Compare commits
14 Commits
3.0.1
...
toplevel-e
Author | SHA1 | Date | |
---|---|---|---|
|
0b0d41dc58 | ||
|
4d795437f1 | ||
|
e40b77b569 | ||
|
f0af03f951 | ||
|
54f81cde17 | ||
|
460be460ec | ||
|
96b954d242 | ||
|
acb71a2fa7 | ||
|
16f1253b77 | ||
|
3630b63b9c | ||
|
0435071747 | ||
|
70796f8475 | ||
|
1ce7cc6202 | ||
|
6a7f0894df |
16
HACKING
16
HACKING
@@ -1,9 +1,9 @@
|
||||
If you want to hack on the GTK+ project, you'll need to have
|
||||
the following packages installed:
|
||||
|
||||
- GNU autoconf 2.62
|
||||
- GNU automake 1.11
|
||||
- GNU libtool 2.2
|
||||
- GNU autoconf 2.54
|
||||
- GNU automake 1.7
|
||||
- GNU libtool 1.4
|
||||
- indent (GNU indent 1.9.1 is known good)
|
||||
- GNU gettext 10.40
|
||||
|
||||
@@ -19,10 +19,10 @@ Information about using git with GNOME can be found here:
|
||||
|
||||
http://live.gnome.org/Git
|
||||
|
||||
In order to get GIT GTK+ installed on your system, you need to have
|
||||
the most recent GIT versions of GLib, Pango, and ATK installed as well.
|
||||
The installation process of these libraries is similar to that of GTK+,
|
||||
but needs to be fulfilled prior to installation of GTK+.
|
||||
In order to get GIT gtk+ installed on your system, you need to have
|
||||
the most recent GIT versions of glib, pango, and atk installed as well.
|
||||
The installation process of these libraries is similar to that of gtk+, but
|
||||
needs to be fulfilled prior to installation of gtk+.
|
||||
|
||||
If at all possible, please use GIT to get the latest development version of
|
||||
gtk+ and glib. You can do the following to get glib and gtk+ from GIT:
|
||||
@@ -37,7 +37,7 @@ have a gnome account, you want to use the following instead:
|
||||
|
||||
$ git clone ssh://<username>@git.gnome.org/git/gtk+
|
||||
|
||||
To compile the GIT version of GTK+ on your system, you will need to take
|
||||
To compile the GIT version of gtk+ on your system, you will need to take
|
||||
several steps to setup the tree for compilation. You can do all these
|
||||
steps at once by running:
|
||||
|
||||
|
14
INSTALL.in
14
INSTALL.in
@@ -9,23 +9,23 @@ GTK+ requires the following packages:
|
||||
GdkPixbuf @GDK_PIXBUF_REQUIRED_VERSION@, ATK @ATK_REQUIRED_VERSION@
|
||||
and cairo @CAIRO_REQUIRED_VERSION@.
|
||||
|
||||
- gobject-introspection @INTROSPECTION_REQUIRED_VERSION@ or newer.
|
||||
- gobject-introspection 0.9.3 or newer.
|
||||
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK+
|
||||
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK+
|
||||
[ Become root if necessary ]
|
||||
% make install # install GTK+
|
||||
% make install # install GTK+
|
||||
|
||||
The Details
|
||||
===========
|
||||
|
||||
Complete information about installing GTK+ and related libraries
|
||||
can be found in the file:
|
||||
Complete information about installing GTK+ and related libraries can be found
|
||||
in the file:
|
||||
|
||||
docs/reference/gtk/html/gtk-building.html
|
||||
|
||||
|
@@ -47,6 +47,7 @@ MAINTAINERCLEANFILES = \
|
||||
$(srcdir)/install-sh \
|
||||
$(srcdir)/ltmain.sh \
|
||||
$(srcdir)/missing \
|
||||
$(srcdir)/mkinstalldirs \
|
||||
$(srcdir)/omf.make \
|
||||
$(srcdir)/xmldocs.make \
|
||||
$(srcdir)/gtk-doc.make \
|
||||
@@ -70,8 +71,8 @@ gtk+-*-3.0-uninstalled.pc: gtk+-3.0-uninstalled.pc
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = gdk-3.0.pc gtk+-3.0.pc gail-3.0.pc
|
||||
|
||||
pkgconfig_DATA += ${GDK_BACKENDS:%=gtk+-%-3.0.pc}
|
||||
pkgconfig_DATA += ${GDK_BACKENDS:%=gdk-%-3.0.pc}
|
||||
pkgconfig_DATA += $(patsubst %,gtk+-%-3.0.pc,@gdktarget@)
|
||||
pkgconfig_DATA += $(patsubst %,gdk-%-3.0.pc,@gdktarget@)
|
||||
|
||||
if OS_UNIX
|
||||
pkgconfig_DATA += gtk+-unix-print-3.0.pc
|
||||
@@ -94,7 +95,8 @@ distclean-local:
|
||||
fi
|
||||
|
||||
ChangeLog:
|
||||
$(AM_V_GEN) if test -d "$(srcdir)/.git"; then \
|
||||
@echo Creating $@
|
||||
@if test -d "$(srcdir)/.git"; then \
|
||||
(GIT_DIR=$(top_srcdir)/.git ./missing --run git log GTK_2_16_0^^.. --stat) | fmt --split-only > $@.tmp \
|
||||
&& mv -f $@.tmp $@ \
|
||||
|| ($(RM) $@.tmp; \
|
||||
|
@@ -17,15 +17,9 @@ XIDS = 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 \
|
||||
1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 \
|
||||
9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 \
|
||||
9995 9996 9997 9998 9999
|
||||
|
||||
if USE_X11
|
||||
SKIP_GDKTARGET = \
|
||||
false
|
||||
else
|
||||
SKIP_GDKTARGET = \
|
||||
echo "Gtk+Tests:INFO: Skipping GUI tests for non-X11 target."
|
||||
endif
|
||||
|
||||
test "$(gdktarget)" != "x11" \
|
||||
&& echo "Gtk+Tests:INFO: Skipping GUI tests for non-X11 target."
|
||||
XVFB_START = \
|
||||
${XVFB} -help 2>/dev/null 1>&2 \
|
||||
&& XID=`for id in $(XIDS) ; do test -e /tmp/.X$$id-lock || { echo $$id; exit 0; }; done; exit 1` \
|
||||
|
373
NEWS
373
NEWS
@@ -1,376 +1,3 @@
|
||||
Overview of Changes in GTK+ 3.0.1
|
||||
=================================
|
||||
|
||||
* A autoconf macro, GTK_CHECK_BACKEND, has been added
|
||||
to allow easy checking for certain gdk backends
|
||||
|
||||
* A number of memory leaks and segfaults involving accessibility
|
||||
have been fixed
|
||||
|
||||
* Bugs fixed:
|
||||
586201 GtkLinkButton doesn't implement neither HyperLink nor...
|
||||
599907 Gail implementation of atk_add_key_event_listener return...
|
||||
626730 Check menu item does not set indeterminate state
|
||||
630971 gailstatusbar attempts to cast a GtkHBox to a GtkBin
|
||||
633291 Handle Shift-keys in X11 gdk_test_simulate_key()
|
||||
642213 gtk_widget_render_icon_pixbuf fails with non-standard...
|
||||
642263 undefined reference to "GTK_IS_SOCKET" and "GTK_IS_PLUG"
|
||||
642541 Missing semi-colon in gtkseparatormenuitem.c
|
||||
642677 "migrating" guide not in sync with GTK+ 3.0
|
||||
642681 gtk_combo_box_text_get_active_text doesn't work as stated
|
||||
642751 Typo in migrating-2to3.xml
|
||||
642771 Fix tiny leak in tracker backend
|
||||
642772 GTK does not correctly process input sent via SendInput...
|
||||
642778 TextView broken for large files
|
||||
642782 gail_misc_buffer_get_run_attributes doesn't set background-gdk...
|
||||
642791 Fix a typo in gtk_socket_notify
|
||||
|
||||
|
||||
* Translation updates:
|
||||
Bengali India
|
||||
British English
|
||||
Bulgarian
|
||||
Hebrew
|
||||
Hungarian
|
||||
Korean
|
||||
Norwegian bokmål
|
||||
Punjabi
|
||||
Spanish
|
||||
Uighur
|
||||
Ukranian
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.0.0
|
||||
=================================
|
||||
|
||||
* Library sonames have been changed from libgdk-3.0 and libgtk-3.0
|
||||
to libgdk-3 and libgtk-3.
|
||||
|
||||
* Bugs fixed:
|
||||
632775 Back / Forward button's icons don't respect RTL settings
|
||||
639846 GdkEventScroll events are sent twice
|
||||
639945 Gtk.Widget does not have drag_* methods (but in pygtk it did)
|
||||
640801 Crash gtk_tree_view_reset_header_styles at gtktreeview.c:11871
|
||||
641196 Fix another GtkFixed regression, in gtk_fixed_forall()
|
||||
641302 show something nicer than XF86AudioMute etc
|
||||
641367 [region] gnome-applications ignore layout switching
|
||||
641409 not chaining up in ::style-updated
|
||||
641429 Errors creating a GtkWidget without a display
|
||||
641431 Apply button goes grey after two mode switching
|
||||
641517 "Migrating from libunique to GtkApplication" examples do not do...
|
||||
641558 GtkCssProvider leaks path string
|
||||
641621 Use faster new G_VALUE_COLLECT_INIT variant instead...
|
||||
641640 Update autotools configuration
|
||||
|
||||
* Translation updates:
|
||||
Arabic
|
||||
English
|
||||
Galician
|
||||
Hebrew
|
||||
Korean
|
||||
Norwegian bokmål
|
||||
Polish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 2.99.3
|
||||
==================================
|
||||
|
||||
* This release adds some forgotten padding to class structs,
|
||||
and thus breaks ABI for a last time before 3.0
|
||||
|
||||
* Many Introspection annotation improvements
|
||||
|
||||
* We no longer build the gtk-update-icon-cache utility, and
|
||||
use a preexisting one, if --enable-gtk2-dependency is passed
|
||||
to configure
|
||||
|
||||
* GtkBuilder can now fill GtkComboBoxText and GtkMenToolButton
|
||||
widgets with data, as well as GtkFileFilters and GtkTextTagTables
|
||||
|
||||
* GtkImage now has a ::use-fallback property to allow generic
|
||||
fallback with GIcons and icon-names (e.g. for symbolic icons)
|
||||
|
||||
* There's a new gtk_text_view_get_cursor_locations() to enable
|
||||
popup-at-cursor functionality
|
||||
|
||||
* The application chooser widgets can now set a custom
|
||||
dialog heading
|
||||
|
||||
* The file chooser and application chooser widgets have received
|
||||
minor visual improvements
|
||||
|
||||
* gtk-auto-mnemonics is now backed by an XSetting
|
||||
|
||||
* Defaults for GtkSettings, as well as theme-specific settings,
|
||||
are now read from key files
|
||||
|
||||
* Key themes are now supported again, their syntax has been changed
|
||||
to be CSS-like
|
||||
|
||||
* More objects use GtkStyleContext directly now:
|
||||
GtkTreeView
|
||||
GtkIconView
|
||||
GtkCellArea
|
||||
GtkCellRendererText
|
||||
GtkCellRendererPixbuf
|
||||
GtkCellRendererAccel
|
||||
GtkCellRendererProgress
|
||||
|
||||
* GtkPlug and GtkSocket have been reduced to X11-specific API, and
|
||||
using them requires including the <gtk/gtkx.h> header, and uses
|
||||
of GdkNativeWindow in their APIs have been replaced by the X11
|
||||
Window type.
|
||||
A number of other API changes were necessary in GDK to ensure
|
||||
that multiple GDK backends can coexist:
|
||||
- GdkNativeWindow has been dropped
|
||||
- The GdkEventOwnerChange owner field is a GdkWindow now
|
||||
- The GdkEventSelection requestor field is a GdkWindow now
|
||||
- The GtkWidget::client_event vfunc is gone
|
||||
- GdkEventClient is gone, together with related API:
|
||||
gdk_add_client_message_filter
|
||||
gdk_display_add_client_message_filter
|
||||
gdk_screen_broadcast_client_message
|
||||
gdk_event_send_client_message
|
||||
gdk_event_send_client_message_for_display
|
||||
gdk_event_send_clientmessage_toall
|
||||
- gdk_drag_get_protocol_for_display has been changed to
|
||||
gdk_window_get_drag_protocol
|
||||
|
||||
* Migration guide and tutorial and other documentation improvements
|
||||
|
||||
* Bug fixes
|
||||
322926 FileChooser: Alt-Shift-Down should work like Alt-Down
|
||||
351755 GTK_RANGE (range) -> round_digits should be exposed...
|
||||
586635 gtk_info_bar_add_button() should return GtkButton*
|
||||
590459 Text is sometimes not pasted at the right location
|
||||
598952 Implement object attribute to expose toolkit/source
|
||||
626336 Warning when activating GtkButton outside of an event...
|
||||
634677 assertion in finalize assuring that buffer is NULL...
|
||||
635287 Specify packages when generating GIR
|
||||
636691 Rendering icons with prelight state doesn't...
|
||||
638920 gail should provide toolkit as an AtkAttribute
|
||||
639139 Subclassing GtkIconView broken lately in master
|
||||
639186 gtk_paper_size_new fails to recognize valid name
|
||||
639325 Generated introspection broken
|
||||
639380 Critical warnings when detaching tab
|
||||
639455 accel cell renderer critical warning
|
||||
639520 Update docs about colormap to use visual instead.
|
||||
639531 No error is given when attempting to save to "nonexistent...
|
||||
639625 Crashes on dereferencing a NULL GtkBorder.
|
||||
639750 Support css3 colors
|
||||
639754 Must widget class names begin with uppercase letter?
|
||||
639767 password not accepted in gnome-screensaver dialog
|
||||
639792 Regional panel: "Add" dialog: combos not sorted
|
||||
639822 Synthesized button2/button3 does not transfer source_device
|
||||
639845 insensitive and separator items in comboboxes not working...
|
||||
639931 gtk_application_add_window() docs should mention window destr...
|
||||
639949 pygobject leaks references on GtkWindows
|
||||
640005 removable media dialog should use app names
|
||||
640006 choose app dialog shows other apps by default
|
||||
640011 Selects application on cancel
|
||||
640105 Crash showing a offscreen window with a textview inside
|
||||
640161 GtkFileChooserWidget 0xbbf6c0 is mapped but visible=1...
|
||||
640188 gdk_pixbuf_get_from_drawable missing from migration guide
|
||||
640195 gdk_cairo_create gets cairo context with badly clipped...
|
||||
640282 insensitive, active check button becomes sensitive
|
||||
640313 BadDevice X error when ungrabbing a SLAVE device
|
||||
640391 Display lines between rows when window is focused
|
||||
640487 crash on gtk_statusbar_remove_all()
|
||||
640698 Incompatibility in 'matched-selected' signal invocation
|
||||
640712 GtkAssistant fonts are too big
|
||||
640744 mount-operation: don't show the dialog until the tree...
|
||||
640902 X11 headers included by default in public headers
|
||||
640965 XCompose does not work with GTK+ 2.99.x
|
||||
640983 GtkSettings: Fix theme not updating for dark theme
|
||||
640999 GtkSpinner Class check macro is invalid
|
||||
641023 assertion `hash_table != NULL' failed in gtkplug.c
|
||||
641039 Cannot expand/collapse nodes by mouse
|
||||
641042 assertion `G_IS_OBJECT (object) in gdkevents.c
|
||||
641059 Fix several bugs handling GtkTrayIcon symbolic colors
|
||||
641073 Please be consistent with GtkEntryCompletion
|
||||
641176 Fix crash in gtk_fixed_remove()
|
||||
|
||||
* Translation updates
|
||||
Arabic
|
||||
Basque
|
||||
Catalan
|
||||
Chinese
|
||||
Esperanto
|
||||
Estonian
|
||||
Galician
|
||||
German
|
||||
Greek
|
||||
Hebrew
|
||||
Italian
|
||||
Kazakh
|
||||
Norwegian bokmål
|
||||
Persian
|
||||
Punjabi
|
||||
Spanish
|
||||
Uighur
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 2.99.2
|
||||
==================================
|
||||
|
||||
* More widget are using GtkStyleContext directly:
|
||||
GtkToolItemGroup, GtkMenuItem, GtkImageMenuItem, GtkMenu,
|
||||
GtkTearoffMenuItem, GtkCheckMenuItem, GtkMenuShell
|
||||
|
||||
* gtk-builder-convert now accepts a --target-version option
|
||||
|
||||
* Bug fixes:
|
||||
637965 GtkTreeCellDataFunc called with a wrong column arguments
|
||||
639127 Misc Win32 GDK building problems
|
||||
639157 GtkOrientable should add/remove "horizontal" and "vert...
|
||||
639209 Allow toggling the GtkSwitch by clicking the handle
|
||||
639286 include gtk/gtktextattributes.h not installed
|
||||
639327 gtk-builder-convert needs to convert gtkcomboboxentry...
|
||||
|
||||
* Translation updates:
|
||||
Arabic
|
||||
Basque
|
||||
Hebrew
|
||||
|
||||
Overview of Changes from GTK+ 2.99.0 to 2.99.1
|
||||
==============================================
|
||||
|
||||
* More widgets are using GtkStyleContext directly:
|
||||
GtkColorButton, GtkColorSelection, GtkHSV,
|
||||
GtkFontSelection, GtkPrintUnixDialog, GtkImage,
|
||||
GtkLayout, GtkViewport, GtkTextDisplay, GtkTextUtil,
|
||||
GtkCalendar
|
||||
|
||||
* GtkBuilder support has been added for setting menus
|
||||
on GtkMenuToolButtons and for adding tags to
|
||||
GtkTextTagTable as well as adding items to
|
||||
GtkComboBoxText
|
||||
|
||||
* Bug fixes:
|
||||
350618 start rubber banding on "white space"
|
||||
612918 Support disabling X11 extensions
|
||||
635687 problem with pygtk or gtk with gtk.Plug and gtk.Socket...
|
||||
638017 GtkTextView: Crash in gtk_text_view_set_tabs()
|
||||
638119 GtkSpinner animation not correctly stopped...
|
||||
638880 Need a setter for has_user_ref_count
|
||||
639030 Small cleanup in gailtextview code.
|
||||
639047 Fix remaining usage of g[dk]ktargetlib.
|
||||
639079 Obtain the fg color from the renderer
|
||||
639105 Port GtkTextDisplay to StyleContext.
|
||||
639106 New CSS style misses distinction between "selected focused"...
|
||||
639127 Misc Win32 GDK building problems
|
||||
639157 GtkOrientable should add/remove "horizontal" and "vertical"...
|
||||
|
||||
* Translation updates:
|
||||
British English
|
||||
Galician
|
||||
Hebrew
|
||||
Indonesian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.91.7 to 2.99.0
|
||||
==============================================
|
||||
|
||||
* Deprecations and removals:
|
||||
- Long-obsolete linuxfb-related GtkWindow APIs have been dropped
|
||||
- All remaining G_SEALed struct members have been removed
|
||||
- GtkThemeEngine has been removed
|
||||
- gdk_display_get_window_at_device_position() has been renamed to
|
||||
gdk_device_get_window_at_position()
|
||||
- gdk_display_get_device_state() has been renamed to
|
||||
gdk_device_get_position()
|
||||
- gdk_device_set_source() has been dropped
|
||||
- gdk_set_pointer_hooks(), gdk_display_set_pointer_hooks() and
|
||||
gdk_display_set_device_hooks() have been removed
|
||||
- The deprecated GtkNotebook:tab-pack child property has been removed
|
||||
- The deprecated gtk_quit_add() functions have been removed
|
||||
- The GtkRange update-policy facility has been removed
|
||||
|
||||
* The gtk-update-icon-cache and gtk-builder-convert utilities have
|
||||
been renamed back to their un-suffixed names. Distributions will
|
||||
have to resolve the conflict between GTK+ 2.x and 3.0 packages
|
||||
by dropping one set of the utilities and adding a dependency.
|
||||
|
||||
* It is now possible to include multiple GDK backends in a single
|
||||
library. The --with-gdk-backend option has been split into separate
|
||||
--enable-{x11,win32,quartz}-backend options.
|
||||
|
||||
* The GDK Quartz backend has been ported to the new GDK backend API
|
||||
|
||||
* A number of widgets have been ported to use GtkStyleContext directly:
|
||||
GtkAccelLabel, GtkArrow, GtkSeparator, GtkSpinButton, GtkMessageDialog,
|
||||
GtkFrame, GtkEventBox, GtkScrolledWindow, GtkProgressBar, GtkEntry,
|
||||
GtkFileChooserEntry, GtkSwitch, GtkHandleBox, GtkToolbar, GtkFixed,
|
||||
GtkToolPalette, GtkAboutDialog, GtkAssistant, GtkTrayIcon, GtkPaned,
|
||||
GtkToolButton, GtkSocket, GtkRecentChooser, GtkTooltip, GtkPathBar,
|
||||
GtkWin32EmbedWidget, GtkCellView, GtkDialog, GtkDrawingArea, GtkPlug,
|
||||
GtkEntryCompletion, GtkFileChooserButton, GtkFileChooser, GtkHandleBox,
|
||||
GtkLinkButton, GtkOffscreenWindow
|
||||
|
||||
* Various problems with width-for-height geometry management have been
|
||||
fixed in GtkAlignment, GtkCheckButton, GtkBin
|
||||
|
||||
* The GtkComboBox, GtkIconView and GtkCellView widgets have been ported
|
||||
to use GtkCellArea for their cell layouts
|
||||
|
||||
* The cups print backend can now send print jobs directly in PDF if
|
||||
cups supports it
|
||||
|
||||
* GtkNumerableIcon is a variant of GEmblemedIcon for using numbers
|
||||
as emblems
|
||||
|
||||
* Bugs fixed:
|
||||
144324 Leaking dnd contexts with XDnD
|
||||
165987 unsets DESKTOP_STARTUP_ID
|
||||
307963 GtkSpinButton clamps value with the wrong maximum.
|
||||
321958 gtk.Calendar Notes should also say the format of year
|
||||
533745 Segfault on gdk.DragContext.drag_get_selection()
|
||||
553404 Out-of-date comment in gtk_text_view_add_child_in_window()
|
||||
559503 Description should mention gregorian
|
||||
560177 Applications should send print jobs to CUPS in PDF format...
|
||||
562182 gtk_init() docs inaccurate
|
||||
599130 Ending a drag using space or enter doesn't always cause a...
|
||||
617312 Move documentation to inline comments: GtkDialog
|
||||
617315 Move documentation to inline comments: GtkDrawingArea
|
||||
617322 Move documentation to inline comments: GtkEntryCompletion
|
||||
617327 Move documentation to inline comments: GtkExpander
|
||||
617471 Migrate API docs from templates to source files...
|
||||
621720 Use $(AM_V_GEN) to silent the build a bit.
|
||||
622125 Note that gtk_show_uri needs gvfs to spawn URLs
|
||||
629955 Deprecate/remove gtk_main and gtk_init_add/remove* API
|
||||
633795 gdk_event_get_state wrongly extracts GDK_PROPERTY_NOTIFY...
|
||||
634711 Xlib warning when RANDR is missing
|
||||
635299 add gtk_selection_data_get_data_with_length API...
|
||||
637691 Eating events breaks proxied DND
|
||||
637721 gtk 2.91.6 issue with gtkcellrendererprogress
|
||||
637736 [GtkAboutDialog] Newlines are ignored in translator-credits
|
||||
637763 [GtkAboutDialog] no longer display contact link
|
||||
637834 gtk_widget_verify_invariants: relax toplevel checks
|
||||
637849 Shell segfaults when unicode characters after U+00FF...
|
||||
637895 gdk_pointer_grab() deprecated comment is not helpful enough
|
||||
637907 gtkwindow.h includes a private header
|
||||
637910 GtkSpinner - does not animate
|
||||
637958 print dialog doesn't fit on netbook screen size
|
||||
637974 Gtk+ 2.91.7 build of introspection fails
|
||||
638179 in draw signal handle call gtk_style_context_add_provider...
|
||||
638193 GtkSpinButton documentation out of date
|
||||
638231 GtkSwitch states translation
|
||||
638386 gdk_x11_display_init_input careless
|
||||
638580 'application' window's property released too late
|
||||
638608 gtkenums: add GTK_STATE_FLAG_NORMAL = 0
|
||||
|
||||
* Updated translations:
|
||||
Estonian
|
||||
Kurdish
|
||||
Norwegian bokmål
|
||||
Punjabi
|
||||
Spanish
|
||||
Swedish
|
||||
Uighur
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.91.6 to 2.91.7
|
||||
==============================================
|
||||
|
||||
|
436
README.in
436
README.in
@@ -27,20 +27,434 @@ Installation
|
||||
See the file 'INSTALL'
|
||||
|
||||
|
||||
Release notes for 3.0
|
||||
Release notes for 2.20
|
||||
======================
|
||||
|
||||
* GtkStatusbar now has a message area (see gtk_status_bar_get_message_area)
|
||||
which makes it easy to place additional widgets inside the statusbar
|
||||
frame or to replace the label widgets. Previously, this was only possible
|
||||
by accessing the innards of the statusbar widget directly. Applications
|
||||
which are doing so may need some adjustments, since the addition of the
|
||||
message area changed the internal widget hierarchy.
|
||||
|
||||
* GtkBuilder no longer sets the "name" property of widgets to the ID
|
||||
attribute of the <object>. Use gtk_buildable_get_name() instead of
|
||||
gtk_widget_get_name() to obtain the ID.
|
||||
|
||||
* GTK+ now includes introspection data, as a consequence, it gained a
|
||||
dependency on gobject-introspection. It is possible to build without
|
||||
introspection by passing --disable-introspection to configure.
|
||||
|
||||
|
||||
Release notes for 2.18
|
||||
======================
|
||||
|
||||
* gtk_tooltip_set_custom now accept a NULL custom_widget to unset the
|
||||
old custom_widget. Custom_widget does not get destroyed when the
|
||||
tooltip goes away.
|
||||
|
||||
* JPEG2000 support is no longer enabled by default. It must be
|
||||
explicitly turned on, by passing --with-libjasper to configure.
|
||||
|
||||
* GDK has been reworked to implement 'client-side windows'. This offers
|
||||
exciting new possibilities, such as transformed, offscreen rendering,
|
||||
but it breaks some long-standing assumptions that applications may
|
||||
have about GDK windows. Setting the environment variable
|
||||
GDK_NATIVE_WINDOWS makes GDK create a native X11 window for each
|
||||
GDK window, which might make problematic applications work better.
|
||||
|
||||
* GTK+ calls signal (SIGPIPE, SIG_IGN) during initialization, to ignore
|
||||
SIGPIPE signals, since these are almost never wanted in graphical
|
||||
applications. If you do need to handle SIGPIPE for some reason, reset
|
||||
the handler after gtk_init(), but notice that other libraries (e.g.
|
||||
libdbus or gvfs) might do similar things.
|
||||
|
||||
Release notes for 2.16
|
||||
======================
|
||||
|
||||
* Password entries now display a caps-lock warning. This can be turned off
|
||||
with the caps-lock-warning property.
|
||||
|
||||
* Various orientation-related functions have been deprecated in favour
|
||||
of the new GtkOrientable interface: gtk_scale_button_get_orientation,
|
||||
gtk_scale_button_set_orientation, gtk_toolbar_set_orientation.
|
||||
|
||||
* The action-proxy interaction has been changed. Widgets that operate as
|
||||
proxies have to implement the GtkActivatable interface now. GtkActivatable
|
||||
implementation are responsible for syncing their appearance with the
|
||||
action and for activating the action. All GTK+ widgets that are commonly
|
||||
used as proxies implement the GtkActivatable interface.
|
||||
|
||||
* The handling of keyboard shortcuts has been changed, to help with a
|
||||
longstanding complaint about the way GTK+ handles multiple layouts. GTK+
|
||||
now only uses keys from groups other than the current group if they are
|
||||
not present in the current group.
|
||||
|
||||
Release notes for 2.14
|
||||
======================
|
||||
|
||||
* gtkitemfactory.h is now completely deprecated.
|
||||
As gtkactiongroup.h and gtkstock.h no longer include the gtkitemfactory.h
|
||||
header, this might break application using gtk_item_factory_* symbols
|
||||
without including gtkitemfactory.h - even though this behaviour has never
|
||||
been supported in the first place.
|
||||
|
||||
* The GtkFileSystem semi-private interface has been removed.
|
||||
The GTK+ filechooser implementation now uses GIO directly, which has
|
||||
rendered external filesystem implementations unnecessary. Consequently,
|
||||
the GtkFileSystem interface is no longer available, nor the filechooser
|
||||
will load any GtkFileSystem implementation.
|
||||
|
||||
* GtkComboBox now renders the popdown button insensitive when
|
||||
the model is empty. Applications which want to populate the list
|
||||
only before displaying it can set gtk_combo_box_set_button_sensitivity
|
||||
to GTK_SENSITIVITY_ON, so that the button is always sensitive or
|
||||
GTK_SENSITIVITY_OFF to make it insensitive respectively.
|
||||
|
||||
* GtkAdjustment now enforces that values are restricted to the
|
||||
range [lower, upper - page_size]. This has always been the documented
|
||||
behaviour, and the recommended practice is to set page_size to 0
|
||||
when using adjustments for simple scalar values, like in a slider
|
||||
or spin button.
|
||||
|
||||
* gdk-pixbuf will use GIO for mime type detection if possible. For
|
||||
this to work, shared-mime-info needs to be installed and XDG_DATA_DIRS
|
||||
set accordingly at configure time. Otherwise, gdk-pixbuf falls
|
||||
back to its built-in sniffing implementation.
|
||||
|
||||
Release notes for 2.12
|
||||
======================
|
||||
|
||||
* gtk_about_dialog_get/set_name() were deprecated in favour of
|
||||
gtk_about_dialog_get/set_program_name(), the GtkAboutDialog now uses the
|
||||
"program-name" property instead of the conflicting "name" property.
|
||||
|
||||
* The gdk-pixbuf tiff loader now requires libtiff 3.6.0 or later.
|
||||
|
||||
* Support for Windows 9x/ME has officially been removed. It hasn't worked
|
||||
since 2.6 anyway.
|
||||
|
||||
* The GtkTextBufferTargetInfo enumeration values have been changed from
|
||||
G_MAXUINT-0, G_MAXUINT-1, G_MAXUINT-2, etc, to -1, -2, -3 to stay within
|
||||
ANSI C limits.
|
||||
|
||||
* A change in the handling of _NET_WM_USER_TIME properties on toplevel
|
||||
windows can cause deadlock problems with window managers that are using
|
||||
GDK for drawing decorations. In particular, metacity <= 2.18.0 is affected
|
||||
by this. The problem has been fixed in metacity 2.18.1.
|
||||
|
||||
* Semi-private GtkTextLayout api has changed: new GtkTextLayout method
|
||||
invalidate_cursors(), and new functions gtk_text_layout_invalidate_cursors()
|
||||
and gtk_text_layout_cursors_changed(), which should be used in place of
|
||||
gtk_text_layout_invalidate() and gtk_text_layout_changed() if invalidation
|
||||
is due to marks moved or changed selection; new GtkTextLineDisplay structure
|
||||
member. Source compatibility is preserved; binary compatibility may break
|
||||
only if GtkTextLineDisplay structure was created on stack or as a part
|
||||
of another structure (in particular GnomeCanvas and its clones do not need
|
||||
recompiling).
|
||||
|
||||
* Another new signal has been added to GtkNotebook. The new signal
|
||||
is called create-window, so this name can no longer be used for signals
|
||||
in objects derived from GtkNotebook.
|
||||
|
||||
* The gtk_notebook_set/get_group_id() functions were found to be insufficient
|
||||
and have been deprecated in favour of gtk_notebook_set/get_group().
|
||||
|
||||
* The move-focus signal has been moved to GtkWidget, to unify the
|
||||
various implementations of this signal in specific widgets. Great care
|
||||
has been taken to make sure that all code using this signal continues
|
||||
to work.
|
||||
|
||||
* An unused and hardly visible GtkFrame has been removed from the menu
|
||||
widget hierarchy when GtkComboBox::appears-as-list style property is
|
||||
set. Any RC file applying a different style to any widget below the
|
||||
widget path "gtk-combobox-popup-window.GtkFrame" should take into
|
||||
account that the frame no longer exists.
|
||||
|
||||
* The external print preview application used by GtkPrintOperationPreview
|
||||
is now passed the print settings on the command line with the
|
||||
--print-settings parameter pointing to a temp file containing the
|
||||
settings. The preview application assumes ownership of the file and
|
||||
should delete it once it does not need it anymore. The --print-settings
|
||||
commandline option is understood by Evince 0.9.0 and newer. To use a
|
||||
different print preview application, change the gtk-print-preview-command
|
||||
setting in your gtkrc file, e.g. gtk-print-preview-command = "ggv %f"
|
||||
|
||||
* GtkMenuShell is now defined as an abstract type. It was already
|
||||
documented as an abstract class, and there is little reason to
|
||||
instantiate it.
|
||||
|
||||
* The GtkTooltips struct (this is the old tooltips API) is now considered
|
||||
private. Code that used to access this struct, in particular the
|
||||
tips_data_list field, will need to change. All of the old tooltips
|
||||
API has been deprecated in favour of a new implementation and
|
||||
API. This affects all of the gtk_tooltips_ functions, and functions
|
||||
which take a GtkTooltips argument, such as gtk_tool_item_set_tooltip()
|
||||
and gtk_menu_tool_button_set_arrow_tooltip().
|
||||
|
||||
* The memory management of the GtkRecentManager object has been changed,
|
||||
as using the screen didn't guarantee that the singleton instance was
|
||||
correctly destroyed. The screen-related functions have been deprecated,
|
||||
and should not be used anymore; the GtkRecentManager instance returned by
|
||||
the gtk_recent_manager_get_default() function is guaranteed to be valid
|
||||
for the entire lifetime of an application.
|
||||
|
||||
* A number of interfaces that have been superseded by newer interfaces for
|
||||
a long time have finally been deprecated. This includes
|
||||
gtk_widget_ref/unref(), gtk_rc_style_ref/unref() and the old file selector.
|
||||
|
||||
* The various coordinate systems in use in GtkTreeView widgets have
|
||||
been clarified in the documentation, and in the cause of doing so,
|
||||
the functions gtk_tree_view_widget_to_tree_coords() and
|
||||
gtk_tree_view_tree_to_widget_coords() have been deprecated in
|
||||
favour of a new family of gtk_tree_view_convert_ functions.
|
||||
|
||||
* gtk_menu_item_remove_submenu() has been deprecated in favour of
|
||||
gtk_menu_item_set_submenu (..., NULL).
|
||||
|
||||
* gtk_default_draw_check() has been fixed to really decrease the
|
||||
indicator size by one pixel to ensure an odd size instead of
|
||||
accidentially increasing it.
|
||||
Consequently, gtk_cell_renderer_toggle_render() could be fixed to
|
||||
not subtract 1 from the size passed to gtk_paint_option(), which
|
||||
was just a workaround for above off-by-two for even sizes (theme
|
||||
engines now get the real indicator size passed).
|
||||
The default toggle size of GtkCheckMenuItem and GtkCellRendererToggle
|
||||
has been changed to 13 to be consistent with GtkCheckButton.
|
||||
The only visible change with default settings is that the indicator in
|
||||
GtkCellRendererToggle has changed its size from 11 to 13 and is now
|
||||
consistent with menus and toggle buttons.
|
||||
|
||||
* GTK+ has always required that gtk_init() (or a variant thereof) is
|
||||
called before any other GTK+ function. Some applications call functions
|
||||
like gtk_clipboard_get() to check if they need to call gtk_init(),
|
||||
anyway. A change in GLib 2.14 has recently broken this unsupported
|
||||
practise. It is worth pointing out that calling gtk_init() twice
|
||||
does no harm.
|
||||
|
||||
|
||||
Release notes for 2.10
|
||||
======================
|
||||
|
||||
* The hexadecimal Unicode input feature has been reworked. It no longer
|
||||
blocks the use of the sixteen Ctrl-Shift-<hex digit> key sequences. Now
|
||||
it only uses Ctrl-Shift-u.
|
||||
|
||||
* A memory leak in GtkStyle handling has been fixed. This may expose bugs
|
||||
in third-party widgets which forget to call gtk_style_attach() in their
|
||||
realize functions.
|
||||
|
||||
* Range widgets like GtkScrollbar now render their arrows insensitive
|
||||
when the slider is at the end. Applications which react to arrow
|
||||
clicks even if the slider is at the end may want to use the new
|
||||
gtk_range_set_[upper/lower]_stepper_sensitivity() functions to
|
||||
prevent the arrows from being rendered insensitive.
|
||||
|
||||
* GtkObject now uses the "floating reference" support in GObject.
|
||||
GTK_OBJECT_IS_FLOATING() will still work, but direct checking
|
||||
of the GTK_FLOATING flag will no longer detect the floating
|
||||
reference. Details about floating references can be found in the docs:
|
||||
http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#floating-ref
|
||||
|
||||
* Accelerators like (_F) are now stripped from labels when they are
|
||||
displayed in toolbars. If this is not wanted, the feature can be
|
||||
suppressed by inserting a Unicode control character, e.g ZWNJ.
|
||||
|
||||
* The pixbuf theme engine can now customize expanders (in GtkTreeView
|
||||
and GtkExpander) and resize grips, using the new EXPANDER and
|
||||
RESIZE_GRIP function values.
|
||||
|
||||
* Dialogs created by gtk_about_dialog_new() no longer hide automatically
|
||||
when the user clicks close. It is the applications responsibility to
|
||||
hide or destroy the dialog.
|
||||
|
||||
* Several new signals have been added to GtkNotebook. Care has been taken
|
||||
to choose signal names which do not collide with signals added by well-known
|
||||
derived classes. The names which can no longer be used for signals in
|
||||
objects derived from GtkNotebook are page-reordered, page-removed and
|
||||
page-added.
|
||||
|
||||
* Due to the interface changes in the file chooser backend interface,
|
||||
the GTK+ ABI version has been bumped to 2.10.0. Third-party filesystem
|
||||
backends have to be ported to the new interface, other modules, such as
|
||||
theme engines, input method modules or pixbuf loaders have to be rebuilt
|
||||
so that they are installed in the right place for GTK+ to find them.
|
||||
|
||||
|
||||
Release notes for 2.8
|
||||
=====================
|
||||
|
||||
* GTK+ 3 is a major new version of GTK+, which is parallel installable
|
||||
with GTK+ 2.x. For information about porting applications from GTK+ 2.x
|
||||
to GTK+ 3, see the file:
|
||||
* GTK+ 2.8 and Pango 1.10 require the cairo library.
|
||||
|
||||
docs/reference/gtk/html/migrating.html
|
||||
* The default theme has been renamed to "Raleigh". Existing configurations
|
||||
specifying the "Default" theme name should still work.
|
||||
|
||||
Or online at:
|
||||
* The GtkTreeView::enable-search property has been changed to control
|
||||
only typeahead search, not the C-f keybinding to start an interactive
|
||||
search. To turn off interactive searching completely, you have to
|
||||
set GtkTreeView::search-column to -1.
|
||||
|
||||
http://library.gnome.org/devel/gtk/3.0/migrating.html
|
||||
* The restriction on using the same cell renderer in multiple columns
|
||||
of a GtkTreeView is now more strictly enforced.
|
||||
|
||||
* Note that the library sonames in this release have been changed from
|
||||
libgtk-3.0 and libgdk-3.0 to libgtk-3 and libgdk-3, to prevent the
|
||||
library versions from going backwards, compared to the 2.90/91/99
|
||||
releases. Applications will have to be recompiled.
|
||||
* In GTK+ 2.8, GtkCalendar uses nl_langinfo() (if available) to determine
|
||||
the first day of the week. Thus, it is possible to select the first day
|
||||
of the week independently from the language, by setting LC_TIME.
|
||||
|
||||
* In GTK+ 2.8, the gtk-update-icon-cache utility includes image data
|
||||
in the icon caches, which will make the icon cache files larger than
|
||||
the one produced by GTK+ 2.6. This change will reduce the memory
|
||||
overhead of icon themes at runtime, since all GTK+ applications can
|
||||
share the image data in memory.
|
||||
|
||||
* In 2.8, GDK emits GdkEventGrabBroken events when a keyboard or pointer
|
||||
grab is broken. On X11, this can happen if the same application grabs
|
||||
again, or if the window used for the grab becomes unviewable. It happens
|
||||
more often on Win32. Applications which use grabs should pay attention
|
||||
to these events and do the necessary cleanups when the grab is lost.
|
||||
* The GIOChannel code for sockets on win32 has been rewritten.
|
||||
Applications who make non-trivial use of GIOChannels on win32 should
|
||||
be watched for possible problems.
|
||||
|
||||
* GLib 2.8 uses atomic operations to implement reference counting, thus
|
||||
g_object_ref/unref, g_closure_ref/sink/unref and g_iochannel_ref/unref
|
||||
can be used without locking in multithreaded applications. Note that
|
||||
other modifications, like concurrent setting of properties still require
|
||||
locking.
|
||||
|
||||
* g_convert() and related character set conversion functions have been
|
||||
fixed to emit pending shift states and to not cache iconv descriptors
|
||||
across multiple calls, since that is problematic for some encodings.
|
||||
Note that these functions are not suitable for streaming conversions;
|
||||
use g_iconv() to do streaming conversion.
|
||||
|
||||
|
||||
Release notes for 2.6
|
||||
=====================
|
||||
|
||||
* GTK+ 2.6 supports clipboard persistency. To make use of this feature,
|
||||
a clipboard manager following the specification at
|
||||
http://www.freedesktop.org/wiki/Standards/clipboard-manager-spec
|
||||
must be running. A sample implementation of such a clipboard manager
|
||||
is available at
|
||||
http://people.imendio.com/andersca/archives/clipboard-manager-0.3.tar.gz
|
||||
Applications can use the function gdk_display_supports_clipboard_persistence()
|
||||
to find out if clipboard persistence is available.
|
||||
|
||||
* Notification on clipboard ownership changes via GdkOwnerChange events
|
||||
requires the XFIXES X extension. Applications can use the function
|
||||
gdk_display_supports_selection_notification() to find out if ownerchip
|
||||
change notification is available.
|
||||
|
||||
* The icon theme code in GTK+ 2.6 follows the freedesktop.org icon theme
|
||||
specification. Setting the XDG_DATA_DIRS environtment variable may be
|
||||
necessary if your icons aren't installed in the default location
|
||||
/usr/share/icons.
|
||||
|
||||
* The icon theme code in GTK+ 2.6 can make use of mmap()able cache files
|
||||
to avoid a lot of disk searching overhead. GTK+ includes a utility named
|
||||
gtk-update-icon-cache to generate these cache files. For further details,
|
||||
see the gtk-update-icon-cache man page or the GTK+ documentation.
|
||||
|
||||
* To reduce code size and improve efficiency, GTK+, when compiled
|
||||
with the GNU toolchain, has separate internal and external entry
|
||||
points for exported functions. The internal names, which begin with
|
||||
IA__, may be seen when debugging a GTK+ program.
|
||||
|
||||
* The following functions have been deprecated in GTK+ 2.6:
|
||||
gdk_pango_context_set_colormap
|
||||
gtk_cell_renderer_editing_canceled
|
||||
|
||||
* The new GtkFileChooser widget emphasizes simplicity and thus does
|
||||
not provide a navigation entry by default when opening files.
|
||||
Experienced command line users will likely want to make heavy use of
|
||||
the location dialog brought up by the Control-L key shortcut.
|
||||
|
||||
* The GTK+ libraries use an '_' prefix to indicate private symbols that
|
||||
must not be used by applications. On some platforms, symbols beginning
|
||||
with prefixes such as _gtk, _gdk, and _pango will be exported
|
||||
from the library, on others not. In no case can applications
|
||||
use these private symbols. In addition to that, GTK+ 2.6 makes several
|
||||
symbols private which were not in any installed header files and
|
||||
were never intended to be exported.
|
||||
|
||||
* The gdk_pixbuf_xlib library included in the contrib/ directory
|
||||
and the framebuffer GDK backend included in the gdk/linux-fb directory
|
||||
of GTK+ are provided on an as-is basis and have not been tested at all.
|
||||
No guarantees about the degree of workingness or about future
|
||||
compatibility are provided.
|
||||
|
||||
* On Unix, the assumption of GLib and GTK+ by default is that filenames on
|
||||
the filesystem are encoded in UTF-8 rather than the encoding of the locale;
|
||||
the GTK+ developers consider that having filenames whose interpretation
|
||||
depends on the current locale is fundamentally a bad idea.
|
||||
|
||||
If you have filenames encoded in the encoding of your locale, then you
|
||||
may want to set the G_FILENAME_ENCODING environment variable:
|
||||
|
||||
G_FILENAME_ENCODING=@locale
|
||||
export G_FILENAME_ENCODING
|
||||
|
||||
(Earlier versions of GLib 2.x required a different environment variable
|
||||
setting; G_BROKEN_FILENAMES=1 to achieve the same effect; this
|
||||
is still supported, but G_FILENAME_ENCODING is preferred.)
|
||||
Best integration of GTK+ 2.6 with the environment is achieved by
|
||||
using a UTF-8 locale.
|
||||
|
||||
On Windows, filenames passed to GTK+ should always be in UTF-8, as
|
||||
in GLib 2.6. This is different than in previous versions of GTK+
|
||||
where the system codepage was used. As in GLib, for DLL ABI
|
||||
stability, applications built against previous versions of GTK+ will
|
||||
use entry points providing the old semantics.
|
||||
|
||||
When compiling against GTK+ 2.6, applications intended to be
|
||||
portable to Windows must take the UTF-8 file name encoding into
|
||||
consideration, and use the gstdio wrappers to access files whose
|
||||
names have been constructed from strings returned from GTK+ or GLib.
|
||||
|
||||
|
||||
How to report bugs
|
||||
==================
|
||||
|
||||
Bugs should be reported to the GNOME bug tracking system.
|
||||
(http://bugzilla.gnome.org, product gtk+.) You will need to create an
|
||||
account for yourself.
|
||||
|
||||
In the bug report please include:
|
||||
|
||||
* Information about your system. For instance:
|
||||
|
||||
- What operating system and version
|
||||
- What version of X
|
||||
- For Linux, what version of the C library
|
||||
|
||||
And anything else you think is relevant.
|
||||
|
||||
* How to reproduce the bug.
|
||||
|
||||
If you can reproduce it with one of the tests or demos built with GTK+,
|
||||
such as demos/gtk-demo/gtk-demo, that would be most convenient. Otherwise,
|
||||
please include a short test program that exhibits the behavior. As a
|
||||
last resort, you can also provide a pointer to a larger piece of software
|
||||
that can be downloaded.
|
||||
|
||||
* If the bug was a crash, the exact text that was printed out when the
|
||||
crash occured.
|
||||
|
||||
* Further information such as stack traces may be useful, but is not
|
||||
necessary. If you do send a stack trace, and the error is an X error,
|
||||
it will be more useful if the stacktrace is produced running the test
|
||||
program with the --sync command line option.
|
||||
|
||||
|
||||
Patches
|
||||
=======
|
||||
|
||||
Patches should also be submitted to bugzilla.gnome.org. If the patch
|
||||
fixes an existing bug, add the patch as an attachment to that bug
|
||||
report.
|
||||
|
||||
Otherwise, enter a new bug report that describes the patch, and attach
|
||||
the patch to that bug report.
|
||||
|
||||
Patches should be in unified diff form. (The -up option to GNU diff.)
|
||||
|
@@ -85,7 +85,7 @@ LDFLAGS="-L/devel/dist/${ARCH}/${LIBPNG}/lib \
|
||||
LIBS=-lintl \
|
||||
CFLAGS=-O2 \
|
||||
./configure \
|
||||
--enable-win32-backend \
|
||||
--with-gdktarget=win32 \
|
||||
--disable-gdiplus \
|
||||
--with-included-immodules \
|
||||
--without-libjasper \
|
||||
|
@@ -6,18 +6,17 @@ first need to use some Unix-like environment or manual work to expand
|
||||
the files needed, like config.h.win32.in into config.h.win32 and the
|
||||
.vcprojin files here into corresponding actual .vcproj files.
|
||||
|
||||
You will need the parts from below in the GTK+ stack: gdk-pixbuf, pango,
|
||||
atk and glib. External dependencies are at least zlib, libpng,
|
||||
proxy-libintl, fontconfig, freetype, expat. See the corresponding
|
||||
README.txt file in glib for details where to unpack them.
|
||||
You will need the parts from below in the GTK+ stack: pango, atk and
|
||||
glib. External dependencies are at least zlib, libpng, proxy-libintl,
|
||||
fontconfig, freetype, expat. See the corresponding README.txt file in
|
||||
glib for details where to unpack them.
|
||||
|
||||
The "install" project will copy build results and headers into their
|
||||
appropriate location under <root>\vs9\<PlatformName>. For instance,
|
||||
built DLLs go into <root>\vs9\<PlatformName>\bin, built LIBs into
|
||||
<root>\vs9\<PlatformName>\lib and GTK+ headers into
|
||||
<root>\vs9\<PlatformName>\include\gtk-3.0. This is then from where
|
||||
<root>\vs9\<PlatformName>\include\gtk-2.0. This is then from where
|
||||
project files higher in the stack are supposed to look for them, not
|
||||
from a specific GLib source tree.
|
||||
|
||||
--Tor Lillqvist <tml@iki.fi>
|
||||
--Updated by Chun-wei Fan <fanc999 --at-- yahoo --dot-- com --dot-- tw>
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -52,7 +52,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -72,7 +72,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -93,7 +93,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -122,24 +122,29 @@
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkapplaunchcontext-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkcolor-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkcursor-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdevice-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdevice-wintab.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdevicemanager-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdisplay-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdnd-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdrawable-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkevents-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkfont-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkgc-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkgeometry-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkglobals-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkim-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkinput-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkinput.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkkeys-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkmain-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkpixmap-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkproperty-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkscreen-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkselection-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkspawn-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdktestutils-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkvisual-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdisplaymanager-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkwin32id.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkwindow-win32.c" />
|
||||
</Filter>
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -42,7 +42,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="imm32.lib"
|
||||
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib imm32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gdk.def"
|
||||
@@ -63,7 +63,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GdkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -72,7 +72,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="imm32.lib"
|
||||
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib imm32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gdk.def"
|
||||
@@ -96,7 +96,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -107,7 +107,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="imm32.lib"
|
||||
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib imm32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gdk.def"
|
||||
@@ -128,7 +128,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GdkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -137,7 +137,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="imm32.lib"
|
||||
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib imm32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gdk.def"
|
||||
@@ -216,7 +216,6 @@
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
#include "libgdk.sourcefiles"
|
||||
<File RelativePath="..\..\..\gdk\gdkkeynames.c" />
|
||||
</Filter>
|
||||
</Files>
|
||||
</VisualStudioProject>
|
||||
|
@@ -8,13 +8,13 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\GdkPixbuf-2.0"
|
||||
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0"
|
||||
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_DEPRECATED;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES"
|
||||
ForcedIncludeFiles="msvc_recommended_pragmas.h"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="gdk_pixbuf-2.0.lib pangocairo-1.0.lib pango-1.0.lib cairo.lib gio-2.0.lib gmodule-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib"
|
||||
AdditionalDependencies="gdk_pixbuf-2.0.lib gio-2.0.lib gmodule-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib"
|
||||
AdditionalLibraryDirectories="$(GlibEtcInstallRoot)\lib"
|
||||
/>
|
||||
<Tool
|
||||
@@ -24,7 +24,9 @@ if exist ..\..\..\config.h goto DONE_CONFIG_H

|
||||
copy ..\..\..\config.h.win32 ..\..\..\config.h

|
||||
:DONE_CONFIG_H

|
||||
|
||||
if exist ..\..\..\gdk\gdkconfig.h goto DONE_GDKCONFIG_H

|
||||
copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h

|
||||
:DONE_GDKCONFIG_H

|
||||
"
|
||||
/>
|
||||
<UserMacro
|
||||
@@ -85,8 +87,10 @@ copy ..\..\..\gdk\gdkdevicemanager.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&
|
||||
copy ..\..\..\gdk\gdkdisplay.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk

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

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

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

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

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

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

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

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

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

|
||||
@@ -98,6 +102,7 @@ copy ..\..\..\gdk\gdkrectangle.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk
|
||||
copy ..\..\..\gdk\gdkrgba.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk

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

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

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

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

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

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

|
||||
@@ -118,10 +123,6 @@ copy ..\..\..\gtk\gtkactiongroup.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x
|
||||
copy ..\..\..\gtk\gtkactivatable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

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

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

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

|
||||
@@ -130,14 +131,10 @@ copy ..\..\..\gtk\gtkbbox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
�
|
||||
copy ..\..\..\gtk\gtkbin.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

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

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

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

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

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

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

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

|
||||
@@ -159,7 +156,6 @@ copy ..\..\..\gtk\gtkcolorseldialog.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
copy ..\..\..\gtk\gtkcombobox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

|
||||
@@ -180,12 +176,12 @@ copy ..\..\..\gtk\gtkfixed.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
&#x
|
||||
copy ..\..\..\gtk\gtkfontbutton.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

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

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

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

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

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

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

|
||||
@@ -216,7 +212,6 @@ copy ..\..\..\gtk\gtkmisc.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
�
|
||||
copy ..\..\..\gtk\gtkmodules.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

|
||||
@@ -242,6 +237,7 @@ copy ..\..\..\gtk\gtkrecentchoosermenu.h $(OutDir)\include\gtk-$(GtkApiVersion)\
|
||||
copy ..\..\..\gtk\gtkrecentchooserwidget.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

|
||||
@@ -262,15 +258,9 @@ copy ..\..\..\gtk\gtkstatusbar.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
copy ..\..\..\gtk\gtkstatusicon.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

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

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

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

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

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

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

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

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

|
||||
@@ -281,7 +271,6 @@ copy ..\..\..\gtk\gtktextmark.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
copy ..\..\..\gtk\gtktexttag.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

|
||||
@@ -302,6 +291,7 @@ copy ..\..\..\gtk\gtktreestore.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
|
||||
copy ..\..\..\gtk\gtktreeview.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

|
||||
@@ -309,14 +299,15 @@ copy ..\..\..\gtk\gtkversion.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
&
|
||||
copy ..\..\..\gtk\gtkviewport.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

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

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

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

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

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

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

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

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

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

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

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

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

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

|
||||
"
|
||||
@@ -327,7 +318,7 @@ copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(OutDir)\l
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkGenerateGtkDef"
|
||||
Value="echo EXPORTS >"$(IntDir)\gtk.def" && cl /EP -DGDK_WINDOWING_WIN32 -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES -DG_GNUC_MALLOC= -DG_GNUC_CONST= -DG_GNUC_NULL_TERMINATED= -DG_GNUC_PRINTF=;G_GNUC_PRINTF ..\..\..\gtk\gtk.symbols >>"$(IntDir)\gtk.def""
|
||||
Value="echo EXPORTS >"$(IntDir)\gtk.def" && cl /EP -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES -DG_GNUC_MALLOC= -DG_GNUC_CONST= -DG_GNUC_NULL_TERMINATED= -DG_GNUC_PRINTF=;G_GNUC_PRINTF ..\..\..\gtk\gtk.symbols >>"$(IntDir)\gtk.def""
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkLibtoolCompatibleDllPrefix"
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkPrefixDefine)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -43,7 +43,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
@@ -64,7 +64,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkPrefixDefine)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -76,7 +76,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
@@ -97,7 +97,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="$(GtkPrefixDefine)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -107,7 +107,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
@@ -130,7 +130,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="$(GtkPrefixDefine)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -140,7 +140,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""
|
||||
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -42,7 +42,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
@@ -63,7 +63,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GtkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -72,7 +72,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
@@ -96,7 +96,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -107,7 +107,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
@@ -128,7 +128,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GtkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -137,7 +137,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
|
592
configure.ac
592
configure.ac
@@ -8,10 +8,10 @@
|
||||
# if backwards compatibility has been broken,
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [0])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_interface_age], [1])
|
||||
m4_define([gtk_major_version], [2])
|
||||
m4_define([gtk_minor_version], [91])
|
||||
m4_define([gtk_micro_version], [8])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -38,25 +38,22 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.28.0])
|
||||
m4_define([glib_required_version], [2.27.5])
|
||||
m4_define([pango_required_version], [1.20])
|
||||
m4_define([atk_required_version], [1.30])
|
||||
m4_define([atk_required_version], [1.29.2])
|
||||
m4_define([cairo_required_version], [1.10.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.22.0])
|
||||
m4_define([introspection_required_version], [0.10.1])
|
||||
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
|
||||
INTROSPECTION_REQUIRED_VERSION=introspection_required_version
|
||||
|
||||
AC_SUBST(GLIB_REQUIRED_VERSION)
|
||||
AC_SUBST(PANGO_REQUIRED_VERSION)
|
||||
AC_SUBST(ATK_REQUIRED_VERSION)
|
||||
AC_SUBST(CAIRO_REQUIRED_VERSION)
|
||||
AC_SUBST(GDK_PIXBUF_REQUIRED_VERSION)
|
||||
AC_SUBST(INTROSPECTION_REQUIRED_VERSION)
|
||||
|
||||
|
||||
# Save this value here, since automake will set cflags later
|
||||
cflags_set=${CFLAGS+set}
|
||||
@@ -173,16 +170,12 @@ dnl
|
||||
AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], gcc)
|
||||
AC_LANG_PUSH([C++])
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
|
||||
[[class a { int b; } c;]])],
|
||||
[],[CXX=])
|
||||
AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
|
||||
AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
|
||||
|
||||
gtk_save_cxxflags="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -x objective-c++"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@interface Foo @end]],
|
||||
[[]])],
|
||||
[OBJC=yes],[OBJC=no])
|
||||
AC_TRY_COMPILE([@interface Foo @end],,OBJC=yes,OBJC=no)
|
||||
AM_CONDITIONAL(HAVE_OBJC, test "$OBJC" = "yes")
|
||||
CXXFLAGS="$gtk_save_cxxflags"
|
||||
AC_LANG_POP([C++])
|
||||
@@ -240,126 +233,39 @@ m4_define([debug_default],
|
||||
|
||||
dnl declare --enable-* args and collect ac_help strings
|
||||
AC_ARG_ENABLE(debug,
|
||||
[AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
|
||||
[turn on debugging @<:@default=debug_default@:>@])],,
|
||||
[enable_debug=debug_default])
|
||||
|
||||
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
|
||||
[turn on debugging @<:@default=debug_default@:>@]),,
|
||||
enable_debug=debug_default)
|
||||
AC_ARG_ENABLE(xkb,
|
||||
[AC_HELP_STRING([--enable-xkb],
|
||||
[support XKB [default=maybe]])],,
|
||||
[enable_xkb="maybe"])
|
||||
AC_ARG_ENABLE(xinerama,
|
||||
[AC_HELP_STRING([--enable-xinerama],
|
||||
[support xinerama extension if available [default=yes]])],,
|
||||
[enable_xinerama="yes"])
|
||||
AC_ARG_ENABLE(rebuilds,
|
||||
[AS_HELP_STRING([--disable-rebuilds],
|
||||
[AC_HELP_STRING([--disable-rebuilds],
|
||||
[disable all source autogeneration rules])],,
|
||||
[enable_rebuilds=yes])
|
||||
|
||||
AC_ARG_ENABLE(gtk2-dependency,
|
||||
[AS_HELP_STRING([--enable-gtk2-dependency],
|
||||
[Do not build gtk-update-icon-cache and other shared tools])],,
|
||||
[enable_gtk2_dependency=no])
|
||||
AC_ARG_WITH(xinput,
|
||||
[AC_HELP_STRING([--with-xinput=@<:@no/yes@:>@], [support XInput])])
|
||||
|
||||
AM_CONDITIONAL(BUILD_ICON_CACHE, [test "x$enable_gtk2_dependency" = xno])
|
||||
|
||||
AC_ARG_ENABLE(xkb,
|
||||
[AS_HELP_STRING([--enable-xkb],
|
||||
[support XKB extension [default=maybe]])],,
|
||||
[enable_xkb="maybe"])
|
||||
AC_ARG_ENABLE(xinerama,
|
||||
[AS_HELP_STRING([--enable-xinerama],
|
||||
[support Xinerama extension if available [default=maybe]])],,
|
||||
[enable_xinerama="maybe"])
|
||||
AC_ARG_ENABLE(xinput,
|
||||
[AS_HELP_STRING([--enable-xinput],
|
||||
[support XInput extension if available [default=yes]])],,
|
||||
[enable_xinput="maybe"])
|
||||
AC_ARG_ENABLE(xrandr,
|
||||
[AS_HELP_STRING([--enable-xrandr],
|
||||
[support XRandR extension if available [default=maybe]])],,
|
||||
[enable_xrandr="maybe"])
|
||||
AC_ARG_ENABLE(xfixes,
|
||||
[AS_HELP_STRING([--enable-xfixes],
|
||||
[support XFixes extension if available [default=maybe]])],,
|
||||
[enable_xfixes="maybe"])
|
||||
AC_ARG_ENABLE(xcomposite,
|
||||
[AS_HELP_STRING([--enable-xcomposite],
|
||||
[support X Composite extension if available [default=maybe]])],,
|
||||
[enable_xcomposite="maybe"])
|
||||
AC_ARG_ENABLE(xdamage,
|
||||
[AS_HELP_STRING([--enable-xdamage],
|
||||
[support X Damage extension if available [default=maybe]])],,
|
||||
[enable_xdamage="maybe"])
|
||||
|
||||
AC_ARG_ENABLE(x11-backend,
|
||||
[AS_HELP_STRING([--enable-x11-backend],
|
||||
[enable the X11 gdk backend])],
|
||||
[backend_set=yes])
|
||||
AC_ARG_ENABLE(win32-backend,
|
||||
[AS_HELP_STRING([--enable-win32-backend],
|
||||
[enable the Win32 gdk backend])],
|
||||
[backend_set=yes])
|
||||
AC_ARG_ENABLE(quartz-backend,
|
||||
[AS_HELP_STRING([--enable-quartz-backend],
|
||||
[enable the quartz gdk backend])],
|
||||
[backend_set=yes])
|
||||
|
||||
if test -z "$backend_set"; then
|
||||
if test "$platform_win32" = yes; then
|
||||
enable_win32_backend=yes
|
||||
else
|
||||
enable_x11_backend=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
cairo_backends=
|
||||
backend_immodules=
|
||||
GDK_BACKENDS=
|
||||
GDK_EXTRA_LIBS=
|
||||
GDK_EXTRA_CFLAGS=
|
||||
GDK_WINDOWING=
|
||||
GIO_PACKAGE=gio-2.0
|
||||
PANGO_PACKAGES="pango pangocairo"
|
||||
|
||||
if test "x$enable_x11_backend" == xyes; then
|
||||
# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
|
||||
# backend names are identical.
|
||||
cairo_backends="$cairo_backends cairo-xlib"
|
||||
GDK_BACKENDS="$GDK_BACKENDS x11"
|
||||
# Pull in gio-unix for GDesktopAppInfo usage, see at least
|
||||
# gdkapplaunchcontext-x11.c
|
||||
GIO_PACKAGE=gio-unix-2.0
|
||||
backend_immodules="$backend_immodules,xim"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_X11"
|
||||
fi
|
||||
|
||||
if test "x$enable_win32_backend" == xyes; then
|
||||
cairo_backends="$cairo_backends cairo-win32"
|
||||
GDK_BACKENDS="$GDK_BACKENDS win32"
|
||||
backend_immodules="$backend_immodules,ime"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_WIN32"
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
|
||||
AM_CONDITIONAL(USE_WIN32, true)
|
||||
PANGO_PACKAGES="pangowin32 pangocairo"
|
||||
if test "$platform_win32" = yes; then
|
||||
gdktarget=win32
|
||||
else
|
||||
AM_CONDITIONAL(USE_WIN32, false)
|
||||
gdktarget=x11
|
||||
fi
|
||||
|
||||
if test "x$enable_quartz_backend" == xyes; then
|
||||
cairo_backends="$cairo_backends cairo-quartz"
|
||||
GDK_BACKENDS="$GDK_BACKENDS quartz"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_QUARTZ"
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
|
||||
AM_CONDITIONAL(USE_QUARTZ, true)
|
||||
else
|
||||
AM_CONDITIONAL(USE_QUARTZ, false)
|
||||
fi
|
||||
AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz]] select non-default GDK target],
|
||||
gdktarget=$with_gdktarget)
|
||||
|
||||
# strip leading space
|
||||
GDK_BACKENDS=${GDK_BACKENDS/# }
|
||||
|
||||
AC_SUBST(GDK_BACKENDS)
|
||||
|
||||
if test -z "$GDK_BACKENDS"; then
|
||||
AC_MSG_ERROR([No GDK backends selected.])
|
||||
fi
|
||||
AC_SUBST(gdktarget)
|
||||
case $gdktarget in
|
||||
x11|win32|quartz) ;;
|
||||
*) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz or win32.]);;
|
||||
esac
|
||||
|
||||
if test "x$enable_debug" = "xyes"; then
|
||||
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
|
||||
@@ -452,7 +358,18 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
|
||||
cairo-gobject >= cairo_required_version dnl
|
||||
gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
|
||||
|
||||
PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
|
||||
## In addition to checking that cairo is present, we also need to
|
||||
## check that the correct cairo backend is there. E.g. if the GDK
|
||||
## target is win32 we need the cairo-win32 backend and so on.
|
||||
cairo_backend=$gdktarget
|
||||
|
||||
# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
|
||||
# backend names are identical.
|
||||
if test "x$cairo_backend" = "xx11"; then
|
||||
cairo_backend=xlib
|
||||
fi
|
||||
PKG_CHECK_MODULES(CAIRO_BACKEND,
|
||||
[cairo-$cairo_backend >= cairo_required_version])
|
||||
|
||||
if test "$os_win32" != yes; then
|
||||
# libtool option to control which symbols are exported
|
||||
@@ -469,7 +386,7 @@ dnl * See whether to include shared library dependencies *
|
||||
dnl ******************************************************
|
||||
|
||||
AC_ARG_ENABLE(explicit-deps,
|
||||
[AS_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
|
||||
[AC_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
|
||||
[use explicit dependencies in .pc files [default=auto]])],,
|
||||
[enable_explicit_deps=auto])
|
||||
|
||||
@@ -514,10 +431,10 @@ AC_CHECK_FUNCS(localtime_r)
|
||||
|
||||
# _NL_TIME_FIRST_WEEKDAY is an enum and not a define
|
||||
AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
|
||||
[[char c;
|
||||
c = *((unsigned char *) nl_langinfo(_NL_TIME_FIRST_WEEKDAY));]])],
|
||||
[gtk_ok=yes], [gtk_ok=no])
|
||||
AC_TRY_LINK([#include <langinfo.h>], [
|
||||
char c;
|
||||
c = *((unsigned char *) nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
|
||||
], gtk_ok=yes, gtk_ok=no)
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
if test "$gtk_ok" = "yes"; then
|
||||
AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
|
||||
@@ -526,10 +443,10 @@ fi
|
||||
|
||||
# _NL_MEASUREMENT_MEASUREMENT is an enum and not a define
|
||||
AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
|
||||
[[char c;
|
||||
c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));]])],
|
||||
[gtk_ok=yes], [gtk_ok=no])
|
||||
AC_TRY_LINK([#include <langinfo.h>], [
|
||||
char c;
|
||||
c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
|
||||
], gtk_ok=yes, gtk_ok=no)
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
if test "$gtk_ok" = "yes"; then
|
||||
AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
|
||||
@@ -538,10 +455,10 @@ fi
|
||||
|
||||
# _NL_PAPER_HEIGHT is an enum and not a define
|
||||
AC_MSG_CHECKING([for _NL_PAPER_HEIGHT])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
|
||||
[[char c;
|
||||
c = *((unsigned char *) nl_langinfo(_NL_PAPER_HEIGHT));]])],
|
||||
[gtk_ok=yes], [gtk_ok=no])
|
||||
AC_TRY_LINK([#include <langinfo.h>], [
|
||||
char c;
|
||||
c = *((unsigned char *) nl_langinfo(_NL_PAPER_HEIGHT));
|
||||
], gtk_ok=yes, gtk_ok=no)
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
if test "$gtk_ok" = "yes"; then
|
||||
AC_DEFINE([HAVE__NL_PAPER_HEIGHT], [1],
|
||||
@@ -550,10 +467,10 @@ fi
|
||||
|
||||
# _NL_PAPER_WIDTH is an enum and not a define
|
||||
AC_MSG_CHECKING([for _NL_PAPER_WIDTH])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
|
||||
[[char c;
|
||||
c = *((unsigned char *) nl_langinfo(_NL_PAPER_WIDTH));]])],
|
||||
[gtk_ok=yes], [gtk_ok=no])
|
||||
AC_TRY_LINK([#include <langinfo.h>], [
|
||||
char c;
|
||||
c = *((unsigned char *) nl_langinfo(_NL_PAPER_WIDTH));
|
||||
], gtk_ok=yes, gtk_ok=no)
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
if test "$gtk_ok" = "yes"; then
|
||||
AC_DEFINE([HAVE__NL_PAPER_WIDTH], [1],
|
||||
@@ -564,11 +481,9 @@ fi
|
||||
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_CONFIG_COMMANDS([po-properties],
|
||||
[[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
|
||||
esac]],
|
||||
[[]])
|
||||
AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
|
||||
esac])
|
||||
|
||||
dnl Snippet below is copied from AM_GLIB_GNU_GETTEXT to generate a first
|
||||
dnl po-properties/POTFILES during configure; see GNOME #573515.
|
||||
@@ -598,20 +513,22 @@ AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
|
||||
|
||||
gtk_save_LIBS=$LIBS
|
||||
LIBS="$LIBS -lm"
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <math.h>
|
||||
int main (void) { return (log(1) != log(1.)); }]])],
|
||||
[AC_MSG_RESULT(none needed)],
|
||||
[gtk_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -std1"
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <math.h>
|
||||
int main (void) { return (log(1) != log(1.)); }]])],
|
||||
[AC_MSG_RESULT(-std1)],
|
||||
[AC_MSG_RESULT()
|
||||
CFLAGS="$gtk_save_CFLAGS"
|
||||
AC_MSG_WARN([No ANSI prototypes found in library. (-std1 did not work.)])],
|
||||
[true])],
|
||||
[AC_MSG_RESULT(none needed)])
|
||||
|
||||
AC_TRY_RUN([#include <math.h>
|
||||
int main (void) { return (log(1) != log(1.)); }],
|
||||
AC_MSG_RESULT(none needed),
|
||||
gtk_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -std1"
|
||||
AC_TRY_RUN([#include <math.h>
|
||||
int main (void) { return (log(1) != log(1.)); }],
|
||||
AC_MSG_RESULT(-std1),
|
||||
AC_MSG_RESULT()
|
||||
CFLAGS="$gtk_save_CFLAGS"
|
||||
AC_MSG_WARN(
|
||||
[No ANSI prototypes found in library. (-std1 didn't work.)]),
|
||||
true
|
||||
),
|
||||
AC_MSG_RESULT(none needed)
|
||||
)
|
||||
LIBS=$gtk_save_LIBS
|
||||
|
||||
AC_MSG_CHECKING(for the BeOS)
|
||||
@@ -640,6 +557,18 @@ case $host_os in
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl NeXTStep cc seems to need this
|
||||
AC_MSG_CHECKING([for extra flags for POSIX compliance])
|
||||
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
|
||||
AC_MSG_RESULT(none needed),
|
||||
gtk_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -posix"
|
||||
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
|
||||
AC_MSG_RESULT(-posix),
|
||||
AC_MSG_RESULT()
|
||||
CFLAGS="$gtk_save_CFLAGS"
|
||||
AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
|
||||
|
||||
#
|
||||
# Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
|
||||
#
|
||||
@@ -684,11 +613,9 @@ AC_CHECK_HEADERS(ftw.h,
|
||||
[Define to 1 if ftw.h is available]))
|
||||
|
||||
AC_MSG_CHECKING([for GNU ftw extensions])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _XOPEN_SOURCE 500
|
||||
#define _GNU_SOURCE
|
||||
#include <ftw.h>]],
|
||||
[[int flags = FTW_ACTIONRETVAL;]])],
|
||||
[gtk_ok=yes],[gtk_ok=no])
|
||||
AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
|
||||
#define _GNU_SOURCE
|
||||
#include <ftw.h>], [int flags = FTW_ACTIONRETVAL;], gtk_ok=yes, gtk_ok=no)
|
||||
if test $gtk_ok = yes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GNU_FTW, 1, [Have GNU ftw])
|
||||
@@ -700,17 +627,42 @@ saved_cflags="$CFLAGS"
|
||||
saved_ldflags="$LDFLAGS"
|
||||
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
||||
# Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_MMAP
|
||||
|
||||
AC_CHECK_FUNCS(mallinfo)
|
||||
AC_CHECK_FUNCS(getresuid)
|
||||
AC_TYPE_UID_T
|
||||
|
||||
# Check if <sys/select.h> needs to be included for fd_set
|
||||
AC_MSG_CHECKING([for fd_set])
|
||||
AC_TRY_COMPILE([#include <sys/types.h>],
|
||||
[fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
|
||||
if test $gtk_ok = yes; then
|
||||
AC_MSG_RESULT([yes, found in sys/types.h])
|
||||
else
|
||||
AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
|
||||
if test $gtk_ok = yes; then
|
||||
AC_DEFINE(HAVE_SYS_SELECT_H, 1,
|
||||
[Define to 1 if sys/select.h is available])
|
||||
AC_MSG_RESULT([yes, found in sys/select.h])
|
||||
else
|
||||
AC_DEFINE(NO_FD_SET, 1,
|
||||
[Define to 1 if fd_set is not available])
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for uxtheme.h (for MS-Windows Engine)
|
||||
AC_MSG_CHECKING(for uxtheme.h)
|
||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <uxtheme.h>]])],
|
||||
[gtk_uxtheme_h=yes], [gtk_uxtheme_h=no])
|
||||
AC_TRY_CPP([#include <uxtheme.h>], gtk_uxtheme_h=yes, gtk_uxtheme_h=no)
|
||||
if test $gtk_uxtheme_h = yes; then
|
||||
AC_DEFINE(HAVE_UXTHEME_H, 1, [Have uxtheme.h include file])
|
||||
fi
|
||||
@@ -723,11 +675,10 @@ AC_CHECK_FUNCS(_NSGetEnviron)
|
||||
AC_MSG_CHECKING(whether to build dynamic modules)
|
||||
|
||||
AC_ARG_ENABLE(modules,
|
||||
[AS_HELP_STRING([--disable-modules],
|
||||
[AC_HELP_STRING([--disable-modules],
|
||||
[disable dynamic module loading])])
|
||||
|
||||
dynworks=false
|
||||
build_dynamic_modules=no
|
||||
deps=
|
||||
if test x$enable_modules = xno; then
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -755,12 +706,10 @@ else
|
||||
fi
|
||||
|
||||
if $dynworks; then
|
||||
build_dynamic_modules=yes
|
||||
AC_DEFINE(USE_GMODULE, 1,
|
||||
[Define to 1 if gmodule works and should be used])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
build_dynamic_modules=no
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
@@ -772,9 +721,13 @@ AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
|
||||
#
|
||||
AC_MSG_CHECKING(immodules to build)
|
||||
|
||||
dnl due to an autoconf bug, commas in the first arg to
|
||||
dnl AC_HELP_STRING cause problems.
|
||||
dnl AC_HELP_STRING([--with-included-immodules=MODULE1 MODULE2 ...],
|
||||
dnl [build the specified input method modules into gtk])
|
||||
AC_ARG_WITH(included_immodules,
|
||||
[AS_HELP_STRING([--with-included-immodules=MODULE1,MODULE2,...],
|
||||
[build the specified input methods into gtk])])
|
||||
[ --with-included-immodules=MODULE1,MODULE2,...
|
||||
build the specified input methods into gtk])
|
||||
|
||||
if $dynworks; then
|
||||
:
|
||||
@@ -785,7 +738,14 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
all_immodules="am-et,cedilla,cyrillic-translit,inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr$backend_immodules"
|
||||
all_immodules="am-et,cedilla,cyrillic-translit"
|
||||
if test "$gdktarget" = "win32"; then
|
||||
all_immodules="${all_immodules},ime"
|
||||
fi
|
||||
all_immodules="${all_immodules},inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr"
|
||||
if test "$gdktarget" = "x11"; then
|
||||
all_immodules="${all_immodules},xim"
|
||||
fi
|
||||
|
||||
included_immodules=""
|
||||
# If the switch specified without listing any specific ones, include all
|
||||
@@ -831,6 +791,10 @@ AM_CONDITIONAL(INCLUDE_IM_TI_ET, [test x"$INCLUDE_ti_et" = xyes])
|
||||
AM_CONDITIONAL(INCLUDE_IM_VIQR, [test x"$INCLUDE_viqr" = xyes])
|
||||
AM_CONDITIONAL(INCLUDE_IM_XIM, [test x"$INCLUDE_xim" = xyes])
|
||||
|
||||
AC_HEADER_SYS_WAIT
|
||||
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
# Checks to see whether we should include mediaLib
|
||||
# support.
|
||||
#
|
||||
@@ -845,15 +809,13 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
|
||||
|
||||
if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
|
||||
if test $cross_compiling = yes; then
|
||||
AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
|
||||
if test x$GTK_UPDATE_ICON_CACHE = xno; then
|
||||
REBUILD_PNGS=#
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
|
||||
|
||||
AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
|
||||
|
||||
if test ! -f $srcdir/gtk/gtkbuiltincache.h &&
|
||||
@@ -868,12 +830,14 @@ fi
|
||||
# Windowing system checks
|
||||
########################################
|
||||
|
||||
GDK_EXTRA_LIBS=
|
||||
GDK_EXTRA_CFLAGS=
|
||||
|
||||
# GTK+ uses some X calls, so needs to link against X directly
|
||||
GTK_DEP_PACKAGES_FOR_X=
|
||||
GTK_DEP_LIBS_FOR_X=
|
||||
X_EXTENSIONS=
|
||||
|
||||
if test "x$enable_x11_backend" == xyes; then
|
||||
if test "x$gdktarget" = "xx11"; then
|
||||
X_PACKAGES=fontconfig
|
||||
|
||||
#
|
||||
@@ -938,17 +902,17 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
# Check for xReply
|
||||
|
||||
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep;]])],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep;]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_RESULT([unknown])
|
||||
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
|
||||
AC_TRY_COMPILE([#include <X11/Xlibint.h>],
|
||||
[xReply *rep;],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_TRY_COMPILE([#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>],
|
||||
[xReply *rep;],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_RESULT([unknown])
|
||||
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
|
||||
|
||||
# Check for XConvertCase, XInternAtoms (X11R6 specific)
|
||||
|
||||
@@ -971,13 +935,10 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
# Check for XKB support.
|
||||
|
||||
if test "x$enable_xkb" = "xyes"; then
|
||||
AC_CHECK_FUNC(XkbQueryExtension,
|
||||
X_EXTENSIONS="$X_EXTENSIONS XKB"
|
||||
AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]),
|
||||
AC_MSG_ERROR([*** XKB extension not found. Check 'config.log' for more details.]))
|
||||
AC_MSG_WARN(XKB support explicitly enabled)
|
||||
AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
|
||||
elif test "x$enable_xkb" = "xmaybe"; then
|
||||
AC_CHECK_FUNC(XkbQueryExtension,
|
||||
X_EXTENSIONS="$X_EXTENSIONS XKB"
|
||||
AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]))
|
||||
else
|
||||
AC_MSG_WARN(XKB support explicitly disabled)
|
||||
@@ -999,23 +960,19 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
|
||||
CFLAGS="$gtk_save_CFLAGS"
|
||||
|
||||
if test "x$enable_xinerama" != "xno"; then
|
||||
if test "x$enable_xinerama" = "xyes"; then
|
||||
# Check for Xinerama extension (Solaris impl or Xfree impl)
|
||||
have_xfree_xinerama=false
|
||||
have_solaris_xinerama=false
|
||||
|
||||
gtk_save_cppflags="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $x_cflags"
|
||||
|
||||
# Check for XFree
|
||||
AC_MSG_CHECKING(for Xinerama packages)
|
||||
AC_MSG_CHECKING(for Xinerama support on XFree86)
|
||||
|
||||
have_xfree_xinerama=false
|
||||
if $PKG_CONFIG --exists xinerama ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
have_xfree_xinerama=true
|
||||
X_PACKAGES="$X_PACKAGES xinerama"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
|
||||
[AC_CHECK_HEADER(X11/extensions/Xinerama.h,
|
||||
[GTK_ADD_LIB(x_extra_libs,Xinerama)
|
||||
@@ -1024,12 +981,14 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
fi
|
||||
|
||||
if $have_xfree_xinerama ; then
|
||||
X_EXTENSIONS="$X_EXTENSIONS Xinerama"
|
||||
AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
|
||||
[Define to 1 if XFree Xinerama is available])
|
||||
AC_DEFINE(HAVE_XINERAMA, 1,
|
||||
[Define to 1 is Xinerama is available])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
case "$host" in
|
||||
*-*-solaris*)
|
||||
# Check for solaris
|
||||
@@ -1042,7 +1001,6 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
[#include <X11/Xlib.h>])])
|
||||
|
||||
if $have_solaris_xinerama ; then
|
||||
X_EXTENSIONS="$X_EXTENSIONS Xinerama"
|
||||
AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
|
||||
[Define to 1 if solaris xinerama is available])
|
||||
AC_DEFINE(HAVE_XINERAMA, 1,
|
||||
@@ -1057,14 +1015,9 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test "x$enable_xinerama" = "xyes" ; then
|
||||
if test "x$have_xfree_xinerama" != "xtrue" -a "x$have_solaris_xinerama" != "xtrue" ; then
|
||||
AC_MSG_ERROR([*** Xinerama extension not found. Check 'config.log' for more details.])
|
||||
fi
|
||||
fi
|
||||
|
||||
# set up things for XInput
|
||||
if test "x$enable_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then
|
||||
if test "x$with_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then
|
||||
have_xinput=yes
|
||||
|
||||
AC_DEFINE(XINPUT_XFREE, 1,
|
||||
@@ -1073,11 +1026,7 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
X_PACKAGES="$X_PACKAGES xi"
|
||||
|
||||
AC_CHECK_HEADER(X11/extensions/XInput2.h,
|
||||
have_xinput2=yes
|
||||
X_EXTENSIONS="$X_EXTENSIONS XI2"
|
||||
AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]),
|
||||
X_EXTENSIONS="$X_EXTENSIONS XInput")
|
||||
|
||||
have_xinput2=yes; AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
|
||||
else
|
||||
AC_DEFINE(XINPUT_NONE, 1,
|
||||
[Define to 1 if no XInput should be used])
|
||||
@@ -1086,22 +1035,11 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
AM_CONDITIONAL(XINPUT_XFREE, test "x$have_xinput" = "xyes")
|
||||
AM_CONDITIONAL(XINPUT_2, test "x$have_xinput2" = "xyes")
|
||||
|
||||
if test "x$enable_xinput" = "xyes" ; then
|
||||
if test "x$have_xinput" != "xyes" -a "x$have_xinput2" != "xyes" ; then
|
||||
AC_MSG_ERROR([*** XInput extension not found. Check 'config.log' for more details.])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for the RANDR extension
|
||||
if test x"$enable_xrandr" != xno; then
|
||||
if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
|
||||
AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
|
||||
if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
|
||||
AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
|
||||
|
||||
X_PACKAGES="$X_PACKAGES xrandr"
|
||||
X_EXTENSIONS="$X_EXTENSIONS XRANDR"
|
||||
elif test x"$enable_xrandr" = xyes; then
|
||||
AC_MSG_ERROR([RANDR support requested but xrandr not found])
|
||||
fi
|
||||
X_PACKAGES="$X_PACKAGES xrandr"
|
||||
fi
|
||||
|
||||
# Checks for Xcursor library
|
||||
@@ -1114,44 +1052,29 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
|
||||
# Checks for XFixes extension
|
||||
|
||||
if test x"$enable_xfixes" != xno; then
|
||||
if $PKG_CONFIG --exists xfixes ; then
|
||||
AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
|
||||
if $PKG_CONFIG --exists xfixes ; then
|
||||
AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
|
||||
|
||||
X_PACKAGES="$X_PACKAGES xfixes"
|
||||
X_EXTENSIONS="$X_EXTENSIONS XFIXES"
|
||||
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
|
||||
elif test x"$enable_xfixes" = xyes; then
|
||||
AC_MSG_ERROR([XFixes support requested but xfixes not found])
|
||||
fi
|
||||
X_PACKAGES="$X_PACKAGES xfixes"
|
||||
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
|
||||
fi
|
||||
|
||||
# Checks for Xcomposite extension
|
||||
|
||||
if test x"$enable_xcomposite" != xno; then
|
||||
if $PKG_CONFIG --exists xcomposite ; then
|
||||
AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
|
||||
if $PKG_CONFIG --exists xcomposite ; then
|
||||
AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
|
||||
|
||||
X_PACKAGES="$X_PACKAGES xcomposite"
|
||||
X_EXTENSIONS="$X_EXTENSIONS Composite"
|
||||
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
|
||||
elif test x"$enable_xcomposite" = xyes; then
|
||||
AC_MSG_ERROR([Xcomposite support requested but xcomposite not found])
|
||||
fi
|
||||
X_PACKAGES="$X_PACKAGES xcomposite"
|
||||
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
|
||||
fi
|
||||
|
||||
# Checks for Xdamage extension
|
||||
|
||||
if test x"$enable_xdamage" != xno; then
|
||||
if $PKG_CONFIG --exists xdamage ; then
|
||||
AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
|
||||
if $PKG_CONFIG --exists xdamage ; then
|
||||
AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
|
||||
|
||||
X_PACKAGES="$X_PACKAGES xdamage"
|
||||
X_EXTENSIONS="$X_EXTENSIONS DAMAGE"
|
||||
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
|
||||
elif test x"$enable_xdamage" = xyes; then
|
||||
AC_MSG_ERROR([Xdamage support requested but xdamage not found])
|
||||
fi
|
||||
X_PACKAGES="$X_PACKAGES xdamage"
|
||||
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
|
||||
fi
|
||||
|
||||
if $have_base_x_pc ; then
|
||||
@@ -1164,10 +1087,6 @@ if test "x$enable_x11_backend" == xyes; then
|
||||
LIBS="$gtk_save_libs"
|
||||
|
||||
AM_CONDITIONAL(USE_X11, true)
|
||||
|
||||
# strip leading space
|
||||
X_EXTENSIONS=${X_EXTENSIONS/# }
|
||||
|
||||
else
|
||||
XPACKAGES=
|
||||
|
||||
@@ -1177,8 +1096,28 @@ else
|
||||
AM_CONDITIONAL(HAVE_X11R6, false)
|
||||
fi
|
||||
|
||||
if test "x$gdktarget" = "xwin32"; then
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
|
||||
AM_CONDITIONAL(USE_WIN32, true)
|
||||
else
|
||||
AM_CONDITIONAL(USE_WIN32, false)
|
||||
fi
|
||||
|
||||
if test "x$gdktarget" = "xquartz"; then
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
|
||||
AM_CONDITIONAL(USE_QUARTZ, true)
|
||||
else
|
||||
AM_CONDITIONAL(USE_QUARTZ, false)
|
||||
fi
|
||||
|
||||
# Check for Pango flags
|
||||
|
||||
if test "x$gdktarget" = "xwin32"; then
|
||||
PANGO_PACKAGES="pangowin32 pangocairo"
|
||||
else
|
||||
PANGO_PACKAGES="pango pangocairo"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(Pango flags)
|
||||
if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
|
||||
PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
|
||||
@@ -1208,7 +1147,12 @@ fi
|
||||
CFLAGS="$saved_cflags"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
GDK_PACKAGES="$PANGO_PACKAGES $GIO_PACKAGE $X_PACKAGES gdk-pixbuf-2.0 $cairo_backends cairo-gobject"
|
||||
# Pull in gio-unix for GDesktopAppInfo usage, see at least gdkapplaunchcontext-x11.c
|
||||
if test "x$gdktarget" = "xx11"; then
|
||||
GDK_PACKAGES="$PANGO_PACKAGES gio-unix-2.0 $X_PACKAGES gdk-pixbuf-2.0 cairo-$cairo_backend cairo-gobject"
|
||||
else
|
||||
GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend cairo-gobject"
|
||||
fi
|
||||
|
||||
GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES`"
|
||||
GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS"
|
||||
@@ -1217,7 +1161,7 @@ GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFL
|
||||
# into the pkg-config files
|
||||
#
|
||||
if test $enable_explicit_deps != yes ; then
|
||||
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 cairo-gobject"
|
||||
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0"
|
||||
GDK_EXTRA_LIBS=
|
||||
fi
|
||||
|
||||
@@ -1258,7 +1202,7 @@ else
|
||||
fi
|
||||
|
||||
GTK_PACKAGES="atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0"
|
||||
if test "x$enable_x11_backend" == xyes; then
|
||||
if test "x$gdktarget" = "xx11"; then
|
||||
GTK_PACKAGES="$GTK_PACKAGES pangoft2"
|
||||
fi
|
||||
GTK_EXTRA_LIBS=
|
||||
@@ -1327,10 +1271,8 @@ LIBS="$old_LIBS"
|
||||
# Printing system checks
|
||||
################################################################
|
||||
|
||||
PRINT_BACKENDS="file lpr"
|
||||
|
||||
AC_ARG_ENABLE(cups,
|
||||
[AS_HELP_STRING([--disable-cups],
|
||||
[AC_HELP_STRING([--disable-cups]
|
||||
[disable cups print backend])],,
|
||||
[enable_cups=auto])
|
||||
|
||||
@@ -1367,16 +1309,14 @@ else
|
||||
|
||||
AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
|
||||
|
||||
PRINT_BACKENDS="$PRINT_BACKENDS cups"
|
||||
AM_CONDITIONAL(HAVE_CUPS, true)
|
||||
|
||||
gtk_save_cflags="$CFLAGS"
|
||||
CFLAGS="$CUPS_CFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cups/http.h>]],
|
||||
[[http_t http; char *s = http.authstring;]])],
|
||||
[AC_DEFINE([HAVE_HTTP_AUTHSTRING], [],
|
||||
[Define if cups http_t authstring field is accessible])],
|
||||
[])
|
||||
AC_TRY_COMPILE([#include <cups/http.h>],
|
||||
[http_t http; char *s = http.authstring;],
|
||||
[AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
|
||||
[Define if cups http_t authstring field is accessible])],)
|
||||
CFLAGS="$gtk_save_cflags"
|
||||
|
||||
AC_SUBST(HAVE_HTTP_AUTHSTRING)
|
||||
@@ -1392,9 +1332,9 @@ fi
|
||||
#
|
||||
|
||||
AC_ARG_ENABLE(papi,
|
||||
[AS_HELP_STRING([--disable-papi],
|
||||
[AC_HELP_STRING([--disable-papi]
|
||||
[disable papi print backend])],,
|
||||
[enable_papi=auto])
|
||||
[enable_papi=auto])
|
||||
|
||||
if test "x$enable_papi" = "xno"; then
|
||||
AM_CONDITIONAL(HAVE_PAPI, false)
|
||||
@@ -1402,7 +1342,6 @@ else
|
||||
AC_MSG_CHECKING(libpapi)
|
||||
AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
|
||||
if test $have_papi = yes; then
|
||||
PRINT_BACKENDS="$PRINT_BACKENDS papi"
|
||||
AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
|
||||
@@ -1428,7 +1367,7 @@ if test "$os_win32" != "yes"; then
|
||||
*** postscript backend enabled.]))
|
||||
|
||||
AC_CHECK_HEADER(cairo-svg.h,,AC_MSG_ERROR([
|
||||
*** Cannot find cairo-svg.h. You must build Cairo with the
|
||||
*** Can't find cairo-svg.h. You must build Cairo with the
|
||||
*** svg backend enabled.]))
|
||||
fi
|
||||
|
||||
@@ -1436,12 +1375,9 @@ CPPFLAGS="$gtk_save_cppflags"
|
||||
|
||||
|
||||
AC_ARG_ENABLE(test-print-backend,
|
||||
[AS_HELP_STRING([--enable-test-print-backend],
|
||||
[AC_HELP_STRING([--enable-test-print-backend],
|
||||
[build test print backend])],,
|
||||
[enable_test_print_backend=no])
|
||||
if test "x$enable_test_print_backend" != "xno" ; then
|
||||
PRINT_BACKENDS="$PRINT_BACKENDS test"
|
||||
fi
|
||||
AM_CONDITIONAL(TEST_PRINT_BACKEND, test "x$enable_test_print_backend" != "xno")
|
||||
|
||||
|
||||
@@ -1475,25 +1411,26 @@ GLIB_GSETTINGS
|
||||
# GObject introspection
|
||||
##################################################
|
||||
|
||||
GOBJECT_INTROSPECTION_CHECK(introspection_required_version)
|
||||
GOBJECT_INTROSPECTION_CHECK([0.9.3])
|
||||
|
||||
##################################################
|
||||
# Packagekit module
|
||||
#################################################
|
||||
|
||||
AC_ARG_ENABLE(packagekit,
|
||||
[AS_HELP_STRING([--disable-packagekit],
|
||||
[build packagekit open-with module])])
|
||||
AC_HELP_STRING([--disable-packagekit],
|
||||
[build packagekit open with module]))
|
||||
|
||||
build_packagekit=no
|
||||
ENABLE_PACKAGEKIT=
|
||||
if test "os_win32" != "yes"; then
|
||||
if test "x$enable_packagekit" != "xno"; then
|
||||
build_packagekit=yes
|
||||
AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
|
||||
fi
|
||||
if test "x$enable_packagekit" != "xno"; then
|
||||
ENABLE_PACKAGEKIT=1
|
||||
AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$build_packagekit" = "xyes")
|
||||
AC_SUBST(ENABLE_PACKAGEKIT)
|
||||
AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$ENABLE_PACKAGEKIT" = "x1")
|
||||
|
||||
##################################################
|
||||
# Checks for gtk-doc and docbook-tools
|
||||
@@ -1505,10 +1442,9 @@ AC_CHECK_PROG(DB2HTML, db2html, true, false)
|
||||
AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
|
||||
|
||||
AC_ARG_ENABLE(man,
|
||||
[AS_HELP_STRING([--enable-man],
|
||||
[regenerate man pages from Docbook [default=no]])],
|
||||
[enable_man=yes],
|
||||
[enable_man=no])
|
||||
[AC_HELP_STRING([--enable-man],
|
||||
[regenerate man pages from Docbook [default=no]])],enable_man=yes,
|
||||
enable_man=no)
|
||||
|
||||
if test "${enable_man}" != no; then
|
||||
dnl
|
||||
@@ -1552,6 +1488,15 @@ AC_CONFIG_COMMANDS([gdk/gdkconfig.h], [
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#ifndef GSEAL
|
||||
/* introduce GSEAL() here for all of Gdk and Gtk+ without the need to modify GLib */
|
||||
# ifdef GSEAL_ENABLE
|
||||
# define GSEAL(ident) _g_sealed__ ## ident
|
||||
# else
|
||||
# define GSEAL(ident) ident
|
||||
# endif
|
||||
#endif /* !GSEAL */
|
||||
|
||||
_______EOF
|
||||
|
||||
cat >>$outfile <<_______EOF
|
||||
@@ -1573,7 +1518,20 @@ _______EOF
|
||||
mv $outfile gdk/gdkconfig.h
|
||||
fi
|
||||
],[
|
||||
gdk_windowing='$GDK_WINDOWING'
|
||||
gdk_windowing=''
|
||||
if expr "$gdktarget" : ".*x11.*" > /dev/null ; then
|
||||
gdk_windowing='$gdk_windowing
|
||||
#define GDK_WINDOWING_X11'
|
||||
fi
|
||||
if expr "$gdktarget" : ".*win32.*" > /dev/null ; then
|
||||
gdk_windowing='$gdk_windowing
|
||||
#define GDK_NATIVE_WINDOW_POINTER
|
||||
#define GDK_WINDOWING_WIN32'
|
||||
fi
|
||||
if expr "$gdktarget" : ".*quartz.*" > /dev/null ; then
|
||||
gdk_windowing='$gdk_windowing
|
||||
#define GDK_WINDOWING_QUARTZ'
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -1581,17 +1539,16 @@ dnl Check for -Bsymbolic-functions linker flag used to avoid
|
||||
dnl intra-library PLT jumps, if available.
|
||||
dnl
|
||||
AC_ARG_ENABLE(Bsymbolic,
|
||||
[AS_HELP_STRING([--disable-Bsymbolic],
|
||||
[AC_HELP_STRING([--disable-Bsymbolic],
|
||||
[avoid linking with -Bsymbolic])],,
|
||||
[SAVED_LDFLAGS="${LDFLAGS}"
|
||||
AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
|
||||
LDFLAGS=-Wl,-Bsymbolic-functions
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
|
||||
[[int main (void) { return 0; }]])],
|
||||
[AC_MSG_RESULT(yes)
|
||||
enable_Bsymbolic=yes],
|
||||
[AC_MSG_RESULT(no)
|
||||
enable_Bsymbolic=no])
|
||||
AC_TRY_LINK([], [int main (void) { return 0; }],
|
||||
AC_MSG_RESULT(yes)
|
||||
enable_Bsymbolic=yes,
|
||||
AC_MSG_RESULT(no)
|
||||
enable_Bsymbolic=no)
|
||||
LDFLAGS="${SAVED_LDFLAGS}"])
|
||||
|
||||
if test "x${enable_Bsymbolic}" = "xyes" ; then
|
||||
@@ -1624,7 +1581,6 @@ docs/reference/gdk/version.xml
|
||||
docs/reference/gtk/Makefile
|
||||
docs/reference/gtk/version.xml
|
||||
docs/reference/libgail-util/Makefile
|
||||
docs/reference/libgail-util/version.xml
|
||||
docs/tools/Makefile
|
||||
build/Makefile
|
||||
build/win32/Makefile
|
||||
@@ -1640,6 +1596,7 @@ gtk/Makefile
|
||||
gtk/makefile.msc
|
||||
gtk/gtkversion.h
|
||||
gtk/gtk-win32.rc
|
||||
gtk/theme-bits/Makefile
|
||||
gtk/tests/Makefile
|
||||
modules/Makefile
|
||||
modules/other/Makefile
|
||||
@@ -1663,22 +1620,5 @@ perf/Makefile
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
# beautify the immodule list a bit
|
||||
included_immodules=${included_immodules//,/ }
|
||||
included_immodules=${included_immodules:-none}
|
||||
|
||||
echo ""
|
||||
echo " GTK+ $GTK_VERSION"
|
||||
echo " ==========="
|
||||
echo ""
|
||||
echo " GDK backends: $GDK_BACKENDS"
|
||||
if test "x$enable_x11_backend" = "xyes"; then
|
||||
echo " X11 extensions: $X_EXTENSIONS"
|
||||
fi
|
||||
echo " Print backends: $PRINT_BACKENDS"
|
||||
echo " Dynamic modules: $build_dynamic_modules"
|
||||
echo " Included immodules: $included_immodules"
|
||||
echo " PackageKit support: $build_packagekit"
|
||||
echo " Introspection: $found_introspection"
|
||||
echo " Debugging: $enable_debug"
|
||||
echo " Documentation: $enable_gtk_doc"
|
||||
echo "configuration:
|
||||
target: $gdktarget"
|
||||
|
@@ -12,11 +12,11 @@ INCLUDES = \
|
||||
$(GTK_DEP_CFLAGS)
|
||||
|
||||
DEPS = \
|
||||
$(top_builddir)/gtk/libgtk-3.la
|
||||
$(top_builddir)/gtk/libgtk-3.0.la
|
||||
|
||||
LDADDS = \
|
||||
$(top_builddir)/gtk/libgtk-3.la \
|
||||
$(top_builddir)/gdk/libgdk-3.la \
|
||||
$(top_builddir)/gtk/libgtk-3.0.la \
|
||||
$(top_builddir)/gdk/libgdk-3.0.la \
|
||||
$(GTK_DEP_LIBS) \
|
||||
$(MATH_LIB)
|
||||
|
||||
|
@@ -55,11 +55,11 @@ INCLUDES = \
|
||||
$(GTK_DEP_CFLAGS)
|
||||
|
||||
DEPS = \
|
||||
$(top_builddir)/gtk/libgtk-3.la
|
||||
$(top_builddir)/gtk/libgtk-3.0.la
|
||||
|
||||
LDADDS = \
|
||||
$(top_builddir)/gtk/libgtk-3.la \
|
||||
$(top_builddir)/gdk/libgdk-3.la \
|
||||
$(top_builddir)/gtk/libgtk-3.0.la \
|
||||
$(top_builddir)/gdk/libgdk-3.0.la \
|
||||
$(GTK_DEP_LIBS) \
|
||||
-lm
|
||||
|
||||
|
@@ -27,9 +27,6 @@
|
||||
* - Using GtkDialog
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
#undef GDK_DISABLE_DEPRECATED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
|
@@ -48,27 +48,27 @@ add_items (void)
|
||||
g_return_if_fail (articles != NULL);
|
||||
|
||||
foo.number = 3;
|
||||
foo.product = "bottles of coke";
|
||||
foo.product = g_strdup ("bottles of coke");
|
||||
foo.yummy = 20;
|
||||
g_array_append_vals (articles, &foo, 1);
|
||||
|
||||
foo.number = 5;
|
||||
foo.product = "packages of noodles";
|
||||
foo.product = g_strdup ("packages of noodles");
|
||||
foo.yummy = 50;
|
||||
g_array_append_vals (articles, &foo, 1);
|
||||
|
||||
foo.number = 2;
|
||||
foo.product = "packages of chocolate chip cookies";
|
||||
foo.product = g_strdup ("packages of chocolate chip cookies");
|
||||
foo.yummy = 90;
|
||||
g_array_append_vals (articles, &foo, 1);
|
||||
|
||||
foo.number = 1;
|
||||
foo.product = "can vanilla ice cream";
|
||||
foo.product = g_strdup ("can vanilla ice cream");
|
||||
foo.yummy = 60;
|
||||
g_array_append_vals (articles, &foo, 1);
|
||||
|
||||
foo.number = 6;
|
||||
foo.product = "eggs";
|
||||
foo.product = g_strdup ("eggs");
|
||||
foo.yummy = 10;
|
||||
g_array_append_vals (articles, &foo, 1);
|
||||
}
|
||||
|
@@ -105,7 +105,6 @@ fill_store (GtkListStore *store)
|
||||
|
||||
name = g_dir_read_name (dir);
|
||||
}
|
||||
g_dir_close (dir);
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@@ -432,7 +432,7 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (align), frame);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
||||
|
||||
gicon = g_themed_icon_new_with_default_fallbacks ("battery-caution-charging-symbolic");
|
||||
gicon = g_themed_icon_new_with_default_fallbacks ("battery-critical-charging-symbolic");
|
||||
image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_DIALOG);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), image);
|
||||
|
@@ -74,17 +74,47 @@ change_orientation (GtkWidget *button,
|
||||
GtkWidget *menubar)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
GtkOrientation orientation;
|
||||
GtkWidget *box = NULL;
|
||||
|
||||
parent = gtk_widget_get_parent (menubar);
|
||||
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (parent));
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (parent), 1 - orientation);
|
||||
|
||||
if (orientation == GTK_ORIENTATION_VERTICAL)
|
||||
g_object_set (menubar, "pack-direction", GTK_PACK_DIRECTION_TTB, NULL);
|
||||
if (GTK_IS_VBOX (parent))
|
||||
{
|
||||
box = gtk_widget_get_parent (parent);
|
||||
|
||||
g_object_ref (menubar);
|
||||
gtk_container_remove (GTK_CONTAINER (parent), menubar);
|
||||
gtk_container_add (GTK_CONTAINER (box), menubar);
|
||||
gtk_box_reorder_child (GTK_BOX (box), menubar, 0);
|
||||
g_object_unref (menubar);
|
||||
g_object_set (menubar,
|
||||
"pack-direction", GTK_PACK_DIRECTION_TTB,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
g_object_set (menubar, "pack-direction", GTK_PACK_DIRECTION_LTR, NULL);
|
||||
{
|
||||
GList *children, *l;
|
||||
|
||||
children = gtk_container_get_children (GTK_CONTAINER (parent));
|
||||
for (l = children; l; l = l->next)
|
||||
{
|
||||
if (GTK_IS_VBOX (l->data))
|
||||
{
|
||||
box = l->data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_list_free (children);
|
||||
|
||||
g_object_ref (menubar);
|
||||
gtk_container_remove (GTK_CONTAINER (parent), menubar);
|
||||
gtk_container_add (GTK_CONTAINER (box), menubar);
|
||||
gtk_box_reorder_child (GTK_BOX (box), menubar, 0);
|
||||
g_object_unref (menubar);
|
||||
g_object_set (menubar,
|
||||
"pack-direction", GTK_PACK_DIRECTION_LTR,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
@@ -290,6 +290,7 @@ gtk_rotated_bin_realize (GtkWidget *widget)
|
||||
g_signal_connect (bin->offscreen_window, "from-embedder",
|
||||
G_CALLBACK (offscreen_window_from_parent), bin);
|
||||
|
||||
gtk_widget_style_attach (widget);
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_style_context_set_background (context, window);
|
||||
gtk_style_context_set_background (context, bin->offscreen_window);
|
||||
|
@@ -228,6 +228,7 @@ gtk_mirror_bin_realize (GtkWidget *widget)
|
||||
g_signal_connect (bin->offscreen_window, "from-embedder",
|
||||
G_CALLBACK (offscreen_window_from_parent), bin);
|
||||
|
||||
gtk_widget_style_attach (widget);
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_style_context_set_background (context, window);
|
||||
gtk_style_context_set_background (context, bin->offscreen_window);
|
||||
|
@@ -24,9 +24,9 @@ set_interp_type (GtkWidget *widget, gpointer data)
|
||||
void
|
||||
overall_changed_cb (GtkAdjustment *adjustment, gpointer data)
|
||||
{
|
||||
if (gtk_adjustment_get_value (adjustment) != overall_alpha)
|
||||
if (adjustment->value != overall_alpha)
|
||||
{
|
||||
overall_alpha = gtk_adjustment_get_value (adjustment);
|
||||
overall_alpha = adjustment->value;
|
||||
gtk_widget_queue_draw (darea);
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.6
|
||||
|
||||
@@ -44,14 +45,15 @@ INCLUDES = \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GDK_DEP_CFLAGS)
|
||||
|
||||
GTKDOC_LIBS = $(top_builddir)/gdk/libgdk-3.la $(GDK_DEP_LIBS)
|
||||
GTKDOC_LIBS = $(top_builddir)/gdk/libgdk-3.0.la $(GDK_DEP_LIBS)
|
||||
|
||||
# Extra options to supply to gtkdoc-mkdb
|
||||
MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=gdk
|
||||
|
||||
# Extra SGML files that are included by DOC_MAIN_SGML_FILE
|
||||
content_files = \
|
||||
version.xml
|
||||
version.xml \
|
||||
multihead.sgml
|
||||
|
||||
# Images to copy into HTML directory
|
||||
HTML_IMAGES = \
|
||||
|
@@ -6,24 +6,23 @@
|
||||
]>
|
||||
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<bookinfo>
|
||||
<title>GDK 3 Reference Manual</title>
|
||||
<title>GDK Reference Manual</title>
|
||||
<releaseinfo>
|
||||
This document is for the GDK 3 library, version &version;
|
||||
The latest versions can be found online at
|
||||
<ulink role="online-location" url="http://library.gnome.org/devel/gdk3/">http://library.gnome.org/devel/gdk3/</ulink>.
|
||||
If you are looking for the older GDK 2 series of libraries,
|
||||
see <ulink role="online-location" url="http://library.gnome.org/devel/gdk/">http://library.gnome.org/devel/gdk/</ulink>.
|
||||
for GDK &version;
|
||||
The latest version of this documentation can be found on-line at
|
||||
<ulink role="online-location" url="http://library.gnome.org/devel/gdk/unstable/">http://library.gnome.org/devel/gdk/unstable/</ulink>.
|
||||
</releaseinfo>
|
||||
</bookinfo>
|
||||
|
||||
<reference id="reference">
|
||||
<title>API Reference</title>
|
||||
<xi:include href="xml/general.xml" />
|
||||
<xi:include href="xml/gdkdisplaymanager.xml" />
|
||||
<xi:include href="multihead.sgml" />
|
||||
<xi:include href="xml/gdkdisplay.xml" />
|
||||
<xi:include href="xml/gdkscreen.xml" />
|
||||
<xi:include href="xml/gdkdevicemanager.xml" />
|
||||
<xi:include href="xml/gdkdisplaymanager.xml" />
|
||||
<xi:include href="xml/gdkdevice.xml" />
|
||||
<xi:include href="xml/gdkdevicemanager.xml" />
|
||||
<xi:include href="xml/gdkscreen.xml" />
|
||||
<xi:include href="xml/regions.xml" />
|
||||
<xi:include href="xml/pixbufs.xml" />
|
||||
<xi:include href="xml/colors.xml" />
|
||||
|
@@ -120,11 +120,16 @@ gdk_display_get_event
|
||||
gdk_display_peek_event
|
||||
gdk_display_put_event
|
||||
gdk_display_has_pending
|
||||
gdk_display_add_client_message_filter
|
||||
gdk_display_set_double_click_time
|
||||
gdk_display_set_double_click_distance
|
||||
gdk_display_get_pointer
|
||||
gdk_display_list_devices
|
||||
gdk_display_get_window_at_pointer
|
||||
GdkDisplayPointerHooks
|
||||
gdk_display_set_pointer_hooks
|
||||
GdkDisplayDeviceHooks
|
||||
gdk_display_set_device_hooks
|
||||
gdk_display_warp_pointer
|
||||
gdk_display_supports_cursor_color
|
||||
gdk_display_supports_cursor_alpha
|
||||
@@ -203,6 +208,7 @@ gdk_screen_get_monitor_at_window
|
||||
gdk_screen_get_monitor_height_mm
|
||||
gdk_screen_get_monitor_width_mm
|
||||
gdk_screen_get_monitor_plug_name
|
||||
gdk_screen_broadcast_client_message
|
||||
gdk_screen_get_setting
|
||||
gdk_screen_get_font_options
|
||||
gdk_screen_set_font_options
|
||||
@@ -467,6 +473,10 @@ gdk_window_set_device_events
|
||||
gdk_window_get_source_events
|
||||
gdk_window_set_source_events
|
||||
|
||||
<SUBSECTION>
|
||||
GdkPointerHooks
|
||||
gdk_set_pointer_hooks
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_offscreen_window_get_surface
|
||||
gdk_offscreen_window_set_embedder
|
||||
@@ -775,6 +785,12 @@ gdk_events_get_distance
|
||||
gdk_event_handler_set
|
||||
GdkEventFunc
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_event_send_client_message
|
||||
gdk_event_send_client_message_for_display
|
||||
gdk_event_send_clientmessage_toall
|
||||
gdk_add_client_message_filter
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_get_show_events
|
||||
gdk_set_show_events
|
||||
@@ -811,8 +827,10 @@ GdkEventFocus
|
||||
GdkEventConfigure
|
||||
GdkEventProperty
|
||||
GdkEventSelection
|
||||
GdkNativeWindow
|
||||
GdkEventDND
|
||||
GdkEventProximity
|
||||
GdkEventClient
|
||||
GdkEventWindowState
|
||||
GdkEventSetting
|
||||
GdkEventOwnerChange
|
||||
@@ -881,11 +899,11 @@ gdk_drag_begin
|
||||
gdk_drag_begin_for_device
|
||||
gdk_drag_motion
|
||||
gdk_drop_finish
|
||||
gdk_drag_get_protocol_for_display
|
||||
GdkDragProtocol
|
||||
GdkDragAction
|
||||
gdk_drag_status
|
||||
gdk_drag_drop_succeeded
|
||||
gdk_window_get_drag_protocol
|
||||
|
||||
gdk_drag_context_get_actions
|
||||
gdk_drag_context_get_suggested_action
|
||||
@@ -924,8 +942,6 @@ GDK_SCREEN_XNUMBER
|
||||
GDK_SCREEN_XSCREEN
|
||||
GDK_CURSOR_XCURSOR
|
||||
GDK_CURSOR_XDISPLAY
|
||||
GDK_POINTER_TO_XID
|
||||
GDK_XID_TO_POINTER
|
||||
gdk_x11_lookup_xdisplay
|
||||
gdk_x11_get_server_time
|
||||
gdk_x11_display_get_user_time
|
||||
|
128
docs/reference/gdk/multihead.sgml
Normal file
128
docs/reference/gdk/multihead.sgml
Normal file
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="multihead" revision="1 May 2002">
|
||||
<refmeta>
|
||||
<refentrytitle>Multi-head Support Overview</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GDK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Multi-head Support Overview</refname>
|
||||
<refpurpose>Overview of GdkDisplay and GdkScreen</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Overview</title>
|
||||
<para>
|
||||
Multihead support is based around two main object types:
|
||||
<itemizedlist>
|
||||
<listitem><para>GdkDisplay</para></listitem>
|
||||
<listitem><para>GdkScreen</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<link linkend="gdk-GdkDisplay">GdkDisplay</link> objects are the GDK
|
||||
representation of the X Display which can be described as <emphasis>a
|
||||
workstation consisting of a keyboard a pointing device (such as a
|
||||
mouse) and one or more screens</emphasis>.
|
||||
It is used to open and keep track of various <link
|
||||
linkend="gdk-GdkScreen">GdkScreen</link> objects currently
|
||||
instanciated by the application. It is also used to grab and release
|
||||
the keyboard and the mouse pointer.
|
||||
</para>
|
||||
<para>
|
||||
<link linkend="gdk-GdkScreen">GdkScreen</link> objects are the GDK
|
||||
representation of a physical screen. It is used throughout GDK and GTK+
|
||||
to specify which screen the top level windows are to be displayed on.
|
||||
It is also used to query the screen specification and default settings such as
|
||||
the default colormap (<link linkend="gdk-screen-get-default-colormap">gdk_screen_get_default_colormap</link>()),
|
||||
the screen width (<link linkend="gdk-screen-get-width">gdk_screen_get_width</link>()), etc.
|
||||
</para>
|
||||
<para>
|
||||
The following code samples demonstrate common usage of the objects described above.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Testing the number of screen on the current display</title>
|
||||
<programlisting><!--
|
||||
-->gint num_screen = 0;
|
||||
gchar *displayname = NULL;
|
||||
GdkScreen **screen_list;
|
||||
GdkDisplay *display;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
display = gdk_display_get_default ();
|
||||
num_screen = gdk_display_get_n_screens (display);
|
||||
displayname = gdk_display_get_name (display);
|
||||
if (num_screen <= 1)
|
||||
{
|
||||
printf ("This Xserver (%s) manages only one screen. exiting...\n",
|
||||
displayname);
|
||||
exit (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("This Xserver (%s) manages %d screens.\n", displayname,
|
||||
num_screen);
|
||||
}<!--
|
||||
|
||||
--> </programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Opening a second display</title>
|
||||
<programlisting><!--
|
||||
-->gchar *second_screen_name;
|
||||
GdkDisplay *second_display;
|
||||
GdkScreen *second_screen;
|
||||
GtkWidget *window;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* screen2_name needs to be initialized before calling
|
||||
/* gdk_display_new() */
|
||||
second_display = gdk_display_new (&argc, &argv, second_screen_name);
|
||||
if (second_display)
|
||||
second_screen = gdk_display_get_default_screen (second_display);
|
||||
else
|
||||
{
|
||||
g_print ("Can't open display :\n\t%s\n\n",
|
||||
second_screen_name);
|
||||
exit (1);
|
||||
}
|
||||
/* now GdkScreen can be assigned to GtkWindows */
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (window, second_screen);<!--
|
||||
--></programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><link linkend="GdkDisplay">GdkDisplay</link></term>
|
||||
<listitem><para>the GDK Object used to represent and manipulate display
|
||||
related data</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><link linkend="GdkScreen">GdkScreen</link></term>
|
||||
<listitem><para>the GDK Object used to represent and query screen related
|
||||
data</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gdk-docs.sgml" "book" "refentry" "")
|
||||
End:
|
||||
-->
|
@@ -1,4 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.6
|
||||
|
||||
@@ -106,7 +107,7 @@ CPPFLAGS += \
|
||||
-UGTK_DISABLE_SINGLE_INCLUDES
|
||||
|
||||
GTKDOC_LIBS = \
|
||||
$(top_builddir)/gtk/libgtk-3.la \
|
||||
$(top_builddir)/gtk/libgtk-3.0.la \
|
||||
$(GTK_DEP_LIBS)
|
||||
|
||||
|
||||
@@ -134,7 +135,8 @@ content_files = \
|
||||
windows.sgml \
|
||||
x11.sgml \
|
||||
gtk-query-immodules-3.0.xml \
|
||||
gtk-update-icon-cache.xml \
|
||||
gtk-update-icon-cache-3.0.xml \
|
||||
gtk-builder-convert-3.0.xml \
|
||||
visual_index.xml \
|
||||
getting_started.xml \
|
||||
overview.xml
|
||||
@@ -274,8 +276,6 @@ HTML_IMAGES = \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-page-setup.png \
|
||||
$(srcdir)/images/aboutdialog.png \
|
||||
$(srcdir)/images/accel-label.png \
|
||||
$(srcdir)/images/appchooserbutton.png \
|
||||
$(srcdir)/images/appchooserdialog.png \
|
||||
$(srcdir)/images/assistant.png \
|
||||
$(srcdir)/images/button.png \
|
||||
$(srcdir)/images/check-button.png \
|
||||
@@ -328,8 +328,6 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/layout-tbrl.png \
|
||||
$(srcdir)/images/window-default.png \
|
||||
$(srcdir)/images/hello-world.png \
|
||||
$(srcdir)/images/grid-packing.png \
|
||||
$(srcdir)/images/drawing.png \
|
||||
$(srcdir)/images/switch.png \
|
||||
$(srcdir)/images/linear.png \
|
||||
$(srcdir)/images/ease.png \
|
||||
@@ -354,9 +352,7 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/sliders.png \
|
||||
$(srcdir)/images/focus.png \
|
||||
$(srcdir)/images/handles.png \
|
||||
$(srcdir)/images/extensions.png \
|
||||
$(srcdir)/images/numerableicon.png \
|
||||
$(srcdir)/images/numerableicon2.png
|
||||
$(srcdir)/images/extensions.png
|
||||
|
||||
# Extra options to supply to gtkdoc-fixref
|
||||
FIXXREF_OPTIONS=--extra-dir=../gdk/html \
|
||||
@@ -375,7 +371,8 @@ EXTRA_DIST += version.xml.in
|
||||
|
||||
man_MANS = \
|
||||
gtk-query-immodules-3.0.1 \
|
||||
gtk-update-icon-cache.1
|
||||
gtk-update-icon-cache-3.0.1 \
|
||||
gtk-builder-convert-3.0.1
|
||||
|
||||
if ENABLE_MAN
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-building">
|
||||
<refentry id="gtk-building" revision="6 Sept 2001">
|
||||
<refmeta>
|
||||
<refentrytitle>Compiling the GTK+ libraries</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
@@ -30,7 +30,7 @@ How to compile GTK+ itself
|
||||
your operating system will be available, either from your
|
||||
operating system vendor or from independent sources. If such a
|
||||
set of packages is available, installing it will get you
|
||||
programming with GTK+ much faster than building it yourself. In
|
||||
programming wih GTK+ much faster than building it yourself. In
|
||||
fact, you may well already have GTK+ installed on your system
|
||||
already.
|
||||
</para>
|
||||
@@ -45,7 +45,7 @@ How to compile GTK+ itself
|
||||
</para>
|
||||
<para>
|
||||
If you are building GTK+ from the distributed source packages,
|
||||
then you won't need these tools installed; the necessary pieces
|
||||
then won't need these tools installed; the necessary pieces
|
||||
of the tools are already included in the source packages. But
|
||||
it's useful to know a bit about how packages that use these
|
||||
tools work. A source package is distributed as a
|
||||
@@ -57,15 +57,14 @@ How to compile GTK+ itself
|
||||
tar xvfj gtk+-3.0.0.tar.bz2
|
||||
</programlisting>
|
||||
<para>
|
||||
In the toplevel directory that is created, there will be
|
||||
In the toplevel of the directory that is created, there will be
|
||||
a shell script called <filename>configure</filename> which
|
||||
you then run to take the template makefiles called
|
||||
<filename>Makefile.in</filename> in the package and create
|
||||
makefiles customized for your operating system.
|
||||
The <filename>configure</filename> script can be passed
|
||||
various command line arguments to determine how the package
|
||||
is built and installed. The most commonly useful argument is
|
||||
the <systemitem>--prefix</systemitem> argument which
|
||||
makefiles customized for your operating system. The <filename>configure</filename>
|
||||
script can be passed various command line arguments to determine how
|
||||
the package is built and installed. The most commonly useful
|
||||
argument is the <systemitem>--prefix</systemitem> argument which
|
||||
determines where the package is installed. To install a package
|
||||
in <filename>/opt/gtk</filename> you would run configure as:
|
||||
</para>
|
||||
@@ -172,7 +171,7 @@ How to compile GTK+ itself
|
||||
such as high level data types, Unicode manipulation, and
|
||||
an object and type system to C programs. It is available
|
||||
from the <ulink url="ftp://ftp.gtk.org/pub/glib/">GTK+
|
||||
FTP site</ulink>.
|
||||
FTP site.</ulink>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -180,7 +179,7 @@ How to compile GTK+ itself
|
||||
<ulink url="http://www.pango.org">Pango</ulink> is a library
|
||||
for internationalized text handling. It is available from
|
||||
the <ulink url="ftp://ftp.gtk.org/pub/pango/">GTK+ FTP
|
||||
site</ulink>.
|
||||
site.</ulink>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -189,7 +188,7 @@ How to compile GTK+ itself
|
||||
interfaces allowing accessibility technologies such as
|
||||
screen readers to interact with a graphical user interface.
|
||||
It is available from the <ulink
|
||||
url="ftp://ftp.gtk.org/pub/atk/">GTK+ FTP site</ulink>.
|
||||
url="ftp://ftp.gtk.org/pub/atk/">GTK+ FTP site.</ulink>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -211,6 +210,22 @@ How to compile GTK+ itself
|
||||
message translation databases.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <ulink url="http://en.wikipedia.org/wiki/Libjpeg">JPEG</ulink>,
|
||||
<ulink url="http://www.libpng.org">PNG</ulink>, and
|
||||
<ulink url="http://www.libtiff.org">TIFF</ulink> image
|
||||
loading libraries are needed to compile GTK+. You probably
|
||||
already have these libraries installed, but if not, the
|
||||
versions you need are available in the
|
||||
<filename>dependencies</filename> directory on the the
|
||||
<ulink url="ftp://ftp.gtk.org/pub/gtk/v2.10/dependencies/">GTK+
|
||||
FTP site.</ulink>. (Before installing these libraries
|
||||
from source, you should check if your operating system
|
||||
vendor has prebuilt packages of these libraries that you
|
||||
don't have installed.)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The libraries from the X window system are needed to build
|
||||
@@ -231,16 +246,10 @@ How to compile GTK+ itself
|
||||
<para>
|
||||
<ulink url="http://www.cairographics.org">Cairo</ulink>
|
||||
is a graphics library that supports vector graphics and image
|
||||
compositing. Both Pango and GTK+ use cairo for all of their
|
||||
compositing. Both Pango and GTK+ use cairo for much of their
|
||||
drawing.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The GdkPixbuf library provides facilities for loading
|
||||
images in a variety of file formats.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="http://live.gnome.org/GObjectIntrospection">gobject-introspection</ulink>
|
||||
@@ -280,8 +289,8 @@ How to compile GTK+ itself
|
||||
<literal>make install</literal> mentioned above. If you're
|
||||
lucky, this will all go smoothly, and you'll be ready to
|
||||
<link linkend="gtk-compiling">start compiling your own GTK+
|
||||
applications</link>. You can test your GTK+ installation
|
||||
by running the <command>gtk3-demo</command> program that
|
||||
applications</link>. You can test your GTK+ installation
|
||||
by running the <command>gtk-demo</command> program that
|
||||
GTK+ installs.
|
||||
</para>
|
||||
<para>
|
||||
@@ -309,76 +318,49 @@ How to compile GTK+ itself
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>configure</command>
|
||||
<sbr/>
|
||||
|
||||
<group>
|
||||
<arg>--disable-modules</arg>
|
||||
<arg>--enable-modules</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--with-included-immodules=MODULE1,MODULE2,...</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-debug=[no/minimum/yes]</arg>
|
||||
<arg>--enable-debug=[no|minimum|yes]</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-Bsymbolic</arg>
|
||||
<arg>--enable-Bsymbolic</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-xkb</arg>
|
||||
<arg>--enable-xkb</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-xinerama</arg>
|
||||
<arg>--enable-xinerama</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-gtk-doc</arg>
|
||||
<arg>--enable-gtk-doc</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-cups</arg>
|
||||
<arg>--enable-cups</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--disable-papi</arg>
|
||||
<arg>--enable-papi</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-xinput</arg>
|
||||
<arg>--disable-xinput</arg>
|
||||
<arg>--with-xinput=[no|yes]</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-packagekit</arg>
|
||||
<arg>--disable-packagekit</arg>
|
||||
<arg>--with-gdktarget=[x11|win32|quartz]</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-x11-backend</arg>
|
||||
<arg>--disable-x11-backend</arg>
|
||||
<arg>--enable-win32-backend</arg>
|
||||
<arg>--disable-win32-backend</arg>
|
||||
<arg>--enable-quartz-backend</arg>
|
||||
<arg>--disable-quartz-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-introspection=[no/auto/yes]</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg>--enable-gtk2-dependency</arg>
|
||||
<arg>--disable-gtk2-dependency</arg>
|
||||
<arg>--disable-introspection</arg>
|
||||
</group>
|
||||
</cmdsynopsis>
|
||||
</para>
|
||||
@@ -389,14 +371,14 @@ How to compile GTK+ itself
|
||||
|
||||
<para>
|
||||
Normally GTK+ will try to build the input method modules
|
||||
as little shared libraries that are loaded on demand.
|
||||
The <systemitem>--disable-modules</systemitem> argument
|
||||
indicates that they should all be built statically
|
||||
into the GTK+ library instead. This is useful for
|
||||
people who need to produce statically-linked binaries.
|
||||
If neither <systemitem>--disable-modules</systemitem> nor
|
||||
<systemitem>--enable-modules</systemitem> is specified,
|
||||
then the <command>configure</command> script will try to
|
||||
as little shared libraries that are loaded on
|
||||
demand. The <systemitem>--disable-modules</systemitem>
|
||||
argument indicates that they should all be built statically
|
||||
into the GTK+ library instead. This is useful for
|
||||
people who need to produce statically-linked binaries. If
|
||||
neither <systemitem>--disable-modules</systemitem> nor
|
||||
<systemitem>--enable-modules</systemitem> is specified, then
|
||||
the <command>configure</command> script will try to
|
||||
auto-detect whether shared modules work on your system.
|
||||
</para>
|
||||
</formalpara>
|
||||
@@ -406,8 +388,7 @@ How to compile GTK+ itself
|
||||
|
||||
<para>
|
||||
This option allows you to specify which input method modules you
|
||||
want to include directly into the GTK+ shared library, as opposed
|
||||
to building them as loadable modules.
|
||||
want to include.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@@ -415,9 +396,10 @@ How to compile GTK+ itself
|
||||
<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 all cast checks between different object types. Setting it
|
||||
to 'minimum' disables only cast checks. Setting it to 'yes' enables
|
||||
Turns on various amounts of debugging support. Setting this to 'no'
|
||||
disables g_assert(), g_return_if_fail(), g_return_val_if_fail() and
|
||||
all cast checks between different object types. Setting it to 'minimum'
|
||||
disables only cast checks. Setting it to 'yes' enables
|
||||
<link linkend="GTK-Debug-Options">runtime debugging</link>.
|
||||
The default is 'minimum'.
|
||||
Note that 'no' is fast, but dangerous as it tends to destabilize
|
||||
@@ -434,8 +416,6 @@ How to compile GTK+ itself
|
||||
<para>
|
||||
The option <systemitem>--disable-Bsymbolic</systemitem>
|
||||
turns off the use of the -Bsymbolic-functions linker flag.
|
||||
This is only necessary if you want to override GTK+ functions
|
||||
by using <envar>LD_PRELOAD</envar>.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@@ -489,21 +469,6 @@ How to compile GTK+ itself
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--disable-xinput</systemitem> and
|
||||
<systemitem>--enable-xinput</systemitem></title>
|
||||
<para>
|
||||
Controls whether GTK+ is built with support for the XInput
|
||||
or XInput2 extension. These extensions provide an extended
|
||||
interface to input devices such as graphics tablets.
|
||||
When this support is compiled in, specially written
|
||||
GTK+ programs can get access to subpixel positions,
|
||||
multiple simultaneous input devices, and extra "axes"
|
||||
provided by the device such as pressure and tilt
|
||||
information.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--disable-gtk-doc</systemitem> and
|
||||
<systemitem>--enable-gtk-doc</systemitem></title>
|
||||
@@ -548,54 +513,33 @@ How to compile GTK+ itself
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--disable-packagekit</systemitem> and
|
||||
<systemitem>--enable-packagekit</systemitem></title>
|
||||
<title><systemitem>--with-xinput</systemitem></title>
|
||||
<para>
|
||||
By default the <command>configure</command> script will try
|
||||
to build the PackageKit support for the open-with dialog if
|
||||
the PackageKit libraries are found.
|
||||
These options can be used to explicitly control whether
|
||||
PackageKit support should be built.
|
||||
Controls whether GTK+ is built with support for the XInput
|
||||
or XInput2 extension. These extensions provide an extended
|
||||
interface to input devices such as graphics tablets.
|
||||
When this support is compiled in, specially written
|
||||
GTK+ programs can get access to subpixel positions,
|
||||
multiple simultaneous input devices, and extra "axes"
|
||||
provided by the device such as pressure and tilt
|
||||
information.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--enable-x11-backend</systemitem>,
|
||||
<systemitem>--disable-x11-backend</systemitem>,
|
||||
<systemitem>--enable-win32-backend</systemitem>,
|
||||
<systemitem>--disable-win32-backend</systemitem>,
|
||||
<systemitem>--enable-quartz-backend</systemitem>,
|
||||
and <systemitem>--disable-quartz-backend</systemitem></title>
|
||||
<title><systemitem>--with-gdktarget</systemitem></title>
|
||||
|
||||
<para>
|
||||
Enables specific backends for GDK. If none of these options
|
||||
are given, the x11 backend will be enabled by default,
|
||||
unless the platform is Windows, in which case the default is
|
||||
win32. If any backend is explicitly enabled or disabled, no
|
||||
other platform will be enabled automatically. Other
|
||||
supported backends are the quartz backend for OS X.
|
||||
Toggles between the supported backends for GDK.
|
||||
The default is x11, unless the platform is Windows, in which
|
||||
case the default is win32. Other supported backends are
|
||||
the quartz backend for OS X.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--enable-introspection</systemitem></title>
|
||||
<title><systemitem>--disable-introspection</systemitem></title>
|
||||
|
||||
<para>
|
||||
Build with or without introspection support.
|
||||
The default is 'auto'.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--enable-gtk2-dependency</systemitem> or
|
||||
<systemitem>--disable-gtk2-dependency</systemitem></title>
|
||||
|
||||
<para>
|
||||
Whether to rely on an exiting gtk-update-icon-cache utility
|
||||
instead of building our own. Distributions which are shipping
|
||||
both GTK+ 2.x and GTK+ 3 may want to use this option to
|
||||
avoid file conflicts between these packages.
|
||||
The default is to build gtk-update-icon-cache.
|
||||
Build without introspection support.
|
||||
</para>
|
||||
</formalpara>
|
||||
</refsect1>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-compiling">
|
||||
<refentry id="gtk-compiling" revision="4 Feb 2001">
|
||||
<refmeta>
|
||||
<refentrytitle>Compiling GTK+ Applications</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
@@ -32,7 +32,7 @@ your system may be different):
|
||||
$ pkg-config --cflags gtk+-3.0
|
||||
-pthread -I/usr/include/gtk-3.0 -I/usr/lib64/gtk-3.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
|
||||
$ pkg-config --libs gtk+-3.0
|
||||
-pthread -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
|
||||
-pthread -lgtk-3.0 -lgdk-3.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-3.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
@@ -69,34 +69,24 @@ define the preprocessor symbol GDK_MULTIDEVICE_SAFE by using the command
|
||||
line option <literal>-DGTK_MULTIDEVICE_SAFE=1</literal>.
|
||||
</para>
|
||||
|
||||
<refsect2>
|
||||
<title>Useful autotools macros</title>
|
||||
|
||||
<para>
|
||||
GTK+ provides various macros for easily checking version and backends
|
||||
supported. The macros are
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>AM_PATH_GTK_3_0([minimum-version], [if-found], [if-not-found], [modules])</term>
|
||||
<listitem>This macro should be used to check that GTK+ is installed
|
||||
and available for compilation. The four arguments are optional, and
|
||||
they are: <emphasis>minimum-version</emphasis>, the minimum version
|
||||
of GTK+ required for compilation; <emphasis>if-found</emphasis>, the
|
||||
action to perform if a valid version of GTK+ has been found;
|
||||
<emphasis>if-not-found</emphasis>, the action to perform if a valid
|
||||
version of GTK+ has not been found; <emphasis>modules</emphasis>, a
|
||||
list of modules to be checked along with GTK+.</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>GTK_CHECK_BACKEND([backend-name], [minimum-version], [if-found], [if-not-found])</term>
|
||||
<listitem>This macro should be used to check if a specific backend
|
||||
is supported by GTK+. The <emphasis>minimum-version</emphasis>,
|
||||
<emphasis>if-found</emphasis> and <emphasis>if-not-found</emphasis>
|
||||
arguments are optional.</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
<para>
|
||||
The recommended way of using GTK+ has always been to only include the
|
||||
toplevel headers <filename>gtk.h</filename>, <filename>gdk.h</filename>,
|
||||
<filename>gdk-pixbuf.h</filename>.
|
||||
If you want to make sure that your program follows this recommended
|
||||
practise, you can define the preprocessor symbols GTK_DISABLE_SINGLE_INCLUDES
|
||||
and GDK_PIXBUF_DISABLE_SINGLE_INCLUDES to make GTK+ generate an error
|
||||
when individual headers are directly included.
|
||||
There are some exceptions: <filename>gdkkeysyms.h</filename> is not included in
|
||||
<filename>gdk.h</filename> because the file is quite large; see
|
||||
<link linkend="gdk-Keyboard-Handling">Key Values documentation</link>.
|
||||
<filename>gdkx.h</filename> must be included independently because It's
|
||||
platform-specific; see
|
||||
<link linkend="gdk-X-Window-System-Interaction">X Window System Interaction</link>
|
||||
documentation.
|
||||
The same for <filename>gtkunixprint.h</filename> if you use the non-portable
|
||||
<link linkend="GtkPrintUnixDialog">GtkPrintUnixDialog</link> API.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@@ -12,226 +12,97 @@
|
||||
<link linkend="gtk-compiling">Compiling the GTK+ libraries</link>
|
||||
section in this reference.</para>
|
||||
|
||||
<simplesect>
|
||||
<title>Basics</title>
|
||||
<para>To begin our introduction to GTK, we'll start with the simplest
|
||||
program possible. This program will create an empty 200x200 pixel
|
||||
window:</para>
|
||||
|
||||
<para>To begin our introduction to GTK, we'll start with the simplest
|
||||
program possible. This program will create an empty 200x200 pixel
|
||||
window:</para>
|
||||
<para>
|
||||
<inlinegraphic fileref="window-default.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="window-default.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
<informalexample><programlisting>
|
||||
<xi:include href="../../../../examples/window-default.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting></informalexample>
|
||||
|
||||
<informalexample><programlisting>
|
||||
<xi:include href="../../../../examples/window-default.c" parse="text">
|
||||
<para>You can compile the program above with GCC using:</para>
|
||||
|
||||
<para><literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o window-default window-default.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout></para>
|
||||
|
||||
<note><para>For more information on how to compile a GTK+ application, please
|
||||
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
|
||||
section in this reference.</para></note>
|
||||
|
||||
<para>All GTK+ applications will, of course, include
|
||||
<filename>gtk/gtk.h</filename>, which declares functions, types and
|
||||
macros required by GTK+ applications.</para>
|
||||
|
||||
<warning><para>Even if GTK+ installs multiple header files, only the
|
||||
top-level <filename>gtk/gtk.h</filename> header can be directly included
|
||||
by third party code. The compiler will abort with an error if any other
|
||||
header will be included.</para></warning>
|
||||
|
||||
<para>We then proceed into the <function>main</function>() function of the
|
||||
application, and we declare a <varname>window</varname> variable as a pointer
|
||||
of type #GtkWidget.</para>
|
||||
|
||||
<para>The following line will call gtk_init(), which
|
||||
is the initialization function for GTK+; this function will set up GTK+,
|
||||
the type system, the connection to the windowing environment, etc. The
|
||||
gtk_init() takes as arguments the pointers to the command line arguments
|
||||
counter and string array; this allows GTK+ to parse specific command line
|
||||
arguments that control the behavior of GTK+ itself. The parsed arguments
|
||||
will be removed from the array, leaving the unrecognized ones for your
|
||||
application to parse.</para>
|
||||
|
||||
<note><para>For more information on which command line arguments GTK+
|
||||
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
|
||||
Applications</link> section in this reference.</para></note>
|
||||
|
||||
<para>The call to gtk_window_new() will create a new #GtkWindow and store
|
||||
it inside the <varname>window</varname> variable. The type of the window
|
||||
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
|
||||
by the windowing system: it will have a frame, a title bar and window
|
||||
controls, depending on the platform.</para>
|
||||
|
||||
<para>In order to terminate the application when the #GtkWindow is
|
||||
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
|
||||
function. This function will terminate the GTK+ main loop started by calling
|
||||
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
|
||||
destroyed, either by explicitly calling gtk_widget_destroy() or when the
|
||||
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
|
||||
the Close window control button is clicked.</para>
|
||||
|
||||
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
|
||||
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
|
||||
can be displayed. All this work is done after the main loop has been
|
||||
started.</para>
|
||||
|
||||
<para>The last line of interest is the call to gtk_main(). This function will
|
||||
start the GTK+ main loop and will block the control flow of the
|
||||
<function>main</function>() until the gtk_main_quit() function is
|
||||
called.</para>
|
||||
|
||||
<para>The following example is slightly more complex, and tries to
|
||||
showcase some of the capabilities of GTK+.</para>
|
||||
|
||||
<para>In the long tradition of programming languages and libraries,
|
||||
it is called <emphasis>Hello, World</emphasis>.</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="hello-world.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<example id="gtk-getting-started-hello-world">
|
||||
<title>Hello World in GTK+</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/hello-world.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting></informalexample>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>You can compile the program above with GCC using:</para>
|
||||
|
||||
<para><literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o window-default window-default.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout></para>
|
||||
|
||||
<note><para>For more information on how to compile a GTK+ application, please
|
||||
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
|
||||
section in this reference.</para></note>
|
||||
|
||||
<para>All GTK+ applications will, of course, include
|
||||
<filename>gtk/gtk.h</filename>, which declares functions, types and
|
||||
macros required by GTK+ applications.</para>
|
||||
|
||||
<warning><para>Even if GTK+ installs multiple header files, only the
|
||||
top-level <filename>gtk/gtk.h</filename> header can be directly included
|
||||
by third party code. The compiler will abort with an error if any other
|
||||
header is directly included.</para></warning>
|
||||
|
||||
<para>We then proceed into the <function>main</function>() function of the
|
||||
application, and we declare a <varname>window</varname> variable as a pointer
|
||||
of type #GtkWidget.</para>
|
||||
|
||||
<para>The following line will call gtk_init(), which
|
||||
is the initialization function for GTK+; this function will set up GTK+,
|
||||
the type system, the connection to the windowing environment, etc. The
|
||||
gtk_init() takes as arguments the pointers to the command line arguments
|
||||
counter and string array; this allows GTK+ to parse specific command line
|
||||
arguments that control the behavior of GTK+ itself. The parsed arguments
|
||||
will be removed from the array, leaving the unrecognized ones for your
|
||||
application to parse.</para>
|
||||
|
||||
<note><para>For more information on which command line arguments GTK+
|
||||
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
|
||||
Applications</link> section in this reference.</para></note>
|
||||
|
||||
<para>The call to gtk_window_new() will create a new #GtkWindow and store
|
||||
it inside the <varname>window</varname> variable. The type of the window
|
||||
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
|
||||
by the windowing system: it will have a frame, a title bar and window
|
||||
controls, depending on the platform.</para>
|
||||
|
||||
<para>In order to terminate the application when the #GtkWindow is
|
||||
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
|
||||
function. This function will terminate the GTK+ main loop started by calling
|
||||
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
|
||||
destroyed, either by explicitly calling gtk_widget_destroy() or when the
|
||||
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
|
||||
the Close window control button is clicked.</para>
|
||||
|
||||
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
|
||||
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
|
||||
can be displayed. All this work is done after the main loop has been
|
||||
started.</para>
|
||||
|
||||
<para>The last line of interest is the call to gtk_main(). This function will
|
||||
start the GTK+ main loop and will block the control flow of the
|
||||
main() until the gtk_main_quit() function is called.</para>
|
||||
|
||||
<para>While the program is running, GTK+ is receiving
|
||||
<firstterm>events</firstterm>. These are typically input events caused by
|
||||
the user interacting with your program, but also things like messages from
|
||||
the window manager or other applications. GTK+ processes these and as a
|
||||
result, <firstterm>signals</firstterm> may be emitted on your widgets.
|
||||
Connecting handlers for these signals is how you normally make your
|
||||
program do something in response to user input.</para>
|
||||
|
||||
<para>The following example is slightly more complex, and tries to
|
||||
showcase some of the capabilities of GTK+.</para>
|
||||
|
||||
<para>In the long tradition of programming languages and libraries,
|
||||
it is called <emphasis>Hello, World</emphasis>.</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="hello-world.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<example id="gtk-getting-started-hello-world">
|
||||
<title>Hello World in GTK+</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/hello-world.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
<title>Packing</title>
|
||||
|
||||
<para>When creating an application, you'll want to put more than one widget
|
||||
inside a window. Our first helloworld example only used one widget so we
|
||||
could simply use a gtk_container_add() call to "pack" the widget into the
|
||||
window. But when you want to put more than one widget into a window, it
|
||||
it becomes important to control how each widget is positioned and sized.
|
||||
This is where packing comes in.</para>
|
||||
|
||||
<para>GTK+ comes with a large variety of <firstterm>layout containers</firstterm>
|
||||
whose purpose it is to control the layout of the child widgets that are
|
||||
added to them. See <xref linkend="LayoutContainers"/> for an overview.</para>
|
||||
|
||||
<para>The following example shows how the GtkGrid container lets you
|
||||
arrange several buttons:</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="grid-packing.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<example id="gtk-getting-started-grid-packing">
|
||||
<title>Packing buttons</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/grid-packing.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
<title>Drawing</title>
|
||||
|
||||
<para>Many widgets, like buttons, do all their drawing themselves. You
|
||||
just tell them the label you want to see, and they figure out what font
|
||||
to use, draw the button outline and focus rectangle, etc. Sometimes, it
|
||||
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
|
||||
might be the right widget to use. It offers a canvas on which you can
|
||||
draw by connecting to the #GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
<para>The following example shows a ::draw signal handler. It is a bit
|
||||
more complicated than the previous examples, since it also demonstrates
|
||||
input event handling by means of ::button-press and ::motion-notify
|
||||
handlers.</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="drawing.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<example id="gtk-getting-started-drawing">
|
||||
<title>Drawing in response to input</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/drawing.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
<title>Building interfaces</title>
|
||||
|
||||
<para>When construcing a more complicated user interface, with dozens
|
||||
or hundreds of widgets, doing all the setup work in C code is
|
||||
cumbersome, and making changes becomes next to impossible.</para>
|
||||
|
||||
<para>Thankfully, GTK+ supports the separation of user interface
|
||||
layout from your business logic, by using UI descriptions in an
|
||||
XML format that can be parsed by the #GtkBuilder class.</para>
|
||||
|
||||
<example>
|
||||
<title>Packing buttons with GtkBuilder</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/builder.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
The builder.ui file looks like this:
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/builder.ui" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>Note that GtkBuilder can also be used to construct objects
|
||||
that are not widgets, such as tree models, adjustments, etc.
|
||||
That is the reason the method we use here is called
|
||||
gtk_builder_get_object() and returns a GObject* instead of a
|
||||
GtkWidget*.</para>
|
||||
|
||||
<para>Normally, you would pass a full path to
|
||||
gtk_builder_add_from_file() to make the execution of your program
|
||||
independent of the current directory. A common location to install
|
||||
UI descriptions and similar data is
|
||||
<filename>/usr/share/<replaceable>appname</replaceable></filename>.
|
||||
</para>
|
||||
|
||||
<para>It is also possible to embed the UI description in the source
|
||||
code as a string and use gtk_builder_add_from_string() to load it.
|
||||
But keeping the UI description in a separate file has several
|
||||
advantages: It is then possible to make minor adjustments to the UI
|
||||
without recompiling your program, and, more importantly, graphical
|
||||
UI editors such as <ulink url="http://glade.gnome.org">glade</ulink>
|
||||
can load the file and allow you to create and modify your UI by
|
||||
point-and-click.</para>
|
||||
|
||||
</simplesect>
|
||||
</chapter>
|
||||
|
61
docs/reference/gtk/gtk-builder-convert-3.0.xml
Normal file
61
docs/reference/gtk/gtk-builder-convert-3.0.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<refentry id="gtk-builder-convert">
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk-builder-convert-3.0</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk-builder-convert-3.0</refname>
|
||||
<refpurpose>Glade file conversion utility</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>gtk-builder-convert-3.0</command>
|
||||
<arg choice="opt">--skip-windows</arg>
|
||||
<arg choice="opt">--root <replaceable>name</replaceable></arg>
|
||||
<arg choice="req">input</arg>
|
||||
<arg choice="req">output</arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
<para><command>gtk-builder-convert-3.0</command> converts glade files
|
||||
into XML files which can be loaded with GtkBuilder.
|
||||
</para>
|
||||
<para>
|
||||
It expects the name of a glade file as the first argument, and writes
|
||||
its output the file specified as the second argument.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Options</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>--skip-windows</term>
|
||||
<term>-w</term>
|
||||
<listitem><para>Convert everything but GtkWindow subclasses.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>--root</term>
|
||||
<term>-r</term>
|
||||
<listitem><para>Convert only the widget named <replaceable>name</replaceable>
|
||||
and its children.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Bugs</title>
|
||||
<para>
|
||||
Toolbars are not handled.
|
||||
</para>
|
||||
<para>
|
||||
Support for accessibility is not yet implemented.
|
||||
</para>
|
||||
<para>
|
||||
The script requires a python interpreter to run.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
@@ -8,13 +8,11 @@
|
||||
]>
|
||||
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<bookinfo>
|
||||
<title>GTK+ 3 Reference Manual</title>
|
||||
<title>GTK+ Reference Manual</title>
|
||||
<releaseinfo>
|
||||
This document is for the GTK+ 3 library, version &version;.
|
||||
The latest versions can be found online at
|
||||
<ulink role="online-location" url="http://library.gnome.org/devel/gtk3/">http://library.gnome.org/devel/gtk3/</ulink>.
|
||||
If you are looking for the older GTK+ 2 series of libraries,
|
||||
see <ulink role="online-location" url="http://library.gnome.org/devel/gtk/">http://library.gnome.org/devel/gtk/</ulink>.
|
||||
for GTK+ &version;
|
||||
The latest version of this documentation can be found on-line at
|
||||
<ulink role="online-location" url="http://library.gnome.org/devel/gtk/unstable/">http://library.gnome.org/devel/gtk/unstable/</ulink>.
|
||||
</releaseinfo>
|
||||
</bookinfo>
|
||||
|
||||
@@ -63,7 +61,6 @@
|
||||
<xi:include href="xml/gtkgradient.xml" />
|
||||
<xi:include href="xml/gtkicontheme.xml" />
|
||||
<xi:include href="xml/gtkiconfactory.xml" />
|
||||
<xi:include href="xml/gtknumerableicon.xml" />
|
||||
<xi:include href="xml/gtkrc.xml" />
|
||||
<xi:include href="xml/gtkstyle.xml" />
|
||||
</part>
|
||||
@@ -359,7 +356,8 @@
|
||||
<part>
|
||||
<title>GTK+ Tools</title>
|
||||
<xi:include href="gtk-query-immodules-3.0.xml" />
|
||||
<xi:include href="gtk-update-icon-cache.xml" />
|
||||
<xi:include href="gtk-update-icon-cache-3.0.xml" />
|
||||
<xi:include href="gtk-builder-convert-3.0.xml" />
|
||||
</part>
|
||||
|
||||
<xi:include href="glossary.xml" />
|
||||
|
@@ -2,17 +2,16 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-query-immodules-3.0">
|
||||
<refentry id="gtk-query-immodules">
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk-query-immodules-3.0</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="manual">User Commands</refmiscinfo>
|
||||
<refentrytitle>gtk-query-immodules-3.0</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk-query-immodules-3.0</refname>
|
||||
<refpurpose>Input method module registration utility</refpurpose>
|
||||
<refname>gtk-query-immodules-3.0</refname>
|
||||
<refpurpose>Input method module registration utility</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
@@ -39,8 +38,8 @@ may be absolute or relative paths.
|
||||
</para>
|
||||
<para>
|
||||
Normally, the output of <command>gtk-query-immodules-3.0</command> is written
|
||||
to <filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename>, where GTK+ looks for it by default. If it is written to some other
|
||||
location, the environment variable <link linkend="gtk-im-module-file"><envar>GTK_IM_MODULE_FILE</envar></link>
|
||||
to <filename><replaceable>libdir</replaceable>gtk-3.0/3.0.0/immodules.cache</filename>, where GTK+ looks for it by default. If it is written to some other
|
||||
location, the environment variable <link linkend="GTK_IM_MODULE_FILE"><envar>GTK_IM_MODULE_FILE</envar></link>
|
||||
can be set to point GTK+ at the file.
|
||||
</para>
|
||||
</refsect1>
|
||||
@@ -57,7 +56,7 @@ can be set to point GTK+ at the file.
|
||||
|
||||
<refsect1><title>Environment</title>
|
||||
<para>
|
||||
The environment variable <link linkend="gtk-path"><envar>GTK_PATH</envar></link>
|
||||
The environment variable <link linkend="GTK_PATH"><envar>GTK_PATH</envar></link>
|
||||
can be used to prepend directories to the input method module path.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@@ -5,45 +5,43 @@
|
||||
<refentry id="gtk-update-icon-cache">
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk-update-icon-cache</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="manual">User Commands</refmiscinfo>
|
||||
<refentrytitle>gtk-update-icon-cache-3.0</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk-update-icon-cache</refname>
|
||||
<refpurpose>Icon theme caching utility</refpurpose>
|
||||
<refname>gtk-update-icon-cache-3.0</refname>
|
||||
<refpurpose>Icon theme caching utility</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>gtk-update-icon-cache</command>
|
||||
<command>gtk-update-icon-cache-3.0</command>
|
||||
<arg choice="opt">--force</arg>
|
||||
<arg choice="opt">--ignore-theme-index</arg>
|
||||
<arg choice="opt">--index-only</arg>
|
||||
<arg choice="opt">--source <arg choice="plain"><replaceable>NAME</replaceable></arg></arg>
|
||||
<arg choice="opt">--source<arg>name</arg></arg>
|
||||
<arg choice="opt">--quiet</arg>
|
||||
<arg choice="opt">--validate</arg>
|
||||
<arg choice="plain"><replaceable>PATH</replaceable></arg>
|
||||
<arg choice="req">iconpath</arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>gtk-update-icon-cache</command> creates mmapable cache
|
||||
<command>gtk-update-icon-cache-3.0</command> creates mmap()able cache
|
||||
files for icon themes.
|
||||
</para>
|
||||
<para>
|
||||
It expects to be given the <replaceable>PATH</replaceable> to a icon theme
|
||||
directory containing an <filename>index.theme</filename>, e.g.
|
||||
<filename>/usr/share/icons/hicolor</filename>, and writes a
|
||||
<filename>icon-theme.cache</filename> containing cached information about
|
||||
the icons in the directory tree below the given directory.
|
||||
It expects to be given the path to a icon theme directory containing an
|
||||
<filename>index.theme</filename>, e.g. <filename>/usr/share/icons/hicolor</filename>,
|
||||
and writes a <filename>icon-theme.cache</filename> containing cached
|
||||
information about the icons in the directory tree below the given directory.
|
||||
</para>
|
||||
<para>
|
||||
GTK+ can use the cache files created by <command>gtk-update-icon-cache</command>
|
||||
GTK+ can use the cache files created by <command>gtk-update-icon-cache-3.0</command>
|
||||
to avoid a lot of system call and disk seek overhead when the application
|
||||
starts. Since the format of the cache files allows them to be mmaped
|
||||
starts. Since the format of the cache files allows them to be mmap()ed
|
||||
shared between multiple applications, the overall memory consumption is
|
||||
reduced as well.
|
||||
</para>
|
||||
@@ -61,8 +59,8 @@
|
||||
<varlistentry>
|
||||
<term>--ignore-theme-index</term>
|
||||
<term>-t</term>
|
||||
<listitem><para>Don't check for the existence of <filename>index.theme</filename>
|
||||
in the icon theme directory. Without this option, <command>gtk-update-icon-cache</command>
|
||||
<listitem><para>Don't check for the existence of 'index.theme' in the icon
|
||||
theme directory. Without this option, <command>gtk-update-icon-cache-3.0</command>
|
||||
refuses to create an icon cache in a directory which does not appear to
|
||||
be the toplevel directory of an icon theme.
|
||||
</para></listitem>
|
||||
@@ -79,7 +77,7 @@
|
||||
<term>--source</term>
|
||||
<term>-c</term>
|
||||
<listitem><para>Output a C header file declaring a constant
|
||||
<replaceable>NAME</replaceable> with the contents of the icon
|
||||
<replaceable>name</replaceable> with the contents of the icon
|
||||
cache.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -106,3 +104,5 @@ None known yet.
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
|
@@ -791,8 +791,6 @@ gtk_combo_box_new
|
||||
gtk_combo_box_new_with_entry
|
||||
gtk_combo_box_new_with_model
|
||||
gtk_combo_box_new_with_model_and_entry
|
||||
gtk_combo_box_new_with_area
|
||||
gtk_combo_box_new_with_area_and_entry
|
||||
gtk_combo_box_get_wrap_width
|
||||
gtk_combo_box_set_wrap_width
|
||||
gtk_combo_box_get_row_span_column
|
||||
@@ -1621,7 +1619,6 @@ gtk_hseparator_get_type
|
||||
GtkIconView
|
||||
GtkIconViewForeachFunc
|
||||
gtk_icon_view_new
|
||||
gtk_icon_view_new_with_area
|
||||
gtk_icon_view_new_with_model
|
||||
gtk_icon_view_set_model
|
||||
gtk_icon_view_get_model
|
||||
@@ -1679,7 +1676,7 @@ gtk_icon_view_unset_model_drag_source
|
||||
gtk_icon_view_unset_model_drag_dest
|
||||
gtk_icon_view_set_reorderable
|
||||
gtk_icon_view_get_reorderable
|
||||
gtk_icon_view_set_drag_dest_item
|
||||
gtk_icon_view_set_drag_dest_item
|
||||
gtk_icon_view_get_drag_dest_item
|
||||
gtk_icon_view_get_dest_item_at_pos
|
||||
gtk_icon_view_create_drag_icon
|
||||
@@ -2058,8 +2055,6 @@ gtk_menu_item_deselect
|
||||
gtk_menu_item_activate
|
||||
gtk_menu_item_toggle_size_request
|
||||
gtk_menu_item_toggle_size_allocate
|
||||
gtk_menu_item_get_reserve_indicator
|
||||
gtk_menu_item_set_reserve_indicator
|
||||
<SUBSECTION Standard>
|
||||
GTK_MENU_ITEM
|
||||
GTK_IS_MENU_ITEM
|
||||
@@ -2272,34 +2267,6 @@ GtkNotebookTab
|
||||
GtkNotebookPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtknumerableicon</FILE>
|
||||
<TITLE>GtkNumerableIcon</TITLE>
|
||||
GtkNumerableIcon
|
||||
gtk_numerable_icon_new
|
||||
gtk_numerable_icon_new_with_style_context
|
||||
gtk_numerable_icon_get_background_gicon
|
||||
gtk_numerable_icon_set_background_gicon
|
||||
gtk_numerable_icon_get_background_icon_name
|
||||
gtk_numerable_icon_set_background_icon_name
|
||||
gtk_numerable_icon_get_count
|
||||
gtk_numerable_icon_set_count
|
||||
gtk_numerable_icon_get_label
|
||||
gtk_numerable_icon_set_label
|
||||
gtk_numerable_icon_get_style_context
|
||||
gtk_numerable_icon_set_style_context
|
||||
<SUBSECTION Standard>
|
||||
GTK_NUMERABLE_ICON
|
||||
GTK_IS_NUMERABLE_ICON
|
||||
GTK_TYPE_NUMERABLE_ICON
|
||||
GTK_NUMERABLE_ICON_CLASS
|
||||
GTK_IS_NUMERABLE_ICON_CLASS
|
||||
GTK_NUMERABLE_ICON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_numerable_icon_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkoffscreenwindow</FILE>
|
||||
<TITLE>GtkOffscreenWindow</TITLE>
|
||||
@@ -2480,15 +2447,15 @@ gtk_range_set_fill_level
|
||||
gtk_range_set_restrict_to_fill_level
|
||||
gtk_range_set_show_fill_level
|
||||
gtk_range_get_adjustment
|
||||
gtk_range_set_update_policy
|
||||
gtk_range_set_adjustment
|
||||
gtk_range_get_inverted
|
||||
gtk_range_set_inverted
|
||||
gtk_range_get_update_policy
|
||||
gtk_range_get_value
|
||||
gtk_range_set_value
|
||||
gtk_range_set_increments
|
||||
gtk_range_set_range
|
||||
gtk_range_get_round_digits
|
||||
gtk_range_set_round_digits
|
||||
gtk_range_set_value
|
||||
GtkSensitivityType
|
||||
gtk_range_set_lower_stepper_sensitivity
|
||||
gtk_range_get_lower_stepper_sensitivity
|
||||
@@ -3450,7 +3417,6 @@ gtk_text_view_move_mark_onscreen
|
||||
gtk_text_view_place_cursor_onscreen
|
||||
gtk_text_view_get_visible_rect
|
||||
gtk_text_view_get_iter_location
|
||||
gtk_text_view_get_cursor_locations
|
||||
gtk_text_view_get_line_at_y
|
||||
gtk_text_view_get_line_yrange
|
||||
gtk_text_view_get_iter_at_location
|
||||
@@ -3954,7 +3920,6 @@ gtk_tree_model_get_iter_first
|
||||
gtk_tree_model_get_path
|
||||
gtk_tree_model_get_value
|
||||
gtk_tree_model_iter_next
|
||||
gtk_tree_model_iter_previous
|
||||
gtk_tree_model_iter_children
|
||||
gtk_tree_model_iter_has_child
|
||||
gtk_tree_model_iter_n_children
|
||||
@@ -4204,7 +4169,6 @@ gtk_tree_view_column_set_clickable
|
||||
gtk_tree_view_column_get_clickable
|
||||
gtk_tree_view_column_set_widget
|
||||
gtk_tree_view_column_get_widget
|
||||
gtk_tree_view_column_get_button
|
||||
gtk_tree_view_column_set_alignment
|
||||
gtk_tree_view_column_get_alignment
|
||||
gtk_tree_view_column_set_reorderable
|
||||
@@ -4289,7 +4253,6 @@ gtk_tree_view_row_expanded
|
||||
gtk_tree_view_set_reorderable
|
||||
gtk_tree_view_get_reorderable
|
||||
gtk_tree_view_get_path_at_pos
|
||||
gtk_tree_view_is_blank_at_pos
|
||||
gtk_tree_view_get_cell_area
|
||||
gtk_tree_view_get_background_area
|
||||
gtk_tree_view_get_visible_rect
|
||||
@@ -4362,7 +4325,6 @@ gtk_tree_view_get_type
|
||||
<TITLE>GtkCellView</TITLE>
|
||||
GtkCellView
|
||||
gtk_cell_view_new
|
||||
gtk_cell_view_new_with_context
|
||||
gtk_cell_view_new_with_text
|
||||
gtk_cell_view_new_with_markup
|
||||
gtk_cell_view_new_with_pixbuf
|
||||
@@ -4373,10 +4335,6 @@ gtk_cell_view_get_displayed_row
|
||||
gtk_cell_view_get_size_of_row
|
||||
gtk_cell_view_set_background_color
|
||||
gtk_cell_view_set_background_rgba
|
||||
gtk_cell_view_set_draw_sensitive
|
||||
gtk_cell_view_get_draw_sensitive
|
||||
gtk_cell_view_set_fit_model
|
||||
gtk_cell_view_get_fit_model
|
||||
<SUBSECTION Standard>
|
||||
GtkCellViewClass
|
||||
GTK_TYPE_CELL_VIEW
|
||||
@@ -4430,6 +4388,8 @@ gtk_cell_area_foreach
|
||||
gtk_cell_area_foreach_alloc
|
||||
gtk_cell_area_event
|
||||
gtk_cell_area_render
|
||||
gtk_cell_area_set_style_detail
|
||||
gtk_cell_area_get_style_detail
|
||||
gtk_cell_area_get_cell_allocation
|
||||
gtk_cell_area_get_cell_at_position
|
||||
gtk_cell_area_create_context
|
||||
@@ -4495,7 +4455,6 @@ gtk_cell_area_context_get_preferred_width_for_height
|
||||
gtk_cell_area_context_get_allocation
|
||||
gtk_cell_area_context_push_preferred_width
|
||||
gtk_cell_area_context_push_preferred_height
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_CELL_AREA_CONTEXT
|
||||
GTK_IS_CELL_AREA_CONTEXT
|
||||
@@ -4517,22 +4476,14 @@ gtk_cell_area_box_pack_start
|
||||
gtk_cell_area_box_pack_end
|
||||
gtk_cell_area_box_get_spacing
|
||||
gtk_cell_area_box_set_spacing
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_CELL_AREA_BOX
|
||||
GTK_IS_CELL_AREA_BOX
|
||||
GTK_TYPE_CELL_AREA_BOX
|
||||
gtk_cell_area_box_get_type
|
||||
GTK_CELL_AREA_BOX_CLASS
|
||||
GTK_IS_CELL_AREA_BOX_CLASS
|
||||
GTK_CELL_AREA_BOX_GET_CLASS
|
||||
GTK_CELL_AREA_BOX_CONTEXT
|
||||
GTK_CELL_AREA_BOX_CONTEXT_CLASS
|
||||
GTK_CELL_AREA_BOX_CONTEXT_GET_CLASS
|
||||
GTK_IS_CELL_AREA_BOX_CONTEXT
|
||||
GTK_IS_CELL_AREA_BOX_CONTEXT_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_cell_area_box_get_type
|
||||
GtkCellAreaBoxPrivate
|
||||
</SECTION>
|
||||
|
||||
@@ -4559,7 +4510,6 @@ gtk_cell_renderer_get_alignment
|
||||
gtk_cell_renderer_set_alignment
|
||||
gtk_cell_renderer_get_padding
|
||||
gtk_cell_renderer_set_padding
|
||||
gtk_cell_renderer_get_state
|
||||
gtk_cell_renderer_is_activatable
|
||||
|
||||
<SUBSECTION Width-for-height>
|
||||
@@ -4569,6 +4519,8 @@ 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
|
||||
@@ -4580,8 +4532,6 @@ GTK_CELL_RENDERER_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkCellRendererPrivate
|
||||
gtk_cell_renderer_get_type
|
||||
gtk_cell_renderer_mode_get_type
|
||||
gtk_cell_renderer_state_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -4745,7 +4695,6 @@ GTK_IS_CELL_RENDERER_ACCEL_CLASS
|
||||
GTK_CELL_RENDERER_ACCEL_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_cell_renderer_accel_get_type
|
||||
gtk_cell_renderer_accel_mode_get_type
|
||||
GtkCellRendererAccelPrivate
|
||||
</SECTION>
|
||||
|
||||
@@ -4981,8 +4930,6 @@ gtk_widget_add_events
|
||||
gtk_widget_set_device_events
|
||||
gtk_widget_get_device_events
|
||||
gtk_widget_add_device_events
|
||||
gtk_widget_set_device_enabled
|
||||
gtk_widget_get_device_enabled
|
||||
gtk_widget_get_toplevel
|
||||
gtk_widget_get_ancestor
|
||||
gtk_widget_get_visual
|
||||
@@ -5290,7 +5237,6 @@ gtk_window_resize_grip_is_visible
|
||||
gtk_window_get_resize_grip_area
|
||||
gtk_window_get_application
|
||||
gtk_window_set_application
|
||||
gtk_window_set_has_user_ref_count
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_WINDOW
|
||||
@@ -5363,6 +5309,16 @@ gtk_grab_remove
|
||||
gtk_device_grab_add
|
||||
gtk_device_grab_remove
|
||||
|
||||
<SUBSECTION>
|
||||
GtkFunction
|
||||
gtk_quit_add_destroy
|
||||
gtk_quit_add
|
||||
GtkCallbackMarshal
|
||||
GtkArg
|
||||
gtk_quit_add_full
|
||||
gtk_quit_remove
|
||||
gtk_quit_remove_by_data
|
||||
|
||||
<SUBSECTION>
|
||||
GTK_PRIORITY_RESIZE
|
||||
|
||||
@@ -5534,22 +5490,6 @@ GTK_STYLE_CLASS_MENUITEM
|
||||
GTK_STYLE_CLASS_PROGRESSBAR
|
||||
GTK_STYLE_CLASS_SPINNER
|
||||
GTK_STYLE_CLASS_TOOLBAR
|
||||
GTK_STYLE_CLASS_PANE_SEPARATOR
|
||||
GTK_STYLE_CLASS_DND
|
||||
GTK_STYLE_CLASS_ERROR
|
||||
GTK_STYLE_CLASS_EXPANDER
|
||||
GTK_STYLE_CLASS_FRAME
|
||||
GTK_STYLE_CLASS_HIGHLIGHT
|
||||
GTK_STYLE_CLASS_INFO
|
||||
GTK_STYLE_CLASS_MARK
|
||||
GTK_STYLE_CLASS_NOTEBOOK
|
||||
GTK_STYLE_CLASS_QUESTION
|
||||
GTK_STYLE_CLASS_SCALE
|
||||
GTK_STYLE_CLASS_SPINBUTTON
|
||||
GTK_STYLE_CLASS_VIEW
|
||||
GTK_STYLE_CLASS_WARNING
|
||||
GTK_STYLE_CLASS_HORIZONTAL
|
||||
GTK_STYLE_CLASS_VERTICAL
|
||||
GTK_STYLE_REGION_COLUMN
|
||||
GTK_STYLE_REGION_COLUMN_HEADER
|
||||
GTK_STYLE_REGION_ROW
|
||||
@@ -5584,8 +5524,6 @@ gtk_style_context_lookup_icon_set
|
||||
gtk_style_context_notify_state_change
|
||||
gtk_style_context_pop_animatable_region
|
||||
gtk_style_context_push_animatable_region
|
||||
gtk_style_context_cancel_animations
|
||||
gtk_style_context_scroll_animations
|
||||
gtk_style_context_remove_provider
|
||||
gtk_style_context_remove_provider_for_screen
|
||||
gtk_style_context_reset_widgets
|
||||
@@ -5753,7 +5691,6 @@ gtk_style_new
|
||||
gtk_style_copy
|
||||
gtk_style_attach
|
||||
gtk_style_detach
|
||||
gtk_style_get_context
|
||||
gtk_style_set_background
|
||||
gtk_style_apply_default_background
|
||||
gtk_style_lookup_color
|
||||
@@ -5887,7 +5824,6 @@ gtk_selection_data_targets_include_rich_text
|
||||
gtk_selection_data_get_selection
|
||||
gtk_selection_data_get_data
|
||||
gtk_selection_data_get_length
|
||||
gtk_selection_data_get_data_with_length
|
||||
gtk_selection_data_get_data_type
|
||||
gtk_selection_data_get_display
|
||||
gtk_selection_data_get_format
|
||||
@@ -6014,7 +5950,6 @@ gtk_bindings_activate
|
||||
gtk_bindings_activate_event
|
||||
gtk_binding_set_activate
|
||||
gtk_binding_entry_add_signal
|
||||
gtk_binding_entry_add_signal_from_string
|
||||
gtk_binding_entry_skip
|
||||
gtk_binding_entry_remove
|
||||
gtk_binding_set_add_path
|
||||
@@ -6051,6 +5986,7 @@ GtkShadowType
|
||||
GtkStateType
|
||||
GtkStateFlags
|
||||
GtkToolbarStyle
|
||||
GtkUpdateType
|
||||
GtkWindowPosition
|
||||
GtkWindowType
|
||||
GtkSortType
|
||||
@@ -6941,18 +6877,9 @@ gtk_app_chooser_refresh
|
||||
GTK_TYPE_APP_CHOOSER
|
||||
GTK_APP_CHOOSER
|
||||
GTK_IS_APP_CHOOSER
|
||||
GTK_APP_CHOOSER_GET_IFACE
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_app_chooser_get_type
|
||||
GTK_APP_CHOOSER_ONLINE
|
||||
GTK_APP_CHOOSER_ONLINE_GET_IFACE
|
||||
GTK_APP_CHOOSER_ONLINE_PK
|
||||
GTK_APP_CHOOSER_ONLINE_PK_CLASS
|
||||
GTK_APP_CHOOSER_ONLINE_PK_GET_CLASS
|
||||
GTK_IS_APP_CHOOSER_ONLINE
|
||||
GTK_IS_APP_CHOOSER_ONLINE_PK
|
||||
GTK_IS_APP_CHOOSER_ONLINE_PK_CLASS
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -6965,8 +6892,6 @@ gtk_app_chooser_button_append_separator
|
||||
gtk_app_chooser_button_set_active_custom_item
|
||||
gtk_app_chooser_button_get_show_dialog_item
|
||||
gtk_app_chooser_button_set_show_dialog_item
|
||||
gtk_app_chooser_button_get_heading
|
||||
gtk_app_chooser_button_set_heading
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkAppChooserButtonClass
|
||||
@@ -6989,8 +6914,6 @@ GtkAppChooserDialog
|
||||
gtk_app_chooser_dialog_new
|
||||
gtk_app_chooser_dialog_new_for_content_type
|
||||
gtk_app_chooser_dialog_get_widget
|
||||
gtk_app_chooser_dialog_set_heading
|
||||
gtk_app_chooser_dialog_get_heading
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkAppChooserDialogClass
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include <gtk/gtkx.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gtk/gtkunixprint.h>
|
||||
|
||||
gtk_about_dialog_get_type
|
||||
@@ -101,7 +101,6 @@ gtk_message_dialog_get_type
|
||||
gtk_misc_get_type
|
||||
gtk_mount_operation_get_type
|
||||
gtk_notebook_get_type
|
||||
gtk_numerable_icon_get_type
|
||||
gtk_offscreen_window_get_type
|
||||
gtk_orientable_get_type
|
||||
gtk_page_setup_get_type
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 51 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB |
@@ -100,11 +100,10 @@
|
||||
</para>
|
||||
<para>
|
||||
To ensure that your application does not have problems with this, you
|
||||
define the preprocessor symbol <literal>GSEAL_ENABLE</literal> while
|
||||
building your application against GTK+ 2.x. This will make the compiler
|
||||
catch all uses of direct access to struct fields so that you can go
|
||||
through them one by one and replace them with a call to an accessor
|
||||
function instead.
|
||||
define the preprocessor symbol <literal>GSEAL_ENABLE</literal>. This
|
||||
will make the compiler catch all uses of direct access to struct fields
|
||||
so that you can go through them one by one and replace them with a call
|
||||
to an accessor function instead.
|
||||
<programlisting>
|
||||
make CFLAGS+="-DGSEAL_ENABLE"
|
||||
</programlisting>
|
||||
@@ -144,8 +143,8 @@
|
||||
GAppLaunchContext *context;
|
||||
GError *error = NULL;
|
||||
|
||||
info = (GAppInfo*) g_desktop_app_info_new ("epiphany.desktop");
|
||||
context = (GAppLaunchContext*) gdk_display_get_app_launch_context (display);
|
||||
info = g_desktop_app_info_new ("epiphany.desktop");
|
||||
context = gdk_display_get_app_launch_context (display);
|
||||
g_app_info_launch (info, NULL, context, &error);
|
||||
|
||||
if (error)
|
||||
@@ -157,10 +156,6 @@
|
||||
g_object_unref (info);
|
||||
g_object_unref (context);
|
||||
</programlisting></informalexample>
|
||||
Remember that you have to include
|
||||
<filename>gio/gdesktopappinfo.h</filename>
|
||||
and use the <filename>gio-unix-2.0</filename> pkg-config file
|
||||
when using g_desktop_app_info_new().
|
||||
</listitem>
|
||||
<listitem>If you are launching a custom commandline, you can
|
||||
still use g_app_info_launch() with a GAppInfo that is constructed
|
||||
@@ -199,7 +194,7 @@
|
||||
<title>Drawing a GdkPixbuf onto a GdkWindow</title>
|
||||
<para>
|
||||
Drawing a pixbuf onto a drawable used to be done like this:
|
||||
<informalexample><programlisting>
|
||||
<programlisting><![CDATA[
|
||||
gdk_draw_pixbuf (window,
|
||||
gtk_widget_get_style (widget)->black_gc,
|
||||
pixbuf,
|
||||
@@ -209,17 +204,16 @@ gdk_draw_pixbuf (window,
|
||||
gdk_pixbuf_get_height (pixbuf),
|
||||
GDK_RGB_DITHER_NORMAL,
|
||||
0, 0);
|
||||
</programlisting></informalexample>
|
||||
]]></programlisting>
|
||||
Doing the same thing with cairo:
|
||||
<informalexample><programlisting>
|
||||
<programlisting><![CDATA[
|
||||
cairo_t *cr = gdk_cairo_create (window);
|
||||
gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
</programlisting></informalexample>
|
||||
Note that very similar code can be used when porting code
|
||||
using GdkPixmap to #cairo_surface_t by calling
|
||||
cairo_set_source_surface() instead of
|
||||
]]></programlisting>
|
||||
Note that very similar code can be used for drawing pixmaps
|
||||
by using gdk_cairo_set_source_pixmap() instead of
|
||||
gdk_cairo_set_source_pixbuf().
|
||||
</para>
|
||||
</example>
|
||||
@@ -228,7 +222,7 @@ cairo_destroy (cr);
|
||||
<para>
|
||||
Tiled pixmaps are often used for drawing backgrounds.
|
||||
Old code looked something like this:
|
||||
<informalexample><programlisting>
|
||||
<programlisting><![CDATA[
|
||||
GdkGCValues gc_values;
|
||||
GdkGC *gc;
|
||||
|
||||
@@ -238,30 +232,26 @@ gdk_gc_set_tile (gc, pixmap);
|
||||
gdk_gc_set_fill (gc, GDK_TILED);
|
||||
gdk_gc_set_ts_origin (gc, x_origin, y_origin);
|
||||
/* use */
|
||||
gdk_draw_rectangle (window, gc, TRUE, 0, 0, width, height);
|
||||
gdk_draw_rectangle (drawable, gc, TRUE, 0, 0, width, height);
|
||||
/* restore */
|
||||
gdk_gc_set_tile (gc, NULL);
|
||||
gdk_gc_set_fill (gc, GDK_SOLID);
|
||||
gdk_gc_set_ts_origin (gc, 0, 0);
|
||||
</programlisting></informalexample>
|
||||
The equivalent cairo code to draw a tiled surface looks
|
||||
like this:
|
||||
<informalexample><programlisting>
|
||||
]]></programlisting>
|
||||
The equivalent cairo code looks like this:
|
||||
<programlisting><![CDATA[
|
||||
cairo_t *cr;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = ...
|
||||
cr = gdk_cairo_create (window);
|
||||
cairo_set_source_surface (cr, surface, x_origin, y_origin);
|
||||
cr = gdk_cairo_create (drawable);
|
||||
gdk_cairo_set_source_pixmap (cr, pixmap, x_origin, y_origin);
|
||||
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_fill (cr);
|
||||
cairo_destroy (cr);
|
||||
</programlisting></informalexample>
|
||||
The surface here can be either an image surface or a X surface,
|
||||
and can either be created on the spot or kept around for caching purposes.
|
||||
Another alternative is to use pixbufs instead of surfaces with
|
||||
gdk_cairo_set_source_pixbuf() instead of cairo_set_source_surface().
|
||||
]]></programlisting>
|
||||
Again, you can exchange pixbufs and pixmaps by using
|
||||
gdk_cairo_set_source_pixbuf() instead of
|
||||
gdk_cairo_set_source_pixmap().
|
||||
</para>
|
||||
</example>
|
||||
<example>
|
||||
@@ -269,38 +259,32 @@ gdk_cairo_set_source_pixbuf() instead of cairo_set_source_surface().
|
||||
<para>
|
||||
Drawing layouts clipped is often used to avoid overdraw or to
|
||||
allow drawing selections. Code would have looked like this:
|
||||
<informalexample><programlisting>
|
||||
<programlisting><![CDATA[
|
||||
GdkGC *gc;
|
||||
|
||||
/* setup */
|
||||
gc = gtk_widget_get_style (widget)->text_gc[state];
|
||||
gdk_gc_set_clip_rectangle (gc, &area);
|
||||
gdk_gc_set_clip_rectangle (gc, &area);
|
||||
/* use */
|
||||
gdk_draw_layout (drawable, gc, x, y, layout);
|
||||
/* restore */
|
||||
gdk_gc_set_clip_rectangle (gc, NULL);
|
||||
</programlisting></informalexample>
|
||||
]]></programlisting>
|
||||
With cairo, the same effect can be achieved using:
|
||||
<informalexample><programlisting>
|
||||
GtkStyleContext *context;
|
||||
GtkStateFlags flags;
|
||||
GdkRGBA rgba;
|
||||
<programlisting><![CDATA[
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (drawable);
|
||||
/* clip */
|
||||
gdk_cairo_rectangle (cr, &area);
|
||||
gdk_cairo_rectangle (cr, &area);
|
||||
cairo_clip (cr);
|
||||
/* set the correct source color */
|
||||
context = gtk_widget_get_style_context (widget));
|
||||
state = gtk_widget_get_state_flags (widget);
|
||||
gtk_style_context_get_color (context, state, &rgba);
|
||||
gdk_cairo_set_source_rgba (cr, &rgba);
|
||||
gdk_cairo_set_source_color (cr, >k_widget_get_style (widget)->text[state]);
|
||||
/* draw the text */
|
||||
cairo_move_to (cr, x, y);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
cairo_destroy (cr);
|
||||
</programlisting></informalexample>
|
||||
]]></programlisting>
|
||||
Clipping using cairo_clip() is of course not restricted to text
|
||||
rendering and can be used everywhere where GC clips were used.
|
||||
And using gdk_cairo_set_source_color() with style colors should
|
||||
@@ -316,7 +300,7 @@ cairo_destroy (cr);
|
||||
It was often used to achieve a checkerboard effect. You can use
|
||||
cairo_mask() to achieve this effect. To get a checkerbox mask,
|
||||
you can use code like this:
|
||||
<informalexample><programlisting>
|
||||
<programlisting><![CDATA[
|
||||
static cairo_pattern_t *
|
||||
gtk_color_button_get_checkered (void)
|
||||
{
|
||||
@@ -337,50 +321,44 @@ gtk_color_button_get_checkered (void)
|
||||
|
||||
return pattern;
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
]]></programlisting>
|
||||
Note that stippling looks very outdated in UIs, and is rarely
|
||||
used in modern applications. All properties that made use of
|
||||
stippling have been removed from GTK+ 3. Most prominently,
|
||||
stippling is absent from text rendering, in particular #GtkTextTag.
|
||||
</para>
|
||||
</formalpara>
|
||||
<formalpara><title>Using the target also as source or mask</title>
|
||||
<formalpara><title>Using the the target drawable also as source or mask</title>
|
||||
<para>
|
||||
The gdk_draw_drawable() function allowed using the same drawable
|
||||
as source and target. This was often used to achieve a scrolling
|
||||
effect. Cairo does not allow this yet. You can however use
|
||||
cairo_push_group() to get a different intermediate target that
|
||||
you can copy to. So you can replace this code:
|
||||
<informalexample><programlisting>
|
||||
<programlisting><![CDATA[
|
||||
gdk_draw_drawable (pixmap,
|
||||
gc,
|
||||
pixmap,
|
||||
area.x + dx, area.y + dy,
|
||||
area.x, area.y,
|
||||
area.width, area.height);
|
||||
</programlisting></informalexample>
|
||||
]]></programlisting>
|
||||
By using this code:
|
||||
<informalexample><programlisting>
|
||||
cairo_t *cr = cairo_create (surface);
|
||||
<programlisting><![CDATA[
|
||||
cairo_t *cr = gdk_cairo_create (pixmap);
|
||||
/* clipping restricts the intermediate surface's size, so it's a good idea
|
||||
* to use it. */
|
||||
gdk_cairo_rectangle (cr, &area);
|
||||
gdk_cairo_rectangle (cr, &area);
|
||||
cairo_clip (cr);
|
||||
/* Now push a group to change the target */
|
||||
cairo_push_group (cr);
|
||||
cairo_set_source_surface (cr, surface, dx, dy);
|
||||
gdk_cairo_set_source_pixmap (cr, pixmap, dx, dy);
|
||||
cairo_paint (cr);
|
||||
/* Now copy the intermediate target back */
|
||||
cairo_pop_group_to_source (cr);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
</programlisting></informalexample>
|
||||
The surface here can be either an image surface or a X surface,
|
||||
and can either be created on the spot or kept around for caching purposes.
|
||||
Another alternative is to use pixbufs instead of surfaces with
|
||||
gdk_cairo_set_source_pixbuf() instead of cairo_set_source_surface().
|
||||
</para>
|
||||
<para>
|
||||
]]></programlisting>
|
||||
The cairo developers plan to add self-copies in the future to allow
|
||||
exactly this effect, so you might want to keep up on cairo
|
||||
development to be able to change your code.
|
||||
@@ -627,7 +605,6 @@ gtk_fixed_get_preferred_height (GtkWidget *widget,
|
||||
find-and-replace task. Please refer to the following table:
|
||||
<table>
|
||||
<tgroup cols="2">
|
||||
<title>GdkRegion to cairo_region_t</title>
|
||||
<thead>
|
||||
<row><entry>GDK</entry><entry>cairo</entry></row>
|
||||
</thead>
|
||||
@@ -673,7 +650,7 @@ gtk_fixed_get_preferred_height (GtkWidget *widget,
|
||||
<para>
|
||||
One place where pixmaps were commonly used is to create custom
|
||||
cursors:
|
||||
<informalexample><programlisting>
|
||||
<programlisting>
|
||||
GdkCursor *cursor;
|
||||
GdkPixmap *pixmap;
|
||||
cairo_t *cr;
|
||||
@@ -689,10 +666,10 @@ cairo_destroy (cr);
|
||||
cursor = gdk_cursor_new_from_pixmap (pixmap, pixmap, &fg, &fg, 0, 0);
|
||||
|
||||
g_object_unref (pixmap);
|
||||
</programlisting></informalexample>
|
||||
</programlisting>
|
||||
The same can be achieved without pixmaps, by drawing onto
|
||||
an image surface:
|
||||
<informalexample><programlisting>
|
||||
<programlisting>
|
||||
GdkCursor *cursor;
|
||||
cairo_surface_t *s;
|
||||
cairo_t *cr;
|
||||
@@ -713,26 +690,26 @@ cairo_surface_destroy (s);
|
||||
cursor = gdk_cursor_new_from_pixbuf (display, pixbuf, 0, 0);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
</programlisting></informalexample>
|
||||
</programlisting>
|
||||
</para>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Replace GdkColormap by GdkVisual</title>
|
||||
<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_widget_set_visual() has been added.
|
||||
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>
|
||||
<informalexample><programlisting>
|
||||
<programlisting>
|
||||
static void
|
||||
on_alpha_screen_changed (GtkWidget *widget,
|
||||
GdkScreen *old_screen,
|
||||
@@ -746,11 +723,11 @@ on_alpha_screen_changed (GtkWidget *widget,
|
||||
|
||||
gtk_widget_set_colormap (widget, colormap);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</programlisting>
|
||||
<para>
|
||||
With visuals instead of colormaps, this will look as follows:
|
||||
</para>
|
||||
<informalexample><programlisting>
|
||||
<programlisting>
|
||||
static void
|
||||
on_alpha_screen_changed (GtkWindow *window,
|
||||
GdkScreen *old_screen,
|
||||
@@ -762,178 +739,12 @@ on_alpha_screen_changed (GtkWindow *window,
|
||||
if (visual == NULL)
|
||||
visual = gdk_screen_get_system_visual (screen);
|
||||
|
||||
gtk_widget_set_visual (window, visual);
|
||||
gtk_window_set_visual (window, visual);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GdkDrawable is gone</title>
|
||||
|
||||
<para>
|
||||
#GdkDrawable has been removed in GTK+ 3, together with #GdkPixmap
|
||||
and #GdkImage. The only remaining drawable class is #GdkWindow.
|
||||
For dealing with image data, you should use a #cairo_surface_t or
|
||||
a #GdkPixbuf.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GdkDrawable functions that are useful with windows have been replaced
|
||||
by corresponding GdkWindow functions:
|
||||
<table>
|
||||
<title>GdkDrawable to GdkWindow</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row><entry>GDK 2.x</entry><entry>GDK 3</entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row><entry>gdk_drawable_get_visual()</entry><entry>gdk_window_get_visual()</entry></row>
|
||||
<row><entry>gdk_drawable_get_size()</entry><entry>gdk_window_get_width()
|
||||
gdk_window_get_height()</entry></row>
|
||||
<row><entry>gdk_pixbuf_get_from_drawable()</entry><entry>gdk_pixbuf_get_from_window()</entry></row>
|
||||
<row><entry>gdk_drawable_get_clip_region()</entry><entry>gdk_window_get_clip_region()</entry></row>
|
||||
<row><entry>gdk_drawable_get_visible_region()</entry><entry>gdk_window_get_visible_region()</entry></row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Event filtering</title>
|
||||
|
||||
<para>
|
||||
If your application uses the low-level event filtering facilities in GDK,
|
||||
there are some changes you need to be aware of.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The special-purpose GdkEventClient events and the gdk_add_client_message_filter() and gdk_display_add_client_message_filter() functions have been
|
||||
removed. Receiving X11 ClientMessage events is still possible, using
|
||||
the general gdk_window_add_filter() API. A client message filter like
|
||||
<informalexample><programlisting>
|
||||
static GdkFilterReturn
|
||||
message_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
|
||||
{
|
||||
XClientMessageEvent *evt = (XClientMessageEvent *)xevent;
|
||||
|
||||
/* do something with evt ... */
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
message_type = gdk_atom_intern ("MANAGER", FALSE);
|
||||
gdk_display_add_client_message_filter (display, message_type, message_filter, NULL);
|
||||
</programlisting></informalexample>
|
||||
then looks like this:
|
||||
<informalexample><programlisting>
|
||||
static GdkFilterReturn
|
||||
event_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
|
||||
{
|
||||
XClientMessageEvent *evt;
|
||||
GdkAtom message_type;
|
||||
|
||||
if (((XEvent *)xevent)->type != ClientMessage)
|
||||
return GDK_FILTER_CONTINUE;
|
||||
|
||||
evt = (XClientMessageEvent *)xevent;
|
||||
message_type = XInternAtom (evt->display, "MANAGER", FALSE);
|
||||
|
||||
if (evt->message_type != message_type)
|
||||
return GDK_FILTER_CONTINUE;
|
||||
|
||||
/* do something with evt ... */
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
gdk_window_add_filter (NULL, message_filter, NULL);
|
||||
</programlisting></informalexample>
|
||||
One advantage of using an event filter is that you can actually
|
||||
remove the filter when you don't need it anymore, using
|
||||
gdk_window_remove_filter().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The other difference to be aware of when working with event filters
|
||||
in GTK+ 3 is that GDK now uses XI2 by default when available. That
|
||||
means that your application does not receive core X11 key or button
|
||||
events. Instead, all input events are delivered as XIDeviceEvents.
|
||||
As a short-term workaround for this, you can force your application
|
||||
to not use XI2, with gdk_disable_multidevice(). In the long term,
|
||||
you probably want to rewrite your event filter to deal with
|
||||
XIDeviceEvents.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Backend-specific code</title>
|
||||
<para>
|
||||
In GTK+ 2.x, GDK could only be compiled for one backend at a time,
|
||||
and the %GDK_WINDOWING_X11 or %GDK_WINDOWING_WIN32 macros could
|
||||
be used to find out which one you are dealing with:
|
||||
<informalexample><programlisting>
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (timestamp != GDK_CURRENT_TIME)
|
||||
gdk_x11_window_set_user_time (gdk_window, timestamp);
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
/* ... win32 specific code ... */
|
||||
#endif
|
||||
</programlisting></informalexample>
|
||||
In GTK+ 3, GDK can be built with multiple backends, and currently
|
||||
used backend has to be determined at runtime, typically using
|
||||
type-check macros on a #GdkDisplay or #GdkWindow. You still need
|
||||
to use the #GDK_WINDOWING macros to only compile code referring
|
||||
to supported backends:
|
||||
<informalexample><programlisting>
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
if (timestamp != GDK_CURRENT_TIME)
|
||||
gdk_x11_window_set_user_time (gdk_window, timestamp);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
if (GDK_IS_WIN32_DISPLAY (display))
|
||||
{
|
||||
/* ... win32 specific code ... */
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
g_warning ("Unsupported GDK backend");
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
If you used the pkg-config variable <varname>target</varname> to
|
||||
conditionally build part of your project depending on the GDK backend,
|
||||
for instance like this:
|
||||
<informalexample><programlisting>
|
||||
AM_CONDITIONAL(BUILD_X11, test `$PKG_CONFIG --variable=target gtk+-2.0` = "x11")
|
||||
</programlisting></informalexample>
|
||||
then you should now use the M4 macro provided by GTK+ itself:
|
||||
<informalexample><programlisting>
|
||||
GTK_CHECK_BACKEND([x11], [3.0.2], [have_x11=yes], [have_x11=no])
|
||||
AM_CONDITIONAL(BUILD_x11, [test "x$have_x11" = "xyes"])
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkPlug and GtkSocket</title>
|
||||
|
||||
<para>
|
||||
The #GtkPlug and #GtkSocket widgets are now X11-specific, and you
|
||||
have to include the <filename><gtk/gtkx.h></filename> header
|
||||
to use them. The previous section about proper handling of
|
||||
backend-specific code applies, if you care about other backends.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>The GtkWidget::draw signal</title>
|
||||
<para>
|
||||
@@ -952,7 +763,7 @@ AM_CONDITIONAL(BUILD_x11, [test "x$have_x11" = "xyes"])
|
||||
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 #GtkWidget::draw signal.
|
||||
before emitting the ::draw signal.
|
||||
</para>
|
||||
<para>
|
||||
There are some special considerations for widgets with multiple windows.
|
||||
@@ -971,7 +782,7 @@ AM_CONDITIONAL(BUILD_x11, [test "x$have_x11" = "xyes"])
|
||||
}
|
||||
...
|
||||
</programlisting></informalexample>
|
||||
In contrast, the #GtkWidget::draw signal handler may have to draw multiple
|
||||
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
|
||||
@@ -1004,13 +815,10 @@ gboolean
|
||||
gtk_arrow_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
gint extent;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
width = gtk_widget_get_allocated_width (widget);
|
||||
height = gtk_widget_get_allocated_height (widget);
|
||||
|
||||
@@ -1018,7 +826,15 @@ gtk_arrow_draw (GtkWidget *widget,
|
||||
x = PAD;
|
||||
y = PAD;
|
||||
|
||||
gtk_render_arrow (context, rc, G_PI / 2, x, y, extent);
|
||||
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>
|
||||
@@ -1057,7 +873,7 @@ gtk_arrow_draw (GtkWidget *widget,
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Check your expand and fill flags</title>
|
||||
<title>Check your expand flags</title>
|
||||
|
||||
<para>
|
||||
The behaviour of expanding widgets has changed slightly in GTK+ 3,
|
||||
@@ -1068,11 +884,6 @@ gtk_arrow_draw (GtkWidget *widget,
|
||||
expand flag of the child from being inherited. See
|
||||
gtk_widget_set_hexpand() and gtk_widget_set_vexpand().
|
||||
</para>
|
||||
<para>
|
||||
If you experience sizing problems with widgets in ported code,
|
||||
carefully check the #GtkBox::expand and #GtkBox::fill flags of your
|
||||
boxes.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -1103,7 +914,7 @@ gtk_arrow_draw (GtkWidget *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 adjust your class_init function,
|
||||
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);
|
||||
@@ -1122,18 +933,6 @@ gtk_arrow_draw (GtkWidget *widget,
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkEntryCompletion signal parameters</title>
|
||||
|
||||
<para>
|
||||
The #GtkEntryCompletion::match-selected and
|
||||
#GtkEntryCompletion::cursor-on-match signals were erroneously
|
||||
given the internal filter model instead of the users model.
|
||||
This oversight has been fixed in GTK+ 3; if you have handlers
|
||||
for these signals, they will likely need slight adjustments.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Resize grips</title>
|
||||
|
||||
|
64
docs/reference/gtk/migrating-ClientSideWindows.sgml
Normal file
64
docs/reference/gtk/migrating-ClientSideWindows.sgml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-ClientSideWindows">
|
||||
|
||||
<title>Migrating to client-side windows</title>
|
||||
|
||||
<para>
|
||||
In version 2.18, GDK has been changed to use client-side windows. This
|
||||
means that there is no longer a 1-1 correspondence between #GdkWindows
|
||||
and windows in the underlying window system. In particular, it is no
|
||||
longer correct to assume that each window has an associated XID.
|
||||
Code that makes this assumption can sometimes be fixed by calling
|
||||
gdk_window_ensure_native() on the windows in question.
|
||||
Calling gdk_x11_window_get_xid() (or GDK_WINDOW_XID()) from the
|
||||
X11-specific API on a non-native window will explicitly call
|
||||
gdk_window_ensure_native(), so old code using this will continue to
|
||||
work. A small gotcha is that the GDK_WINDOW_XID() call is no longer a
|
||||
trivial accessor for the XID of the window, and thus must not be called
|
||||
from another thread without taking locking precautions.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GDK looks for the <envar>GDK_NATIVE_WINDOWS</envar> environment variable
|
||||
and makes all windows native if it is set. It also tries to be more
|
||||
compatible with the way prior versions worked in some other ways.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Some applications assume that they can just operate on the X windows
|
||||
corresponding to their GDK windows without ever telling GDK. One
|
||||
example that we've seen is changing the child window stacking order
|
||||
using XRestackWindows(). Fixing this properly requires to fix the code
|
||||
to use GDK functions to achieve whatever it is trying to achieve.
|
||||
To make this easier in the case of stacking order changes, we've added
|
||||
a gdk_window_restack() function.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
One change that can cause problems for some applications is that GDK
|
||||
is more aggressive about optimizing away expose events. Code that does
|
||||
more than just repainting exposed areas in response to expose events
|
||||
may be affected by this.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Problems can also occur when using cairo for drawing. One thing that can
|
||||
go wrong is clip handling. You may not use cairo_reset_clip() on a
|
||||
cairo_t on a cairo context created via gdk_cairo_create() or passed to
|
||||
the GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Due to a weird API in XClearArea the gdk_window_clear_area() call handled
|
||||
a specified width or height of zero to mean "to end of window" for
|
||||
non-double-buffered drawing. This has been changed to be consistent with
|
||||
the docs and what happens in the double-buffered case. All code in GTK+
|
||||
that relied on this has been fixed, but it is possible (although unlikely)
|
||||
that third party applications rely on this. If you need to do this, just
|
||||
implement it yourself using gdk_drawable_get_size().
|
||||
</para>
|
||||
|
||||
</chapter>
|
98
docs/reference/gtk/migrating-GtkAboutDialog.sgml
Normal file
98
docs/reference/gtk/migrating-GtkAboutDialog.sgml
Normal file
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkAboutDialog">
|
||||
|
||||
<title>Migrating from GnomeAbout to GtkAboutDialog</title>
|
||||
|
||||
<para>
|
||||
Since version 2.6, GTK+ provides the #GtkAboutDialog widget as a
|
||||
replacement for the <structname>GnomeAbout</structname> dialog in
|
||||
the libgnomeui library.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
#GtkAboutDialog supports all features found in <structname>GnomeAbout</structname>.
|
||||
The <structname>GtkAboutDialog</structname> API is bigger, since it follows
|
||||
the GTK+ policy to have getters and setters for all widget properties,
|
||||
but it isn't much more complex than <structname>GnomeAbout</structname>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To convert an application that uses <structname>GnomeAbout</structname> to
|
||||
<structname>GtkAboutDialog</structname>, as a first step, replace calls
|
||||
like
|
||||
<informalexample><programlisting>
|
||||
const gchar *documentors[] = {
|
||||
"Documenter 1",
|
||||
"Documenter 2",
|
||||
NULL
|
||||
};
|
||||
|
||||
const gchar *documentors[] = {
|
||||
"Author 1",
|
||||
"Author 2",
|
||||
NULL
|
||||
};
|
||||
|
||||
GtkWidget *about = gnome_about_new ("GNOME Test Program", VERSION,
|
||||
"(C) 1998-2001 The Free Software Foundation",
|
||||
"Program to display GNOME functions.",
|
||||
authors,
|
||||
documenters,
|
||||
_("translator-credits"),
|
||||
"logo.png");
|
||||
</programlisting></informalexample>
|
||||
by something like
|
||||
<informalexample><programlisting>
|
||||
GdkPixbuf *logo = gdk_pixbuf_new_from_file ("logo.png", NULL);
|
||||
GtkWidget *about = g_object_new (GTK_TYPE_ABOUT_DIALOG,
|
||||
"name", "GNOME Test Program",
|
||||
"version", VERSION,
|
||||
"copyright", "(C) 1998-2001 The Free Software Foundation",
|
||||
"comments", "Program to display GNOME functions.",
|
||||
"authors", authors,
|
||||
"documenters", documenters,
|
||||
"translator-credits", _("translator-credits"),
|
||||
"logo", logo,
|
||||
NULL);
|
||||
g_object_unref (pixbuf);
|
||||
</programlisting></informalexample>
|
||||
If the g_object_new() construction scares you, you can also use
|
||||
gtk_about_dialog_new() to construct the dialog and then use the
|
||||
setters for the individual properties.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once you are done with the initial conversion, you may want to look into
|
||||
using some of the features of <structname>GtkAboutDialog</structname>
|
||||
which are not present in <structname>GnomeAbout</structname>.
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
You can specify license information with the
|
||||
#GtkAboutDialog:license property
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
You can add separate credits for artists with the
|
||||
#GtkAboutDialog:artists property
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
You can add a pointer to the website of your application, using the
|
||||
#GtkAboutDialog:website and #GtkAboutDialog:website-label properties.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
If your credits contain email addresses or URLs, you can turn them
|
||||
into clickable links using gtk_about_dialog_set_email_hook() and
|
||||
gtk_about_dialog_set_url_hook().
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
445
docs/reference/gtk/migrating-GtkAction.sgml
Normal file
445
docs/reference/gtk/migrating-GtkAction.sgml
Normal file
@@ -0,0 +1,445 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkAction">
|
||||
<chapterinfo>
|
||||
<author>
|
||||
<firstname>Federico</firstname>
|
||||
<surname>Mena-Quintero</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>federico@ximian.com</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</chapterinfo>
|
||||
|
||||
<title>Migrating from old menu and toolbar systems to GtkAction</title>
|
||||
|
||||
<para>
|
||||
Prior to GTK+ 2.4, there were several APIs in use to create menus
|
||||
and toolbars. GTK+ itself included #GtkItemFactory, which was
|
||||
historically used in the GIMP; libgnomeui provided the gnome-ui
|
||||
set of macros; libbonoboui provided a complex mechanism to do menu
|
||||
merging across embedded components. GTK+ 2.4 includes a system
|
||||
for creating menus and toolbars, with merging of items, based
|
||||
around the #GtkAction mechanism.
|
||||
</para>
|
||||
|
||||
<section id="actions-and-action-groups">
|
||||
<title>Actions and Action Groups</title>
|
||||
|
||||
<para>
|
||||
A #GtkAction represents an operation that the user can perform from
|
||||
the menus and toolbars of an application. It is similar to "verbs"
|
||||
in other menu systems. A #GtkAction has a name, which is its identifier,
|
||||
and it can have several widgets that represent it in the user interface.
|
||||
For example, an action for <symbol>EditCopy</symbol> can have a menu item
|
||||
as well as a toolbar button associated to it. If there is nothing selected
|
||||
in the document, the application can simply de-sensitize the
|
||||
<symbol>EditCopy</symbol> action; this will cause both the menu
|
||||
item and the toolbar button to be de-sensitized automatically.
|
||||
Similarly, whenever the user selects the menu item or the
|
||||
toolbar button associated to the <symbol>EditCopy</symbol>
|
||||
action, the corresponding #GtkAction object will emit an
|
||||
"activate" signal.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
#GtkActionGroup is simply a group of #GtkAction objects. An
|
||||
application may want to have several groups: one for global
|
||||
actions such as "new document", "about", and "exit"; then one
|
||||
group for each open document with actions specific to the
|
||||
document, such as "cut", "copy", "paste", and "print".
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normal actions are simply commands, such as
|
||||
<symbol>FileSave</symbol> or <symbol>EditCopy</symbol>.
|
||||
Toggle actions can be active or inactive, such as
|
||||
<symbol>FormatBold</symbol> or <symbol>ViewShowRulers</symbol>.
|
||||
Radio actions define a set of items for which one and only one
|
||||
can be active at a time, for example, {
|
||||
<symbol>ViewHighQuality</symbol>,
|
||||
<symbol>ViewNormalQuality</symbol>,
|
||||
<symbol>ViewLowQuality</symbol> }.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="ui-manager">
|
||||
<title>User Interface Manager Object</title>
|
||||
|
||||
<para>
|
||||
#GtkUIManager is an object that can construct menu and toolbar widgets
|
||||
from an XML description. These widgets are in turn associated to
|
||||
corresponding actions and action groups.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
#GtkUIManager supports merging of menus and toolbars for applications
|
||||
that have multiple components, each with separate sets of commands.
|
||||
For example, a word processor that can embed images may want to have
|
||||
toolbar buttons for Bold and Italic when the cursor is on a text
|
||||
block, but Crop and Brightness/Contrast buttons when the cursor
|
||||
is on an image. These actions, which change depending on the
|
||||
state of the application, can be merged and de-merged from a
|
||||
#GtkUIManager as appropriate.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="migrating-gnomeuiinfo">
|
||||
<title>Migrating from GnomeUIInfo</title>
|
||||
|
||||
<para>
|
||||
Prior to GTK+ 2.4, some applications used the GnomeUIInfo
|
||||
mechanism from
|
||||
<filename><libgnomeui/gnome-app-helper.h></filename> to
|
||||
define their menus and toolbars. With it, a program decleres an
|
||||
array of <structname>GnomeUIInfo</structname> structures, which
|
||||
contain information for menu or toolbar items such as their
|
||||
label, icon, and accelerator key. Then, one calls
|
||||
gnome_app_fill_menu() or gnome_app_fill_toolbar(), or one of the
|
||||
related functions, to create the appropriate widgets based on
|
||||
these structures.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A downside of this API is that the same structures are used to
|
||||
pass back pointers to the widgets that got created. This means
|
||||
that the structures cannot simply be kept around if the program
|
||||
requires multiple instances of the user interface (e.g. several
|
||||
windows); each new invocation of gnome_app_fill_menu() would
|
||||
overwrite the widget fields of the structures.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Another disadvantage is that there is no automatic way to
|
||||
synchronize the state of related controls. If there are toolbar
|
||||
toogle buttons for "Bold", "Italic", "Underline", and also
|
||||
corresponding menu items under "Format/Bold", etc., one has to
|
||||
synchronize their toggled states by hand whenever the user
|
||||
selects any one of them.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Finally, there is no way to do menu and toolbar merging for
|
||||
applications that require embedded components.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To convert an application that uses GnomeUIInfo into the new
|
||||
GtkAction mechanism, you need to do several things:
|
||||
</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Separate your existing GnomeUIInfo entries into normal
|
||||
actions, toggle actions, and radio actions, and then create
|
||||
a separate array of #GtkActionEntry structures
|
||||
for each group. This will allow you to create the necessary
|
||||
#GtkActionGroup objects. Note that this does not describe
|
||||
the actual "shape" that your menus and toolbars will have;
|
||||
it simply defines the set of commands that will appear in them.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Create an XML description of your menus and toolbars for use
|
||||
with #GtkUIManager. This defines the actual shape of the menus
|
||||
and toolbars.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Port the code that uses gnome-app and gnome-app-helper to
|
||||
#GtkAction and #GtkUIManager.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
If your GnomeUIInfo entries use GNOME_APP_PIXMAP_DATA or
|
||||
GNOME_APP_PIXMAP_FILENAME for pixmaps, you have to create a
|
||||
#GtkIconFactory, add it to the list of default factories, then
|
||||
create a #GtkIconSet for each of your own icons. Add the sets to
|
||||
the factory, and use the id in the #GtkActionEntry like a regular
|
||||
GTK+ stock id.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<example id="gnomeuiinfo-example">
|
||||
<title>GnomeUIInfo Example</title>
|
||||
|
||||
<para>
|
||||
The following code shows a declaration of a simple menu bar to
|
||||
be used with gnome_app_fill_menu() or similar. The menu hierarchy i
|
||||
looks like this:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><guimenu>File</guimenu></para>
|
||||
<simplelist>
|
||||
<member><guimenuitem>Open</guimenuitem></member>
|
||||
<member><guimenuitem>—</guimenuitem></member>
|
||||
<member><guimenuitem>Exit</guimenuitem></member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><guimenu>View</guimenu></para>
|
||||
<simplelist>
|
||||
<member><guimenuitem>Zoom In</guimenuitem></member>
|
||||
<member><guimenuitem>Zoom Out</guimenuitem></member>
|
||||
<member><guimenuitem>—</guimenuitem></member>
|
||||
<member><guimenuitem>[ ] Full Screen</guimenuitem></member>
|
||||
<member><guimenuitem>—</guimenuitem></member>
|
||||
<member><guimenuitem>( ) High Quality</guimenuitem></member>
|
||||
<member><guimenuitem>( ) Normal Quality</guimenuitem></member>
|
||||
<member><guimenuitem>( ) Low Quality</guimenuitem></member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<programlisting>
|
||||
static GnomeUIInfo file_menu_items[] = {
|
||||
{ GNOME_APP_UI_ITEM, "_Open", "Open a file",
|
||||
open_callback, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GTK_STOCK_OPEN,
|
||||
'o', GDK_CONTROL_MASK, NULL },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_ITEM, "E_xit", "Exit the program",
|
||||
exit_callback, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GTK_STOCK_QUIT,
|
||||
'q', GDK_CONTROL_MASK, NULL},
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo view_radio_items[] = {
|
||||
{ GNOME_APP_UI_ITEM, "_High Quality", "Display images in high quality, slow mode",
|
||||
high_quality_callback, NULL, NULL, GNOME_APP_PIXMAP_FILENAME, "high-quality.png",
|
||||
0, 0, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "_Normal Quality", "Display images in normal quality",
|
||||
normal_quality_callback, NULL, NULL, GNOME_APP_PIXMAP_FILENAME, "normal-quality.png",
|
||||
0, 0, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "_Low Quality", "Display images in low quality, fast mode",
|
||||
low_quality_callback, NULL, NULL, GNOME_APP_PIXMAP_FILENAME, "low-quality.png",
|
||||
0, 0, NULL },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo view_menu_items[] = {
|
||||
{ GNOME_APP_UI_ITEM, "Zoom _In", "Zoom into the image",
|
||||
zoom_in_callback, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GTK_STOCK_ZOOM_IN,
|
||||
GDK_PLUS, 0, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Zoom _Out", "Zoom away from the image",
|
||||
zoom_out_callback, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GTK_STOCK_ZOOM_OUT,
|
||||
GDK_MINUS, 0, NULL },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_TOGGLEITEM, "_Full Screen", "Switch between full screen and windowed mode",
|
||||
full_screen_callback, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL,
|
||||
GDK_F11, 0, NULL },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_RADIOITEMS, NULL, NULL, view_radio_items },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
};
|
||||
|
||||
static GnomeUIInfo menubar[] = {
|
||||
{ GNOME_APP_UI_SUBTREE, "_File", NULL, file_menu_items },
|
||||
{ GNOME_APP_UI_SUBTREE, "_View", NULL, view_menu_items },
|
||||
{ GNOME_APP_UI_ENDOFINFO }
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example id="gnomeuiinfo-action-entries">
|
||||
<title><structname>GtkActionEntry</structname> Structures</title>
|
||||
|
||||
<para>
|
||||
The following code is the set of actions that are present in
|
||||
the <link linkend="gnomeuiinfo-example">previous
|
||||
example</link>. Note that the toggle and radio entries are
|
||||
separate from normal actions. Also, note that #GtkActionEntry
|
||||
structures take key names in the format of gtk_accelerator_parse()
|
||||
rather than key values plus modifiers; you will have to convert these
|
||||
values by hand. For example, %GDK_F11 with no modifiers is equivalent
|
||||
to a key name of <literal>"F11"</literal>. Likewise, <literal>"o"</literal>
|
||||
with %GDK_CONTROL_MASK is equivalent to <literal>"<ontrol>O"</literal>.
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
/* Normal items */
|
||||
static const GtkActionEntry entries[] = {
|
||||
{ "FileMenu", NULL, "_File" },
|
||||
{ "ViewMenu", NULL, "_View" },
|
||||
{ "Open", GTK_STOCK_OPEN, "_Open", "<control>O", "Open a file", open_action_callback },
|
||||
{ "Exit", GTK_STOCK_QUIT, "E_xit", "<control>Q", "Exit the program", exit_action_callback },
|
||||
{ "ZoomIn", GTK_STOCK_ZOOM_IN, "Zoom _In", "plus", "Zoom into the image", zoom_in_action_callback },
|
||||
{ "ZoomOut", GTK_STOCK_ZOOM_OUT, "Zoom _Out", "minus", "Zoom away from the image", zoom_out_action_callback },
|
||||
};
|
||||
|
||||
/* Toggle items */
|
||||
static const GtkToggleActionEntry toggle_entries[] = {
|
||||
{ "FullScreen", NULL, "_Full Screen", "F11", "Switch between full screen and windowed mode", full_screen_action_callback, FALSE }
|
||||
};
|
||||
|
||||
/* Radio items */
|
||||
static const GtkRadioActionEntry radio_entries[] = {
|
||||
{ "HighQuality", "my-stock-high-quality", "_High Quality", NULL, "Display images in high quality, slow mode", 0 },
|
||||
{ "NormalQuality", "my-stock-normal-quality", "_Normal Quality", NULL, "Display images in normal quality", 1 },
|
||||
{ "LowQuality", "my-stock-low-quality", "_Low Quality", NULL, "Display images in low quality, fast mode", 2 }
|
||||
};
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example id="gnomeuiinfo-xml">
|
||||
<title>XML Description</title>
|
||||
|
||||
<para>
|
||||
After extracting the actions, you will need to create an XML
|
||||
description of the actual layout of your menus and toolbars
|
||||
for use with #GtkUIManager. The following code shows a simple
|
||||
menu bar that corresponds to the <link linkend="gnomeuiinfo-example">previous
|
||||
example</link>. Note that the <guimenu>File</guimenu> and
|
||||
<guimenu>View</guimenu> menus have their names specified in
|
||||
the <link linkend="gnomeuiinfo-action-entries">action
|
||||
entries</link>, not in the XML itself. This is because the
|
||||
XML description only contains <emphasis>identifiers</emphasis>
|
||||
for the items in the GUI, rather than human-readable names.
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
static const char *ui_description =
|
||||
"<ui>"
|
||||
" <menubar name='MainMenu'>"
|
||||
" <menu action='FileMenu'>"
|
||||
" <menuitem action='Open'/>"
|
||||
" <menuitem action='Exit'/>"
|
||||
" </menu>"
|
||||
" <menu action='ViewMenu'>"
|
||||
" <menuitem action='ZoomIn'/>"
|
||||
" <menuitem action='ZoomOut'/>"
|
||||
" <separator/>"
|
||||
" <menuitem action='FullScreen'/>"
|
||||
" <separator/>"
|
||||
" <menuitem action='HighQuality'/>"
|
||||
" <menuitem action='NormalQuality'/>"
|
||||
" <menuitem action='LowQuality'/>"
|
||||
" </menu>"
|
||||
" </menubar>"
|
||||
"</ui>";
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example id="gnomeuiinfo-code">
|
||||
<title>Creating the Menu Bar</title>
|
||||
|
||||
<para>
|
||||
In this last example, we will create a #GtkActionGroup based on the
|
||||
<link linkend="gnomeuiinfo-action-entries">action entries</link>
|
||||
we created above. We will then create a #GtkUIManager with the <link
|
||||
linkend="gnomeuiinfo-xml">XML description</link> of the menu
|
||||
layout. We will also extract the accelerator group and the
|
||||
widgets from the #GtkUIManager put them into a window.
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
GtkWidget *window;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *menubar;
|
||||
GtkActionGroup *action_group;
|
||||
GtkUIManager *ui_manager;
|
||||
GtkAccelGroup *accel_group;
|
||||
GError *error;
|
||||
|
||||
register_my_stock_icons (<!-- -->);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
action_group = gtk_action_group_new ("MenuActions");
|
||||
gtk_action_group_add_actions (action_group, entries, G_N_ELEMENTS (entries), window);
|
||||
gtk_action_group_add_toggle_actions (action_group, toggle_entries, G_N_ELEMENTS (toggle_entries), window);
|
||||
gtk_action_group_add_radio_actions (action_group, radio_entries, G_N_ELEMENTS (radio_entries), 0, radio_action_callback, window);
|
||||
|
||||
ui_manager = gtk_ui_manager_new (<!-- -->);
|
||||
gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
|
||||
|
||||
accel_group = gtk_ui_manager_get_accel_group (ui_manager);
|
||||
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
|
||||
|
||||
error = NULL;
|
||||
if (!gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, &error))
|
||||
{
|
||||
g_message ("building menus failed: %s", error->message);
|
||||
g_error_free (error);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
menubar = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example id="gnomeuiinfo-icons">
|
||||
<title>Registering the icons</title>
|
||||
|
||||
<para>
|
||||
Here we show how the register_my_stock_icons() function
|
||||
used in the previous example could look like.
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
static struct {
|
||||
gchar *filename;
|
||||
gchar *stock_id;
|
||||
} stock_icons[] = {
|
||||
{ "high-quality.png", "my-stock-high-quality" },
|
||||
{ "normal-quality.png", "my-stock-normal-quality" },
|
||||
{ "low-quality.png", "my-stock-low-quality" },
|
||||
};
|
||||
|
||||
static gint n_stock_icons = G_N_ELEMENTS (stock_icons);
|
||||
|
||||
static void
|
||||
register_my_stock_icons (void)
|
||||
{
|
||||
GtkIconFactory *icon_factory;
|
||||
GtkIconSet *icon_set;
|
||||
GtkIconSource *icon_source;
|
||||
gint i;
|
||||
|
||||
icon_factory = gtk_icon_factory_new (<!-- -->);
|
||||
|
||||
for (i = 0; i < n_stock_icons; i++)
|
||||
{
|
||||
icon_set = gtk_icon_set_new (<!-- -->);
|
||||
icon_source = gtk_icon_source_new (<!-- -->);
|
||||
gtk_icon_source_set_filename (icon_source, stock_icons[i].filename);
|
||||
gtk_icon_set_add_source (icon_set, icon_source);
|
||||
gtk_icon_source_free (icon_source);
|
||||
gtk_icon_factory_add (icon_factory, stock_icons[i].stock_id, icon_set);
|
||||
gtk_icon_set_unref (icon_set);
|
||||
}
|
||||
|
||||
gtk_icon_factory_add_default (icon_factory);
|
||||
|
||||
g_object_unref (icon_factory);
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
@@ -59,21 +59,11 @@ The same application using GtkApplication:
|
||||
static void
|
||||
activate (GtkApplication *app)
|
||||
{
|
||||
GList *list;
|
||||
GtkWidget *window;
|
||||
|
||||
list = gtk_application_get_windows (app);
|
||||
|
||||
if (list)
|
||||
{
|
||||
gtk_window_present (GTK_WINDOW (list->data));
|
||||
}
|
||||
else
|
||||
{
|
||||
window = create_my_window ();
|
||||
gtk_window_set_application (GTK_WINDOW (window), app);
|
||||
gtk_widget_show (window);
|
||||
}
|
||||
window = create_my_window ();
|
||||
gtk_window_set_application (GTK_WINDOW (window), app);
|
||||
gtk_widget_show (window);
|
||||
}
|
||||
|
||||
int
|
||||
|
178
docs/reference/gtk/migrating-GtkAssistant.sgml
Normal file
178
docs/reference/gtk/migrating-GtkAssistant.sgml
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkAssistant">
|
||||
<chapterinfo>
|
||||
<author>
|
||||
<firstname>Carlos</firstname>
|
||||
<surname>Garnacho</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>carlosg@gnome.org</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</chapterinfo>
|
||||
|
||||
<title>Migrating from GnomeDruid to GtkAssistant</title>
|
||||
|
||||
<para>
|
||||
Since version 2.10, GTK+ provides the GtkAssistant widget as a replacement
|
||||
for the <structname>GnomeDruid</structname> widget in the libgnomeui
|
||||
library.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Conceptually, both <structname>GtkAssistant</structname> and
|
||||
<structname>GnomeDruid</structname> do the same task, but there are
|
||||
several areas where the API has been completely redesigned, so this
|
||||
chapter covers the main changes between both widgets.
|
||||
</para>
|
||||
|
||||
<section id="inserting-pages">
|
||||
<title>Inserting pages</title>
|
||||
|
||||
<para>
|
||||
<structname>GnomeDruid</structname> was implemented as a container for
|
||||
<structname>GnomeDruidPage</structname> abstract objects, which are
|
||||
implemented by the <structname>GnomeDruidPageEdge</structname> and
|
||||
<structname>GnomeDruidPageStandard</structname> widgets. Instead,
|
||||
<structname>GtkAssistant</structname> allows any widget to be a page,
|
||||
and implements per-page settings (such as page type or title) as
|
||||
child properties. So instead of:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
/* Page 1 */
|
||||
page = gnome_druid_page_edge_new (GNOME_EDGE_START);
|
||||
gnome_druid_page_edge_set_test (GNOME_DRUID_PAGE_EDGE (page),
|
||||
"Welcome to the assistant, it will make your life easier");
|
||||
gtk_widget_show (page);
|
||||
gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (page));
|
||||
|
||||
/* Page 2 */
|
||||
page = gnome_druid_page_standard_new ();
|
||||
gtk_container_add (GTK_CONTAINER (GNOME_DRUID_PAGE_STANDARD (page)->vbox,
|
||||
create_page1 ());
|
||||
gtk_widget_show_all (page);
|
||||
gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (page));
|
||||
|
||||
/* Page 3 */
|
||||
page = gnome_druid_page_edge_new (GNOME_EDGE_FINISH);
|
||||
gnome_druid_page_edge_set_test (GNOME_DRUID_PAGE_EDGE (page),
|
||||
"Now you are done, your life is easier");
|
||||
gtk_widget_show (page);
|
||||
gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (page));
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
You have to write:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant),
|
||||
gtk_label_new ("Welcome to the assistant, it will make your life easier"));
|
||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant),
|
||||
create_page1 ());
|
||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant),
|
||||
gtk_label_new ("Now you are done, your life is easier");
|
||||
</programlisting>
|
||||
</section>
|
||||
|
||||
<section id="decorating-the-assistant-pages">
|
||||
<title>Decorating the assistant pages</title>
|
||||
|
||||
<para>
|
||||
To decorate your assistant pages, <structname>GtkAssistant</structname> provides similar functions
|
||||
to <structname>GnomeDruid</structname>, so you have to transform code like this:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
gnome_druid_page_edge_set_title (GNOME_DRUID_PAGE_EDGE (page), "Welcome");
|
||||
gnome_druid_page_edge_set_logo (GNOME_DRUID_PAGE_EDGE (page), logo_pixbuf);
|
||||
gnome_druid_page_edge_set_watermark (GNOME_DRUID_PAGE_EDGE (page), watermark_pixbuf);
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Into this:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page_widget, "Welcome");
|
||||
gtk_assistant_set_page_header_image (GTK_ASSISTANT (assistant), page_widget, logo_pixbuf);
|
||||
gtk_assistant_set_page_side_image (GTK_ASSISTANT (assistant), page_widget, watermark_pixbuf);
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Where page_widget is the widget used as a page.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="setting-the-page-flow">
|
||||
<title>Setting the page flow</title>
|
||||
|
||||
<para>
|
||||
Here is the area where <structname>GtkAssistant</structname> and <structname>GnomeDruid</structname>
|
||||
differ the most. While <structname>GnomeDruid</structname> used the "next" and "back" signals from the
|
||||
<structname>GnomeDruidPage</structname>, <structname>GtkAssistant</structname> uses the following
|
||||
techniques:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>gtk_assistant_set_forward_page_func (): Allows to define a GtkAssistantPageFunc to let the
|
||||
assistant know which will be the following page given the current page.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>gtk_assistant_set_page_complete (): Lets the assistant know whether the specified page is complete
|
||||
or not, updating buttons state accordingly.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>gtk_assistant_set_page_type (): Lets the assistant know the page role and update the buttons
|
||||
state accordingly. Pages can have the following roles:</para>
|
||||
<simplelist>
|
||||
<member>Intro</member>
|
||||
<member>Content</member>
|
||||
<member>Progress</member>
|
||||
<member>Confirmation</member>
|
||||
<member>Summary</member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
A sample GtkAssistantPageFunc could look like this:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
static gint
|
||||
forward_page_function (gint current_page,
|
||||
gpointer data)
|
||||
{
|
||||
switch (current_page)
|
||||
{
|
||||
case 0:
|
||||
return 1;
|
||||
case 1:
|
||||
if (check_page1_data ())
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
case 2:
|
||||
return 3;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
102
docs/reference/gtk/migrating-GtkBuilder.sgml
Normal file
102
docs/reference/gtk/migrating-GtkBuilder.sgml
Normal file
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkBuilder">
|
||||
|
||||
<title>Migrating from libglade to GtkBuilder</title>
|
||||
|
||||
<para>
|
||||
Since version 2.12, GTK+ provides #GtkBuilder to construct
|
||||
user interfaces from XML descriptions, similar to the functionality
|
||||
provided by #GladeXML in the libglade library.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A good way to start a migration from libglade to GtkBuilder is using
|
||||
<application>glade3</application> to convert your .glade file.
|
||||
If your code uses the @root parameter of glade_xml_new(),
|
||||
you can use gtk_builder_add_objects_from_file() to construct only certain
|
||||
objects from a GtkBuilder file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Alternatively, GTK+ also offers the
|
||||
<link linkend="gtk-builder-convert">gtk-builder-convert</link> script you can use
|
||||
to do the conversion; in which case you should be careful to inspect the output
|
||||
and make sure you didn't lose any data.
|
||||
</para>
|
||||
|
||||
<table pgwide="1" frame="topbot">
|
||||
<title>Step-by-step instructions for porting code from libglade to GtkBuilder</title>
|
||||
<tgroup cols="2" colsep="0" rowsep="0">
|
||||
<thead>
|
||||
<row><entry>libglade</entry><entry>GtkBuilder</entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><![CDATA[#include <glade/glade.h>]]></entry>
|
||||
<entry>not needed</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>GladeXML*</screen></entry>
|
||||
<entry><screen>GtkBuilder*</screen></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>glade_xml_new (FILE, "first_widget", NULL)</screen></entry>
|
||||
<entry>
|
||||
<screen>
|
||||
GError* error = NULL;
|
||||
GtkBuilder* builder = gtk_builder_new (<!-- -->);
|
||||
if (!gtk_builder_add_from_file (builder, FILE, &error))
|
||||
{
|
||||
g_warning ("Couldn't load builder file: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
</screen>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>glade_xml_get_widget (gxml, “widget_name”)</screen></entry>
|
||||
<entry><screen>GTK_WIDGET (gtk_builder_get_object (builder, “widget_name”))</screen></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>glade_get_widget_name (widget)</screen></entry>
|
||||
<entry><screen>gtk_widget_get_name (widget)</screen></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><screen>glade_xml_get_widget_prefix (gxml, “prefix”)</screen></entry>
|
||||
<entry>can be emulated by <literal>gtk_builder_get_objects (builder)</literal> together with manual filtering. It returns a GSList* instead of a GList* though.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<para>
|
||||
While GtkBuilder strives to be a complete replacement for
|
||||
libglade, there are a number of areas where it is currently
|
||||
still behind libglade:
|
||||
<itemizedlist>
|
||||
|
||||
<listitem><para>
|
||||
GtkBuilder supports context information in translatable
|
||||
properties in a slightly different way than libglade.
|
||||
Intltool does not yet support this; see
|
||||
<ulink url="http://bugzilla.gnome.org/show_bug.cgi?id=454894">bug
|
||||
454894</ulink> for the current status of intltool support for
|
||||
GtkBuilder files. Thankfully, context in translations is a
|
||||
rarely used feature, and if you are not using it, intltools
|
||||
glade format support works just fine for GtkBuilder files.
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
While libglade can often tolerate multiple widgets having the
|
||||
same id in a glade file, GtkBuilder will not accept duplicate
|
||||
object ids. Both <application>gtk-builder-convert</application>
|
||||
and the GtkBuilder parser emit warnings when they see
|
||||
duplicate ids.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
</chapter>
|
54
docs/reference/gtk/migrating-GtkColorButton.sgml
Normal file
54
docs/reference/gtk/migrating-GtkColorButton.sgml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkColorButton">
|
||||
|
||||
<title>Migrating from GnomeColorPicker to GtkColorButton</title>
|
||||
|
||||
<para>
|
||||
Since version 2.6, GTK+ provides the #GtkColorButton
|
||||
widget as a replacement for the <structname>GnomeColorPicker</structname>
|
||||
widget in the libgnomeui library.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Porting an application from <structname>GnomeColorPicker</structname> to
|
||||
<structname>GtkColorButton</structname> is very simple.
|
||||
<structname>GtkColorButton</structname> doesn't support dithering
|
||||
(since it is rarely needed on modern hardware), and it doesn't have
|
||||
setters and getters to set the color from floating point or integer
|
||||
components. So instead of
|
||||
<informalexample><programlisting>
|
||||
guint red, green, blue, alpha;
|
||||
/* ... */
|
||||
gnome_color_picker_set_i8 (color_picker, red, green, blue, alpha);
|
||||
</programlisting></informalexample>
|
||||
you have to write
|
||||
<informalexample><programlisting>
|
||||
GdkColor color;
|
||||
|
||||
color.red = red << 8;
|
||||
color.green = green << 8;
|
||||
color.blue = blue << 8;
|
||||
gtk_color_button_set_color (color_picker, &color);
|
||||
gtk_color_button_set_alpha (color_picker, alpha << 8);
|
||||
</programlisting></informalexample>
|
||||
and similarly for the setters taking other number formats. For
|
||||
<function>gnome_color_picker_set_i16()</function> no conversion is needed,
|
||||
for <function>gnome_color_picker_set_d()</function>, you need to convert
|
||||
the color components like this:
|
||||
<informalexample><programlisting>
|
||||
color.red = (guint16) (red * 65535.0 + 0.5);
|
||||
color.green = (guint16) (green * 65535.0 + 0.5);
|
||||
color.blue = (guint16) (blue * 65535.0 + 0.5);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
213
docs/reference/gtk/migrating-GtkComboBox.sgml
Normal file
213
docs/reference/gtk/migrating-GtkComboBox.sgml
Normal file
@@ -0,0 +1,213 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkComboBox">
|
||||
|
||||
<title>Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and
|
||||
GtkComboBoxEntry</title>
|
||||
|
||||
<para>
|
||||
Prior to 2.4, GTK+ offered two widgets for the task of selecting one
|
||||
item from a list of options. #GtkOptionMenu presents the list of
|
||||
options as a menu while #GtkCombo presents them in a Windows-style list
|
||||
popup. The only difference between the two is that a #GtkCombo allows to
|
||||
manually edit the selected value, while the #GtkOptionMenu does not.
|
||||
</para>
|
||||
<para>
|
||||
In GTK+ 2.4, a unified API for list selection was introduced, with
|
||||
#GtkComboBox for the non-editable case and #GtkComboBoxEntry for the
|
||||
editable case.
|
||||
The selection of the display style — menu or list —
|
||||
is no longer done at the API level, but has been made themeable via
|
||||
the style property #GtkComboBox:appears-as-list.
|
||||
</para>
|
||||
|
||||
<section id="migrating-GtkOptionMenu">
|
||||
<title>Migrating from GtkOptionMenu to GtkComboBox</title>
|
||||
|
||||
<para>
|
||||
Here is an example of a simple, but typical use of
|
||||
#GtkOptionMenu<!---->:
|
||||
<informalexample><programlisting>
|
||||
GtkWidget *option_menu, *menu, *menu_item;
|
||||
|
||||
option_menu = gtk_option_menu_new (<!-- -->);
|
||||
menu = gtk_menu_new (<!-- -->);
|
||||
|
||||
menu_item = gtk_menu_item_new_with_label ("First Item");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_show (menu_item);
|
||||
menu_item = gtk_menu_item_new_with_label ("Second Item");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_show (menu_item);
|
||||
menu_item = gtk_menu_item_new_with_label ("Third Item");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_show (menu_item);
|
||||
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
|
||||
</programlisting></informalexample>
|
||||
In order to react to the user's selection, connect to the #GtkOptionMenu::changed
|
||||
signal on the option menu and use gtk_option_menu_get_history()
|
||||
to retrieve the index of the selected item.
|
||||
</para>
|
||||
<para>
|
||||
And here is how it would be done with a #GtkComboBox<!---->:
|
||||
<informalexample><programlisting>
|
||||
GtkWidget *combo_box;
|
||||
|
||||
combo_box = gtk_combo_box_new_text (<!-- -->);
|
||||
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "First Item");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Second Item");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Third Item");
|
||||
</programlisting></informalexample>
|
||||
In order to react to the user's selection, connect to the
|
||||
#GtkComboBox::changed signal and use gtk_combo_box_get_active()
|
||||
to retrieve the index of the selected item.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A slightly more complex example involving images:
|
||||
<informalexample><programlisting>
|
||||
GtkWidget *option_menu, *menu, *menu_item;
|
||||
|
||||
option_menu = gtk_option_menu_new (<!-- -->);
|
||||
menu = gtk_menu_new (<!-- -->);
|
||||
|
||||
menu_item = gtk_image_menu_item_new_with_label ("First Item");
|
||||
gtk_image_menu_item_set_image (gtk_image_new_from_pixbuf (pixbuf1));
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_show (menu_item);
|
||||
menu_item = gtk_image_menu_item_new_with_label ("Second Item");
|
||||
gtk_image_menu_item_set_image (gtk_image_new_from_pixbuf (pixbuf2));
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_show (menu_item);
|
||||
menu_item = gtk_image_menu_item_new_with_label ("Third Item");
|
||||
gtk_image_menu_item_set_image (gtk_image_new_from_pixbuf (pixbuf3));
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_show (menu_item);
|
||||
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
can be done using a #GtkComboBox as follows:
|
||||
<informalexample><programlisting>
|
||||
GtkListStore *store;
|
||||
GtkTreeIter iter;
|
||||
GtkCellRenderer *renderer;
|
||||
GtkWidget *combo_box;
|
||||
|
||||
store = gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
|
||||
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter, 0, pixbuf1, 1, "First Item", -1);
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter, 0, pixbuf2, 1, "Second Item", -1);
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter, 0, pixbuf3, 1, "Third Item", -1);
|
||||
|
||||
combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
|
||||
|
||||
renderer = gtk_cell_renderer_pixbuf_new (<!-- -->);
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, FALSE);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
|
||||
"pixbuf", 0,
|
||||
NULL);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new (<!-- -->);
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
|
||||
"text", 1,
|
||||
NULL);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="migrating-GtkCombo">
|
||||
<title>Migrating from GtkCombo to GtkComboBoxEntry</title>
|
||||
|
||||
<para>
|
||||
Here is an example of a simple, but typical use of a #GtkCombo<!---->:
|
||||
<informalexample><programlisting>
|
||||
GtkWidget *combo;
|
||||
GList *items = NULL;
|
||||
|
||||
items = g_list_append (items, "First Item");
|
||||
items = g_list_append (items, "Second Item");
|
||||
items = g_list_append (items, "Third Item");
|
||||
|
||||
combo = gtk_combo_new (<!-- -->);
|
||||
gtk_combo_set_popdown_strings (GTK_COMBO (combo), items);
|
||||
</programlisting></informalexample>
|
||||
In order to react to the user's selection, connect to the #GtkCombo::changed
|
||||
signal on the combo and use
|
||||
<literal>gtk_entry_get_text (GTK_ENTRY (combo->entry))</literal>
|
||||
to retrieve the selected text.
|
||||
</para>
|
||||
<para>
|
||||
And here is how it would be done using #GtkComboBoxEntry<!---->:
|
||||
<informalexample><programlisting>
|
||||
combo_box = gtk_combo_box_entry_new_text (<!-- -->);
|
||||
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "First Item");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Second Item");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), "Third Item");
|
||||
</programlisting></informalexample>
|
||||
In order to react to the user's selection, connect to the #GtkComboBox::changed
|
||||
signal on the combo and use
|
||||
<literal>gtk_entry_get_text (GTK_ENTRY (GTK_BIN (combo_box)->child))</literal>
|
||||
to retrieve the selected text.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="new-features-GtkComboBox">
|
||||
<title>New features</title>
|
||||
|
||||
<para>
|
||||
The new widgets have more to offer than a mere combination of the
|
||||
features of #GtkOptionMenu and #GtkCombo. Notable new features
|
||||
include:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>Grid mode</term>
|
||||
<listitem><para>Sometimes it is preferable to display the available
|
||||
options not in a linear list, but in a grid. A typical example
|
||||
would be a "color combo" where the individual items are small
|
||||
square color swatches. The new widgets support gridded display
|
||||
with the functions
|
||||
gtk_combo_box_set_wrap_width(),
|
||||
gtk_combo_box_set_row_span_column() and
|
||||
gtk_combo_box_set_column_span_column().
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>Display of icons</term>
|
||||
<listitem><para>An often-heard complaint about #GtkOptionMenu is that
|
||||
the icons which appear in the image menu items in its menu are not
|
||||
displayed in the button showing the selected item. This limitation
|
||||
has been removed in #GtkComboBox; the selected item appears in the
|
||||
same way as the options in the popup.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>Full tree model power</term>
|
||||
<listitem><para>
|
||||
Since the new widgets are built around the same models that are
|
||||
used for #GtkTreeView, all of the powerful machinery of tree models
|
||||
and cell renderers can be used.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
141
docs/reference/gtk/migrating-GtkEntry-icons.sgml
Normal file
141
docs/reference/gtk/migrating-GtkEntry-icons.sgml
Normal file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-entry-icons">
|
||||
|
||||
<title>Migrating from SexyIconEntry to GtkEntry</title>
|
||||
|
||||
<para>
|
||||
GTK+ 2.16 supports showing icons inside a #GtkEntry, similar to
|
||||
SexyIconEntry. Porting from SexyIconEntry to GtkEntry is relatively
|
||||
straightforward. The main difference between the two APIs is that
|
||||
SexyIconEntry uses #GtkImage widgets in a somewhat awkward way as
|
||||
storage vehicles for icons, while GtkEntry allows to specify icons
|
||||
via pixbufs, stock ids, icon names or #GIcons. So, if your code uses
|
||||
e.g.:
|
||||
<informalexample><programlisting>
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_NEW, GTK_ICON_SIZE_MENU);
|
||||
sexy_icon_entry_set_icon (entry, SEXY_ICON_ENTRY_PRIMARY, image);
|
||||
</programlisting></informalexample>
|
||||
you can get rid of the @image, and directly write:
|
||||
<informalexample><programlisting>
|
||||
gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_NEW);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The signals SexyIconEntry::icon-pressed and SexyIconEntry::icon-released
|
||||
have been renamed to #GtkEntry::icon-press and #GtkEntry::icon-release
|
||||
to avoid problems due to signal name clashes. Also, the signature of the
|
||||
signals has changed from
|
||||
<informalexample><programlisting>
|
||||
void (*icon_pressed) (SexyIconEntry *entry,
|
||||
SexyIconEntryPosition icon_pos,
|
||||
int button)
|
||||
</programlisting></informalexample>
|
||||
to
|
||||
<informalexample><programlisting>
|
||||
void (*icon_press) (GtkEntry *entry,
|
||||
GtkEntryIconPosition icon_pos,
|
||||
GdkEventButton *event)
|
||||
</programlisting></informalexample>
|
||||
The new signature has the advantage that the signal handler can use
|
||||
the timestamp of the event, e.g. for passing it to gtk_menu_popup().
|
||||
When adapting an existing signal handler to the new signature, you
|
||||
should note that the button number is easily available as @event->button,
|
||||
as shown in the following example:
|
||||
<informalexample><programlisting>
|
||||
static void
|
||||
icon_pressed_cb (SexyIconEntry *entry,
|
||||
SexyIconEntryPosition position,
|
||||
int button,
|
||||
gpointer data)
|
||||
{
|
||||
GtkMenu *menu = data;
|
||||
|
||||
if (position == SEXY_ICON_ENTRY_PRIMARY)
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
|
||||
button, GDK_CURRENT_TIME);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
can be ported as:
|
||||
<informalexample><programlisting>
|
||||
static void
|
||||
icon_press_cb (GtkEntry *entry,
|
||||
GtkEntryIconPosition position,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkMenu *menu = data;
|
||||
|
||||
if (position == GTK_ENTRY_ICON_PRIMARY)
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
|
||||
event->button, event->time);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Another difference is that SexyIconEntry offers manual control of
|
||||
the icon prelighting, via sexy_icon_entry_set_icon_highlight().
|
||||
#GtkEntry prelights automatically when appropriate, depending on
|
||||
whether the icon is activatable and sensitive. You should make
|
||||
sure that your icons are properly marked as activatable or nonactivatable
|
||||
and sensitive or insensitive:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
Sensitive, but non-activatable icons are
|
||||
good for purely informational purposes.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Icons should be marked as insensitive if the
|
||||
function that they trigger is currently not available.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GtkEntry has no direct equivalent of the special-purpose function
|
||||
sexy_icon_entry_add_clear_button(). If you need this functionality,
|
||||
the following code works:
|
||||
<informalexample><programlisting>
|
||||
static void
|
||||
icon_pressed_cb (GtkEntry *entry,
|
||||
gint position,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (position == GTK_ENTRY_ICON_SECONDARY)
|
||||
gtk_entry_set_text (entry, "");
|
||||
}
|
||||
|
||||
static void
|
||||
text_changed_cb (GtkEntry *entry,
|
||||
GParamSpec *pspec,
|
||||
GtkWidget *button)
|
||||
{
|
||||
gboolean has_text;
|
||||
|
||||
has_text = gtk_entry_get_text_length (entry) > 0;
|
||||
gtk_entry_set_icon_sensitive (entry,
|
||||
GTK_ENTRY_ICON_SECONDARY,
|
||||
has_text);
|
||||
}
|
||||
|
||||
|
||||
/* ... */
|
||||
|
||||
/* Set up the clear icon */
|
||||
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
|
||||
GTK_ENTRY_ICON_SECONDARY,
|
||||
GTK_STOCK_CLEAR);
|
||||
g_signal_connect (entry, "icon-press",
|
||||
G_CALLBACK (icon_pressed_cb), NULL);
|
||||
g_signal_connect (entry, "notify::text",
|
||||
G_CALLBACK (text_changed_cb), find_button);
|
||||
|
||||
/* ... */
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
</chapter>
|
163
docs/reference/gtk/migrating-GtkFileChooser.sgml
Normal file
163
docs/reference/gtk/migrating-GtkFileChooser.sgml
Normal file
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkFileChooser">
|
||||
<chapterinfo>
|
||||
<author>
|
||||
<firstname>Federico</firstname>
|
||||
<surname>Mena-Quintero</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>federico@ximian.com</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</chapterinfo>
|
||||
|
||||
<title>Migrating from GtkFileSelection to GtkFileChooser</title>
|
||||
|
||||
<para>
|
||||
#GtkFileChooser, starting with GTK+ 2.4, is the new set of APIs for file
|
||||
selection widgets and dialogs. Previous versions of GTK+ used #GtkFileSelection,
|
||||
which has numerous problems.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
#GtkFileChooser is an abstract interface that can be implemented by widgets
|
||||
that perform file selection tasks. Two widgets in GTK+ implement this
|
||||
interface: #GtkFileChooserDialog and #GtkFileChooserWidget. Most applications
|
||||
simply need to use #GtkFileChooserDialog, which is a dialog box that allows the
|
||||
user to select existing files for opening them, or to pick new filenames for
|
||||
saving documents. #GtkFileChooserWidget is for special applications that need to
|
||||
embed a file selection widget inside a larger window. In the context of GTK+,
|
||||
#GtkFileChooserDialog is simply a #GtkDialog box with a #GtkFileChooserWidget.
|
||||
inside.
|
||||
</para>
|
||||
|
||||
<section id="gtkfilechooser-creating">
|
||||
<title>Creating a GtkFileChooserDialog</title>
|
||||
|
||||
<para>
|
||||
To create a #GtkFileChooserDialog, you simply call gtk_file_chooser_dialog_new().
|
||||
This function is similar to gtk_dialog_new() in that it takes parameters for the
|
||||
title of the dialog box and its transient parent, as well as its
|
||||
buttons. In addition, it takes in an argument that determines
|
||||
whether the file chooser dialog will be used for opening
|
||||
existing files or for saving to a possibly new file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Please see <xref linkend="gtkfilechooser-typical-usage"/> for
|
||||
how to create a simple file chooser dialog and extract the
|
||||
selected filename from it.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="gtkfilechooser-selection-modes">
|
||||
<title>Selection Modes</title>
|
||||
|
||||
<para>
|
||||
#GtkFileChooser can be used in two modes, to select a single file at a
|
||||
time or to select a set of more than one file. To set this, use
|
||||
gtk_file_chooser_set_select_multiple(). In single-selection
|
||||
mode, you can use gtk_file_chooser_get_filename() to get a file
|
||||
name from the local file system or gtk_file_chooser_get_uri() to
|
||||
get a full-formed URI. In multiple-selection mode, you can use
|
||||
gtk_file_chooser_get_filenames() to get a #GSList of filename strings, or
|
||||
gtk_file_chooser_get_uris() to get a list of URI strings.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Also, you can configure #GtkFileChooser to select files
|
||||
or folders. Consider a backup program that needs to let the
|
||||
user select a folder that will be backed up along with its
|
||||
subfolders. To configure whether #GtkFileChooser is used to select
|
||||
files or folders, use gtk_file_chooser_set_action(). In
|
||||
addition, this lets you configure whether the file chooser will
|
||||
be used to select existing files or folders (e.g. for
|
||||
"File/Open"), or to type in new filenames (for
|
||||
"File/Save As...").
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="gtkfilechooser-installing-preview">
|
||||
<title>Installing a Preview widget</title>
|
||||
|
||||
<para>
|
||||
Many applications need to have a preview facility within their
|
||||
file chooser dialogs. Previous to GTK+ 2.4, one needed to
|
||||
access the #GtkFileSelection widget hierarchy directly to hook in
|
||||
a preview widget. With #GtkFileChooser, there is a
|
||||
dedicated API to do this.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Please see the <link linkend="gtkfilechooser-preview">section on
|
||||
creating preview widgets</link> for more information.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="gtkfilechooser-installing-extra-widgets">
|
||||
<title>Installing Extra Widgets</title>
|
||||
|
||||
<para>
|
||||
Some applications need to install extra widgets in a file
|
||||
chooser. For example, an application may want to provide a
|
||||
toggle button to give the user the option of opening a file
|
||||
read-only.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Please see the <link linkend="gtkfilechooser-extra">section on
|
||||
creating extra widgets</link> for more information.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="gtkfilechooser-new-features">
|
||||
<title>New features</title>
|
||||
|
||||
<para>
|
||||
New features in #GtkFileChooser include the following:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Ability to select URIs rather than just local files. You
|
||||
must use a #GtkFileSystem implementation that supports this,
|
||||
for example the gnome-vfs backend.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Present a list of application-specific shortcut folders.
|
||||
For example, a paint program may want to add a shortcut for
|
||||
its <filename>/usr/share/paint_program/Clipart</filename>
|
||||
folder.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Define custom filters so that not all the files in a folder
|
||||
are listed. For example, you could filter out backup files,
|
||||
or show only image files.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
To see how to use these features, please consult the #GtkFileChooser
|
||||
reference documentation.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
153
docs/reference/gtk/migrating-GtkIconView.sgml
Normal file
153
docs/reference/gtk/migrating-GtkIconView.sgml
Normal file
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkIconView">
|
||||
|
||||
<title>Migrating from GnomeIconList to GtkIconView</title>
|
||||
|
||||
<para>
|
||||
Since version 2.6, GTK+ provides the #GtkIconView widget. It is similar in
|
||||
functionality to the <structname>GnomeIconList</structname> widget in the
|
||||
libgnomeui library, both widgets provide a way to lay out named icons in
|
||||
a grid. The distinctive feature of the GTK+ widget is that it follows the
|
||||
model-view pattern, allowing it to share the actual data (i.e. the names
|
||||
and images of the icons) with other views.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
#GtkIconView currently doesn't support some features found in
|
||||
<structname>GnomeIconList</structname>. Icons can not be positioned freely,
|
||||
the spacing is not customizable, and it is not possible to edit the names of
|
||||
icons.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To convert an application that uses <structname>GnomeIconList</structname>
|
||||
to #GtkIconView, the first step is to organize your data in a #GtkTreeModel.
|
||||
<structname>GnomeIconList</structname> lets you directly insert data with
|
||||
gnome_icon_list_insert() and gnome_icon_list_insert_pixbuf() and their
|
||||
append variants. So, if you previously had a function to fill your icon
|
||||
list similar to this one:
|
||||
<informalexample><programlisting>
|
||||
void
|
||||
fill_icon_list (GnomeIconList *icon_list)
|
||||
{
|
||||
gnome_icon_list_append (icon_list, "file1.png", "Icon 1");
|
||||
gnome_icon_list_append (icon_list, "file2.png", "Icon 2");
|
||||
|
||||
/* more icons ... */
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
you will have to create a tree model, attach your icon view to it, and
|
||||
fill the model:
|
||||
<informalexample><programlisting>
|
||||
enum {
|
||||
PIXBUF_COLUMN,
|
||||
TEXT_COLUMN,
|
||||
|
||||
/* you can have more columns here, e.g */
|
||||
|
||||
DATA_COLUMN
|
||||
};
|
||||
|
||||
void
|
||||
fill_model (GtkListStore *store)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
gtk_list_store_append (store, &iter);
|
||||
pixbuf = gdk_pixbuf_new_from_file ("file1.png", NULL);
|
||||
gtk_list_store_set (store, &iter, PIXBUF_COLUMN, pixbuf, TEXT_COLUMN, "Icon 1", -1);
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
gtk_list_store_append (store, &iter);
|
||||
pixbuf = gdk_pixbuf_new_from_file ("file2.png", NULL);
|
||||
gtk_list_store_set (store, &iter, PIXBUF_COLUMN, pixbuf, TEXT_COLUMN, "Icon 2", -1);
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
/* more icons ... */
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *icon_view;
|
||||
GtkListStore *store;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* do other initialization... */
|
||||
|
||||
/* construct the GtkIconView */
|
||||
icon_view = gtk_icon_view_new (<!-- -->);
|
||||
store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
|
||||
|
||||
gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (icon_view), PIXBUF_COLUMN);
|
||||
gtk_icon_view_set_text_column (GTK_ICON_VIEW (icon_view), TEXT_COLUMN);
|
||||
gtk_icon_view_set_model (GTK_ICON_VIEW (icon_view), GTK_TREE_MODEL (store));
|
||||
|
||||
fill_model (store);
|
||||
|
||||
/* ... */
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
This example uses a #GtkListStore as model, but part of the elegance of the
|
||||
model-view pattern is that you can easily use another tree model implementation,
|
||||
or even write your own custom tree model.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Your application may make use of extra data attached to the icons in the
|
||||
<structname>GnomeIconList</structname> via gnome_icon_list_set_icon_data() and
|
||||
gnome_icon_list_get_icon_data(). With #GtkIconView such data is most
|
||||
conveniently stored in an extra column in the tree model, so you would
|
||||
call a function like
|
||||
<informalexample><programlisting>
|
||||
void
|
||||
set_icon_data (GtkIconView *icon_view,
|
||||
gint idx,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
model = gtk_icon_view_get_model (icon_view);
|
||||
|
||||
if (gtk_tree_model_iter_nth_child (model, &iter, NULL, idx))
|
||||
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
|
||||
DATA_COLUMN, data, -1);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
assuming that your tree model has a <literal>DATA_COLUMN</literal> of type
|
||||
%G_TYPE_POINTER.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There is a number of minor API differences between
|
||||
<structname>GnomeIconList</structname> and
|
||||
<structname>GtkIconView</structname>:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<type>GnomeIconListMode</type> is replaced by the
|
||||
<link linkend="GtkIconView--orientation">orientation</link>
|
||||
property of <structname>GtkIconView</structname>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<structname>GtkIconView</structname> can not be frozen in the same
|
||||
way as <structname>GnomeIconList</structname> can with
|
||||
gnome_icon_list_freeze() and gnome_icon_list_thaw(). Instead you can
|
||||
replace the whole model of a <structname>GtkIconView</structname>,
|
||||
instead of doing many small changes to the existing model.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
24
docs/reference/gtk/migrating-GtkLabel-links.sgml
Normal file
24
docs/reference/gtk/migrating-GtkLabel-links.sgml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-label-links">
|
||||
|
||||
<title>Migrating from SexyUrlLabel to GtkLabel</title>
|
||||
|
||||
<para>
|
||||
GTK+ 2.18 supports showing links inside a #GtkLabel, similar to
|
||||
SexyUrlLabel. Porting from SexyUrlLabel to GtkLabel is relatively
|
||||
straightforward. GtkLabel accepts links in the markup using the
|
||||
same HTML <tag>a</tag> notation that SexyUrlLabel uses. In addition
|
||||
to the href attribute, GtkLabel accepts a title attribute that
|
||||
is displayed as a tooltip on the link. Instead of
|
||||
sexy_url_label_set_markup(), just call gtk_label_set_markup().
|
||||
</para>
|
||||
<para>
|
||||
One difference between the two APIs is that the ::url-activated signal
|
||||
from SexyUrlLabel has been replaced by the #GtkLabel::activate-link
|
||||
signal. The need for connecting to this signal is greatly reduced,
|
||||
since GtkLabel has a default handler that calls gtk_show_uri().
|
||||
</para>
|
||||
</chapter>
|
81
docs/reference/gtk/migrating-GtkLinkButton.sgml
Normal file
81
docs/reference/gtk/migrating-GtkLinkButton.sgml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkLinkButton">
|
||||
|
||||
<title>Migrating from GnomeHRef to GtkLinkButton</title>
|
||||
|
||||
<para>
|
||||
Since version 2.10, GTK+ provides the #GtkLinkButton widget as a
|
||||
replacement for the <structname>GnomeHRef</structname> widget
|
||||
in the libgnomeui library.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Porting an application from <structname>GnomeHRef</structname> to
|
||||
#GtkLinkButton is very simple. #GtkLinkButton does not have a
|
||||
default action for #GtkButton::clicked signal. So instead of simply
|
||||
creating the widget
|
||||
<informalexample><programlisting>
|
||||
GtkWidget *button;
|
||||
|
||||
button = gnome_href_new (url, "");
|
||||
</programlisting></informalexample>
|
||||
you will have to handle the activation of the #GtkLinkButton, using
|
||||
the ::clicked signal for instance
|
||||
<informalexample><programlisting>
|
||||
static void
|
||||
link_button_clicked_cb (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
const gchar *link;
|
||||
|
||||
link = gtk_link_button_get_uri (GTK_LINK_BUTTON (widget));
|
||||
open_browser_at_url (link);
|
||||
}
|
||||
|
||||
/* ... */
|
||||
|
||||
GtkWidget *button;
|
||||
|
||||
button = gtk_link_button_new (url);
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (link_button_clicked_cb), NULL);
|
||||
</programlisting></informalexample>
|
||||
If you have more than one #GtkLinkButton instead of connecting
|
||||
a signal to each one, you can use a "hook function" which will be
|
||||
called whenever a user activates a link button
|
||||
<informalexample><programlisting>
|
||||
static void
|
||||
link_button_hook (GtkLinkButton *button,
|
||||
const gchar *link,
|
||||
gpointer user_data)
|
||||
|
||||
{
|
||||
open_browser_at_url (link);
|
||||
}
|
||||
|
||||
/* ... */
|
||||
|
||||
GtkWidget *button1 = gtk_link_button_new (uri1);
|
||||
GtkWidget *button2 = gtk_link_button_new (uri2);
|
||||
|
||||
gtk_link_button_set_uri_hook (link_button_hook, NULL, NULL);
|
||||
</programlisting></informalexample>
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Starting with GTK+ 2.16, it is no longer necessary to set up a uri hook
|
||||
manually, since GTK+ now defaults to calling gtk_show_uri() if no uri
|
||||
hook has been set.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
323
docs/reference/gtk/migrating-GtkRecentChooser.sgml
Normal file
323
docs/reference/gtk/migrating-GtkRecentChooser.sgml
Normal file
@@ -0,0 +1,323 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-GtkRecentChooser">
|
||||
<chapterinfo>
|
||||
<author>
|
||||
<firstname>Emmanuele</firstname>
|
||||
<lastname>Bassi</lastname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>ebassi@gmail.com</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</chapterinfo>
|
||||
|
||||
<title>Migrating from EggRecent to GtkRecentChooser</title>
|
||||
|
||||
<para>
|
||||
Since version 2.10, GTK+ provides a way of handling the recently used
|
||||
documents. It is similar to the code that has lived inside the libegg
|
||||
library and has been incorporated by many applications. The GTK+ version
|
||||
aims to completely replace that code, and offers many distinctive features
|
||||
that improve the registration and visualization of the recently used
|
||||
documents, such as:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
Better performances while reading and writing the list of recently used
|
||||
files
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
More meta-data available for each recent document, like the
|
||||
applications that have registered a document inside the list, the last
|
||||
time and the number of times the same application did register a
|
||||
document inside the list, an optional user readable name and
|
||||
description of the document
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Improved the ability to sort and filter the documents, also using
|
||||
custom sorting and filtering functions
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
New widgets for displaying the list, and better integration with
|
||||
current #GtkFileChooser and #GtkUIManager widgets
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<section id="gtkrecent-manager">
|
||||
<title>Managing the Recently Used Documents</title>
|
||||
|
||||
<para>
|
||||
#GtkRecentManager is used to manage the Recently Used Documents. To
|
||||
create a new #GtkRecentManager, you simply call gtk_recent_manager_new().
|
||||
Like the <structname>EggRecentModel</structname> inside EggRecent, the
|
||||
#GtkRecentManager loads the list of the recent documents and notifies
|
||||
you of changes inside the list.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Usually, instead of creating a new #GtkRecentManager each time you
|
||||
need it, you'll want to use the gtk_recent_manager_get_default()
|
||||
function.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To add a document to the list, you can use gtk_recent_manager_add_item(),
|
||||
like:
|
||||
<informalexample><programlisting>
|
||||
GtkRecentManager *manager;
|
||||
|
||||
manager = gtk_recent_manager_new (<!-- -->);
|
||||
|
||||
if (!gtk_recent_manager_add_item (manager, document_uri))
|
||||
{
|
||||
/* warn about the error */
|
||||
}
|
||||
|
||||
g_object_unref (manager);
|
||||
</programlisting></informalexample>
|
||||
The gtk_recent_manager_add_item() function will try and guess some of the
|
||||
meta-data associated to a URI. If you know some of meta-data about the
|
||||
document yourself, set the desired fields of a #GtkRecentData structure
|
||||
and pass it to the gtk_recent_manager_add_full() function instead:
|
||||
<informalexample><programlisting>
|
||||
GtkRecentManager *manager;
|
||||
GtkRecentData *recent_data;
|
||||
|
||||
manager = gtk_recent_manager_new (<!-- -->);
|
||||
|
||||
recent_data = g_new0 (GtkRecentData, 1);
|
||||
/* the user visible name of the document (maybe its title); should
|
||||
* be preferred when displaying the item into the list
|
||||
*/
|
||||
recent_data->display_name = document_name;
|
||||
|
||||
/* the MIME type is mandatory */
|
||||
recent_data->mime_type = document_mime_type;
|
||||
|
||||
/* the name of the application that is registering the document
|
||||
* (also mandatory); usually, the same name you used with
|
||||
* the g_set_application_name (<!-- -->) function.
|
||||
*/
|
||||
recent_data-&app_name = APP_NAME;
|
||||
|
||||
/* the command to open a file; the %u string will be automagically
|
||||
* expanded to the document's URI when getting the application's
|
||||
* command line from the GtkRecentInfo object with
|
||||
* gtk_recent_info_get_application_info (<!-- -->)
|
||||
*/
|
||||
recent_data-&app_exec = g_strjoin (" ", g_get_prgname (<!-- -->), "--open-file", "%u", NULL);
|
||||
|
||||
if (!gtk_recent_manager_add_full (manager, document_uri, recent_data))
|
||||
{
|
||||
/* warn about the error */
|
||||
}
|
||||
|
||||
g_free (recent_data->app_exec);
|
||||
g_free (recent_data);
|
||||
g_object_unref (manager);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Getting the list of items is also similar to
|
||||
<structname>EggRecentModel</structname>; the GtkRecentInfo data is
|
||||
allocated at look up time in order not to waste memory keeping it
|
||||
around, so you must remember to free the data inside the list and then
|
||||
the list itself when you are done using it:
|
||||
<informalexample><programlisting>
|
||||
GtkRecentManager *manager;
|
||||
GList *recent_items, *l;
|
||||
|
||||
manager = gtk_recent_manager_get_default(<!-- -->);
|
||||
|
||||
recent_items = gtk_recent_manager_get_items (manager);
|
||||
for (l = recent_items; l != NULL; l = l->next)
|
||||
{
|
||||
GtkRecentInfo *recent_info = l->data;
|
||||
|
||||
do_something_with_the_item (recent_info);
|
||||
}
|
||||
|
||||
/* free everything and the list */
|
||||
g_list_foreach (recent_items, (GFunc) gtk_recent_info_unref, NULL);
|
||||
g_list_free (recent_items);
|
||||
</programlisting></informalexample>
|
||||
You can also look up a single item:
|
||||
<informalexample><programlisting>
|
||||
GtkRecentInfo *recent_info;
|
||||
GError *error = NULL;
|
||||
|
||||
recent_info = gtk_recent_manager_lookup_item (manager, document_uri, &error);
|
||||
if (error)
|
||||
{
|
||||
display_error (error);
|
||||
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
{
|
||||
do_something_with_the_item (recent_info);
|
||||
|
||||
gtk_recent_info_unref (recent_info);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
The #GtkRecentInfo is a reference counted boxed type, and it holds all
|
||||
the meta-data of a recently used document, like its display name, its
|
||||
description, the list of each application that has registered the
|
||||
document or the list of groups to which the document belong.
|
||||
</para>
|
||||
|
||||
</section> <!-- gtkrecent-manager -->
|
||||
|
||||
<section id="gtkrecent-chooser">
|
||||
<title>Displaying the Recently Used Documents</title>
|
||||
|
||||
<para>
|
||||
Displaying the Recently Used Documents list is handled by any widget
|
||||
implementing the #GtkRecentChooser interface. These widgets also handle
|
||||
the sorting and filtering of the list; they will create their own
|
||||
#GtkRecentManager objects by default:
|
||||
<informalexample><programlisting>
|
||||
GtkWidget *chooser;
|
||||
gint response;
|
||||
|
||||
/* create a new dialog with the recently used documents list shown
|
||||
* using a GtkTreeView widget
|
||||
*/
|
||||
chooser = gtk_recent_chooser_dialog_new ("Recent Documents",
|
||||
parent_window,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
|
||||
NULL);
|
||||
/* set the sorting order to "most recently used first" */
|
||||
gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (chooser), GTK_RECENT_SORT_MRU);
|
||||
response = gtk_dialog_run (GTK_DIALOG (chooser));
|
||||
if (response == GTK_RESPONSE_OK)
|
||||
{
|
||||
GtkRecentInfo *info;
|
||||
|
||||
info = gtk_recent_chooser_get_current_item (GTK_RECENT_CHOOSER (chooser));
|
||||
do_something_with_the_item (info);
|
||||
|
||||
gtk_recent_info_unref (info);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (chooser);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
</section> <!-- gtkrecent-chooser -->
|
||||
|
||||
<section id="gtkrecent-advanced">
|
||||
<title>Advanced usage</title>
|
||||
|
||||
<para>
|
||||
The #GtkRecentChooser widgets might display items sorted and filtered,
|
||||
either with already supplied or custom sorting and filtering functions.
|
||||
The biggest difference from the <structname>EggRecentView</structname>
|
||||
widgets in EggRecent is that the #GtkRecentChooser widgets will use
|
||||
their own copy of the list and will apply the sorting and filtering
|
||||
functions only on the copy; this allows the creation of many viewers
|
||||
with a single controller, like using many #GtkTreeView with a single
|
||||
#GtkTreeModel instance.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Available sorting methods are:
|
||||
<informalexample><programlisting>
|
||||
/* no sorting */
|
||||
gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (chooser), GTK_RECENT_SORT_NONE);
|
||||
|
||||
/* most recently used first */
|
||||
gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (chooser), GTK_RECENT_SORT_MRU);
|
||||
|
||||
/* most recently used last */
|
||||
gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (chooser), GTK_RECENT_SORT_LRU);
|
||||
</programlisting></informalexample>
|
||||
You can create your own sorting function, and the use the
|
||||
GTK_RECENT_SORT_CUSTOM method:
|
||||
<informalexample><programlisting>
|
||||
/* custom sorting function, based on the registration count
|
||||
* (most used first)
|
||||
*/
|
||||
static void
|
||||
sort_by_usage_count (GtkRecentInfo *a,
|
||||
GtkRecentInfo *b,
|
||||
gpointer data)
|
||||
{
|
||||
gint count_a, count_b;
|
||||
|
||||
count_a = count_b = 0;
|
||||
|
||||
if (gtk_recent_info_has_application (a, APP_NAME))
|
||||
gtk_recent_info_get_application_info (a, APP_NAME, NULL, &count_a, NULL);
|
||||
|
||||
if (gtk_recent_info_has_application (b, APP_NAME))
|
||||
gtk_recent_info_get_application_info (b, APP_NAME, NULL, &count_b, NULL);
|
||||
|
||||
return count_a < count_b;
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
/* set custom sorting and set the custom sorting function */
|
||||
gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (chooser),
|
||||
GTK_RECENT_SORT_CUSTOM);
|
||||
gtk_recent_chooser_set_sort_func (GTK_RECENT_CHOOSER,
|
||||
sort_by_usage_count,
|
||||
NULL, /* sort function data */
|
||||
NULL /* destroy notify for the data */);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering is done using the #GtkRecentFilter object, similar to the
|
||||
#GtkFileFilter object used by the #GtkFileChooser widgets. The
|
||||
#GtkRecentFilter object has a set of pre-defined options based on the
|
||||
meta-data exposed by the #GtkRecentInfo object. It also allows custom
|
||||
filtering function:
|
||||
<informalexample><programlisting>
|
||||
GtkRecentFilter *filter;
|
||||
|
||||
filter = gtk_recent_filter_new (<!-- -->);
|
||||
|
||||
/* set the user visible name of the filter */
|
||||
gtk_recent_filter_set_name (filter, "Since Last Month");
|
||||
|
||||
/* set the maximum age of a recently used document */
|
||||
gtk_recent_filter_set_age (filter, 31);
|
||||
|
||||
/* the chooser takes the ownership of the object */
|
||||
gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (chooser), filter);
|
||||
|
||||
/* set the currently used filter */
|
||||
gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER (chooser), filter);
|
||||
|
||||
filter = gtk_recent_filter_new (<!-- -->);
|
||||
gtk_recent_filter_set_name (filter, "Every text file");
|
||||
gtk_recent_filter_set_mime_type (filter, "text/plain");
|
||||
|
||||
gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (chooser), filter);
|
||||
</programlisting></informalexample>
|
||||
The #GtkRecentChooserWidget and #GtkRecentChooserDialog widgets allow
|
||||
multiple filters and the selection of an appropriate one; the
|
||||
#GtkRecentChooserMenu widget allows just a single filter object.
|
||||
</para>
|
||||
|
||||
</section> <!-- gtkrecent-advanced -->
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-parent-document: ("gtk-docs.sgml" "book" "part" "chapter")
|
||||
End:
|
||||
-->
|
@@ -27,21 +27,6 @@
|
||||
with possible variants such as the dark theme being named
|
||||
<filename>gtk-dark.css</filename> in the same directory.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If your theme RC file was providing values for #GtkSettings, you
|
||||
can install a <filename>settings.ini</filename> keyfile along with
|
||||
the <filename>gtk.css</filename> to provide theme-specific defaults
|
||||
for settings.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Key themes have been converted to CSS syntax too. See the
|
||||
<link linkend="css-binding-set">GtkCssProvider</link> documentation
|
||||
information about the syntax. GTK+ looks for key themes in the file
|
||||
<filename>$datadir/themes/<replaceable>theme</replaceable>/gtk-3.0/gtk-keys.css</filename>, where <replaceable>theme</replaceable> is the current
|
||||
key theme name.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="gtk-migrating-theme-GtkStyleContext-engines">
|
||||
@@ -429,8 +414,8 @@
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
Replace #GtkWidget::style-set handlers with
|
||||
#GtkWidget::style-updated handlers.
|
||||
Replace <literal>style_set()</literal> calls with
|
||||
<literal>style_updated()</literal>.
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
@@ -571,24 +556,7 @@
|
||||
Typically, the provider will be a #GtkCssProvider, which parse CSS
|
||||
information from a file or from a string.
|
||||
</para>
|
||||
<example>
|
||||
<title>Using a custom GtkStyleProvider</title>
|
||||
<programlisting>
|
||||
GtkStyleContext *context;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
|
||||
".frame1 {\n"
|
||||
" border-image: url('gradient1.png') 10 10 10 10 stretch;\n"
|
||||
"}\n", -1, NULL);
|
||||
gtk_style_context_add_provider (context,
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
g_object_unref (provider);
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Notice that you can also get style information from custom resources
|
||||
by implementing the #GtkStyleProvider interface yourself. This is
|
||||
|
66
docs/reference/gtk/migrating-GtkTooltip.sgml
Normal file
66
docs/reference/gtk/migrating-GtkTooltip.sgml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="gtk-migrating-tooltips">
|
||||
|
||||
<title>Migrating from GtkTooltips to GtkTooltip</title>
|
||||
|
||||
<para>
|
||||
GTK+ 2.12 brings a completely new tooltip implementation which
|
||||
allows many things that were not possible with the old
|
||||
#GtkTooltips interface. The new possibilities are explained
|
||||
in more detail in the section about #GtkTooltip.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A number of complications of the old API have been removed:
|
||||
<itemizedlist>
|
||||
|
||||
<listitem><para>
|
||||
Tooltips can not be grouped anymore. The old tooltips
|
||||
API allowed this by using multiple #GtkTooltips objects.
|
||||
We believe that the timeout behaviour of the new tooltips
|
||||
implementation is better and makes it unnecessary to use
|
||||
grouping as a way to overcome shortcomings of the
|
||||
fast-tooltips mode.
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
Timeouts can not be set individually anymore. Instead
|
||||
there are settings #GtkSettings:gtk-tooltip-timeout,
|
||||
#GtkSettings:gtk-tooltip-browse-timeout and
|
||||
#GtkSettings:gtk-tooltip-browse-mode-timeout to influence
|
||||
the behaviour of tooltips globally.
|
||||
</para></listitem>
|
||||
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Here is an example of setting a tooltip on a widget with the old API:
|
||||
<informalexample><programlisting>
|
||||
GtkTooltips *tooltips = gtk_tooltips_new ();
|
||||
gtk_tooltips_set_tip (tooltips, widget, "Some tips", NULL);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
Using the new tooltips API, it is no longer necessary to create
|
||||
an object:
|
||||
<informalexample><programlisting>
|
||||
gtk_widget_set_tooltip_text (widget, "Some tips");
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
Similarly, setting a tooltip on a #GtkToolItem gets
|
||||
simplified from
|
||||
<informalexample><programlisting>
|
||||
gtk_tool_item_set_tooltip (toolitem, toolbar->tooltips, "tool tip", NULL);
|
||||
</programlisting></informalexample>
|
||||
to
|
||||
<informalexample><programlisting>
|
||||
gtk_tool_item_set_tooltip_text (toolitem, text);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
</chapter>
|
@@ -127,6 +127,7 @@
|
||||
|
||||
<emphasis>Misc. Objects</emphasis>
|
||||
<link linkend="GtkAdjustment">GtkAdjustment</link>
|
||||
<link linkend="GtkItemFactory">GtkItemFactory</link>
|
||||
<link linkend="GtkInvisible">GtkInvisible</link>
|
||||
</literallayout></entry>
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-other-software">
|
||||
<refentry id="gtk-other-software" revision="5 Sept 2001">
|
||||
<refmeta>
|
||||
<refentrytitle>Mixing GTK+ with other software</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
@@ -35,11 +35,11 @@ How do I get started with GTK+?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
The GTK+ <ulink url="http://www.gtk.org">website</ulink> offers some
|
||||
<ulink url="http://www.gtk.org/documentation">tutorials</ulink> and other
|
||||
documentation (most of it about GTK+ 2.x, but mostly still applicable).
|
||||
More documentation ranging from whitepapers to online books can be found at
|
||||
the <ulink url="http://library.gnome.org/devel/">GNOME developer's site</ulink>.
|
||||
The GTK+ <ulink url="http://www.gtk.org">website</ulink> offers a
|
||||
<ulink url="http://www.gtk.org/tutorial">tutorial</ulink> and a
|
||||
<ulink url="http://www.gtk.org/faq">FAQ</ulink>. More documentation ranging
|
||||
from whitepapers to online books can be found at the
|
||||
<ulink url="http://library.gnome.org/devel/">GNOME developer's site</ulink>.
|
||||
After studying these materials you should be well prepared to come back to
|
||||
this reference manual for details.
|
||||
</para></answer>
|
||||
@@ -47,7 +47,7 @@ this reference manual for details.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
Where can I get help with GTK+, submit a bug report, or make a feature
|
||||
Where can I get help with GTK+, submit a bug report, or make a feature
|
||||
request?
|
||||
</para></question>
|
||||
|
||||
@@ -102,11 +102,11 @@ state (explained in its documentation).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For strings returned from functions, they will be declared "const" (using
|
||||
#G_CONST_RETURN) if they should not be freed. Non-const strings should be
|
||||
freed with g_free(). Arrays follow the same rule. If you find an
|
||||
undocumented exception to the rules, please report a bug to <ulink
|
||||
url="http://bugzilla.gnome.org">http://bugzilla.gnome.org</ulink>.
|
||||
For strings returned from functions, they will be declared "const" (using
|
||||
#G_CONST_RETURN) if they should not be freed. Non-const strings should be
|
||||
freed with g_free(). Arrays follow the same rule. (If you find an exception
|
||||
to the rules, please report a bug to <ulink
|
||||
url="http://bugzilla.gnome.org">http://bugzilla.gnome.org</ulink>.)
|
||||
</para>
|
||||
|
||||
</answer>
|
||||
@@ -164,8 +164,8 @@ How do I use GTK+ with threads?
|
||||
<answer>
|
||||
|
||||
<para>
|
||||
This is covered in the <link linkend="gdk-Threads">GDK threads
|
||||
documentation</link>. See also the <link linkend="glib-Threads">GThread</link>
|
||||
This is covered in the <link linkend="gdk-Threads">GDK threads
|
||||
documentation</link>. See also the <link linkend="glib-Threads">GThread</link>
|
||||
documentation for portable threading primitives.
|
||||
</para>
|
||||
|
||||
@@ -182,37 +182,33 @@ How do I internationalize a GTK+ program?
|
||||
<para>
|
||||
Most people use <ulink url="http://www.gnu.org/software/gettext/">GNU
|
||||
gettext</ulink>, already required in order to install GLib. On a UNIX
|
||||
or Linux system with gettext installed, type <literal>info gettext</literal>
|
||||
or Linux system with gettext installed, type <literal>info gettext</literal>
|
||||
to read the documentation.
|
||||
</para>
|
||||
<para>
|
||||
The short checklist on how to use gettext is: call bindtextdomain() so
|
||||
gettext can find the files containing your translations, call textdomain()
|
||||
to set the default translation domain, call bind_textdomain_codeset() to
|
||||
request that all translated strings are returned in UTF-8, then call
|
||||
gettext() to look up each string to be translated in the default domain.
|
||||
</para>
|
||||
<para>
|
||||
<filename>gi18n.h</filename> provides the following shorthand macros for
|
||||
convenience.
|
||||
The short checklist on how to use gettext is: call bindtextdomain() so gettext
|
||||
can find the files containing your translations, call textdomain() to set the
|
||||
default translation domain, call bind_textdomain_codeset() to request that
|
||||
all translated strings are returned in UTF-8, then call gettext() to look up
|
||||
each string to be translated in the default domain.
|
||||
Conventionally, people define macros as follows for convenience:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
#define _(x) gettext (x)
|
||||
#define N_(x) x
|
||||
#define C_(ctx,x) pgettext (ctx, x)
|
||||
#define _(x) gettext (x)
|
||||
#define N_(x) x
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
You use N_() (N stands for no-op) to mark a string for translation in
|
||||
a location where a function call to gettext() is not allowed, such as
|
||||
in an array initializer.
|
||||
You eventually have to call gettext() on the string to actually fetch
|
||||
the translation. _() both marks the string for translation and actually
|
||||
You use N_() (N stands for no-op) to mark a string for translation in a
|
||||
context where a function call to gettext() is not allowed, such as in an
|
||||
array initializer.
|
||||
You eventually have to call gettext() on the string to actually fetch the
|
||||
translation. _() both marks the string for translation and actually
|
||||
translates it.
|
||||
The C_() macro (C stands for context) adds an additional context to
|
||||
the string that is marked for translation, which can help to disambiguate
|
||||
short strings that might need different translations in different
|
||||
parts of your program.
|
||||
</para>
|
||||
<para>
|
||||
Nowadays, GLib provides the common shorthand macros in the header file
|
||||
<filename>gi18n.h</filename>, so you don't have to define them yourself,
|
||||
just include that header.
|
||||
</para>
|
||||
<para>
|
||||
Code using these macros ends up looking like this:
|
||||
@@ -235,22 +231,22 @@ Code using these macros ends up looking like this:
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
Libraries using gettext should use dgettext() instead of gettext(), which
|
||||
allows them to specify the translation domain each time they ask for a
|
||||
translation. Libraries should also avoid calling textdomain(), since
|
||||
they will be specifying the domain instead of using the default.
|
||||
</para>
|
||||
<para>
|
||||
With the convention that the macro <literal>GETTEXT_PACKAGE</literal> is
|
||||
defined to hold your libraries translation domain,
|
||||
<filename>gi18n-lib.h</filename> can be included to provide
|
||||
the following convenience:
|
||||
Libraries using gettext should use dgettext() instead of gettext(), which
|
||||
allows them to specify the translation domain each time they ask for a
|
||||
translation. Libraries should also avoid calling textdomain(), since they
|
||||
will be specifying the domain instead of using the default. For dgettext()
|
||||
the _() macro can be defined as:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
#define _(x) dgettext (GETTEXT_PACKAGE, x)
|
||||
#define _(x) dgettext ("MyDomain", x)
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
Again, GLib comes with the <filename>gi18n-lib.h</filename>, saving you the
|
||||
trouble of defining the macros by hand. The macros in that header expect the
|
||||
translation domain to be specified by the %GETTEXT_PACKAGE macro.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
@@ -263,9 +259,9 @@ How do I use non-ASCII characters in GTK+ programs ?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
|
||||
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a sequence of
|
||||
one to six bytes and has a number of nice properties which make it a good
|
||||
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
|
||||
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a sequence of
|
||||
one to six bytes and has a number of nice properties which make it a good
|
||||
choice for working with Unicode text in C programs:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
@@ -275,30 +271,30 @@ ASCII characters are encoded by their familiar ASCII codepoints.
|
||||
ASCII characters never appear as part of any other character.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
The zero byte doesn't occur as part of a character, so that UTF-8 strings
|
||||
can be manipulated with the usual C library functions for handling
|
||||
The zero byte doesn't occur as part of a character, so that UTF-8 strings
|
||||
can be manipulated with the usual C library functions for handling
|
||||
zero-terminated strings.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
More information about Unicode and UTF-8 can be found in the
|
||||
<ulink url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode
|
||||
More information about Unicode and UTF-8 can be found in the
|
||||
<ulink url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode i
|
||||
FAQ for Unix/Linux</ulink>.
|
||||
GLib provides functions for converting strings between UTF-8 and other
|
||||
encodings, see g_locale_to_utf8() and g_convert().
|
||||
</para>
|
||||
<para>
|
||||
Text coming from external sources (e.g. files or user input), has to be
|
||||
converted to UTF-8 before being handed over to GTK+. The following example
|
||||
writes the content of a IS0-8859-1 encoded text file to
|
||||
converted to UTF-8 before being handed over to GTK+. The following example
|
||||
writes the content of a IS0-8859-1 encoded text file to
|
||||
<literal>stdout</literal>:
|
||||
<informalexample><programlisting>
|
||||
gchar *text, *utf8_text;
|
||||
gsize length;
|
||||
GError *error = NULL;
|
||||
|
||||
if (g_file_get_contents (filename, &text, &length, NULL))
|
||||
if (g_file_get_contents (filename, &text, &length, NULL))
|
||||
{
|
||||
utf8_text = g_convert (text, length, "UTF-8", "ISO-8859-1",
|
||||
utf8_text = g_convert (text, length, "UTF-8", "ISO-8859-1",
|
||||
NULL, NULL, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
@@ -308,7 +304,7 @@ if (g_file_get_contents (filename, &text, &length, NULL))
|
||||
else
|
||||
g_print (utf8_text);
|
||||
}
|
||||
else
|
||||
else
|
||||
fprintf (stderr, "Unable to read file %s\n", filename);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
@@ -319,37 +315,36 @@ handling non-ASCII content:
|
||||
<varlistentry><term>direct UTF-8</term>
|
||||
<listitem><para>
|
||||
If your editor and compiler are capable of handling UTF-8 encoded sources,
|
||||
it is very convenient to simply use UTF-8 for string literals, since it
|
||||
allows you to edit the strings in "wysiwyg". Note that choosing this option
|
||||
may reduce the portability of your code.
|
||||
it is very convenient to simply use UTF-8 for string literals, since it allows
|
||||
you to edit the strings in "wysiwyg". Note that choosing this option may
|
||||
reduce the portability of your code.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term>escaped UTF-8</term>
|
||||
<listitem><para>
|
||||
Even if your toolchain can't handle UTF-8 directly, you can still encode
|
||||
string literals in UTF-8 by using octal or hexadecimal escapes like
|
||||
<literal>\212</literal> or <literal>\xa8</literal> to encode each byte.
|
||||
This is portable, but modifying the escaped strings is not very convenient.
|
||||
Be careful when mixing hexadecimal escapes with ordinary text;
|
||||
Even if your toolchain can't handle UTF-8 directly, you can still encode string
|
||||
literals in UTF-8 by using octal or hexadecimal escapes like
|
||||
<literal>\212</literal> or <literal>\xa8</literal> to
|
||||
encode each byte. This is portable, but modifying the escaped strings is not
|
||||
very convenient. Be careful when mixing hexadecimal escapes with ordinary text;
|
||||
<literal>"\xa8abcd"</literal> is a string of length 1 !
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term>runtime conversion</term>
|
||||
<listitem><para>
|
||||
If the string literals can be represented in an encoding which your
|
||||
toolchain can handle (e.g. IS0-8859-1), you can write your source files
|
||||
in that encoding and use g_convert() to convert the strings to UTF-8 at
|
||||
runtime. Note that this has some runtime overhead, so you may want to move
|
||||
the conversion out of inner loops.
|
||||
If the string literals can be represented in an encoding which your toolchain
|
||||
can handle (e.g. IS0-8859-1), you can write your source files in that encoding
|
||||
and use g_convert() to convert the strings to UTF-8 at runtime. Note that this
|
||||
has some runtime overhead, so you may want to move the conversion out of inner
|
||||
loops.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
Here is an example showing the three approaches using the copyright sign
|
||||
© which has Unicode and ISO-8859-1 codepoint 169 and is represented
|
||||
in UTF-8 by the two bytes 194, 169, or <literal>"\302\251"</literal> as
|
||||
a string literal:
|
||||
Here is an example showing the three approaches using the copyright sign
|
||||
© which has Unicode and ISO-8859-1 codepoint 169 and is represented in
|
||||
UTF-8 by the two bytes 194, 169:
|
||||
<informalexample><programlisting>
|
||||
g_print ("direct UTF-8: ©");
|
||||
g_print ("escaped UTF-8: \302\251");
|
||||
@@ -373,9 +368,9 @@ How do I use GTK+ with C++?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
There are two ways to approach this. The GTK+ header files use the subset
|
||||
of C that's also valid C++, so you can simply use the normal GTK+ API
|
||||
in a C++ program. Alternatively, you can use a "C++ binding"
|
||||
There are two ways to approach this. The GTK+ header files use the subset
|
||||
of C that's also valid C++, so you can simply use the normal GTK+ API
|
||||
in a C++ program. Alternatively, you can use a "C++ binding"
|
||||
such as <ulink url="http://gtkmm.sourceforge.net/">gtkmm</ulink>
|
||||
which provides a native C++ API.
|
||||
</para>
|
||||
@@ -385,20 +380,20 @@ connected to signals, not methods. So you will need to use global
|
||||
functions or "static" class functions for signal connections.
|
||||
</para>
|
||||
<para>
|
||||
Another common issue when using GTK+ directly is that
|
||||
C++ will not implicitly convert an integer to an enumeration.
|
||||
Another common issue when using GTK+ directly is that
|
||||
C++ will not implicitly convert an integer to an enumeration.
|
||||
This comes up when using bitfields; in C you can write the following
|
||||
code:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
gdk_window_set_events (gdk_window,
|
||||
gdk_window_set_events (gdk_window,
|
||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
while in C++ you must write:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
gdk_window_set_events (gdk_window,
|
||||
gdk_window_set_events (gdk_window,
|
||||
(GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
@@ -432,19 +427,19 @@ How do I load an image or animation from a file?
|
||||
<answer>
|
||||
|
||||
<para>
|
||||
To load an image file straight into a display widget, use
|
||||
gtk_image_new_from_file() <footnote><para> If the file load fails,
|
||||
gtk_image_new_from_file() will display no image graphic — to detect
|
||||
a failed load yourself, use gdk_pixbuf_new_from_file() directly, then
|
||||
gtk_image_new_from_pixbuf().</para></footnote>.
|
||||
To load an image file straight into a display widget, use
|
||||
gtk_image_new_from_file() <footnote><para> If the file load fails,
|
||||
gtk_image_new_from_file() will display no image graphic — to detect
|
||||
a failed load yourself, use gdk_pixbuf_new_from_file() directly, then
|
||||
gtk_image_new_from_pixbuf().</para></footnote>.
|
||||
To load an image for another purpose, use gdk_pixbuf_new_from_file(). To i
|
||||
load an animation, use gdk_pixbuf_animation_new_from_file().
|
||||
gdk_pixbuf_animation_new_from_file() can also load non-animated images, so
|
||||
use it in combination with gdk_pixbuf_animation_is_static_image() to load a
|
||||
file of unknown type.
|
||||
gdk_pixbuf_animation_new_from_file() can also load non-animated images, so
|
||||
use it in combination with gdk_pixbuf_animation_is_static_image() to load a
|
||||
file of unknown type.
|
||||
</para>
|
||||
<para>
|
||||
To load an image or animation file asynchronously (without blocking), use
|
||||
To load an image or animation file asynchronously (without blocking), use
|
||||
#GdkPixbufLoader.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -458,17 +453,19 @@ How do I draw text ?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
To draw a piece of text, use a Pango layout and pango_cairo_show_layout().
|
||||
To draw a piece of text, use a Pango layout and gdk_draw_layout(),
|
||||
using code like the following:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
gdk_draw_layout (..., layout);
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
Do not use the deprecated #GdkFont and gdk_draw_text().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -489,18 +486,19 @@ How do I measure the size of a piece of text ?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
To obtain the size of a piece of text, use a Pango layout and
|
||||
To obtain the size of a piece of text, use a Pango layout and
|
||||
pango_layout_get_pixel_size(), using code like the following:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
pango_layout_get_pixel_size (layout, &width, &height);
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
Do not use the deprecated function gdk_text_width().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -514,21 +512,21 @@ section of <ulink url="http://library.gnome.org/devel/pango/stable/">Pango manua
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
Why are types not registered if I use their <literal>GTK_TYPE_BLAH</literal>
|
||||
Why are types not registered if I use their <literal>GTK_TYPE_BLAH</literal>
|
||||
macro ?
|
||||
</para>
|
||||
</question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
The <literal>GTK_TYPE_BLAH</literal> macros are defined as calls to
|
||||
The <literal>GTK_TYPE_BLAH</literal> macros are defined as calls to
|
||||
<literal>gtk_blah_get_type()</literal>, and the <literal>_get_type()</literal> i
|
||||
functions are declared as %G_GNUC_CONST which allows the compiler to optimize
|
||||
the call away if it appears that the value is not being used.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A common workaround for this problem is to store the result in a volatile
|
||||
A common workaround for this problem is to store the result in a volatile
|
||||
variable, which keeps the compiler from optimizing the call away.
|
||||
<informalexample><programlisting>
|
||||
volatile GType dummy = GTK_TYPE_BLAH;
|
||||
@@ -547,29 +545,28 @@ How do I create a transparent toplevel window ?
|
||||
<answer>
|
||||
<para>
|
||||
To make a window transparent, it needs to use a visual which supports that.
|
||||
This is done by getting the RGBA visual of the screen with
|
||||
gdk_screen_get_rgba_visual() and setting it on the window. Note that
|
||||
gdk_screen_get_rgba_visual() will return %NULL if transparent windows
|
||||
are not supported on the screen, you should fall back to
|
||||
gdk_screen_get_system_visual() in that case. Additionally, note that this
|
||||
will change from screen to screen, so it needs to be repeated whenever the
|
||||
window is moved to a different screen.
|
||||
This is done by getting the RGBA colormap of the screen with
|
||||
gdk_screen_get_rgba_colormap() and setting it on the window. Note that
|
||||
gdk_screen_get_rgba_colormap() will return %NULL if transparent windows
|
||||
are not supported on the screen; also note that this may change from
|
||||
screen to screen, so it needs to be repeated whenever the window is moved
|
||||
to a different screen.
|
||||
<informalexample><programlisting>
|
||||
GdkVisual *visual;
|
||||
GdkColormap *colormap;
|
||||
|
||||
visual = gdk_screen_get_rgba_visual (screen);
|
||||
if (visual == NULL)
|
||||
visual = gdk_screen_get_system_visual (screen);
|
||||
colormap = gdk_screen_get_rgba_colormap (screen);
|
||||
if (!colormap)
|
||||
colormap = gdk_screen_get_rgb_colormap (screen);
|
||||
|
||||
gtk_widget_set_visual (GTK_WIDGET (window), visual);
|
||||
gtk_widget_set_colormap (widget, colormap);
|
||||
</programlisting></informalexample>
|
||||
To fill the alpha channel on the window simply use cairos
|
||||
RGBA drawing capabilities.
|
||||
One possibility to fill the alpha channel on the window is to use
|
||||
gdk_draw_rgb_32_image().
|
||||
</para>
|
||||
<para>
|
||||
Note that the presence of an RGBA visual is no guarantee that the
|
||||
window will actually appear transparent on screen. On X11, this
|
||||
requires a compositing manager to be running. See
|
||||
window will actually appear transparent on screen. On X11, this
|
||||
requires a compositing manager to be running. See
|
||||
gtk_widget_is_composited() for a way to find out if the alpha
|
||||
channel will be respected.
|
||||
</para>
|
||||
@@ -588,8 +585,10 @@ channel will be respected.
|
||||
<answer>
|
||||
<para>
|
||||
See <link linkend="TreeWidget">tree widget overview</link> — you
|
||||
should use the #GtkTreeView widget. (A list is just a tree with no branches,
|
||||
so the tree widget is used for lists as well).
|
||||
should use the #GtkTreeView widget. (A list is just a tree with no branches,
|
||||
so the tree widget is used for lists as well.) Do not use the deprecated
|
||||
widgets #GtkTree or #GtkCList/#GtkCTree in newly-written code, they are
|
||||
less flexible and result in an inferior user interface.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -602,11 +601,12 @@ so the tree widget is used for lists as well).
|
||||
<answer>
|
||||
<para>
|
||||
See <link linkend="TextWidget">text widget overview</link> — you
|
||||
should use the #GtkTextView widget.
|
||||
should use the #GtkTextView widget. Do not use the deprecated widget #GtkText
|
||||
in newly-written code, it has a number of problems that are best avoided.
|
||||
</para>
|
||||
<para>
|
||||
If you only have a small amount of text, #GtkLabel may also be appropriate
|
||||
of course. It can be made selectable with gtk_label_set_selectable(). For a
|
||||
If you only have a small amount of text, #GtkLabel may also be appropriate
|
||||
of course. It can be made selectable with gtk_label_set_selectable(). For a
|
||||
single-line text entry, see #GtkEntry.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -620,8 +620,8 @@ single-line text entry, see #GtkEntry.
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
#GtkImage can display images in just about any format GTK+ understands.
|
||||
You can also use #GtkDrawingArea if you need to do something more complex,
|
||||
#GtkImage can display images in just about any format GTK+ understands.
|
||||
You can also use #GtkDrawingArea if you need to do something more complex,
|
||||
such as draw text or graphics over the top of the image.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -637,8 +637,7 @@ would use a combo box?
|
||||
<para>
|
||||
With GTK+, a #GtkComboBox is the recommended widget to use for this use case.
|
||||
This widget looks like either a combo box or the current option menu, depending
|
||||
on the current theme. If you need an editable text entry, use the
|
||||
#GtkComboBox:has-entry property.
|
||||
on the current theme. If you need an editable text entry, use #GtkComboBoxEntry.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -653,14 +652,17 @@ How do I change the color of a widget?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
See gtk_widget_override_color() and gtk_widget_override_background_color().
|
||||
You can also change the appearance of a widget by installing a
|
||||
custom style provider, see gtk_style_context_add_provider().
|
||||
See gtk_widget_modify_fg(), gtk_widget_modify_bg(), gtk_widget_modify_base(),
|
||||
and gtk_widget_modify_text(). See <link linkend="gtk-Resource-Files">GTK+
|
||||
resource files</link> for more discussion. You can also change widget color
|
||||
by installing a resource file and parsing it with gtk_rc_add_default_file().
|
||||
The advantage of a resource file is that users can then override the
|
||||
color you've chosen.
|
||||
</para>
|
||||
|
||||
<para>To change the background color for widgets such as #GtkLabel that
|
||||
have no background, place them in a #GtkEventBox and set the background
|
||||
of the event box.
|
||||
<para>To change the background color for widgets such as #GtkLabel that have
|
||||
no background, place them in a #GtkEventBox and set the background of the
|
||||
event box.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
@@ -670,38 +672,35 @@ How do I change the font of a widget?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
This has several possible answers, depending on what exactly you want to
|
||||
achieve. One option is gtk_widget_override_font().
|
||||
<informalexample><programlisting>
|
||||
This has several possible answers, depending on what exactly you want to
|
||||
achieve. One option is gtk_widget_modify_font(). Note that this function
|
||||
can be used to change only the font size, as in the following example:
|
||||
<programlisting>
|
||||
PangoFontDesc *font_desc = pango_font_description_new (<!-- -->);
|
||||
pango_font_description_set_size (font_desc, 40);
|
||||
gtk_widget_override_font (widget, font);
|
||||
gtk_widget_modify_font (widget, font);
|
||||
pango_font_description_free (font_desc);
|
||||
</programlisting></informalexample>
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
If you want to make the text of a label larger, you can use
|
||||
If you want to make the text of a label larger, you can use
|
||||
gtk_label_set_markup():
|
||||
<informalexample><programlisting>
|
||||
<programlisting>
|
||||
gtk_label_set_markup (label, "<big>big text</big>");
|
||||
</programlisting></informalexample>
|
||||
This is preferred for many apps because it's a relative size to the
|
||||
user's chosen font size. See g_markup_escape_text() if you are
|
||||
</programlisting>
|
||||
This is preferred for many apps because it's a relative size to the
|
||||
user's chosen font size. See g_markup_escape_text() if you are
|
||||
constructing such strings on the fly.
|
||||
</para>
|
||||
<para>
|
||||
You can also change the font of a widget by putting
|
||||
<programlisting>
|
||||
.my-widget-class {
|
||||
font: Sans 30;
|
||||
}
|
||||
gtk-font-name = "Sans 30"
|
||||
</programlisting>
|
||||
in a CSS file, loading it with gtk_css_provider_load_from_file(), and
|
||||
adding the provider with gtk_style_context_add_provider_for_screen().
|
||||
To associate this style information with your widget, set a style class
|
||||
on its #GtkStyleContext using gtk_style_context_add_class().
|
||||
The advantage of this approach is that users can then override the font
|
||||
you have chosen. See the #GtkStyleContext documentation for more discussion.
|
||||
in a resource file and parsing it with gtk_rc_add_default_file().
|
||||
The advantage of a resource file is that users can then override the font you
|
||||
have chosen. See <link linkend="gtk-Resource-Files">GTK+ resource files</link>
|
||||
for more discussion.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -711,9 +710,8 @@ you have chosen. See the #GtkStyleContext documentation for more discussion.
|
||||
How do I disable/ghost/desensitize a widget?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
In GTK+ a disabled widget is termed "insensitive."
|
||||
See gtk_widget_set_sensitive().
|
||||
<answer><para> In GTK+ a disabled widget is termed "insensitive." See
|
||||
gtk_widget_set_sensitive().
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
@@ -752,14 +750,14 @@ How do I make a text widget display its complete contents in a specific font?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
If you use gtk_text_buffer_insert_with_tags() with appropriate tags to
|
||||
select the font, the inserted text will have the desired appearance, but
|
||||
text typed in by the user before or after the tagged block will appear in
|
||||
the default style.
|
||||
If you use gtk_text_buffer_insert_with_tags() with appropriate tags to select
|
||||
the font, the inserted text will have the desired appearance, but text typed
|
||||
in by the user before or after the tagged block will appear in the default
|
||||
style.
|
||||
</para>
|
||||
<para>
|
||||
To ensure that all text has the desired appearance, use
|
||||
gtk_widget_override_font() to change the default font for the widget.
|
||||
To ensure that all text has the desired appearance, use gtk_widget_modify_font()
|
||||
to change the default font for the widget.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
@@ -776,17 +774,17 @@ A good way to keep a text buffer scrolled to the end is to place a
|
||||
<link linkend="GtkTextMark">mark</link> at the end of the buffer, and
|
||||
give it right gravity. The gravity has the effect that text inserted
|
||||
at the mark gets inserted <emphasis>before</emphasis>, keeping the mark
|
||||
at the end.
|
||||
at the end.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<para>
|
||||
To ensure that the end of the buffer remains visible, use
|
||||
gtk_text_view_scroll_to_mark() to scroll to the mark after
|
||||
inserting new text.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The gtk-demo application contains an example of this technique.
|
||||
The gtk-demo application contains an example of this technique.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -803,10 +801,25 @@ How do I associate some data with a row in the tree?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
Remember that the #GtkTreeModel columns don't necessarily have to be
|
||||
displayed. So you can put non-user-visible data in your model just
|
||||
like any other data, and retrieve it with gtk_tree_model_get().
|
||||
See the <link linkend="TreeWidget">tree widget overview</link>.
|
||||
Remember that the #GtkTreeModel columns don't necessarily have to be displayed.
|
||||
So you can put non-user-visible data in your model just like any other data,
|
||||
and retrieve it with gtk_tree_model_get(). See the
|
||||
<link linkend="TreeWidget">tree widget overview</link>.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
What's the #GtkTreeView equivalent of gtk_clist_find_row_from_data()?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
As there is no separate data column in the #GtkTreeModel, there's no
|
||||
built in function to find the iter from data. You can write a custom
|
||||
searching function to walk the tree and find the data, or use
|
||||
gtk_tree_model_foreach().
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -818,9 +831,9 @@ How do I put an image and some text in the same column?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
You can pack more than one #GtkCellRenderer into a single #GtkTreeViewColumn
|
||||
using gtk_tree_view_column_pack_start() or gtk_tree_view_column_pack_end().
|
||||
So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the
|
||||
You can pack more than one #GtkCellRenderer into a single #GtkTreeViewColumn
|
||||
using gtk_tree_view_column_pack_start() or gtk_tree_view_column_pack_end().
|
||||
So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the
|
||||
column.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -828,15 +841,15 @@ column.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
I can set data easily on my #GtkTreeStore/#GtkListStore models using
|
||||
I can set data easily on my #GtkTreeStore/#GtkListStore models using
|
||||
gtk_list_store_set() and gtk_tree_store_set(), but can't read it back?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
Both the #GtkTreeStore and the #GtkListStore implement the #GtkTreeModel
|
||||
interface. Consequentially, you can use any function this interface
|
||||
implements. The easiest way to read a set of data back is to use
|
||||
interface. Consequentially, the can use any function this interface
|
||||
implements. The easiest way to read a set of data back is to use
|
||||
gtk_tree_model_get().
|
||||
</para>
|
||||
</answer>
|
||||
@@ -848,14 +861,14 @@ How do I change the way that numbers are formatted by #GtkTreeView?
|
||||
</para></question>
|
||||
<answer><para>
|
||||
Use gtk_tree_view_insert_column_with_data_func()
|
||||
or gtk_tree_view_column_set_cell_data_func() and do the conversion
|
||||
from number to string yourself (with, say, g_strdup_printf()).
|
||||
or gtk_tree_view_column_set_cell_data_func() and do the conversion from i
|
||||
number to string yourself (with, say, g_strdup_printf()).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following example demonstrates this:
|
||||
<informalexample><programlisting>
|
||||
enum
|
||||
enum
|
||||
{
|
||||
DOUBLE_COLUMN,
|
||||
N_COLUMNS
|
||||
@@ -864,11 +877,11 @@ enum
|
||||
GtkListStore *mycolumns;
|
||||
GtkTreeView *treeview;
|
||||
|
||||
void
|
||||
void
|
||||
my_cell_double_to_text (GtkTreeViewColumn *tree_column,
|
||||
GtkCellRenderer *cell,
|
||||
GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
GtkCellRendererText *cell_text = (GtkCellRendererText *)cell;
|
||||
@@ -883,7 +896,7 @@ my_cell_double_to_text (GtkTreeViewColumn *tree_column,
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
set_up_new_columns (GtkTreeView *myview)
|
||||
{
|
||||
GtkCellRendererText *renderer;
|
||||
@@ -899,7 +912,7 @@ set_up_new_columns (GtkTreeView *myview)
|
||||
|
||||
/* Create a new column that has a title ("Example column"),
|
||||
* uses the above created renderer that will render the double
|
||||
* value into text from the associated model's rows.
|
||||
* value into text from the associated model's rows.
|
||||
*/
|
||||
column = gtk_tree_view_column_new (<!-- -->);
|
||||
gtk_tree_view_column_set_title (column, "Example column");
|
||||
@@ -913,10 +926,10 @@ set_up_new_columns (GtkTreeView *myview)
|
||||
*/
|
||||
/* Set up a custom function that will be called when the column content
|
||||
* is rendered. We use the func_data pointer as an index into our
|
||||
* model. This is convenient when using multi column lists.
|
||||
* model. This is convenient when using multi column lists.
|
||||
*/
|
||||
gtk_tree_view_column_set_cell_data_func (column, renderer,
|
||||
my_cell_double_to_text,
|
||||
my_cell_double_to_text,
|
||||
(gpointer)DOUBLE_COLUMN, NULL);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
@@ -944,15 +957,42 @@ How do I use cairo to draw in GTK+ applications ?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
The #GtkWidget::draw signal gets a ready-to-use cairo context
|
||||
as parameter that you should use.
|
||||
Use gdk_cairo_create() to obtain a cairo context for drawing
|
||||
on a GDK window or pixmap. See <link linkend="gdk-Cairo-Interaction">Cairo
|
||||
Interaction</link> for some more useful functions.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
I have created a cairo context with gdk_cairo_create(), but when I
|
||||
later use it, my drawing does not show up. Why is that ?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
All drawing in GTK+ is normally done in an expose handler, and GTK+
|
||||
creates a temporary pixmap for double-buffering the drawing. If you
|
||||
create a cairo context outside the expose handler, it is backed
|
||||
by the GDK window itself, not the double-buffering pixmap. Consequently,
|
||||
any drawing you do with that cairo context gets overwritten at the
|
||||
end of the expose handler, when the double-buffering pixmap is copied
|
||||
back.
|
||||
</para>
|
||||
<para>
|
||||
All drawing in GTK+ is normally done in a draw handler, and GTK+
|
||||
creates a temporary pixmap for double-buffering the drawing.
|
||||
It is possible to turn off double-buffering, with
|
||||
gtk_widget_set_double_buffered(), but this is not ideal,
|
||||
since it can cause some flickering.
|
||||
Possible solutions to this problem are:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
Turn off double-buffering, with gtk_widget_set_double_buffered().
|
||||
This is not ideal, since it can cause some flickering.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Create the cairo context inside the expose handler. If you do this,
|
||||
gdk_create_cairo() arranges for it to be backed by the double-buffering
|
||||
pixmap. This is the preferred solution, and is used throughout GTK+
|
||||
itself.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -960,7 +1000,7 @@ since it can cause some flickering.
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
Can I improve the performance of my application by using the
|
||||
Glitz or GL backend of cairo ?
|
||||
Glitz backend of cairo ?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
@@ -980,7 +1020,7 @@ Can I use cairo to draw on a #GdkPixbuf ?
|
||||
|
||||
<answer><para>
|
||||
No, at least not yet. The cairo image surface does not support the
|
||||
pixel format used by GdkPixbuf.
|
||||
pixel format used by GdkPixbuf.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-resources">
|
||||
<refentry id="gtk-resources" revision="5 Sept 2001">
|
||||
<refmeta>
|
||||
<refentrytitle>Mailing lists and bug reports</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
@@ -199,13 +199,9 @@ additional environment variables.
|
||||
<para>
|
||||
A list of modules to load. Note that GTK+ also allows to specify modules to load via a commandline option (<option>--gtk-module</option>) and with the <literal>gtk-modules</literal> setting.
|
||||
</para>
|
||||
<warning>
|
||||
Note that this environment variable is read by GTK+ 2.x too,
|
||||
which may not have the same set of modules available for loading.
|
||||
</warning>
|
||||
</formalpara>
|
||||
|
||||
<formalpara id="gtk-path">
|
||||
<formalpara>
|
||||
<title><envar>GTK_PATH</envar></title>
|
||||
|
||||
<para>
|
||||
@@ -215,7 +211,7 @@ additional environment variables.
|
||||
modules, file system backends and print backends. If the path to
|
||||
the dynamically loaded object is given as an absolute path name,
|
||||
then GTK+ loads it directly.
|
||||
Otherwise, GTK+ goes in turn through the directories in <envar>GTK_PATH</envar>,
|
||||
Otherwise, GTK+ goes in turn through the directories in GTK_PATH,
|
||||
followed by the directory <filename>.gtk-3.0</filename> in the user's
|
||||
home directory, followed by the system default directory,
|
||||
which is <filename><replaceable>libdir</replaceable>/gtk-3.0/modules</filename>.
|
||||
@@ -245,12 +241,6 @@ additional environment variables.
|
||||
The components of GTK_PATH are separated by the ':' character on
|
||||
Linux and Unix, and the ';' character on Windows.
|
||||
</para>
|
||||
<warning>
|
||||
Note that this environment variable is read by GTK+ 2.x too, which
|
||||
makes it unsuitable for setting it system-wide (or session-wide),
|
||||
since doing so will cause either GTK+ 2.x applications or GTK+ 3
|
||||
applications to see incompatible modules.
|
||||
</warning>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
@@ -258,32 +248,23 @@ additional environment variables.
|
||||
|
||||
<para>
|
||||
Specifies an IM module to use in preference to the one determined
|
||||
from the locale. If this isn't set and you are running on the system
|
||||
from the locale. If this isn't set and you are running on the system
|
||||
that enables <literal>XSETTINGS</literal> and has a value in
|
||||
<literal>Gtk/IMModule</literal>, that will be used for the default
|
||||
IM module.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara id="gtk-im-module-file">
|
||||
<formalpara id="im-module-file">
|
||||
<title><envar>GTK_IM_MODULE_FILE</envar></title>
|
||||
|
||||
<para>
|
||||
Specifies the file listing the IM modules to load. This environment
|
||||
variable the default value
|
||||
variable overrides the <literal>im_module_file</literal> specified in
|
||||
the RC files, which in turn overrides the default value
|
||||
<filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename>
|
||||
(<replaceable>libdir</replaceable> has the same meaning here as explained for <envar>GTK_PATH</envar>).
|
||||
</para>
|
||||
<para>
|
||||
The <filename>immodules.cache</filename> file is generated by the
|
||||
<command>gtk-query-immodules-3.0</command> utility.
|
||||
</para>
|
||||
<warning>
|
||||
Note that this environment variable is read by GTK+ 2.x too, which
|
||||
makes it unsuitable for setting it system-wide (or session-wide),
|
||||
since doing so will cause either GTK+ 2.x applications or GTK+ 3
|
||||
applications to see the wrong list of IM modules.
|
||||
</warning>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
@@ -316,13 +297,9 @@ nevertheless.
|
||||
<para>
|
||||
Specifies the file listing the GdkPixbuf loader modules to load.
|
||||
This environment variable overrides the default value
|
||||
<filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/loaders.cache</filename>
|
||||
<filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/loaders.cache</filename>
|
||||
(<replaceable>libdir</replaceable> is the sysconfdir specified when
|
||||
GTK+ was configured, usually <filename>/usr/local/lib</filename>.)
|
||||
</para>
|
||||
<para>
|
||||
The <filename>loaders.cache</filename> file is generated by the
|
||||
<command>gdk-pixbuf-query-loaders</command> utility.
|
||||
GTK+ was configured, usually <filename>/usr/local/lib</filename>.)
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@@ -391,34 +368,6 @@ nevertheless.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GDK_BACKEND</envar></title>
|
||||
|
||||
<para>
|
||||
If set, selects the GDK backend to use. Selecting a backend requires that GTK is compiled
|
||||
with support for that backend. The following backends can be selected:
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term>quartz</term>
|
||||
<listitem><para>Selects the native Quartz backend</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>win32</term>
|
||||
<listitem><para>Selects the native backend for Microsoft Windows</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>x11</term>
|
||||
<listitem><para>Selects the native backend for connecting to X11 servers.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
For more information about selecting backends, see the gdk_display_manager_get() function.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>GDK_SYNCHRONIZE</envar></title>
|
||||
|
||||
@@ -440,19 +389,6 @@ nevertheless.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><envar>DESKTOP_STARTUP_ID</envar></title>
|
||||
|
||||
<para>
|
||||
GTK+ uses this environment variable to provide startup notification
|
||||
according to the <ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">Startup Notification Spec</ulink>.
|
||||
Following the specification, GTK+ unsets this variable after reading
|
||||
it (to keep it from leaking to child processes). So, if you need its
|
||||
value for your own purposes, you have to read it before calling
|
||||
gtk_init().
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
</refsect2>
|
||||
|
||||
</refsect1>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="TextWidget">
|
||||
<refentry id="TextWidget" revision="18 Oct 2000">
|
||||
<refmeta>
|
||||
<refentrytitle>Text Widget Overview</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
19
docs/reference/gtk/tmpl/.gitignore
vendored
19
docs/reference/gtk/tmpl/.gitignore
vendored
@@ -3,13 +3,11 @@ gtkactiongroup.sgml
|
||||
gtkaboutdialog.sgml
|
||||
gtkadjustment.sgml
|
||||
gtkbbox.sgml
|
||||
gtkbindings.sgml
|
||||
gtkbox.sgml
|
||||
gtkbuilder.sgml
|
||||
gtkbutton.sgml
|
||||
gtkcalendar.sgml
|
||||
gtkcelleditable.sgml
|
||||
gtkcelllayout.sgml
|
||||
gtkcellrenderer.sgml
|
||||
gtkcellrenderertext.sgml
|
||||
gtkcellview.sgml
|
||||
@@ -18,17 +16,9 @@ gtkcolorsel.sgml
|
||||
gtkcombobox.sgml
|
||||
gtkcomboboxentry.sgml
|
||||
gtkcontainer.sgml
|
||||
gtkdialog.sgml
|
||||
gtkdrawingarea.sgml
|
||||
gtkeditable.sgml
|
||||
gtkentry.sgml
|
||||
gtkentrybuffer.sgml
|
||||
gtkenum.sgml
|
||||
gtkeventbox.sgml
|
||||
gtkexpander.sgml
|
||||
gtkfeatures.sgml
|
||||
gtkfixed.sgml
|
||||
gtkfilefilter.sgml
|
||||
gtkhbox.sgml
|
||||
gtkiconview.sgml
|
||||
gtkimcontextsimple.sgml
|
||||
@@ -36,10 +26,6 @@ gtkimmulticontext.sgml
|
||||
gtkitemfactory.sgml
|
||||
gtklayout.sgml
|
||||
gtklinkbutton.sgml
|
||||
gtkmain.sgml
|
||||
gtkmenu.sgml
|
||||
gtkmenubar.sgml
|
||||
gtkmenushell.sgml
|
||||
gtkmessagedialog.sgml
|
||||
gtknotebook.sgml
|
||||
gtkobject.sgml
|
||||
@@ -49,8 +35,6 @@ gtkpagesetupunixdialog.sgml
|
||||
gtkpaned.sgml
|
||||
gtkpapersize.sgml
|
||||
gtkprinter.sgml
|
||||
gtkprintjob.sgml
|
||||
gtkprintoperation.sgml
|
||||
gtkprogressbar.sgml
|
||||
gtkradioaction.sgml
|
||||
gtkradiobutton.sgml
|
||||
@@ -65,7 +49,6 @@ gtkscale.sgml
|
||||
gtkscalebutton.sgml
|
||||
gtkscrollbar.sgml
|
||||
gtkscrolledwindow.sgml
|
||||
gtkselection.sgml
|
||||
gtkseparator.sgml
|
||||
gtkseparatormenuitem.sgml
|
||||
gtkseparatortoolitem.sgml
|
||||
@@ -74,7 +57,6 @@ gtkstatusbar.sgml
|
||||
gtkstyle.sgml
|
||||
gtktesting.sgml
|
||||
gtktextiter.sgml
|
||||
gtktexttag.sgml
|
||||
gtktexttagtable.sgml
|
||||
gtktextview.sgml
|
||||
gtktoggleaction.sgml
|
||||
@@ -82,7 +64,6 @@ gtktoolbar.sgml
|
||||
gtktoolitem.sgml
|
||||
gtktooltip.sgml
|
||||
gtktreednd.sgml
|
||||
gtktreemodel.sgml
|
||||
gtktreemodelfilter.sgml
|
||||
gtktreeselection.sgml
|
||||
gtktreesortable.sgml
|
||||
|
296
docs/reference/gtk/tmpl/gtkbindings.sgml
Normal file
296
docs/reference/gtk/tmpl/gtkbindings.sgml
Normal file
@@ -0,0 +1,296 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Bindings
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Key bindings for individual widgets
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
GtkBinding provides a mechanism for configuring GTK+ key bindings through
|
||||
RC files. This eases key binding adjustments for application developers as
|
||||
well as users and provides GTK+ users or administrators with high key
|
||||
binding configurability which requires no application or toolkit side changes.
|
||||
</para>
|
||||
|
||||
<refsect2>
|
||||
<anchor id="gtk-bindings-install"/>
|
||||
<title>Installing a key binding</title>
|
||||
|
||||
<para>
|
||||
A resource file binding consists of a 'binding' definition and a match
|
||||
statement to apply the binding to specific widget types. Details on the
|
||||
matching mechanism are described under
|
||||
<link linkend="gtkrc-pathnames-and-patterns">Pathnames and patterns</link>.
|
||||
Inside the binding definition, key combinations are bound to specific signal
|
||||
emissions on the target widget. Key combinations are strings consisting of
|
||||
an optional #GdkModifierType name and
|
||||
<link linkend="gdk-Keyboard-Handling">key names</link> such as those defined
|
||||
in <filename><gdk/gdkkeysyms.h></filename> or returned from
|
||||
gdk_keyval_name(), they have to be parsable by gtk_accelerator_parse().
|
||||
Specifications of signal emissions consist of a string identifying the signal
|
||||
name, and a list of signal specific arguments in parenthesis.
|
||||
</para>
|
||||
<para>
|
||||
For example for binding Control and the left or right cursor keys of a
|
||||
#GtkEntry widget to the #GtkEntry::move-cursor signal, so movement occurs
|
||||
in 3 letter steps, the following binding can be used:
|
||||
|
||||
<informalexample><programlisting>
|
||||
binding "MoveCursor3" {
|
||||
bind "<Control>Right" {
|
||||
"move-cursor" (visual-positions, 3, 0)
|
||||
}
|
||||
bind "<Control>Left" {
|
||||
"move-cursor" (visual-positions, -3, 0)
|
||||
}
|
||||
}
|
||||
class "GtkEntry" binding "MoveCursor3"
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
|
||||
<anchor id="gtk-bindings-unbind"/>
|
||||
<title>Unbinding existing key bindings</title>
|
||||
<para>
|
||||
GTK+ already defines a number of useful bindings for the widgets it provides.
|
||||
Because custom bindings set up in RC files take precedence over the default
|
||||
bindings shipped with GTK+, overriding existing bindings as demonstrated in
|
||||
<link linkend="gtk-bindings-install">Installing a key binding</link>
|
||||
works as expected. The same mechanism can not be used to "unbind" existing
|
||||
bindings, however.
|
||||
|
||||
<informalexample><programlisting>
|
||||
binding "MoveCursor3" {
|
||||
bind "<Control>Right" { }
|
||||
bind "<Control>Left" { }
|
||||
}
|
||||
class "GtkEntry" binding "MoveCursor3"
|
||||
</programlisting></informalexample>
|
||||
|
||||
The above example will not have the desired effect of causing
|
||||
"<Control>Right" and "<Control>Left" key presses to be ignored
|
||||
by GTK+. Instead, it just causes any existing bindings from the bindings
|
||||
set "MoveCursor3" to be deleted, so when "<Control>Right" or
|
||||
"<Control>Left" are pressed, no binding for these keys is found in
|
||||
binding set "MoveCursor3". GTK+ will thus continue to search for matching
|
||||
key bindings, and will eventually lookup and find the default GTK+ bindings
|
||||
for entries which implement word movement. To keep GTK+ from activating its
|
||||
default bindings, the "unbind" keyword can be used like this:
|
||||
|
||||
<informalexample><programlisting>
|
||||
binding "MoveCursor3" {
|
||||
unbind "<Control>Right"
|
||||
unbind "<Control>Left"
|
||||
}
|
||||
class "GtkEntry" binding "MoveCursor3"
|
||||
</programlisting></informalexample>
|
||||
|
||||
Now, GTK+ will find a match when looking up "<Control>Right" and
|
||||
"<Control>Left" key presses before it resorts to its default
|
||||
bindings, and the match instructs it to abort ("unbind") the search, so
|
||||
the key presses are not consumed by this widget. As usual, further processing
|
||||
of the key presses, e.g. by an entry's parent widget, is now possible.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The "unbind" functionality has been introduced in GTK+ 2.12.
|
||||
</para>
|
||||
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><link linkend="gtk-keyboard-accelerators">Keyboard Accelerators</link>
|
||||
</term>
|
||||
<listitem><para>installing and using keyboard short-cuts.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><link linkend="Resource-Files">Resource Files</link>
|
||||
</term>
|
||||
<listitem><para>GTK+ Resource Files - behavior and style definitions.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkBindingSet ##### -->
|
||||
<para>
|
||||
A binding set maintains a list of activatable key bindings.
|
||||
A single binding set can match multiple types of widgets.
|
||||
Similar to styles, widgets can be mapped by widget name paths, widget
|
||||
class paths or widget class types. When a binding within a set is
|
||||
matched upon activation, an action signal is emitted on the target
|
||||
widget to carry out the actual activation.
|
||||
</para>
|
||||
|
||||
@set_name: unique binding set name
|
||||
@priority: unused
|
||||
@widget_path_pspecs: widgets matched by path that this binding set applies to
|
||||
@widget_class_pspecs: widgets matched by class path that this binding set applies to
|
||||
@class_branch_pspecs: widgets matched by class that this binding set applies to
|
||||
@entries: the key binding entries in this binding set
|
||||
@current: implementation detail
|
||||
@parsed: whether this binding set stems from an RC file and is reset upon theme changes
|
||||
|
||||
<!-- ##### STRUCT GtkBindingEntry ##### -->
|
||||
<para>
|
||||
Each key binding element of a binding sets binding list is represented by
|
||||
a #GtkBindingEntry.
|
||||
</para>
|
||||
|
||||
@keyval: key value to match
|
||||
@modifiers: key modifier to match
|
||||
@binding_set: binding set this entry belongs to
|
||||
@destroyed: implementation detail
|
||||
@in_emission: implementation detail
|
||||
@marks_unbound: implementation detail
|
||||
@set_next: linked list of entries maintained by binding set
|
||||
@hash_next: implementation detail
|
||||
@signals: action signals of this entry
|
||||
|
||||
<!-- ##### STRUCT GtkBindingSignal ##### -->
|
||||
<anchor id="keybinding-signals"/>
|
||||
<para>
|
||||
A #GtkBindingSignal stores the necessary information to activate a widget
|
||||
in response to a key press via a signal emission.
|
||||
</para>
|
||||
|
||||
@next: implementation detail
|
||||
@signal_name: the action signal to be emitted
|
||||
@n_args: number of arguments specified for the signal
|
||||
@args: the arguments specified for the signal
|
||||
|
||||
<!-- ##### STRUCT GtkBindingArg ##### -->
|
||||
<para>
|
||||
A #GtkBindingArg holds the data associated with an argument for a
|
||||
key binding signal emission as stored in #GtkBindingSignal.
|
||||
</para>
|
||||
|
||||
@arg_type: implementation detail
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_entry_add_signall ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@binding_set:
|
||||
@keyval:
|
||||
@modifiers:
|
||||
@signal_name:
|
||||
@binding_args:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_set_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@set_name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_set_by_class ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@object_class:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_set_find ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@set_name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_bindings_activate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@object:
|
||||
@keyval:
|
||||
@modifiers:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_bindings_activate_event ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@object:
|
||||
@event:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_set_activate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@binding_set:
|
||||
@keyval:
|
||||
@modifiers:
|
||||
@object:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_entry_add_signal ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@binding_set:
|
||||
@keyval:
|
||||
@modifiers:
|
||||
@signal_name:
|
||||
@n_args:
|
||||
@Varargs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_entry_skip ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@binding_set:
|
||||
@keyval:
|
||||
@modifiers:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_entry_remove ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@binding_set:
|
||||
@keyval:
|
||||
@modifiers:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_binding_set_add_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@binding_set:
|
||||
@path_type:
|
||||
@path_pattern:
|
||||
@priority:
|
||||
|
||||
|
1312
docs/reference/gtk/tmpl/gtkclist.sgml
Normal file
1312
docs/reference/gtk/tmpl/gtkclist.sgml
Normal file
File diff suppressed because it is too large
Load Diff
406
docs/reference/gtk/tmpl/gtkdialog.sgml
Normal file
406
docs/reference/gtk/tmpl/gtkdialog.sgml
Normal file
@@ -0,0 +1,406 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkDialog
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Create popup windows
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
|
||||
<para>
|
||||
Dialog boxes are a convenient way to prompt the user for a small amount of
|
||||
input, e.g. to display a message, ask a question, or anything else that does
|
||||
not require extensive effort on the user's part.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GTK+ treats a dialog as a window split vertically. The top section is a
|
||||
#GtkVBox known as the <structfield>content_area</structfield>, and is
|
||||
where widgets such as a #GtkLabel or a #GtkEntry should be packed.
|
||||
The bottom area is known as the <structfield>action_area</structfield>.
|
||||
This is generally used for packing buttons into the dialog which may
|
||||
perform functions such as cancel, ok, or apply.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GtkDialog boxes are created with a call to gtk_dialog_new() or
|
||||
gtk_dialog_new_with_buttons(). gtk_dialog_new_with_buttons() is recommended;
|
||||
it allows you to set the dialog title, some convenient flags, and add simple
|
||||
buttons.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If 'dialog' is a newly created dialog, the two primary areas of the window
|
||||
can be accessed through gtk_dialog_get_content_area() and
|
||||
gtk_dialog_get_action_area(), as can be seen from the example, below.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A 'modal' dialog (that is, one which freezes the rest of the application from
|
||||
user input), can be created by calling gtk_window_set_modal() on the dialog. Use
|
||||
the GTK_WINDOW() macro to cast the widget returned from gtk_dialog_new() into a
|
||||
#GtkWindow. When using gtk_dialog_new_with_buttons() you can also pass the
|
||||
#GTK_DIALOG_MODAL flag to make a dialog modal.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you add buttons to #GtkDialog using gtk_dialog_new_with_buttons(),
|
||||
gtk_dialog_add_button(), gtk_dialog_add_buttons(), or
|
||||
gtk_dialog_add_action_widget(), clicking the button will emit a signal called
|
||||
"response" with a response ID that you specified. GTK+ will never assign a
|
||||
meaning to positive response IDs; these are entirely user-defined. But for
|
||||
convenience, you can use the response IDs in the #GtkResponseType enumeration
|
||||
(these all have values less than zero). If a dialog receives a delete event,
|
||||
the "response" signal will be emitted with a response ID of #GTK_RESPONSE_DELETE_EVENT.
|
||||
</para>
|
||||
|
||||
|
||||
<para>
|
||||
If you want to block waiting for a dialog to return before returning control
|
||||
flow to your code, you can call gtk_dialog_run(). This function enters a
|
||||
recursive main loop and waits for the user to respond to the dialog, returning the
|
||||
response ID corresponding to the button the user clicked.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For the simple dialog in the following example, in reality you'd probably use
|
||||
#GtkMessageDialog to save yourself some effort. But you'd need to create the
|
||||
dialog contents manually if you had more than a simple message in the dialog.
|
||||
<example>
|
||||
<title>Simple <structname>GtkDialog</structname> usage.</title>
|
||||
<programlisting>
|
||||
|
||||
/* Function to open a dialog box displaying the message provided. */
|
||||
|
||||
void quick_message (gchar *message) {
|
||||
|
||||
GtkWidget *dialog, *label, *content_area;
|
||||
|
||||
/* Create the widgets */
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons ("Message",
|
||||
main_application_window,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_STOCK_OK,
|
||||
GTK_RESPONSE_NONE,
|
||||
NULL);
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
||||
label = gtk_label_new (message);
|
||||
|
||||
/* Ensure that the dialog box is destroyed when the user responds. */
|
||||
|
||||
g_signal_connect_swapped (dialog,
|
||||
"response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog);
|
||||
|
||||
/* Add the label, and show everything we've added to the dialog. */
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (content_area), label);
|
||||
gtk_widget_show_all (dialog);
|
||||
}
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<refsect2 id="GtkDialog-BUILDER-UI"><title>GtkDialog as GtkBuildable</title>
|
||||
<para>
|
||||
The GtkDialog implementation of the GtkBuildable interface exposes the
|
||||
@vbox and @action_area as internal children with the names "vbox" and
|
||||
"action_area".
|
||||
</para>
|
||||
<para>
|
||||
GtkDialog supports a custom <action-widgets> element, which
|
||||
can contain multiple <action-widget> elements. The "response"
|
||||
attribute specifies a numeric response, and the content of the element
|
||||
is the id of widget (which should be a child of the dialogs @action_area).
|
||||
</para>
|
||||
<example>
|
||||
<title>A <structname>GtkDialog</structname> UI definition fragment.</title>
|
||||
<programlisting><![CDATA[
|
||||
<object class="GtkDialog" id="dialog1">
|
||||
<child internal-child="vbox">"
|
||||
<object class="GtkVBox" id="vbox">
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="button_box">
|
||||
<child>
|
||||
<object class="GtkButton" id="button_cancel"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button_ok"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="3">button_ok</action-widget>
|
||||
<action-widget response="-5">button_cancel</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
]]></programlisting>
|
||||
</example>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>#GtkVBox</term>
|
||||
<listitem><para>Pack widgets vertically.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>#GtkWindow</term>
|
||||
<listitem><para>Alter the properties of your dialog box.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>#GtkButton</term>
|
||||
<listitem><para>Add them to the <structfield>action_area</structfield> to get a
|
||||
response from the user.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkDialog ##### -->
|
||||
<para>
|
||||
<structfield>vbox</structfield> is a #GtkVBox - the main part of the
|
||||
dialog box.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<structfield>action_area</structfield> is a #GtkHButtonBox packed below the
|
||||
dividing #GtkHSeparator in the dialog. It is treated exactly the same
|
||||
as any other #GtkHButtonBox.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkDialog::close ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkDialog::response ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@arg1:
|
||||
|
||||
<!-- ##### ARG GtkDialog:action-area-border ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkDialog:button-spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkDialog:content-area-border ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkDialog:content-area-spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ENUM GtkDialogFlags ##### -->
|
||||
<para>
|
||||
Flags used to influence dialog construction.
|
||||
</para>
|
||||
|
||||
@GTK_DIALOG_MODAL: Make the constructed dialog modal,
|
||||
see gtk_window_set_modal().
|
||||
@GTK_DIALOG_DESTROY_WITH_PARENT: Destroy the dialog when its
|
||||
parent is destroyed, see gtk_window_set_destroy_with_parent().
|
||||
|
||||
<!-- ##### ENUM GtkResponseType ##### -->
|
||||
<para>
|
||||
Predefined values for use as response ids in gtk_dialog_add_button().
|
||||
All predefined values are negative, GTK+ leaves positive values for
|
||||
application-defined response ids.
|
||||
</para>
|
||||
|
||||
@GTK_RESPONSE_NONE: Returned if an action widget has no response id, or if
|
||||
the dialog gets programmatically hidden or destroyed.
|
||||
@GTK_RESPONSE_REJECT: Generic response id, not used by GTK+ dialogs.
|
||||
@GTK_RESPONSE_ACCEPT: Generic response id, not used by GTK+ dialogs.
|
||||
@GTK_RESPONSE_DELETE_EVENT: Returned if the dialog is deleted.
|
||||
@GTK_RESPONSE_OK: Returned by OK buttons in GTK+ dialogs.
|
||||
@GTK_RESPONSE_CANCEL: Returned by Cancel buttons in GTK+ dialogs.
|
||||
@GTK_RESPONSE_CLOSE: Returned by Close buttons in GTK+ dialogs.
|
||||
@GTK_RESPONSE_YES: Returned by Yes buttons in GTK+ dialogs.
|
||||
@GTK_RESPONSE_NO: Returned by No buttons in GTK+ dialogs.
|
||||
@GTK_RESPONSE_APPLY: Returned by Apply buttons in GTK+ dialogs.
|
||||
@GTK_RESPONSE_HELP: Returned by Help buttons in GTK+ dialogs.
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_new ##### -->
|
||||
<para>
|
||||
Creates a new dialog box. Widgets should not be packed into this #GtkWindow
|
||||
directly, but into the @vbox and @action_area, as described above.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: a new #GtkDialog.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_new_with_buttons ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@title:
|
||||
@parent:
|
||||
@flags:
|
||||
@first_button_text:
|
||||
@Varargs:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_run ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_response ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@response_id:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_add_button ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@button_text:
|
||||
@response_id:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_add_buttons ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@first_button_text:
|
||||
@Varargs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_add_action_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@child:
|
||||
@response_id:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_set_default_response ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@response_id:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_set_response_sensitive ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@response_id:
|
||||
@setting:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_get_response_for_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@widget:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_get_widget_for_response ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@response_id:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_get_action_area ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_get_content_area ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_alternative_dialog_button_order ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@screen:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_set_alternative_button_order ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@first_response_id:
|
||||
@Varargs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_dialog_set_alternative_button_order_from_array ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dialog:
|
||||
@n_params:
|
||||
@new_order:
|
||||
|
||||
|
140
docs/reference/gtk/tmpl/gtkdrawingarea.sgml
Normal file
140
docs/reference/gtk/tmpl/gtkdrawingarea.sgml
Normal file
@@ -0,0 +1,140 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkDrawingArea
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A widget for custom user interface elements
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
The #GtkDrawingArea widget is used for creating custom user interface
|
||||
elements. It's essentially a blank widget; you can draw on
|
||||
<literal>widget->window</literal>. After creating a drawing area,
|
||||
the application may want to connect to:
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Mouse and button press signals to respond to input from
|
||||
the user. (Use gtk_widget_add_events() to enable events
|
||||
you wish to receive.)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The "realize" signal to take any necessary actions
|
||||
when the widget is instantiated on a particular display.
|
||||
(Create GDK resources in response to this signal.)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The "configure_event" signal to take any necessary actions
|
||||
when the widget changes size.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The "draw" signal to handle redrawing the contents of the
|
||||
widget.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
The following code portion demonstrates using a drawing
|
||||
area to display a circle in the normal widget foreground
|
||||
color.
|
||||
Note that GDK automatically clears the exposed area
|
||||
to the background color before sending the expose event, and
|
||||
that drawing is implicitly clipped to the exposed area.
|
||||
</para>
|
||||
<example>
|
||||
<title>Simple <structname>GtkDrawingArea</structname> usage.</title>
|
||||
<programlisting>
|
||||
gboolean
|
||||
draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data)
|
||||
{
|
||||
guint width, height;
|
||||
GdkRGBA color;
|
||||
|
||||
width = gtk_widget_get_allocated_width (widget);
|
||||
height = gtk_widget_get_allocated_height (widget);
|
||||
cairo_arc (cr,
|
||||
width / 2.0, height / 2.0,
|
||||
MIN (width, height) / 2.0,
|
||||
0, 2 * G_PI);
|
||||
|
||||
gtk_style_context_get_color (gtk_widget_get_style_context (widget),
|
||||
0,
|
||||
&color);
|
||||
gdk_cairo_set_source_rgba (cr, &color);
|
||||
|
||||
cairo_fill (cr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ... */
|
||||
|
||||
GtkWidget *drawing_area = gtk_drawing_area_new (<!-- -->);
|
||||
gtk_widget_set_size_request (drawing_area, 100, 100);
|
||||
g_signal_connect (G_OBJECT (drawing_area), "draw",
|
||||
G_CALLBACK (draw_callback), NULL);
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Draw signals are normally delivered when a drawing area first comes
|
||||
onscreen, or when it's covered by another window and then uncovered.
|
||||
You can also force a redraw by adding to the "damage region" of the
|
||||
drawing area's window; use gtk_widget_queue_draw_area() to do this.
|
||||
You'll then get a draw event for the invalid region.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The available routines for drawing are documented on the <link
|
||||
linkend="gdk3-Cairo-Interaction">GDK Drawing Primitives</link> page
|
||||
and the cairo documentation.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To receive mouse events on a drawing area, you will need to enable
|
||||
them with gtk_widget_add_events(). To receive keyboard events, you
|
||||
will need to set the #GTK_CAN_FOCUS flag on the drawing area, and
|
||||
should probably draw some user-visible indication that the drawing
|
||||
area is focused. Use the GTK_HAS_FOCUS() macro in your expose event
|
||||
handler to decide whether to draw the focus indicator. See
|
||||
gtk_paint_focus() for one way to draw focus.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
Sometimes #GtkImage is a useful alternative to a drawing area.
|
||||
You can put a #GdkPixmap in the #GtkImage and draw to the #GdkPixmap,
|
||||
calling gtk_widget_queue_draw() on the #GtkImage when you want to
|
||||
refresh to the screen.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkDrawingArea ##### -->
|
||||
<para>
|
||||
The #GtkDrawingArea struct contains private data only, and
|
||||
should be accessed using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_drawing_area_new ##### -->
|
||||
<para>
|
||||
Creates a new drawing area.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: a new #GtkDrawingArea
|
||||
|
||||
|
377
docs/reference/gtk/tmpl/gtkentrycompletion.sgml
Normal file
377
docs/reference/gtk/tmpl/gtkentrycompletion.sgml
Normal file
@@ -0,0 +1,377 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkEntryCompletion
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Completion functionality for GtkEntry
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
#GtkEntryCompletion is an auxiliary object to be used in conjunction with
|
||||
#GtkEntry to provide the completion functionality. It implements the
|
||||
#GtkCellLayout interface, to allow the user to add extra cells to the
|
||||
#GtkTreeView with completion matches.
|
||||
</para>
|
||||
<para>
|
||||
"Completion functionality" means that when the user modifies the text
|
||||
in the entry, #GtkEntryCompletion checks which rows in the model match
|
||||
the current content of the entry, and displays a list of matches.
|
||||
By default, the matching is done by comparing the entry text
|
||||
case-insensitively against the text column of the model (see
|
||||
gtk_entry_completion_set_text_column()), but this can be overridden with
|
||||
a custom match function (see gtk_entry_completion_set_match_func()).
|
||||
</para>
|
||||
<para>
|
||||
When the user selects a completion, the content of the entry is updated.
|
||||
By default, the content of the entry is replaced by the text column of the
|
||||
model, but this can be overridden by connecting to the ::match-selected signal
|
||||
and updating the entry in the signal handler. Note that you should return
|
||||
%TRUE from the signal handler to suppress the default behaviour.
|
||||
</para>
|
||||
<para>
|
||||
To add completion functionality to an entry, use gtk_entry_set_completion().
|
||||
</para>
|
||||
<para>
|
||||
In addition to regular completion matches, which will be inserted into the
|
||||
entry when they are selected, #GtkEntryCompletion also allows to display
|
||||
"actions" in the popup window. Their appearance is similar to menuitems,
|
||||
to differentiate them clearly from completion strings. When an action is
|
||||
selected, the ::action-activated signal is emitted.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkEntryCompletion ##### -->
|
||||
<para>
|
||||
The GtkEntryCompletion struct contains only private data.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkEntryCompletion::action-activated ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@entrycompletion: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkEntryCompletion::cursor-on-match ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@entrycompletion: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkEntryCompletion::insert-prefix ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@entrycompletion: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkEntryCompletion::match-selected ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@entrycompletion: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### ARG GtkEntryCompletion:inline-completion ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryCompletion:inline-selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryCompletion:minimum-key-length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryCompletion:model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryCompletion:popup-completion ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryCompletion:popup-set-width ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryCompletion:popup-single-match ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryCompletion:text-column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkEntryCompletionMatchFunc ##### -->
|
||||
<para>
|
||||
A function which decides whether the row indicated by @iter matches a given
|
||||
@key, and should be displayed as a possible completion for @key. Note that
|
||||
@key is normalized and case-folded (see g_utf8_normalize() and
|
||||
g_utf8_casefold()). If this is not appropriate, match functions have access
|
||||
to the unmodified key via <literal>gtk_entry_get_text (GTK_ENTRY (gtk_entry_completion_get_entry (<!-- -->)))</literal>.
|
||||
</para>
|
||||
|
||||
@completion: the #GtkEntryCompletion
|
||||
@key: the string to match, normalized and case-folded
|
||||
@iter: a #GtkTreeIter indicating the row to match
|
||||
@user_data: user data given to gtk_entry_completion_set_match_func()
|
||||
@Returns: %TRUE if @iter should be displayed as a possible completion for @key
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_entry ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@model:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_match_func ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@func:
|
||||
@func_data:
|
||||
@func_notify:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_minimum_key_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@length:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_minimum_key_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_complete ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_completion_prefix ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_insert_prefix ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_insert_action_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index_:
|
||||
@text:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_insert_action_markup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index_:
|
||||
@markup:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_delete_action ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@index_:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_text_column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@column:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_text_column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_inline_completion ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@inline_completion:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_inline_completion ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_inline_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@inline_selection:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_inline_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_popup_completion ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@popup_completion:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_popup_completion ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_popup_set_width ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@popup_set_width:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_popup_set_width ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_set_popup_single_match ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@popup_single_match:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_completion_get_popup_single_match ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@completion:
|
||||
@Returns:
|
||||
|
||||
|
458
docs/reference/gtk/tmpl/gtkenums.sgml
Normal file
458
docs/reference/gtk/tmpl/gtkenums.sgml
Normal file
@@ -0,0 +1,458 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Standard Enumerations
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Public enumerated types used throughout GTK+
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkAccelFlags ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_ACCEL_VISIBLE:
|
||||
@GTK_ACCEL_LOCKED:
|
||||
@GTK_ACCEL_MASK:
|
||||
|
||||
<!-- ##### ENUM GtkArrowPlacement ##### -->
|
||||
<para>
|
||||
Used to specify the placement of scroll arrows in scrolling menus.
|
||||
</para>
|
||||
|
||||
@GTK_ARROWS_BOTH: Place one arrow on each end of the menu.
|
||||
@GTK_ARROWS_START: Place both arrows at the top of the menu.
|
||||
@GTK_ARROWS_END: Place both arrows at the bottom of the menu.
|
||||
|
||||
<!-- ##### ENUM GtkArrowType ##### -->
|
||||
<para>
|
||||
Used to indicate the direction in which a #GtkArrow should point.
|
||||
</para>
|
||||
|
||||
@GTK_ARROW_UP: Represents an upward pointing arrow.
|
||||
@GTK_ARROW_DOWN: Represents a downward pointing arrow.
|
||||
@GTK_ARROW_LEFT: Represents a left pointing arrow.
|
||||
@GTK_ARROW_RIGHT: Represents a right pointing arrow.
|
||||
@GTK_ARROW_NONE: No arrow. Since 2.10.
|
||||
|
||||
<!-- ##### ENUM GtkAttachOptions ##### -->
|
||||
<para>
|
||||
Denotes the expansion properties that a widget will have when it (or its
|
||||
parent) is resized.
|
||||
</para>
|
||||
|
||||
@GTK_EXPAND: the widget should expand to take up any extra space in its
|
||||
container that has been allocated.
|
||||
@GTK_SHRINK: the widget should shrink as and when possible.
|
||||
@GTK_FILL: the widget should fill the space allocated to it.
|
||||
|
||||
<!-- ##### ENUM GtkButtonBoxStyle ##### -->
|
||||
<para>
|
||||
Used to dictate the style that a #GtkButtonBox uses to layout the buttons it
|
||||
contains. (See also: #GtkVButtonBox and #GtkHButtonBox).
|
||||
</para>
|
||||
|
||||
@GTK_BUTTONBOX_SPREAD: Buttons are evenly spread across the box.
|
||||
@GTK_BUTTONBOX_EDGE: Buttons are placed at the edges of the box.
|
||||
@GTK_BUTTONBOX_START: Buttons are grouped towards the start of the box,
|
||||
(on the left for a HBox, or the top for a VBox).
|
||||
@GTK_BUTTONBOX_END: Buttons are grouped towards the end of the box,
|
||||
(on the right for a HBox, or the bottom for a VBox).
|
||||
@GTK_BUTTONBOX_CENTER: Buttons are centered in the box. Since 2.12
|
||||
|
||||
<!-- ##### ENUM GtkCornerType ##### -->
|
||||
<para>
|
||||
Specifies which corner a child widget should be placed in when packed into
|
||||
a #GtkScrolledWindow. This is effectively the opposite of where the scroll
|
||||
bars are placed.
|
||||
</para>
|
||||
|
||||
@GTK_CORNER_TOP_LEFT: Place the scrollbars on the right and bottom of the
|
||||
widget (default behaviour).
|
||||
@GTK_CORNER_BOTTOM_LEFT: Place the scrollbars on the top and right of the
|
||||
widget.
|
||||
@GTK_CORNER_TOP_RIGHT: Place the scrollbars on the left and bottom of the
|
||||
widget.
|
||||
@GTK_CORNER_BOTTOM_RIGHT: Place the scrollbars on the top and left of the
|
||||
widget.
|
||||
|
||||
<!-- ##### ENUM GtkDeleteType ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_DELETE_CHARS:
|
||||
@GTK_DELETE_WORD_ENDS:
|
||||
@GTK_DELETE_WORDS:
|
||||
@GTK_DELETE_DISPLAY_LINES:
|
||||
@GTK_DELETE_DISPLAY_LINE_ENDS:
|
||||
@GTK_DELETE_PARAGRAPH_ENDS:
|
||||
@GTK_DELETE_PARAGRAPHS:
|
||||
@GTK_DELETE_WHITESPACE:
|
||||
|
||||
<!-- ##### ENUM GtkDirectionType ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_DIR_TAB_FORWARD:
|
||||
@GTK_DIR_TAB_BACKWARD:
|
||||
@GTK_DIR_UP:
|
||||
@GTK_DIR_DOWN:
|
||||
@GTK_DIR_LEFT:
|
||||
@GTK_DIR_RIGHT:
|
||||
|
||||
<!-- ##### ENUM GtkExpanderStyle ##### -->
|
||||
<para>
|
||||
Used to specify the style of the expanders drawn by a #GtkTreeView.
|
||||
</para>
|
||||
|
||||
@GTK_EXPANDER_COLLAPSED: The style used for a collapsed subtree.
|
||||
@GTK_EXPANDER_SEMI_COLLAPSED: Intermediate style used during animation.
|
||||
@GTK_EXPANDER_SEMI_EXPANDED: Intermediate style used during animation.
|
||||
@GTK_EXPANDER_EXPANDED: The style used for an expanded subtree.
|
||||
|
||||
<!-- ##### ENUM GtkIMPreeditStyle ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_IM_PREEDIT_NOTHING:
|
||||
@GTK_IM_PREEDIT_CALLBACK:
|
||||
@GTK_IM_PREEDIT_NONE:
|
||||
|
||||
<!-- ##### ENUM GtkIMStatusStyle ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_IM_STATUS_NOTHING:
|
||||
@GTK_IM_STATUS_CALLBACK:
|
||||
@GTK_IM_STATUS_NONE:
|
||||
|
||||
<!-- ##### ENUM GtkJustification ##### -->
|
||||
<para>
|
||||
Used for justifying the text inside a #GtkLabel widget. (See also
|
||||
#GtkAlignment).
|
||||
</para>
|
||||
|
||||
@GTK_JUSTIFY_LEFT: The text is placed at the left edge of the label.
|
||||
@GTK_JUSTIFY_RIGHT: The text is placed at the right edge of the label.
|
||||
@GTK_JUSTIFY_CENTER: The text is placed in the center of the label.
|
||||
@GTK_JUSTIFY_FILL: The text is placed is distributed across the label.
|
||||
|
||||
<!-- ##### ENUM GtkMovementStep ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_MOVEMENT_LOGICAL_POSITIONS:
|
||||
@GTK_MOVEMENT_VISUAL_POSITIONS:
|
||||
@GTK_MOVEMENT_WORDS:
|
||||
@GTK_MOVEMENT_DISPLAY_LINES:
|
||||
@GTK_MOVEMENT_DISPLAY_LINE_ENDS:
|
||||
@GTK_MOVEMENT_PARAGRAPHS:
|
||||
@GTK_MOVEMENT_PARAGRAPH_ENDS:
|
||||
@GTK_MOVEMENT_PAGES:
|
||||
@GTK_MOVEMENT_BUFFER_ENDS:
|
||||
@GTK_MOVEMENT_HORIZONTAL_PAGES:
|
||||
|
||||
<!-- ##### ENUM GtkOrientation ##### -->
|
||||
<para>
|
||||
Represents the orientation of widgets which can be switched between horizontal
|
||||
and vertical orientation on the fly, like #GtkToolbar.
|
||||
</para>
|
||||
|
||||
@GTK_ORIENTATION_HORIZONTAL: The widget is in horizontal orientation.
|
||||
@GTK_ORIENTATION_VERTICAL: The widget is in vertical orientation.
|
||||
|
||||
<!-- ##### ENUM GtkPackType ##### -->
|
||||
<para>
|
||||
Represents the packing location #GtkBox children. (See: #GtkVBox,
|
||||
#GtkHBox, and #GtkButtonBox).
|
||||
</para>
|
||||
|
||||
@GTK_PACK_START: The child is packed into the start of the box
|
||||
@GTK_PACK_END: The child is packed into the end of the box
|
||||
|
||||
<!-- ##### ENUM GtkPathPriorityType ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_PATH_PRIO_LOWEST:
|
||||
@GTK_PATH_PRIO_GTK:
|
||||
@GTK_PATH_PRIO_APPLICATION:
|
||||
@GTK_PATH_PRIO_THEME:
|
||||
@GTK_PATH_PRIO_RC:
|
||||
@GTK_PATH_PRIO_HIGHEST:
|
||||
|
||||
<!-- ##### ENUM GtkPathType ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_PATH_WIDGET:
|
||||
@GTK_PATH_WIDGET_CLASS:
|
||||
@GTK_PATH_CLASS:
|
||||
|
||||
<!-- ##### ENUM GtkPolicyType ##### -->
|
||||
<para>
|
||||
Determines when a scroll bar will be visible.
|
||||
</para>
|
||||
|
||||
@GTK_POLICY_ALWAYS: The scrollbar is always visible.
|
||||
@GTK_POLICY_AUTOMATIC: The scrollbar will appear and disappear as necessary. For example,
|
||||
when all of a #GtkCList can not be seen.
|
||||
@GTK_POLICY_NEVER: The scrollbar will never appear.
|
||||
|
||||
<!-- ##### ENUM GtkPositionType ##### -->
|
||||
<para>
|
||||
Describes which edge of a widget a certain feature is positioned at, e.g. the
|
||||
tabs of a #GtkNotebook, the handle of a #GtkHandleBox or the label of a
|
||||
#GtkScale.
|
||||
</para>
|
||||
|
||||
@GTK_POS_LEFT: The feature is at the left edge.
|
||||
@GTK_POS_RIGHT: The feature is at the right edge.
|
||||
@GTK_POS_TOP: The feature is at the top edge.
|
||||
@GTK_POS_BOTTOM: The feature is at the bottom edge.
|
||||
|
||||
<!-- ##### ENUM GtkReliefStyle ##### -->
|
||||
<para>
|
||||
Indicated the relief to be drawn around a #GtkButton.
|
||||
</para>
|
||||
|
||||
@GTK_RELIEF_NORMAL: Draw a normal relief.
|
||||
@GTK_RELIEF_HALF: A half relief.
|
||||
@GTK_RELIEF_NONE: No relief.
|
||||
|
||||
<!-- ##### ENUM GtkResizeMode ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_RESIZE_PARENT:
|
||||
@GTK_RESIZE_QUEUE:
|
||||
@GTK_RESIZE_IMMEDIATE: Deprecated.
|
||||
|
||||
<!-- ##### ENUM GtkScrollStep ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_SCROLL_STEPS:
|
||||
@GTK_SCROLL_PAGES:
|
||||
@GTK_SCROLL_ENDS:
|
||||
@GTK_SCROLL_HORIZONTAL_STEPS:
|
||||
@GTK_SCROLL_HORIZONTAL_PAGES:
|
||||
@GTK_SCROLL_HORIZONTAL_ENDS:
|
||||
|
||||
<!-- ##### ENUM GtkScrollType ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_SCROLL_NONE:
|
||||
@GTK_SCROLL_JUMP:
|
||||
@GTK_SCROLL_STEP_BACKWARD:
|
||||
@GTK_SCROLL_STEP_FORWARD:
|
||||
@GTK_SCROLL_PAGE_BACKWARD:
|
||||
@GTK_SCROLL_PAGE_FORWARD:
|
||||
@GTK_SCROLL_STEP_UP:
|
||||
@GTK_SCROLL_STEP_DOWN:
|
||||
@GTK_SCROLL_PAGE_UP:
|
||||
@GTK_SCROLL_PAGE_DOWN:
|
||||
@GTK_SCROLL_STEP_LEFT:
|
||||
@GTK_SCROLL_STEP_RIGHT:
|
||||
@GTK_SCROLL_PAGE_LEFT:
|
||||
@GTK_SCROLL_PAGE_RIGHT:
|
||||
@GTK_SCROLL_START:
|
||||
@GTK_SCROLL_END:
|
||||
|
||||
<!-- ##### ENUM GtkSelectionMode ##### -->
|
||||
<para>
|
||||
Used to control what selections users are allowed to make.
|
||||
</para>
|
||||
|
||||
@GTK_SELECTION_NONE: No selection is possible.
|
||||
@GTK_SELECTION_SINGLE: Zero or one element may be selected.
|
||||
@GTK_SELECTION_BROWSE: Exactly one element is selected. In some circumstances,
|
||||
such as initially or during a search operation, it's possible for no element
|
||||
to be selected with %GTK_SELECTION_BROWSE. What is really enforced is that
|
||||
the user can't deselect a currently selected element except by selecting
|
||||
another element.
|
||||
@GTK_SELECTION_MULTIPLE: Any number of elements may be selected.
|
||||
Clicks toggle the state of an item. Any number of elements may be selected.
|
||||
The Ctrl key may be used to enlarge the selection, and Shift key to select
|
||||
between the focus and the child pointed to. Some widgets may also allow
|
||||
Click-drag to select a range of elements.
|
||||
|
||||
<!-- ##### ENUM GtkShadowType ##### -->
|
||||
<para>
|
||||
Used to change the appearance of an outline typically provided by a #GtkFrame.
|
||||
</para>
|
||||
|
||||
@GTK_SHADOW_NONE: No outline.
|
||||
@GTK_SHADOW_IN: The outline is bevelled inwards.
|
||||
@GTK_SHADOW_OUT: The outline is bevelled outwards like a button.
|
||||
@GTK_SHADOW_ETCHED_IN: The outline has a sunken 3d appearance.
|
||||
@GTK_SHADOW_ETCHED_OUT: The outline has a raised 3d appearance
|
||||
|
||||
<!-- ##### ENUM GtkStateType ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_STATE_NORMAL:
|
||||
@GTK_STATE_ACTIVE:
|
||||
@GTK_STATE_PRELIGHT:
|
||||
@GTK_STATE_SELECTED:
|
||||
@GTK_STATE_INSENSITIVE:
|
||||
@GTK_STATE_INCONSISTENT:
|
||||
@GTK_STATE_FOCUSED:
|
||||
|
||||
<!-- ##### ENUM GtkStateFlags ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_STATE_FLAG_ACTIVE:
|
||||
@GTK_STATE_FLAG_PRELIGHT:
|
||||
@GTK_STATE_FLAG_SELECTED:
|
||||
@GTK_STATE_FLAG_INSENSITIVE:
|
||||
@GTK_STATE_FLAG_INCONSISTENT:
|
||||
@GTK_STATE_FLAG_FOCUSED:
|
||||
|
||||
<!-- ##### ENUM GtkToolbarStyle ##### -->
|
||||
<para>
|
||||
Used to customize the appearance of a #GtkToolbar. Note that
|
||||
setting the toolbar style overrides the user's preferences
|
||||
for the default toolbar style. Note that if the button has only
|
||||
a label set and GTK_TOOLBAR_ICONS is used, the label will be
|
||||
visible, and vice versa.
|
||||
</para>
|
||||
|
||||
@GTK_TOOLBAR_ICONS: Buttons display only icons in the toolbar.
|
||||
@GTK_TOOLBAR_TEXT: Buttons display only text labels in the toolbar.
|
||||
@GTK_TOOLBAR_BOTH: Buttons display text and icons in the toolbar.
|
||||
@GTK_TOOLBAR_BOTH_HORIZ: Buttons display icons and text alongside each
|
||||
other, rather than vertically stacked
|
||||
|
||||
<!-- ##### ENUM GtkUpdateType ##### -->
|
||||
<para>
|
||||
Used by #GtkRange to control the policy for notifying value changes.
|
||||
</para>
|
||||
|
||||
@GTK_UPDATE_CONTINUOUS: Notify updates whenever the value changed
|
||||
@GTK_UPDATE_DISCONTINUOUS: Notify updates when the mouse button has been released
|
||||
@GTK_UPDATE_DELAYED: Space out updates with a small timeout
|
||||
|
||||
<!-- ##### ENUM GtkWindowPosition ##### -->
|
||||
<para>
|
||||
Window placement can be influenced using this enumeration. Note that
|
||||
using #GTK_WIN_POS_CENTER_ALWAYS is almost always a bad idea.
|
||||
It won't necessarily work well with all window managers or on all windowing systems.
|
||||
</para>
|
||||
|
||||
@GTK_WIN_POS_NONE: No influence is made on placement.
|
||||
@GTK_WIN_POS_CENTER: Windows should be placed in the center of the screen.
|
||||
@GTK_WIN_POS_MOUSE: Windows should be placed at the current mouse position.
|
||||
@GTK_WIN_POS_CENTER_ALWAYS: Keep window centered as it changes size, etc.
|
||||
@GTK_WIN_POS_CENTER_ON_PARENT: Center the window on its transient
|
||||
parent (see gtk_window_set_transient_for()).
|
||||
|
||||
<!-- ##### ENUM GtkWindowType ##### -->
|
||||
<para>
|
||||
A #GtkWindow can be one of these types. Most things you'd consider a
|
||||
"window" should have type #GTK_WINDOW_TOPLEVEL; windows with this type
|
||||
are managed by the window manager and have a frame by default (call
|
||||
gtk_window_set_decorated() to toggle the frame). Windows with type
|
||||
#GTK_WINDOW_POPUP are ignored by the window manager; window manager
|
||||
keybindings won't work on them, the window manager won't decorate the
|
||||
window with a frame, many GTK+ features that rely on the window
|
||||
manager will not work (e.g. resize grips and
|
||||
maximization/minimization). #GTK_WINDOW_POPUP is used to implement
|
||||
widgets such as #GtkMenu or tooltips that you normally don't think of
|
||||
as windows per se. Nearly all windows should be #GTK_WINDOW_TOPLEVEL.
|
||||
In particular, do not use #GTK_WINDOW_POPUP just to turn off
|
||||
the window borders; use gtk_window_set_decorated() for that.
|
||||
</para>
|
||||
|
||||
@GTK_WINDOW_TOPLEVEL: A regular window, such as a dialog.
|
||||
@GTK_WINDOW_POPUP: A special window such as a tooltip.
|
||||
|
||||
<!-- ##### ENUM GtkSortType ##### -->
|
||||
<para>
|
||||
Determines the direction of a sort.
|
||||
</para>
|
||||
|
||||
@GTK_SORT_ASCENDING: Sorting is in ascending order.
|
||||
@GTK_SORT_DESCENDING: Sorting is in descending order.
|
||||
|
||||
<!-- ##### ENUM GtkDragResult ##### -->
|
||||
<para>
|
||||
Gives an indication why a drag operation failed.
|
||||
The value can by obtained by connecting to the
|
||||
#GtkWidget::drag-failed signal.
|
||||
</para>
|
||||
|
||||
@GTK_DRAG_RESULT_SUCCESS: The drag operation was successful
|
||||
@GTK_DRAG_RESULT_NO_TARGET: No suitable drag target
|
||||
@GTK_DRAG_RESULT_USER_CANCELLED: The user cancelled the drag operation
|
||||
@GTK_DRAG_RESULT_TIMEOUT_EXPIRED: The drag operation timed out
|
||||
@GTK_DRAG_RESULT_GRAB_BROKEN: The pointer or keyboard grab used
|
||||
for the drag operation was broken
|
||||
@GTK_DRAG_RESULT_ERROR: The drag operation failed due to some
|
||||
unspecified error
|
||||
|
||||
<!-- ##### ENUM GtkJunctionSides ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_JUNCTION_NONE:
|
||||
@GTK_JUNCTION_CORNER_TOPLEFT:
|
||||
@GTK_JUNCTION_CORNER_TOPRIGHT:
|
||||
@GTK_JUNCTION_CORNER_BOTTOMLEFT:
|
||||
@GTK_JUNCTION_CORNER_BOTTOMRIGHT:
|
||||
@GTK_JUNCTION_TOP:
|
||||
@GTK_JUNCTION_BOTTOM:
|
||||
@GTK_JUNCTION_LEFT:
|
||||
@GTK_JUNCTION_RIGHT:
|
||||
|
||||
<!-- ##### ENUM GtkBorderStyle ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_BORDER_STYLE_NONE:
|
||||
@GTK_BORDER_STYLE_SOLID:
|
||||
@GTK_BORDER_STYLE_INSET:
|
||||
@GTK_BORDER_STYLE_OUTSET:
|
||||
|
||||
<!-- ##### ENUM GtkRegionFlags ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_REGION_EVEN:
|
||||
@GTK_REGION_ODD:
|
||||
@GTK_REGION_FIRST:
|
||||
@GTK_REGION_LAST:
|
||||
@GTK_REGION_SORTED:
|
||||
|
86
docs/reference/gtk/tmpl/gtkeventbox.sgml
Normal file
86
docs/reference/gtk/tmpl/gtkeventbox.sgml
Normal file
@@ -0,0 +1,86 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkEventBox
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A widget used to catch events for widgets which do not have their own window
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkEventBox widget is a subclass of #GtkBin which also has its own window.
|
||||
It is useful since it allows you to catch events for widgets which do not
|
||||
have their own window.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkEventBox ##### -->
|
||||
<para>
|
||||
The #GtkEventBox-struct struct contains private data only, and
|
||||
should be accessed using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkEventBox:above-child ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEventBox:visible-window ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_event_box_new ##### -->
|
||||
<para>
|
||||
Creates a new #GtkEventBox.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: a new #GtkEventBox.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_event_box_set_above_child ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@event_box:
|
||||
@above_child:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_event_box_get_above_child ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@event_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_event_box_set_visible_window ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@event_box:
|
||||
@visible_window:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_event_box_get_visible_window ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@event_box:
|
||||
@Returns:
|
||||
|
||||
|
296
docs/reference/gtk/tmpl/gtkexpander.sgml
Normal file
296
docs/reference/gtk/tmpl/gtkexpander.sgml
Normal file
@@ -0,0 +1,296 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkExpander
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A container which can hide its child
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkExpander allows the user to hide or show its child by clicking
|
||||
on an expander triangle similar to the triangles used in a #GtkTreeView.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normally you use an expander as you would use any other descendant
|
||||
of #GtkBin; you create the child widget and use gtk_container_add()
|
||||
to add it to the expander. When the expander is toggled, it will take
|
||||
care of showing and hiding the child automatically.
|
||||
</para>
|
||||
|
||||
<section id="expander-special-usage">
|
||||
<title>Special Usage</title>
|
||||
|
||||
<para>
|
||||
There are situations in which you may prefer to show and hide the
|
||||
expanded widget yourself, such as when you want to actually create
|
||||
the widget at expansion time. In this case, create a #GtkExpander
|
||||
but do not add a child to it. The expander widget has an
|
||||
<literal>expanded</literal> property which can be used to monitor
|
||||
its expansion state. You should watch this property with a signal
|
||||
connection as follows:
|
||||
</para>
|
||||
|
||||
<programlisting id="expander-callback-example">
|
||||
expander = gtk_expander_new_with_mnemonic ("_More Options");
|
||||
g_signal_connect (expander, "notify::expanded",
|
||||
G_CALLBACK (expander_callback), NULL);
|
||||
|
||||
...
|
||||
|
||||
static void
|
||||
expander_callback (GObject *object,
|
||||
GParamSpec *param_spec,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkExpander *expander;
|
||||
|
||||
expander = GTK_EXPANDER (object);
|
||||
|
||||
if (gtk_expander_get_expanded (expander))
|
||||
{
|
||||
/* Show or create widgets */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Hide or destroy widgets */
|
||||
}
|
||||
}
|
||||
</programlisting>
|
||||
</section>
|
||||
<refsect2 id="GtkExpander-BUILDER-UI">
|
||||
<title>GtkExpander as GtkBuildable</title>
|
||||
<para>
|
||||
The GtkExpander implementation of the GtkBuildable interface
|
||||
supports placing a child in the label position by specifying
|
||||
"label" as the "type" attribute of a <child> element.
|
||||
A normal content child can be specified without specifying
|
||||
a <child> type attribute.
|
||||
</para>
|
||||
<example>
|
||||
<title>A UI definition fragment with GtkExpander</title>
|
||||
<programlisting><![CDATA[
|
||||
<object class="GtkExpander">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="expander-label"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="expander-content"/>
|
||||
</child>
|
||||
</object>
|
||||
]]></programlisting>
|
||||
</example>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkExpander ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkExpander::activate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander: the object which received the signal.
|
||||
|
||||
<!-- ##### ARG GtkExpander:expanded ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkExpander:label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkExpander:label-fill ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkExpander:label-widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkExpander:spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkExpander:use-markup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkExpander:use-underline ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkExpander:expander-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkExpander:expander-spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@label:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_new_with_mnemonic ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@label:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_set_expanded ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@expanded:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_get_expanded ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_set_spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@spacing:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_get_spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_set_label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@label:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_get_label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_set_use_underline ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@use_underline:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_get_use_underline ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_set_use_markup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@use_markup:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_get_use_markup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_set_label_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@label_widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_get_label_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_set_label_fill ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@label_fill:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_expander_get_label_fill ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@expander:
|
||||
@Returns:
|
||||
|
||||
|
135
docs/reference/gtk/tmpl/gtkfeatures.sgml
Normal file
135
docs/reference/gtk/tmpl/gtkfeatures.sgml
Normal file
@@ -0,0 +1,135 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Version Information
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Variables and functions to check the GTK+ version
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
GTK+ provides version information, primarily useful in configure checks
|
||||
for builds that have a configure script. Applications will not
|
||||
typically use the features described here.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_major_version ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_minor_version ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_micro_version ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_binary_age ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_interface_age ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_check_version ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@required_major:
|
||||
@required_minor:
|
||||
@required_micro:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_MAJOR_VERSION ##### -->
|
||||
<para>
|
||||
Like #gtk_major_version, but from the headers used at
|
||||
application compile time, rather than from the library linked against
|
||||
at application run time.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_MINOR_VERSION ##### -->
|
||||
<para>
|
||||
Like #gtk_minor_version, but from the headers used at
|
||||
application compile time, rather than from the library linked against
|
||||
at application run time.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_MICRO_VERSION ##### -->
|
||||
<para>
|
||||
Like #gtk_micro_version, but from the headers used at
|
||||
application compile time, rather than from the library linked against
|
||||
at application run time.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_BINARY_AGE ##### -->
|
||||
<para>
|
||||
Like #gtk_binary_age, but from the headers used at
|
||||
application compile time, rather than from the library linked against
|
||||
at application run time.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_INTERFACE_AGE ##### -->
|
||||
<para>
|
||||
Like #gtk_interface_age, but from the headers used at
|
||||
application compile time, rather than from the library linked against
|
||||
at application run time.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_CHECK_VERSION ##### -->
|
||||
<para>
|
||||
Returns %TRUE if the version of the GTK+ header files is the same
|
||||
as or newer than the passed-in version.
|
||||
</para>
|
||||
|
||||
@major: major version (e.g. 1 for version 1.2.5)
|
||||
@minor: minor version (e.g. 2 for version 1.2.5)
|
||||
@micro: micro version (e.g. 5 for version 1.2.5)
|
||||
|
||||
|
170
docs/reference/gtk/tmpl/gtkfilefilter.sgml
Normal file
170
docs/reference/gtk/tmpl/gtkfilefilter.sgml
Normal file
@@ -0,0 +1,170 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkFileFilter
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A filter for selecting a file subset
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A GtkFileFilter can be used to restrict the files being shown
|
||||
in a #GtkFileChooser. Files can be filtered based on their name
|
||||
(with gtk_file_filter_add_pattern()), on their mime type (with
|
||||
gtk_file_filter_add_mime_type()), or by a custom filter function
|
||||
(with gtk_file_filter_add_custom()).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering by mime types handles aliasing and subclassing of mime
|
||||
types; e.g. a filter for text/plain also matches a file with mime
|
||||
type application/rtf, since application/rtf is a subclass of
|
||||
text/plain. Note that #GtkFileFilter allows wildcards for the
|
||||
subtype of a mime type, so you can e.g. filter for image/*.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normally, filters are used by adding them to a #GtkFileChooser,
|
||||
see gtk_file_chooser_add_filter(), but it is also possible
|
||||
to manually use a filter on a file with gtk_file_filter_filter().
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkFileChooser
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkFileFilter ##### -->
|
||||
<para>
|
||||
The <structname>GtkFileFilter</structname> struct contains
|
||||
only private fields and should not be directly accessed.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkFileFilterInfo ##### -->
|
||||
<para>
|
||||
A <structname>GtkFileFilterInfo</structname> struct is used
|
||||
to pass information about the tested file to
|
||||
gtk_file_filter_filter().
|
||||
</para>
|
||||
|
||||
@contains: Flags indicating which of the following fields need
|
||||
are filled
|
||||
@filename: the filename of the file being tested
|
||||
@uri: the URI for the file being tested
|
||||
@display_name: the string that will be used to display the file
|
||||
in the file chooser
|
||||
@mime_type: the mime type of the file
|
||||
|
||||
<!-- ##### ENUM GtkFileFilterFlags ##### -->
|
||||
<para>
|
||||
These flags indicate what parts of a #GtkFileFilterInfo struct
|
||||
are filled or need to be filled.
|
||||
</para>
|
||||
|
||||
@GTK_FILE_FILTER_FILENAME: the filename of the file being tested
|
||||
@GTK_FILE_FILTER_URI: the URI for the file being tested
|
||||
@GTK_FILE_FILTER_DISPLAY_NAME: the string that will be used to
|
||||
display the file in the file chooser
|
||||
@GTK_FILE_FILTER_MIME_TYPE: the mime type of the file
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkFileFilterFunc ##### -->
|
||||
<para>
|
||||
The type of function that is used with custom filters,
|
||||
see gtk_file_filter_add_custom().
|
||||
</para>
|
||||
|
||||
@filter_info: a #GtkFileFilterInfo that is filled according
|
||||
to the @needed flags passed to gtk_file_filter_add_custom()
|
||||
@data: user data passed to gtk_file_filter_add_custom()
|
||||
@Returns: %TRUE if the file should be displayed
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_set_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@name:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_get_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_add_mime_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@mime_type:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_add_pattern ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@pattern:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_add_pixbuf_formats ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_add_custom ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@needed:
|
||||
@func:
|
||||
@data:
|
||||
@notify:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_get_needed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_filter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@filter_info:
|
||||
@Returns:
|
||||
|
||||
|
133
docs/reference/gtk/tmpl/gtkfixed.sgml
Normal file
133
docs/reference/gtk/tmpl/gtkfixed.sgml
Normal file
@@ -0,0 +1,133 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkFixed
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A container which allows you to position widgets at fixed coordinates
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkFixed widget is a container which can place child widgets at fixed
|
||||
positions and with fixed sizes, given in pixels. #GtkFixed performs no
|
||||
automatic layout management.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For most applications, you should not use this container! It keeps
|
||||
you from having to learn about the other GTK+ containers, but it
|
||||
results in broken applications.
|
||||
With #GtkFixed, the following things will result in truncated text,
|
||||
overlapping widgets, and other display bugs:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Themes, which may change widget sizes.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Fonts other than the one you used to write the app will of
|
||||
course change the size of widgets containing text; keep in mind that
|
||||
users may use a larger font because of difficulty reading the default,
|
||||
or they may be using Windows or the framebuffer port of GTK+, where
|
||||
different fonts are available.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Translation of text into other languages changes its size. Also,
|
||||
display of non-English text will use a different font in many cases.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In addition, the fixed widget can't properly be mirrored in
|
||||
right-to-left languages such as Hebrew and Arabic. i.e. normally GTK+
|
||||
will flip the interface to put labels to the right of the thing they
|
||||
label, but it can't do that with #GtkFixed. So your application will
|
||||
not be usable in right-to-left languages.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Finally, fixed positioning makes it kind of annoying to add/remove GUI
|
||||
elements, since you have to reposition all the other elements. This is
|
||||
a long-term maintenance problem for your application.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you know none of these things are an issue for your application,
|
||||
and prefer the simplicity of #GtkFixed, by all means use the
|
||||
widget. But you should be aware of the tradeoffs.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkFixed ##### -->
|
||||
<para>
|
||||
The #GtkFixed-struct struct contains the following fields.
|
||||
(These fields should be considered read-only. They should never be set by
|
||||
an application.)
|
||||
|
||||
<informaltable pgwide="1" frame="none" role="struct">
|
||||
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
|
||||
<tbody>
|
||||
|
||||
<row>
|
||||
<entry>#GList *children;</entry>
|
||||
<entry>a list of #GtkFixedChild elements, containing the child widgets and
|
||||
their positions.</entry>
|
||||
</row>
|
||||
|
||||
</tbody></tgroup></informaltable>
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkFixed:x ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkFixed:y ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_fixed_new ##### -->
|
||||
<para>
|
||||
Creates a new #GtkFixed.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: a new #GtkFixed.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_fixed_put ##### -->
|
||||
<para>
|
||||
Adds a widget to a #GtkFixed container at the given position.
|
||||
</para>
|
||||
|
||||
@fixed: a #GtkFixed.
|
||||
@widget: the widget to add.
|
||||
@x: the horizontal position to place the widget at.
|
||||
@y: the vertical position to place the widget at.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_fixed_move ##### -->
|
||||
<para>
|
||||
Moves a child of a #GtkFixed container to the given position.
|
||||
</para>
|
||||
|
||||
@fixed: a #GtkFixed.
|
||||
@widget: the child widget.
|
||||
@x: the horizontal position to move the widget to.
|
||||
@y: the vertical position to move the widget to.
|
||||
|
||||
|
626
docs/reference/gtk/tmpl/gtkmain.sgml
Normal file
626
docs/reference/gtk/tmpl/gtkmain.sgml
Normal file
@@ -0,0 +1,626 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Main loop and Events
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Library initialization, main event loop, and events
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
|
||||
<para>
|
||||
Before using GTK+, you need to initialize it; initialization connects
|
||||
to the window system display, and parses some standard command line
|
||||
arguments. The gtk_init() function initializes GTK+. gtk_init() exits
|
||||
the application if errors occur; to avoid this, use gtk_init_check().
|
||||
gtk_init_check() allows you to recover from a failed GTK+
|
||||
initialization - you might start up your application in text mode instead.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Like all GUI toolkits, GTK+ uses an event-driven programming
|
||||
model. When the user is doing nothing, GTK+ sits in the
|
||||
<firstterm>main loop</firstterm> and waits for input. If the user
|
||||
performs some action - say, a mouse click - then the main loop "wakes
|
||||
up" and delivers an event to GTK+. GTK+ forwards the event to one or
|
||||
more widgets.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When widgets receive an event, they frequently emit one or more
|
||||
<firstterm>signals</firstterm>. Signals notify your program that
|
||||
"something interesting happened" by invoking functions you've
|
||||
connected to the signal with g_signal_connect(). Functions connected
|
||||
to a signal are often termed <firstterm>callbacks</firstterm>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When your callbacks are invoked, you would typically take some action
|
||||
- for example, when an Open button is clicked you might display a
|
||||
#GtkFileSelectionDialog. After a callback finishes, GTK+ will return
|
||||
to the main loop and await more user input.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Typical <function>main</function> function for a GTK+ application</title>
|
||||
<programlisting>
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
/* Initialize i18n support */
|
||||
gtk_set_locale (<!-- -->);
|
||||
|
||||
/* Initialize the widget set */
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* Create the main window */
|
||||
mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
/* Set up our GUI elements */
|
||||
...
|
||||
|
||||
/* Show the application window */
|
||||
gtk_widget_show_all (mainwin);
|
||||
|
||||
/* Enter the main event loop, and wait for user interaction */
|
||||
gtk_main (<!-- -->);
|
||||
|
||||
/* The user lost interest */
|
||||
return 0;
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
It's OK to use the GLib main loop directly instead of gtk_main(),
|
||||
though it involves slightly more typing. See #GMainLoop in the GLib
|
||||
documentation.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
See the GLib manual, especially #GMainLoop and signal-related
|
||||
functions such as g_signal_connect().
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_set_locale ##### -->
|
||||
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_disable_setlocale ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_default_language ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_parse_args ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@argc:
|
||||
@argv:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_init ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
</para>
|
||||
</note>
|
||||
|
||||
@argc:
|
||||
@argv:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_init_check ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@argc:
|
||||
@argv:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_init_with_args ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@argc:
|
||||
@argv:
|
||||
@parameter_string:
|
||||
@entries:
|
||||
@translation_domain:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_option_group ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@open_default_display:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_events_pending ##### -->
|
||||
<para>
|
||||
Checks if any events are pending. This can be used to update the GUI
|
||||
and invoke timeouts etc. while doing some time intensive computation.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Updating the GUI during a long computation.</title>
|
||||
<programlisting>
|
||||
/* computation going on */
|
||||
...
|
||||
while (gtk_events_pending (<!-- -->))
|
||||
gtk_main_iteration (<!-- -->);
|
||||
...
|
||||
/* computation continued */
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
@void:
|
||||
@Returns: %TRUE if any events are pending, %FALSE otherwise.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_main ##### -->
|
||||
<para>
|
||||
Runs the main loop until gtk_main_quit() is called. You can nest calls to
|
||||
gtk_main(). In that case gtk_main_quit() will make the innermost invocation
|
||||
of the main loop return.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_main_level ##### -->
|
||||
<para>
|
||||
Asks for the current nesting level of the main loop. This can be useful
|
||||
when calling gtk_quit_add().
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: the nesting level of the current invocation of the main loop.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_main_quit ##### -->
|
||||
<para>
|
||||
Makes the innermost invocation of the main loop return when it regains
|
||||
control.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_main_iteration ##### -->
|
||||
<para>
|
||||
Runs a single iteration of the mainloop. If no events are waiting to be
|
||||
processed GTK+ will block until the next event is noticed. If you don't
|
||||
want to block look at gtk_main_iteration_do() or check if any events are
|
||||
pending with gtk_events_pending() first.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: %TRUE if gtk_main_quit() has been called for the innermost mainloop.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_main_iteration_do ##### -->
|
||||
<para>
|
||||
Runs a single iteration of the mainloop. If no events are available either
|
||||
return or block dependent on the value of @blocking.
|
||||
</para>
|
||||
|
||||
@blocking: %TRUE if you want GTK+ to block if no events are pending.
|
||||
@Returns: %TRUE if gtk_main_quit() has been called for the innermost mainloop.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_main_do_event ##### -->
|
||||
<para>
|
||||
Processes a single GDK event. This is public only to allow filtering of events
|
||||
between GDK and GTK+. You will not usually need to call this function directly.
|
||||
</para>
|
||||
<para>
|
||||
While you should not call this function directly, you might want to know
|
||||
how exactly events are handled. So here is what this function does with
|
||||
the event:
|
||||
</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
Compress enter/leave notify events. If the event passed build an
|
||||
enter/leave pair together with the next event (peeked from GDK)
|
||||
both events are thrown away. This is to avoid a backlog of (de-)highlighting
|
||||
widgets crossed by the pointer.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Find the widget which got the event. If the widget can't be determined
|
||||
the event is thrown away unless it belongs to a INCR transaction. In that
|
||||
case it is passed to gtk_selection_incr_event().
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Then the event is passed on a stack so you can query the currently handled
|
||||
event with gtk_get_current_event().
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
The event is sent to a widget. If a grab is active all events for
|
||||
widgets that are not in the contained in the grab widget are sent to the
|
||||
latter with a few exceptions:
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
Deletion and destruction events are still sent to the event widget for
|
||||
obvious reasons.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Events which directly relate to the visual representation of the event
|
||||
widget.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Leave events are delivered to the event widget if there was an enter
|
||||
event delivered to it before without the paired leave event.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Drag events are not redirected because it is unclear what the semantics
|
||||
of that would be.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
Another point of interest might be that all key events are first passed
|
||||
through the key snooper functions if there are any. Read the description
|
||||
of gtk_key_snooper_install() if you need this feature.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
After finishing the delivery the event is popped from the event stack.
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
|
||||
@event: An event to process (normally) passed by GDK.
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkModuleInitFunc ##### -->
|
||||
<para>
|
||||
Each GTK+ module must have a function gtk_module_init() with this prototype.
|
||||
This function is called after loading the module with the @argc and @argv
|
||||
cleaned from any arguments that GTK+ handles itself.
|
||||
</para>
|
||||
|
||||
@argc: Pointer to the number of arguments remaining after gtk_init().
|
||||
@argv: Points to the argument vector.
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkModuleDisplayInitFunc ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@display:
|
||||
@Since: 2.2
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_true ##### -->
|
||||
<para>
|
||||
All this function does it to return %TRUE. This can be useful for example
|
||||
if you want to inhibit the deletion of a window. Of course you should
|
||||
not do this as the user expects a reaction from clicking the close
|
||||
icon of the window...
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>A persistent window</title>
|
||||
<programlisting>
|
||||
##include <gtk/gtk.h>
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GtkWidget *win, *but;
|
||||
|
||||
gtk_init( &argc, &argv );
|
||||
|
||||
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
g_signal_connect (win, "delete-event",
|
||||
G_CALLBACK (gtk_true), NULL);
|
||||
g_signal_connect (win, "destroy",
|
||||
G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
but = gtk_button_new_with_label ("Close yourself. I mean it!");
|
||||
g_signal_connect_swapped (but, "clicked",
|
||||
G_CALLBACK (gtk_object_destroy), win);
|
||||
gtk_container_add (GTK_CONTAINER (win), but);
|
||||
|
||||
gtk_widget_show_all (win);
|
||||
gtk_main (<!-- -->);
|
||||
return 0;
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
@void:
|
||||
@Returns: %TRUE
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_false ##### -->
|
||||
<para>
|
||||
Analogical to gtk_true() this function does nothing
|
||||
but always returns %FALSE.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: %FALSE
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_grab_add ##### -->
|
||||
<para>
|
||||
Makes @widget the current grabbed widget. This means that interaction with
|
||||
other widgets in the same application is blocked and mouse as well as
|
||||
keyboard events are delivered to this widget.
|
||||
</para>
|
||||
<para>
|
||||
If @widget is not sensitive, it is not set as the current grabbed
|
||||
widget and this function does nothing.
|
||||
</para>
|
||||
|
||||
@widget: The widget that grabs keyboard and pointer events.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_grab_get_current ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_grab_remove ##### -->
|
||||
<para>
|
||||
Removes the grab from the given widget. You have to pair calls to gtk_grab_add()
|
||||
and gtk_grab_remove().
|
||||
</para>
|
||||
<para>
|
||||
If @widget does not have the grab, this function does nothing.
|
||||
</para>
|
||||
|
||||
@widget: The widget which gives up the grab.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_device_grab_add ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@device:
|
||||
@block_others:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_device_grab_remove ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@device:
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkFunction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_quit_add_destroy ##### -->
|
||||
<para>
|
||||
Trigger destruction of @object in case the mainloop at level @main_level
|
||||
is quit.
|
||||
</para>
|
||||
|
||||
@main_level: Level of the mainloop which shall trigger the destruction.
|
||||
@object: Object to be destroyed.
|
||||
@Deprecated: This function is going to be removed in GTK+ 3.0
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_quit_add ##### -->
|
||||
<para>
|
||||
Registers a function to be called when an instance of the mainloop is left.
|
||||
</para>
|
||||
|
||||
@main_level: Level at which termination the function shall be called. You
|
||||
can pass 0 here to have the function run at the termination of the current
|
||||
mainloop.
|
||||
@function: The function to call. This should return 0 to be removed from the
|
||||
list of quit handlers. Otherwise the function might be called again.
|
||||
@data: Pointer to pass when calling @function.
|
||||
@Returns: A handle for this quit handler (you need this for gtk_quit_remove())
|
||||
or 0 if you passed a %NULL pointer in @function.
|
||||
@Deprecated: This function is going to be removed in GTK+ 3.0
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkCallbackMarshal ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@object:
|
||||
@data:
|
||||
@n_args:
|
||||
@args:
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkArg ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@type:
|
||||
@name:
|
||||
|
||||
<!-- ##### FUNCTION gtk_quit_add_full ##### -->
|
||||
<para>
|
||||
Registers a function to be called when an instance of the mainloop is left.
|
||||
In comparison to gtk_quit_add() this function adds the possibility to
|
||||
pass a marshaller and a function to be called when the quit handler is freed.
|
||||
</para>
|
||||
<para>
|
||||
The former can be used to run interpreted code instead of a compiled function
|
||||
while the latter can be used to free the information stored in @data (while
|
||||
you can do this in @function as well)... So this function will mostly be
|
||||
used by GTK+ wrappers for languages other than C.
|
||||
</para>
|
||||
|
||||
@main_level: Level at which termination the function shall be called. You
|
||||
can pass 0 here to have the function run at the termination of the current
|
||||
mainloop.
|
||||
@function: The function to call. This should return 0 to be removed from the
|
||||
list of quit handlers. Otherwise the function might be called again.
|
||||
@marshal: The marshaller to be used. If this is non-%NULL, @function is
|
||||
ignored.
|
||||
@data: Pointer to pass when calling @function.
|
||||
@destroy: Function to call to destruct @data. Gets @data as argument.
|
||||
@Returns: A handle for this quit handler (you need this for gtk_quit_remove())
|
||||
or 0 if you passed a %NULL pointer in @function.
|
||||
@Deprecated: This function is going to be removed in GTK+ 3.0
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_quit_remove ##### -->
|
||||
<para>
|
||||
Removes a quit handler by its identifier.
|
||||
</para>
|
||||
|
||||
@quit_handler_id: Identifier for the handler returned when installing it.
|
||||
@Deprecated: This function is going to be removed in GTK+ 3.0
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_quit_remove_by_data ##### -->
|
||||
<para>
|
||||
Removes a quit handler identified by its @data field.
|
||||
</para>
|
||||
|
||||
@data: The pointer passed as @data to gtk_quit_add() or gtk_quit_add_full().
|
||||
@Deprecated: This function is going to be removed in GTK+ 3.0
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_PRIORITY_RESIZE ##### -->
|
||||
<para>
|
||||
Use this priority for resizing related stuff. It is used internally by
|
||||
GTK+ to compute the sizes of widgets. This priority is higher than
|
||||
%GDK_PRIORITY_REDRAW to avoid resizing a widget which was just redrawn.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_key_snooper_install ##### -->
|
||||
<para>
|
||||
Installs a key snooper function, which will get called on all key events
|
||||
before delivering them normally.
|
||||
</para>
|
||||
|
||||
@snooper: a #GtkKeySnoopFunc.
|
||||
@func_data: data to pass to @snooper.
|
||||
@Returns: a unique id for this key snooper for use with gtk_key_snooper_remove().
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkKeySnoopFunc ##### -->
|
||||
<para>
|
||||
Key snooper functions are called before normal event delivery.
|
||||
They can be used to implement custom key event handling.
|
||||
</para>
|
||||
|
||||
@grab_widget: the widget to which the event will be delivered.
|
||||
@event: the key event.
|
||||
@func_data: the @func_data supplied to gtk_key_snooper_install().
|
||||
@Returns: %TRUE to stop further processing of @event, %FALSE to continue.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_key_snooper_remove ##### -->
|
||||
<para>
|
||||
Removes the key snooper function with the given id.
|
||||
</para>
|
||||
|
||||
@snooper_handler_id: Identifies the key snooper to remove.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_current_event ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_current_event_time ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_current_event_state ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@state:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_current_event_device ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_get_event_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@event:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_propagate_event ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@event:
|
||||
|
||||
|
494
docs/reference/gtk/tmpl/gtkmenu.sgml
Normal file
494
docs/reference/gtk/tmpl/gtkmenu.sgml
Normal file
@@ -0,0 +1,494 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkMenu
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A menu widget
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkMenu is a #GtkMenuShell that implements a drop down menu consisting of
|
||||
a list of #GtkMenuItem objects which can be navigated and activated by the
|
||||
user to perform application functions.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A #GtkMenu is most commonly dropped down by activating a #GtkMenuItem in a
|
||||
#GtkMenuBar or popped up by activating a #GtkMenuItem in another #GtkMenu.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A #GtkMenu can also be popped up by activating a #GtkOptionMenu.
|
||||
Other composite widgets such as the #GtkNotebook can pop up a #GtkMenu
|
||||
as well.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Applications can display a #GtkMenu as a popup menu by calling the
|
||||
gtk_menu_popup() function. The example below shows how an application
|
||||
can pop up a menu when the 3rd mouse button is pressed.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Connecting the popup signal handler.</title>
|
||||
<programlisting>
|
||||
/* connect our handler which will popup the menu */
|
||||
g_signal_connect_swapped (window, "button_press_event",
|
||||
G_CALLBACK (my_popup_handler), menu);
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Signal handler which displays a popup menu.</title>
|
||||
<programlisting>
|
||||
static gint
|
||||
my_popup_handler (GtkWidget *widget, GdkEvent *event)
|
||||
{
|
||||
GtkMenu *menu;
|
||||
GdkEventButton *event_button;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_MENU (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
/* The "widget" is the menu that was supplied when
|
||||
* g_signal_connect_swapped() was called.
|
||||
*/
|
||||
menu = GTK_MENU (widget);
|
||||
|
||||
if (event->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
event_button = (GdkEventButton *) event;
|
||||
if (event_button->button == 3)
|
||||
{
|
||||
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
|
||||
event_button->button, event_button->time);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkMenu ##### -->
|
||||
<para>
|
||||
The #GtkMenu struct contains private data only, and
|
||||
should be accessed using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkMenu::move-scroll ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### ARG GtkMenu:accel-group ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:accel-path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:active ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:attach-widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:monitor ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:reserve-toggle-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:tearoff-state ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:tearoff-title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:bottom-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:left-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:right-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:top-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:arrow-placement ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:arrow-scaling ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:double-arrows ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:horizontal-offset ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:horizontal-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:vertical-offset ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:vertical-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_new ##### -->
|
||||
<para>
|
||||
Creates a new #GtkMenu.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: a new #GtkMenu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_screen ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@screen:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_reorder_child ##### -->
|
||||
<para>
|
||||
Moves a #GtkMenuItem to a new position within the #GtkMenu.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@child: the #GtkMenuItem to move.
|
||||
@position: the new position to place @child. Positions are numbered from
|
||||
0 to n-1.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@child:
|
||||
@left_attach:
|
||||
@right_attach:
|
||||
@top_attach:
|
||||
@bottom_attach:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_popup_for_device ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@device:
|
||||
@parent_menu_shell:
|
||||
@parent_menu_item:
|
||||
@func:
|
||||
@data:
|
||||
@destroy:
|
||||
@button:
|
||||
@activate_time:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_popup ##### -->
|
||||
|
||||
|
||||
@menu:
|
||||
@parent_menu_shell:
|
||||
@parent_menu_item:
|
||||
@func:
|
||||
@data:
|
||||
@button:
|
||||
@activate_time:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_accel_group ##### -->
|
||||
<para>
|
||||
Set the #GtkAccelGroup which holds global accelerators for the menu.
|
||||
This accelerator group needs to also be added to all windows that
|
||||
this menu is being used in with gtk_window_add_accel_group(), in order
|
||||
for those windows to support all the accelerators contained in this group.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@accel_group: the #GtkAccelGroup to be associated with the menu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_accel_group ##### -->
|
||||
<para>
|
||||
Gets the #GtkAccelGroup which holds global accelerators for the menu.
|
||||
See gtk_menu_set_accel_group().
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@Returns: the #GtkAccelGroup associated with the menu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_accel_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@accel_path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_accel_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_title ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@title:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_monitor ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@monitor_num:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_monitor ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_tearoff_state ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_reserve_toggle_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@reserve_toggle_size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_reserve_toggle_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_popdown ##### -->
|
||||
<para>
|
||||
Removes the menu from the screen.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_reposition ##### -->
|
||||
<para>
|
||||
Repositions the menu according to its position function.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_active ##### -->
|
||||
<para>
|
||||
Returns the selected menu item from the menu. This is used by the
|
||||
#GtkOptionMenu.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@Returns: the #GtkMenuItem that was last selected in the menu. If a
|
||||
selection has not yet been made, the first menu item is selected.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_active ##### -->
|
||||
<para>
|
||||
Selects the specified menu item within the menu. This is used by the
|
||||
#GtkOptionMenu and should not be used by anyone else.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@index_: the index of the menu item to select. Index values are from
|
||||
0 to n-1.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_tearoff_state ##### -->
|
||||
<para>
|
||||
Changes the tearoff state of the menu. A menu is normally displayed
|
||||
as drop down menu which persists as long as the menu is active. It can
|
||||
also be displayed as a tearoff menu which persists until it is closed
|
||||
or reattached.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@torn_off: If %TRUE, menu is displayed as a tearoff menu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_attach_to_widget ##### -->
|
||||
<para>
|
||||
Attaches the menu to the widget and provides a callback function that will
|
||||
be invoked when the menu calls gtk_menu_detach() during its destruction.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@attach_widget: the #GtkWidget that the menu will be attached to.
|
||||
@detacher: the user supplied callback function that will be called when
|
||||
the menu calls gtk_menu_detach().
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_detach ##### -->
|
||||
<para>
|
||||
Detaches the menu from the widget to which it had been attached.
|
||||
This function will call the callback function, @detacher, provided
|
||||
when the gtk_menu_attach_to_widget() function was called.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_attach_widget ##### -->
|
||||
<para>
|
||||
Returns the #GtkWidget that the menu is attached to.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@Returns: the #GtkWidget that the menu is attached to.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_for_attach_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkMenuPositionFunc ##### -->
|
||||
<para>
|
||||
A user function supplied when calling gtk_menu_popup() which controls the
|
||||
positioning of the menu when it is displayed. The function sets the @x
|
||||
and @y parameters to the coordinates where the menu is to be drawn.
|
||||
To make the menu appear on a different monitor than the mouse pointer,
|
||||
gtk_menu_set_monitor() must be called.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@x: address of the #gint representing the horizontal position where the
|
||||
menu shall be drawn. This is an output parameter.
|
||||
@y: address of the #gint representing the vertical position where the
|
||||
menu shall be drawn. This is an output parameter.
|
||||
@push_in: This parameter controls how menus placed outside the monitor are handled.
|
||||
If this is set to %TRUE and part of the menu is outside the monitor then
|
||||
GTK+ pushes the window into the visible area, effectively modifying the
|
||||
popup position.
|
||||
Note that moving and possibly resizing the menu around will alter the
|
||||
scroll position to keep the menu items "in place", i.e. at the same monitor
|
||||
position they would have been without resizing.
|
||||
In practice, this behavior is only useful for combobox popups or option
|
||||
menus and cannot be used to simply confine a menu to monitor boundaries.
|
||||
In that case, changing the scroll offset is not desirable.
|
||||
@user_data: the data supplied by the user in the gtk_menu_popup() @data
|
||||
parameter.
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkMenuDetachFunc ##### -->
|
||||
<para>
|
||||
A user function supplied when calling gtk_menu_attach_to_widget() which
|
||||
will be called when the menu is later detached from the widget.
|
||||
</para>
|
||||
|
||||
@attach_widget: the #GtkWidget that the menu is being detached from.
|
||||
@menu: the #GtkMenu being detached.
|
||||
|
||||
|
104
docs/reference/gtk/tmpl/gtkmenubar.sgml
Normal file
104
docs/reference/gtk/tmpl/gtkmenubar.sgml
Normal file
@@ -0,0 +1,104 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkMenuBar
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A subclass widget for GtkMenuShell which holds GtkMenuItem widgets
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkMenuBar is a subclass of #GtkMenuShell which contains one to many #GtkMenuItem. The result is a standard menu bar which can hold many menu items. #GtkMenuBar allows for a shadow type to be set for aesthetic purposes. The shadow types are defined in the #gtk_menu_bar_set_shadow_type function.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkMenuShell, #GtkMenu, #GtkMenuItem
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkMenuBar ##### -->
|
||||
<para>
|
||||
The #GtkMenuBar struct contains the following fields. (These fields should be considered read-only. They should never be set by an application.)
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkMenuBar:child-pack-direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenuBar:pack-direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenuBar:internal-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenuBar:shadow-type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_new ##### -->
|
||||
<para>
|
||||
Creates the new #GtkMenuBar
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: the #GtkMenuBar
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkPackDirection ##### -->
|
||||
<para>
|
||||
Determines how widgets should be packed insided menubars and
|
||||
menuitems contained in menubars.
|
||||
</para>
|
||||
|
||||
@GTK_PACK_DIRECTION_LTR: Widgets are packed left-to-right.
|
||||
@GTK_PACK_DIRECTION_RTL: Widgets are packed right-to-left.
|
||||
@GTK_PACK_DIRECTION_TTB: Widgets are packed top-to-bottom.
|
||||
@GTK_PACK_DIRECTION_BTT: Widgets are packed bottom-to-top.
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_set_pack_direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menubar:
|
||||
@pack_dir:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_get_pack_direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menubar:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_set_child_pack_direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menubar:
|
||||
@child_pack_dir:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_get_child_pack_direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menubar:
|
||||
@Returns:
|
||||
|
||||
|
224
docs/reference/gtk/tmpl/gtkmenushell.sgml
Normal file
224
docs/reference/gtk/tmpl/gtkmenushell.sgml
Normal file
@@ -0,0 +1,224 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkMenuShell
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A base class for menu objects
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkMenuShell is the abstract base class used to derive the
|
||||
#GtkMenu and #GtkMenuBar subclasses.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A #GtkMenuShell is a container of #GtkMenuItem objects arranged in a
|
||||
list which can be navigated, selected, and activated by the user to perform
|
||||
application functions. A #GtkMenuItem can have a submenu associated with it,
|
||||
allowing for nested hierarchical menus.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkMenuShell ##### -->
|
||||
<para>
|
||||
The #GtkMenuShell-struct struct contains the following fields.
|
||||
(These fields should be considered read-only. They should never be set by
|
||||
an application.)
|
||||
|
||||
<informaltable pgwide="1" frame="none" role="struct">
|
||||
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
|
||||
<tbody>
|
||||
|
||||
<row>
|
||||
<entry>#GList *children;</entry>
|
||||
<entry>The list of #GtkMenuItem objects contained by this #GtkMenuShell.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody></tgroup></informaltable>
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::activate-current ##### -->
|
||||
<para>
|
||||
An action signal that activates the current menu item within the menu
|
||||
shell.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
@force_hide: if TRUE, hide the menu after activating the menu item.
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::cancel ##### -->
|
||||
<para>
|
||||
An action signal which cancels the selection within the menu shell.
|
||||
Causes the GtkMenuShell::selection-done signal to be emitted.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::cycle-focus ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::deactivate ##### -->
|
||||
<para>
|
||||
This signal is emitted when a menu shell is deactivated.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::move-current ##### -->
|
||||
<para>
|
||||
An action signal which moves the current menu item in the direction
|
||||
specified by @direction.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
@direction: the direction to move.
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::move-selected ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::selection-done ##### -->
|
||||
<para>
|
||||
This signal is emitted when a selection has been completed within a menu
|
||||
shell.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
|
||||
<!-- ##### ARG GtkMenuShell:take-focus ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_append ##### -->
|
||||
<para>
|
||||
Adds a new #GtkMenuItem to the end of the menu shell's item list.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@child: The #GtkMenuItem to add.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_prepend ##### -->
|
||||
<para>
|
||||
Adds a new #GtkMenuItem to the beginning of the menu shell's item list.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@child: The #GtkMenuItem to add.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_insert ##### -->
|
||||
<para>
|
||||
Adds a new #GtkMenuItem to the menu shell's item list at the position
|
||||
indicated by @position.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@child: The #GtkMenuItem to add.
|
||||
@position: The position in the item list where @child is added.
|
||||
Positions are numbered from 0 to n-1.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_deactivate ##### -->
|
||||
<para>
|
||||
Deactivates the menu shell. Typically this results in the menu shell
|
||||
being erased from the screen.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_select_item ##### -->
|
||||
<para>
|
||||
Selects the menu item from the menu shell.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@menu_item: The #GtkMenuItem to select.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_select_first ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu_shell:
|
||||
@search_sensitive:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_deselect ##### -->
|
||||
<para>
|
||||
Deselects the currently selected item from the menu shell, if any.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_activate_item ##### -->
|
||||
<para>
|
||||
Activates the menu item within the menu shell.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@menu_item: The #GtkMenuItem to activate.
|
||||
@force_deactivate: If TRUE, force the deactivation of the menu shell
|
||||
after the menu item is activated.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_cancel ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu_shell:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_set_take_focus ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu_shell:
|
||||
@take_focus:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_get_take_focus ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu_shell:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkMenuDirectionType ##### -->
|
||||
<para>
|
||||
An enumeration representing directional movements within a menu.
|
||||
</para>
|
||||
|
||||
@GTK_MENU_DIR_PARENT: To the parent menu shell.
|
||||
@GTK_MENU_DIR_CHILD: To the submenu, if any, associated with the item.
|
||||
@GTK_MENU_DIR_NEXT: To the next menu item.
|
||||
@GTK_MENU_DIR_PREV: To the previous menu item.
|
||||
|
@@ -16,24 +16,6 @@ A GtkToolItem containing a button with an additional dropdown menu
|
||||
#GtkMenuToolButton. Use gtk_menu_tool_button_new_from_stock() to
|
||||
create a new #GtkMenuToolButton containing a stock item.
|
||||
</para>
|
||||
<refsect2 id="GtkMenuToolButton-BUILDER-UI">
|
||||
<title>GtkMenuToolButton as GtkBuildable</title>
|
||||
<para>
|
||||
The GtkMenuToolButton implementation of the GtkBuildable interface
|
||||
supports adding a menu by specifying "menu" as the "type"
|
||||
attribute of a <child> element.
|
||||
</para>
|
||||
<example>
|
||||
<title>A UI definition fragment with menus</title>
|
||||
<programlisting><![CDATA[
|
||||
<object class="GtkMenuToolButton">
|
||||
<child type="menu">
|
||||
<object class="GtkMenu"/>
|
||||
</child>
|
||||
</object>
|
||||
]]></programlisting>
|
||||
</example>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
265
docs/reference/gtk/tmpl/gtkpreview.sgml
Normal file
265
docs/reference/gtk/tmpl/gtkpreview.sgml
Normal file
@@ -0,0 +1,265 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkPreview
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A widget to display RGB or grayscale data
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkPreview widget provides a simple interface
|
||||
used to display images as RGB or grayscale data.
|
||||
It's deprecated; just use a #GdkPixbuf displayed by a #GtkImage, or
|
||||
perhaps a #GtkDrawingArea. #GtkPreview has no advantage over those
|
||||
approaches.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GdkRGB</term>
|
||||
<listitem><para>the backend used by #GtkPreview.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkPreview ##### -->
|
||||
<para>
|
||||
The #GtkPreview-struct struct contains private data only, and
|
||||
should be accessed using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkPreview:expand ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### STRUCT GtkPreviewInfo ##### -->
|
||||
<para>
|
||||
Contains information about global properties
|
||||
of preview widgets.
|
||||
|
||||
The #GtkPreviewInfo struct contains the following fields.
|
||||
(These fields should be considered read-only. They should never be set by
|
||||
an application.)
|
||||
|
||||
<informaltable pgwide="1" frame="none" role="struct">
|
||||
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
|
||||
<tbody>
|
||||
|
||||
<row>
|
||||
<entry>#GdkVisual *visual;</entry>
|
||||
<entry>the visual used by all previews.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>#GdkColormap *cmap;</entry>
|
||||
<entry>the colormap used by all previews.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>gdouble gamma;</entry>
|
||||
<entry>the gamma correction value used by all previews (See gtk_preview_set_gamma()).</entry>
|
||||
</row>
|
||||
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
||||
</para>
|
||||
|
||||
@lookup:
|
||||
@gamma:
|
||||
|
||||
<!-- ##### UNION GtkDitherInfo ##### -->
|
||||
<para>
|
||||
This union not used in GTK+.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_uninit ##### -->
|
||||
<para>
|
||||
This function is deprecated and does nothing.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_new ##### -->
|
||||
<para>
|
||||
Create a new preview widget.
|
||||
</para>
|
||||
|
||||
@type: the type data contained by the widget.
|
||||
(Grayscale or RGB)
|
||||
@Returns: a new #GtkPreview
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_size ##### -->
|
||||
<para>
|
||||
Set the size that the preview widget will request
|
||||
in response to a "size_request" signal. The
|
||||
drawing area may actually be allocated a size
|
||||
larger than this depending on how it is packed
|
||||
within the enclosing containers. The effect
|
||||
of this is determined by whether the preview
|
||||
is set to expand or not (see gtk_preview_expand())
|
||||
</para>
|
||||
|
||||
@preview: a #GtkPreview.
|
||||
@width: the new width.
|
||||
@height: the new height.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_put ##### -->
|
||||
<para>
|
||||
Takes a portion of the contents of a preview widget
|
||||
and draws it onto the given drawable, @window.
|
||||
</para>
|
||||
|
||||
@preview: a #GtkPreview.
|
||||
@window: a window or pixmap.
|
||||
@gc: The graphics context for the operation. Only the
|
||||
clip mask for this GC matters.
|
||||
@srcx: the x coordinate of the upper left corner in the source image.
|
||||
@srcy: the y coordinate of the upper left corner in the source image.
|
||||
@destx: the x coordinate of the upper left corner in the destination image.
|
||||
@desty: the y coordinate of the upper left corner in the destination image.
|
||||
@width: the width of the rectangular portion to draw.
|
||||
@height: the height of the rectangular portion to draw.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_draw_row ##### -->
|
||||
<para>
|
||||
Sets the data for a portion of a row.
|
||||
</para>
|
||||
|
||||
@preview: a #GtkPreview.
|
||||
@data: the new data for the portion. It should contain
|
||||
@w bytes of data if the preview is of type
|
||||
GTK_TYPE_GRAYSCALE, and 3*@w bytes of data
|
||||
if the preview is of type GTK_TYPE_COLOR.
|
||||
@x: the starting value on the row to set.
|
||||
@y: the row to change.
|
||||
@w: the number of pixels in the row to change.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_set_expand ##### -->
|
||||
<para>
|
||||
Determines the way that the the preview widget behaves
|
||||
when the size it is allocated is larger than the requested
|
||||
size. If @expand is %FALSE, then the preview's window
|
||||
and buffer will be no larger than the size set with
|
||||
gtk_preview_size(), and the data set will be centered
|
||||
in the allocation if it is larger. If @expand is %TRUE
|
||||
then the window and buffer will expand with the allocation;
|
||||
the application is responsible for catching
|
||||
the "size_allocate" signal and providing the data
|
||||
appropriate for this size.
|
||||
</para>
|
||||
|
||||
@preview: a #GtkPreview.
|
||||
@expand: whether the preview's window should expand or not.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_set_gamma ##### -->
|
||||
<para>
|
||||
Set the gamma-correction value for all preview widgets.
|
||||
(This function will eventually be replaced with a
|
||||
function that sets a per-preview-widget gamma value).
|
||||
The resulting intensity is given by:
|
||||
<literal>destination_value * pow (source_value/255, 1/gamma)</literal>.
|
||||
The gamma value is applied when the data is
|
||||
set with gtk_preview_draw_row() so changing this
|
||||
value will not affect existing data in preview
|
||||
widgets.
|
||||
</para>
|
||||
|
||||
@gamma_: the new gamma value.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_set_color_cube ##### -->
|
||||
<para>
|
||||
This function is deprecated and does nothing. GdkRGB
|
||||
automatically picks an optimium color cube for the
|
||||
display.
|
||||
</para>
|
||||
|
||||
@nred_shades: ignored
|
||||
@ngreen_shades: ignored
|
||||
@nblue_shades: ignored
|
||||
@ngray_shades: ignored
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_set_install_cmap ##### -->
|
||||
<para>
|
||||
This function is deprecated
|
||||
and does nothing. GdkRGB will automatically pick
|
||||
a private colormap if it cannot allocate sufficient
|
||||
colors.
|
||||
</para>
|
||||
|
||||
@install_cmap: ignored.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_set_reserved ##### -->
|
||||
<para>
|
||||
This function is deprecated and does nothing.
|
||||
</para>
|
||||
|
||||
@nreserved: ignored.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_set_dither ##### -->
|
||||
<para>
|
||||
Set the dithering mode for the display.
|
||||
</para>
|
||||
|
||||
@preview: a #GtkPreview.
|
||||
@dither: the dithering mode.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_get_visual ##### -->
|
||||
<para>
|
||||
Returns the visual used by preview widgets. This
|
||||
function is deprecated, and you should use
|
||||
gdk_rgb_get_visual() instead.
|
||||
</para>
|
||||
|
||||
@Returns: the visual for previews.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_get_cmap ##### -->
|
||||
<para>
|
||||
Returns the colormap used by preview widgets. This
|
||||
function is deprecated, and you should use
|
||||
gdk_rgb_get_cmap() instead.
|
||||
</para>
|
||||
|
||||
@Returns: the colormap for previews.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_get_info ##### -->
|
||||
<para>
|
||||
Return a #GtkPreviewInfo structure containing
|
||||
global information about preview widgets.
|
||||
</para>
|
||||
|
||||
@Returns: a #GtkPreviewInfo structure. The return
|
||||
value belongs to GTK+ and must not be modified
|
||||
or freed.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_preview_reset ##### -->
|
||||
<para>
|
||||
This function is deprecated and does nothing. It was
|
||||
once used for changing the colormap and visual on the fly.
|
||||
</para>
|
||||
|
||||
|
||||
|
186
docs/reference/gtk/tmpl/gtkprintjob.sgml
Normal file
186
docs/reference/gtk/tmpl/gtkprintjob.sgml
Normal file
@@ -0,0 +1,186 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkPrintJob
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Represents a print job
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkPrintJob object represents a job that is sent to a
|
||||
printer. You only need to deal directly with print jobs if
|
||||
you use the non-portable #GtkPrintUnixDialog API.
|
||||
</para>
|
||||
<para>
|
||||
Use gtk_print_job_get_surface() to obtain the cairo surface
|
||||
onto which the pages must be drawn. Use gtk_print_job_send()
|
||||
to send the finished job to the printer. If you don't use cairo
|
||||
#GtkPrintJob also supports printing of manually generated postscript,
|
||||
via gtk_print_job_set_source_file().
|
||||
<!-- FIXME more details needed here -->
|
||||
</para>
|
||||
<!-- FIXME examples ? -->
|
||||
|
||||
<para>
|
||||
Printing support was added in GTK+ 2.10.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkPrintJob ##### -->
|
||||
<para>
|
||||
The GtkPrintJob struct contains only private members
|
||||
and should not be directly accessed.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintJob::status-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printjob: the object which received the signal.
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:page-setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:printer ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:settings ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:track-print-status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkPrintJobCompleteFunc ##### -->
|
||||
<para>
|
||||
The type of callback that is passed to gtk_print_job_send().
|
||||
It is called when the print job has been completely sent.
|
||||
</para>
|
||||
|
||||
@print_job: the #GtkPrintJob
|
||||
@user_data: user data that has been passed to gtk_print_job_send()
|
||||
@error: a #GError that contains error information if the sending
|
||||
of the print job failed, otherwise %NULL
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@title:
|
||||
@printer:
|
||||
@settings:
|
||||
@page_setup:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_settings ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_printer ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_set_source_file ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@filename:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_surface ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_send ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@callback:
|
||||
@user_data:
|
||||
@dnotify:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_set_track_print_status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@track_status:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_track_print_status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
704
docs/reference/gtk/tmpl/gtkprintoperation.sgml
Normal file
704
docs/reference/gtk/tmpl/gtkprintoperation.sgml
Normal file
@@ -0,0 +1,704 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkPrintOperation
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
High-level Printing API
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
GtkPrintOperation is the high-level, portable printing API. It looks
|
||||
a bit different than other GTK+ dialogs such as the #GtkFileChooser,
|
||||
since some platforms don't expose enough infrastructure to implement
|
||||
a good print dialog. On such platforms, GtkPrintOperation uses the
|
||||
native print dialog. On platforms which do not provide a native
|
||||
print dialog, GTK+ uses its own, see #GtkPrintUnixDialog.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The typical way to use the high-level printing API is to create a
|
||||
#GtkPrintOperation object with gtk_print_operation_new() when the user
|
||||
selects to print. Then you set some properties on it, e.g. the page size,
|
||||
any #GtkPrintSettings from previous print operations, the number of pages,
|
||||
the current page, etc.
|
||||
</para>
|
||||
<para>
|
||||
Then you start the print operation by calling gtk_print_operation_run().
|
||||
It will then show a dialog, let the user select a printer and options.
|
||||
When the user finished the dialog various signals will be emitted on the
|
||||
#GtkPrintOperation, the main one being ::draw-page, which you are supposed
|
||||
to catch and render the page on the provided #GtkPrintContext using Cairo.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>The high-level printing API</title>
|
||||
<programlisting>
|
||||
static GtkPrintSettings *settings = NULL;
|
||||
|
||||
static void
|
||||
do_print (void)
|
||||
{
|
||||
GtkPrintOperation *print;
|
||||
GtkPrintOperationResult res;
|
||||
|
||||
print = gtk_print_operation_new (<!-- -->);
|
||||
|
||||
if (settings != NULL)
|
||||
gtk_print_operation_set_print_settings (print, settings);
|
||||
|
||||
g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), NULL);
|
||||
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL);
|
||||
|
||||
res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
|
||||
GTK_WINDOW (main_window), NULL);
|
||||
|
||||
if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
|
||||
{
|
||||
if (settings != NULL)
|
||||
g_object_unref (settings);
|
||||
settings = g_object_ref (gtk_print_operation_get_print_settings (print));
|
||||
}
|
||||
|
||||
g_object_unref (print);
|
||||
}
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
By default GtkPrintOperation uses an external application to do
|
||||
print preview. To implement a custom print preview, an application
|
||||
must connect to the preview signal. The functions
|
||||
gtk_print_operation_print_preview_render_page(),
|
||||
gtk_print_operation_preview_end_preview() and
|
||||
gtk_print_operation_preview_is_selected() are useful
|
||||
when implementing a print preview.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Printing support was added in GTK+ 2.10.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkPrintContext, #GtkPrintUnixDialog
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkPrintOperation ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::begin-print ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation:
|
||||
@context:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::create-custom-widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::custom-widget-apply ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation:
|
||||
@widget:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::done ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::draw-page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::end-print ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::paginate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::preview ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@arg3:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::request-page-setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@arg3:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::status-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperation::update-custom-widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperation: the object which received the signal.
|
||||
@widget:
|
||||
@arg1:
|
||||
@arg2:
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:allow-async ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:current-page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:custom-tab-label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:default-page-setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:embed-page-setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:export-filename ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:has-selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:job-name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:n-pages ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:n-pages-to-print ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:print-settings ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:show-progress ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:status-string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:support-selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:track-print-status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:unit ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintOperation:use-full-page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ENUM GtkPrintStatus ##### -->
|
||||
<para>
|
||||
The status gives a rough indication of the completion
|
||||
of a running print operation.
|
||||
</para>
|
||||
|
||||
@GTK_PRINT_STATUS_INITIAL: The printing has not started yet; this
|
||||
status is set initially, and while the print dialog is shown.
|
||||
@GTK_PRINT_STATUS_PREPARING: This status is set while the begin-print
|
||||
signal is emitted and during pagination.
|
||||
@GTK_PRINT_STATUS_GENERATING_DATA: This status is set while the
|
||||
pages are being rendered.
|
||||
@GTK_PRINT_STATUS_SENDING_DATA: The print job is being sent off to the
|
||||
printer.
|
||||
@GTK_PRINT_STATUS_PENDING: The print job has been sent to the printer,
|
||||
but is not printed for some reason, e.g. the printer may be stopped.
|
||||
@GTK_PRINT_STATUS_PENDING_ISSUE: Some problem has occurred during
|
||||
printing, e.g. a paper jam.
|
||||
@GTK_PRINT_STATUS_PRINTING: The printer is processing the print job.
|
||||
@GTK_PRINT_STATUS_FINISHED: The printing has been completed successfully.
|
||||
@GTK_PRINT_STATUS_FINISHED_ABORTED: The printing has been aborted.
|
||||
|
||||
<!-- ##### ENUM GtkPrintOperationAction ##### -->
|
||||
<para>
|
||||
The @action parameter to gtk_print_operation_run()
|
||||
determines what action the print operation should perform.
|
||||
</para>
|
||||
|
||||
@GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG: Show the print dialog.
|
||||
@GTK_PRINT_OPERATION_ACTION_PRINT: Start to print without showing
|
||||
the print dialog, based on the current print settings.
|
||||
@GTK_PRINT_OPERATION_ACTION_PREVIEW: Show the print preview.
|
||||
@GTK_PRINT_OPERATION_ACTION_EXPORT: Export to a file. This requires
|
||||
the export-filename property to be set.
|
||||
|
||||
<!-- ##### ENUM GtkPrintOperationResult ##### -->
|
||||
<para>
|
||||
A value of this type is returned by gtk_print_operation_run().
|
||||
</para>
|
||||
|
||||
@GTK_PRINT_OPERATION_RESULT_ERROR: An error has occured.
|
||||
@GTK_PRINT_OPERATION_RESULT_APPLY: The print settings should be stored.
|
||||
@GTK_PRINT_OPERATION_RESULT_CANCEL: The print operation has been canceled,
|
||||
the print settings should not be stored.
|
||||
@GTK_PRINT_OPERATION_RESULT_IN_PROGRESS: The print operation is not complete
|
||||
yet. This value will only be returned when running asynchronously.
|
||||
|
||||
<!-- ##### ENUM GtkPrintError ##### -->
|
||||
<para>
|
||||
Error codes that identify various errors that can occur while
|
||||
using the GTK+ printing support.
|
||||
</para>
|
||||
|
||||
@GTK_PRINT_ERROR_GENERAL: An unspecified error occurred.
|
||||
@GTK_PRINT_ERROR_INTERNAL_ERROR: An internal error occurred.
|
||||
@GTK_PRINT_ERROR_NOMEM: A memory allocation failed.
|
||||
@GTK_PRINT_ERROR_INVALID_FILE: An error occurred while loading a page setup
|
||||
or paper size from a key file.
|
||||
|
||||
<!-- ##### MACRO GTK_PRINT_ERROR ##### -->
|
||||
<para>
|
||||
The #GQuark used for #GtkPrintError errors.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_allow_async ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@allow_async:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_error ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@error:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_default_page_setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@default_page_setup:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_default_page_setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_print_settings ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@print_settings:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_print_settings ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_job_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@job_name:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_n_pages ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@n_pages:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_n_pages_to_print ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_current_page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@current_page:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_use_full_page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@full_page:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_unit ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@unit:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_export_filename ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@filename:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_show_progress ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@show_progress:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_track_print_status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@track_status:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_custom_tab_label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@label:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_run ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@action:
|
||||
@parent:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_cancel ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_draw_page_finish ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_defer_drawing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_status_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_is_finished ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_support_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@support_selection:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_support_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_has_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@has_selection:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_has_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_set_embed_page_setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@embed:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_get_embed_page_setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@op:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_run_page_setup_dialog ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@parent:
|
||||
@page_setup:
|
||||
@settings:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkPageSetupDoneFunc ##### -->
|
||||
<para>
|
||||
The type of function that is passed to gtk_print_run_page_setup_dialog_async().
|
||||
This function will be called when the page setup dialog is dismissed, and
|
||||
also serves as destroy notify for @data.
|
||||
</para>
|
||||
|
||||
@page_setup: the #GtkPageSetup that has been
|
||||
@data: user data that has been passed to
|
||||
gtk_print_run_page_setup_dialog_async().
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_run_page_setup_dialog_async ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@parent:
|
||||
@page_setup:
|
||||
@settings:
|
||||
@done_cb:
|
||||
@data:
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkPrintOperationPreview ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperationPreview::got-page-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperationpreview: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintOperationPreview::ready ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printoperationpreview: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_preview_end_preview ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@preview:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_preview_is_selected ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@preview:
|
||||
@page_nr:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_operation_preview_render_page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@preview:
|
||||
@page_nr:
|
||||
|
||||
|
215
docs/reference/gtk/tmpl/gtkprogress.sgml
Normal file
215
docs/reference/gtk/tmpl/gtkprogress.sgml
Normal file
@@ -0,0 +1,215 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkProgress
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Base class for GtkProgressBar
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkProgress is the abstract base class used to derive
|
||||
a #GtkProgressBar which provides a visual representation of
|
||||
the progress of a long running operation.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkProgress ##### -->
|
||||
<para>
|
||||
The #GtkProgress-struct struct contains private data only.
|
||||
and should be accessed using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkProgress:activity-mode ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkProgress:show-text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkProgress:text-xalign ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkProgress:text-yalign ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_set_show_text ##### -->
|
||||
<para>
|
||||
Controls whether progress text is shown.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@show_text: a boolean indicating whether the progress text
|
||||
is shown.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_set_text_alignment ##### -->
|
||||
<para>
|
||||
Controls the alignment of the text within the progress bar area.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@x_align: a number between 0.0 and 1.0 indicating the horizontal
|
||||
alignment of the progress text within the #GtkProgress.
|
||||
@y_align: a number between 0.0 and 1.0 indicating the vertical
|
||||
alignment of the progress text within the #GtkProgress.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_set_format_string ##### -->
|
||||
<para>
|
||||
Sets a format string used to display text indicating the
|
||||
current progress. The string can contain the following substitution characters:
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
%v - the current progress value.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
%l - the lower bound for the progress value.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
%u - the upper bound for the progress value.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
%p - the current progress percentage.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@format: a string used to display progress text, or %NULL
|
||||
to restore to the default format.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_set_adjustment ##### -->
|
||||
<para>
|
||||
Associates a #GtkAdjustment with the #GtkProgress. A #GtkAdjustment
|
||||
is used to represent the upper and lower bounds and the step interval
|
||||
of the underlying value for which progress is shown.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@adjustment: the #GtkAdjustment to be associated with the #GtkProgress.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_set_percentage ##### -->
|
||||
<para>
|
||||
Sets the current percentage completion for the #GtkProgress.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@percentage: the percentage complete which must be between 0.0
|
||||
and 1.0.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_set_value ##### -->
|
||||
<para>
|
||||
Sets the value within the #GtkProgress to an absolute value.
|
||||
The value must be within the valid range of values for the
|
||||
underlying #GtkAdjustment.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@value: the value indicating the current completed amount.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_get_value ##### -->
|
||||
<para>
|
||||
Returns the current progress complete value.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@Returns: the current progress complete value.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_set_activity_mode ##### -->
|
||||
<para>
|
||||
A #GtkProgress can be in one of two different modes: percentage
|
||||
mode (the default) and activity mode. In activity mode, the
|
||||
progress is simply indicated as activity rather than as a percentage
|
||||
complete.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@activity_mode: a boolean, %TRUE for activity mode.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_get_current_text ##### -->
|
||||
<para>
|
||||
Returns the current text associated with the #GtkProgress. This
|
||||
text is the based on the underlying format string after any substitutions
|
||||
are made.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@Returns: the text indicating the current progress.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_get_text_from_value ##### -->
|
||||
<para>
|
||||
Returns the text indicating the progress based on the supplied value.
|
||||
The current value for the #GtkProgress remains unchanged.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@value: an absolute progress value to use when formatting the progress text.
|
||||
@Returns: a string indicating the progress.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_get_current_percentage ##### -->
|
||||
<para>
|
||||
Returns the current progress as a percentage.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@Returns: a number between 0.0 and 1.0 indicating the percentage complete.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_get_percentage_from_value ##### -->
|
||||
<para>
|
||||
Returns the progress as a percentage calculated from the supplied
|
||||
absolute progress value.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@value: an absolute progress value.
|
||||
@Returns: a number between 0.0 and 1.0 indicating the percentage complete
|
||||
represented by @value.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_progress_configure ##### -->
|
||||
<para>
|
||||
Allows the configuration of the minimum, maximum, and current values for
|
||||
the #GtkProgress.
|
||||
</para>
|
||||
|
||||
@progress: a #GtkProgress.
|
||||
@value: the current progress value.
|
||||
@min: the minimum progress value.
|
||||
@max: the maximum progress value.
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Resource Files
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Deprecated routines for handling resource files
|
||||
Routines for handling resource files
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
@@ -10,10 +10,10 @@ GTK+ provides resource file mechanism for configuring
|
||||
various aspects of the operation of a GTK+ program
|
||||
at runtime.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
In GTK+ 3.0, resource files have been deprecated and replaced
|
||||
by CSS-like style sheets, which are understood by #GtkCssProvider.
|
||||
</warning>
|
||||
</para>
|
||||
|
||||
<refsect2><title>Default files</title>
|
||||
<para>
|
||||
|
207
docs/reference/gtk/tmpl/gtkrecentfilter.sgml
Normal file
207
docs/reference/gtk/tmpl/gtkrecentfilter.sgml
Normal file
@@ -0,0 +1,207 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkRecentFilter
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A filter for selecting a subset of recently used files
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkRecentFilter can be used to restrict the files being shown
|
||||
in a #GtkRecentChooser. Files can be filtered based on their name
|
||||
(with gtk_recent_filter_add_pattern()), on their mime type (with
|
||||
gtk_file_filter_add_mime_type()), on the application that has
|
||||
registered them (with gtk_recent_filter_add_application()), or by
|
||||
a custom filter function (with gtk_recent_filter_add_custom()).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering by mime type handles aliasing and subclassing of mime
|
||||
types; e.g. a filter for text/plain also matches a file with mime
|
||||
type application/rtf, since application/rtf is a subclass of text/plain.
|
||||
Note that #GtkRecentFilter allows wildcards for the subtype of a
|
||||
mime type, so you can e.g. filter for image/*.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normally, filters are used by adding them to a #GtkRecentChooser,
|
||||
see gtk_recent_chooser_add_filter(), but it is also possible to
|
||||
manually use a filter on a file with gtk_recent_filter_filter().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Recently used files are supported since GTK+ 2.10.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkRecentChooser
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkRecentFilter ##### -->
|
||||
<para>
|
||||
The <structname>GtkRecentFilter</structname> struct contains
|
||||
only private fields and should not be directly accessed.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkRecentFilterInfo ##### -->
|
||||
<para>
|
||||
A <structname>GtkRecentFilterInfo</structname> struct is used
|
||||
to pass information about the tested file to gtk_recent_filter_filter().
|
||||
</para>
|
||||
|
||||
@contains: Flags indicating which of the following fields need
|
||||
are filled
|
||||
@uri: the URI of the file being tested
|
||||
@display_name: the string that will be used to display the file
|
||||
in the recent chooser
|
||||
@mime_type: the mime type of the file
|
||||
@applications: the list of applications that have registered the file
|
||||
@groups: the groups to which the file belongs to
|
||||
@age: the number of days elapsed since the file has been registered
|
||||
|
||||
<!-- ##### ENUM GtkRecentFilterFlags ##### -->
|
||||
<para>
|
||||
These flags indicate what parts of a #GtkRecentFilterInfo struct
|
||||
are filled or need to be filled.
|
||||
</para>
|
||||
|
||||
@GTK_RECENT_FILTER_URI: the URI of the file being tested
|
||||
@GTK_RECENT_FILTER_DISPLAY_NAME: the string that will be used to
|
||||
display the file in the recent chooser
|
||||
@GTK_RECENT_FILTER_MIME_TYPE: the mime type of the file
|
||||
@GTK_RECENT_FILTER_APPLICATION: the list of applications that have
|
||||
registered the file
|
||||
@GTK_RECENT_FILTER_GROUP: the groups to which the file belongs to
|
||||
@GTK_RECENT_FILTER_AGE: the number of days elapsed since the file
|
||||
has been registered
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkRecentFilterFunc ##### -->
|
||||
<para>
|
||||
The type of function that is used with custom filters,
|
||||
see gtk_recent_filter_add_custom().
|
||||
</para>
|
||||
|
||||
@filter_info: a #GtkRecentFilterInfo that is filled according
|
||||
to the @needed flags passed to gtk_recent_filter_add_custom()
|
||||
@user_data: user data passed to gtk_recent_filter_add_custom()
|
||||
@Returns: %TRUE if the file should be displayed
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_get_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_set_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@name:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_mime_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@mime_type:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_pattern ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@pattern:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_pixbuf_formats ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_application ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@application:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_group ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@group:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_age ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@days:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_custom ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@needed:
|
||||
@func:
|
||||
@data:
|
||||
@data_destroy:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_get_needed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_filter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@filter_info:
|
||||
@Returns:
|
||||
|
||||
|
134
docs/reference/gtk/tmpl/gtkruler.sgml
Normal file
134
docs/reference/gtk/tmpl/gtkruler.sgml
Normal file
@@ -0,0 +1,134 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkRuler
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Base class for horizontal or vertical rulers
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<note>
|
||||
<para>
|
||||
This widget is considered too specialized/little-used for
|
||||
GTK+, and will in the future be moved to some other package. If
|
||||
your application needs this widget, feel free to use it, as the
|
||||
widget does work and is useful in some applications; it's just not
|
||||
of general interest. However, we are not accepting new features for
|
||||
the widget, and it will eventually move out of the GTK+
|
||||
distribution.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The GTKRuler widget is a base class for horizontal and vertical rulers. Rulers
|
||||
are used to show the mouse pointer's location in a window. The ruler can either
|
||||
be horizontal or vertical on the window. Within the ruler a small triangle
|
||||
indicates the location of the mouse relative to the horizontal or vertical
|
||||
ruler. See #GtkHRuler to learn how to create a new horizontal ruler. See
|
||||
#GtkVRuler to learn how to create a new vertical ruler.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkHRuler, #GtkVRuler
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkRuler ##### -->
|
||||
<para>
|
||||
All distances are in 1/72nd's of an inch. (According to Adobe thats a point, but
|
||||
points are really 1/72.27 in.)
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkRuler:lower ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkRuler:max-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkRuler:metric ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkRuler:position ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkRuler:upper ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### STRUCT GtkRulerMetric ##### -->
|
||||
<para>
|
||||
This should be points_per_unit. This is the size of the unit in 1/72nd's of an inch and has nothing to do with screen pixels.
|
||||
</para>
|
||||
|
||||
@metric_name:
|
||||
@abbrev:
|
||||
@pixels_per_unit:
|
||||
@ruler_scale:
|
||||
@subdivide:
|
||||
|
||||
<!-- ##### FUNCTION gtk_ruler_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@orientation:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_ruler_set_metric ##### -->
|
||||
<para>
|
||||
This calls the #GTKMetricType to set the ruler to units defined. Available units
|
||||
are GTK_PIXELS, GTK_INCHES, or GTK_CENTIMETERS. The default unit of measurement
|
||||
is GTK_PIXELS.
|
||||
</para>
|
||||
|
||||
@ruler: the gtkruler
|
||||
@metric: the unit of measurement
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_ruler_set_range ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@ruler:
|
||||
@lower:
|
||||
@upper:
|
||||
@position:
|
||||
@max_size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_ruler_get_metric ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@ruler:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_ruler_get_range ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@ruler:
|
||||
@lower:
|
||||
@upper:
|
||||
@position:
|
||||
@max_size:
|
||||
|
||||
|
542
docs/reference/gtk/tmpl/gtkselection.sgml
Normal file
542
docs/reference/gtk/tmpl/gtkselection.sgml
Normal file
@@ -0,0 +1,542 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Selections
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Functions for handling inter-process communication via selections
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
|
||||
<para>
|
||||
The selection mechanism provides the basis for different types
|
||||
of communication between processes. In particular, drag and drop and
|
||||
#GtkClipboard work via selections. You will very seldom or
|
||||
never need to use most of the functions in this section directly;
|
||||
#GtkClipboard provides a nicer interface to the same functionality.
|
||||
</para>
|
||||
<para>
|
||||
Some of the datatypes defined this section are used in
|
||||
the #GtkClipboard and drag-and-drop API's as well. The
|
||||
#GtkTargetEntry structure and #GtkTargetList objects represent
|
||||
lists of data types that are supported when sending or
|
||||
receiving data. The #GtkSelectionData object is used to
|
||||
store a chunk of data along with the data type and other
|
||||
associated information.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GtkWidget</term>
|
||||
<listitem><para>Much of the operation of selections happens via
|
||||
signals for #GtkWidget. In particular, if you are
|
||||
using the functions in this section, you may need
|
||||
to pay attention to ::selection_get,
|
||||
::selection_received, and :selection_clear_event
|
||||
signals.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTargetEntry ##### -->
|
||||
<para>
|
||||
A #GtkTargetEntry structure represents a single type of
|
||||
data than can be supplied for by a widget for a selection
|
||||
or for supplied or received during drag-and-drop. It
|
||||
contains a string representing the drag type, a flags
|
||||
field (used only for drag and drop - see #GtkTargetFlags),
|
||||
and an application assigned integer ID. The integer
|
||||
ID will later be passed as a signal parameter for signals
|
||||
like "selection_get". It allows the application to identify
|
||||
the target type without extensive string compares.
|
||||
</para>
|
||||
|
||||
@target:
|
||||
@flags:
|
||||
@info:
|
||||
|
||||
<!-- ##### STRUCT GtkTargetList ##### -->
|
||||
<para>
|
||||
A #GtkTargetList structure is a reference counted list
|
||||
of #GtkTargetPair. It is used to represent the same
|
||||
information as a table of #GtkTargetEntry, but in
|
||||
an efficient form. This structure should be treated as
|
||||
opaque.
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@ref_count:
|
||||
|
||||
<!-- ##### STRUCT GtkTargetPair ##### -->
|
||||
<para>
|
||||
Internally used structure in the drag-and-drop and
|
||||
selection handling code.
|
||||
</para>
|
||||
|
||||
@target:
|
||||
@flags:
|
||||
@info:
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_entry_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@target:
|
||||
@flags:
|
||||
@info:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_entry_copy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_entry_free ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_new ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@ntargets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_ref ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_unref ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@target:
|
||||
@flags:
|
||||
@info:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_table ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@targets:
|
||||
@ntargets:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_text_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@info:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_image_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@info:
|
||||
@writable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_uri_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@info:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_rich_text_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@info:
|
||||
@deserializable:
|
||||
@buffer:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_remove ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@target:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_find ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@target:
|
||||
@info:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_table_free ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_table_new_from_list ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@n_targets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_owner_set ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
@time_:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_owner_set_for_display ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@display:
|
||||
@widget:
|
||||
@selection:
|
||||
@time_:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_add_target ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
@target:
|
||||
@info:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_add_targets ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
@targets:
|
||||
@ntargets:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_clear_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_convert ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
@target:
|
||||
@time_:
|
||||
@Returns: x
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_set ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@type:
|
||||
@format:
|
||||
@data:
|
||||
@length:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_set_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@str:
|
||||
@len:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_set_pixbuf ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@pixbuf:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_pixbuf ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_set_uris ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@uris:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_uris ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@targets:
|
||||
@n_atoms:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_targets_include_image ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@writable:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_targets_include_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_targets_include_uri ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_targets_include_rich_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@buffer:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_data ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_data_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_display ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_format ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_target ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_targets_include_image ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
@writable:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_targets_include_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_targets_include_uri ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_targets_include_rich_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
@buffer:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_remove_all ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_copy ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_free ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@data:
|
||||
|
||||
|
482
docs/reference/gtk/tmpl/gtkspinbutton.sgml
Normal file
482
docs/reference/gtk/tmpl/gtkspinbutton.sgml
Normal file
@@ -0,0 +1,482 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkSpinButton
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Retrieve an integer or floating-point number from the user
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkSpinButton is an ideal way to allow the user to set the value of some
|
||||
attribute. Rather than having to directly type a number into a #GtkEntry,
|
||||
#GtkSpinButton allows the user to click on one of two arrows to increment or
|
||||
decrement the displayed value. A value can still be typed in, with the bonus
|
||||
that it can be checked to ensure it is in a given range.
|
||||
</para>
|
||||
<para>
|
||||
The main properties of a #GtkSpinButton are through a #GtkAdjustment. See the
|
||||
#GtkAdjustment section for more details about an adjustment's properties.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Using a <structname>GtkSpinButton</structname> to get an integer.</title>
|
||||
<programlisting>
|
||||
|
||||
/* Provides a function to retrieve an integer value from a GtkSpinButton
|
||||
* and creates a spin button to model percentage values.
|
||||
*/
|
||||
|
||||
gint grab_int_value (GtkSpinButton *a_spinner, gpointer user_data) {
|
||||
return gtk_spin_button_get_value_as_int (a_spinner);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
|
||||
|
||||
/* creates the spinner, with no decimal places */
|
||||
spinner = gtk_spin_button_new (spinner_adj, 1.0, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), spinner);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
return;
|
||||
}
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title>Using a <structname>GtkSpinButton</structname> to get a floating point value.</title>
|
||||
<programlisting>
|
||||
|
||||
/* Provides a function to retrieve a floating point value from a
|
||||
* GtkSpinButton, and creates a high precision spin button.
|
||||
*/
|
||||
|
||||
gfloat grab_int_value (GtkSpinButton *a_spinner, gpointer user_data) {
|
||||
return gtk_spin_button_get_value (a_spinner);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
|
||||
|
||||
/* creates the spinner, with three decimal places */
|
||||
spinner = gtk_spin_button_new (spinner_adj, 0.001, 3);
|
||||
gtk_container_add (GTK_CONTAINER (window), spinner);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
return;
|
||||
}
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>#GtkEntry</term>
|
||||
<listitem><para>retrieve text rather than numbers.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkSpinButton ##### -->
|
||||
<para>
|
||||
<structfield>entry</structfield> is the #GtkEntry part of the #GtkSpinButton
|
||||
widget, and can be used accordingly. All other fields contain private data
|
||||
and should only be modified using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkSpinButton::change-value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spinbutton: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkSpinButton::input ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spinbutton: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkSpinButton::output ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spinbutton: the object which received the signal.
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkSpinButton::value-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spinbutton: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkSpinButton::wrapped ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spinbutton: the object which received the signal.
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:adjustment ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:climb-rate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:digits ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:numeric ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:snap-to-ticks ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:update-policy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:wrap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSpinButton:shadow-type ##### -->
|
||||
<para>
|
||||
the type of border that surrounds the arrows of a spin button.
|
||||
</para>
|
||||
|
||||
<!-- ##### ENUM GtkSpinButtonUpdatePolicy ##### -->
|
||||
<para>
|
||||
|
||||
<informaltable pgwide="1" frame="none" role="enum">
|
||||
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>GTK_UPDATE_ALWAYS</entry>
|
||||
<entry>When refreshing your #GtkSpinButton, the value is always displayed.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>GTK_UPDATE_IF_VALID</entry>
|
||||
<entry>When refreshing your #GtkSpinButton, the value is only displayed if it is valid within the bounds of the spin button's #GtkAdjustment.</entry>
|
||||
</row>
|
||||
</tbody></tgroup></informaltable>
|
||||
</para>
|
||||
|
||||
@GTK_UPDATE_ALWAYS:
|
||||
@GTK_UPDATE_IF_VALID:
|
||||
|
||||
<!-- ##### ENUM GtkSpinType ##### -->
|
||||
<para>
|
||||
|
||||
<informaltable pgwide="1" frame="none" role="struct">
|
||||
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>GTK_SPIN_STEP_FORWARD,
|
||||
GTK_SPIN_STEP_BACKWARD,
|
||||
GTK_SPIN_PAGE_FORWARD,
|
||||
GTK_SPIN_PAGE_BACKWARD</entry>
|
||||
<entry>These values spin a #GtkSpinButton by the relevant values of the spin button's #GtkAdjustment.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>GTK_SPIN_HOME,
|
||||
GTK_SPIN_END</entry>
|
||||
<entry>These set the spin button's value to the minimum or maxmimum possible values, (set by its #GtkAdjustment), respectively.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>GTK_SPIN_USER_DEFINED</entry>
|
||||
<entry>The programmer must specify the exact amount to spin the #GtkSpinButton.</entry>
|
||||
</row>
|
||||
</tbody></tgroup></informaltable>
|
||||
</para>
|
||||
|
||||
@GTK_SPIN_STEP_FORWARD:
|
||||
@GTK_SPIN_STEP_BACKWARD:
|
||||
@GTK_SPIN_PAGE_FORWARD:
|
||||
@GTK_SPIN_PAGE_BACKWARD:
|
||||
@GTK_SPIN_HOME:
|
||||
@GTK_SPIN_END:
|
||||
@GTK_SPIN_USER_DEFINED:
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_configure ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@adjustment:
|
||||
@climb_rate:
|
||||
@digits:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_new ##### -->
|
||||
<para>
|
||||
Creates a new #GtkSpinButton.
|
||||
</para>
|
||||
|
||||
@adjustment: the #GtkAdjustment object that this spin button should use.
|
||||
@climb_rate: specifies how much the spin button changes when an arrow is clicked on.
|
||||
@digits: the number of decimal places to display.
|
||||
@Returns: The new spin button as a #GtkWidget.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_new_with_range ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@min:
|
||||
@max:
|
||||
@step:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_adjustment ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@adjustment:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_adjustment ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_digits ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@digits:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_increments ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@step:
|
||||
@page:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_range ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@min:
|
||||
@max:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_value_as_int ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@value:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_update_policy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@policy:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_numeric ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@numeric:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_spin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@direction:
|
||||
@increment:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_wrap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@wrap:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_set_snap_to_ticks ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@snap_to_ticks:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_update ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_digits ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_increments ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@step:
|
||||
@page:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_numeric ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_range ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@min:
|
||||
@max:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_snap_to_ticks ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_update_policy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_spin_button_get_wrap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@spin_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_INPUT_ERROR ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
|
@@ -931,7 +931,7 @@ It must return the serialized form of the content.
|
||||
</para>
|
||||
|
||||
@register_buffer: the #GtkTextBuffer for which the format is registered
|
||||
@content_buffer: the #GtkTextBuffer to serialize
|
||||
@content_buffer: the #GtkTextsBuffer to serialize
|
||||
@start: start of the block of text to serialize
|
||||
@end: end of the block of text to serialize
|
||||
@length: Return location for the length of the serialized data
|
||||
|
498
docs/reference/gtk/tmpl/gtktexttag.sgml
Normal file
498
docs/reference/gtk/tmpl/gtktexttag.sgml
Normal file
@@ -0,0 +1,498 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkTextTag
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A tag that can be applied to text in a GtkTextBuffer
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
You may wish to begin by reading the <link linkend="TextWidget">text widget
|
||||
conceptual overview</link> which gives an overview of all the objects and data
|
||||
types related to the text widget and how they work together.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Tags should be in the #GtkTextTagTable for a given #GtkTextBuffer
|
||||
before using them with that buffer.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
gtk_text_buffer_create_tag() is the best way to create tags.
|
||||
See <application>gtk-demo</application> for numerous examples.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The "invisible" property was not implemented for GTK+ 2.0.
|
||||
It is working (with minor issues) since 2.8.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTextTag ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkTextTag::event ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@texttag: the object which received the signal.
|
||||
@arg1:
|
||||
@event:
|
||||
@arg2:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### ARG GtkTextTag:accumulative-margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background-full-height ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background-full-height-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background-gdk ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:editable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:editable-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:family ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:family-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:font ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:font-desc ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:foreground ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:foreground-gdk ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:foreground-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:indent ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:indent-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:invisible ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:invisible-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:justification ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:justification-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:language ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:language-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:left-margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:left-margin-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:paragraph-background ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:paragraph-background-gdk ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:paragraph-background-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-above-lines ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-above-lines-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-below-lines ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-below-lines-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-inside-wrap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-inside-wrap-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:right-margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:right-margin-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:rise ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:rise-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:scale ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:scale-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:size-points ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:size-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:stretch ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:stretch-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:strikethrough ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:strikethrough-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:style-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:tabs ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:tabs-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:underline ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:underline-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:variant ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:variant-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:weight ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:weight-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:wrap-mode ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:wrap-mode-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ENUM GtkWrapMode ##### -->
|
||||
<para>
|
||||
Describes a type of line wrapping.
|
||||
</para>
|
||||
|
||||
@GTK_WRAP_NONE: do not wrap lines; just make the text area wider
|
||||
@GTK_WRAP_CHAR: wrap text, breaking lines anywhere the cursor can
|
||||
appear (between characters, usually - if you want to
|
||||
be technical, between graphemes, see
|
||||
pango_get_log_attrs())
|
||||
@GTK_WRAP_WORD: wrap text, breaking lines in between words
|
||||
@GTK_WRAP_WORD_CHAR: wrap text, breaking lines in between words, or if
|
||||
that is not enough, also between graphemes.
|
||||
|
||||
<!-- ##### STRUCT GtkTextAttributes ##### -->
|
||||
<para>
|
||||
Using #GtkTextAttributes directly should rarely be necessary. It's
|
||||
primarily useful with gtk_text_iter_get_attributes(). As with most
|
||||
GTK+ structs, the fields in this struct should only be read, never
|
||||
modified directly.
|
||||
</para>
|
||||
|
||||
@appearance: pointer to sub-struct containing certain attributes
|
||||
@justification:
|
||||
@direction:
|
||||
@font:
|
||||
@font_scale:
|
||||
@left_margin:
|
||||
@indent:
|
||||
@right_margin:
|
||||
@pixels_above_lines:
|
||||
@pixels_below_lines:
|
||||
@pixels_inside_wrap:
|
||||
@tabs:
|
||||
@wrap_mode:
|
||||
@language:
|
||||
@invisible:
|
||||
@bg_full_height:
|
||||
@editable:
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_get_priority ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tag:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_set_priority ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tag:
|
||||
@priority:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_event ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tag:
|
||||
@event_object:
|
||||
@event:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTextAppearance ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@bg_color:
|
||||
@fg_color:
|
||||
@rise:
|
||||
@underline:
|
||||
@strikethrough:
|
||||
@draw_bg:
|
||||
@inside_selection:
|
||||
@is_text:
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_copy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_copy_values ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src:
|
||||
@dest:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_unref ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@values:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_ref ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@values:
|
||||
@Returns:
|
||||
|
||||
|
19
docs/reference/gtk/tmpl/gtkthemes.sgml
Normal file
19
docs/reference/gtk/tmpl/gtkthemes.sgml
Normal file
@@ -0,0 +1,19 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Themes
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
163
docs/reference/gtk/tmpl/gtktipsquery.sgml
Normal file
163
docs/reference/gtk/tmpl/gtktipsquery.sgml
Normal file
@@ -0,0 +1,163 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkTipsQuery
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Displays help about widgets in the user interface
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkTipsQuery widget is a subclass of #GtkLabel which is used to display
|
||||
help about widgets in a user interface.
|
||||
</para>
|
||||
<para>
|
||||
A query is started with a call to gtk_tips_query_start_query(), usually
|
||||
when some kind of 'Help' button is pressed. The #GtkTipsQuery then grabs all
|
||||
events, stopping the user interface from functioning normally.
|
||||
Then as the user moves the mouse over the widgets, the #GtkTipsQuery displays
|
||||
each widget's tooltip text.
|
||||
</para>
|
||||
<para>
|
||||
By connecting to the "widget-entered" or "widget-selected" signals, it is
|
||||
possible to customize the #GtkTipsQuery to perform other actions when widgets
|
||||
are entered or selected. For example, a help browser could be opened with
|
||||
documentation on the widget selected.
|
||||
</para>
|
||||
<para>
|
||||
At some point a call to gtk_tips_query_stop_query() must be made in order to
|
||||
stop the query and return the interface to its normal state.
|
||||
The gtk_tips_query_set_caller() function can be used to specify a widget
|
||||
which the user can select to stop the query (often the same button used to
|
||||
start the query).
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>#GtkTooltips</term>
|
||||
<listitem><para>the object which handles tooltips.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTipsQuery ##### -->
|
||||
<para>
|
||||
The #GtkTipsQuery-struct struct contains private data only, and
|
||||
should be accessed using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkTipsQuery::start-query ##### -->
|
||||
<para>
|
||||
Emitted when the query is started.
|
||||
</para>
|
||||
|
||||
@tipsquery: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkTipsQuery::stop-query ##### -->
|
||||
<para>
|
||||
Emitted when the query is stopped.
|
||||
</para>
|
||||
|
||||
@tipsquery: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkTipsQuery::widget-entered ##### -->
|
||||
<para>
|
||||
Emitted when a widget is entered by the pointer while the query is in effect.
|
||||
</para>
|
||||
|
||||
@tipsquery: the object which received the signal.
|
||||
@widget: the widget that was entered by the pointer.
|
||||
@tip_text: the widget's tooltip.
|
||||
@tip_private: the widget's private tooltip (see gtk_tooltips_set_tip()).
|
||||
|
||||
<!-- ##### SIGNAL GtkTipsQuery::widget-selected ##### -->
|
||||
<para>
|
||||
Emitted when a widget is selected during a query.
|
||||
</para>
|
||||
|
||||
@tipsquery: the object which received the signal.
|
||||
@widget: the widget that was selected.
|
||||
@tip_text: the widget's tooltip.
|
||||
@tip_private: the widget's private tooltip (see gtk_tooltips_set_tip()).
|
||||
@event: the button press or button release event.
|
||||
@Returns: %TRUE if the query should be stopped.
|
||||
|
||||
<!-- ##### ARG GtkTipsQuery:caller ##### -->
|
||||
<para>
|
||||
The widget that starts the tips query, usually a button.
|
||||
If it is selected while the query is in effect the query is automatically
|
||||
stopped.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTipsQuery:emit-always ##### -->
|
||||
<para>
|
||||
%TRUE if the widget-entered and widget-selected signals are emitted even when
|
||||
the widget has no tooltip set.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTipsQuery:label-inactive ##### -->
|
||||
<para>
|
||||
The text to display in the #GtkTipsQuery widget when the query is not in
|
||||
effect.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTipsQuery:label-no-tip ##### -->
|
||||
<para>
|
||||
The text to display in the #GtkTipsQuery widget when the query is running
|
||||
and the widget that the pointer is over has no tooltip.
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_tips_query_new ##### -->
|
||||
<para>
|
||||
Creates a new #GtkTipsQuery.
|
||||
</para>
|
||||
|
||||
@Returns: a new #GtkTipsQuery.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tips_query_start_query ##### -->
|
||||
<para>
|
||||
Starts a query.
|
||||
The #GtkTipsQuery widget will take control of the mouse and as the mouse
|
||||
moves it will display the tooltip of the widget beneath the mouse.
|
||||
</para>
|
||||
|
||||
@tips_query: a #GtkTipsQuery.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tips_query_stop_query ##### -->
|
||||
<para>
|
||||
Stops a query.
|
||||
</para>
|
||||
|
||||
@tips_query: a #GtkTipsQuery.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tips_query_set_caller ##### -->
|
||||
<para>
|
||||
Sets the widget which initiates the query, usually a button.
|
||||
If the @caller is selected while the query is running, the query is
|
||||
automatically stopped.
|
||||
</para>
|
||||
|
||||
@tips_query: a #GtkTipsQuery.
|
||||
@caller: the widget which initiates the query.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tips_query_set_labels ##### -->
|
||||
<para>
|
||||
Sets the text to display when the query is not in effect,
|
||||
and the text to display when the query is in effect but the widget beneath
|
||||
the pointer has no tooltip.
|
||||
</para>
|
||||
|
||||
@tips_query: a #GtkTipsQuery.
|
||||
@label_inactive: the text to display when the query is not running.
|
||||
@label_no_tip: the text to display when the query is running but the widget
|
||||
beneath the pointer has no tooltip.
|
||||
|
||||
|
864
docs/reference/gtk/tmpl/gtktreemodel.sgml
Normal file
864
docs/reference/gtk/tmpl/gtktreemodel.sgml
Normal file
@@ -0,0 +1,864 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkTreeModel
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
The tree interface used by GtkTreeView
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkTreeModel interface defines a generic tree interface for use by
|
||||
the #GtkTreeView widget. It is an abstract interface, and is designed
|
||||
to be usable with any appropriate data structure. The programmer just
|
||||
has to implement this interface on their own data type for it to be
|
||||
viewable by a #GtkTreeView widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The model is represented as a hierarchical tree of strongly-typed,
|
||||
columned data. In other words, the model can be seen as a tree where
|
||||
every node has different values depending on which column is being
|
||||
queried. The type of data found in a column is determined by using the
|
||||
GType system (ie. #G_TYPE_INT, #GTK_TYPE_BUTTON, #G_TYPE_POINTER, etc.).
|
||||
The types are homogeneous per column across all nodes. It is important
|
||||
to note that this interface only provides a way of examining a model and
|
||||
observing changes. The implementation of each individual model decides
|
||||
how and if changes are made.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In order to make life simpler for programmers who do not need to write
|
||||
their own specialized model, two generic models are provided — the
|
||||
#GtkTreeStore and the #GtkListStore. To use these, the developer simply
|
||||
pushes data into these models as necessary. These models provide the
|
||||
data structure as well as all appropriate tree interfaces. As a result,
|
||||
implementing drag and drop, sorting, and storing data is trivial. For
|
||||
the vast majority of trees and lists, these two models are sufficient.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Models are accessed on a node/column level of granularity. One can
|
||||
query for the value of a model at a certain node and a certain column
|
||||
on that node. There are two structures used to reference a particular
|
||||
node in a model. They are the #GtkTreePath and the #GtkTreeIter
|
||||
<footnote>
|
||||
<para>
|
||||
Here, <abbrev>iter</abbrev> is short for <quote>iterator</quote>
|
||||
</para>
|
||||
</footnote>
|
||||
Most of the interface consists of operations on a #GtkTreeIter.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A path is essentially a potential node. It is a location on a model
|
||||
that may or may not actually correspond to a node on a specific model.
|
||||
The #GtkTreePath struct can be converted into either an array of
|
||||
unsigned integers or a string. The string form is a list of numbers
|
||||
separated by a colon. Each number refers to the offset at that level.
|
||||
Thus, the path <quote>0</quote> refers to the root node and the path
|
||||
<quote>2:4</quote> refers to the fifth child of the third node.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
By contrast, a #GtkTreeIter is a reference to a specific node on a
|
||||
specific model. It is a generic struct with an integer and three
|
||||
generic pointers. These are filled in by the model in a model-specific
|
||||
way. One can convert a path to an iterator by calling
|
||||
gtk_tree_model_get_iter(). These iterators are the primary way of
|
||||
accessing a model and are similar to the iterators used by
|
||||
#GtkTextBuffer. They are generally statically allocated on the stack and
|
||||
only used for a short time. The model interface defines a set of
|
||||
operations using them for navigating the model.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is expected that models fill in the iterator with private data. For
|
||||
example, the #GtkListStore model, which is internally a simple linked
|
||||
list, stores a list node in one of the pointers. The #GtkTreeModelSort
|
||||
stores an array and an offset in two of the pointers. Additionally,
|
||||
there is an integer field. This field is generally filled with a unique
|
||||
stamp per model. This stamp is for catching errors resulting from using
|
||||
invalid iterators with a model.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The lifecycle of an iterator can be a little confusing at first.
|
||||
Iterators are expected to always be valid for as long as the model is
|
||||
unchanged (and doesn't emit a signal). The model is considered to own
|
||||
all outstanding iterators and nothing needs to be done to free them from
|
||||
the user's point of view. Additionally, some models guarantee that an
|
||||
iterator is valid for as long as the node it refers to is valid (most
|
||||
notably the #GtkTreeStore and #GtkListStore). Although generally
|
||||
uninteresting, as one always has to allow for the case where iterators
|
||||
do not persist beyond a signal, some very important performance
|
||||
enhancements were made in the sort model. As a result, the
|
||||
#GTK_TREE_MODEL_ITERS_PERSIST flag was added to indicate this behavior.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To help show some common operation of a model, some examples are
|
||||
provided. The first example shows three ways of getting the iter at the
|
||||
location <quote>3:2:5</quote>. While the first method shown is easier,
|
||||
the second is much more common, as you often get paths from callbacks.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Acquiring a <structname>GtkTreeIter</structname></title>
|
||||
<programlisting>
|
||||
/* Three ways of getting the iter pointing to the location
|
||||
*/
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeIter parent_iter;
|
||||
|
||||
/* get the iterator from a string */
|
||||
gtk_tree_model_get_iter_from_string (model, &iter, "3:2:5");
|
||||
|
||||
/* get the iterator from a path */
|
||||
path = gtk_tree_path_new_from_string ("3:2:5");
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
|
||||
/* walk the tree to find the iterator */
|
||||
gtk_tree_model_iter_nth_child (model, &iter, NULL, 3);
|
||||
parent_iter = iter;
|
||||
gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 2);
|
||||
parent_iter = iter;
|
||||
gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 5);
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This second example shows a quick way of iterating through a list and
|
||||
getting a string and an integer from each row. The
|
||||
<function>populate_model</function> function used below is not shown, as
|
||||
it is specific to the #GtkListStore. For information on how to write
|
||||
such a function, see the #GtkListStore documentation.
|
||||
<example>
|
||||
<title>Reading data from a <structname>GtkTreeModel</structname></title>
|
||||
<programlisting>
|
||||
enum
|
||||
{
|
||||
STRING_COLUMN,
|
||||
INT_COLUMN,
|
||||
N_COLUMNS
|
||||
};
|
||||
|
||||
{
|
||||
GtkTreeModel *list_store;
|
||||
GtkTreeIter iter;
|
||||
gboolean valid;
|
||||
gint row_count = 0;
|
||||
|
||||
/* make a new list_store */
|
||||
list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_INT);
|
||||
|
||||
/* Fill the list store with data */
|
||||
populate_model (list_store);
|
||||
|
||||
/* Get the first iter in the list */
|
||||
valid = gtk_tree_model_get_iter_first (list_store, &iter);
|
||||
|
||||
while (valid)
|
||||
{
|
||||
/* Walk through the list, reading each row */
|
||||
gchar *str_data;
|
||||
gint int_data;
|
||||
|
||||
/* Make sure you terminate calls to gtk_tree_model_get(<!-- -->)
|
||||
* with a '-1' value
|
||||
*/
|
||||
gtk_tree_model_get (list_store, &iter,
|
||||
STRING_COLUMN, &str_data,
|
||||
INT_COLUMN, &int_data,
|
||||
-1);
|
||||
|
||||
/* Do something with the data */
|
||||
g_print ("Row %d: (%s,%d)\n", row_count, str_data, int_data);
|
||||
g_free (str_data);
|
||||
|
||||
row_count ++;
|
||||
valid = gtk_tree_model_iter_next (list_store, &iter);
|
||||
}
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkTreeView, #GtkTreeStore, #GtkListStore, <link linkend="gtk-GtkTreeView-drag-and-drop">GtkTreeDnd</link>, #GtkTreeSortable
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTreeModel ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkTreeModel::row-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@treemodel: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
|
||||
<!-- ##### SIGNAL GtkTreeModel::row-deleted ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@treemodel: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkTreeModel::row-has-child-toggled ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@treemodel: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
|
||||
<!-- ##### SIGNAL GtkTreeModel::row-inserted ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@treemodel: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
|
||||
<!-- ##### SIGNAL GtkTreeModel::rows-reordered ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@treemodel: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@arg3:
|
||||
|
||||
<!-- ##### STRUCT GtkTreeIter ##### -->
|
||||
<para>
|
||||
The <structname>GtkTreeIter</structname> is the primary structure for
|
||||
accessing a structure. Models are expected to put a unique integer in
|
||||
the <structfield>stamp</structfield> member, and put model-specific
|
||||
data in the three <structfield>user_data</structfield> members.
|
||||
</para>
|
||||
|
||||
@stamp: A unique stamp to catch invalid iterators
|
||||
@user_data: Model specific data
|
||||
@user_data2: Model specific data
|
||||
@user_data3: Model specific data
|
||||
|
||||
<!-- ##### STRUCT GtkTreePath ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTreeRowReference ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTreeModelIface ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@g_iface:
|
||||
@row_changed:
|
||||
@row_inserted:
|
||||
@row_has_child_toggled:
|
||||
@row_deleted:
|
||||
@rows_reordered:
|
||||
@get_flags:
|
||||
@get_n_columns:
|
||||
@get_column_type:
|
||||
@get_iter:
|
||||
@get_path:
|
||||
@get_value:
|
||||
@iter_next:
|
||||
@iter_children:
|
||||
@iter_has_child:
|
||||
@iter_n_children:
|
||||
@iter_nth_child:
|
||||
@iter_parent:
|
||||
@ref_node:
|
||||
@unref_node:
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkTreeModelForeachFunc ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@model: The #GtkTreeModel currently being iterated
|
||||
@path: The current #GtkTreePath
|
||||
@iter: The current #GtkTreeIter
|
||||
@data: The user data passed to gtk_tree_model_foreach()
|
||||
@Returns: %TRUE to stop iterating, %FALSE to continue.
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkTreeModelFlags ##### -->
|
||||
<para>
|
||||
These flags indicate various properties of a #GtkTreeModel. They are
|
||||
returned by gtk_tree_model_get_flags(), and must be static for the
|
||||
lifetime of the object. A more complete description of
|
||||
#GTK_TREE_MODEL_ITERS_PERSIST can be found in the overview of this
|
||||
section.
|
||||
</para>
|
||||
|
||||
@GTK_TREE_MODEL_ITERS_PERSIST: Iterators survive all signals emitted by the tree.
|
||||
@GTK_TREE_MODEL_LIST_ONLY: The model is a list only, and never has children
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_new_from_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_new_from_indices ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@first_index:
|
||||
@Varargs:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_to_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_new_first ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_append_index ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@index_:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_prepend_index ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@index_:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_get_depth ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_get_indices ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_get_indices_with_depth ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@depth:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_free ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_copy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_compare ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@a:
|
||||
@b:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_next ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_prev ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_up ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_down ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_is_ancestor ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@descendant:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_path_is_descendant ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@path:
|
||||
@ancestor:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@model:
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_new_proxy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@proxy:
|
||||
@model:
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_get_model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@reference:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_get_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@reference:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_valid ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@reference:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_free ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@reference:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_copy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@reference:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_inserted ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@proxy:
|
||||
@path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_deleted ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@proxy:
|
||||
@path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_row_reference_reordered ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@proxy:
|
||||
@path:
|
||||
@iter:
|
||||
@new_order:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_iter_copy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_iter_free ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@iter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_flags ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_n_columns ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_column_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@index_:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_iter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@path:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_iter_from_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@path_string:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_iter_first ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@column:
|
||||
@value:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_iter_next ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_iter_children ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@parent:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_iter_has_child ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_iter_n_children ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_iter_nth_child ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@parent:
|
||||
@n:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_iter_parent ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_string_from_iter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_ref_node ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_unref_node ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@Varargs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_get_valist ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@iter:
|
||||
@var_args:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_foreach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@model:
|
||||
@func:
|
||||
@user_data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_row_changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@path:
|
||||
@iter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_row_inserted ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@path:
|
||||
@iter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_row_has_child_toggled ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@path:
|
||||
@iter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_row_deleted ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tree_model_rows_reordered ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tree_model:
|
||||
@path:
|
||||
@iter:
|
||||
@new_order:
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="TreeWidget">
|
||||
<refentry id="TreeWidget" revision="20 Mar 2002">
|
||||
<refmeta>
|
||||
<refentrytitle>Tree and List Widget Overview</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
@@ -30,9 +30,6 @@
|
||||
<link linkend="GtkFontButton">
|
||||
<inlinegraphic fileref="font-button.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkAppChooserButton">
|
||||
<inlinegraphic fileref="appchooserbutton.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkFrame">
|
||||
<inlinegraphic fileref="frame.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
@@ -126,9 +123,6 @@
|
||||
<link linkend="GtkFileChooserDialog">
|
||||
<inlinegraphic fileref="filechooser.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkAppChooserDialog">
|
||||
<inlinegraphic fileref="appchooserdialog.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkSwitch">
|
||||
<inlinegraphic fileref="switch.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user