Compare commits

..

788 Commits

Author SHA1 Message Date
Tristan Van Berkom 78c0b1da9f Added <mime-types> and <patterns> parsing support to GtkFileFilter. 2011-01-27 16:30:15 +09:00
Tristan Van Berkom e2dfd6296d Fixed GtkCellLayout to parse <cell-packing> property text accumulatively. 2011-01-26 22:19:41 +09:00
Tristan Van Berkom 0ee8c43f8f Fixed GtkContainer to parse <packing> property text accumulatively. 2011-01-26 22:10:33 +09:00
Tristan Van Berkom db55f2e16d Changed GtkComboBoxText <items> builder parser to use g_string_append_len(). 2011-01-26 21:56:43 +09:00
Tristan Van Berkom 2f3d2128ea Changed GtkRecentFilter builder parsing to use g_string_append_len 2011-01-26 21:53:45 +09:00
Tristan Van Berkom 0054bb6936 Fix GtkRecentFilter GtkBuildable parsing to handle incomming text accumulatively 2011-01-26 21:51:01 +09:00
Tristan Van Berkom d10c862acd Fix GtkComboBoxText GtkBuildable <items> parsing to handle incomming text accumulatively 2011-01-26 21:51:01 +09:00
Tristan Van Berkom 0640d95a11 Added a line to the documentation example of GtkRecentFilter 2011-01-26 21:51:01 +09:00
Tristan Van Berkom 542533a2a5 Added GtkBuildable support for adding rules to GtkRecentFilter
Also added documentation section for this. Since the GtkRecentFilter
documentation was still living in sgml, as a side-effect I migrated these
docs to the gtkrecentfilter.[ch] sources.
2011-01-26 21:51:01 +09:00
Christian Dywan 205ee834ec State that _add_button functions return a "#GtkButton widget"
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=586635
2011-01-26 10:33:49 +01:00
Michael Natterer 3933f99ed7 gtk: add missing class padding
Sorry for this late ABI break, but the newly added style classes
definitely need padding, so I can just as well add missing padding
globally.
2011-01-25 22:29:00 +01:00
Carlos Garnacho e521158973 Make gtk_widget_get_state() only handle GtkStateType values available in 2.x
GtkStateType was generally used as an index in GtkStyle color arrays, so
bigger values will cause invalid memory accesses in widgets that are still
doing that. this was seen in focused GtkIconViews for example
2011-01-25 13:36:13 +01:00
Chao-Hsiung Liao 42b6e47fca Updated Traditional Chinese translation (Hong Kong and Taiwan) 2011-01-25 19:23:35 +08:00
Matthias Clasen 7db4bee4b6 Clarify documentation about application vs window lifecycle
https://bugzilla.gnome.org/show_bug.cgi?id=639931
2011-01-24 22:20:35 -05:00
Matthias Clasen 9be8bbc9a0 Add gtk_app_chooser_button_get/set_heading 2011-01-24 19:25:08 -05:00
Carlos Garnacho 8fdd8dbc35 Do not modify associated device for non-master devices on dispose
Only master devices must modify the associated device to separate
a pointer/keyboard pair, slave devices must only call
_gdk_device_remove_slave().

Fixes bug 639767 - password not accepted in gnome-screensaver dialog,
reported by Frederic Crozat. On VT-switch, the X server removes its
grab on HW devices, the effect on clients is that slave devices
disappear, and these were mistakenly mangling the master device
hierarchy. so gdk_device_get_associated_device() on the client
pointer wouldn't return the paired keyboard anymore.

The final effect is that gtkplug-x11 wasn't setting a keyboard to
its generated events.
2011-01-24 19:55:41 +01:00
Carlos Garnacho e3be6fc24f Unset border-width for treeview rows in default CSS
Fixes bug #640391 - Display lines between rows when window is focused.
Reported by Guillaume Desmottes.
2011-01-24 18:14:05 +01:00
Matthias Clasen 98346cc219 Avoid passing widgets around here
The style context is enough.
2011-01-24 07:46:15 -05:00
Matthias Clasen b42b47e7d3 Port gtk_draw_insertion_cursor to GtkStyleContext 2011-01-24 00:24:12 -05:00
Matthias Clasen 6619aa58b1 Kill one more unused variable 2011-01-23 23:48:32 -05:00
Matthias Clasen 3413438d37 Don't leak CursorInfo structs 2011-01-23 23:20:57 -05:00
Matthias Clasen d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Carlos Garnacho 94c4a312c1 Add extra checks for GdkDevice functions that might fail on slave devices.
Documentation bits have been added as well.
2011-01-24 02:54:38 +01:00
Carlos Garnacho 5fd5872b37 Avoid toplevel tracking on slave device after ungrab
slave devices don't have coordinates themselves, as they depend
on a master, this only changes if they have a grab in effect,
so only keep toplevel tracking enabled in such situation. Fixes
Bug #640313 - BadDevice X error when ungrabbing a SLAVE device,
noticed by Jesse van den Kieboom.
2011-01-24 02:54:00 +01:00
Matthias Clasen 454c36523a Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 18:50:09 -05:00
Matthias Clasen a12dad75a2 Split out private style context api into a private header 2011-01-23 18:29:28 -05:00
Carlos Garnacho 0cc2f93d5c Free button_state.mask after XIQueryPointer()
This function allocates the button mask, so free it after
use, or right before the next XIQueryPointer() call, as done
in gdk_x11_device_xi2_window_at_position().
2011-01-23 23:19:30 +01:00
Carlos Garnacho b2b73a349e Fix valgrind warning about uninitialized value
mods_state->effective is not being set in XIQueryPointer() currently, so
use base|latched|locked instead, effective is nothing else than a shorthand
for these ORs, and these 3 values are set correctly anytime.
2011-01-23 23:14:53 +01:00
Benjamin Otte 51290e0a57 gdk: When reffing the impl surface, ref it from the impl window
This was causing surfaces to be created with the wrong size and that
caused broken clipping.

https://bugzilla.gnome.org/show_bug.cgi?id=640195
2011-01-23 21:41:01 +01:00
Carlos Garnacho e3774b6ff2 Render check/radio buttons with border-color: @fg_color 2011-01-23 20:01:22 +01:00
Carlos Garnacho 13a3954ad4 GtkNotebook: only set/unset active flag on the tab label 2011-01-23 19:35:21 +01:00
Carlos Garnacho b3ba85a01c Simplify GTK_STATE_FLAG_FOCUSED handling in state propagation.
Just unsetting it before propagating to the children suffices.
2011-01-23 19:34:50 +01:00
Carlos Garnacho 0c7772f0cf Do not unset sensitivity mistakenly in gtk_widget_set_state_flags()
together with commit 8903615a34, this finally fixes bug #640282.
Insensitivity is handled separatedly in _gtk_widget_update_state_flags(),
but the insensitive flag is mistakenly unset afterwards if clear is TRUE
in gtk_widget_set_state_flags().
2011-01-23 19:34:44 +01:00
Carlos Garnacho a0e1fa9e77 Gtk(Toggle)Button: preserve untouched state flags when updating state.
Partly fixes bug #640282, noticed by Christian Persch. buttons were
clobbering the insensitive flag when updating their state.
2011-01-23 19:34:38 +01:00
Matthias Clasen 74f7e08811 Add a migration guide section about GdkDrawable
https://bugzilla.gnome.org/show_bug.cgi?id=640188
2011-01-23 12:27:18 -05:00
Chun-wei Fan 09244b7f1d Update Visual C++ 2008 Project Files Stuff
-Updated README.txt file in build/win32/vs9.
-Fix the gdk.vcprojin and gtk+.vsprops regarding include paths
 and copying of headers (missed header etc.)
2011-01-24 00:10:19 +08:00
Jorge González f68faa3465 Updated Spanish translation 2011-01-23 15:10:51 +01:00
Kristjan SCHMIDT 73bfc16aa2 Updated Esperanto translation 2011-01-23 13:48:41 +01:00
Kjartan Maraas db25eda122 Updated Norwegian bokmål translation 2011-01-23 11:41:44 +01:00
Aron Xu 644cc23fe0 Update Chinese (China) GTK+ po translation. 2011-01-23 08:37:09 +00:00
Matthias Clasen eab3d94a43 Expose gtk-auto-mnemonics as an Xsetting 2011-01-22 23:48:39 -05:00
Matthias Clasen 9d34a9cc65 checksettings: succeed quietly 2011-01-22 23:47:01 -05:00
Matthias Clasen 09bf05bd57 Fix alignment problems with text cell renderers
When set to PANGO_ALIGN_CENTER, text was rendered off-center
by the amount of 'free space' that the PangoLayout left (ie
the x returned by pango_layout_get_pixel_extents).
2011-01-22 23:23:46 -05:00
Yaron Shahrabani 936f74c762 Updated Hebrew translation. 2011-01-23 02:40:52 +02:00
Jorge González f60db29f82 Updated Spanish translation 2011-01-22 16:51:03 +01:00
Ivar Smolin 81fdf6619c [l10n] Updated Estonian translation 2011-01-22 11:53:00 +02:00
Federico Mena Quintero a4a2d76182 bgo#639531 - [filechooser] Handle the case where the user types a nonexistent_subfolder/file.txt
The logic was to try to switch to that nonexistent folder and thus get
an error message presented.  However, no such message actually appears,
as the file chooser tries to switch to the closest parent folder that
actually exists, without bringing up an error message --- this is done
to cope with the case of the file chooser being started with a folder
that doesn't exist anymore.

Now, we just bring up an error message directly when we detect that
the user types a subfolder name that doesn't exist.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-01-21 17:08:10 -06:00
Federico Mena Quintero 84bf984f85 bgo#640161 - Maintain map/unmap invariants in GtkFileChooserDialog
We used to explicitly map and unmap the child GtkFileChooserWidget when
mapping and unmapping the dialog, respectively.  Now that GtkWidget actually
unmaps child widgets (instead of avoiding that), we can assume that the
child GtkFileChooserWidget will be unmapped when we wanted it to be.

This fixes a warning that happened with the new GtkWidget invariant checker,
as we were mapping our child widget before calling our parent class' ::map() handler.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-01-21 15:48:39 -06:00
Federico Mena Quintero d07231cb7a bgo#626336 - Don't assume that GtkButton is activated only when a keyboard event is available
Buttons may also be activated at any time from gtk_widget_activate()
or related functions.  In that case, just do the 'show the button
as pushed for a short amount of time' trick, but don't actually
try to grab the keyboard device.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-01-21 15:48:39 -06:00
William Jon McCann 120e289f56 Use actual app name in app choosers
Instead of using a strange composite of name and generic name.

https://bugzilla.gnome.org/show_bug.cgi?id=640005
2011-01-21 15:35:52 -05:00
Tomeu Vizoso e2d42f3c4b [gi] Return value of gdk_window_new should have transfer full 2011-01-21 17:34:18 +01:00
Michael Natterer 5d3106275a gtk: no need to add GTK_STYLE_FLAG_FOCUSED to the widget's state flags
because they correctly contain that flag now if the widget has focus.
2011-01-21 15:38:52 +01:00
Carlos Garnacho 6e553324f9 Make gtk_widget_get_state_flags() avoid propagating the focused flag down the hierarchy
There is only one widget supposed to have the focused flag at a given time,
so avoid propagating the state down the hierarchy, the focused flag is now
also set in _gtk_widget_set_has_focus().
2011-01-21 15:25:29 +01:00
Michael Natterer 7fabfec533 gtk: save/restore the cairo_t around early upchaining in draw()
and don't save/restore the style context because that's the job of
each draw() implementation.
2011-01-21 15:06:43 +01:00
Michael Natterer 287a388415 gtk: remove unused "window" variable from gtk_entry_draw_frame() 2011-01-21 14:19:48 +01:00
Fridrich Štrba a79f05c7be fix win32 build after removal of the colormap debug category 2011-01-21 11:20:16 +01:00
Sebastian Pölsterl 8effa1eb0e [gi] Added missing (allow-none) annotation to gdk_device_grab 2011-01-21 10:36:07 +01:00
Matthias Clasen f941f7b123 Fix keynav issue in menu mode
Skipping insensitive and separator rows was broken in menu mode.
https://bugzilla.gnome.org/show_bug.cgi?id=639845
2011-01-20 23:40:14 -05:00
Benjamin Otte d0ba16a3b2 assistant: Fix mapped invariants
gtk_widget_verify_invariants() was complaining, now it's silent.
2011-01-21 04:42:55 +01:00
Matthias Clasen cfe909848d Avoid a warning if GtkCellView has no model 2011-01-20 22:35:09 -05:00
Matthias Clasen 46903a9100 Fix a crash during DND
https://bugzilla.gnome.org/show_bug.cgi?id=640105
2011-01-20 21:36:50 -05:00
William Jon McCann 6f4df09a04 When cancelling the app dialog return to the last item in combobox
https://bugzilla.gnome.org/show_bug.cgi?id=640011
2011-01-20 21:29:29 -05:00
Matthias Clasen 9532e96db4 Make GtkAppChooserButton work in modal context 2011-01-20 21:21:42 -05:00
Matthias Clasen a7bcb8a4d7 Add a way to set the heading of GtkAppChooserDialog
The application can probably set a better string than the default
we construct, like 'Select an application for "software" files'.
2011-01-20 20:57:47 -05:00
Benjamin Otte ec750bed0c gdk: Remove colormap debug category
We don't have colormaps anymore.
2011-01-21 02:54:09 +01:00
Benjamin Otte 7013406167 x11: Don't keep two lists of devices internally 2011-01-21 02:54:09 +01:00
Matthias Clasen 70879d345f Change the label of the GtkAppChooserDialog button
We are not "opening" an application, we are selecting it to
open a file. String change !
2011-01-20 19:59:55 -05:00
William Jon McCann bbe56c1f9a Make the show more button follow the show-other property
Instead of show-all.

https://bugzilla.gnome.org/show_bug.cgi?id=640006
2011-01-20 19:45:22 -05:00
Matthias Clasen 5b7add024d Adapt gtk_icon_info_load_symbolic to librsvg limitations too
Pointed out by Owen Taylor.
2011-01-20 19:01:57 -05:00
William Jon McCann f531787875 Don't reserve a column of space the for icons in app chooser button
In order to more consistently present the items regardless of
whether they have icons or not.
2011-01-20 15:48:00 -05:00
Johan Dahlin 56009e2226 Do not scan gtktextdisplay.h, avoids a scanner warning 2011-01-20 14:22:13 -02:00
William Jon McCann deeac8caf3 Don't use an icon for Other Applications...
We only show icons in "menus" for nouns or dynamic objects.
2011-01-20 09:36:43 -05:00
Johan Dahlin 7ad7c61678 Mark api with xlib types as skipped
Since they'd need to have boxed type to be able to work
for introspection based bindings
2011-01-20 12:12:22 -02:00
Johan Dahlin 030b5ebf3e gtksettings: Add gtk-doc to silent an annotation warning 2011-01-20 12:12:22 -02:00
Johan Dahlin 766e1d35da Correct gtk-doc syntax and add missing (transfer) 2011-01-20 12:12:22 -02:00
Johan Dahlin 1e0327f844 Use identifier-prefix instead of deprecated strip-prefix 2011-01-20 12:12:22 -02:00
Johan Dahlin b92df453c6 Remove property user_data which doesn't exist anymore 2011-01-20 12:12:22 -02:00
Pavel Holejsovsky 48ad65e1dd Bump required GObject-Introspection version to 0.10.1 2011-01-20 14:54:19 +01:00
Pavel Holejsovsky 374e76a19d [GI] Mark unintrospectable constructs as (skip)
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Pavel Holejsovsky 2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky 2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky 9b88eb356d [GI] Add missing (scope) annotations 2011-01-20 13:57:15 +01:00
Pavel Holejsovsky 3c8fc21e9b [GI] Fixes of existing incorrect annotations 2011-01-20 13:56:06 +01:00
Florian Müllner 497b66a5ab docs: Fix typo
s/gtk_builder_add_From_file/gtk_builder_add_from_file
2011-01-20 12:29:17 +01:00
Cosimo Cecchi de6580b38d gail: fix the build 2011-01-20 12:00:27 +01:00
Steve Frécinaux 3f0d330a65 [GI] Fix transfer annotation on gtk_dialog_add_button()
The transfer annotation was (transfer full) but the caller actually
doesn't own a reference of the object. This made the pygobject test suite
crash because pygobject was trying to unref the returned GtkButton
instance.

https://bugzilla.gnome.org/show_bug.cgi?id=639949
2011-01-20 11:55:38 +01:00
Laszlo Pandy 75a05621bf [GI] Add annotation (type GdkModifierType) to state attributes in many GdkEvent structs.
The state attribute is available in GdkEventMotion, GdkEventButton,
GdkEventScroll, GdkEventKey and GdkEventCrossing. This type annotation
fixes the wrapping of this attribute in the GI PyGObject bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=639929
2011-01-20 11:19:26 +01:00
Pavel Holejsovsky 9389054da2 [GI] Add (type) annotations to real types 2011-01-20 10:38:38 +01:00
Matthias Clasen b29af18a26 Add a GtkBuilder section to the tutorial 2011-01-20 01:30:34 -05:00
Matthias Clasen 99812be7d7 Be more careful with private event data
When copying allocated events, also copy the source device.
When synthesizing double or triple clicks, copy the original
button press event including device information.

https://bugzilla.gnome.org/show_bug.cgi?id=639822
2011-01-19 22:52:55 -05:00
Matthias Clasen 6869ff26f3 Make GtkBorder style properties have a non-NULL default
https://bugzilla.gnome.org/show_bug.cgi?id=639625
2011-01-19 21:24:30 -05:00
Matthias Clasen 2f7245699b Add gtk_text_view_get_cursor_locations
In GTK 3.0 it's no longer possible to e.g. pop up something
at a text view's cursor (this wasn't exactly possible before
either without including gtktextlayout, but this is a quite
special need anyway).
2011-01-19 17:01:19 -05:00
Michael Kotsarinis ba02ae72fa Updated Greek translation 2011-01-19 22:03:53 +02:00
Matthias Clasen eb7e81ddd6 Use simplesect in the tutorial
This avoids blowing up the global toc even more.
2011-01-19 14:34:08 -05:00
Jorge González 8ed7494948 Updated Spanish translation 2011-01-19 19:37:26 +01:00
Michael Kotsarinis 889dc8111b Updated Greek translation 2011-01-19 20:30:31 +02:00
Michael Kotsarinis e7e3702a22 Updated Greek translation 2011-01-19 20:24:06 +02:00
Matthias Clasen 0a5e8ce685 Mention type vs region ambiguity in the docs 2011-01-19 12:55:48 -05:00
Martin Pitt d45a0114a5 Fix linking of drawing example
Commit 80e1340e introduced using a GDK method in examples/drawing.c, so
actually link that to GDK. Fixes build failure with --as-needed linker option
and gcc 4.5.
2011-01-19 15:40:46 +01:00
Sebastian Pölsterl cbbfe48ee4 [GI] Added missing (transfer none) annotation to gtk_tree_view_get_path_at_pos 2011-01-19 15:09:05 +01:00
Trevor Saunders f710cca49d gail now provides toolkit = gail as an AtkAttribute of all gtk objects.
https://bugzilla.gnome.org/show_bug.cgi?id=598952

https://bugzilla.gnome.org/show_bug.cgi?id=638920
2011-01-19 15:39:04 +08:00
Matthias Clasen 80e1340e51 Add a drawing example to the tutorial 2011-01-18 23:59:17 -05:00
Matthias Clasen ceeaf183a1 Add a packing example to the tutorial 2011-01-18 23:59:17 -05:00
Matthias Clasen ce1244fdd7 Add a paragraph explaining events and signals 2011-01-18 23:59:17 -05:00
Carlos Garnacho 0b7496558d Make GtkCssProvider deal with widget types not being in plain CamelCase
Fixes bug #Bug 639754, reported by Kjell Ahlstedt. gtkmm doesn't
use plain CamelCase for its widget type names, so in order to
distinguish widget type names from regions in the CSS parser,
the following checks are now done:

* if it contains an uppercase letter -> widget class (that should
  also work for gtkmm)

* if it's a string compound by lowercase letters and '-' -> it's
  a region, checks have been added in gtk_style_context_add_region()
  and gtk_widget_path_iter_add_region() to ensure this.
2011-01-19 04:28:49 +01:00
Carlos Garnacho 0c5ceaf757 Set horizontal/vertical style classes to GtkRanges 2011-01-19 04:28:49 +01:00
Carlos Garnacho f430a306f7 Make GtkCheckButton/GtkRadioButton background white again 2011-01-19 04:28:49 +01:00
Carlos Garnacho 687ac4d4aa Don't displace background for spinbuttons in the theming engine
This is a leftover from the older GtkStyle code, this is handled
through CSS spacings instead.
2011-01-19 04:28:48 +01:00
A S Alam 474ed78b25 update Punjabi Translation 2011-01-19 08:40:52 +05:30
Yaron Shahrabani da27cae045 Updated Hebrew translation. 2011-01-19 01:02:39 +02:00
Pavel Holejsovsky a1c297a310 [GI] Cosmetic cleanups of annotations and doc comments
This change does not introduce any functionality change, mostly
cosmtic cleanups, like re-linebreak when introduced annotations messed
up indentation or whitespace errors fixes.
2011-01-18 17:31:59 +01:00
Pavel Holejsovsky fe372ddf5e [GI] Add missing (allow-none) annotations 2011-01-18 17:30:43 +01:00
Pavel Holejsovsky 6d5cdad56e [GI] Annotate strings holding file paths as (type filename) 2011-01-18 17:29:40 +01:00
Pavel Holejsovsky 204d1fd0a6 [GI] Make argument names in vfunc decls consistent with invoker docs 2011-01-18 17:28:35 +01:00
Pavel Holejsovsky 729c823955 [GI] Mark callbacks' context parameter with (closure) annotation. 2011-01-18 17:20:32 +01:00
Bastien Nocera 714d9bc407 GtkImage: Add "use-fallback" property
So that icon-name and GIcon type of GtkImages can use automatic
fallback names.
2011-01-18 16:14:05 +00:00
Tristan Van Berkom e6a51e4afb More accurate fix for GtkTreeMenu regression.
The previous fix rebuilds the root menu unconditionally,
this one only rebuilds the root menu if the root path
has indeed changed.

https://bugzilla.gnome.org/show_bug.cgi?id=639792
2011-01-19 00:43:08 +09:00
Sebastian Pölsterl 34b573b07c Fixed gtk_calendar_get_date annotations: Added missing (out) 2011-01-18 16:21:10 +01:00
Anders F Björklund 6095598c39 Consistently use PKG_CONFIG in macros 2011-01-18 09:55:35 -05:00
Matthias Clasen bb7662392d Don't set the default display to NULL
This was causing segfaults if DISPLAY is unset
2011-01-18 09:36:59 -05:00
Matthias Clasen fe687e760e Add testcases for opening display
More precisely, test that we can successfully fail to open
a display...
2011-01-18 09:36:24 -05:00
Martin Pitt b208b9c0e9 Fix GtkIconView GI annotations
Add the missing (out) annotations, and a missing allow-none.
2011-01-18 12:32:52 +01:00
Yaron Shahrabani ebb18e65c3 Updated Hebrew translation. 2011-01-18 12:56:57 +02:00
Matthias Clasen 64c79c15a6 Fix a combo refactor regression
https://bugzilla.gnome.org/show_bug.cgi?id=639792
2011-01-17 21:56:34 -05:00
Luca Ferretti a29b4c6a51 Fix case (s/A/a) in translatable string (Select A Folder) 2011-01-17 21:43:33 +01:00
Garrett Regier cb0fac73a5 Fix memory leak in gtk_window_group_list_windows 2011-01-17 08:23:59 -08:00
Martin Pitt 234b3b2c6f Annotate GtkIconView array arguments 2011-01-17 16:01:40 +01:00
Matthias Clasen 9f895aa3ad Make symbolic icons work again
Work around https://bugzilla.gnome.org/show_bug.cgi?id=639750
2011-01-17 09:57:35 -05:00
Matthias Clasen 77ff699226 Drop gtk-builder-convert
It will still be shipped in gtk 2.24.
2011-01-17 09:55:52 -05:00
Pavel Holejsovsky 09d395f629 Move GtkFileFilter docs inline 2011-01-17 15:27:06 +01:00
Pavel Holejsovsky 4dab3a601d Move GtkMenu docs inline 2011-01-17 15:27:04 +01:00
Pavel Holejsovsky 2bd38dc7f5 Move GtkFixed docs inline
Also remove incorrect documentation of opaque GtkFixed class struct.
2011-01-17 15:27:02 +01:00
Carlos Garnacho 2f207ca749 Make selectors with no explicit state from higher priority GtkStyleProviders override lower ones with a state.
This makes overriding information from the themes more intuitive
2011-01-17 04:44:29 +01:00
Carlos Garnacho 5f43a51a83 Make gtk_widget_get_path() also add all persistent style classes the widget has. 2011-01-17 04:44:03 +01:00
Carlos Garnacho 62fd79b224 Do not set junction sides to the entry frame in spinbuttons.
That's meant to be the outer frame, so no junction sides apply there
2011-01-17 04:43:52 +01:00
Carlos Garnacho f482d4dc89 Ensure harder a GtkStyleContext has a theming engine anytime 2011-01-17 04:43:42 +01:00
Carlos Garnacho 07e62229da Make GtkFrame propagate the "frame" style class to its header label 2011-01-17 04:43:31 +01:00
Carlos Garnacho 0e77486e91 Make GtkEntry set the style context state. 2011-01-17 04:43:23 +01:00
Carlos Garnacho e28a2695ac Improve progressbars theming.
Make progressbar itself have an outset border, and improve spacings.
2011-01-17 04:43:16 +01:00
Daniel Mustieles c444ccf531 Updated Spanish translation 2011-01-16 21:25:10 +01:00
Daniel Mustieles 477ff06b25 Updated Spanish translation 2011-01-16 21:24:39 +01:00
Daniel Mustieles 837583eb36 Updated Spanish translation 2011-01-16 19:30:49 +01:00
Fran Diéguez 6893aa9c25 Updated Galician translations 2011-01-16 17:14:23 +01:00
Tristan Van Berkom d9ebdb7610 Plugged memory leak in gdk_x11_device_manager_xi2_list_devices.
This was simply a misplaced 'g_list_copy()'.
2011-01-16 22:47:12 +09:00
Tristan Van Berkom a530f88234 Plugged leaking PangoFontDescriptions in gtk_modifier_style_set_font(). 2011-01-16 21:14:00 +09:00
Tristan Van Berkom 9438107bff Plugged leak in gtkcssprovider.c
SelectorStyleInfo structs were never freed.
2011-01-16 20:52:43 +09:00
Tristan Van Berkom c35fb706bd Plugged memory leak in gtk_style_finalize (destroy the ->background[] patterns). 2011-01-16 20:17:52 +09:00
Tristan Van Berkom 4a5c435e9a Plugging memory leak in GtkCellArea (free ->style_detail at finalize time). 2011-01-16 18:15:57 +09:00
Ivar Smolin f793626a53 [l10n] Updated Estonian translation 2011-01-16 10:25:57 +02:00
Ivar Smolin 27e8df0c2c [l10n] Updated Estonian translation 2011-01-16 10:25:22 +02:00
Martin Pitt 85fe2ce17f Gtk{List,Tree}Store: Fix GI array annotations 2011-01-15 15:26:12 -06:00
Inaki Larranaga Murgoitio 9f78fd22bc Updated Basque language 2011-01-15 18:17:38 +01:00
Javier Jardón 46f0994417 docs: gtkwidget: Add some "Since: 3.0" 2011-01-15 16:43:49 +00:00
Tristan Van Berkom ac61edb9fc Avoid calling gtk_widget_is_visible(NULL) in _gtk_notebook_get_tab_flags().
The tab can be NULL here when GtkNotebook:show-tabs is FALSE.
2011-01-15 21:34:49 +09:00
Kjartan Maraas fed55eaf36 Updated Norwegian bokmål translation 2011-01-15 12:08:53 +01:00
Kjartan Maraas 77ad5096a9 Add missing files 2011-01-15 12:08:53 +01:00
Kjartan Maraas 4392c0e9b5 Updated Norwegian bokmål translation 2011-01-15 12:08:53 +01:00
Matthias Clasen 22876d789c Fix a typo 2011-01-15 00:39:29 -05:00
Matthias Clasen cc92d6da03 Fix a typo 2011-01-15 00:16:51 -05:00
Matthias Clasen ccc3d874ef Add accessors for GtkRange::round-digits
Patch by Christian Dywan,
https://bugzilla.gnome.org/show_bug.cgi?id=351755
2011-01-15 00:08:39 -05:00
Matthias Clasen 8e420bca02 Unify handling of prelighted icons
Make GtkEntry use gtk_render_icon_pixbuf for rendering the
icons, and move the working icon prelighting code from GtkEntry
to GtkThemingEngine.

https://bugzilla.gnome.org/show_bug.cgi?id=636691
2011-01-14 23:59:22 -05:00
Chun-wei Fan e9319c6182 Merge ssh://git.gnome.org/git/gtk+ 2011-01-15 12:42:52 +08:00
Matthias Clasen 867dc0bd0d Avoid a critical warning during tab DND
https://bugzilla.gnome.org/show_bug.cgi?id=639380
2011-01-14 21:15:06 -05:00
Matthias Clasen d790fd4fdd Update information about visuals
Based on a patch by Jasper St. Pierre,
https://bugzilla.gnome.org/show_bug.cgi?id=639520
2011-01-14 20:45:53 -05:00
Matthias Clasen 8f6a8441a2 Implement the editing-canceled property in GtkCellEditableEventBox
https://bugzilla.gnome.org/show_bug.cgi?id=639455
2011-01-14 20:24:26 -05:00
Matthias Clasen 1cba79677c Add --enable-gtk2-dependency option
This can be used to suppress building of gtk-update-icon-cache
in favor of using a preexisting version. Based on a patch by
Colin Walters,
https://bugzilla.gnome.org/show_bug.cgi?id=639471
2011-01-14 20:01:05 -05:00
Matthias Clasen d8d31c60ca Drop never-updated revision attributes 2011-01-14 19:35:34 -05:00
Matthias Clasen abc8ac1a8b Move GtkSelection docs inline
At the same time, move private selection API to gtkselectionprivate.h
2011-01-14 19:20:56 -05:00
Matthias Clasen 00a3685f41 Move GtkPrintJob docs inline 2011-01-14 18:39:01 -05:00
Matthias Clasen 6cf78a12c1 Move GtkTextTag docs inline 2011-01-14 17:49:48 -05:00
Matthias Clasen 06864ba656 Move GtkMenuShell docs inline 2011-01-14 16:59:29 -05:00
Sahran 35644cab9e Added UG translation 2011-01-14 22:46:35 +01:00
Fridrich Štrba 708357001a make the ms-windows engine compile again 2011-01-14 19:49:31 +01:00
Michael Natterer 6f4adebcef gtk: render GtkEventBox' background in the right state 2011-01-14 16:56:50 +01:00
Fran Diéguez d0f51577a4 Updated Galician translations 2011-01-14 16:49:43 +01:00
Matthias Clasen e62b68fe62 Add EXPORT_PACKAGES for the girs
This connects the girs to the pc file names.

https://bugzilla.gnome.org/show_bug.cgi?id=635287
2011-01-14 09:46:21 -05:00
Matthias Clasen 9d14edf760 Add --include-uninstalled for the gdk gir
https://bugzilla.gnome.org/show_bug.cgi?id=635287
2011-01-14 09:44:10 -05:00
Matthias Clasen 8ba35bc381 Add --warn-all to introspection scanner args
https://bugzilla.gnome.org/show_bug.cgi?id=635287
2011-01-14 09:32:26 -05:00
Colin Walters 890e4511aa GtkContainer: make "handle_border_width" member private
Otherwise in introspection we get a naming conflict between the
structure member and the method.

http://bugzilla.gnome.org/show_bug.cgi?id=639325
2011-01-14 09:29:33 -05:00
Matthias Clasen 92c8a3e0e1 Remove an overlooked instance of gdk drawing api 2011-01-13 23:42:12 -05:00
Matthias Clasen 985b0e57b2 Add a migration guide section about multiple backends 2011-01-13 23:40:47 -05:00
Matthias Clasen 04248fbd39 Update some outdated content in the question index
Based on a patch by Jasper St. Pierre
https://bugzilla.gnome.org/show_bug.cgi?id=639494
2011-01-13 23:10:25 -05:00
Matthias Clasen b23839c7a5 Add an example for custom css 2011-01-13 22:19:58 -05:00
Matthias Clasen 9d85d87f05 Move GtkMenuBar docs inline
And remove some outdated content.
2011-01-13 22:11:22 -05:00
Matthias Clasen df78c9ee66 Add some doc details
Mention symbolic color names in gtk_icon_info_load_symbolic_for_context()
2011-01-13 21:38:08 -05:00
Cosimo Cecchi 7e29fc5b42 gtkshow: don't call _get_display() on a NULL GdkScreen
gtk_show_uri() is documented to accept a NULL screen to mean the default
one. Calling gdk_screen_get_display() on a NULL object will cause
segfaults.
2011-01-13 16:18:59 +01:00
Tristan Van Berkom 04494c5df0 Making GtkCellLayout "no cell area yet" warning a g_critical instead. 2011-01-13 23:02:34 +09:00
Tristan Van Berkom 66593ef569 Added warnings to GtkCellLayout when api is accessed and there is no GtkCellArea to operate on. 2011-01-13 21:35:02 +09:00
Ivar Smolin eaca2ea5e8 [l10n] Updated Estonian translation 2011-01-13 12:40:46 +02:00
Mahyar Moghimi cbd313c237 correcting on off in gtkswitch according to bugreport:638232 2011-01-13 11:35:44 +03:30
Tristan Van Berkom 89eb869ecf Avoid crashes calling gdk_window_enable_synchronized_configure() on an offscreen window.
Just added gdk_offscreen_window_do_nothing() noop stub in that slot.
2011-01-13 17:03:14 +09:00
Matthias Clasen 290c34b232 Try harder to find a good display name for paper sizes
This was requested in https://bugzilla.gnome.org/show_bug.cgi?id=639186.
Also add some tests for GtkPaperSize.
2011-01-12 22:30:08 -05:00
Matthias Clasen 8709c86944 bump version 2011-01-12 19:56:22 -05:00
Matthias Clasen 03344207b9 Update NEWS 2011-01-12 19:06:48 -05:00
Matthias Clasen 76de8aa790 Move GtkTreeModel docs inline 2011-01-12 18:50:45 -05:00
Matthias Clasen 349c3a8839 Move enum docs inline
Based on a patch by Garrett Regier
https://bugzilla.gnome.org/show_bug.cgi?id=617324
2011-01-12 18:50:45 -05:00
Thomas Wood 0c6251d0d2 switch: allow the user to toggle the switch by clicking on the handle 2011-01-12 18:50:45 -05:00
Inaki Larranaga Murgoitio 49a6e0c2b6 Updated Basque language 2011-01-12 23:20:26 +01:00
Inaki Larranaga Murgoitio e3304fe130 Updated Basque language 2011-01-12 23:18:55 +01:00
Inaki Larranaga Murgoitio 6a5d9b0bec Updated Basque language 2011-01-12 23:09:27 +01:00
Carlos Garnacho e2e7075533 Redo patch in efae64b (Set vertical/horizontal class...)
Add a _gtk_orientable_set_style_classes() function so all
orientation changes to style happen in a single place.
2011-01-12 22:58:41 +01:00
Christian Persch b6464b6c0a Add target version handling to gtk-builder-convert
When converting to gtk3, replace GtkComboBoxEntry with GtkComboxBox
has-entry=True, and remove the has-separator property from GtkDialogs.

Bug #639327.
2011-01-12 22:45:57 +01:00
Carlos Garnacho efae64be66 Set vertical/horizontal class on all widgets overriding GtkOrientable::orientation
This is so g_object_set() on that property leaves widgets' style in
a meaningful state. Fully fixes bug 639157.
2011-01-12 22:28:43 +01:00
Carlos Garnacho 8ad724ebcc Deal with the abscence of horizontal/vertical class when rendering an expander 2011-01-12 22:07:34 +01:00
Carlos Garnacho 26db0b7276 Make GtkMenu(Shell) use GtkStyleContext
The default CSS has also been modified to theme these sensibly
2011-01-12 20:55:36 +01:00
Carlos Garnacho 4b61182521 Make GtkCheckMenuItem use GtkStyleContext 2011-01-12 20:54:35 +01:00
Carlos Garnacho b7caeb7adb Fix rendering glitch in menu radiobuttons
The arcs needed a new subpath.
2011-01-12 20:54:35 +01:00
Carlos Garnacho f4714ccae2 Make GtkTearoffMenuItem use GtkStyleContext 2011-01-12 20:54:35 +01:00
Carlos Garnacho 7f5349b75a Make GtkImageMenuItem use GtkStyleContext 2011-01-12 20:54:34 +01:00
Carlos Garnacho c42f20efe3 Make GtkMenuItem use GtkStyleContext 2011-01-12 20:54:34 +01:00
Carlos Garnacho 6ff7a8daf2 Make GtkToolItemGroup use GtkStyleContext 2011-01-12 20:54:34 +01:00
Tristan Van Berkom 3492b1567d Fixed assertions in gtk_cell_renderer_get_aligned_area().
The assertions here were not accounting for the possiblility of
zero width visible renderers that are aligned completely to the
right (i.e. renderers with no content set for a said row).
2011-01-13 01:16:19 +09:00
Guillaume Desmottes aa1f58b731 _gtk_cell_area_set_cell_data_func_with_proxy: set the proxy when creating a new CellInfo (#637965) 2011-01-12 14:33:27 +01:00
Benjamin Otte 2b0b08a861 stylecontext: Protect the cairo contexts with cairo_save/cairo_restore()
We don't want theme engines to mess up the context we are currently
drawing with.
2011-01-12 11:40:09 +01:00
Chun-wei Fan f79266092b Update MSVC 2008 Project Files
-Update the project files to simplify them a bit after the seperation of
 GDK-Pixbuf (move GDK-Pixbuf includes into the property sheet, move the
 linking of Cairo/Pango/PangoCairo into the property sheet)--this is for
 all DLL/EXE Projects (GDK/GTK/gtk-demo)

-Update the GDK-Win32 project as the source files have changed
 significantly (especially as GDK3 was not compilable on Windows for a
 while--thanks to Hans Breuer for the help in the process-Bug 639127)

-Made up for missed headers in the "install" stage and removed the removed
 headers in the property sheet

-Updated GTK+ .def file generation as an extra macro is needed for that

-Updated gdk/Makefile.am for the generation of gdk.vcproj from gdk.vcprojin
2011-01-12 18:36:05 +08:00
Chun-wei Fan 479a08054b Update MSVC 2008 Project Files
-Update the project files to simplify them a bit after the seperation of
 GDK-Pixbuf (move GDK-Pixbuf includes into the property sheet, move the
 linking of Cairo/Pango/PangoCairo into the property sheet)--this is for
 all DLL/EXE Projects (GDK/GTK/gtk-demo)

-Update the GDK-Win32 project as the source files have changed
 significantly (especially as GDK3 was not compilable on Windows for a
 while--thanks to Hans Breuer for the help in the process-Bug 639127)

-Made up for missed headers in the "install" stage and removed the removed
 headers in the property sheet

-Updated GTK+ .def file generation as an extra macro is needed for that

-Updated gdk/Makefile.am for the generation of gdk.vcproj from gdk.vcprojin
2011-01-12 18:32:57 +08:00
Khaled Hosny 6d6b38cf78 Updated Arabic translation 2011-01-12 09:11:04 +02:00
Khaled Hosny 908b419260 Updated Arabic translation 2011-01-12 08:56:41 +02:00
Fridrich Štrba 2f3c3ca7d3 Fix windows build from git clean and a minor linking issue 2011-01-11 22:45:40 +01:00
Yaron Shahrabani f0b05328a6 Updated Hebrew translation 2011-01-11 20:40:36 +02:00
Florian Müllner 5616ad0e19 [build] Add gtktextattributes.h
Commit 7fae37ecd5 factored out GtkTextAttributes, but did not add
the new header to the build system.
2011-01-11 18:10:26 +01:00
Fridrich Štrba a606ea62a1 Fix win32 build 2011-01-11 17:28:37 +01:00
Benjamin Otte 7e33c009a0 gdk: Fix typo
<mclasen>: Comapny: kludge, with a k
2011-01-11 17:06:49 +01:00
Benjamin Otte b05f54ff73 x11: Add --c-include for gdk/gdkx.h to Gdk-X11 gir build 2011-01-11 16:46:59 +01:00
Benjamin Otte ebd5f8b10e gdk: Put stub gdkx.h into gdk/ dir
This is so we can include gdk/gdkx.h from inside GTK code.
2011-01-11 16:46:59 +01:00
Benjamin Otte 654aca5ccd gdk: Don't build X11 stuff into Gdk.gir 2011-01-11 16:46:59 +01:00
Benjamin Otte 268efbc0ef gdk: Add --c-include gdk/gdk.h to Gir build. 2011-01-11 16:46:59 +01:00
Benjamin Otte a25813cc24 gtk: Add --c-include to gir build 2011-01-11 16:46:59 +01:00
Benjamin Otte b30b33998f gtk: Prefix GtkCellAreaBoxContext symbols with an underscore
They are private.
2011-01-11 16:46:59 +01:00
Benjamin Otte 8899ab3f91 gtk: Remove private GtkCellAreaBoxContext symbols from gtk.symbols 2011-01-11 16:46:59 +01:00
Benjamin Otte 04c773c94d gtk: Rename private header to private name
gtk/gtkcellareaboxcontext.h -> gtk/gtkcellareaboxcontextprivate.h
2011-01-11 16:46:59 +01:00
Benjamin Otte b43bafff52 textview: Move text attributes code into its own .c file 2011-01-11 16:46:59 +01:00
Benjamin Otte 7fae37ecd5 textview: Move GtkTextAttributes to its own header 2011-01-11 16:46:59 +01:00
Benjamin Otte b40dc528f6 tests: Remove useless calls to gtk_widget_style_attach() 2011-01-11 16:46:59 +01:00
Christian Dywan 35d361fce9 2 to 3 migration should say gtk_widget_set_visual 2011-01-11 16:36:19 +01:00
Milan Bouchet-Valat 44da5a0094 Improve docs about GtkStyleContext padding/border/margin
GTK_STYLE_PROPERTY_BORDER_WIDTH is of style GtkBorder, not gint.

Also make it clearer what the definition and ordering of these 3
properties is. Reorder them in the header to be more logical.
2011-01-11 12:28:54 +01:00
Cosimo Cecchi 27ee3fec96 numerableicon: fix a typo in the gtk-doc annotation 2011-01-11 10:55:42 +01:00
Javier Jardón df2a4a6131 docs: question_index: Do not reference deprecated API 2011-01-11 09:37:05 +00:00
Javier Jardón 44f16bfe6d docs: question_index: GtkComboBoxEntry no longer exists 2011-01-11 09:35:15 +00:00
Javier Jardón 1a79d9939c docs: question_index: Some documentation fixes 2011-01-11 09:31:08 +00:00
Matthias Clasen 62ba858582 Bump version 2011-01-10 23:36:47 -05:00
Matthias Clasen 6d9191f601 Revert accidental gtk.symbols changes 2011-01-10 22:59:13 -05:00
Matthias Clasen a9a7eca7f3 Update NEWS 2011-01-10 22:19:12 -05:00
Sébastien Granjoux 8f6cd8d86d Fix bgo #638017 Crash in gtk_text_view_set_tabs() 2011-01-10 21:07:32 -05:00
Matthias Clasen 9b752aee1a Don't use deprecated style api 2011-01-10 20:33:13 -05:00
Carlos Garnacho 48a4f88ab1 Mark orientable widgets with the vertical/horizontal css classes
This can be used to theme widgets differently depending on the
orientation. Bug 639157, reported by Christian Dywan.
2011-01-10 23:53:29 +01:00
Carlos Garnacho 529fcc84cf Add missing CSS class defines to gtk3-sections.txt 2011-01-10 23:52:47 +01:00
Carlos Garnacho 4c4df23d12 GtkThemingEngine: Fix handles rendering
The wrong class was being used, so the theming engine didn't
match it properly.
2011-01-10 23:52:36 +01:00
Carlos Garnacho d5b0ccacce GtkStyleContext: Do not cancel possibly unstarted transitions
It might happen that this overcautious check is done on an animation
that didn't have time to gather invalidation rectangles.
2011-01-10 23:52:21 +01:00
Carlos Garnacho 733cb5e43d Cleanup leftover code in gtkplug-x11
This code was part of the GdkDeviceManagerCore hack
2011-01-10 23:52:02 +01:00
Carlos Garnacho 42ad651914 Mark gtk_widget_style_attach() as deprecated.
This isn't needed anymore.
2011-01-10 23:51:48 +01:00
Carlos Garnacho e426f76e57 Fix compiler warning. 2011-01-10 23:51:14 +01:00
Carlos Garnacho fa2bfd93f8 Add gtk_widget_set_device_enabled()
This function is a more convenient variant than
gtk_widget_set_device_events(), as it will

1) perform changes down a widget hierarchy, to
all windows.
1) use the same event mask than gdk_window_get_events()
2011-01-10 23:01:02 +01:00
Carlos Garnacho c94912afd5 GtkTextUtil: Fix typo
Use the right "context" object around in GtkStyleContext methods.
2011-01-10 23:01:01 +01:00
Paolo Borelli a67507a53e Set the proper css class when getting attributes. 2011-01-10 21:58:29 +01:00
Hans Breuer 0a9abb0222 [portability] Use G_PI rather than M_PI 2011-01-10 21:39:34 +01:00
Hans Breuer f605d3d698 Bug 639127 - Add missing gdkdisplaymanager-win32.c 2011-01-10 21:39:33 +01:00
Carlos Garnacho de36dda925 Add gtk_style_context_scroll_animations()
This function will be needed in widgets like GtkTreeView,
since gdk_window_scroll() doesn't trigger the usual
mechanisms to update the invalidation area, this function
is needed together with it.
2011-01-10 20:49:41 +01:00
Carlos Garnacho 162380fca5 Make GtkCalendar use GtkStyleContext 2011-01-10 20:49:34 +01:00
Carlos Garnacho 12944d9c23 Do not set any padding for scrolled window children. 2011-01-10 20:49:27 +01:00
Carlos Garnacho d9dab98ad6 GtkCssProvider: enable parsing negative GtkBorders
this can be used as in regular CSS under some situations,
so child items overlap the parent element's border.
2011-01-10 20:49:14 +01:00
Carlos Garnacho 2ec40cac8c Make GtkTextUtil use GtkStyleContext. 2011-01-10 20:48:59 +01:00
Paolo Borelli c5a8584c3e CSS styles for the selection in a TextView.
https://bugzilla.gnome.org/show_bug.cgi?id=639106
2011-01-10 18:52:35 +01:00
Paolo Borelli 2290ec6bd8 Port GtkTextDisplay to StyleContext.
Use the new StyleContext and StateFlags to draw the text

https://bugzilla.gnome.org/show_bug.cgi?id=639105
2011-01-10 18:52:35 +01:00
Matthias Clasen 845d864a51 add gtknumerable.c to POTFILES.in 2011-01-10 12:06:31 -05:00
Yaakov Selkowitz 5caa2b58cb Fix remaining usage of g[dk]ktargetlib.
This is a follow-up to commit 07d49ee56a.

https://bugzilla.gnome.org/show_bug.cgi?id=639047
2011-01-10 11:53:26 -05:00
Matthias Clasen efd0e6ec1f Add a setter for GtkWindow.has_user_ref_count
This is needed for some language bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=638880
2011-01-10 11:49:06 -05:00
Matthias Clasen 061d48b68d More doc build fixes
Grr, our mixture of xml and plain text in long descriptions is
a mess.
2011-01-10 10:59:50 -05:00
Matthias Clasen f758385353 Fix doc syntax 2011-01-10 09:47:09 -05:00
Javier Jardón 63bb0c73bc build: Use mkdir_p instead mkinstalldirs
As we don't use mkinstalldirs, $(mkinstalldirs) is simply an
alias for $(mkdir_p)
2011-01-10 13:55:29 +00:00
Tristan Van Berkom 3f911b2516 Fixed GtkEntry to report the proper default value for "primary/secondary-icon-activatable" 2011-01-10 22:26:46 +09:00
Tristan Van Berkom 2dafbba921 Added GtkBuildable support for specifying <items> in GtkComboBoxText. 2011-01-10 18:48:07 +09:00
Tristan Van Berkom cfecb6bf10 Added GtkBuildable support to add "tag" children to GtkTextTagTable. 2011-01-10 18:48:07 +09:00
Tristan Van Berkom 03975b8e74 Added GtkBuilder support for "menu" child type of GtkMenuToolButton 2011-01-10 18:48:07 +09:00
Tristan Van Berkom 1fa280938b Fixed GtkCellAreaBox to not allocate invisible cells.
This was already done for the most part but not taken care
of for single cell groups (which is the most common case).
2011-01-10 18:47:55 +09:00
Tristan Van Berkom 34a7dbae3b Fixed GtkCellArea to never activate/start editing insensitive cells.
Included extension to tests/testtreeedit to show this is working properly.
2011-01-10 17:58:57 +09:00
Carlos Garnacho 5c3b49ab14 Ensure GtkStyleContext is generated on gtk_widget_render_icon_pixbuf()
This fixes some warnings seen when this is called early
on non yet styled widgets.
2011-01-10 03:50:02 +01:00
Carlos Garnacho 6f3706ac28 Make GtkViewport use GtkStyleContext 2011-01-10 03:50:02 +01:00
Carlos Garnacho e6277d3b82 Add gtk_style_context_cancel_animations()
This function takes a region ID and cancels all animations
on or beneath that region (as in push/pop_animatable_region).

First user of this is GtkWidget itself, so unmapped widgets
have looping animations cancelled. Fixes bug #638119, reported
by Jesse van den Kieboom.
2011-01-10 03:50:01 +01:00
Carlos Garnacho 3dd838fe76 Make GtkLayout use GtkStyleContext 2011-01-10 03:50:01 +01:00
Carlos Garnacho 18502518f3 Make GtkImage use GtkStyleContext 2011-01-10 03:50:00 +01:00
Carlos Garnacho 4e73267325 Make GtkPrintUnixDialog use GtkStyleContext. 2011-01-10 03:50:00 +01:00
Carlos Garnacho 6fae7c9fa7 Make GtkFontSelection use GtkStyleContext 2011-01-10 03:50:00 +01:00
Carlos Garnacho 2f6514ce34 Make GtkHSV use GtkStyleContext
two custom classes replace the light/dark focus detail strings,
it doesn't make much sense to have a GTK_STYLE_CLASS_* for that.
2011-01-10 03:49:59 +01:00
Carlos Garnacho 27c5cc88f8 Make GtkColorSelection use GtkStyleContext 2011-01-10 03:49:59 +01:00
Carlos Garnacho 455c31d815 Make GtkColorButton use GtkStyleContext 2011-01-10 03:49:59 +01:00
Carlos Garnacho e0e36b621f Update _gtk_button_paint() arguments to GtkStyleContext
The detail strings weren't in use anymore, and the state
argument is now a GtkStateFlags. GtkToggleButton has been
updated as well.
2011-01-10 03:49:59 +01:00
Carlos Garnacho f506fc3e93 Remove recent GtkStyle usage in GtkWindow
GtkStyleContext API is used instead.
2011-01-10 03:49:59 +01:00
Fran Diéguez e94b515171 Updated Galician translations 2011-01-10 00:03:19 +01:00
Paolo Borelli ab656b3f7a Obtain the fg color from the renderer
prepare_run must have been called before draw_shape, so we can avoid
fiddling the the (deprecated) style and state and just use the color
alredy set on the renderer.

https://bugzilla.gnome.org/show_bug.cgi?id=639079
2011-01-09 21:59:50 +01:00
Paolo Borelli fadca187f2 Remove stipple attributes
GtkTextView does not support them anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=639030
2011-01-09 21:59:50 +01:00
Paolo Borelli 12c4730e6f Small cleanup in gailtextview code.
Fold gail_misc_add_to_attr_set into the only function calling it, which
avoids a useless big "switch" and results in much less code.

https://bugzilla.gnome.org/show_bug.cgi?id=639030
2011-01-09 21:59:50 +01:00
Yaron Shahrabani 89c8e2af2d Updated Hebrew translation 2011-01-09 21:04:58 +02:00
Fran Diéguez e0d393dec8 Updated Galician translations 2011-01-09 16:42:40 +01:00
Milan Bouchet-Valat f9e685e5c0 [Doc] gtk_symbolic_color_resolve()'s props arg can be NULL
Document this behavior and add annotations.
2011-01-08 17:30:45 +01:00
Jorge González b761cadacc Updated Spanish translation, fixes bug #638991 2011-01-08 13:49:31 +01:00
Javier Jardón cc0a65cb56 docs: Fix typo in GtkWidget geometry-management documentation
Reported by Andrew Cowie in
https://bugzilla.gnome.org/show_bug.cgi?id=638963
2011-01-08 10:56:59 +01:00
Tristan Van Berkom 1ff8df1e18 Adding missing gtk-doc annotations.
GtkProgressBar:show-text, GtkScrolledWindow:min-content-width/height
are new properties in 3.0.
2011-01-08 18:46:46 +09:00
Bruce Cowan 094d4c81be Updated British English translation 2011-01-07 23:25:18 +00:00
Carlos Garnacho 29b4baea97 Translate KeyPress/KeyRelease in gtkplug-x11
This makes XEmbed work properly again. Only event->key.group
and is_modifier are left blank at the moment. Exposing the
necessary XKB bits should be considered, but it's not urgent
for the current usecases.
2011-01-07 22:07:52 +01:00
Kristian Rietveld 4ed781778d Introduce gtk_tree_view_is_blank_at_pos()
This function is useful to figure out whether the tree view is "blank"
at a given location.  For such locations you might want to popup a
custom popup menu, clear the current selection or start rubber banding.
In the future, we are planning on updating GtkTreeView's user
interactions to take advantage of this new function.

Part of bug 350618.
2011-01-07 15:38:06 +01:00
Kristian Rietveld 688d053436 Fix gtk_tree_view_column_cell_get_position() 2011-01-07 15:38:06 +01:00
Andika Triwidada c40c4a45e5 Updated Indonesian translation 2011-01-07 20:38:52 +07:00
Matthias Clasen be632558dc Document that GtkModuleInit doesn't receive argv anymore 2011-01-07 08:12:07 -05:00
Ignacio Casal Quinteiro 8de4661d80 Set the style for .view so i.e the GtkTextView gets the right style. 2011-01-07 11:35:40 +01:00
Tristan Van Berkom da41937b42 Removed special casing code in GtkCellLayout in favor of default implementation.
The fact that GtkCellLayout was checking "if (gtk_cell_layout_get_area (layout))"
and executing code contitionally from the apis instead of simply falling
back to the default implementation for these things was causing problems
in language bindings such as gtkmm... Regardless, the implementation
is cleaner this way too.
2011-01-07 18:08:51 +09:00
Tristan Van Berkom 685fe29473 Fixed documentation of gtk_cell_area_set_focus_cell(). 2011-01-07 16:21:51 +09:00
Emilio Pozuelo Monfort ec15c405cf Support disabling X11 extensions
Based on a patch from Cyril Brulebois <kibi@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=612918
2011-01-07 01:30:11 +00:00
Fran Diéguez 7fc09ee135 Updated Galician translations 2011-01-07 00:11:51 +01:00
Matthias Clasen aead0b04df Forgotten documentation fix 2011-01-06 11:27:38 -05:00
Matthias Clasen 7f58c57606 Bump version 2011-01-06 11:27:15 -05:00
Matthias Clasen 6cdb6255af More documentation fixes 2011-01-06 09:44:08 -05:00
Matthias Clasen f35c3fd5f7 Undoccommentize gtktreemenu.c 2011-01-06 09:00:53 -05:00
Matthias Clasen 6619ac35e3 Documentation fixes 2011-01-06 09:00:53 -05:00
Matthias Clasen c396c52327 Documentation fixes 2011-01-06 08:12:01 -05:00
Matthias Clasen dc3d70b4ec Add sufficient deps to make building from 'git clean' work 2011-01-06 07:44:44 -05:00
Matthias Clasen 5984fa0073 Fix introspection annotation syntax 2011-01-06 07:44:19 -05:00
Kizito Birabwa 2f09f800cc Updated Luganda translation 2011-01-06 10:23:59 +01:00
Matthias Clasen 7b88b29763 Add appchooser docs 2011-01-06 02:07:35 -05:00
Matthias Clasen 80a11b7483 Documentation polishing 2011-01-06 01:13:50 -05:00
Matthias Clasen f2cde4cf3b Move the GtkApplication example to the right place 2011-01-06 01:13:50 -05:00
Matthias Clasen 39d0a8ac47 Update NEWS some more 2011-01-06 01:13:50 -05:00
Tristan Van Berkom 44a9b1c35e Fixed statement in gtkwindow.c when toplevelness changes.
Fixed a typo when checking if the heirarchy toplevel is a toplevel
before firing the hierarchy-changed signal.
2011-01-06 14:39:41 +09:00
Tristan Van Berkom a28295a742 Dont show the GtkWindow when removing it from a parent and becomming a toplevel
Showing the window causes it to try to grab focus, this causes problems
when embedded toplevels run through dispose cycles.
2011-01-06 14:39:41 +09:00
Tristan Van Berkom b8c8f2ccb1 Fixed conflict while rebasing master. 2011-01-06 14:39:41 +09:00
Tristan Van Berkom 72675f1f28 Changes to testtoplevelembed
- Made notebook tabs smaller
  - No need to hide/show toplevels after removing from a parent,
    if it's visible it will be automatically shown after removing
    outside of it's previous parent.
2011-01-06 14:39:41 +09:00
Tristan Van Berkom 53980aca9b Fixed GtkFileChooserDefault to handle cases of being in an embedded dialog.
This involves checking the toplevelness of new toplevels before connecting
but not the *old* ones for disconnecting signals. Also take care of handling
a row_reference that becomes invalid over the course of reparenting the
filechooser into another parent.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom 93c8058582 Fixed GtkWindow/GtkWidget to properly emit hierarchy changed for embedded toplevels
Now GtkWindow takes some measures when setting toplevelness:

  - When a window becomes toplevel after being embedded it saves
    the visibility state and reshow's itself so that the window
    re-realizes and presents itself again automatically

  - When emitting hierarchy-changed, synthetically mark the toplevel
    as not anchored, this allows the hierarchy changed propagation to
    recurse properly.

GtkWidget also takes care to unset the parent window *after* unparenting
the widget and after emitting the heirarhcy changed that leaves a NULL
toplevel.

That means there are now 2 cycles of "hierarchy-changed" when removing
an embedded toplevel from a parent, first one that makes the new toplevel
a NULL one (since the toplevel flag is not yet restored), the second cycle
makes the removed window toplevel again when setting the parent window
to NULL.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom aa787c9dd1 Fixed focus handling on embedded windows.
Now GtkWindow chains up in focus vfuncs when non-toplevel, this
fixes focus in testtoplevelembed.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom 387d745e0e Added buttons to notebook tabs in testtoplevelembed
Now you can remove and reembed the toplevels (deleting the
toplevels put them back in the notebook).
2011-01-06 14:39:40 +09:00
Tristan Van Berkom 2dfa855bc4 Moved location of unsetting parent window inside gtk_widget_unparent().
Make sure to do this after the widget is unrealized.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom fdba9f281d Fixed issues with "hierarchy-changed" signal.
GtkFileChooserDefault watches the toplevel and montitors "set-focus"
signal on it... however the connection needs to be remade when the
GtkFileChooserDialog is in an embedded toplevel.

Measure's taken: GtkWindow propagates hierarchy changes when
_gtk_window_set_is_toplevel() is called, gtk_widget_unparent()
unsets the widget's parent window earlier in the function so that
the possible hierarchy change is still able to properly access the hierarchy.

GtkFileChooserDefault checks if the "new" toplevel is indeed
gtk_widget_is_toplevel() but not the old one, GtkRange has been
updated to use gtk_widget_is_toplevel() inside it's hierarhcy_changed
vfunc, other classes already do this properly.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom 69b1bfb17b Added tests/testtoplevelembed. 2011-01-06 14:39:40 +09:00
Tristan Van Berkom addcc64b9c Slightly less special casing in GtkWindow for gtk_widget_is_toplevel()
Also take care of setting the resize-mode at realize time depending
on toplevelness.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom 6299f61ee7 Added docs to gtk_widget_set_parent_window.
Also stop setting the resize mode of the window.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom 8b4b62f00c Allow GtkWindow to be parented if gtk_widget_set_parent_window() is called on one
This patch makes gtk_widget_set_parent_window() undo the toplevelness
of a GtkWindow, GtkWindow then realizes itself as a normal child widget
and behaves like a normal GtkBin by checking gtk_widget_is_toplevel() in
several places (show/hide/map/unmap/draw/size_allocate/check_resize/configure_event).
2011-01-06 14:39:40 +09:00
Matthias Clasen a601b43b83 Cosmetic changes 2011-01-06 00:14:02 -05:00
Tristan Van Berkom 4d8c7c5782 Ensure that GtkIconView items get redrawn when the focus cell changes.
Seems the redraw was not happenning from keynav when set_focus_cell()
was called because keynav already updates the focus-cell. Now we
just unconditionally redraw the focus item when set_focus_cell() is
called.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom bab0f5a5c1 Fixed GtkIconView keynav
Icon View was not initially setting focus on a cell when
focus initially comes into the view. Focusing into whatever
is the first cell in the cursor item when set_cursor_item
is called with a NULL cell fixes this.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom b7c25c41d6 Fixed gtkiconview dispose cycle to not fire warnings. 2011-01-06 13:51:49 +09:00
Tristan Van Berkom 56580d1b8b Restored the old GtkIconView guess for wrap-width/width size of text cell
GtkIconView sets the minimum width of the text cell to be at least 50
pixels and otherwise twice the width of the first pixbuf cell found
in the icon list.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom 60e5fcf4db Made GtkIconView reset the context and invalidate all sizes when a row changes.
GtkIconView should have a "grow-only" mode to handle optimization to
only allow icons to grow in width when rows change, however since
GtkIconView still does not handle large numbers of rows for now we'll
just relayout the whole thing whenever a series of rows change.

Also fixed up to watch the context incase of implicit resets.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom 6036c51d52 Removed gtk_icon_view_get_item_area()
Now use a GdkRectangle at the begining of the GtkIconViewItem
structure and just re-cast the struct to get the item area.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom d0f13ae52c Fixed GtkIconView buildable custom tag end to let cell layout properly
handle <cell-packing>
2011-01-06 13:51:48 +09:00
Tristan Van Berkom 01a35e4483 Added gtk_icon_view_new_with_area() 2011-01-06 13:51:48 +09:00
Tristan Van Berkom a160358830 GtkIconView now uses a per-row GtkCellAreaContext to store the alignments
of each row.

GtkIconView now properly calculates the height of each row separately
using a separate GtkCellAreaContext stored in an array which it can
always easily index with the item->row index for all purposes.
2011-01-06 13:51:48 +09:00
Tristan Van Berkom 2d5eadb7f9 Alignments with variable row heights almost works perfectly.
However, I'm going to have to figure a way to store the alignments
for rows separately, this may involve using a separate GtkCellAreaContext
for each row, unfortunately.
2011-01-06 13:51:48 +09:00
Tristan Van Berkom e51592c0b3 Experimenting with allocating the context a different height for each row. 2011-01-06 13:51:48 +09:00
Tristan Van Berkom c77abe1f83 Committing working version of GtkIconView using GtkCellArea.
Some things still not sorted out, GtkCellAreaContext is not allocated
so icons dont recieve alignments yet, focus navigation is not exactly
what it used to be (maybe we can work around that by observing the
item orientation and explicitly setting focus to the same cell when
navigating in the wrong orientation).
2011-01-06 13:51:48 +09:00
Tristan Van Berkom 951ea857cc Initial messy commit of GtkIconView using GtkCellArea (nothing works yet). 2011-01-06 13:51:48 +09:00
Tristan Van Berkom 6d483ed930 Added GtkCellArea & GtkCellAreaContext to GtkIconView
First commit to icon-view-refactor, essentially only adds the
construct-only "cell-area" property and the context but doesnt
use it.
2011-01-06 13:51:48 +09:00
Szilárd Pfeiffer 8219ed3a26 Add gtk_tree_model_iter_previous() vfunc
https://bugzilla.gnome.org/show_bug.cgi?id=128058
2011-01-05 23:39:11 -05:00
Matthias Clasen 072023e57b Remove deprecated GtkSpinner style properties 2011-01-05 23:21:52 -05:00
Matthias Clasen 2b3b3934a4 Another NEWS update 2011-01-05 21:12:51 -05:00
A S Alam f4cf52f2cc Translation: update Punjabi 2011-01-06 07:16:05 +05:30
Matthias Clasen 53b67b9a72 Drop the G_SEAL definition from gdkconfig.h
All sealed members removed. Yay!
2011-01-05 19:00:14 -05:00
Benjamin Otte 2e064b3378 tests: Port testsocket example to not use deprecated APIs 2011-01-05 23:50:22 +01:00
Benjamin Otte 8136481d75 tests: Fix compile warnings for people who don't read gcc output. 2011-01-05 23:50:22 +01:00
Benjamin Otte 96091a4d9c adjustment: Privateize sealed members 2011-01-05 23:50:22 +01:00
Benjamin Otte e1cb1b89d8 testgtk: Update adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte 3d3358b561 testgtk: Rename "adj" variables to "adjustment" 2011-01-05 23:50:22 +01:00
Benjamin Otte b533305728 tests: Update prop-editor adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte d5f7b6cd64 gtk-demo: Undef GDK_DISABLE_DEPRECATED to make test compile 2011-01-05 23:50:22 +01:00
Benjamin Otte e62b39c921 volumebutton: Update adjustment usage for sealing
Also rename all variables named "adj" to "adjustment", like they're
called everywhere else.
2011-01-05 23:50:22 +01:00
Benjamin Otte f79c6baa66 scalebutton: Update adjustment usage for sealing
Also rename all variables named "adj" to "adjustment", like they're
called everywhere else.
2011-01-05 23:50:22 +01:00
Benjamin Otte cc879a6028 textview: Update adjustment usage for sealing
Also rename all variables named "adj" to "adjustment", like they're
called everywhere else.
2011-01-05 23:50:22 +01:00
Benjamin Otte cd80f49053 tests: Update adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte a41402c455 combobox: Update adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte e4442c010b examples: Update dial adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte c731e1ce0a demos: Update testpixbuf-scale demo for adjustment sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte a28be2cc6c gail: Update adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte 801ba1c758 range: Update adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte 95e9f4c0c1 range: Rewrite attachment setters to use sealed API 2011-01-05 23:50:22 +01:00
Benjamin Otte 7210e6e1cd viewport: Update adjustment usage for sealing 2011-01-05 23:50:22 +01:00
Benjamin Otte 2b4bb071a3 viewport: Rewrite adjustment modification code for sealing 2011-01-05 23:50:21 +01:00
Benjamin Otte a317499031 iconview: Update adjustment usage for sealing 2011-01-05 23:50:21 +01:00
Benjamin Otte aa495f00b4 iconview: Use gtk_adjustment_configure() instead of g_object_set()
Simplifies code quite a bit apart from jsut making it more readable.
2011-01-05 23:50:21 +01:00
Benjamin Otte 3f1a65d6f5 iconview: Use set_[hv]adjustment_values() also when just changing upper
Simplifies the code quite a bit and the code is smart enough to not do
extra work if only one value changes.
2011-01-05 23:50:21 +01:00
Benjamin Otte 1af3a95e8c menu: Update adjustment usage for sealing 2011-01-05 23:50:21 +01:00
Benjamin Otte 8ea3372395 menu: Update adjustment usage for sealing
Call gtk_adjustment_set_value() instead of manually updating the value
in gtk_menu_scroll_to()
2011-01-05 23:50:21 +01:00
Benjamin Otte f5a3af9b02 scrolledwindow: Update adjustment usage for sealing 2011-01-05 23:50:21 +01:00
Benjamin Otte 76b50a7eae spinbutton: Update adjustment usage for sealing
Also rename all variables named "adj" to "adjustment", like they're
called everywhere else.
2011-01-05 23:50:21 +01:00
Matthias Clasen 14a452ab50 More updates 2011-01-05 16:58:08 -05:00
Matthias Clasen 7799fbf239 Add GtkNumerableIcon
This is a subclass of GEmblemedIcon that can show a number or
short string as an emblem, overlayed on top of another emblem.

Written by Cosimo Cecchi
https://bugzilla.gnome.org/show_bug.cgi?id=637169
2011-01-05 16:33:15 -05:00
Tristan Van Berkom 9a80100e9a Fixed get_size() for GtkCellRendererText to clip to the input area
For ellipsize cells it's important to clip the result of get_size()
so that the returned required rectangle is indeed less than or equal
to the input rectangle... this is done so that GtkCellArea can accurately
paint focus on cells by calling gtk_cell_renderer_get_aligned_area().

Patch also adds assertions to gtk_cell_renderer_get_aligned_area() to
ensure this keeps working correctly.
2011-01-06 02:31:42 +09:00
Matthias Clasen e41fb7703c Add padding to text attribute structs 2011-01-05 11:28:45 -05:00
Ivar Smolin 3d12aca2f9 [l10n] Updated Estonian translation 2011-01-05 18:14:40 +02:00
Matthias Clasen 67b8f22d8b Remove some dropped symbols from gtk3-sections.txt 2011-01-05 11:01:46 -05:00
Matthias Clasen 3109441c77 Update gtk symbols list 2011-01-05 11:01:45 -05:00
Milan Bouchet-Valat d7af47d657 Fix doc about gtk_cell_layout_get_area()
Return value was copied and pasted from gtk_cell_layout_get_cells(),
which is obviously wrong.
2011-01-05 16:45:51 +01:00
Milan Bouchet-Valat ebe9d075f4 Fix GtkCellArea:edit-widget to be of type GtkCellEditable
More correct, and consistent with gtk_cell_area_get_editable_widget().
2011-01-05 16:45:51 +01:00
Matthias Clasen f377621eb7 Fix libgail-util doc build 2011-01-05 10:12:16 -05:00
Matthias Clasen 680b64d04a Fix some parameter name mismatches in the docs 2011-01-05 10:04:48 -05:00
Matthias Clasen 9f13312520 Fix file lists in the win32 backend 2011-01-05 09:58:46 -05:00
Matthias Clasen 1a8290f92c Update POTFILES some more 2011-01-05 09:43:45 -05:00
Matthias Clasen 57de2c84c4 Try again to fix the doc build 2011-01-05 09:38:36 -05:00
Matthias Clasen 2c9fad9ea8 Update POTFILES 2011-01-05 08:42:57 -05:00
Benjamin Otte 7d94127917 testutils: Update adjustment usage for sealing 2011-01-05 14:36:11 +01:00
Benjamin Otte 58fa980d12 textview: Update adjustment usage for sealing 2011-01-05 14:36:11 +01:00
Benjamin Otte f65fa81e3a treeview: Update adjustment usage for sealing
Use getters instead of direct structure access.
2011-01-05 14:30:59 +01:00
Benjamin Otte 6ff585e189 treeview: Update adjustment usage for sealing
Use gtk_adjustment_set_upper() instead of doing its work manually.
2011-01-05 14:30:59 +01:00
Benjamin Otte e93eb20794 treeview: Update adjustment usage for sealing
Use gtk_adjustment_configure() when toggling header visibility.
2011-01-05 14:30:58 +01:00
Benjamin Otte bb64831987 tests: Update adjustment usage for sealing 2011-01-05 14:30:58 +01:00
Benjamin Otte 79cc672f3f toolitemgroup: Update adjustment usage for sealing 2011-01-05 14:30:58 +01:00
Benjamin Otte c6697af962 layout: Update adjustment usage for sealing 2011-01-05 14:30:58 +01:00
Benjamin Otte fdedc8e376 colorsel: Update adjustment usage for sealing 2011-01-05 14:30:58 +01:00
Benjamin Otte beec484964 toolpalette: Update adjustment usage for sealing 2011-01-05 14:30:58 +01:00
Benjamin Otte c43a31ea33 API: range: Remove update policy
It's unused and complicates code a lot. In particular, it breaks the
adjustment/range abstractions.
2011-01-05 14:30:58 +01:00
Matthias Clasen e608cc4eaf Update gtk symbol list 2011-01-04 23:49:01 -05:00
Matthias Clasen 5c1502479a Fix gdk/abicheck.sh temporarily
The best fix for now is to just hardcode the X11 backend again
2011-01-04 23:40:41 -05:00
Matthias Clasen c4f0bbb130 fix documentation build 2011-01-04 23:15:35 -05:00
Matthias Clasen 9ec7f51ac1 Update NEWS for 2.99 2011-01-04 22:49:54 -05:00
Matthias Clasen c1773bf240 Bump version to 2.99 2011-01-04 22:01:48 -05:00
Matthias Clasen 369b64b427 Brush up configure output
Show used X extensions, print backends, etc.
Also make configure abort in some more cases when explicitly
enabled options are missing dependencies.
2011-01-04 21:57:21 -05:00
Matthias Clasen c97652aeb4 Decouple GdkWindowCache life-cycle from GdkX11DragContext
By making window caches refcounted. This fixes problems with leaking
drag contexts, as experienced in
https://bugzilla.gnome.org/show_bug.cgi?id=637691
and
https://bugzilla.gnome.org/show_bug.cgi?id=144324

Based on a patch by drago01@gmail.com
2011-01-04 19:30:04 -05:00
Emilio Pozuelo Monfort a108b2b08b Fix build when builddir != srcdir 2011-01-04 23:21:36 +00:00
Emilio Pozuelo Monfort cfc70ca71b Fix introspection build when builddir != srcdir
So gdk/gdk.h can find gdk/gdkconfig.h, which is in $builddir
because it's generated.
2011-01-04 23:21:35 +00:00
Matthias Clasen 2690b8b924 Move GtkEntryCompletion docs inline
Based on a patch by Garrett Regier
https://bugzilla.gnome.org/show_bug.cgi?id=617322
2011-01-04 17:54:47 -05:00
Matthias Clasen 82c9013e01 Add gtkcellrenderer.sgml to .gitignore 2011-01-04 17:52:14 -05:00
Matthias Clasen e9cc9d5c47 Small doc cleanups for GtkCellLayout 2011-01-04 17:42:30 -05:00
Matthias Clasen b123bc41fd Move docs for gtkmain inline
At the same time, introduce a gtkmainprivate.h header
and various other cleanups.

Based on a patch by Tadej Borovšak.
https://bugzilla.gnome.org/show_bug.cgi?id=617471
2011-01-04 17:32:12 -05:00
Matthias Clasen 98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen 1283368b1b Remove GtkArg, GtkCallbackMarshal and GtkFunction
Based on a patch by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 13:49:37 -05:00
Javier Jardón 7e7d8c4ccc Remove deprecated gtk_quit_* API 2011-01-04 13:39:35 -05:00
Matthias Clasen 3e348181ed Move GtkExpander docs inline
Based on a patch by Garrett Regier.

https://bugzilla.gnome.org/show_bug.cgi?id=617327
2011-01-04 13:26:32 -05:00
Matthias Clasen c770fdd08a Move GtkDrawingArea docs inline
Based on a patch by Garrett Regier.

https://bugzilla.gnome.org/show_bug.cgi?id=617315
2011-01-04 13:26:32 -05:00
Javier Jardón 72161a071f gtkmenuitem: Use private pointer instead G_TYPE_INSTANCE_GET_PRIVATE 2011-01-04 19:00:11 +01:00
Matthias Clasen deab5ff1c9 Remove gtk_tree_menu_get_type from gtk3.types 2011-01-04 12:54:47 -05:00
Matthias Clasen c009149670 Move GtkDialog docs inline
Based on a patch by Garrett Regier.

https://bugzilla.gnome.org/show_bug.cgi?id=617312
2011-01-04 12:54:47 -05:00
Javier Jardón 7245ca82f0 gtkmenu: Use private pointer instead G_TYPE_INSTANCE_GET_PRIVATE 2011-01-04 18:46:43 +01:00
Matthias Clasen b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Matthias Clasen 16877b4d7b Reduce includes of gtktypeutils.h to a minimum 2011-01-04 12:05:05 -05:00
Matthias Clasen 8bdb44fd47 Remove an outdated doc statement.
https://bugzilla.gnome.org/show_bug.cgi?id=553404
2011-01-04 11:55:56 -05:00
Matthias Clasen e515bd4f71 Some more calendar doc additions
Proposed by Nikos Kouremenos

https://bugzilla.gnome.org/show_bug.cgi?id=321958
2011-01-04 11:44:09 -05:00
Matthias Clasen 336d355c2a Some documentation additions
Proposed by Bruno Piguet.

https://bugzilla.gnome.org/show_bug.cgi?id=559503
2011-01-04 11:36:42 -05:00
Matthias Clasen bf2a6114ab Mention gvfs in the gtk_show_uri() docs
https://bugzilla.gnome.org/show_bug.cgi?id=622125
2011-01-04 11:25:40 -05:00
Matthias Clasen ee89c605cf Some documentation improvements for gtk_init/gtk_parse_args
https://bugzilla.gnome.org/show_bug.cgi?id=562182
2011-01-04 11:18:42 -05:00
Matthias Clasen 0a069e1643 Document DESKTOP_STARTUP_ID use
Closes https://bugzilla.gnome.org/show_bug.cgi?id=165987
2011-01-04 10:58:04 -05:00
Szilárd Pfeiffer f130db44ea gail: add/remove horizontal/vertical state based on orientation value
Now, these states are depending on the widget class.
2011-01-04 10:47:54 -05:00
Milan Bouchet-Valat 52e1722f35 GtkComboBox(Text): Add documentation about the entry 2011-01-04 10:36:08 -05:00
Matthias Clasen 06f6f7bd93 Move GtkEventBox docs inline
At the same time, add a private pointer, and generally clean
things up.
2011-01-04 10:33:33 -05:00
Tristan Van Berkom 68aa336f5f Removed TABs and trailing whitespace from GtkComboBox and GtkTreeMenu 2011-01-05 00:14:25 +09:00
Tristan Van Berkom f5f822b91c Moved GtkMenuItem private functions to the private header. 2011-01-05 00:14:08 +09:00
Tristan Van Berkom 185744d402 Mentioned that GtkTreeMenu is based on some GtkComboBox code in the copyright header. 2011-01-04 23:37:14 +09:00
Tristan Van Berkom 4ff893979b Fixed conflicts after rebasing master into combo-refactor branch. 2011-01-04 23:37:14 +09:00
Tristan Van Berkom d681aa7977 Fixed GtkComboBox to properly set tearoff state on delegate GtkTreeMenu.
This breakage was also the cause of not correctly positioning the child
menu over the selected item.
2011-01-04 23:37:13 +09:00
Tristan Van Berkom 80e427c857 Fixed gtktreemenu for new gtkcellareabox api. 2011-01-04 23:37:13 +09:00
Tristan Van Berkom 7b2d6e5cdf Make GtkTreeMenu a private class:
- Removed GtkTreeMenu from gtk-docs.sgml
  - Removed GtkTreeMenu from gtk3-sections.txt
  - Removed GtkTreeMenu from gtk.symbols
  - Make GtkTreeMenu apis prefixed with '_' (including _get_type()).
  - Updated GtkComboBox sources to use the private apis
  - Updated GtkCellView to not mention #GtkTreeMenu in gtk-doc statements
  - Updated tests/testtreemenu to not use a GtkTreeMenu but still
    show a very fancy GtkComboBox
  - Moved gtktreemenu.h to private headers section in the makefile.
  - Removed include of gtktreemenu.h from gtk.h
2011-01-04 23:37:13 +09:00
Tristan Van Berkom 6ae724c0d3 Added LISTMODE env var check to testcombo.c so that one can easily test listmode. 2011-01-04 23:37:13 +09:00
Tristan Van Berkom 57857f13df Added new constructors gtk_combo_box_new_with_area and gtk_combo_box_new_with_area_and_entry. 2011-01-04 23:37:13 +09:00
Tristan Van Berkom b3ff60db71 Fixed GtkComboBox to let the cell-layout implementation handle <cell-packing> 2011-01-04 23:37:13 +09:00
Tristan Van Berkom 467fb0d7dc Fixed gtk_tree_menu_path_in_menu function which has been malfunctioning.
Now sensitivity is properly handled in the "apply-attributes" callback.
2011-01-04 23:37:12 +09:00
Tristan Van Berkom 01981311da Removed GtkComboBoxPrivate->minimum/natural_width members.
And updated gtk_combo_box_list_position() which is still waiting
for GtkTreeView to report natural width in order to properly do
non fixed width dropdown menus.
2011-01-04 23:37:12 +09:00
Tristan Van Berkom ee02ac5863 Re-refactored GtkComboBox to not reorder the file.
Turns out reordering the file the way I did before put
me in an unmergable situation, now re-refactored the
combo and list-mode works again.
2011-01-04 23:37:12 +09:00
Tristan Van Berkom f3de78a023 Fixing GtkComboBox breakage after merge, completing hand-merge of style-context GtkBorder issues (now it works again). 2011-01-04 23:37:11 +09:00
Tristan Van Berkom 0c9c031962 Fixing GtkCellView to not strcmp() in buildable_custom_tag_end()
GtkCellLayout function now returns boolean if one of the tags
it was interested in was handled.
2011-01-04 23:37:11 +09:00
Tristan Van Berkom 85609d124a Added clarification to the GtkCellView:cell-area-context documentation. 2011-01-04 23:37:11 +09:00
Tristan Van Berkom 613545f821 Fixed a broken gtk-doc statement in gtktreemenu.c 2011-01-04 23:37:11 +09:00
Tristan Van Berkom 1f1e94739b Added remaining missing gtk-doc statements for GtkCellView. 2011-01-04 23:37:11 +09:00
Tristan Van Berkom e8503f600e Added GtkTreeMenu to gtk+ documentation and updated sections for newly added GtkCellView apis. 2011-01-04 23:37:11 +09:00
Tristan Van Berkom 7a673b2ed1 Added all documentation for new GtkTreeMenu 2011-01-04 23:37:10 +09:00
Tristan Van Berkom f358dfbccc Added new symbols for GtkTreeMenu and added GtkCellView apis to gtk.symbols 2011-01-04 23:37:10 +09:00
Tristan Van Berkom c8b63bfe03 Removed calls to gtk_cell_area_context_sum_*() since they went away. 2011-01-04 23:37:10 +09:00
Tristan Van Berkom b57095412b Added aligned food menu test to testcombo.c 2011-01-04 23:37:10 +09:00
Tristan Van Berkom 15ac4be60f Fixed combo-refactor branch for recent switch to gtk_cell_area_context_reset() api. 2011-01-04 23:37:10 +09:00
Tristan Van Berkom ab3b75aeb1 Adding a combo box to testtreemenu to show the GtkTreeMenu at work as a combo box delegate. 2011-01-04 23:37:10 +09:00
Tristan Van Berkom 1193c30e15 Revert "Added gtk_tree_menu_get_area()."
This reverts commit d32d7c8f9c4d2bcd7c5c206c09273ce67ed20df4.
2011-01-04 23:37:10 +09:00
Tristan Van Berkom b32ee4fde3 Added orientation control to the treemenu test. 2011-01-04 23:37:09 +09:00
Tristan Van Berkom bd1b4ddf75 Updated GtkCellView for new gtk_cell_area_context_allocate() api. 2011-01-04 23:37:09 +09:00
Tristan Van Berkom 26a6965d26 Aligned prototypes in gtkcellview.h 2011-01-04 23:37:09 +09:00
Tristan Van Berkom f101bf4a2d Added gtk_tree_menu_get_area(). 2011-01-04 23:37:09 +09:00
Tristan Van Berkom 2e2eb786d3 Make GtkCellView orientable and only allocate the cell area in the orientable orientation (unless its a "fit-model" cellview which gets both). 2011-01-04 23:37:09 +09:00
Tristan Van Berkom 6ab29f5fd8 Removing apis from GtkCellView
APIS: gtk_cell_view_get_desired_width_of_row &
gtk_cell_view_get_desired_height_for_width_of_row were introduced in
3.0 only for use from GtkComboBox and now the refactored cellview
does this transparently and just requests the right thing through
GtkWidget apis.
2011-01-04 23:37:09 +09:00
Tristan Van Berkom 238bf5cbaa Oops one of my last commits disabled some tests, re-enabling them. 2011-01-04 23:37:09 +09:00
Tristan Van Berkom caf1d57fd3 Fixed inserting and deleting rows for submenus of GtkTreeMenu 2011-01-04 23:37:08 +09:00
Tristan Van Berkom 4a5be7c74e Getting closer to updating the treemenu view properly from the model signals 2011-01-04 23:37:08 +09:00
Tristan Van Berkom 39cf1576d7 Fixed GtkCellView to always allocate when in fit-model mode. 2011-01-04 23:37:08 +09:00
Tristan Van Berkom 83c69f4cf3 Implementing GtkComboBox using GtkTreeMenu !
First iteration at implementing combo box using a delegate
treemenu, almost everything is working. Still need to finalize
sensitivity issues in GtkTreeMenu (and should go ahead and pass
through GtkComboBox code with a fine comb...).
2011-01-04 23:37:08 +09:00
Tristan Van Berkom e1ecd34ce1 Added "fit-model" and "draw-sensitive" properties to GtkCellView
- "fit-model" decides that the cellview should request space for
   the entire treemodel, this ensures the cell view displayed on
   a combo box will not spuriously change size when the selected
   item changes.

 - "draw-sensitive" forces cell area to render cells sensitive
   even if they are insensitive in the model.
2011-01-04 23:37:08 +09:00
Tristan Van Berkom d48690c32c Make GtkTreeMenu update menu item sensitivity when "apply-attributes" signal is fired for a row in the menu. 2011-01-04 23:37:08 +09:00
Tristan Van Berkom 84a726c3ce Support grid mode in GtkTreeMenu
Added properties "wrap-width", "row-span-column" and "column-span-column"
to allow grid style menus from treemodels. Handling row data changes
appropriately.
2011-01-04 23:37:07 +09:00
Tristan Van Berkom e628345394 Fixed GtkCellView to call cell_view_set_model() and disconnect signals at dispose time. 2011-01-04 23:37:07 +09:00
Tristan Van Berkom de59f05ccd Added gtk_tree_menu_set/get_tearoff to allow the root menu to have a tearoff item
Combo boxes expose an "add-tearoffs" feature to add a tearoff item to the root of the combo menu, added this feature to GtkTreeMenu to achieve this (and updated the testcase).
2011-01-04 23:37:07 +09:00
Tristan Van Berkom 3a56f8814f Reduced code size in GtkTreeMenu by only implementing GtkCellLayout->get_area method for the GtkCellLayout iface. 2011-01-04 23:37:07 +09:00
Tristan Van Berkom b6b810ba51 Reduced code in GtkCellView by just implementing the GtkCellLayout->get_area method. 2011-01-04 23:37:06 +09:00
Tristan Van Berkom 438b0f7c9b Connected to GtkTreeModel signals in GtkTreeMenu
Now the GtkTreeMenu properly updates its hierarchy when the underlying
model data changes (row inserted/deleted or reordered). Also some unneeded
hackery was removed, all size calculations are delegated to the cellviews.
2011-01-04 23:37:06 +09:00
Tristan Van Berkom 88ec6a62ef GtkCellView now watches the "row-changed" signal.
When the "row-changed" signal on the model is trapped, if the row which
changed is the displayed row then the context is flushed and sizes are
recalculated for every area in the same context.
2011-01-04 23:37:06 +09:00
Tristan Van Berkom 9ffaae5022 Added GtkTreeMenuHeaderFunc to decide if a submenu gets a leaf header.
GtkComboBox needs treemenus to allow selection of all leafs including
rows which may have children, this allows the combobox or combobox user
to decide which row that has children can also be selectable as a header
leaf of the submenu. Test case testtreemenu updated to reflect this.
2011-01-04 23:37:06 +09:00
Tristan Van Berkom 6d8dfd5546 Fixed GtkCellView to not clear the layout when disposing
The layout belongs the underlying area which may be shared across
views and treemenus, let the cells be destroyed when the area is finally
destroyed.
2011-01-04 23:37:06 +09:00
Tristan Van Berkom 53bdca9dae Adding more "small" submenus to testtreemenu 2011-01-04 23:37:06 +09:00
Tristan Van Berkom 1cacae9cc4 Fixed trailing ';' on if statement in gtkmenuitem.c 2011-01-04 23:37:06 +09:00
Tristan Van Berkom aef55bb629 Added submenus to tests/testtreemenu 2011-01-04 23:37:06 +09:00
Tristan Van Berkom 963db86d23 Fixed GtkTreeMenu to not infinitely recurse when building submenus.
GtkTreeMenu needs to only populate it's submenus when set_root()
is called, we were populating it when the model is set which cause
the tree to be infinitely populated as the root is NULL by default.

Also call gtk_menu_set_reserve_toggle_thingy (FALSE) to not reserve
space for the toggle size.
2011-01-04 23:37:06 +09:00
Tristan Van Berkom c690402446 Fixed GtkMenuItem to reserve the actual arrow size and spacing
GtkMenuItem was reserving arrow size based on it's requested height,
now base the submenu arrow size on the actual arrow size and spacing.
2011-01-04 23:37:06 +09:00
Tristan Van Berkom 26c3f1a26d Adding GtkTreeMenu class.
Added GtkTreeMenu class to automatically render
a GtkTreeModel into a GtkMenu hierarchy (will be
used by GtkComboBox for its dropdown menus). Included
an accompanying testcase tests/testtreemenu
2011-01-04 23:37:06 +09:00
Tristan Van Berkom f15a589651 Added gtk_menu_item_set/get_reserve_indicator.
This is needed by GtkTreeMenu to ensure that child menu items
reserve space for the submenu indicator even if they dont have
submenus... in this way we ensure the same size of all cell
areas in the menu items at allocation/request time.
2011-01-04 23:37:06 +09:00
Tristan Van Berkom 5e8e4429c7 Fixing GtkCellView PROP_CELL_AREA_CONTEXT property id
... and renaming some internal variables.
2011-01-04 23:37:06 +09:00
Tristan Van Berkom 988200800c Added gtk_cell_view_new_with_context(). 2011-01-04 23:37:06 +09:00
Tristan Van Berkom b70589b6a4 Reimplemented GtkCellView using an internal GtkCellArea.
Added construct GtkCellArea and GtkCellAreaContext properties,
the context property allows putting multiple cellviews into the
same size request context.
2011-01-04 23:37:05 +09:00
Tristan Van Berkom 58cdd6d38e Removed GtkMenuItem->show_submenu_indicator flag
The show_submenu_indicator flag was explicitly set in various
places from GtkMenu/GtkMenuBar at request times, since the
GtkMenuItem already checks the parent type for GTK_IS_MENU_BAR()
in various places, removed this flag in favor of just checking
the parent type (only in the interest of better readable code).
2011-01-04 23:37:05 +09:00
Matthias Clasen 7352a166b6 Formatting fixes and whitespace cleanups 2011-01-04 02:21:38 -05:00
Matthias Clasen 32bfc980c1 Remove pack property altogether 2011-01-04 02:06:03 -05:00
Matthias Clasen 723fedef8b Remove pack consideration from tab drawing 2011-01-04 02:03:03 -05:00
Matthias Clasen 4ea886aea1 Don't consider pack when allocating tabs 2011-01-04 01:57:22 -05:00
Matthias Clasen f9d6bc6cca Drop pack consideration from gtk_notebook_search_page 2011-01-04 01:39:18 -05:00
Matthias Clasen a7bb193377 Drop internal function to find page position 2011-01-04 01:36:09 -05:00
Matthias Clasen f838ecf9f0 Remove pack consideration from tab dnd 2011-01-04 01:35:52 -05:00
Matthias Clasen 88501d527d Remove pack consideration from tab reordering 2011-01-04 01:23:05 -05:00
Matthias Clasen 03b37a2e54 Remove pack arguments from some internal functions
This removes pack from gtk_notebook_{set,query}_tab_label_packing.
2011-01-04 01:11:28 -05:00
Matthias Clasen 08a99e9ab3 Remove the deprecated GtkNotebook:tab-pack child property 2011-01-04 00:57:34 -05:00
Matthias Clasen 98b140e7b5 Don't use GtkNotebook:tab-pack in testnotebookdnd 2011-01-04 00:55:50 -05:00
Matthias Clasen c874bba0e1 GtkNotebook: fix reference to no-longer-exiting function in docs 2011-01-03 22:55:38 -05:00
Matthias Clasen 72b69ae2ed Don't use page_size in GtkSpinButton
It ought to be 0 anyway, but don't use it.

This puts bug 307963 to rest.
2011-01-03 21:51:58 -05:00
Matthias Clasen a975d62071 Rename gtk-update-icon-cache and gtk-builder-convert back
In bug 635207, it was pointed out that it is a bad idea to
rename these tools purely in the name of parallel-installability,
since it forces dependencies to make a choice between running
gtk-update-icon-cache and gtk-update-icon-cache-3.0 (or both ?!).

So, we rename these utilities back to their un-suffixed names
and rely on distributors to resolve the conflict between GTK+ 2.x
and GTK+ 3.0 packages, which can be done e.g. by dropping the
utilities from the gtk3 packages and add a gtk3 -> gtk2 dependency.
2011-01-03 21:35:23 -05:00
Carlos Garnacho 7266d0f11f Make GtkPathBar use ::style-updated 2011-01-04 03:06:27 +01:00
Carlos Garnacho c3b5b3531c GtkPaned: Remove unneeded call 2011-01-04 03:06:26 +01:00
Carlos Garnacho f9a5c14ac0 Make GtkOffscreenWindow use GtkStyleContext 2011-01-04 03:06:26 +01:00
Carlos Garnacho 7e2dea1dff GtkNotebook: remove unneeded call 2011-01-04 03:06:25 +01:00
Carlos Garnacho 61691117dc GtkMisc: Remove unneeded calls 2011-01-04 03:06:24 +01:00
Carlos Garnacho 905604550a Make GtkMessageDialog use GtkStyleContext 2011-01-04 03:06:24 +01:00
Carlos Garnacho 166b709c7f Make GtkLinkButton use ::style-updated 2011-01-04 03:06:23 +01:00
Carlos Garnacho 80e115331c GtkInvisible: Avoid chaining up in ::style-updated 2011-01-04 03:06:22 +01:00
Carlos Garnacho 7b3de2d552 Make GtkHandleBox size request code use GtkStyleContext for padding 2011-01-04 03:06:22 +01:00
Carlos Garnacho b062a583d3 Make GtkFixed use GtkStyleContext 2011-01-04 03:06:21 +01:00
Carlos Garnacho 14a5c0b9ff Make GtkFileChooser use GtkStyleContext 2011-01-04 03:06:21 +01:00
Carlos Garnacho 8e18c2cfd2 Make GtkFileChooserButton use ::style-updated 2011-01-04 03:06:21 +01:00
Carlos Garnacho 96d8f85dcc Make DnD code use GtkStyleContext for the highlight rectangle. 2011-01-04 03:06:20 +01:00
Carlos Garnacho e02cbf4770 Make GtkEntryCompletion use GtkStyleContext 2011-01-04 03:06:20 +01:00
Carlos Garnacho e4c509837f GtkEntry: get font description from GtkStyleContext 2011-01-04 03:06:20 +01:00
Carlos Garnacho 55145e0e4e GtkEntry: Remove unneeded calls 2011-01-04 03:06:19 +01:00
Carlos Garnacho c180edd80c Make GtkDrawingArea use GtkStyleContext 2011-01-04 03:06:19 +01:00
Carlos Garnacho 552c4c78f6 GtkExpander: remove unneeded call 2011-01-04 03:06:19 +01:00
Carlos Garnacho 6c21f3d8e6 Remove unneeded/deprecated call from size requisition code 2011-01-04 03:06:19 +01:00
Carlos Garnacho c296d11ac3 GtkToolItem: Remove unneeded call 2011-01-04 03:06:19 +01:00
Carlos Garnacho be0ebc9f5a Make GtkDialog use ::style-updated 2011-01-04 03:06:18 +01:00
Carlos Garnacho 99791d183c Make GtkCellView use GtkStateFlags 2011-01-04 03:06:18 +01:00
Carlos Garnacho 554e649a68 Make GtkTooltip use GtkStyleContext 2011-01-04 03:06:17 +01:00
Carlos Garnacho 41389cb435 Make GtkWin32EmbedWidget use GtkStyleContext 2011-01-04 03:06:17 +01:00
Carlos Garnacho 665a94e0f3 Make GtkPlug use GtkStyleContext 2011-01-04 03:06:15 +01:00
Carlos Garnacho 81eb953206 Make GtkRecentChooser use GtkStyleContext 2011-01-04 03:06:14 +01:00
Carlos Garnacho 732730425a GtkSeparatorToolItem: remove unneeded call 2011-01-04 03:06:13 +01:00
Carlos Garnacho ddd12f3f19 Make GtkSocket use GtkStyleContext 2011-01-04 03:06:12 +01:00
Carlos Garnacho cb21085187 GtkSwitch: remove deprecated call. 2011-01-04 03:06:11 +01:00
Carlos Garnacho f4cc2c6f17 GtkToolbar: remove deprecated call 2011-01-04 03:06:11 +01:00
Carlos Garnacho a090de1780 Make GtkToolButton use ::style-updated 2011-01-04 03:06:10 +01:00
Carlos Garnacho 24db0283ad Update GtkTrayIcon to GtkStyleContext 2011-01-04 03:06:10 +01:00
Carlos Garnacho dd8887c07d Compress all ::style-updated prior to ::realize
This is done to avoid early emission of this signal, that was
causing warnings during GtkDialog construction.
2011-01-04 03:06:09 +01:00
Carlos Garnacho 7981869308 Update GtkAssistant to GtkStyleContext 2011-01-04 03:06:08 +01:00
Carlos Garnacho 00a80c9bdc Update GtkAboutDialog to GtkStyleContext 2011-01-04 02:56:26 +01:00
Carlos Garnacho 804e8a0572 Update GtkToolPalette to GtkStyleContext. 2011-01-04 02:56:26 +01:00
Carlos Garnacho badbef33ab GtkWindow: remove unneeded call
gtk_widget_style_attach() is no longer necessary.
2011-01-04 02:56:25 +01:00
Diego Escalante Urrelo d0a3846eb1 gtkenums: add GTK_STATE_FLAG_NORMAL = 0
Allows a more readable omission of GtkStateFlag arguments.

Bug #638608
2011-01-03 20:37:35 -05:00
Matthias Clasen 83058bf2ca Use AM_V_GEN in a few more places
Based on a patch by Javier Jardón in

https://bugzilla.gnome.org/show_bug.cgi?id=621720
2011-01-03 20:33:36 -05:00
Matthias Clasen 411cda4ff4 Keep an explicit dep on cairo in the gdk pc file 2011-01-03 18:12:54 -05:00
Matthias Clasen 86a7ae67bc GtkColorButton: trivial doc and formatting fixes 2011-01-03 17:18:43 -05:00
Javier Jardón 55016f72f2 gtktexttag: Move public members to private header
And fix gail to not poke at GtkTextTag internals
2011-01-03 15:05:46 -05:00
Matthias Clasen 6a11c59290 Release GtkApplication earlier
GtkWindow was only releasing the application in finalize, causing
problems for language bindings. Now we release it already in destroy
(and then again in finalize for good measure).

https://bugzilla.gnome.org/show_bug.cgi?id=638580
2011-01-03 13:11:55 -05:00
Frederic Crozat b673e5b1ee Scale down print dialog size
Shrink the preview display a little to make the print dialog
fit on a typical netbook screen.

https://bugzilla.gnome.org/show_bug.cgi?id=637958
2011-01-03 12:51:22 -05:00
Matthias Clasen b555be06b7 Make styleexamples work
If we are keeping this code in source control, might as well
make it work.

https://bugzilla.gnome.org/show_bug.cgi?id=638179
2011-01-03 12:34:23 -05:00
Matthias Clasen c7f39eb07e add gtk_selection_data_get_data_with_length API which can be bound
* gtk_selection_data_get_data can't be bound because we need to know the length
  of data inorder to marshal it

https://bugzilla.gnome.org/show_bug.cgi?id=635299
2011-01-03 12:13:30 -05:00
Julien Cristau d211c8af6b gdk/x11: don't select RANDR events if the extension is missing
Prevents an Xlib warning on Xnest, or Xorg with xinerama, or other
non-RANDR-capable xserver.  Reintroduce a have_randr12 field in
GdkDisplayX11 to avoid having to call XRRQuery{Extension,Version} twice,
and don't select randr 1.2 events if that's false.

https://bugzilla.gnome.org/show_bug.cgi?id=634711

Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-03 12:13:30 -05:00
Kristian Høgsberg 317f8baf60 configure.ac: Consolidate gdk backend specific checks and code
Only the big chunk of x11 checks is left further down in the file,
but that depends on variables and checks above it, so we'll leave that in
place for now.
2011-01-03 11:59:45 -05:00
Kristian Høgsberg 9c002cf2c1 Silence automake warnings
When commenting out a binary, also comment out the related variables.
Don't include Makefile.decl in gtk-doc Makefile.am's as they disagree
on assigning to EXTRA_DIST.
2011-01-03 11:59:45 -05:00
Kristian Høgsberg cacee7e7a3 configure.ac: Support multiple GDK backends in one build 2011-01-03 11:59:45 -05:00
Benjamin Otte ae7e5fc2d1 gdk: Simplify code
Move a previous vfunc into the only caller.
2011-01-03 17:44:24 +01:00
Benjamin Otte 6c39cade16 gdk: Get rid of GdkDisplayDeviceHooks
Move the only user to call the function directly and copy the called
function over.
2011-01-03 17:44:24 +01:00
Benjamin Otte 6e18276f52 gdk: Move get_device_state out of the display hooks
Previous callers now use _gdk_device_query_state() directly.
2011-01-03 17:44:24 +01:00
Benjamin Otte 2267602295 gdk: Simplify code
Fold the previous vfunc into the only caller.
2011-01-03 17:44:24 +01:00
Benjamin Otte 8d2104fdc9 gdk: Move window_get_device_position function out of the device hooks 2011-01-03 17:44:24 +01:00
Matthias Clasen c07f9c040f Some configure.ac cleanups
Change from --with-xinput to --enable-xinput, and consistently
use AC_HELP_STRING. Also document the packagekit options in the
docs.
2011-01-03 11:29:26 -05:00
Benjamin Otte d72d19d247 API: gdk: Remove gdk_display_set_device_hooks()
There's no usecase for them, so remove them before we have to commit to
keeping an API.

Make the hooks private for now, actually removing them will come in
followup patches.
2011-01-03 16:51:38 +01:00
Benjamin Otte ff1ad99dce API: gdk: Remove gdk_display_set_pointer_hooks()
Its usecase was GERD - http://testbit.eu/~timj/historic/gerd/ - and that
project is long since dead.

I couldn't find any app using it after asking around and googling either.
2011-01-03 16:35:10 +01:00
Benjamin Otte 36a15720b1 API: gdk: Remove gdk_set_pointer_hooks()
Its usecase was GERD - http://testbit.eu/~timj/historic/gerd/ - and that
project is long since dead.

It has been superseded in GTK 2.2 by GdkDisplayPointerHooks anyway.
2011-01-03 16:25:18 +01:00
Benjamin Otte d1ecd28695 cups: Someone can neither type, read compiler output and run tests.
Being able to do one of these would have caught this.
2011-01-03 16:25:18 +01:00
Matthias Clasen 7537907baf cups printbackend: create a pdf surface when appropriate
This should address bug 560177.
Based on a patch by Adrian Johnson.
2011-01-03 09:34:04 -05:00
Matthias Clasen a493fad990 Remove gtk_printer_new from gtkprintbackend.h
The function has been in gtkprinter.h forever.
2011-01-03 08:14:34 -05:00
Adrian Johnson ebcd0ba233 Set file GtkPrinter accepts_pdf/ps based on selected format 2011-01-03 08:14:34 -05:00
Adrian Johnson 856cc65f63 Set "accepts-pdf" property to true only if supported by the print backend 2011-01-03 08:14:34 -05:00
Carlos Garcia Campos 3fff4bd091 GtkRadioButton: Use "radio" style class instead of "check" 2011-01-03 13:09:00 +01:00
Matthias Clasen 83f5e4868c Drop no-longer-used migration docs 2011-01-02 23:57:03 -05:00
Nguyễn Thái Ngọc Duy cf752786f3 gdkdnd-x11.c: fix building without HAVE_XCOMPOSITE
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
2011-01-02 23:40:00 -05:00
Nguyễn Thái Ngọc Duy 98a30bbf3e gdkcursor-x11.c: fix building without HAVE_XCURSOR
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
2011-01-02 23:39:55 -05:00
Matthias Clasen 85fe6cb2c4 Move GtkSpinButton docs inline
...and modernize the examples at the same time.

This fixes a problem pointed out in bug 638193.
2011-01-02 23:30:02 -05:00
Matthias Clasen 1a87dfdf6d Fix list handling in gdk_x1_display_init_input
Pointed out in bug 638386.
2011-01-02 21:41:30 -05:00
Kjartan Maraas 7ee697ab8d Updated Norwegian bokmål translation from Torstein Adolf Winterseth 2011-01-02 19:32:29 +01:00
Kjartan Maraas 8a9457cb80 Updated Norwegian bokmål translation from Torstein Adolf Winterseth 2011-01-02 19:31:56 +01:00
John Ralls acf13456b1 Fix refresh of static autorelease_pool so that it doesn't happen in gtk-nested loops. 2011-01-02 10:23:20 -08:00
Hans Breuer 23506c0e44 c99ism: declaration in the mid of a block 2011-01-02 13:33:13 +01:00
Hans Breuer 53c1b21ffb win32: disable gdk_display_get_default ()->core_pointer
I neither know how to trigger this code nor what would be
the suggested replacement API. BUt it's the last thing stopping
me to compile GTK3 for win32.
2011-01-02 13:33:12 +01:00
Hans Breuer 5fe027500e win32: include gtkprivate.h for win32 GTK_DATA_PREFIX 2011-01-02 13:33:11 +01:00
Hans Breuer d4c4db6a7c Avoid C99 sinf() 2011-01-02 13:33:10 +01:00
Hans Breuer 67b4eff921 win32: use GtkSocketPrivate 2011-01-02 13:33:09 +01:00
Hans Breuer a2b1da064a win32: ported backend specific code to now backend specific API 2011-01-02 13:33:08 +01:00
Hans Breuer cfeaba9d62 Protect Unix specific print functions with G_OS_UNIX
Although gtk.symbols seems to be unused on Unix now it still
must not contain unprotected Unix only functions, because they
can not be exported on win32.
2011-01-02 13:33:07 +01:00
Hans Breuer 95213b3f04 win32: update msvc build 2011-01-02 13:33:06 +01:00
Hans Breuer 1d838f586c win32: gdk3 resurrection
There are sure regressions but basic stuff seems to be working
again after all the API breakage done with comments like
"Win32 and Quartz need to be ported still."
2011-01-02 13:33:04 +01:00
Hans Breuer fc122305d0 Protect inclusion of unistd.h 2011-01-02 13:29:23 +01:00
Hans Breuer cdb998dea6 Fix line endings
The unix version had CrLf which results in modified by checkout
under windows.
2011-01-02 13:08:06 +01:00
Daniel Nylander 54cd607393 Updated Swedish translation 2010-12-31 01:42:34 +01:00
Daniel Nylander ac8a10f6c4 Updated Swedish translation 2010-12-30 21:15:44 +01:00
Jorge González 3810e4da49 Updated Spanish translation 2010-12-29 22:51:20 +01:00
Fran Diéguez a6168288f8 Solved bug 638231 in Galician translations 2010-12-29 13:05:44 +01:00
Tristan Van Berkom c234313a25 Make GtkCheckButton's label left aligned by default.
Since we no longer limit the label's allocation to the minimum, now
we take a saner approach to left aligning the label.
2010-12-29 18:20:32 +09:00
Tristan Van Berkom a6a97ad442 Fixed unused variable in GtkCheckButton. 2010-12-29 16:30:38 +09:00
Tristan Van Berkom 21aef5b77f Fixed generic height-for-width implementation of GtkBin to consider request adjustments
Since "->adjust_size_request()" was added, it became important for GtkBin's
generic height-for-width implementation to further check the requests
using this vfunc.
2010-12-29 16:26:05 +09:00
Tristan Van Berkom f519da41cf Make GtkCheckButton allocate all remaining space to it's child instead
of limiting it to it's minimum size.

This fixes height-for-width labels inside a GtkCheckButton, for some
reason GtkCheckButton was limiting the child allocation to the child's
minimum request, probably for the sake of virtual left-alignment of
the child label to be beside the checkmark. This should be done by
other means if nescesarry.
2010-12-29 16:19:48 +09:00
Tristan Van Berkom 2fe4e6a815 Added proper height-for-width implementation to GtkAlignment.
For "padding" cases, it would be ok to fallback on GtkBin class
implementation of height-for-width. However in cases where the
user set's an xscale/yscale the GtkAlignment needs to take care
of properly adjusting the for_size when querying it's child.
2010-12-29 16:18:04 +09:00
Tristan Van Berkom 7fab89d93f Removed checks in gtksizerequest.c
Checks were in place to ensure that widgets never request taller
or wider than screen size. This was there to test a theory about
scrolled window children functioning correctly with dynamic content
however it breaks GtkViewport children which can generally return a
value taller than screen height intentionally, GtkViewport uses this
value to update the adjustments.
2010-12-29 16:12:11 +09:00
Carlos Garnacho ac00e77e54 Make GtkToolbar use GtkStyleContext 2010-12-28 19:25:49 +01:00
Carlos Garnacho a3a9c61a5a Make GtkHandleBox use GtkStyleContext 2010-12-28 19:25:49 +01:00
Carlos Garnacho 029fb53ac2 Make GtkSwitch use GtkStyleContext 2010-12-28 19:25:48 +01:00
Carlos Garnacho 18b333bfe7 Make GtkFileChooserEntry make GtkStyleContext 2010-12-28 19:25:48 +01:00
Carlos Garnacho b2e8992291 Make GtkProgressBar use GtkStyleContext 2010-12-28 19:25:48 +01:00
Carlos Garnacho e3457a83cf Make GtkScrolledWindow use GtkStyleContext 2010-12-28 19:25:48 +01:00
Carlos Garnacho 53a4feadf0 Make GtkEventBox use GtkStyleContext. 2010-12-28 19:25:47 +01:00
Carlos Garnacho 06462b98a0 Make GtkFrame use GtkStyleContext. 2010-12-28 19:18:57 +01:00
Carlos Garnacho 7a623988e5 Fix leak in GtkStyle. 2010-12-28 19:06:46 +01:00
Tristan Van Berkom 05254766c7 Avoid rendering frames when shadow type argument is GTK_SHADOW_NONE in
gtk_paint_* functions.
2010-12-28 23:15:39 +09:00
Ignacio Casal Quinteiro 9d64a5833d Fix docs. 2010-12-28 11:18:01 +01:00
Matthias Clasen 7032996c76 Remove bashisms from configure.ac
Pointed out by Koop Mast in
https://bugzilla.gnome.org/show_bug.cgi?id=637974
2010-12-27 19:24:05 -05:00
Benjamin Otte 42fbccd3d2 API: gdk: Remove gdk_device_set_source()
The source of a device is not changeable.
2010-12-27 20:08:50 +01:00
Benjamin Otte e4cc259111 testgtk: Don't use deprecated APIs 2010-12-27 19:43:24 +01:00
Benjamin Otte 7ab7422821 testgtk: Use the relevant device to query the widget to snapshot
Also gets rid of deprecated functions.
2010-12-27 19:27:16 +01:00
Benjamin Otte 9746991548 API: gdk: Make gdk_display_get_window_at_device_position() a device API
It's now called gdk_device_get_window_at_position(). It doesn't make
sense to keep device-specific API part of the display.
2010-12-27 18:46:41 +01:00
Benjamin Otte 0c285341a9 API: gdk: gdk_display_get_device_state() => gdk_device_get_position()
The API was not display-specific, but belonged to the device. Also, we
didn't find a user of the modifier mask, so we dropped it.
2010-12-27 18:46:41 +01:00
Alejandro Piñeiro 586283ecbb [gail] Clean the code to check the redundan object on the show watcher
The watcher doesn't add a window if is a redundant object. This
patch fixes two things:

 * The check was made twice.
 * It uses a check with the string "redundant object", when the
   defined role ATK_ROLE_REDUNDANT_OBJECT is available
2010-12-27 16:23:55 +01:00
Alejandro Piñeiro e1029b907c [gail] Proper connection to a toplevel window destroy signal
Only connect to the destroy of a toplevel window if it was
really added to the toplevel list of windows.

The destroy callback was added to remove the window from
the toplevel list. The callback doesn't cause a error,
but would iterate on the toplevel list without success.
2010-12-27 13:21:09 +01:00
Matthias Clasen 48b47971b5 Fix some issues with initial setup of GdkX11DisplayManager
We need to defer setting the default display until the
GdkDisplay is fully initialized. Also, short-circuit some
encoding conversions when creating windows, to avoid an
implicit dependency on the display being in the list of
displays yet.
2010-12-27 01:02:52 -05:00
Matthias Clasen 59ea137fa0 GtkTreeView: Don't use deprecated grab api 2010-12-26 23:40:59 -05:00
Matthias Clasen 51f7e42650 Remove pointless sealing from GtkTextMark 2010-12-26 23:17:10 -05:00
Matthias Clasen 0c4a0dae6d Remove pointless sealing from GtkTextChild 2010-12-26 22:58:57 -05:00
Matthias Clasen 9dee9a84d0 Removed sealed members from GtkMenuItem 2010-12-26 22:58:57 -05:00
A S Alam 05eb55dcfc update Punjabi Properities file 2010-12-27 07:30:19 +05:30
Benjamin Otte 45d98d108e tooltip: Don't use deprecated APIs 2010-12-27 01:05:40 +01:00
Benjamin Otte a5f493bfad notebook: Use nondeprecated API to query coordinates 2010-12-27 00:50:30 +01:00
Benjamin Otte 9bab53f1bd hsv: Fix gcc warnings 2010-12-27 00:45:56 +01:00
Matthias Clasen 5bc0cf1a19 Fix some more typos 2010-12-25 00:29:23 -05:00
Matthias Clasen 8f816d7c3b Fix a few typos 2010-12-25 00:26:22 -05:00
Matthias Clasen 27ce9421d0 Fix up GDK docs 2010-12-25 00:02:39 -05:00
Matthias Clasen 436e75c34c Add deprecation guards for deprecated grab APIs 2010-12-24 20:01:24 -05:00
Matthias Clasen bde1d072e5 Don't use gdk_{pointer,keyboard}_grab
Instead use gdk_device_grab.
2010-12-24 20:00:19 -05:00
Matthias Clasen 1d41b98cf8 Add deprecation guards for deprecated GdkAppLaunchContext API
Also adapt the docs to not use deprecated API.
2010-12-24 17:37:00 -05:00
Matthias Clasen 1e13b42b9b Avoid some gtk-doc warnings 2010-12-24 17:36:19 -05:00
Matthias Clasen 29eb3fba5f Fix gdk_x11_display_text_property_to_text_list
This was an incomplete attempt to get rid of the custom free function.
Lets just keep it for now. Bug 637849, patch by Dan Winship.

Also add a test case for this function.
2010-12-24 16:27:31 -05:00
Matthias Clasen 92f163d40a Consistently hide class structs
And, since we've decided to keep the structs private, there is
no point in having the standard GObject clas macros anymore either.
2010-12-24 15:54:12 -05:00
John Ralls 806b6dfa08 Rename GdkQuartzWindow.h and .c to GdkQuartzNSWindow.h and .c
Normally HFS+ (the MacOSX file system) isn't case-sensitive, so having both
GtkQuartzWindow.h and gtkquartzwindow.h causes the latter to overwrite the
former during git pull, breaking the build.
2010-12-24 11:29:08 -08:00
Carlos Garnacho 0f0512aee3 Use gtk_style_context_get_font() in GtkSpinButton 2010-12-24 20:20:40 +01:00
Carlos Garnacho 92102c3bf4 Make GtkSeparator use GtkStyleContext 2010-12-24 19:38:14 +01:00
Carlos Garnacho 7c35994bda Make GtkPaned use GtkStyleContext 2010-12-24 19:38:06 +01:00
Carlos Garnacho 760d6d1e78 Do not set "entry" class in spinbutton buttons.
Also, fix an unpaired gtk_style_context_save() call.
2010-12-24 19:37:56 +01:00
Carlos Garnacho 2bd221d215 Bug 637910 - GtkSpinner - does not animate
Fix widget-to-window coordinates translation in the
style context animation code.
2010-12-24 19:37:49 +01:00
Carlos Garnacho 7f099a9a23 Make GtkArrow use GtkStyleContext 2010-12-24 19:37:41 +01:00
Carlos Garnacho e5e95934ba Fix color name (as of rgb.txt) parsing in symbolic colors
The end of the substring wasn't being detected properly.
2010-12-24 19:37:30 +01:00
Carlos Garnacho 1cecb10584 Make GtkAccelLabel use GtkStyleContext. 2010-12-24 19:37:20 +01:00
Javier Jardón 5e74427dee gailmenushell.c: Fix typo 2010-12-24 18:42:24 +01:00
Javier Jardón 03cddad42b build: Use autoreconf 2010-12-24 18:40:54 +01:00
Kristian Rietveld c659542333 Check for NULL pointer 2010-12-24 14:45:47 +01:00
Javier Jardón 30cdab13fe docs: Add docs about how to get a GtkDevice
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=637895
2010-12-24 14:39:55 +01:00
Matthias Clasen 55ca24d1d4 Drop GtkThemeEngine
It is not used anymore.
2010-12-23 22:16:50 -05:00
Matthias Clasen ca493cd20d Fix a few warnings 2010-12-23 22:11:50 -05:00
Matthias Clasen 7ff572dfd3 Add some missing includes 2010-12-23 22:11:28 -05:00
Matthias Clasen 1bcf8a0027 Remove sealed members from GtkSettings 2010-12-23 21:56:50 -05:00
Stef Walter 433a22cd11 Remove private header from gtkwindow.h
https://bugzilla.gnome.org/show_bug.cgi?id=637907
2010-12-23 19:23:48 -06:00
Matthias Clasen 7650482e46 Add sufficient API to make gail work
The accessible implementations should really be folded into
gtk proper. Until that happens, we need some more guts exposed...
2010-12-23 20:11:38 -05:00
Matthias Clasen 2ed81aa57c Remove sealed members from GtkMenuShell 2010-12-23 18:21:53 -05:00
Matthias Clasen c5b020e628 Remove sealed members from GtkMenu 2010-12-23 15:51:20 -05:00
Jorge Gonzalez 65652d818d Updated Spanish translation 2010-12-23 20:47:02 +01:00
Gheyret T.Kenji 9b6a0a0e2b Added UG translation 2010-12-23 20:17:15 +01:00
Gheyret T.Kenji 80b534561b Added UG translation 2010-12-23 20:11:32 +01:00
Gheyret T.Kenji 4064a100f0 Added UG translation 2010-12-23 19:18:55 +01:00
Matthias Clasen 96d1c2c46e Reserve space for a pointer in GtkDrawingArea
It was pointed out that this will let us add a private pointer
without abi break in the future, should we ever need one.
2010-12-23 13:01:21 -05:00
Matthias Clasen 3e08a23237 Drop long-obsolete linux framebuffer APIs
The functions to set frames on windows stopped being interesting
when the linux framebuffer port was dropped, many years ago.

Similar functionality may come back with client-side decorations
in the future.
2010-12-23 12:59:49 -05:00
Kristian Rietveld 9ab2786991 GtkCellRendererText: use PANGO_PIXELS_CEIL for text_width
Usually pango_layout_get_pixel_extents() is used, which uses
PANGO_PIXELS_CEIL on the rectangle's width.  This commit makes the new
function gtk_cell_renderer_text_get_preferred_width() consistent with
this.

This fixes rounding errors on Mac OS X, where we were seeing tree views
with a double height for a single line of text, while the usual single
row height would have been sufficient.
2010-12-23 18:41:23 +01:00
Kristian Rietveld 31536736ea Hide GtkTreeViewColumn buttons when header_window is not visible 2010-12-23 18:19:56 +01:00
Kristian Rietveld 26173c7864 Delimit the other_entries array 2010-12-23 18:19:55 +01:00
Matthias Clasen 3a6800a898 Some small doc corrections 2010-12-23 11:18:50 -05:00
Matthias Clasen 1f9ce46906 Update keymap docs to match current behaviour
An overlooked API change in the gdk-backend work: many of the
keymap functions used to accept NULL to mean 'default keymap'.
They no longer do, so update the docs to match the new behaviour.
2010-12-23 10:06:08 -05:00
Kristian Rietveld 374f8e22aa quartz: internalize _gdk_quartz_window_set_needs_display_in_region 2010-12-23 14:17:42 +01:00
Kristian Rietveld f0b8dcb4f3 quartz: move gdkgeometry-quartz into gdkwindow-quartz.c 2010-12-23 14:17:42 +01:00
Kristian Rietveld deffbd9885 quartz: reorder gdkprivate-quartz.h and related clean up 2010-12-23 14:17:42 +01:00
Kristian Rietveld ac6f50120b quartz: _gdk_quartz_visual -> gdk_quartz_visual 2010-12-23 14:17:42 +01:00
Kristian Rietveld 1e2907fa02 quartz: _gdk_quartz_screen -> gdk_quartz_screen 2010-12-23 14:17:42 +01:00
Kristian Rietveld 0736544174 quartz: _gdk_quartz_keymap -> gdk_quartz_keymap 2010-12-23 14:17:42 +01:00
Kristian Rietveld 0d8eeb924e quartz: _gdk_quartz_display -> gdk_quartz_display 2010-12-23 14:17:42 +01:00
Kristian Rietveld 07110a6170 quartz: we must provide a window on drag begin now 2010-12-23 14:17:42 +01:00
Kristian Rietveld 0840b25165 quartz: fix some more typos 2010-12-23 14:17:42 +01:00
Kristian Rietveld 1e814709d7 quartz: fix typo 2010-12-23 14:17:41 +01:00
Kristian Rietveld fb8717f722 quartz: move utils to gdkutils-quartz.c 2010-12-23 14:17:41 +01:00
Kristian Rietveld f15934bd66 quartz: remove gdkmain-quartz.c 2010-12-23 14:17:41 +01:00
Kristian Rietveld caa9794af8 quartz: Clean up header files, use same arrangement as X11 backend 2010-12-23 14:17:41 +01:00
Erdal Ronahi dd5a74dcbc Updated Kurdish translations 2010-12-23 14:14:10 +01:00
Matthias Clasen af9d59aaca Allow inspection of construct-only object properties
The 'Properties' button here is not really modifying the property
in any way, so it doesn't make sense to disable it just because
the object can only be set at construction.

This lets us poke at e.g. the cell area of an icon view.
2010-12-23 00:43:50 -05:00
Brian Cameron f90365d46b Fix spacing. 2010-12-22 21:58:40 -06:00
Brian Cameron e88a44f4c9 Fix bug #637721, fix function prototype. 2010-12-22 21:57:12 -06:00
Matthias Clasen d77dcfb9b2 Better fix for keynav dnd
With proper rounding, we can go back to a 'small step' of 1.
2010-12-22 22:33:40 -05:00
Matthias Clasen 7e0a30b752 Abort a drag when a keynav drop has not destination
This was claimed to cause problems for Chromium, see bug 599130.

Also work around apparent rounding errors in XIWarpDevice by
setting the 'small step' for keynav dnd to 2 instead of 1 - I notice
that a warp seems to sometimes warp a little less than I tell it to,
and if I tell it to only move by 1 pixel then moving less means
that you are stuck.
2010-12-22 21:47:14 -05:00
Matthias Clasen 9baf24f87e Add a default handler for drag_failed
And use it in notebook dnd.
2010-12-22 18:46:29 -05:00
Matthias Clasen e6693ab840 Avoid invariant checking spew in gnome-shell
For normal toplevels, visible is tightly bound to mapped, but for
something like a toplevel that exists within a Clutter stage we
may want to make mapping dependenton external factors, so we shouldn't
actually checked that !mapped toplevels are !visible.

Pointed out by Owen Taylor,

https://bugzilla.gnome.org/show_bug.cgi?id=637834
2010-12-22 16:54:52 -05:00
Kristian Rietveld 197590258f quartz: Make keyboard input work again 2010-12-22 22:33:05 +01:00
Kristian Rietveld 48b6b939d3 Implement process_updates_recurse for GdkOffscreenWindow
Makes offscreen windows work again.
2010-12-22 20:41:39 +01:00
Matthias Clasen 03f7e26d26 Don't return PropertyNotify.state as modifier state
It isn't, it really is a GdkPropertyState.

Reported by Tim Janik in bug 633795.
2010-12-22 14:33:09 -05:00
Matthias Clasen 3adb7c7a49 Avoid a crash
pointed out in bug 533745
2010-12-22 14:08:03 -05:00
Javier Jardón 187762d8b3 docs: fix a typo 2010-12-22 17:05:50 +00:00
Kristian Rietveld 083c556e00 quartz: rename GdkDeviceManagerCore -> GdkQuartzDeviceManagerCore 2010-12-22 17:47:05 +01:00
Kristian Rietveld 59a3d9ae46 quartz: Rename GdkDeviceCore -> GdkQuartzDeviceCore 2010-12-22 17:47:05 +01:00
Kristian Rietveld e2e4391992 quartz: commit forgotten file 2010-12-22 17:47:05 +01:00
Kristian Rietveld 2e7f14c90f quartz: GdkDeviceCore: check for NULL pointer 2010-12-22 17:47:04 +01:00
Kristian Rietveld 32731fcb07 quartz: register before/after process all updates 2010-12-22 17:47:04 +01:00
Kristian Rietveld ab74358b82 quartz: set all methods on window class, not root window class 2010-12-22 17:47:04 +01:00
Kristian Rietveld 552e7be7e5 quartz: set window_type in display_class 2010-12-22 17:47:04 +01:00
Kristian Rietveld b0ffe16f90 quartz: introduce GdkQuartzWindow (as a subclass of GdkWindow) 2010-12-22 17:47:04 +01:00
Kristian Rietveld 3bc60a8149 quartz: rename GdkQuartzWindow to GdkQuartzNSWindow 2010-12-22 17:47:04 +01:00
Kristian Rietveld c6fad1d2cb quartz: fix typo 2010-12-22 17:47:04 +01:00
Kristian Rietveld c87e878308 quartz: add new files to Makefile.am 2010-12-22 17:47:04 +01:00
Kristian Rietveld e5695de12b GdkDisplayManager: register Quartz backend when applicable 2010-12-22 17:47:04 +01:00
Kristian Rietveld 5226ae3ecc quartz: create gdkdisplaymanager-quartz.h 2010-12-22 17:47:04 +01:00
Kristian Rietveld f2883fe8eb quartz: gdkselection-quartz.c: fix typos 2010-12-22 17:47:04 +01:00
Kristian Rietveld b638515ae0 quartz: re-introduce _gdk_quartz_display_list_devices 2010-12-22 17:47:03 +01:00
Kristian Rietveld 4c663f0474 gdkwindow-quartz: fix typo 2010-12-22 17:47:03 +01:00
Kristian Rietveld 4a6c50c298 gtkclipboard-quartz: use accessors and add missing include 2010-12-22 17:47:03 +01:00
Kristian Rietveld 44d9fb2d71 gtkdnd-quartz: use accessors and add missing include 2010-12-22 17:47:03 +01:00
Kristian Rietveld 7979be1430 quartz: gtkquartz.c: add missing include 2010-12-22 17:47:03 +01:00
Kristian Rietveld 9b4f5a424c gdk: Fix toplevel makefile to build non-x11 backends again 2010-12-22 17:47:03 +01:00
Kristian Rietveld 6b96c56976 quartz: remove duplicate definition of gdk_flush 2010-12-22 17:47:03 +01:00
Kristian Rietveld 8b4d583cd8 quartz: gdkkeys-quartz.c: remove duplicate function 2010-12-22 17:47:03 +01:00
Kristian Rietveld 3d02a14f4f quartz: remove duplicate functions from gdkmain-quartz.c 2010-12-22 17:47:03 +01:00
Kristian Rietveld fbd9fd6a38 quartz: make gdkwindow-quartz.c build again 2010-12-22 17:47:03 +01:00
Kristian Rietveld c14078f388 quartz: adapt gdkdisplay-quartz.c to new function names 2010-12-22 17:47:03 +01:00
Kristian Rietveld 5f782ed9e7 quartz: add prototype for _gdk_quartz_screen_new() 2010-12-22 17:47:03 +01:00
Kristian Rietveld 1b344ad8e4 quartz: convert GdkVisual 2010-12-22 17:47:02 +01:00
Kristian Rietveld d024153c96 quartz: Fix screen implementation, rename to GdkQuartzScreen 2010-12-22 17:47:02 +01:00
Kristian Rietveld cde6dade8f quartz: Port gdkkeys-quartz.c to new API 2010-12-22 17:47:02 +01:00
Kristian Rietveld 6fe3100f14 quartz: Remove gdkinput code 2010-12-22 17:47:02 +01:00
Kristian Rietveld e4a0101542 quartz: gdkeventloop-quartz.c: fix 2010-12-22 17:47:02 +01:00
Kristian Rietveld d0976d9f53 quartz: Fix gdkevents-quartz.c 2010-12-22 17:47:02 +01:00
Kristian Rietveld b2844cb48b quartz: Make GdkQuartzDisplay compile 2010-12-22 17:47:02 +01:00
Kristian Rietveld 709b4d4346 quartz: Fix display manager, move over code from gdkmain-quartz.c 2010-12-22 17:47:02 +01:00
Kristian Rietveld 988b8bf96a quartz: gdkcursor-quartz.h: fix cut-n-paste error 2010-12-22 17:47:02 +01:00
Kristian Rietveld 98b8bf035f quartz: gdkdevice-core: fix up 2010-12-22 17:47:02 +01:00
Kristian Rietveld da481666cd quartz: gdkdevice-core.c: use GdkQuartzCursor 2010-12-22 17:47:01 +01:00
Kristian Rietveld 62273fc08a quartz: add forgotten file (gdkdnd-quartz.h) 2010-12-22 17:47:01 +01:00
Kristian Rietveld f4c0c47a1a quartz: move bits into gdkcursor-quartz.h (private header for now) 2010-12-22 17:47:01 +01:00
Kristian Rietveld dff3973198 quartz: remove GdkCursorPrivate typedef 2010-12-22 17:47:01 +01:00
Kristian Rietveld 013cbea25f quartz: Remove API for extension checks 2010-12-22 17:47:01 +01:00
Kristian Rietveld 881ea6e06c quartz: convert GdkQuartzWindow to new drag context API 2010-12-22 17:47:01 +01:00
Kristian Rietveld 71404825c3 quartz: fix up GdkDragContext conversion 2010-12-22 17:47:01 +01:00
Kristian Rietveld 8cb301762a Fix typo 2010-12-22 17:47:01 +01:00
Kristian Rietveld 3ace122563 quartz: turn quartz GdkCursor into GObject 2010-12-22 17:47:01 +01:00
Matthias Clasen bd1ff477ca Deal with property encoding functions for quartz 2010-12-22 17:47:01 +01:00
Matthias Clasen de41790470 Implement selection related vfuncs for quartz 2010-12-22 17:47:01 +01:00
Matthias Clasen 762548d303 Implement selection owner vfuncs for quartz 2010-12-22 17:47:01 +01:00
Matthias Clasen 547d674ce5 Implement window property vfuncs for quartz 2010-12-22 17:47:01 +01:00
Matthias Clasen 168b3c13b7 Implement keyval vfuncs for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen 9ae2dc0deb Drop gdk_set_locale from quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen a1b300ecb6 Implement test vfuncs for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen 6eb2a3520c Implement atom-related vfuncs for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen 51f149df5e Implement get_keymap vfunc for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen 46352afa6f Implement create_window_impl vfunc for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen 57efe15bda Drop gdk_spawn functions
These have been removed since the implementation was just
a straight wrapper around g_spawn.
2010-12-22 17:47:00 +01:00
Matthias Clasen 9dbe3bd316 Drop unimplemented foreign window functions
These have been relegated to backend-specific
2010-12-22 17:47:00 +01:00
Matthias Clasen b2ff02332f Implement event_data_{copy,free} for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen 4b92625fe0 Implement notify_startup_complete vfunc for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen 2f3c7da763 Remove a duplicate doc comment 2010-12-22 17:47:00 +01:00
Matthias Clasen 1a04631707 Implement get_next_serial for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen dadbc63f1e gdk_display_warp_pointer is in the frontend now 2010-12-22 17:46:59 +01:00
Matthias Clasen a1a0205dad Implment process_updates_recurse vfunc for quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen 3232be603a Implement has_pending and queue_events vfuncs for quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen 733c8fc8e7 Derive GdkDisplayManager for quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen 8a9c604b8a Adapt quartz device code to new ways
We will need to rename the Core implementations in X11/Quartz
to not clash, later.
2010-12-22 17:46:59 +01:00
Matthias Clasen e2fea748d6 Adapt quartz visual code to new ways
We may still need a subclass here later, not sure
2010-12-22 17:46:59 +01:00
Matthias Clasen 46e8aadaf8 Rename _gdk_dnd_init 2010-12-22 17:46:59 +01:00
Matthias Clasen 25271f5e9a Implement dnd vtables for quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen d2ce9ec3dc Convert a bunch of visual related calls to use the screen vtable, quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen 41352f24d6 Convert all GdkScreen methods to vtable calls, quartz backend 2010-12-22 17:46:59 +01:00
Matthias Clasen f43f259d49 Derive GdkKeymap for Quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen acd99409b8 Make display method vtable calls, quartz backend 2010-12-22 17:46:59 +01:00
Matthias Clasen 064bfceaad Convert all gdk_window methods to vtable calls in the quartz backend 2010-12-22 17:46:59 +01:00
Matthias Clasen 62cbc1acd4 continue to install gdk-$TARGET-3.0.pc 2010-12-22 11:39:58 -05:00
Matthias Clasen 05b43caf4c Add a section about gdk_spawn to migration guide 2010-12-22 11:13:31 -05:00
Tristan Van Berkom e20503836c Fixed GtkGrid GtkContainerClass->forall() to not use a for loop.
This loop needs to be safe for removing children in a forall loop.
2010-12-22 21:25:53 +09:00
Matthias Clasen 367211ed7f Document WINDOWING macros 2010-12-22 01:43:57 -05:00
Matthias Clasen 3973ef760e Mention GDK_BACKEND in the docs 2010-12-22 01:32:18 -05:00
Matthias Clasen fa59cc4652 Fix the X backend docs 2010-12-22 01:31:15 -05:00
Matthias Clasen a6b05106a5 GtkAboutDialog: Be slightly more flexible when listing credits
Make sure we render credits ok that are occurring in the wild,
such as "Contact us at:", "<foo@bar>" or "guy1\nguy2\nguy3"

https://bugzilla.gnome.org/show_bug.cgi?id=637763
https://bugzilla.gnome.org/show_bug.cgi?id=637736
2010-12-22 01:03:58 -05:00
Matthias Clasen 4cc76927b1 Show translators properly in the new about dialog
translator-credits is a single string, typically with newline-
separated names.
2010-12-22 00:31:05 -05:00
Robert Ancell 2013e23c4b Use getters and setters for GtkPrintJob in gtkprintbackendtest.c 2010-12-22 15:36:47 +11:00
Robert Ancell f4419be0d6 Fix DSO link issues 2010-12-22 15:01:50 +11:00
Matthias Clasen e60eff282a Bump version 2010-12-21 20:17:35 -05:00
633 changed files with 94817 additions and 88659 deletions
+3 -4
View File
@@ -47,7 +47,6 @@ MAINTAINERCLEANFILES = \
$(srcdir)/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/missing \
$(srcdir)/mkinstalldirs \
$(srcdir)/omf.make \
$(srcdir)/xmldocs.make \
$(srcdir)/gtk-doc.make \
@@ -71,7 +70,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 += $(patsubst %,gtk+-%-3.0.pc,@gdktarget@)
pkgconfig_DATA += ${GDK_BACKENDS:%=gtk+-%-3.0.pc}
pkgconfig_DATA += ${GDK_BACKENDS:%=gdk-%-3.0.pc}
if OS_UNIX
pkgconfig_DATA += gtk+-unix-print-3.0.pc
@@ -94,8 +94,7 @@ distclean-local:
fi
ChangeLog:
@echo Creating $@
@if test -d "$(srcdir)/.git"; then \
$(AM_V_GEN) 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; \
+8 -2
View File
@@ -17,9 +17,15 @@ 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 = \
test "$(gdktarget)" != "x11" \
&& echo "Gtk+Tests:INFO: Skipping GUI tests for non-X11 target."
false
else
SKIP_GDKTARGET = \
echo "Gtk+Tests:INFO: Skipping GUI tests for non-X11 target."
endif
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` \
+160
View File
@@ -1,3 +1,163 @@
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
==============================================
+1 -1
View File
@@ -85,7 +85,7 @@ LDFLAGS="-L/devel/dist/${ARCH}/${LIBPNG}/lib \
LIBS=-lintl \
CFLAGS=-O2 \
./configure \
--with-gdktarget=win32 \
--enable-win32-backend \
--disable-gdiplus \
--with-included-immodules \
--without-libjasper \
+18 -116
View File
@@ -1,130 +1,32 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.
ORIGDIR=`pwd`
cd $srcdir
PROJECT=Gtk+
TEST_TYPE=-d
FILE=gdk
olddir=`pwd`
cd "$srcdir"
DIE=0
have_libtool=false
if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
libtool_version=`libtoolize --version |
head -1 |
sed -e 's/^\(.*\)([^)]*)\(.*\)$/\1\2/g' \
-e 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
case $libtool_version in
2.*)
have_libtool=true
;;
esac
fi
if $have_libtool ; then : ; else
echo
echo "You must have libtool 2.2 installed to compile $PROJECT."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
DIE=1
fi
(gtkdocize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have gtk-doc installed to compile $PROJECT."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/"
DIE=1
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $PROJECT."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
DIE=1
}
if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-1.11
ACLOCAL=aclocal-1.11
else if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then
AUTOMAKE=automake-1.10
ACLOCAL=aclocal-1.10
GTKDOCIZE=`which gtkdocize`
if test -z $GTKDOCIZE; then
echo "*** No GTK-Doc found, please install it ***"
exit 1
else
echo
echo "You must have automake 1,10.x or 1.11.x installed to compile $PROJECT."
echo "Install the appropriate package for your distribution,"
echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
DIE=1
gtkdocize || exit $?
fi
fi
if test "$DIE" -eq 1; then
exit 1
fi
test $TEST_TYPE $FILE || {
echo "You must run this script in the top-level $PROJECT directory"
exit 1
}
# NOCONFIGURE is used by gnome-common; support both
if ! test -z "$AUTOGEN_SUBDIR_MODE"; then
NOCONFIGURE=1
fi
if test -z "$NOCONFIGURE"; then
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
fi
if test -z "$ACLOCAL_FLAGS"; then
acdir=`$ACLOCAL --print-ac-dir`
m4list="glib-2.0.m4 glib-gettext.m4"
for file in $m4list
do
if [ ! -f "$acdir/$file" ]; then
echo "WARNING: aclocal's directory is $acdir, but..."
echo " no file $acdir/$file"
echo " You may see fatal macro warnings below."
echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
echo " environment variable to \"-I /some/dir\", or install"
echo " $acdir/$file."
echo ""
fi
done
fi
rm -rf autom4te.cache
# README and INSTALL are required by automake, but may be deleted by clean
# up rules. to get automake to work, simply touch these here, they will be
# regenerated from their corresponding *.in files by ./configure anyway.
touch README INSTALL
gtkdocize || exit $?
$ACLOCAL -I m4 $ACLOCAL_FLAGS || exit $?
libtoolize --force || exit $?
autoheader || exit $?
$AUTOMAKE --add-missing || exit $?
autoconf || exit $?
cd $ORIGDIR || exit $?
if test -z "$NOCONFIGURE"; then
$srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
echo
echo "Now type 'make' to compile $PROJECT."
AUTORECONF=`which autoreconf`
if test -z $AUTORECONF; then
echo "*** No autoreconf found, please install it ***"
exit 1
else
autoreconf --force --install --verbose || exit $?
fi
cd "$olddir"
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
+6 -5
View File
@@ -6,17 +6,18 @@ first need to use some Unix-like environment or manual work to expand
the files needed, like config.h.win32.in into config.h.win32 and the
.vcprojin files here into corresponding actual .vcproj files.
You will need the parts from below in the GTK+ stack: pango, atk and
glib. External dependencies are at least zlib, libpng, proxy-libintl,
fontconfig, freetype, expat. See the corresponding README.txt file in
glib for details where to unpack them.
You will need the parts from below in the GTK+ stack: gdk-pixbuf, pango,
atk and glib. External dependencies are at least zlib, libpng,
proxy-libintl, fontconfig, freetype, expat. See the corresponding
README.txt file in glib for details where to unpack them.
The "install" project will copy build results and headers into their
appropriate location under <root>\vs9\<PlatformName>. For instance,
built DLLs go into <root>\vs9\<PlatformName>\bin, built LIBs into
<root>\vs9\<PlatformName>\lib and GTK+ headers into
<root>\vs9\<PlatformName>\include\gtk-2.0. This is then from where
<root>\vs9\<PlatformName>\include\gtk-3.0. This is then from where
project files higher in the stack are supposed to look for them, not
from a specific GLib source tree.
--Tor Lillqvist <tml@iki.fi>
--Updated by Chun-wei Fan <fanc999 --at-- yahoo --dot-- com --dot-- tw>
+8 -13
View File
@@ -31,7 +31,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -52,7 +52,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="$(GdkDefines);INSIDE_GDK_WIN32"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -72,7 +72,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -93,7 +93,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="$(GdkDefines);INSIDE_GDK_WIN32"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -122,29 +122,24 @@
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\gdkwin32displaymanager.c" />
<File RelativePath="..\..\..\gdk\win32\gdkwin32id.c" />
<File RelativePath="..\..\..\gdk\win32\gdkwindow-win32.c" />
</Filter>
+9 -8
View File
@@ -31,7 +31,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="_DEBUG;$(GdkDefines)"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -42,7 +42,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib imm32.lib"
AdditionalDependencies="imm32.lib"
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\gdk.def"
@@ -63,7 +63,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="$(GdkDefines)"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -72,7 +72,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib imm32.lib"
AdditionalDependencies="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-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="_DEBUG;$(GdkDefines)"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -107,7 +107,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib imm32.lib"
AdditionalDependencies="imm32.lib"
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\gdk.def"
@@ -128,7 +128,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="$(GdkDefines)"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -137,7 +137,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib imm32.lib"
AdditionalDependencies="imm32.lib"
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\gdk.def"
@@ -216,6 +216,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
#include "libgdk.sourcefiles"
<File RelativePath="..\..\..\gdk\gdkkeynames.c" />
</Filter>
</Files>
</VisualStudioProject>
+23 -13
View File
@@ -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"
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"
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 gio-2.0.lib gmodule-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib"
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"
AdditionalLibraryDirectories="$(GlibEtcInstallRoot)\lib"
/>
<Tool
@@ -24,9 +24,7 @@ if exist ..\..\..\config.h goto DONE_CONFIG_H&#x0D;&#x0A;
copy ..\..\..\config.h.win32 ..\..\..\config.h&#x0D;&#x0A;
:DONE_CONFIG_H&#x0D;&#x0A;
if exist ..\..\..\gdk\gdkconfig.h goto DONE_GDKCONFIG_H&#x0D;&#x0A;
copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h&#x0D;&#x0A;
:DONE_GDKCONFIG_H&#x0D;&#x0A;
"
/>
<UserMacro
@@ -87,10 +85,8 @@ copy ..\..\..\gdk\gdkdevicemanager.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&
copy ..\..\..\gdk\gdkdisplay.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkdisplaymanager.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkdnd.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkdrawable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkenumtypes.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkevents.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkinput.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkkeys.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkkeysyms.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkmain.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
@@ -102,7 +98,6 @@ copy ..\..\..\gdk\gdkrectangle.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D
copy ..\..\..\gdk\gdkrgba.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkscreen.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkselection.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkspawn.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdktestutils.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdkthreads.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
copy ..\..\..\gdk\gdktypes.h $(OutDir)\include\gtk-$(GtkApiVersion)\gdk&#x0D;&#x0A;
@@ -123,6 +118,10 @@ copy ..\..\..\gtk\gtkactiongroup.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x
copy ..\..\..\gtk\gtkactivatable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkadjustment.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkalignment.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkappchooser.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkappchooserbutton.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkappchooserdialog.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkappchooserwidget.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkapplication.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkarrow.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkaspectframe.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -131,10 +130,14 @@ copy ..\..\..\gtk\gtkbbox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0
copy ..\..\..\gtk\gtkbin.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkbindings.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkbox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkborder.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkbuildable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkbuilder.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkbutton.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcalendar.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcellarea.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcellareabox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcellareacontext.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcelleditable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcelllayout.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcellrenderer.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -156,6 +159,7 @@ copy ..\..\..\gtk\gtkcolorseldialog.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk
copy ..\..\..\gtk\gtkcombobox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcomboboxtext.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcontainer.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkcssprovider.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkdebug.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkdialog.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkdnd.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -176,12 +180,12 @@ copy ..\..\..\gtk\gtkfixed.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x
copy ..\..\..\gtk\gtkfontbutton.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkfontsel.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkframe.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkgradient.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkgrid.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkhandlebox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkhbbox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkhbox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkhpaned.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkhruler.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkhscale.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkhscrollbar.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkhseparator.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -212,6 +216,7 @@ copy ..\..\..\gtk\gtkmisc.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0
copy ..\..\..\gtk\gtkmodules.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkmountoperation.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtknotebook.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtknumerableicon.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkoffscreenwindow.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkorientable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkpagesetup.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -237,7 +242,6 @@ copy ..\..\..\gtk\gtkrecentchoosermenu.h $(OutDir)\include\gtk-$(GtkApiVersion)\
copy ..\..\..\gtk\gtkrecentchooserwidget.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkrecentfilter.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkrecentmanager.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkruler.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkscale.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkscalebutton.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkscrollable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -258,9 +262,15 @@ copy ..\..\..\gtk\gtkstatusbar.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D
copy ..\..\..\gtk\gtkstatusicon.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkstock.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkstyle.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkstylecontext.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkstyleproperties.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkstyleprovider.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkswitch.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtksymboliccolor.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktearoffmenuitem.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktestutils.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktextattributes.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktextbuffer.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktextbufferrichtext.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktextchild.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -271,6 +281,7 @@ copy ..\..\..\gtk\gtktextmark.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;
copy ..\..\..\gtk\gtktexttag.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktexttagtable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktextview.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkthemingengine.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktoggleaction.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktogglebutton.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktoggletoolbutton.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -291,7 +302,6 @@ copy ..\..\..\gtk\gtktreestore.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D
copy ..\..\..\gtk\gtktreeview.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktreeviewcolumn.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktypebuiltins.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtktypeutils.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkuimanager.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkvbbox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkvbox.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
@@ -299,15 +309,15 @@ copy ..\..\..\gtk\gtkversion.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&
copy ..\..\..\gtk\gtkviewport.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkvolumebutton.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkvpaned.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkvruler.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkvscale.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkvscrollbar.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkvseparator.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkwidget.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkwidgetpath.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkwindow.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
mkdir $(OutDir)\lib\gtk-$(GtkApiVersion)\include&#x0D;&#x0A;
copy ..\..\..\gdk\gdkconfig.h $(OutDir)\lib\gtk-$(GtkApiVersion)\include&#x0D;&#x0A;
copy ..\..\..\gdk\gdkconfig.h $(OutDir)\include\gtk-3.0\gdk&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(OutDir)\lib&#x0D;&#x0A;
"
@@ -318,7 +328,7 @@ copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(OutDir)\l
/>
<UserMacro
Name="GtkGenerateGtkDef"
Value="echo EXPORTS &gt;&quot;$(IntDir)\gtk.def&quot; &amp;&amp; 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 &gt;&gt;&quot;$(IntDir)\gtk.def&quot;"
Value="echo EXPORTS &gt;&quot;$(IntDir)\gtk.def&quot; &amp;&amp; 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 &gt;&gt;&quot;$(IntDir)\gtk.def&quot;"
/>
<UserMacro
Name="GtkLibtoolCompatibleDllPrefix"
+8 -8
View File
@@ -31,7 +31,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="_DEBUG;$(GtkPrefixDefine)"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -43,7 +43,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib"
AdditionalDependencies=""
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
@@ -64,7 +64,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="_DEBUG;$(GtkPrefixDefine)"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -76,7 +76,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib"
AdditionalDependencies=""
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
@@ -97,7 +97,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="$(GtkPrefixDefine)"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -107,7 +107,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib"
AdditionalDependencies=""
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
@@ -130,7 +130,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="$(GtkPrefixDefine)"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -140,7 +140,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib pango-1.0.lib pangocairo-1.0.lib"
AdditionalDependencies=""
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
+8 -8
View File
@@ -31,7 +31,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="_DEBUG;$(GtkDefines)"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -42,7 +42,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\gtk.def"
@@ -63,7 +63,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="$(GtkDefines)"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -72,7 +72,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\gtk.def"
@@ -96,7 +96,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="_DEBUG;$(GtkDefines)"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -107,7 +107,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\gtk.def"
@@ -128,7 +128,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
PreprocessorDefinitions="$(GtkDefines)"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@@ -137,7 +137,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\gtk.def"
+235 -143
View File
@@ -9,8 +9,8 @@
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [91])
m4_define([gtk_micro_version], [7])
m4_define([gtk_minor_version], [99])
m4_define([gtk_micro_version], [3])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -236,36 +236,124 @@ AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
[turn on debugging @<:@default=debug_default@:>@]),,
enable_debug=debug_default)
AC_ARG_ENABLE(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,
[AC_HELP_STRING([--disable-rebuilds],
[disable all source autogeneration rules])],,
[enable_rebuilds=yes])
AC_ARG_WITH(xinput,
[AC_HELP_STRING([--with-xinput=@<:@no/yes@:>@], [support XInput])])
AC_ARG_ENABLE(gtk2-dependency,
AC_HELP_STRING([--enable-gtk2-dependency],
[Do not build gtk-update-icon-cache and other shared tools]),,
[enable_gtk2_dependency=no])
if test "$platform_win32" = yes; then
gdktarget=win32
else
gdktarget=x11
AM_CONDITIONAL(BUILD_ICON_CACHE, [test "x$enable_gtk2_dependency" = xno])
AC_ARG_ENABLE(xkb,
[AC_HELP_STRING([--enable-xkb],
[support XKB extension [default=maybe]])],,
[enable_xkb="maybe"])
AC_ARG_ENABLE(xinerama,
[AC_HELP_STRING([--enable-xinerama],
[support Xinerama extension if available [default=maybe]])],,
[enable_xinerama="maybe"])
AC_ARG_ENABLE(xinput,
[AC_HELP_STRING([--enable-xinput],
[support XInput extension if available [default=yes]])],,
[enable_xinput="maybe"])
AC_ARG_ENABLE(xrandr,
[AC_HELP_STRING([--enable-xrandr],
[support XRandR extension if available [default=maybe]])],,
[enable_xrandr="maybe"])
AC_ARG_ENABLE(xfixes,
[AC_HELP_STRING([--enable-xfixes],
[support XFixes extension if available [default=maybe]])],,
[enable_xfixes="maybe"])
AC_ARG_ENABLE(xcomposite,
[AC_HELP_STRING([--enable-xcomposite],
[support X Composite extension if available [default=maybe]])],,
[enable_xcomposite="maybe"])
AC_ARG_ENABLE(xdamage,
[AC_HELP_STRING([--enable-xdamage],
[support X Damage extension if available [default=maybe]])],,
[enable_xdamage="maybe"])
AC_ARG_ENABLE(x11-backend,
[AC_HELP_STRING([--enable-x11-backend],
[enable the X11 gdk backend])],
[backend_set=yes])
AC_ARG_ENABLE(win32-backend,
[AC_HELP_STRING([--enable-win32-backend],
[enable the Win32 gdk backend])],
[backend_set=yes])
AC_ARG_ENABLE(quartz-backend,
[AC_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
AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz]] select non-default GDK target],
gdktarget=$with_gdktarget)
cairo_backends=
backend_immodules=
GDK_BACKENDS=
GDK_EXTRA_LIBS=
GDK_EXTRA_CFLAGS=
GDK_WINDOWING=
GIO_PACKAGE=gio-2.0
PANGO_PACKAGES="pango pangocairo"
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_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_NATIVE_WINDOW_POINTER
#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"
else
AM_CONDITIONAL(USE_WIN32, false)
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
# 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
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
@@ -358,18 +446,7 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
cairo-gobject >= cairo_required_version dnl
gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
## In addition to checking that cairo is present, we also need to
## 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])
PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
if test "$os_win32" != yes; then
# libtool option to control which symbols are exported
@@ -679,6 +756,7 @@ AC_ARG_ENABLE(modules,
[disable dynamic module loading])])
dynworks=false
build_dynamic_modules=no
deps=
if test x$enable_modules = xno; then
AC_MSG_RESULT(no)
@@ -706,10 +784,12 @@ 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
@@ -726,8 +806,8 @@ 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,
[ --with-included-immodules=MODULE1,MODULE2,...
build the specified input methods into gtk])
AC_HELP_STRING([--with-included-immodules=MODULE1,MODULE2,...],
[build the specified input methods into gtk]))
if $dynworks; then
:
@@ -738,14 +818,7 @@ else
fi
fi
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
all_immodules="am-et,cedilla,cyrillic-translit,inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr$backend_immodules"
included_immodules=""
# If the switch specified without listing any specific ones, include all
@@ -809,13 +882,15 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
if test $cross_compiling = yes; then
if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
if test x$GTK_UPDATE_ICON_CACHE = xno; then
REBUILD_PNGS=#
fi
fi
AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
if test ! -f $srcdir/gtk/gtkbuiltincache.h &&
@@ -830,14 +905,12 @@ 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$gdktarget" = "xx11"; then
if test "x$enable_x11_backend" == xyes; then
X_PACKAGES=fontconfig
#
@@ -935,10 +1008,13 @@ if test "x$gdktarget" = "xx11"; then
# Check for XKB support.
if test "x$enable_xkb" = "xyes"; then
AC_MSG_WARN(XKB support explicitly enabled)
AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
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.]))
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)
@@ -960,19 +1036,23 @@ if test "x$gdktarget" = "xx11"; then
CFLAGS="$gtk_save_CFLAGS"
if test "x$enable_xinerama" = "xyes"; then
if test "x$enable_xinerama" != "xno"; 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 support on XFree86)
AC_MSG_CHECKING(for Xinerama packages)
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)
@@ -981,14 +1061,12 @@ if test "x$gdktarget" = "xx11"; 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
@@ -1001,6 +1079,7 @@ if test "x$gdktarget" = "xx11"; 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,
@@ -1015,9 +1094,14 @@ if test "x$gdktarget" = "xx11"; 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$with_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then
if test "x$enable_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then
have_xinput=yes
AC_DEFINE(XINPUT_XFREE, 1,
@@ -1026,7 +1110,11 @@ if test "x$gdktarget" = "xx11"; then
X_PACKAGES="$X_PACKAGES xi"
AC_CHECK_HEADER(X11/extensions/XInput2.h,
have_xinput2=yes; AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
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")
else
AC_DEFINE(XINPUT_NONE, 1,
[Define to 1 if no XInput should be used])
@@ -1035,11 +1123,22 @@ if test "x$gdktarget" = "xx11"; then
AM_CONDITIONAL(XINPUT_XFREE, test "x$have_xinput" = "xyes")
AM_CONDITIONAL(XINPUT_2, test "x$have_xinput2" = "xyes")
# Check for the RANDR extension
if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
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
X_PACKAGES="$X_PACKAGES xrandr"
# 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])
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
fi
# Checks for Xcursor library
@@ -1052,29 +1151,44 @@ if test "x$gdktarget" = "xx11"; then
# Checks for XFixes extension
if $PKG_CONFIG --exists xfixes ; then
AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
if test x"$enable_xfixes" != xno; then
if $PKG_CONFIG --exists xfixes ; then
AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
X_PACKAGES="$X_PACKAGES xfixes"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
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
fi
# Checks for Xcomposite extension
if $PKG_CONFIG --exists xcomposite ; then
AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
if test x"$enable_xcomposite" != xno; then
if $PKG_CONFIG --exists xcomposite ; then
AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
X_PACKAGES="$X_PACKAGES xcomposite"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
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
fi
# Checks for Xdamage extension
if $PKG_CONFIG --exists xdamage ; then
AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
if test x"$enable_xdamage" != xno; then
if $PKG_CONFIG --exists xdamage ; then
AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
X_PACKAGES="$X_PACKAGES xdamage"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
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
fi
if $have_base_x_pc ; then
@@ -1087,6 +1201,10 @@ if test "x$gdktarget" = "xx11"; then
LIBS="$gtk_save_libs"
AM_CONDITIONAL(USE_X11, true)
# strip leading space
X_EXTENSIONS=${X_EXTENSIONS/# }
else
XPACKAGES=
@@ -1096,28 +1214,8 @@ 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`
@@ -1147,12 +1245,7 @@ fi
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
# 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_PACKAGES="$PANGO_PACKAGES $GIO_PACKAGE $X_PACKAGES gdk-pixbuf-2.0 $cairo_backends cairo-gobject"
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"
@@ -1161,7 +1254,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"
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 cairo-gobject"
GDK_EXTRA_LIBS=
fi
@@ -1202,7 +1295,7 @@ else
fi
GTK_PACKAGES="atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0"
if test "x$gdktarget" = "xx11"; then
if test "x$enable_x11_backend" == xyes; then
GTK_PACKAGES="$GTK_PACKAGES pangoft2"
fi
GTK_EXTRA_LIBS=
@@ -1271,8 +1364,10 @@ LIBS="$old_LIBS"
# Printing system checks
################################################################
PRINT_BACKENDS="file lpr"
AC_ARG_ENABLE(cups,
[AC_HELP_STRING([--disable-cups]
[AC_HELP_STRING([--disable-cups],
[disable cups print backend])],,
[enable_cups=auto])
@@ -1309,6 +1404,7 @@ 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"
@@ -1332,7 +1428,7 @@ fi
#
AC_ARG_ENABLE(papi,
[AC_HELP_STRING([--disable-papi]
[AC_HELP_STRING([--disable-papi],
[disable papi print backend])],,
[enable_papi=auto])
@@ -1342,6 +1438,7 @@ 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)
@@ -1367,7 +1464,7 @@ if test "$os_win32" != "yes"; then
*** postscript backend enabled.]))
AC_CHECK_HEADER(cairo-svg.h,,AC_MSG_ERROR([
*** Can't find cairo-svg.h. You must build Cairo with the
*** Cannot find cairo-svg.h. You must build Cairo with the
*** svg backend enabled.]))
fi
@@ -1378,6 +1475,9 @@ AC_ARG_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")
@@ -1411,26 +1511,25 @@ GLIB_GSETTINGS
# GObject introspection
##################################################
GOBJECT_INTROSPECTION_CHECK([0.9.3])
GOBJECT_INTROSPECTION_CHECK([0.10.1])
##################################################
# Packagekit module
#################################################
AC_ARG_ENABLE(packagekit,
AC_HELP_STRING([--disable-packagekit],
[build packagekit open with module]))
AC_HELP_STRING([--disable-packagekit],
[build packagekit open-with module]))
ENABLE_PACKAGEKIT=
build_packagekit=no
if test "os_win32" != "yes"; then
if test "x$enable_packagekit" != "xno"; then
ENABLE_PACKAGEKIT=1
AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
fi
if test "x$enable_packagekit" != "xno"; then
build_packagekit=yes
AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
fi
fi
AC_SUBST(ENABLE_PACKAGEKIT)
AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$ENABLE_PACKAGEKIT" = "x1")
AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$build_packagekit" = "xyes")
##################################################
# Checks for gtk-doc and docbook-tools
@@ -1488,15 +1587,6 @@ 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
@@ -1518,20 +1608,7 @@ _______EOF
mv $outfile gdk/gdkconfig.h
fi
],[
gdk_windowing=''
if expr "$gdktarget" : ".*x11.*" > /dev/null ; then
gdk_windowing+='
#define GDK_WINDOWING_X11'
fi
if expr "$gdktarget" : ".*win32.*" > /dev/null ; then
gdk_windowing+='
#define GDK_NATIVE_WINDOW_POINTER
#define GDK_WINDOWING_WIN32'
fi
if expr "$gdktarget" : ".*quartz.*" > /dev/null ; then
gdk_windowing='
#define GDK_WINDOWING_QUARTZ'
fi
gdk_windowing='$GDK_WINDOWING'
])
dnl
@@ -1551,7 +1628,7 @@ AC_ARG_ENABLE(Bsymbolic,
enable_Bsymbolic=no)
LDFLAGS="${SAVED_LDFLAGS}"])
if test "x${enable_Bsymbolic}" == "xyes"; then
if test "x${enable_Bsymbolic}" = "xyes" ; then
GTK_LINK_FLAGS=-Wl,-Bsymbolic-functions
fi
AC_SUBST(GTK_LINK_FLAGS)
@@ -1581,6 +1658,7 @@ 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
@@ -1620,5 +1698,19 @@ perf/Makefile
AC_OUTPUT
echo "configuration:
target: $gdktarget"
# beautify the immodule list a bit
included_immodules=${included_immodules//,/ }
included_immodules=${included_immodules:-none}
echo "configuration:"
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"
+1
View File
@@ -16,6 +16,7 @@ DEPS = \
LDADDS = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(top_builddir)/gdk/libgdk-3.0.la \
$(GTK_DEP_LIBS) \
$(MATH_LIB)
+1
View File
@@ -59,6 +59,7 @@ DEPS = \
LDADDS = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(top_builddir)/gdk/libgdk-3.0.la \
$(GTK_DEP_LIBS) \
-lm
+3
View File
@@ -27,6 +27,9 @@
* - Using GtkDialog
*/
#include <string.h>
#undef GDK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "demo-common.h"
-1
View File
@@ -290,7 +290,6 @@ 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);
-1
View File
@@ -228,7 +228,6 @@ 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);
+2 -2
View File
@@ -24,9 +24,9 @@ set_interp_type (GtkWidget *widget, gpointer data)
void
overall_changed_cb (GtkAdjustment *adjustment, gpointer data)
{
if (adjustment->value != overall_alpha)
if (gtk_adjustment_get_value (adjustment) != overall_alpha)
{
overall_alpha = adjustment->value;
overall_alpha = gtk_adjustment_get_value (adjustment);
gtk_widget_queue_draw (darea);
}
}
+87 -89
View File
@@ -1,5 +1,4 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
AUTOMAKE_OPTIONS = 1.6
@@ -13,35 +12,35 @@ DOC_MAIN_SGML_FILE=gdk-docs.sgml
SCAN_OPTIONS=--deprecated-guards="GDK_ENABLE_BROKEN|GDK_DISABLE_DEPRECATED"
# The directory containing the source code. Relative to $(srcdir)
DOC_SOURCE_DIR=../../../gdk
DOC_SOURCE_DIR=../../../gdk ../../../gdk/x11
# Used for dependencies
HFILE_GLOB=$(top_srcdir)/gdk/*.h $(top_srcdir)/gdk/x11/gdkx.h
CFILE_GLOB=$(top_srcdir)/gdk/*.c
# Header files to ignore when scanning
IGNORE_HFILES= \
IGNORE_HFILES= \
gdkintl.h \
gdkmarshalers.h \
gdkkeysyms.h \
gdkinternals.h \
gdkprivate.h \
gdkpoly-generic.h \
gdk*private.h \
keyname-table.h \
win32 \
win32 \
x11 \
quartz
# Extra files to add when scanning (relative to $srcdir)
EXTRA_HFILES= \
../../../gdk/x11/gdkx.h
../../../gdk/x11/gdkx.h
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/gdk \
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/gdk \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
@@ -56,86 +55,85 @@ content_files = \
multihead.sgml
# Images to copy into HTML directory
HTML_IMAGES = \
HTML_IMAGES = \
images/rotated-text.png \
\
images/X_cursor.png \
images/arrow.png \
images/based_arrow_down.png \
images/based_arrow_up.png \
images/boat.png \
images/bogosity.png \
images/bottom_left_corner.png \
images/bottom_right_corner.png \
images/bottom_side.png \
images/bottom_tee.png \
images/box_spiral.png \
images/center_ptr.png \
images/circle.png \
images/clock.png \
images/coffee_mug.png \
images/cross.png \
images/cross_reverse.png \
images/crosshair.png \
images/diamond_cross.png \
images/dot.png \
images/dotbox.png \
images/double_arrow.png \
images/draft_large.png \
images/draft_small.png \
images/draped_box.png \
images/exchange.png \
images/fleur.png \
images/gobbler.png \
images/gumby.png \
images/hand1.png \
images/hand2.png \
images/heart.png \
images/icon.png \
images/iron_cross.png \
images/left_ptr.png \
images/left_side.png \
images/left_tee.png \
images/leftbutton.png \
images/ll_angle.png \
images/lr_angle.png \
images/man.png \
images/middlebutton.png \
images/mouse.png \
images/pencil.png \
images/pirate.png \
images/plus.png \
images/question_arrow.png \
images/right_ptr.png \
images/right_side.png \
images/right_tee.png \
images/rightbutton.png \
images/rtl_logo.png \
images/sailboat.png \
images/sb_down_arrow.png \
images/sb_h_double_arrow.png \
images/sb_left_arrow.png \
images/sb_right_arrow.png \
images/sb_up_arrow.png \
images/sb_v_double_arrow.png \
images/shuttle.png \
images/sizing.png \
images/spider.png \
images/spraycan.png \
images/star.png \
images/target.png \
images/tcross.png \
images/top_left_arrow.png \
images/top_left_corner.png \
images/top_right_corner.png \
images/top_side.png \
images/top_tee.png \
images/trek.png \
images/ul_angle.png \
images/umbrella.png \
images/ur_angle.png \
images/watch.png \
images/xterm.png
images/X_cursor.png \
images/arrow.png \
images/based_arrow_down.png \
images/based_arrow_up.png \
images/boat.png \
images/bogosity.png \
images/bottom_left_corner.png \
images/bottom_right_corner.png \
images/bottom_side.png \
images/bottom_tee.png \
images/box_spiral.png \
images/center_ptr.png \
images/circle.png \
images/clock.png \
images/coffee_mug.png \
images/cross.png \
images/cross_reverse.png \
images/crosshair.png \
images/diamond_cross.png \
images/dot.png \
images/dotbox.png \
images/double_arrow.png \
images/draft_large.png \
images/draft_small.png \
images/draped_box.png \
images/exchange.png \
images/fleur.png \
images/gobbler.png \
images/gumby.png \
images/hand1.png \
images/hand2.png \
images/heart.png \
images/icon.png \
images/iron_cross.png \
images/left_ptr.png \
images/left_side.png \
images/left_tee.png \
images/leftbutton.png \
images/ll_angle.png \
images/lr_angle.png \
images/man.png \
images/middlebutton.png \
images/mouse.png \
images/pencil.png \
images/pirate.png \
images/plus.png \
images/question_arrow.png \
images/right_ptr.png \
images/right_side.png \
images/right_tee.png \
images/rightbutton.png \
images/rtl_logo.png \
images/sailboat.png \
images/sb_down_arrow.png \
images/sb_h_double_arrow.png \
images/sb_left_arrow.png \
images/sb_right_arrow.png \
images/sb_up_arrow.png \
images/sb_v_double_arrow.png \
images/shuttle.png \
images/sizing.png \
images/spider.png \
images/spraycan.png \
images/star.png \
images/target.png \
images/tcross.png \
images/top_left_arrow.png \
images/top_left_corner.png \
images/top_right_corner.png \
images/top_side.png \
images/top_tee.png \
images/trek.png \
images/ul_angle.png \
images/umbrella.png \
images/ur_angle.png \
images/watch.png \
images/xterm.png
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS= \
+2 -1
View File
@@ -20,6 +20,8 @@
<xi:include href="multihead.sgml" />
<xi:include href="xml/gdkdisplay.xml" />
<xi:include href="xml/gdkdisplaymanager.xml" />
<xi:include href="xml/gdkdevice.xml" />
<xi:include href="xml/gdkdevicemanager.xml" />
<xi:include href="xml/gdkscreen.xml" />
<xi:include href="xml/regions.xml" />
<xi:include href="xml/pixbufs.xml" />
@@ -35,7 +37,6 @@
<xi:include href="xml/dnd.xml" />
<xi:include href="xml/properties.xml" />
<xi:include href="xml/threads.xml" />
<xi:include href="xml/gdkdevicemanager.xml" />
<xi:include href="xml/pango_interaction.xml" />
<xi:include href="xml/cairo_interaction.xml" />
<xi:include href="xml/x_interaction.xml" />
+77 -73
View File
@@ -61,7 +61,6 @@ GdkStatus
GDKVAR
gdk_axis_use_get_type
gdk_byte_order_get_type
gdk_cap_style_get_type
gdk_crossing_mode_get_type
gdk_cursor_type_get_type
gdk_drag_action_get_type
@@ -77,17 +76,14 @@ gdk_input_mode_get_type
gdk_input_source_get_type
gdk_modifier_type_get_type
gdk_notify_type_get_type
gdk_overlap_type_get_type
gdk_property_state_get_type
gdk_prop_mode_get_type
gdk_scroll_direction_get_type
gdk_setting_action_get_type
gdk_status_get_type
gdk_subwindow_mode_get_type
gdk_visibility_state_get_type
gdk_visual_type_get_type
gdk_window_attributes_type_get_type
gdk_window_class_get_type
gdk_window_edge_get_type
gdk_window_hints_get_type
gdk_window_state_get_type
@@ -123,17 +119,13 @@ gdk_display_is_closed
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_get_device_state
gdk_display_list_devices
gdk_display_get_window_at_pointer
gdk_display_get_window_at_device_position
GdkDisplayPointerHooks
gdk_display_set_pointer_hooks
GdkDisplayDeviceHooks
gdk_display_set_device_hooks
gdk_display_warp_pointer
gdk_display_supports_cursor_color
gdk_display_supports_cursor_alpha
@@ -147,6 +139,9 @@ gdk_display_store_clipboard
gdk_display_supports_shapes
gdk_display_supports_input_shapes
gdk_display_supports_composite
gdk_display_get_app_launch_context
gdk_display_notify_startup_complete
<SUBSECTION Standard>
GDK_DISPLAY
GDK_DISPLAY_OBJECT
@@ -170,6 +165,8 @@ gdk_display_manager_get
gdk_display_manager_get_default_display
gdk_display_manager_set_default_display
gdk_display_manager_list_displays
gdk_display_manager_open_display
<SUBSECTION Standard>
GDK_DISPLAY_MANAGER
GDK_DISPLAY_MANAGER_CLASS
@@ -309,7 +306,6 @@ GDK_VISUAL_GET_CLASS
<SUBSECTION Private>
GdkVisualClass
GdkVisualPrivate
gdk_visual_get_type
</SECTION>
@@ -473,10 +469,6 @@ 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
@@ -498,7 +490,6 @@ GDK_TYPE_FILTER_RETURN
GDK_TYPE_GRAVITY
GDK_TYPE_MODIFIER_TYPE
GDK_TYPE_WINDOW_ATTRIBUTES_TYPE
GDK_TYPE_WINDOW_CLASS
GDK_TYPE_WINDOW_EDGE
GDK_TYPE_WINDOW_HINTS
GDK_TYPE_WINDOW_TYPE
@@ -509,7 +500,6 @@ GDK_TYPE_WM_FUNCTION
<SUBSECTION Private>
gdk_window_get_type
gdk_window_window_class_get_type
GdkWindowObject
GdkWindowClass
GdkWindowImpl
GdkWindowImplClass
@@ -555,17 +545,8 @@ GdkAtom
GDK_ATOM_TO_POINTER
GDK_POINTER_TO_ATOM
GDK_NONE
gdk_text_property_to_text_list
gdk_text_property_to_text_list_for_display
gdk_free_text_list
gdk_text_property_to_utf8_list
gdk_text_property_to_utf8_list_for_display
gdk_string_to_compound_text
gdk_string_to_compound_text_for_display
gdk_free_compound_text
gdk_utf8_to_string_target
gdk_utf8_to_compound_text
gdk_utf8_to_compound_text_for_display
gdk_atom_intern
gdk_atom_intern_static_string
gdk_atom_name
@@ -631,10 +612,6 @@ gdk_threads_add_timeout
gdk_threads_add_timeout_full
gdk_threads_add_timeout_seconds
gdk_threads_add_timeout_seconds_full
<SUBSECTION Private>
gdk_threads_lock
gdk_threads_unlock
</SECTION>
<SECTION>
@@ -684,25 +661,17 @@ gdk_keymap_get_type
</SECTION>
<SECTION>
<TITLE>GdkDeviceManager</TITLE>
<FILE>gdkdevicemanager</FILE>
GdkDeviceManager
<TITLE>GdkDevice</TITLE>
<FILE>gdkdevice</FILE>
GdkDevice
GdkDeviceType
GdkInputSource
GdkInputMode
GdkDeviceKey
GdkDeviceAxis
GdkAxisUse
GdkDeviceType
GdkGrabOwnership
gdk_disable_multidevice
gdk_device_manager_get_display
gdk_device_manager_list_devices
gdk_device_manager_get_client_pointer
<SUBSECTION>
gdk_device_get_name
gdk_device_set_source
gdk_device_get_source
gdk_device_set_mode
gdk_device_get_mode
@@ -711,6 +680,7 @@ gdk_device_get_key
gdk_device_set_axis_use
gdk_device_get_axis_use
gdk_device_get_associated_device
gdk_device_list_slave_devices
gdk_device_get_device_type
gdk_device_get_display
gdk_device_get_has_cursor
@@ -724,6 +694,8 @@ gdk_device_ungrab
<SUBSECTION>
gdk_device_get_state
gdk_device_get_position
gdk_device_get_window_at_position
gdk_device_get_history
gdk_device_free_history
GdkTimeCoord
@@ -738,12 +710,6 @@ GDK_TYPE_INPUT_MODE
GDK_TYPE_INPUT_SOURCE
GDK_TYPE_DEVICE_TYPE
GDK_TYPE_GRAB_OWNERSHIP
GDK_DEVICE_MANAGER
GDK_DEVICE_MANAGER_CLASS
GDK_DEVICE_MANAGER_GET_CLASS
GDK_IS_DEVICE_MANAGER
GDK_IS_DEVICE_MANAGER_CLASS
GDK_TYPE_DEVICE_MANAGER
GDK_DEVICE
GDK_DEVICE_CLASS
GDK_DEVICE_GET_CLASS
@@ -753,15 +719,33 @@ GDK_TYPE_DEVICE
<SUBSECTION Private>
GdkDeviceClass
GdkDevicePrivate
GdkDeviceManagerClass
GdkDeviceManagerPrivate
gdk_device_get_type
gdk_device_manager_get_type
gdk_device_type_get_type
GDK_MAX_TIMECOORD_AXES
</SECTION>
<SECTION>
<TITLE>GdkDeviceManager</TITLE>
<FILE>gdkdevicemanager</FILE>
GdkDeviceManager
gdk_disable_multidevice
gdk_device_manager_get_display
gdk_device_manager_list_devices
gdk_device_manager_get_client_pointer
<SUBSECTION Standard>
GDK_DEVICE_MANAGER
GDK_DEVICE_MANAGER_CLASS
GDK_DEVICE_MANAGER_GET_CLASS
GDK_IS_DEVICE_MANAGER
GDK_IS_DEVICE_MANAGER_CLASS
GDK_TYPE_DEVICE_MANAGER
<SUBSECTION Private>
GdkDeviceManagerClass
gdk_device_manager_get_type
</SECTION>
<SECTION>
<TITLE>Events</TITLE>
<FILE>events</FILE>
@@ -771,7 +755,6 @@ GDK_CURRENT_TIME
GDK_PRIORITY_EVENTS
GDK_PRIORITY_REDRAW
<SUBSECTION>
gdk_events_pending
gdk_event_peek
@@ -807,6 +790,8 @@ gdk_event_set_screen
gdk_event_get_screen
gdk_event_get_device
gdk_event_set_device
gdk_event_get_source_device
gdk_event_set_source_device
<SUBSECTION>
gdk_setting_get
@@ -896,30 +881,31 @@ gdk_cursor_get_type
<SECTION>
<TITLE>Drag and Drop</TITLE>
<FILE>dnd</FILE>
GdkDragContext
gdk_drag_get_selection
gdk_drag_abort
gdk_drop_reply
gdk_drag_context_new
gdk_drag_drop
gdk_drag_find_window
gdk_drag_find_window_for_screen
gdk_drag_context_get_source_window
gdk_drag_begin
gdk_drag_begin_for_device
gdk_drag_motion
gdk_drop_finish
gdk_drag_get_protocol
gdk_drag_get_protocol_for_display
GdkDragProtocol
GdkDragContext
GdkDragAction
gdk_drag_status
gdk_drag_drop_succeeded
gdk_drag_context_get_actions
gdk_drag_context_get_suggested_action
gdk_drag_context_get_selected_action
gdk_drag_context_list_targets
gdk_drag_context_get_device
gdk_drag_context_set_device
gdk_drag_context_get_source_window
gdk_drag_context_get_dest_window
gdk_drag_context_get_protocol
<SUBSECTION Standard>
GDK_DRAG_CONTEXT
@@ -948,20 +934,9 @@ GDK_SCREEN_XNUMBER
GDK_SCREEN_XSCREEN
GDK_CURSOR_XCURSOR
GDK_CURSOR_XDISPLAY
gdkx_visual_get
gdk_x11_window_foreign_new_for_display
gdk_x11_window_lookup_for_display
gdk_x11_lookup_xdisplay
gdk_x11_get_server_time
gdk_x11_screen_supports_net_wm_hint
gdk_x11_screen_get_window_manager_name
gdk_x11_screen_get_monitor_output
gdk_x11_screen_lookup_visual
gdk_x11_window_set_user_time
gdk_x11_window_move_to_current_desktop
gdk_x11_display_get_user_time
gdk_x11_cursor_get_xcursor
gdk_x11_cursor_get_xdisplay
gdk_x11_display_broadcast_startup_message
gdk_x11_display_get_startup_notification_id
gdk_x11_display_set_startup_notification_id
@@ -973,14 +948,24 @@ gdk_x11_display_error_trap_pop
gdk_x11_display_error_trap_pop_ignored
gdk_x11_display_set_cursor_theme
gdk_x11_register_standard_event_type
gdk_x11_screen_get_screen_number
gdk_x11_screen_get_xscreen
gdk_x11_screen_get_window_manager_name
gdk_x11_screen_get_monitor_output
gdk_x11_screen_lookup_visual
gdk_x11_screen_supports_net_wm_hint
gdk_x11_window_foreign_new_for_display
gdk_x11_window_lookup_for_display
gdk_x11_window_get_xid
gdk_x11_window_set_user_time
gdk_x11_window_move_to_current_desktop
gdk_x11_get_default_root_xwindow
gdk_x11_get_default_screen
gdk_x11_get_default_xdisplay
gdk_x11_grab_server
gdk_x11_screen_get_screen_number
gdk_x11_screen_get_xscreen
gdk_x11_ungrab_server
gdk_x11_cursor_get_xcursor
gdk_x11_cursor_get_xdisplay
gdk_x11_visual_get_xvisual
gdk_x11_atom_to_xatom
gdk_x11_atom_to_xatom_for_display
@@ -990,10 +975,30 @@ gdk_x11_get_xatom_by_name
gdk_x11_get_xatom_by_name_for_display
gdk_x11_get_xatom_name
gdk_x11_get_xatom_name_for_display
gdk_x11_set_sm_client_id
gdk_x11_display_text_property_to_text_list
gdk_x11_free_text_list
gdk_x11_display_string_to_compound_text
gdk_x11_display_utf8_to_compound_text
gdk_x11_free_compound_text
<SUBSECTION Private>
GDK_HAVE_WCHAR_H
GDK_HAVE_WCTYPE_H
gdk_x11_app_launch_context_get_type
gdk_x11_cursor_get_type
gdk_x11_device_core_get_type
gdk_x11_device_manager_core_get_type
gdk_x11_device_manager_xi2_get_type
gdk_x11_device_manager_xi_get_type
gdk_x11_device_xi2_get_type
gdk_x11_device_xi_get_type
gdk_x11_display_get_type
gdk_x11_display_manager_get_type
gdk_x11_drag_context_get_type
gdk_x11_keymap_get_type
gdk_x11_screen_get_type
gdk_x11_visual_get_type
gdk_x11_window_get_type
gdk_window_impl_x11_get_type
</SECTION>
<SECTION>
@@ -1015,7 +1020,6 @@ GDK_IS_APP_LAUNCH_CONTEXT
GDK_IS_APP_LAUNCH_CONTEXT_CLASS
GDK_TYPE_APP_LAUNCH_CONTEXT
GdkAppLaunchContextClass
GdkAppLaunchContextPrivate
<SUBSECTION Private>
gdk_app_launch_context_get_type
</SECTION>
+9 -5
View File
@@ -1,9 +1,13 @@
#include <gdk/gdk.h>
gdk_display_get_type
gdk_display_manager_get_type
gdk_screen_get_type
gdk_window_get_type
gdk_keymap_get_type
gdk_app_launch_context_get_type
gdk_cursor_get_type
gdk_device_get_type
gdk_device_manager_get_type
gdk_display_get_type
gdk_display_manager_get_type
gdk_drag_context_get_type
gdk_keymap_get_type
gdk_screen_get_type
gdk_visual_get_type
gdk_window_get_type
+9 -6
View File
@@ -1,5 +1,4 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
AUTOMAKE_OPTIONS = 1.6
@@ -135,8 +134,7 @@ content_files = \
windows.sgml \
x11.sgml \
gtk-query-immodules-3.0.xml \
gtk-update-icon-cache-3.0.xml \
gtk-builder-convert-3.0.xml \
gtk-update-icon-cache.xml \
visual_index.xml \
getting_started.xml \
overview.xml
@@ -276,6 +274,8 @@ 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,6 +328,8 @@ HTML_IMAGES = \
$(srcdir)/images/layout-tbrl.png \
$(srcdir)/images/window-default.png \
$(srcdir)/images/hello-world.png \
$(srcdir)/images/grid-packing.png \
$(srcdir)/images/drawing.png \
$(srcdir)/images/switch.png \
$(srcdir)/images/linear.png \
$(srcdir)/images/ease.png \
@@ -352,7 +354,9 @@ HTML_IMAGES = \
$(srcdir)/images/sliders.png \
$(srcdir)/images/focus.png \
$(srcdir)/images/handles.png \
$(srcdir)/images/extensions.png
$(srcdir)/images/extensions.png \
$(srcdir)/images/numerableicon.png \
$(srcdir)/images/numerableicon2.png
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=--extra-dir=../gdk/html \
@@ -371,8 +375,7 @@ EXTRA_DIST += version.xml.in
man_MANS = \
gtk-query-immodules-3.0.1 \
gtk-update-icon-cache-3.0.1 \
gtk-builder-convert-3.0.1
gtk-update-icon-cache.1
if ENABLE_MAN
+103 -60
View File
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk-building" revision="6 Sept 2001">
<refentry id="gtk-building">
<refmeta>
<refentrytitle>Compiling the GTK+ libraries</refentrytitle>
<manvolnum>3</manvolnum>
@@ -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 wih GTK+ much faster than building it yourself. In
programming with 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 won't need these tools installed; the necessary pieces
then you 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,14 +57,15 @@ How to compile GTK+ itself
tar xvfj gtk+-3.0.0.tar.bz2
</programlisting>
<para>
In the toplevel of the directory that is created, there will be
In the toplevel 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>
@@ -210,22 +211,6 @@ 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
@@ -246,10 +231,16 @@ 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 much of their
compositing. Both Pango and GTK+ use cairo for all 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>
@@ -289,8 +280,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>gtk-demo</command> program that
applications</link>. You can test your GTK+ installation
by running the <command>gtk3-demo</command> program that
GTK+ installs.
</para>
<para>
@@ -327,7 +318,7 @@ How to compile GTK+ itself
<arg>--with-included-immodules=MODULE1,MODULE2,...</arg>
</group>
<group>
<arg>--enable-debug=[no|minimum|yes]</arg>
<arg>--enable-debug=[no/minimum/yes]</arg>
</group>
<group>
<arg>--disable-Bsymbolic</arg>
@@ -354,13 +345,27 @@ How to compile GTK+ itself
<arg>--enable-papi</arg>
</group>
<group>
<arg>--with-xinput=[no|yes]</arg>
<arg>--enable-xinput</arg>
<arg>--disable-xinput</arg>
</group>
<group>
<arg>--with-gdktarget=[x11|win32|quartz]</arg>
<arg>--enable-packagekit</arg>
<arg>--disable-packagekit</arg>
</group>
<group>
<arg>--disable-introspection</arg>
<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>
<group>
<arg>--enable-introspection=[no/auto/yes]</arg>
</group>
<group>
<arg>--enable-gtk2-dependency</arg>
<arg>--disable-gtk2-dependency</arg>
</group>
</cmdsynopsis>
</para>
@@ -371,14 +376,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>
@@ -388,7 +393,8 @@ How to compile GTK+ itself
<para>
This option allows you to specify which input method modules you
want to include.
want to include directly into the GTK+ shared library, as opposed
to building them as loadable modules.
</para>
</formalpara>
@@ -396,10 +402,9 @@ 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
@@ -416,6 +421,8 @@ 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>
@@ -469,6 +476,21 @@ 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>
@@ -513,33 +535,54 @@ How to compile GTK+ itself
</formalpara>
<formalpara>
<title><systemitem>--with-xinput</systemitem></title>
<title><systemitem>--disable-packagekit</systemitem> and
<systemitem>--enable-packagekit</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.
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.
</para>
</formalpara>
<formalpara>
<title><systemitem>--with-gdktarget</systemitem></title>
<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>
<para>
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.
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.
</para>
</formalpara>
<formalpara>
<title><systemitem>--disable-introspection</systemitem></title>
<title><systemitem>--enable-introspection</systemitem></title>
<para>
Build without introspection support.
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.
</para>
</formalpara>
</refsect1>
+1 -20
View File
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk-compiling" revision="4 Feb 2001">
<refentry id="gtk-compiling">
<refmeta>
<refentrytitle>Compiling GTK+ Applications</refentrytitle>
<manvolnum>3</manvolnum>
@@ -69,24 +69,5 @@ define the preprocessor symbol GDK_MULTIDEVICE_SAFE by using the command
line option <literal>-DGTK_MULTIDEVICE_SAFE=1</literal>.
</para>
<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>
+216 -87
View File
@@ -12,97 +12,226 @@
<link linkend="gtk-compiling">Compiling the GTK+ libraries</link>
section in this reference.</para>
<para>To begin our introduction to GTK, we'll start with the simplest
program possible. This program will create an empty 200x200 pixel
window:</para>
<simplesect>
<title>Basics</title>
<para>
<inlinegraphic fileref="window-default.png" format="PNG"></inlinegraphic>
</para>
<para>To begin our introduction to GTK, we'll start with the simplest
program possible. This program will create an empty 200x200 pixel
window:</para>
<informalexample><programlisting>
<xi:include href="../../../../examples/window-default.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting></informalexample>
<para>
<inlinegraphic fileref="window-default.png" format="PNG"></inlinegraphic>
</para>
<para>You can compile the program above with GCC using:</para>
<para><literallayout>
<literal>gcc `pkg-config --cflags gtk+-3.0` -o window-default window-default.c `pkg-config --libs gtk+-3.0`</literal>
</literallayout></para>
<note><para>For more information on how to compile a GTK+ application, please
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
section in this reference.</para></note>
<para>All GTK+ applications will, of course, include
<filename>gtk/gtk.h</filename>, which declares functions, types and
macros required by GTK+ applications.</para>
<warning><para>Even if GTK+ installs multiple header files, only the
top-level <filename>gtk/gtk.h</filename> header can be directly included
by third party code. The compiler will abort with an error if any other
header 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">
<informalexample><programlisting>
<xi:include href="../../../../examples/window-default.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
</programlisting></informalexample>
<para>You can compile the program above with GCC using:</para>
<para><literallayout>
<literal>gcc `pkg-config --cflags gtk+-3.0` -o window-default window-default.c `pkg-config --libs gtk+-3.0`</literal>
</literallayout></para>
<note><para>For more information on how to compile a GTK+ application, please
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
section in this reference.</para></note>
<para>All GTK+ applications will, of course, include
<filename>gtk/gtk.h</filename>, which declares functions, types and
macros required by GTK+ applications.</para>
<warning><para>Even if GTK+ installs multiple header files, only the
top-level <filename>gtk/gtk.h</filename> header can be directly included
by third party code. The compiler will abort with an error if any other
header is directly included.</para></warning>
<para>We then proceed into the <function>main</function>() function of the
application, and we declare a <varname>window</varname> variable as a pointer
of type #GtkWidget.</para>
<para>The following line will call gtk_init(), which
is the initialization function for GTK+; this function will set up GTK+,
the type system, the connection to the windowing environment, etc. The
gtk_init() takes as arguments the pointers to the command line arguments
counter and string array; this allows GTK+ to parse specific command line
arguments that control the behavior of GTK+ itself. The parsed arguments
will be removed from the array, leaving the unrecognized ones for your
application to parse.</para>
<note><para>For more information on which command line arguments GTK+
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
Applications</link> section in this reference.</para></note>
<para>The call to gtk_window_new() will create a new #GtkWindow and store
it inside the <varname>window</varname> variable. The type of the window
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
by the windowing system: it will have a frame, a title bar and window
controls, depending on the platform.</para>
<para>In order to terminate the application when the #GtkWindow is
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
function. This function will terminate the GTK+ main loop started by calling
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
destroyed, either by explicitly calling gtk_widget_destroy() or when the
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
the Close window control button is clicked.</para>
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
can be displayed. All this work is done after the main loop has been
started.</para>
<para>The last line of interest is the call to gtk_main(). This function will
start the GTK+ main loop and will block the control flow of the
main() until the gtk_main_quit() function is called.</para>
<para>While the program is running, GTK+ is receiving
<firstterm>events</firstterm>. These are typically input events caused by
the user interacting with your program, but also things like messages from
the window manager or other applications. GTK+ processes these and as a
result, <firstterm>signals</firstterm> may be emitted on your widgets.
Connecting handlers for these signals is how you normally make your
program do something in response to user input.</para>
<para>The following example is slightly more complex, and tries to
showcase some of the capabilities of GTK+.</para>
<para>In the long tradition of programming languages and libraries,
it is called <emphasis>Hello, World</emphasis>.</para>
<para>
<inlinegraphic fileref="hello-world.png" format="PNG"></inlinegraphic>
</para>
<example id="gtk-getting-started-hello-world">
<title>Hello World in GTK+</title>
<programlisting>
<xi:include href="../../../../examples/hello-world.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
</simplesect>
<simplesect>
<title>Packing</title>
<para>When creating an application, you'll want to put more than one widget
inside a window. Our first helloworld example only used one widget so we
could simply use a gtk_container_add() call to "pack" the widget into the
window. But when you want to put more than one widget into a window, it
it becomes important to control how each widget is positioned and sized.
This is where packing comes in.</para>
<para>GTK+ comes with a large variety of <firstterm>layout containers</firstterm>
whose purpose it is to control the layout of the child widgets that are
added to them. See <xref linkend="LayoutContainers"/> for an overview.</para>
<para>The following example shows how the GtkGrid container lets you
arrange several buttons:</para>
<para>
<inlinegraphic fileref="grid-packing.png" format="PNG"></inlinegraphic>
</para>
<example id="gtk-getting-started-grid-packing">
<title>Packing buttons</title>
<programlisting>
<xi:include href="../../../../examples/grid-packing.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
</simplesect>
<simplesect>
<title>Drawing</title>
<para>Many widgets, like buttons, do all their drawing themselves. You
just tell them the label you want to see, and they figure out what font
to use, draw the button outline and focus rectangle, etc. Sometimes, it
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
might be the right widget to use. It offers a canvas on which you can
draw by connecting to the #GtkWidget::draw signal.
</para>
<para>The contents of a widget often need to be partially or fully redrawn,
e.g. when another window is moved and uncovers part of the widget, or
when tie window containing it is resized. It is also possible to explicitly
cause part or all of the widget to be redrawn, by calling
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
details by providing a ready-to-use cairo context to the ::draw signal
handler.</para>
<para>The following example shows a ::draw signal handler. It is a bit
more complicated than the previous examples, since it also demonstrates
input event handling by means of ::button-press and ::motion-notify
handlers.</para>
<para>
<inlinegraphic fileref="drawing.png" format="PNG"></inlinegraphic>
</para>
<example id="gtk-getting-started-drawing">
<title>Drawing in response to input</title>
<programlisting>
<xi:include href="../../../../examples/drawing.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
</simplesect>
<simplesect>
<title>Building UIs</title>
<para>When construcing a more complicated interface, with dozens
or hundreds of widgets, doing all the setup work in C code is
cumbersome, and making changes becomes next to impossible.</para>
<para>Thankfully, GTK+ supports the separation of user interface
layout from your business logic, by using UI descriptions in an
XML format that can be parsed by the #GtkBuilder class.</para>
<example>
<title>Packing buttons with GtkBuilder</title>
<programlisting>
<xi:include href="../../../../examples/builder.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
The builder.ui file looks like this:
<programlisting>
<xi:include href="../../../../examples/builder.ui" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
<para>Note that GtkBuilder can also be used to construct objects
that are not widgets, such as tree models, adjustments, etc.
That is the reason the method we use here is called
gtk_builder_get_object() and returns a GObject* instead of a
GtkWidget*.</para>
<para>Normally, you would pass a full path to
gtk_builder_add_from_file() to make the execution of your program
independent of the current directory. A common location to install
UI descriptions and similar data is
<filename>/usr/share/<replaceable>appname</replaceable></filename>.
</para>
<para>It is also possible to embed the UI description in the source
code as a string and use gtk_builder_add_from_string() to load it.
But keeping the UI description in a separate file has several
advantages: It is then possible to make minor adjustments to the UI
without recompiling your program, and, more importantly, graphical
UI editors such as <ulink url="http://glade.gnome.org">glade</ulink>
can load the file and allow you to create and modify your UI by
point-and-click.</para>
</simplesect>
</chapter>
@@ -1,61 +0,0 @@
<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>
+2 -2
View File
@@ -61,6 +61,7 @@
<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>
@@ -356,8 +357,7 @@
<part>
<title>GTK+ Tools</title>
<xi:include href="gtk-query-immodules-3.0.xml" />
<xi:include href="gtk-update-icon-cache-3.0.xml" />
<xi:include href="gtk-builder-convert-3.0.xml" />
<xi:include href="gtk-update-icon-cache.xml" />
</part>
<xi:include href="glossary.xml" />
@@ -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-query-immodules">
<refentry id="gtk-query-immodules-3.0">
<refmeta>
<refentrytitle>gtk-query-immodules-3.0</refentrytitle>
@@ -5,18 +5,18 @@
<refentry id="gtk-update-icon-cache">
<refmeta>
<refentrytitle>gtk-update-icon-cache-3.0</refentrytitle>
<refentrytitle>gtk-update-icon-cache</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>gtk-update-icon-cache-3.0</refname>
<refname>gtk-update-icon-cache</refname>
<refpurpose>Icon theme caching utility</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>gtk-update-icon-cache-3.0</command>
<command>gtk-update-icon-cache</command>
<arg choice="opt">--force</arg>
<arg choice="opt">--ignore-theme-index</arg>
<arg choice="opt">--index-only</arg>
@@ -29,7 +29,7 @@
<refsect1><title>Description</title>
<para>
<command>gtk-update-icon-cache-3.0</command> creates mmap()able cache
<command>gtk-update-icon-cache</command> creates mmap()able cache
files for icon themes.
</para>
<para>
@@ -39,7 +39,7 @@
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-3.0</command>
GTK+ can use the cache files created by <command>gtk-update-icon-cache</command>
to avoid a lot of system call and disk seek overhead when the application
starts. Since the format of the cache files allows them to be mmap()ed
shared between multiple applications, the overall memory consumption is
@@ -60,7 +60,7 @@
<term>--ignore-theme-index</term>
<term>-t</term>
<listitem><para>Don't check for the existence of 'index.theme' in the icon
theme directory. Without this option, <command>gtk-update-icon-cache-3.0</command>
theme directory. Without this option, <command>gtk-update-icon-cache</command>
refuses to create an icon cache in a directory which does not appear to
be the toplevel directory of an icon theme.
</para></listitem>
@@ -104,5 +104,3 @@ None known yet.
</refsect1>
</refentry>
+92 -22
View File
@@ -791,6 +791,8 @@ 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
@@ -1619,6 +1621,7 @@ 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
@@ -1676,7 +1679,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
@@ -2116,6 +2119,8 @@ gtk_menu_shell_activate_item
gtk_menu_shell_cancel
gtk_menu_shell_set_take_focus
gtk_menu_shell_get_take_focus
gtk_menu_shell_get_selected_item
gtk_menu_shell_get_parent_shell
GtkMenuDirectionType
<SUBSECTION Standard>
GTK_MENU_SHELL
@@ -2265,6 +2270,34 @@ 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>
@@ -2445,15 +2478,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_set_value
gtk_range_get_round_digits
gtk_range_set_round_digits
GtkSensitivityType
gtk_range_set_lower_stepper_sensitivity
gtk_range_get_lower_stepper_sensitivity
@@ -3415,6 +3448,7 @@ gtk_text_view_move_mark_onscreen
gtk_text_view_place_cursor_onscreen
gtk_text_view_get_visible_rect
gtk_text_view_get_iter_location
gtk_text_view_get_cursor_locations
gtk_text_view_get_line_at_y
gtk_text_view_get_line_yrange
gtk_text_view_get_iter_at_location
@@ -3918,6 +3952,7 @@ 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
@@ -4323,6 +4358,7 @@ 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
@@ -4333,6 +4369,10 @@ 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
@@ -4453,6 +4493,7 @@ 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
@@ -4474,14 +4515,22 @@ 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>
@@ -4517,8 +4566,6 @@ 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
@@ -4530,6 +4577,8 @@ 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>
@@ -4693,6 +4742,7 @@ 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>
@@ -4928,6 +4978,8 @@ 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
@@ -5177,8 +5229,6 @@ gtk_window_begin_resize_drag
gtk_window_begin_move_drag
gtk_window_set_decorated
gtk_window_set_deletable
gtk_window_set_frame_dimensions
gtk_window_set_has_frame
gtk_window_set_mnemonic_modifier
gtk_window_set_type_hint
gtk_window_set_skip_taskbar_hint
@@ -5194,8 +5244,6 @@ gtk_window_get_default_icon_list
gtk_window_get_default_icon_name
gtk_window_get_default_size
gtk_window_get_destroy_with_parent
gtk_window_get_frame_dimensions
gtk_window_get_has_frame
gtk_window_get_icon
gtk_window_get_icon_list
gtk_window_get_icon_name
@@ -5239,6 +5287,7 @@ 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
@@ -5311,16 +5360,6 @@ 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
@@ -5492,6 +5531,22 @@ 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
@@ -5526,6 +5581,8 @@ 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
@@ -5826,6 +5883,7 @@ 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
@@ -5988,7 +6046,6 @@ GtkShadowType
GtkStateType
GtkStateFlags
GtkToolbarStyle
GtkUpdateType
GtkWindowPosition
GtkWindowType
GtkSortType
@@ -6879,9 +6936,18 @@ 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>
@@ -6894,6 +6960,8 @@ gtk_app_chooser_button_append_separator
gtk_app_chooser_button_set_active_custom_item
gtk_app_chooser_button_get_show_dialog_item
gtk_app_chooser_button_set_show_dialog_item
gtk_app_chooser_button_get_heading
gtk_app_chooser_button_set_heading
<SUBSECTION Standard>
GtkAppChooserButtonClass
@@ -6916,6 +6984,8 @@ GtkAppChooserDialog
gtk_app_chooser_dialog_new
gtk_app_chooser_dialog_new_for_content_type
gtk_app_chooser_dialog_get_widget
gtk_app_chooser_dialog_set_heading
gtk_app_chooser_dialog_get_heading
<SUBSECTION Standard>
GtkAppChooserDialogClass
+1
View File
@@ -101,6 +101,7 @@ 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.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

+131 -7
View File
@@ -100,10 +100,11 @@
</para>
<para>
To ensure that your application does not have problems with this, you
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.
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.
<programlisting>
make CFLAGS+="-DGSEAL_ENABLE"
</programlisting>
@@ -123,6 +124,53 @@
</section>
<section>
<title>Use GIO for launching applications</title>
<para>
The <literal>gdk_spawn</literal> family of functions has been
deprecated in GDK 2.24 and removed from GDK 3. Various replacements
exist; the best replacement depends on the circumstances:
<itemizedlist>
<listitem>If you are opening a document or URI by launching a command
like <literal>firefox http://my-favourite-website.com</literal> or
<literal>gnome-open ghelp:epiphany</literal>, it is best to just use
gtk_show_uri(); as an added benefit, your application will henceforth
respect the users preference for what application to use.</listitem>
<listitem>If you are launching a regular, installed application that
has a desktop file, it is best to use GIOs #GAppInfo with a suitable
launch context.
<informalexample><programlisting>
GAppInfo *info;
GAppLaunchContext *context;
GError *error = NULL;
info = g_desktop_app_info_new ("epiphany.desktop");
context = gdk_display_get_app_launch_context (display);
g_app_info_launch (info, NULL, context, &amp;error);
if (error)
{
g_warning ("Failed to launch epiphany: %s", error-&gt;message);
g_error_free (error);
}
g_object_unref (info);
g_object_unref (context);
</programlisting></informalexample>
</listitem>
<listitem>If you are launching a custom commandline, you can
still use g_app_info_launch() with a GAppInfo that is constructed
with g_app_info_create_from_commandline(), or you can use the
more lowlevel <literal>g_spawn</literal> family of functions
(e.g. g_spawn_command_line_async()), and pass <envar>DISPLAY</envar>
in the environment. gdk_screen_make_display_name() can be
used to find the right value for the <envar>DISPLAY</envar>
environment variable.
</listitem>
</itemizedlist>
</para>
</section>
<section>
<title>Use cairo for drawing</title>
<para>
@@ -558,6 +606,7 @@ gtk_fixed_get_preferred_height (GtkWidget *widget,
find-and-replace task. Please refer to the following table:
<table>
<tgroup cols="2">
<title>GdkRegion to cairo_region_t</title>
<thead>
<row><entry>GDK</entry><entry>cairo</entry></row>
</thead>
@@ -649,14 +698,14 @@ g_object_unref (pixbuf);
</section>
<section>
<title>Replace colormaps by visuals</title>
<title>Replace GdkColormap by GdkVisual</title>
<para>
For drawing with cairo, it is not necessary to allocate colors, and
a #GdkVisual provides enough information for cairo to handle colors
in 'native' surfaces. Therefore, #GdkColormap and related functions
have been removed in GTK+ 3, and visuals are used instead. The
colormap-handling functions of #GtkWidget (gtk_widget_set_colormap(),
etc) have been removed and gtk_window_set_visual() has been added.
etc) have been removed and gtk_widget_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
@@ -692,12 +741,87 @@ on_alpha_screen_changed (GtkWindow *window,
if (visual == NULL)
visual = gdk_screen_get_system_visual (screen);
gtk_window_set_visual (window, visual);
gtk_widget_set_visual (window, visual);
}
</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 cairo surfaces or
#GdkPixbufs.
</para>
<para>
GdkDrawable functions that are useful with windows have been replaced
by corresponding GdkWindow functions:
<table>
<title>GdkDrawable to GdkWindow</title>
<tgroup cols="2">
<thead>
<row><entry>GDK 2.x</entry><entry>GDK 3</entry></row>
</thead>
<tbody>
<row><entry>gdk_drawable_get_visual()</entry><entry>gdk_window_get_visual()</entry></row>
<row><entry>gdk_drawable_get_size()</entry><entry>gdk_window_get_width()
gdk_window_get_height()</entry></row>
<row><entry>gdk_pixbuf_get_from_drawable()</entry><entry>gdk_pixbuf_get_from_window()</entry></row>
<row><entry>gdk_drawable_get_clip_region()</entry><entry>gdk_window_get_clip_region()</entry></row>
<row><entry>gdk_drawable_get_visible_region()</entry><entry>gdk_window_get_visible_region()</entry></row>
</tbody>
</tgroup>
</table>
</para>
</section>
<section>
<title>Backend-specific code</title>
<para>
In GTK+ 2.x, GDK could only be compiled for one backend at a time,
and the %GDK_WINDOWING_X11 or %GDK_WINDOWING_WIN32 macros could
be used to find out which one you are dealing with:
<informalexample><programlisting>
#ifdef GDK_WINDOWING_X11
if (timestamp != GDK_CURRENT_TIME)
gdk_x11_window_set_user_time (gdk_window, timestamp);
#endif
#ifdef GDK_WINDOWING_WIN32
/* ... win32 specific code ... */
#endif
</programlisting></informalexample>
In GTK+ 3, GDK can be built with multiple backends, and currently
used backend has to be determined at runtime, typically using
type-check macros on a #GdkDisplay or #GdkWindow. You still need
to use the #GDK_WINDOWING macros to only compile code referring
to supported backends:
<informalexample><programlisting>
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
if (timestamp != GDK_CURRENT_TIME)
gdk_x11_window_set_user_time (gdk_window, timestamp);
}
else
#endif
#ifdef GDK_WINDOWING_WIN32
if (GDK_IS_WIN32_DISPLAY (display))
{
/* ... win32 specific code ... */
}
else
#endif
{
g_warning ("Unsupported GDK backend");
}
</programlisting></informalexample>
</para>
</section>
<section>
<title>The GtkWidget::draw signal</title>
<para>
@@ -1,64 +0,0 @@
<?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>
@@ -1,98 +0,0 @@
<?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
View File
@@ -1,445 +0,0 @@
<?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>&lt;libgnomeui/gnome-app-helper.h&gt;</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>&mdash;</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>&mdash;</guimenuitem></member>
<member><guimenuitem>[ ] Full Screen</guimenuitem></member>
<member><guimenuitem>&mdash;</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>"&lt;ontrol&gt;O"</literal>.
</para>
<programlisting>
/* Normal items */
static const GtkActionEntry entries[] = {
{ "FileMenu", NULL, "_File" },
{ "ViewMenu", NULL, "_View" },
{ "Open", GTK_STOCK_OPEN, "_Open", "&lt;control&gt;O", "Open a file", open_action_callback },
{ "Exit", GTK_STOCK_QUIT, "E_xit", "&lt;control&gt;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 =
"&lt;ui&gt;"
" &lt;menubar name='MainMenu'&gt;"
" &lt;menu action='FileMenu'&gt;"
" &lt;menuitem action='Open'/&gt;"
" &lt;menuitem action='Exit'/&gt;"
" &lt;/menu&gt;"
" &lt;menu action='ViewMenu'&gt;"
" &lt;menuitem action='ZoomIn'/&gt;"
" &lt;menuitem action='ZoomOut'/&gt;"
" &lt;separator/&gt;"
" &lt;menuitem action='FullScreen'/&gt;"
" &lt;separator/&gt;"
" &lt;menuitem action='HighQuality'/&gt;"
" &lt;menuitem action='NormalQuality'/&gt;"
" &lt;menuitem action='LowQuality'/&gt;"
" &lt;/menu&gt;"
" &lt;/menubar&gt;"
"&lt;/ui&gt;";
</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, &amp;error))
{
g_message ("building menus failed: %s", error-&gt;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 &lt; 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:
-->
@@ -1,178 +0,0 @@
<?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:
-->
@@ -1,102 +0,0 @@
<?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, &amp;error))
{
g_warning ("Couldn't load builder file: &percnt;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>
@@ -1,54 +0,0 @@
<?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 &lt;&lt; 8;
color.green = green &lt;&lt; 8;
color.blue = blue &lt;&lt; 8;
gtk_color_button_set_color (color_picker, &amp;color);
gtk_color_button_set_alpha (color_picker, alpha &lt;&lt; 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:
-->
@@ -1,213 +0,0 @@
<?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 &mdash; menu or list &mdash;
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, &amp;iter);
gtk_list_store_set (store, &amp;iter, 0, pixbuf1, 1, "First Item", -1);
gtk_list_store_append (store, &amp;iter);
gtk_list_store_set (store, &amp;iter, 0, pixbuf2, 1, "Second Item", -1);
gtk_list_store_append (store, &amp;iter);
gtk_list_store_set (store, &amp;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:
-->
@@ -1,141 +0,0 @@
<?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>
@@ -1,163 +0,0 @@
<?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&nbsp;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:
-->
@@ -1,153 +0,0 @@
<?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, &amp;iter);
pixbuf = gdk_pixbuf_new_from_file ("file1.png", NULL);
gtk_list_store_set (store, &amp;iter, PIXBUF_COLUMN, pixbuf, TEXT_COLUMN, "Icon 1", -1);
g_object_unref (pixbuf);
gtk_list_store_append (store, &amp;iter);
pixbuf = gdk_pixbuf_new_from_file ("file2.png", NULL);
gtk_list_store_set (store, &amp;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 (&amp;argc, &amp;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, &amp;iter, NULL, idx))
gtk_list_store_set (GTK_LIST_STORE (model), &amp;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:
-->
@@ -1,24 +0,0 @@
<?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>
@@ -1,81 +0,0 @@
<?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:
-->
@@ -1,323 +0,0 @@
<?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-&gt;display_name = document_name;
/* the MIME type is mandatory */
recent_data-&gt;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-&amp;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-&amp;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-&gt;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-&gt;next)
{
GtkRecentInfo *recent_info = l-&gt;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, &amp;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, &amp;count_a, NULL);
if (gtk_recent_info_has_application (b, APP_NAME))
gtk_recent_info_get_application_info (b, APP_NAME, NULL, &amp;count_b, NULL);
return count_a &lt; 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:
-->
@@ -556,7 +556,24 @@
Typically, the provider will be a #GtkCssProvider, which parse CSS
information from a file or from a string.
</para>
<example>
<title>Using a custom GtkStyleProvider</title>
<programlisting>
GtkStyleContext *context;
GtkCssProvider *provider;
context = gtk_widget_get_style_context (widget);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
".frame1 {\n"
" border-image: url('gradient1.png') 10 10 10 10 stretch;\n"
"}\n", -1, NULL);
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
</programlisting>
</example>
<para>
Notice that you can also get style information from custom resources
by implementing the #GtkStyleProvider interface yourself. This is
@@ -1,66 +0,0 @@
<?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>
+1 -1
View File
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk-other-software" revision="5 Sept 2001">
<refentry id="gtk-other-software">
<refmeta>
<refentrytitle>Mixing GTK+ with other software</refentrytitle>
<manvolnum>3</manvolnum>
+189 -229
View File
@@ -35,8 +35,8 @@ How do I get started with GTK+?
</para></question>
<answer><para>
The GTK+ <ulink url="http://www.gtk.org">website</ulink> offers a
<ulink url="http://www.gtk.org/tutorial">tutorial</ulink> and a
The GTK+ <ulink url="http://www.gtk.org">website</ulink> offers a
<ulink url="http://www.gtk.org/tutorial">tutorial</ulink> and a
<ulink url="http://www.gtk.org/faq">FAQ</ulink>. More documentation ranging
from whitepapers to online books can be found at the
<ulink url="http://library.gnome.org/devel/">GNOME developer's site</ulink>.
@@ -47,7 +47,7 @@ this reference manual for details.
<qandaentry>
<question><para>
Where can I get help with GTK+, submit a bug report, or make a feature
Where can I get help with GTK+, submit a bug report, or make a feature
request?
</para></question>
@@ -102,11 +102,11 @@ state (explained in its documentation).
</para>
<para>
For strings returned from functions, they will be declared "const" (using
#G_CONST_RETURN) if they should not be freed. Non-const strings should be
freed with g_free(). Arrays follow the same rule. (If you find an exception
to the rules, please report a bug to <ulink
url="http://bugzilla.gnome.org">http://bugzilla.gnome.org</ulink>.)
For strings returned from functions, they will be declared "const" (using
#G_CONST_RETURN) if they should not be freed. Non-const strings should be
freed with g_free(). Arrays follow the same rule. If you find an
undocumented exception to the rules, please report a bug to <ulink
url="http://bugzilla.gnome.org">http://bugzilla.gnome.org</ulink>.
</para>
</answer>
@@ -164,8 +164,8 @@ How do I use GTK+ with threads?
<answer>
<para>
This is covered in the <link linkend="gdk-Threads">GDK threads
documentation</link>. See also the <link linkend="glib-Threads">GThread</link>
This is covered in the <link linkend="gdk-Threads">GDK threads
documentation</link>. See also the <link linkend="glib-Threads">GThread</link>
documentation for portable threading primitives.
</para>
@@ -182,33 +182,37 @@ How do I internationalize a GTK+ program?
<para>
Most people use <ulink url="http://www.gnu.org/software/gettext/">GNU
gettext</ulink>, already required in order to install GLib. On a UNIX
or Linux system with gettext installed, type <literal>info gettext</literal>
or Linux system with gettext installed, type <literal>info gettext</literal>
to read the documentation.
</para>
<para>
The short checklist on how to use gettext is: call bindtextdomain() so gettext
can find the files containing your translations, call textdomain() to set the
default translation domain, call bind_textdomain_codeset() to request that
all translated strings are returned in UTF-8, then call gettext() to look up
each string to be translated in the default domain.
The short checklist on how to use gettext is: call bindtextdomain() so
gettext can find the files containing your translations, call textdomain()
to set the default translation domain, call bind_textdomain_codeset() to
request that all translated strings are returned in UTF-8, then call
gettext() to look up each string to be translated in the default domain.
</para>
<para>
<filename>gi18n.h</filename> provides the following shorthand macros for
convenience.
Conventionally, people define macros as follows for convenience:
<informalexample>
<programlisting>
#define _(x) gettext (x)
#define N_(x) x
#define _(x) gettext (x)
#define N_(x) x
#define C_(ctx,x) pgettext (ctx, x)
</programlisting>
</informalexample>
You use N_() (N stands for no-op) to mark a string for translation in a
context where a function call to gettext() is not allowed, such as in an
array initializer.
You eventually have to call gettext() on the string to actually fetch the
translation. _() both marks the string for translation and actually
You use N_() (N stands for no-op) to mark a string for translation in
a location where a function call to gettext() is not allowed, such as
in an array initializer.
You eventually have to call gettext() on the string to actually fetch
the translation. _() both marks the string for translation and actually
translates it.
</para>
<para>
Nowadays, GLib provides the common shorthand macros in the header file
<filename>gi18n.h</filename>, so you don't have to define them yourself,
just include that header.
The C_() macro (C stands for context) adds an additional context to
the string that is marked for translation, which can help to disambiguate
short strings that might need different translations in different
parts of your program.
</para>
<para>
Code using these macros ends up looking like this:
@@ -231,21 +235,21 @@ Code using these macros ends up looking like this:
</informalexample>
</para>
<para>
Libraries using gettext should use dgettext() instead of gettext(), which
allows them to specify the translation domain each time they ask for a
translation. Libraries should also avoid calling textdomain(), since they
will be specifying the domain instead of using the default. For dgettext()
the _() macro can be defined as:
<informalexample>
<programlisting>
#define _(x) dgettext ("MyDomain", x)
</programlisting>
</informalexample>
Libraries using gettext should use dgettext() instead of gettext(), which
allows them to specify the translation domain each time they ask for a
translation. Libraries should also avoid calling textdomain(), since
they will be specifying the domain instead of using the default.
</para>
<para>
Again, GLib comes with the <filename>gi18n-lib.h</filename>, saving you the
trouble of defining the macros by hand. The macros in that header expect the
translation domain to be specified by the %GETTEXT_PACKAGE macro.
With the convention that the macro <literal>GETTEXT_PACKAGE</literal> is
defined to hold your libraries translation domain,
<filename>gi18n-lib.h</filename> can be included to provide
the following convenience:
<informalexample>
<programlisting>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
</programlisting>
</informalexample>
</para>
</answer>
</qandaentry>
@@ -259,9 +263,9 @@ How do I use non-ASCII characters in GTK+ programs ?
<answer>
<para>
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a sequence of
one to six bytes and has a number of nice properties which make it a good
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a sequence of
one to six bytes and has a number of nice properties which make it a good
choice for working with Unicode text in C programs:
<itemizedlist>
<listitem><para>
@@ -271,30 +275,30 @@ ASCII characters are encoded by their familiar ASCII codepoints.
ASCII characters never appear as part of any other character.
</para></listitem>
<listitem><para>
The zero byte doesn't occur as part of a character, so that UTF-8 strings
can be manipulated with the usual C library functions for handling
The zero byte doesn't occur as part of a character, so that UTF-8 strings
can be manipulated with the usual C library functions for handling
zero-terminated strings.
</para></listitem>
</itemizedlist>
More information about Unicode and UTF-8 can be found in the
<ulink url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode i
More information about Unicode and UTF-8 can be found in the
<ulink url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode
FAQ for Unix/Linux</ulink>.
GLib provides functions for converting strings between UTF-8 and other
encodings, see g_locale_to_utf8() and g_convert().
</para>
<para>
Text coming from external sources (e.g. files or user input), has to be
converted to UTF-8 before being handed over to GTK+. The following example
writes the content of a IS0-8859-1 encoded text file to
converted to UTF-8 before being handed over to GTK+. The following example
writes the content of a IS0-8859-1 encoded text file to
<literal>stdout</literal>:
<informalexample><programlisting>
gchar *text, *utf8_text;
gsize length;
GError *error = NULL;
if (g_file_get_contents (filename, &amp;text, &amp;length, NULL))
if (g_file_get_contents (filename, &amp;text, &amp;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, &amp;error);
if (error != NULL)
{
@@ -304,7 +308,7 @@ if (g_file_get_contents (filename, &amp;text, &amp;length, NULL))
else
g_print (utf8_text);
}
else
else
fprintf (stderr, "Unable to read file &percnt;s\n", filename);
</programlisting></informalexample>
</para>
@@ -315,36 +319,37 @@ handling non-ASCII content:
<varlistentry><term>direct UTF-8</term>
<listitem><para>
If your editor and compiler are capable of handling UTF-8 encoded sources,
it is very convenient to simply use UTF-8 for string literals, since it allows
you to edit the strings in "wysiwyg". Note that choosing this option may
reduce the portability of your code.
it is very convenient to simply use UTF-8 for string literals, since it
allows you to edit the strings in "wysiwyg". Note that choosing this option
may reduce the portability of your code.
</para></listitem>
</varlistentry>
<varlistentry><term>escaped UTF-8</term>
<listitem><para>
Even if your toolchain can't handle UTF-8 directly, you can still encode string
literals in UTF-8 by using octal or hexadecimal escapes like
<literal>\212</literal> or <literal>\xa8</literal> to
encode each byte. This is portable, but modifying the escaped strings is not
very convenient. Be careful when mixing hexadecimal escapes with ordinary text;
Even if your toolchain can't handle UTF-8 directly, you can still encode
string literals in UTF-8 by using octal or hexadecimal escapes like
<literal>\212</literal> or <literal>\xa8</literal> to encode each byte.
This is portable, but modifying the escaped strings is not very convenient.
Be careful when mixing hexadecimal escapes with ordinary text;
<literal>"\xa8abcd"</literal> is a string of length 1 !
</para></listitem>
</varlistentry>
<varlistentry><term>runtime conversion</term>
<listitem><para>
If the string literals can be represented in an encoding which your toolchain
can handle (e.g. IS0-8859-1), you can write your source files in that encoding
and use g_convert() to convert the strings to UTF-8 at runtime. Note that this
has some runtime overhead, so you may want to move the conversion out of inner
loops.
If the string literals can be represented in an encoding which your
toolchain can handle (e.g. IS0-8859-1), you can write your source files
in that encoding and use g_convert() to convert the strings to UTF-8 at
runtime. Note that this has some runtime overhead, so you may want to move
the conversion out of inner loops.
</para></listitem>
</varlistentry>
</variablelist>
Here is an example showing the three approaches using the copyright sign
&copy; which has Unicode and ISO-8859-1 codepoint 169 and is represented in
UTF-8 by the two bytes 194, 169:
Here is an example showing the three approaches using the copyright sign
&copy; which has Unicode and ISO-8859-1 codepoint 169 and is represented
in UTF-8 by the two bytes 194, 169, or <literal>"\302\251"</literal> as
a string literal:
<informalexample><programlisting>
g_print ("direct UTF-8: &copy;");
g_print ("escaped UTF-8: \302\251");
@@ -368,9 +373,9 @@ How do I use GTK+ with C++?
<answer>
<para>
There are two ways to approach this. The GTK+ header files use the subset
of C that's also valid C++, so you can simply use the normal GTK+ API
in a C++ program. Alternatively, you can use a "C++ binding"
There are two ways to approach this. The GTK+ header files use the subset
of C that's also valid C++, so you can simply use the normal GTK+ API
in a C++ program. Alternatively, you can use a "C++ binding"
such as <ulink url="http://gtkmm.sourceforge.net/">gtkmm</ulink>
which provides a native C++ API.
</para>
@@ -380,20 +385,20 @@ connected to signals, not methods. So you will need to use global
functions or "static" class functions for signal connections.
</para>
<para>
Another common issue when using GTK+ directly is that
C++ will not implicitly convert an integer to an enumeration.
Another common issue when using GTK+ directly is that
C++ will not implicitly convert an integer to an enumeration.
This comes up when using bitfields; in C you can write the following
code:
<informalexample>
<programlisting>
gdk_window_set_events (gdk_window,
gdk_window_set_events (gdk_window,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
</programlisting>
</informalexample>
while in C++ you must write:
<informalexample>
<programlisting>
gdk_window_set_events (gdk_window,
gdk_window_set_events (gdk_window,
(GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
</programlisting>
</informalexample>
@@ -427,19 +432,19 @@ How do I load an image or animation from a file?
<answer>
<para>
To load an image file straight into a display widget, use
gtk_image_new_from_file() <footnote><para> If the file load fails,
gtk_image_new_from_file() will display no image graphic &mdash; 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 &mdash; to detect
a failed load yourself, use gdk_pixbuf_new_from_file() directly, then
gtk_image_new_from_pixbuf().</para></footnote>.
To load an image for another purpose, use gdk_pixbuf_new_from_file(). To i
load an animation, use gdk_pixbuf_animation_new_from_file().
gdk_pixbuf_animation_new_from_file() can also load non-animated images, so
use it in combination with gdk_pixbuf_animation_is_static_image() to load a
file of unknown type.
gdk_pixbuf_animation_new_from_file() can also load non-animated images, so
use it in combination with gdk_pixbuf_animation_is_static_image() to load a
file of unknown type.
</para>
<para>
To load an image or animation file asynchronously (without blocking), use
To load an image or animation file asynchronously (without blocking), use
#GdkPixbufLoader.
</para>
</answer>
@@ -453,19 +458,17 @@ How do I draw text ?
<answer>
<para>
To draw a piece of text, use a Pango layout and gdk_draw_layout(),
using code like the following:
To draw a piece of text, use a Pango layout and pango_cairo_show_layout().
<informalexample>
<programlisting>
layout = gtk_widget_create_pango_layout (widget, text);
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
pango_layout_set_font_description (layout, fontdesc);
gdk_draw_layout (..., layout);
pango_layout_set_font_description (layout, fontdesc);
pango_cairo_show_layout (cr, layout);
pango_font_description_free (fontdesc);
g_object_unref (layout);
</programlisting>
</informalexample>
Do not use the deprecated #GdkFont and gdk_draw_text().
</para>
<para>
@@ -486,19 +489,18 @@ 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, &amp;width, &amp;height);
pango_font_description_free (fontdesc);
g_object_unref (layout);
</programlisting>
</informalexample>
Do not use the deprecated function gdk_text_width().
</para>
<para>
@@ -512,21 +514,21 @@ section of <ulink url="http://library.gnome.org/devel/pango/stable/">Pango manua
<qandaentry>
<question>
<para>
Why are types not registered if I use their <literal>GTK_TYPE_BLAH</literal>
Why are types not registered if I use their <literal>GTK_TYPE_BLAH</literal>
macro ?
</para>
</question>
<answer>
<para>
The <literal>GTK_TYPE_BLAH</literal> macros are defined as calls to
The <literal>GTK_TYPE_BLAH</literal> macros are defined as calls to
<literal>gtk_blah_get_type()</literal>, and the <literal>_get_type()</literal> i
functions are declared as %G_GNUC_CONST which allows the compiler to optimize
the call away if it appears that the value is not being used.
</para>
<para>
A common workaround for this problem is to store the result in a volatile
A common workaround for this problem is to store the result in a volatile
variable, which keeps the compiler from optimizing the call away.
<informalexample><programlisting>
volatile GType dummy = GTK_TYPE_BLAH;
@@ -545,28 +547,29 @@ How do I create a transparent toplevel window ?
<answer>
<para>
To make a window transparent, it needs to use a visual which supports that.
This is done by getting the RGBA colormap of the screen with
gdk_screen_get_rgba_colormap() and setting it on the window. Note that
gdk_screen_get_rgba_colormap() will return %NULL if transparent windows
are not supported on the screen; also note that this may change from
screen to screen, so it needs to be repeated whenever the window is moved
to a different screen.
This is done by getting the RGBA visual of the screen with
gdk_screen_get_rgba_visual() and setting it on the window. Note that
gdk_screen_get_rgba_visual() will return %NULL if transparent windows
are not supported on the screen, you should fall back to
gdk_screen_get_system_visual() in that case. Additionally, note that this
will change from screen to screen, so it needs to be repeated whenever the
window is moved to a different screen.
<informalexample><programlisting>
GdkColormap *colormap;
GdkVisual *visual;
colormap = gdk_screen_get_rgba_colormap (screen);
if (!colormap)
colormap = gdk_screen_get_rgb_colormap (screen);
visual = gdk_screen_get_rgba_visual (screen);
if (visual == NULL)
visual = gdk_screen_get_system_visual (screen);
gtk_widget_set_colormap (widget, colormap);
gtk_widget_set_visual (GTK_WIDGET (window), visual);
</programlisting></informalexample>
One possibility to fill the alpha channel on the window is to use
gdk_draw_rgb_32_image().
To fill the alpha channel on the window simply use cairos
RGBA drawing capabilities.
</para>
<para>
Note that the presence of an RGBA visual is no guarantee that the
window will actually appear transparent on screen. On X11, this
requires a compositing manager to be running. See
window will actually appear transparent on screen. On X11, this
requires a compositing manager to be running. See
gtk_widget_is_composited() for a way to find out if the alpha
channel will be respected.
</para>
@@ -585,10 +588,8 @@ channel will be respected.
<answer>
<para>
See <link linkend="TreeWidget">tree widget overview</link> &mdash; 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.) 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.
should use the #GtkTreeView widget. (A list is just a tree with no branches,
so the tree widget is used for lists as well).
</para>
</answer>
</qandaentry>
@@ -601,12 +602,11 @@ less flexible and result in an inferior user interface.
<answer>
<para>
See <link linkend="TextWidget">text widget overview</link> &mdash; you
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.
should use the #GtkTextView widget.
</para>
<para>
If you only have a small amount of text, #GtkLabel may also be appropriate
of course. It can be made selectable with gtk_label_set_selectable(). For a
If you only have a small amount of text, #GtkLabel may also be appropriate
of course. It can be made selectable with gtk_label_set_selectable(). For a
single-line text entry, see #GtkEntry.
</para>
</answer>
@@ -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,7 +637,8 @@ 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 #GtkComboBoxEntry.
on the current theme. If you need an editable text entry, use the
#GtkComboBox:has-entry property.
</para>
</answer>
</qandaentry>
@@ -652,17 +653,14 @@ How do I change the color of a widget?
</para></question>
<answer><para>
See gtk_widget_modify_fg(), gtk_widget_modify_bg(), gtk_widget_modify_base(),
and gtk_widget_modify_text(). See <link linkend="gtk-Resource-Files">GTK+
resource files</link> for more discussion. You can also change widget color
by installing a resource file and parsing it with gtk_rc_add_default_file().
The advantage of a resource file is that users can then override the
color you've chosen.
See gtk_widget_override_color() and gtk_widget_override_background_color().
You can also change the appearance of a widget by installing a
custom style provider, see gtk_style_context_add_provider().
</para>
<para>To change the background color for widgets such as #GtkLabel that have
no background, place them in a #GtkEventBox and set the background of the
event box.
<para>To change the background color for widgets such as #GtkLabel that
have no background, place them in a #GtkEventBox and set the background
of the event box.
</para></answer>
</qandaentry>
@@ -672,35 +670,38 @@ How do I change the font of a widget?
</para></question>
<answer><para>
This has several possible answers, depending on what exactly you want to
achieve. One option is gtk_widget_modify_font(). Note that this function
can be used to change only the font size, as in the following example:
<programlisting>
This has several possible answers, depending on what exactly you want to
achieve. One option is gtk_widget_override_font().
<informalexample><programlisting>
PangoFontDesc *font_desc = pango_font_description_new (<!-- -->);
pango_font_description_set_size (font_desc, 40);
gtk_widget_modify_font (widget, font);
gtk_widget_override_font (widget, font);
pango_font_description_free (font_desc);
</programlisting>
</programlisting></informalexample>
</para>
<para>
If you want to make the text of a label larger, you can use
If you want to make the text of a label larger, you can use
gtk_label_set_markup():
<programlisting>
<informalexample><programlisting>
gtk_label_set_markup (label, "&lt;big&gt;big text&lt;/big&gt;");
</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
</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
constructing such strings on the fly.
</para>
<para>
You can also change the font of a widget by putting
<programlisting>
gtk-font-name = "Sans 30"
.my-widget-class {
font: Sans 30;
}
</programlisting>
in a resource file and parsing it with gtk_rc_add_default_file().
The advantage of a resource file is that users can then override the font you
have chosen. See <link linkend="gtk-Resource-Files">GTK+ resource files</link>
for more discussion.
in a CSS file, loading it with gtk_css_provider_load_from_file(), and
adding the provider with gtk_style_context_add_provider_for_screen().
To associate this style information with your widget, set a style class
on its #GtkStyleContext using gtk_style_context_add_class().
The advantage of this approach is that users can then override the font
you have chosen. See the #GtkStyleContext documentation for more discussion.
</para>
</answer>
</qandaentry>
@@ -710,8 +711,9 @@ for more discussion.
How do I disable/ghost/desensitize a widget?
</para></question>
<answer><para> In GTK+ a disabled widget is termed "insensitive." See
gtk_widget_set_sensitive().
<answer><para>
In GTK+ a disabled widget is termed "insensitive."
See gtk_widget_set_sensitive().
</para></answer>
</qandaentry>
@@ -750,14 +752,14 @@ How do I make a text widget display its complete contents in a specific font?
</para></question>
<answer><para>
If you use gtk_text_buffer_insert_with_tags() with appropriate tags to select
the font, the inserted text will have the desired appearance, but text typed
in by the user before or after the tagged block will appear in the default
style.
If you use gtk_text_buffer_insert_with_tags() with appropriate tags to
select the font, the inserted text will have the desired appearance, but
text typed in by the user before or after the tagged block will appear in
the default style.
</para>
<para>
To ensure that all text has the desired appearance, use gtk_widget_modify_font()
to change the default font for the widget.
To ensure that all text has the desired appearance, use
gtk_widget_override_font() to change the default font for the widget.
</para></answer>
</qandaentry>
@@ -774,17 +776,17 @@ A good way to keep a text buffer scrolled to the end is to place a
<link linkend="GtkTextMark">mark</link> at the end of the buffer, and
give it right gravity. The gravity has the effect that text inserted
at the mark gets inserted <emphasis>before</emphasis>, keeping the mark
at the end.
at the end.
</para>
<para>
<para>
To ensure that the end of the buffer remains visible, use
gtk_text_view_scroll_to_mark() to scroll to the mark after
inserting new text.
</para>
<para>
The gtk-demo application contains an example of this technique.
The gtk-demo application contains an example of this technique.
</para>
</answer>
</qandaentry>
@@ -801,25 +803,10 @@ How do I associate some data with a row in the tree?
<answer>
<para>
Remember that the #GtkTreeModel columns don't necessarily have to be displayed.
So you can put non-user-visible data in your model just like any other data,
and retrieve it with gtk_tree_model_get(). See the
<link linkend="TreeWidget">tree widget overview</link>.
</para>
</answer>
</qandaentry>
<qandaentry>
<question><para>
What's the #GtkTreeView equivalent of gtk_clist_find_row_from_data()?
</para></question>
<answer>
<para>
As there is no separate data column in the #GtkTreeModel, there's no
built in function to find the iter from data. You can write a custom
searching function to walk the tree and find the data, or use
gtk_tree_model_foreach().
Remember that the #GtkTreeModel columns don't necessarily have to be
displayed. So you can put non-user-visible data in your model just
like any other data, and retrieve it with gtk_tree_model_get().
See the <link linkend="TreeWidget">tree widget overview</link>.
</para>
</answer>
</qandaentry>
@@ -831,9 +818,9 @@ How do I put an image and some text in the same column?
<answer>
<para>
You can pack more than one #GtkCellRenderer into a single #GtkTreeViewColumn
using gtk_tree_view_column_pack_start() or gtk_tree_view_column_pack_end().
So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the
You can pack more than one #GtkCellRenderer into a single #GtkTreeViewColumn
using gtk_tree_view_column_pack_start() or gtk_tree_view_column_pack_end().
So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the
column.
</para>
</answer>
@@ -841,15 +828,15 @@ column.
<qandaentry>
<question><para>
I can set data easily on my #GtkTreeStore/#GtkListStore models using
I can set data easily on my #GtkTreeStore/#GtkListStore models using
gtk_list_store_set() and gtk_tree_store_set(), but can't read it back?
</para></question>
<answer>
<para>
Both the #GtkTreeStore and the #GtkListStore implement the #GtkTreeModel
interface. Consequentially, the can use any function this interface
implements. The easiest way to read a set of data back is to use
interface. Consequentially, you can use any function this interface
implements. The easiest way to read a set of data back is to use
gtk_tree_model_get().
</para>
</answer>
@@ -861,14 +848,14 @@ How do I change the way that numbers are formatted by #GtkTreeView?
</para></question>
<answer><para>
Use gtk_tree_view_insert_column_with_data_func()
or gtk_tree_view_column_set_cell_data_func() and do the conversion from i
number to string yourself (with, say, g_strdup_printf()).
or gtk_tree_view_column_set_cell_data_func() and do the conversion
from number to string yourself (with, say, g_strdup_printf()).
</para>
<para>
The following example demonstrates this:
<informalexample><programlisting>
enum
enum
{
DOUBLE_COLUMN,
N_COLUMNS
@@ -877,11 +864,11 @@ enum
GtkListStore *mycolumns;
GtkTreeView *treeview;
void
void
my_cell_double_to_text (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *iter,
gpointer data)
{
GtkCellRendererText *cell_text = (GtkCellRendererText *)cell;
@@ -896,7 +883,7 @@ my_cell_double_to_text (GtkTreeViewColumn *tree_column,
g_free (text);
}
void
void
set_up_new_columns (GtkTreeView *myview)
{
GtkCellRendererText *renderer;
@@ -912,7 +899,7 @@ set_up_new_columns (GtkTreeView *myview)
/* Create a new column that has a title ("Example column"),
* uses the above created renderer that will render the double
* value into text from the associated model's rows.
* value into text from the associated model's rows.
*/
column = gtk_tree_view_column_new (<!-- -->);
gtk_tree_view_column_set_title (column, "Example column");
@@ -926,10 +913,10 @@ set_up_new_columns (GtkTreeView *myview)
*/
/* Set up a custom function that will be called when the column content
* is rendered. We use the func_data pointer as an index into our
* model. This is convenient when using multi column lists.
* model. This is convenient when using multi column lists.
*/
gtk_tree_view_column_set_cell_data_func (column, renderer,
my_cell_double_to_text,
my_cell_double_to_text,
(gpointer)DOUBLE_COLUMN, NULL);
}
</programlisting></informalexample>
@@ -957,42 +944,15 @@ How do I use cairo to draw in GTK+ applications ?
</para></question>
<answer><para>
Use gdk_cairo_create() to obtain a cairo context for drawing
on a GDK window or pixmap. See <link linkend="gdk-Cairo-Interaction">Cairo
Interaction</link> for some more useful functions.
</para></answer>
</qandaentry>
<qandaentry>
<question><para>
I have created a cairo context with gdk_cairo_create(), but when I
later use it, my drawing does not show up. Why is that ?
</para></question>
<answer>
<para>
All drawing in GTK+ is normally done in an expose handler, and GTK+
creates a temporary pixmap for double-buffering the drawing. If you
create a cairo context outside the expose handler, it is backed
by the GDK window itself, not the double-buffering pixmap. Consequently,
any drawing you do with that cairo context gets overwritten at the
end of the expose handler, when the double-buffering pixmap is copied
back.
The #GtkWidget::draw signal gets a ready-to-use cairo context
as parameter that you should use.
</para>
<para>
Possible solutions to this problem are:
<itemizedlist>
<listitem><para>
Turn off double-buffering, with gtk_widget_set_double_buffered().
This is not ideal, since it can cause some flickering.
</para></listitem>
<listitem><para>
Create the cairo context inside the expose handler. If you do this,
gdk_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>
All drawing in GTK+ is normally done in a draw handler, and GTK+
creates a temporary pixmap for double-buffering the drawing.
It is possible to turn off double-buffering, with
gtk_widget_set_double_buffered(), but this is not ideal,
since it can cause some flickering.
</para>
</answer>
</qandaentry>
@@ -1000,7 +960,7 @@ itself.
<qandaentry>
<question><para>
Can I improve the performance of my application by using the
Glitz backend of cairo ?
Glitz or GL backend of cairo ?
</para></question>
<answer><para>
@@ -1020,7 +980,7 @@ Can I use cairo to draw on a #GdkPixbuf ?
<answer><para>
No, at least not yet. The cairo image surface does not support the
pixel format used by GdkPixbuf.
pixel format used by GdkPixbuf.
</para></answer>
</qandaentry>
+1 -1
View File
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk-resources" revision="5 Sept 2001">
<refentry id="gtk-resources">
<refmeta>
<refentrytitle>Mailing lists and bug reports</refentrytitle>
<manvolnum>3</manvolnum>
+13
View File
@@ -389,6 +389,19 @@ 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>
+1 -1
View File
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="TextWidget" revision="18 Oct 2000">
<refentry id="TextWidget">
<refmeta>
<refentrytitle>Text Widget Overview</refentrytitle>
<manvolnum>3</manvolnum>
+17
View File
@@ -8,6 +8,7 @@ gtkbuilder.sgml
gtkbutton.sgml
gtkcalendar.sgml
gtkcelleditable.sgml
gtkcelllayout.sgml
gtkcellrenderer.sgml
gtkcellrenderertext.sgml
gtkcellview.sgml
@@ -16,9 +17,17 @@ 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
@@ -26,6 +35,10 @@ gtkimmulticontext.sgml
gtkitemfactory.sgml
gtklayout.sgml
gtklinkbutton.sgml
gtkmain.sgml
gtkmenu.sgml
gtkmenubar.sgml
gtkmenushell.sgml
gtkmessagedialog.sgml
gtknotebook.sgml
gtkobject.sgml
@@ -35,6 +48,7 @@ gtkpagesetupunixdialog.sgml
gtkpaned.sgml
gtkpapersize.sgml
gtkprinter.sgml
gtkprintjob.sgml
gtkprogressbar.sgml
gtkradioaction.sgml
gtkradiobutton.sgml
@@ -49,6 +63,7 @@ gtkscale.sgml
gtkscalebutton.sgml
gtkscrollbar.sgml
gtkscrolledwindow.sgml
gtkselection.sgml
gtkseparator.sgml
gtkseparatormenuitem.sgml
gtkseparatortoolitem.sgml
@@ -57,6 +72,7 @@ gtkstatusbar.sgml
gtkstyle.sgml
gtktesting.sgml
gtktextiter.sgml
gtktexttag.sgml
gtktexttagtable.sgml
gtktextview.sgml
gtktoggleaction.sgml
@@ -64,6 +80,7 @@ gtktoolbar.sgml
gtktoolitem.sgml
gtktooltip.sgml
gtktreednd.sgml
gtktreemodel.sgml
gtktreemodelfilter.sgml
gtktreeselection.sgml
gtktreesortable.sgml
-406
View File
@@ -1,406 +0,0 @@
<!-- ##### 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 &lt;action-widgets&gt; element, which
can contain multiple &lt;action-widget&gt; 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
View File
@@ -1,140 +0,0 @@
<!-- ##### 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-&gt;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,
&amp;color);
gdk_cairo_set_source_rgba (cr, &amp;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
@@ -1,377 +0,0 @@
<!-- ##### 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
View File
@@ -1,458 +0,0 @@
<!-- ##### 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
View File
@@ -1,86 +0,0 @@
<!-- ##### 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
View File
@@ -1,296 +0,0 @@
<!-- ##### 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 &lt;child&gt; element.
A normal content child can be specified without specifying
a &lt;child&gt; 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
View File
@@ -1,135 +0,0 @@
<!-- ##### 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
View File
@@ -1,170 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkFileFilter
<!-- ##### SECTION Short_Description ##### -->
A filter for selecting a file subset
<!-- ##### SECTION Long_Description ##### -->
<para>
A GtkFileFilter can be used to restrict the files being shown
in a #GtkFileChooser. Files can be filtered based on their name
(with gtk_file_filter_add_pattern()), on their mime type (with
gtk_file_filter_add_mime_type()), or by a custom filter function
(with gtk_file_filter_add_custom()).
</para>
<para>
Filtering by mime types handles aliasing and subclassing of mime
types; e.g. a filter for text/plain also matches a file with mime
type application/rtf, since application/rtf is a subclass of
text/plain. Note that #GtkFileFilter allows wildcards for the
subtype of a mime type, so you can e.g. filter for image/*.
</para>
<para>
Normally, filters are used by adding them to a #GtkFileChooser,
see gtk_file_chooser_add_filter(), but it is also possible
to manually use a filter on a file with gtk_file_filter_filter().
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GtkFileChooser
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkFileFilter ##### -->
<para>
The <structname>GtkFileFilter</structname> struct contains
only private fields and should not be directly accessed.
</para>
<!-- ##### STRUCT GtkFileFilterInfo ##### -->
<para>
A <structname>GtkFileFilterInfo</structname> struct is used
to pass information about the tested file to
gtk_file_filter_filter().
</para>
@contains: Flags indicating which of the following fields need
are filled
@filename: the filename of the file being tested
@uri: the URI for the file being tested
@display_name: the string that will be used to display the file
in the file chooser
@mime_type: the mime type of the file
<!-- ##### ENUM GtkFileFilterFlags ##### -->
<para>
These flags indicate what parts of a #GtkFileFilterInfo struct
are filled or need to be filled.
</para>
@GTK_FILE_FILTER_FILENAME: the filename of the file being tested
@GTK_FILE_FILTER_URI: the URI for the file being tested
@GTK_FILE_FILTER_DISPLAY_NAME: the string that will be used to
display the file in the file chooser
@GTK_FILE_FILTER_MIME_TYPE: the mime type of the file
<!-- ##### USER_FUNCTION GtkFileFilterFunc ##### -->
<para>
The type of function that is used with custom filters,
see gtk_file_filter_add_custom().
</para>
@filter_info: a #GtkFileFilterInfo that is filled according
to the @needed flags passed to gtk_file_filter_add_custom()
@data: user data passed to gtk_file_filter_add_custom()
@Returns: %TRUE if the file should be displayed
<!-- ##### FUNCTION gtk_file_filter_new ##### -->
<para>
</para>
@void:
@Returns:
<!-- ##### FUNCTION gtk_file_filter_set_name ##### -->
<para>
</para>
@filter:
@name:
<!-- ##### FUNCTION gtk_file_filter_get_name ##### -->
<para>
</para>
@filter:
@Returns:
<!-- ##### FUNCTION gtk_file_filter_add_mime_type ##### -->
<para>
</para>
@filter:
@mime_type:
<!-- ##### FUNCTION gtk_file_filter_add_pattern ##### -->
<para>
</para>
@filter:
@pattern:
<!-- ##### FUNCTION gtk_file_filter_add_pixbuf_formats ##### -->
<para>
</para>
@filter:
<!-- ##### FUNCTION gtk_file_filter_add_custom ##### -->
<para>
</para>
@filter:
@needed:
@func:
@data:
@notify:
<!-- ##### FUNCTION gtk_file_filter_get_needed ##### -->
<para>
</para>
@filter:
@Returns:
<!-- ##### FUNCTION gtk_file_filter_filter ##### -->
<para>
</para>
@filter:
@filter_info:
@Returns:
-133
View File
@@ -1,133 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkFixed
<!-- ##### SECTION Short_Description ##### -->
A container which allows you to position widgets at fixed coordinates
<!-- ##### SECTION Long_Description ##### -->
<para>
The #GtkFixed widget is a container which can place child widgets at fixed
positions and with fixed sizes, given in pixels. #GtkFixed performs no
automatic layout management.
</para>
<para>
For most applications, you should not use this container! It keeps
you from having to learn about the other GTK+ containers, but it
results in broken applications.
With #GtkFixed, the following things will result in truncated text,
overlapping widgets, and other display bugs:
<itemizedlist>
<listitem>
<para>Themes, which may change widget sizes.
</para>
</listitem>
<listitem>
<para>Fonts other than the one you used to write the app will of
course change the size of widgets containing text; keep in mind that
users may use a larger font because of difficulty reading the default,
or they may be using Windows or the framebuffer port of GTK+, where
different fonts are available.
</para>
</listitem>
<listitem>
<para>
Translation of text into other languages changes its size. Also,
display of non-English text will use a different font in many cases.
</para>
</listitem>
</itemizedlist>
</para>
<para>
In addition, the fixed widget can't properly be mirrored in
right-to-left languages such as Hebrew and Arabic. i.e. normally GTK+
will flip the interface to put labels to the right of the thing they
label, but it can't do that with #GtkFixed. So your application will
not be usable in right-to-left languages.
</para>
<para>
Finally, fixed positioning makes it kind of annoying to add/remove GUI
elements, since you have to reposition all the other elements. This is
a long-term maintenance problem for your application.
</para>
<para>
If you know none of these things are an issue for your application,
and prefer the simplicity of #GtkFixed, by all means use the
widget. But you should be aware of the tradeoffs.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkFixed ##### -->
<para>
The #GtkFixed-struct struct contains the following fields.
(These fields should be considered read-only. They should never be set by
an application.)
<informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
<tbody>
<row>
<entry>#GList *children;</entry>
<entry>a list of #GtkFixedChild elements, containing the child widgets and
their positions.</entry>
</row>
</tbody></tgroup></informaltable>
</para>
<!-- ##### ARG GtkFixed:x ##### -->
<para>
</para>
<!-- ##### ARG GtkFixed:y ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_fixed_new ##### -->
<para>
Creates a new #GtkFixed.
</para>
@void:
@Returns: a new #GtkFixed.
<!-- ##### FUNCTION gtk_fixed_put ##### -->
<para>
Adds a widget to a #GtkFixed container at the given position.
</para>
@fixed: a #GtkFixed.
@widget: the widget to add.
@x: the horizontal position to place the widget at.
@y: the vertical position to place the widget at.
<!-- ##### FUNCTION gtk_fixed_move ##### -->
<para>
Moves a child of a #GtkFixed container to the given position.
</para>
@fixed: a #GtkFixed.
@widget: the child widget.
@x: the horizontal position to move the widget to.
@y: the vertical position to move the widget to.
-626
View File
@@ -1,626 +0,0 @@
<!-- ##### 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 (&amp;argc, &amp;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 &lt;gtk/gtk.h&gt;
int
main (int argc, char **argv)
{
GtkWidget *win, *but;
gtk_init( &amp;argc, &amp;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
View File
@@ -1,494 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkMenu
<!-- ##### SECTION Short_Description ##### -->
A menu widget
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GtkMenu is a #GtkMenuShell that implements a drop down menu consisting of
a list of #GtkMenuItem objects which can be navigated and activated by the
user to perform application functions.
</para>
<para>
A #GtkMenu is most commonly dropped down by activating a #GtkMenuItem in a
#GtkMenuBar or popped up by activating a #GtkMenuItem in another #GtkMenu.
</para>
<para>
A #GtkMenu can also be popped up by activating a #GtkOptionMenu.
Other composite widgets such as the #GtkNotebook can pop up a #GtkMenu
as well.
</para>
<para>
Applications can display a #GtkMenu as a popup menu by calling the
gtk_menu_popup() function. The example below shows how an application
can pop up a menu when the 3rd mouse button is pressed.
</para>
<example>
<title>Connecting the popup signal handler.</title>
<programlisting>
/* connect our handler which will popup the menu */
g_signal_connect_swapped (window, "button_press_event",
G_CALLBACK (my_popup_handler), menu);
</programlisting>
</example>
<example>
<title>Signal handler which displays a popup menu.</title>
<programlisting>
static gint
my_popup_handler (GtkWidget *widget, GdkEvent *event)
{
GtkMenu *menu;
GdkEventButton *event_button;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_MENU (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
/* The "widget" is the menu that was supplied when
* g_signal_connect_swapped() was called.
*/
menu = GTK_MENU (widget);
if (event->type == GDK_BUTTON_PRESS)
{
event_button = (GdkEventButton *) event;
if (event_button->button == 3)
{
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
event_button->button, event_button->time);
return TRUE;
}
}
return FALSE;
}
</programlisting>
</example>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkMenu ##### -->
<para>
The #GtkMenu struct contains private data only, and
should be accessed using the functions below.
</para>
<!-- ##### SIGNAL GtkMenu::move-scroll ##### -->
<para>
</para>
@menu: the object which received the signal.
@arg1:
<!-- ##### ARG GtkMenu:accel-group ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:accel-path ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:active ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:attach-widget ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:monitor ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:reserve-toggle-size ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:tearoff-state ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:tearoff-title ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:bottom-attach ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:left-attach ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:right-attach ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:top-attach ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:arrow-placement ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:arrow-scaling ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:double-arrows ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:horizontal-offset ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:horizontal-padding ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:vertical-offset ##### -->
<para>
</para>
<!-- ##### ARG GtkMenu:vertical-padding ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_menu_new ##### -->
<para>
Creates a new #GtkMenu.
</para>
@void:
@Returns: a new #GtkMenu.
<!-- ##### FUNCTION gtk_menu_set_screen ##### -->
<para>
</para>
@menu:
@screen:
<!-- ##### FUNCTION gtk_menu_reorder_child ##### -->
<para>
Moves a #GtkMenuItem to a new position within the #GtkMenu.
</para>
@menu: a #GtkMenu.
@child: the #GtkMenuItem to move.
@position: the new position to place @child. Positions are numbered from
0 to n-1.
<!-- ##### FUNCTION gtk_menu_attach ##### -->
<para>
</para>
@menu:
@child:
@left_attach:
@right_attach:
@top_attach:
@bottom_attach:
<!-- ##### FUNCTION gtk_menu_popup_for_device ##### -->
<para>
</para>
@menu:
@device:
@parent_menu_shell:
@parent_menu_item:
@func:
@data:
@destroy:
@button:
@activate_time:
<!-- ##### FUNCTION gtk_menu_popup ##### -->
@menu:
@parent_menu_shell:
@parent_menu_item:
@func:
@data:
@button:
@activate_time:
<!-- ##### FUNCTION gtk_menu_set_accel_group ##### -->
<para>
Set the #GtkAccelGroup which holds global accelerators for the menu.
This accelerator group needs to also be added to all windows that
this menu is being used in with gtk_window_add_accel_group(), in order
for those windows to support all the accelerators contained in this group.
</para>
@menu: a #GtkMenu.
@accel_group: the #GtkAccelGroup to be associated with the menu.
<!-- ##### FUNCTION gtk_menu_get_accel_group ##### -->
<para>
Gets the #GtkAccelGroup which holds global accelerators for the menu.
See gtk_menu_set_accel_group().
</para>
@menu: a #GtkMenu.
@Returns: the #GtkAccelGroup associated with the menu.
<!-- ##### FUNCTION gtk_menu_set_accel_path ##### -->
<para>
</para>
@menu:
@accel_path:
<!-- ##### FUNCTION gtk_menu_get_accel_path ##### -->
<para>
</para>
@menu:
@Returns:
<!-- ##### FUNCTION gtk_menu_set_title ##### -->
<para>
</para>
@menu:
@title:
<!-- ##### FUNCTION gtk_menu_get_title ##### -->
<para>
</para>
@menu:
@Returns:
<!-- ##### FUNCTION gtk_menu_set_monitor ##### -->
<para>
</para>
@menu:
@monitor_num:
<!-- ##### FUNCTION gtk_menu_get_monitor ##### -->
<para>
</para>
@menu:
@Returns:
<!-- ##### FUNCTION gtk_menu_get_tearoff_state ##### -->
<para>
</para>
@menu:
@Returns:
<!-- ##### FUNCTION gtk_menu_set_reserve_toggle_size ##### -->
<para>
</para>
@menu:
@reserve_toggle_size:
<!-- ##### FUNCTION gtk_menu_get_reserve_toggle_size ##### -->
<para>
</para>
@menu:
@Returns:
<!-- ##### FUNCTION gtk_menu_popdown ##### -->
<para>
Removes the menu from the screen.
</para>
@menu: a #GtkMenu.
<!-- ##### FUNCTION gtk_menu_reposition ##### -->
<para>
Repositions the menu according to its position function.
</para>
@menu: a #GtkMenu.
<!-- ##### FUNCTION gtk_menu_get_active ##### -->
<para>
Returns the selected menu item from the menu. This is used by the
#GtkOptionMenu.
</para>
@menu: a #GtkMenu.
@Returns: the #GtkMenuItem that was last selected in the menu. If a
selection has not yet been made, the first menu item is selected.
<!-- ##### FUNCTION gtk_menu_set_active ##### -->
<para>
Selects the specified menu item within the menu. This is used by the
#GtkOptionMenu and should not be used by anyone else.
</para>
@menu: a #GtkMenu.
@index_: the index of the menu item to select. Index values are from
0 to n-1.
<!-- ##### FUNCTION gtk_menu_set_tearoff_state ##### -->
<para>
Changes the tearoff state of the menu. A menu is normally displayed
as drop down menu which persists as long as the menu is active. It can
also be displayed as a tearoff menu which persists until it is closed
or reattached.
</para>
@menu: a #GtkMenu.
@torn_off: If %TRUE, menu is displayed as a tearoff menu.
<!-- ##### FUNCTION gtk_menu_attach_to_widget ##### -->
<para>
Attaches the menu to the widget and provides a callback function that will
be invoked when the menu calls gtk_menu_detach() during its destruction.
</para>
@menu: a #GtkMenu.
@attach_widget: the #GtkWidget that the menu will be attached to.
@detacher: the user supplied callback function that will be called when
the menu calls gtk_menu_detach().
<!-- ##### FUNCTION gtk_menu_detach ##### -->
<para>
Detaches the menu from the widget to which it had been attached.
This function will call the callback function, @detacher, provided
when the gtk_menu_attach_to_widget() function was called.
</para>
@menu: a #GtkMenu.
<!-- ##### FUNCTION gtk_menu_get_attach_widget ##### -->
<para>
Returns the #GtkWidget that the menu is attached to.
</para>
@menu: a #GtkMenu.
@Returns: the #GtkWidget that the menu is attached to.
<!-- ##### FUNCTION gtk_menu_get_for_attach_widget ##### -->
<para>
</para>
@widget:
@Returns:
<!-- ##### USER_FUNCTION GtkMenuPositionFunc ##### -->
<para>
A user function supplied when calling gtk_menu_popup() which controls the
positioning of the menu when it is displayed. The function sets the @x
and @y parameters to the coordinates where the menu is to be drawn.
To make the menu appear on a different monitor than the mouse pointer,
gtk_menu_set_monitor() must be called.
</para>
@menu: a #GtkMenu.
@x: address of the #gint representing the horizontal position where the
menu shall be drawn. This is an output parameter.
@y: address of the #gint representing the vertical position where the
menu shall be drawn. This is an output parameter.
@push_in: This parameter controls how menus placed outside the monitor are handled.
If this is set to %TRUE and part of the menu is outside the monitor then
GTK+ pushes the window into the visible area, effectively modifying the
popup position.
Note that moving and possibly resizing the menu around will alter the
scroll position to keep the menu items "in place", i.e. at the same monitor
position they would have been without resizing.
In practice, this behavior is only useful for combobox popups or option
menus and cannot be used to simply confine a menu to monitor boundaries.
In that case, changing the scroll offset is not desirable.
@user_data: the data supplied by the user in the gtk_menu_popup() @data
parameter.
<!-- ##### USER_FUNCTION GtkMenuDetachFunc ##### -->
<para>
A user function supplied when calling gtk_menu_attach_to_widget() which
will be called when the menu is later detached from the widget.
</para>
@attach_widget: the #GtkWidget that the menu is being detached from.
@menu: the #GtkMenu being detached.
-104
View File
@@ -1,104 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkMenuBar
<!-- ##### SECTION Short_Description ##### -->
A subclass widget for GtkMenuShell which holds GtkMenuItem widgets
<!-- ##### SECTION Long_Description ##### -->
<para>
The #GtkMenuBar is a subclass of #GtkMenuShell which contains one to many #GtkMenuItem. The result is a standard menu bar which can hold many menu items. #GtkMenuBar allows for a shadow type to be set for aesthetic purposes. The shadow types are defined in the #gtk_menu_bar_set_shadow_type function.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GtkMenuShell, #GtkMenu, #GtkMenuItem
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkMenuBar ##### -->
<para>
The #GtkMenuBar struct contains the following fields. (These fields should be considered read-only. They should never be set by an application.)
</para>
<!-- ##### ARG GtkMenuBar:child-pack-direction ##### -->
<para>
</para>
<!-- ##### ARG GtkMenuBar:pack-direction ##### -->
<para>
</para>
<!-- ##### ARG GtkMenuBar:internal-padding ##### -->
<para>
</para>
<!-- ##### ARG GtkMenuBar:shadow-type ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_menu_bar_new ##### -->
<para>
Creates the new #GtkMenuBar
</para>
@void:
@Returns: the #GtkMenuBar
<!-- ##### ENUM GtkPackDirection ##### -->
<para>
Determines how widgets should be packed insided menubars and
menuitems contained in menubars.
</para>
@GTK_PACK_DIRECTION_LTR: Widgets are packed left-to-right.
@GTK_PACK_DIRECTION_RTL: Widgets are packed right-to-left.
@GTK_PACK_DIRECTION_TTB: Widgets are packed top-to-bottom.
@GTK_PACK_DIRECTION_BTT: Widgets are packed bottom-to-top.
<!-- ##### FUNCTION gtk_menu_bar_set_pack_direction ##### -->
<para>
</para>
@menubar:
@pack_dir:
<!-- ##### FUNCTION gtk_menu_bar_get_pack_direction ##### -->
<para>
</para>
@menubar:
@Returns:
<!-- ##### FUNCTION gtk_menu_bar_set_child_pack_direction ##### -->
<para>
</para>
@menubar:
@child_pack_dir:
<!-- ##### FUNCTION gtk_menu_bar_get_child_pack_direction ##### -->
<para>
</para>
@menubar:
@Returns:
-224
View File
@@ -1,224 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkMenuShell
<!-- ##### SECTION Short_Description ##### -->
A base class for menu objects
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GtkMenuShell is the abstract base class used to derive the
#GtkMenu and #GtkMenuBar subclasses.
</para>
<para>
A #GtkMenuShell is a container of #GtkMenuItem objects arranged in a
list which can be navigated, selected, and activated by the user to perform
application functions. A #GtkMenuItem can have a submenu associated with it,
allowing for nested hierarchical menus.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkMenuShell ##### -->
<para>
The #GtkMenuShell-struct struct contains the following fields.
(These fields should be considered read-only. They should never be set by
an application.)
<informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
<tbody>
<row>
<entry>#GList *children;</entry>
<entry>The list of #GtkMenuItem objects contained by this #GtkMenuShell.
</entry>
</row>
</tbody></tgroup></informaltable>
</para>
<!-- ##### SIGNAL GtkMenuShell::activate-current ##### -->
<para>
An action signal that activates the current menu item within the menu
shell.
</para>
@menushell: the object which received the signal.
@force_hide: if TRUE, hide the menu after activating the menu item.
<!-- ##### SIGNAL GtkMenuShell::cancel ##### -->
<para>
An action signal which cancels the selection within the menu shell.
Causes the GtkMenuShell::selection-done signal to be emitted.
</para>
@menushell: the object which received the signal.
<!-- ##### SIGNAL GtkMenuShell::cycle-focus ##### -->
<para>
</para>
@menushell: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GtkMenuShell::deactivate ##### -->
<para>
This signal is emitted when a menu shell is deactivated.
</para>
@menushell: the object which received the signal.
<!-- ##### SIGNAL GtkMenuShell::move-current ##### -->
<para>
An action signal which moves the current menu item in the direction
specified by @direction.
</para>
@menushell: the object which received the signal.
@direction: the direction to move.
<!-- ##### SIGNAL GtkMenuShell::move-selected ##### -->
<para>
</para>
@menushell: the object which received the signal.
@arg1:
@Returns:
<!-- ##### SIGNAL GtkMenuShell::selection-done ##### -->
<para>
This signal is emitted when a selection has been completed within a menu
shell.
</para>
@menushell: the object which received the signal.
<!-- ##### ARG GtkMenuShell:take-focus ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_menu_shell_append ##### -->
<para>
Adds a new #GtkMenuItem to the end of the menu shell's item list.
</para>
@menu_shell: a #GtkMenuShell.
@child: The #GtkMenuItem to add.
<!-- ##### FUNCTION gtk_menu_shell_prepend ##### -->
<para>
Adds a new #GtkMenuItem to the beginning of the menu shell's item list.
</para>
@menu_shell: a #GtkMenuShell.
@child: The #GtkMenuItem to add.
<!-- ##### FUNCTION gtk_menu_shell_insert ##### -->
<para>
Adds a new #GtkMenuItem to the menu shell's item list at the position
indicated by @position.
</para>
@menu_shell: a #GtkMenuShell.
@child: The #GtkMenuItem to add.
@position: The position in the item list where @child is added.
Positions are numbered from 0 to n-1.
<!-- ##### FUNCTION gtk_menu_shell_deactivate ##### -->
<para>
Deactivates the menu shell. Typically this results in the menu shell
being erased from the screen.
</para>
@menu_shell: a #GtkMenuShell.
<!-- ##### FUNCTION gtk_menu_shell_select_item ##### -->
<para>
Selects the menu item from the menu shell.
</para>
@menu_shell: a #GtkMenuShell.
@menu_item: The #GtkMenuItem to select.
<!-- ##### FUNCTION gtk_menu_shell_select_first ##### -->
<para>
</para>
@menu_shell:
@search_sensitive:
<!-- ##### FUNCTION gtk_menu_shell_deselect ##### -->
<para>
Deselects the currently selected item from the menu shell, if any.
</para>
@menu_shell: a #GtkMenuShell.
<!-- ##### FUNCTION gtk_menu_shell_activate_item ##### -->
<para>
Activates the menu item within the menu shell.
</para>
@menu_shell: a #GtkMenuShell.
@menu_item: The #GtkMenuItem to activate.
@force_deactivate: If TRUE, force the deactivation of the menu shell
after the menu item is activated.
<!-- ##### FUNCTION gtk_menu_shell_cancel ##### -->
<para>
</para>
@menu_shell:
<!-- ##### FUNCTION gtk_menu_shell_set_take_focus ##### -->
<para>
</para>
@menu_shell:
@take_focus:
<!-- ##### FUNCTION gtk_menu_shell_get_take_focus ##### -->
<para>
</para>
@menu_shell:
@Returns:
<!-- ##### ENUM GtkMenuDirectionType ##### -->
<para>
An enumeration representing directional movements within a menu.
</para>
@GTK_MENU_DIR_PARENT: To the parent menu shell.
@GTK_MENU_DIR_CHILD: To the submenu, if any, associated with the item.
@GTK_MENU_DIR_NEXT: To the next menu item.
@GTK_MENU_DIR_PREV: To the previous menu item.
@@ -16,6 +16,24 @@ 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 &lt;child&gt; 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>
-186
View File
@@ -1,186 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkPrintJob
<!-- ##### SECTION Short_Description ##### -->
Represents a print job
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GtkPrintJob object represents a job that is sent to a
printer. You only need to deal directly with print jobs if
you use the non-portable #GtkPrintUnixDialog API.
</para>
<para>
Use gtk_print_job_get_surface() to obtain the cairo surface
onto which the pages must be drawn. Use gtk_print_job_send()
to send the finished job to the printer. If you don't use cairo
#GtkPrintJob also supports printing of manually generated postscript,
via gtk_print_job_set_source_file().
<!-- FIXME more details needed here -->
</para>
<!-- FIXME examples ? -->
<para>
Printing support was added in GTK+ 2.10.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkPrintJob ##### -->
<para>
The GtkPrintJob struct contains only private members
and should not be directly accessed.
</para>
<!-- ##### SIGNAL GtkPrintJob::status-changed ##### -->
<para>
</para>
@printjob: the object which received the signal.
<!-- ##### ARG GtkPrintJob:page-setup ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintJob:printer ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintJob:settings ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintJob:title ##### -->
<para>
</para>
<!-- ##### ARG GtkPrintJob:track-print-status ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GtkPrintJobCompleteFunc ##### -->
<para>
The type of callback that is passed to gtk_print_job_send().
It is called when the print job has been completely sent.
</para>
@print_job: the #GtkPrintJob
@user_data: user data that has been passed to gtk_print_job_send()
@error: a #GError that contains error information if the sending
of the print job failed, otherwise %NULL
<!-- ##### FUNCTION gtk_print_job_new ##### -->
<para>
</para>
@title:
@printer:
@settings:
@page_setup:
@Returns:
<!-- ##### FUNCTION gtk_print_job_get_settings ##### -->
<para>
</para>
@job:
@Returns:
<!-- ##### FUNCTION gtk_print_job_get_printer ##### -->
<para>
</para>
@job:
@Returns:
<!-- ##### FUNCTION gtk_print_job_get_title ##### -->
<para>
</para>
@job:
@Returns:
<!-- ##### FUNCTION gtk_print_job_get_status ##### -->
<para>
</para>
@job:
@Returns:
<!-- ##### FUNCTION gtk_print_job_set_source_file ##### -->
<para>
</para>
@job:
@filename:
@error:
@Returns:
<!-- ##### FUNCTION gtk_print_job_get_surface ##### -->
<para>
</para>
@job:
@error:
@Returns:
<!-- ##### FUNCTION gtk_print_job_send ##### -->
<para>
</para>
@job:
@callback:
@user_data:
@dnotify:
<!-- ##### FUNCTION gtk_print_job_set_track_print_status ##### -->
<para>
</para>
@job:
@track_status:
<!-- ##### FUNCTION gtk_print_job_get_track_print_status ##### -->
<para>
</para>
@job:
@Returns:
@@ -630,14 +630,11 @@ The #GQuark used for #GtkPrintError errors.
<!-- ##### USER_FUNCTION GtkPageSetupDoneFunc ##### -->
<para>
The type of function that is passed to gtk_print_run_page_setup_dialog_async().
This function will be called when the page setup dialog is dismissed, and
also serves as destroy notify for @data.
</para>
@page_setup: the #GtkPageSetup that has been
@data: user data that has been passed to
gtk_print_run_page_setup_dialog_async().
@page_setup:
@data:
<!-- ##### FUNCTION gtk_print_run_page_setup_dialog_async ##### -->
@@ -1,207 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkRecentFilter
<!-- ##### SECTION Short_Description ##### -->
A filter for selecting a subset of recently used files
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GtkRecentFilter can be used to restrict the files being shown
in a #GtkRecentChooser. Files can be filtered based on their name
(with gtk_recent_filter_add_pattern()), on their mime type (with
gtk_file_filter_add_mime_type()), on the application that has
registered them (with gtk_recent_filter_add_application()), or by
a custom filter function (with gtk_recent_filter_add_custom()).
</para>
<para>
Filtering by mime type handles aliasing and subclassing of mime
types; e.g. a filter for text/plain also matches a file with mime
type application/rtf, since application/rtf is a subclass of text/plain.
Note that #GtkRecentFilter allows wildcards for the subtype of a
mime type, so you can e.g. filter for image/*.
</para>
<para>
Normally, filters are used by adding them to a #GtkRecentChooser,
see gtk_recent_chooser_add_filter(), but it is also possible to
manually use a filter on a file with gtk_recent_filter_filter().
</para>
<para>
Recently used files are supported since GTK+ 2.10.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GtkRecentChooser
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkRecentFilter ##### -->
<para>
The <structname>GtkRecentFilter</structname> struct contains
only private fields and should not be directly accessed.
</para>
<!-- ##### STRUCT GtkRecentFilterInfo ##### -->
<para>
A <structname>GtkRecentFilterInfo</structname> struct is used
to pass information about the tested file to gtk_recent_filter_filter().
</para>
@contains: Flags indicating which of the following fields need
are filled
@uri: the URI of the file being tested
@display_name: the string that will be used to display the file
in the recent chooser
@mime_type: the mime type of the file
@applications: the list of applications that have registered the file
@groups: the groups to which the file belongs to
@age: the number of days elapsed since the file has been registered
<!-- ##### ENUM GtkRecentFilterFlags ##### -->
<para>
These flags indicate what parts of a #GtkRecentFilterInfo struct
are filled or need to be filled.
</para>
@GTK_RECENT_FILTER_URI: the URI of the file being tested
@GTK_RECENT_FILTER_DISPLAY_NAME: the string that will be used to
display the file in the recent chooser
@GTK_RECENT_FILTER_MIME_TYPE: the mime type of the file
@GTK_RECENT_FILTER_APPLICATION: the list of applications that have
registered the file
@GTK_RECENT_FILTER_GROUP: the groups to which the file belongs to
@GTK_RECENT_FILTER_AGE: the number of days elapsed since the file
has been registered
<!-- ##### USER_FUNCTION GtkRecentFilterFunc ##### -->
<para>
The type of function that is used with custom filters,
see gtk_recent_filter_add_custom().
</para>
@filter_info: a #GtkRecentFilterInfo that is filled according
to the @needed flags passed to gtk_recent_filter_add_custom()
@user_data: user data passed to gtk_recent_filter_add_custom()
@Returns: %TRUE if the file should be displayed
<!-- ##### FUNCTION gtk_recent_filter_new ##### -->
<para>
</para>
@void:
@Returns:
<!-- ##### FUNCTION gtk_recent_filter_get_name ##### -->
<para>
</para>
@filter:
@Returns:
<!-- ##### FUNCTION gtk_recent_filter_set_name ##### -->
<para>
</para>
@filter:
@name:
<!-- ##### FUNCTION gtk_recent_filter_add_mime_type ##### -->
<para>
</para>
@filter:
@mime_type:
<!-- ##### FUNCTION gtk_recent_filter_add_pattern ##### -->
<para>
</para>
@filter:
@pattern:
<!-- ##### FUNCTION gtk_recent_filter_add_pixbuf_formats ##### -->
<para>
</para>
@filter:
<!-- ##### FUNCTION gtk_recent_filter_add_application ##### -->
<para>
</para>
@filter:
@application:
<!-- ##### FUNCTION gtk_recent_filter_add_group ##### -->
<para>
</para>
@filter:
@group:
<!-- ##### FUNCTION gtk_recent_filter_add_age ##### -->
<para>
</para>
@filter:
@days:
<!-- ##### FUNCTION gtk_recent_filter_add_custom ##### -->
<para>
</para>
@filter:
@needed:
@func:
@data:
@data_destroy:
<!-- ##### FUNCTION gtk_recent_filter_get_needed ##### -->
<para>
</para>
@filter:
@Returns:
<!-- ##### FUNCTION gtk_recent_filter_filter ##### -->
<para>
</para>
@filter:
@filter_info:
@Returns:
-542
View File
@@ -1,542 +0,0 @@
<!-- ##### SECTION Title ##### -->
Selections
<!-- ##### SECTION Short_Description ##### -->
Functions for handling inter-process communication via selections
<!-- ##### SECTION Long_Description ##### -->
<para>
The selection mechanism provides the basis for different types
of communication between processes. In particular, drag and drop and
#GtkClipboard work via selections. You will very seldom or
never need to use most of the functions in this section directly;
#GtkClipboard provides a nicer interface to the same functionality.
</para>
<para>
Some of the datatypes defined this section are used in
the #GtkClipboard and drag-and-drop API's as well. The
#GtkTargetEntry structure and #GtkTargetList objects represent
lists of data types that are supported when sending or
receiving data. The #GtkSelectionData object is used to
store a chunk of data along with the data type and other
associated information.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>
<varlistentry>
<term>#GtkWidget</term>
<listitem><para>Much of the operation of selections happens via
signals for #GtkWidget. In particular, if you are
using the functions in this section, you may need
to pay attention to ::selection_get,
::selection_received, and :selection_clear_event
signals.</para></listitem>
</varlistentry>
</variablelist>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkTargetEntry ##### -->
<para>
A #GtkTargetEntry structure represents a single type of
data than can be supplied for by a widget for a selection
or for supplied or received during drag-and-drop. It
contains a string representing the drag type, a flags
field (used only for drag and drop - see #GtkTargetFlags),
and an application assigned integer ID. The integer
ID will later be passed as a signal parameter for signals
like "selection_get". It allows the application to identify
the target type without extensive string compares.
</para>
@target:
@flags:
@info:
<!-- ##### STRUCT GtkTargetList ##### -->
<para>
A #GtkTargetList structure is a reference counted list
of #GtkTargetPair. It is used to represent the same
information as a table of #GtkTargetEntry, but in
an efficient form. This structure should be treated as
opaque.
</para>
@list:
@ref_count:
<!-- ##### STRUCT GtkTargetPair ##### -->
<para>
Internally used structure in the drag-and-drop and
selection handling code.
</para>
@target:
@flags:
@info:
<!-- ##### FUNCTION gtk_target_entry_new ##### -->
<para>
</para>
@target:
@flags:
@info:
@Returns:
<!-- ##### FUNCTION gtk_target_entry_copy ##### -->
<para>
</para>
@data:
@Returns:
<!-- ##### FUNCTION gtk_target_entry_free ##### -->
<para>
</para>
@data:
<!-- ##### FUNCTION gtk_target_list_new ##### -->
<para>
</para>
@targets:
@ntargets:
@Returns:
<!-- ##### FUNCTION gtk_target_list_ref ##### -->
<para>
</para>
@list:
@Returns:
<!-- ##### FUNCTION gtk_target_list_unref ##### -->
<para>
</para>
@list:
<!-- ##### FUNCTION gtk_target_list_add ##### -->
<para>
</para>
@list:
@target:
@flags:
@info:
<!-- ##### FUNCTION gtk_target_list_add_table ##### -->
<para>
</para>
@list:
@targets:
@ntargets:
<!-- ##### FUNCTION gtk_target_list_add_text_targets ##### -->
<para>
</para>
@list:
@info:
<!-- ##### FUNCTION gtk_target_list_add_image_targets ##### -->
<para>
</para>
@list:
@info:
@writable:
<!-- ##### FUNCTION gtk_target_list_add_uri_targets ##### -->
<para>
</para>
@list:
@info:
<!-- ##### FUNCTION gtk_target_list_add_rich_text_targets ##### -->
<para>
</para>
@list:
@info:
@deserializable:
@buffer:
<!-- ##### FUNCTION gtk_target_list_remove ##### -->
<para>
</para>
@list:
@target:
<!-- ##### FUNCTION gtk_target_list_find ##### -->
<para>
</para>
@list:
@target:
@info:
@Returns:
<!-- ##### FUNCTION gtk_target_table_free ##### -->
<para>
</para>
@targets:
@n_targets:
<!-- ##### FUNCTION gtk_target_table_new_from_list ##### -->
<para>
</para>
@list:
@n_targets:
@Returns:
<!-- ##### FUNCTION gtk_selection_owner_set ##### -->
<para>
</para>
@widget:
@selection:
@time_:
@Returns:
<!-- ##### FUNCTION gtk_selection_owner_set_for_display ##### -->
<para>
</para>
@display:
@widget:
@selection:
@time_:
@Returns:
<!-- ##### FUNCTION gtk_selection_add_target ##### -->
<para>
</para>
@widget:
@selection:
@target:
@info:
<!-- ##### FUNCTION gtk_selection_add_targets ##### -->
<para>
</para>
@widget:
@selection:
@targets:
@ntargets:
<!-- ##### FUNCTION gtk_selection_clear_targets ##### -->
<para>
</para>
@widget:
@selection:
<!-- ##### FUNCTION gtk_selection_convert ##### -->
<para>
</para>
@widget:
@selection:
@target:
@time_:
@Returns: x
<!-- ##### FUNCTION gtk_selection_data_set ##### -->
<para>
</para>
@selection_data:
@type:
@format:
@data:
@length:
<!-- ##### FUNCTION gtk_selection_data_set_text ##### -->
<para>
</para>
@selection_data:
@str:
@len:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_text ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_set_pixbuf ##### -->
<para>
</para>
@selection_data:
@pixbuf:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_pixbuf ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_set_uris ##### -->
<para>
</para>
@selection_data:
@uris:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_uris ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_targets ##### -->
<para>
</para>
@selection_data:
@targets:
@n_atoms:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_targets_include_image ##### -->
<para>
</para>
@selection_data:
@writable:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_targets_include_text ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_targets_include_uri ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_targets_include_rich_text ##### -->
<para>
</para>
@selection_data:
@buffer:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_selection ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_data ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_length ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_data_type ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_display ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_format ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_get_target ##### -->
<para>
</para>
@selection_data:
@Returns:
<!-- ##### FUNCTION gtk_targets_include_image ##### -->
<para>
</para>
@targets:
@n_targets:
@writable:
@Returns:
<!-- ##### FUNCTION gtk_targets_include_text ##### -->
<para>
</para>
@targets:
@n_targets:
@Returns:
<!-- ##### FUNCTION gtk_targets_include_uri ##### -->
<para>
</para>
@targets:
@n_targets:
@Returns:
<!-- ##### FUNCTION gtk_targets_include_rich_text ##### -->
<para>
</para>
@targets:
@n_targets:
@buffer:
@Returns:
<!-- ##### FUNCTION gtk_selection_remove_all ##### -->
<para>
</para>
@widget:
<!-- ##### FUNCTION gtk_selection_data_copy ##### -->
<para>
</para>
@data:
@Returns:
<!-- ##### FUNCTION gtk_selection_data_free ##### -->
<para>
</para>
@data:
-482
View File
@@ -1,482 +0,0 @@
<!-- ##### 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>
+1 -1
View File
@@ -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 #GtkTextsBuffer to serialize
@content_buffer: the #GtkTextBuffer 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
View File
@@ -1,498 +0,0 @@
<!-- ##### SECTION Title ##### -->
GtkTextTag
<!-- ##### SECTION Short_Description ##### -->
A tag that can be applied to text in a GtkTextBuffer
<!-- ##### SECTION Long_Description ##### -->
<para>
You may wish to begin by reading the <link linkend="TextWidget">text widget
conceptual overview</link> which gives an overview of all the objects and data
types related to the text widget and how they work together.
</para>
<para>
Tags should be in the #GtkTextTagTable for a given #GtkTextBuffer
before using them with that buffer.
</para>
<para>
gtk_text_buffer_create_tag() is the best way to create tags.
See <application>gtk-demo</application> for numerous examples.
</para>
<para>
The "invisible" property was not implemented for GTK+ 2.0.
It is working (with minor issues) since 2.8.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkTextTag ##### -->
<para>
</para>
<!-- ##### SIGNAL GtkTextTag::event ##### -->
<para>
</para>
@texttag: the object which received the signal.
@arg1:
@event:
@arg2:
@Returns:
<!-- ##### ARG GtkTextTag:accumulative-margin ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:background ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:background-full-height ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:background-full-height-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:background-gdk ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:background-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:direction ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:editable ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:editable-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:family ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:family-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:font ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:font-desc ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:foreground ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:foreground-gdk ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:foreground-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:indent ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:indent-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:invisible ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:invisible-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:justification ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:justification-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:language ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:language-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:left-margin ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:left-margin-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:name ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:paragraph-background ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:paragraph-background-gdk ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:paragraph-background-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:pixels-above-lines ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:pixels-above-lines-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:pixels-below-lines ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:pixels-below-lines-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:pixels-inside-wrap ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:pixels-inside-wrap-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:right-margin ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:right-margin-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:rise ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:rise-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:scale ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:scale-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:size ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:size-points ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:size-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:stretch ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:stretch-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:strikethrough ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:strikethrough-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:style ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:style-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:tabs ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:tabs-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:underline ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:underline-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:variant ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:variant-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:weight ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:weight-set ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:wrap-mode ##### -->
<para>
</para>
<!-- ##### ARG GtkTextTag:wrap-mode-set ##### -->
<para>
</para>
<!-- ##### ENUM GtkWrapMode ##### -->
<para>
Describes a type of line wrapping.
</para>
@GTK_WRAP_NONE: do not wrap lines; just make the text area wider
@GTK_WRAP_CHAR: wrap text, breaking lines anywhere the cursor can
appear (between characters, usually - if you want to
be technical, between graphemes, see
pango_get_log_attrs())
@GTK_WRAP_WORD: wrap text, breaking lines in between words
@GTK_WRAP_WORD_CHAR: wrap text, breaking lines in between words, or if
that is not enough, also between graphemes.
<!-- ##### STRUCT GtkTextAttributes ##### -->
<para>
Using #GtkTextAttributes directly should rarely be necessary. It's
primarily useful with gtk_text_iter_get_attributes(). As with most
GTK+ structs, the fields in this struct should only be read, never
modified directly.
</para>
@appearance: pointer to sub-struct containing certain attributes
@justification:
@direction:
@font:
@font_scale:
@left_margin:
@indent:
@right_margin:
@pixels_above_lines:
@pixels_below_lines:
@pixels_inside_wrap:
@tabs:
@wrap_mode:
@language:
@invisible:
@bg_full_height:
@editable:
<!-- ##### FUNCTION gtk_text_tag_new ##### -->
<para>
</para>
@name:
@Returns:
<!-- ##### FUNCTION gtk_text_tag_get_priority ##### -->
<para>
</para>
@tag:
@Returns:
<!-- ##### FUNCTION gtk_text_tag_set_priority ##### -->
<para>
</para>
@tag:
@priority:
<!-- ##### FUNCTION gtk_text_tag_event ##### -->
<para>
</para>
@tag:
@event_object:
@event:
@iter:
@Returns:
<!-- ##### STRUCT GtkTextAppearance ##### -->
<para>
</para>
@bg_color:
@fg_color:
@rise:
@underline:
@strikethrough:
@draw_bg:
@inside_selection:
@is_text:
<!-- ##### FUNCTION gtk_text_attributes_new ##### -->
<para>
</para>
@void:
@Returns:
<!-- ##### FUNCTION gtk_text_attributes_copy ##### -->
<para>
</para>
@src:
@Returns:
<!-- ##### FUNCTION gtk_text_attributes_copy_values ##### -->
<para>
</para>
@src:
@dest:
<!-- ##### FUNCTION gtk_text_attributes_unref ##### -->
<para>
</para>
@values:
<!-- ##### FUNCTION gtk_text_attributes_ref ##### -->
<para>
</para>
@values:
@Returns:
-864
View File
@@ -1,864 +0,0 @@
<!-- ##### 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 &mdash; 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, &amp;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, &amp;iter, path);
gtk_tree_path_free (path);
/* walk the tree to find the iterator */
gtk_tree_model_iter_nth_child (model, &amp;iter, NULL, 3);
parent_iter = iter;
gtk_tree_model_iter_nth_child (model, &amp;iter, &amp;parent_iter, 2);
parent_iter = iter;
gtk_tree_model_iter_nth_child (model, &amp;iter, &amp;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, &amp;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, &amp;iter,
STRING_COLUMN, &amp;str_data,
INT_COLUMN, &amp;int_data,
-1);
/* Do something with the data */
g_print ("Row &percnt;d: (&percnt;s,&percnt;d)\n", row_count, str_data, int_data);
g_free (str_data);
row_count ++;
valid = gtk_tree_model_iter_next (list_store, &amp;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:
+1 -1
View File
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="TreeWidget" revision="20 Mar 2002">
<refentry id="TreeWidget">
<refmeta>
<refentrytitle>Tree and List Widget Overview</refentrytitle>
<manvolnum>3</manvolnum>
+6
View File
@@ -30,6 +30,9 @@
<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>
@@ -123,6 +126,9 @@
<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>
+1 -1
View File
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk-windows" revision="4 Feb 2001">
<refentry id="gtk-windows">
<refmeta>
<refentrytitle>Using GTK+ on Windows</refentrytitle>
<manvolnum>3</manvolnum>
+1 -1
View File
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk-x11" revision="17 Jan 2002">
<refentry id="gtk-x11">
<refmeta>
<refentrytitle>Using GTK+ on the X Window System</refentrytitle>
<manvolnum>3</manvolnum>
+5 -2
View File
@@ -1,5 +1,4 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
AUTOMAKE_OPTIONS = 1.7
@@ -27,10 +26,14 @@ GTKDOC_LIBS = $(top_builddir)/modules/other/gail/libgail-util/libgailutil.la
# gtkdoc-mkdb related varaibles
MKDB_OPTIONS =
content_files =
content_files = \
version.xml
HTML_IMAGES =
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
EXTRA_DIST += version.xml.in
-include $(top_srcdir)/git.mk
@@ -2,6 +2,7 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
@@ -0,0 +1 @@
@GTK_VERSION@
+2
View File
@@ -13,7 +13,9 @@ DEPS = \
LDADDS = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(top_builddir)/gdk/libgdk-3.0.la \
$(GTK_DEP_LIBS) \
$(GDK_DEP_LIBS) \
-lm
if USE_X11
+35
View File
@@ -1070,6 +1070,39 @@ create_assistant (void)
return info;
}
static WidgetInfo *
create_appchooserbutton (void)
{
GtkWidget *picker;
GtkWidget *align, *vbox;
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
picker = gtk_app_chooser_button_new ("text/plain");
gtk_container_add (GTK_CONTAINER (align), picker);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
gtk_label_new ("Application Button"),
FALSE, FALSE, 0);
return new_widget_info ("appchooserbutton", vbox, SMALL);
}
static WidgetInfo *
create_appchooserdialog (void)
{
WidgetInfo *info;
GtkWidget *widget;
widget = gtk_app_chooser_dialog_new_for_content_type (NULL, 0, "image/png");
gtk_window_set_default_size (GTK_WINDOW (widget), 200, 300);
info = new_widget_info ("appchooserdialog", widget, ASIS);
info->include_decorations = TRUE;
return info;
}
GList *
get_all_widgets (void)
{
@@ -1117,6 +1150,8 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_print_dialog ());
retval = g_list_prepend (retval, create_volume_button ());
retval = g_list_prepend (retval, create_switch ());
retval = g_list_prepend (retval, create_appchooserbutton ());
retval = g_list_prepend (retval, create_appchooserdialog ());
return retval;
}
+12 -1
View File
@@ -48,4 +48,15 @@ LDADD = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(GTK_DEP_LIBS)
noinst_PROGRAMS = hello-world window-default
drawing_LDADD = $(LDADD) \
$(top_builddir)/gdk/libgdk-3.0.la
noinst_PROGRAMS = \
hello-world \
window-default \
bloatpad \
grid-packing \
drawing \
builder
EXTRA_DIST = builder.ui
+40
View File
@@ -0,0 +1,40 @@
#include <gtk/gtk.h>
static void
print_hello (GtkWidget *widget,
gpointer data)
{
g_print ("Hello World\n");
}
int
main (int argc,
char *argv[])
{
GtkBuilder *builder;
GObject *window;
GObject *button;
gtk_init (&argc, &argv);
/* Construct a GtkBuilder instance and load our UI description */
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "builder.ui", NULL);
/* Connect signal handlers to the constructed widgets. */
window = gtk_builder_get_object (builder, "window");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
button = gtk_builder_get_object (builder, "button1");
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
button = gtk_builder_get_object (builder, "button2");
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
button = gtk_builder_get_object (builder, "quit");
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
gtk_main ();
return 0;
}
+45
View File
@@ -0,0 +1,45 @@
<interface>
<object id="window" class="GtkWindow">
<property name="visible">True</property>
<property name="title">Grid</property>
<property name="border-width">10</property>
<child>
<object id="grid" class="GtkGrid">
<property name="visible">True</property>
<child>
<object id="button1" class="GtkButton">
<property name="visible">True</property>
<property name="label">Button 1</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object id="button2" class="GtkButton">
<property name="visible">True</property>
<property name="label">Button 2</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object id="quit" class="GtkButton">
<property name="visible">True</property>
<property name="label">Quit</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
<property name="width">2</property>
</packing>
</child>
</object>
<packing>
</packing>
</child>
</object>
</interface>
+200
View File
@@ -0,0 +1,200 @@
#include <gtk/gtk.h>
/* Surface to store current scribbles */
static cairo_surface_t *surface = NULL;
static void
clear_surface (void)
{
cairo_t *cr;
cr = cairo_create (surface);
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr);
cairo_destroy (cr);
}
/* Create a new surface of the appropriate size to store our scribbles */
static gboolean
configure_event_cb (GtkWidget *widget,
GdkEventConfigure *event,
gpointer data)
{
if (surface)
cairo_surface_destroy (surface);
surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
CAIRO_CONTENT_COLOR,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
/* Initialize the surface to white */
clear_surface ();
/* We've handled the configure event, no need for further processing. */
return TRUE;
}
/* Redraw the screen from the surface. Note that the ::draw
* signal receives a ready-to-be-used cairo_t that is already
* clipped to only draw the exposed areas of the widget
*/
static gboolean
draw_cb (GtkWidget *widget,
cairo_t *cr,
gpointer data)
{
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);
return FALSE;
}
/* Draw a rectangle on the surface at the given position */
static void
draw_brush (GtkWidget *widget,
gdouble x,
gdouble y)
{
cairo_t *cr;
/* Paint to the surface, where we store our state */
cr = cairo_create (surface);
cairo_rectangle (cr, x - 3, y - 3, 6, 6);
cairo_fill (cr);
cairo_destroy (cr);
/* Now invalidate the affected region of the drawing area. */
gtk_widget_queue_draw_area (widget, x - 3, y - 3, 6, 6);
}
/* Handle button press events by either drawing a rectangle
* or clearing the surface, depending on which button was pressed.
* The ::button-press signal handler receives a GdkEventButton
* struct which contains this information.
*/
static gboolean
button_press_event_cb (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
/* paranoia check, in case we haven't gotten a configure event */
if (surface == NULL)
return FALSE;
if (event->button == 1)
{
draw_brush (widget, event->x, event->y);
}
else if (event->button == 3)
{
clear_surface ();
gtk_widget_queue_draw (widget);
}
/* We've handled the event, stop processing */
return TRUE;
}
/* Handle motion events by continuing to draw if button 1 is
* still held down. The ::motion-notify signal handler receives
* a GdkEventMotion struct which contains this information.
*/
static gboolean
motion_notify_event_cb (GtkWidget *widget,
GdkEventMotion *event,
gpointer data)
{
int x, y;
GdkModifierType state;
/* paranoia check, in case we haven't gotten a configure event */
if (surface == NULL)
return FALSE;
/* This call is very important; it requests the next motion event.
* If you don't call gdk_window_get_pointer() you'll only get
* a single motion event. The reason is that we specified
* GDK_POINTER_MOTION_HINT_MASK to gtk_widget_set_events().
* If we hadn't specified that, we could just use event->x, event->y
* as the pointer location. But we'd also get deluged in events.
* By requesting the next event as we handle the current one,
* we avoid getting a huge number of events faster than we
* can cope.
*/
gdk_window_get_pointer (event->window, &x, &y, &state);
if (state & GDK_BUTTON1_MASK)
draw_brush (widget, x, y);
/* We've handled it, stop processing */
return TRUE;
}
static void
close_window (void)
{
if (surface)
cairo_surface_destroy (surface);
gtk_main_quit ();
}
int
main (int argc,
char *argv[])
{
GtkWidget *window;
GtkWidget *frame;
GtkWidget *da;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (window), frame);
da = gtk_drawing_area_new ();
/* set a minimum size */
gtk_widget_set_size_request (da, 100, 100);
gtk_container_add (GTK_CONTAINER (frame), da);
/* Signals used to handle the backing surface */
g_signal_connect (da, "draw",
G_CALLBACK (draw_cb), NULL);
g_signal_connect (da,"configure-event",
G_CALLBACK (configure_event_cb), NULL);
/* Event signals */
g_signal_connect (da, "motion-notify-event",
G_CALLBACK (motion_notify_event_cb), NULL);
g_signal_connect (da, "button-press-event",
G_CALLBACK (button_press_event_cb), NULL);
/* Ask to receive events the drawing area doesn't normally
* subscribe to. In particular, we need to ask for the
* button press and motion notify events that want to handle.
*/
gtk_widget_set_events (da, gtk_widget_get_events (da)
| GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}
+73
View File
@@ -0,0 +1,73 @@
#include <gtk/gtk.h>
static void
print_hello (GtkWidget *widget,
gpointer data)
{
g_print ("Hello World\n");
}
int
main (int argc,
char *argv[])
{
GtkWidget *window;
GtkWidget *grid;
GtkWidget *button;
/* This is called in all GTK applications. Arguments are parsed
* from the command line and are returned to the application.
*/
gtk_init (&argc, &argv);
/* create a new window, and set its title */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Grid");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
/* Here we construct the container that is going pack our buttons */
grid = gtk_grid_new ();
/* Pack the container in the window */
gtk_container_add (GTK_CONTAINER (window), grid);
button = gtk_button_new_with_label ("Button 1");
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
/* Place the first button in the grid cell (0, 0), and make it fill
* just 1 cell horizontally and vertically (ie no spanning)
*/
gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1);
button = gtk_button_new_with_label ("Button 2");
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
/* Place the second button in the grid cell (1, 0), and make it fill
* just 1 cell horizontally and vertically (ie no spanning)
*/
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1);
button = gtk_button_new_with_label ("Quit");
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
/* Place the Quit button in the grid cell (0, 1), and make it
* span 2 columns.
*/
gtk_grid_attach (GTK_GRID (grid), button, 0, 1, 2, 1);
/* Now that we are done packing our widgets, we show them all
* in one go, by calling gtk_widget_show_all() on the window.
* This call recursively calls gtk_widget_show() on all widgets
* that are contained in the window, directly or indirectly.
*/
gtk_widget_show_all (window);
/* All GTK applications must have a gtk_main(). Control ends here
* and waits for an event to occur (like a key press or a mouse event),
* until gtk_main_quit() is called.
*/
gtk_main ();
return 0;
}
+1 -1
View File
@@ -9,7 +9,7 @@ void value_changed( GtkAdjustment *adjustment,
{
char buffer[16];
sprintf(buffer,"%4.2f",adjustment->value);
sprintf(buffer,"%4.2f",gtk_adjustment_get_value (adjustment));
gtk_label_set_text (GTK_LABEL (label), buffer);
}
+27 -27
View File
@@ -199,9 +199,9 @@ gtk_dial_set_adjustment (GtkDial *dial,
G_CALLBACK (gtk_dial_adjustment_value_changed),
(gpointer) dial);
dial->old_value = adjustment->value;
dial->old_lower = adjustment->lower;
dial->old_upper = adjustment->upper;
dial->old_value = gtk_adjustment_get_value (adjustment);
dial->old_lower = gtk_adjustment_get_lower (adjustment);
dial->old_upper = gtk_adjustment_get_upper (adjustment);
gtk_dial_update (dial);
}
@@ -314,8 +314,8 @@ gtk_dial_expose( GtkWidget *widget,
xc = widget->allocation.width / 2;
yc = widget->allocation.height / 2;
upper = dial->adjustment->upper;
lower = dial->adjustment->lower;
upper = gtk_adjustment_get_upper (dial->adjustment);
lower = gtk_adjustment_get_lower (dial->adjustment);
/* Erase old pointer */
@@ -490,7 +490,7 @@ gtk_dial_button_release( GtkWidget *widget,
g_source_remove (dial->timer);
if ((dial->policy != GTK_UPDATE_CONTINUOUS) &&
(dial->old_value != dial->adjustment->value))
(dial->old_value != gtk_adjustment_get_value (dial->adjustment)))
g_signal_emit_by_name (dial->adjustment, "value_changed");
}
@@ -566,7 +566,7 @@ gtk_dial_update_mouse( GtkDial *dial, gint x, gint y )
xc = GTK_WIDGET(dial)->allocation.width / 2;
yc = GTK_WIDGET(dial)->allocation.height / 2;
old_value = dial->adjustment->value;
old_value = gtk_adjustment_get_value (dial->adjustment);
dial->angle = atan2(yc-y, x-xc);
if (dial->angle < -M_PI/2.)
@@ -578,10 +578,10 @@ gtk_dial_update_mouse( GtkDial *dial, gint x, gint y )
if (dial->angle > 7.*M_PI/6.)
dial->angle = 7.*M_PI/6.;
dial->adjustment->value = dial->adjustment->lower + (7.*M_PI/6 - dial->angle) *
(dial->adjustment->upper - dial->adjustment->lower) / (4.*M_PI/3.);
gtk_adjustment_get_value (dial->adjustment) = gtk_adjustment_get_lower (dial->adjustment) + (7.*M_PI/6 - dial->angle) *
(gtk_adjustment_get_upper (dial->adjustment) - gtk_adjustment_get_lower (dial->adjustment)) / (4.*M_PI/3.);
if (dial->adjustment->value != old_value)
if (gtk_adjustment_get_value (dial->adjustment) != old_value)
{
if (dial->policy == GTK_UPDATE_CONTINUOUS)
{
@@ -612,22 +612,22 @@ gtk_dial_update (GtkDial *dial)
g_return_if_fail (dial != NULL);
g_return_if_fail (GTK_IS_DIAL (dial));
new_value = dial->adjustment->value;
new_value = gtk_adjustment_get_value (dial->adjustment);
if (new_value < dial->adjustment->lower)
new_value = dial->adjustment->lower;
if (new_value < gtk_adjustment_get_lower (dial->adjustment))
new_value = gtk_adjustment_get_lower (dial->adjustment);
if (new_value > dial->adjustment->upper)
new_value = dial->adjustment->upper;
if (new_value > gtk_adjustment_get_upper (dial->adjustment))
new_value = gtk_adjustment_get_upper (dial->adjustment);
if (new_value != dial->adjustment->value)
if (new_value != gtk_adjustment_get_value (dial->adjustment))
{
dial->adjustment->value = new_value;
gtk_adjustment_get_value (dial->adjustment) = new_value;
g_signal_emit_by_name (dial->adjustment, "value_changed");
}
dial->angle = 7.*M_PI/6. - (new_value - dial->adjustment->lower) * 4.*M_PI/3. /
(dial->adjustment->upper - dial->adjustment->lower);
dial->angle = 7.*M_PI/6. - (new_value - gtk_adjustment_get_lower (dial->adjustment)) * 4.*M_PI/3. /
(gtk_adjustment_get_upper (dial->adjustment) - gtk_adjustment_get_lower (dial->adjustment));
gtk_widget_queue_draw (GTK_WIDGET (dial));
}
@@ -643,15 +643,15 @@ gtk_dial_adjustment_changed (GtkAdjustment *adjustment,
dial = GTK_DIAL (data);
if ((dial->old_value != adjustment->value) ||
(dial->old_lower != adjustment->lower) ||
(dial->old_upper != adjustment->upper))
if ((dial->old_value != gtk_adjustment_get_value (adjustment)) ||
(dial->old_lower != gtk_adjustment_get_lower (adjustment)) ||
(dial->old_upper != gtk_adjustment_get_upper (adjustment)))
{
gtk_dial_update (dial);
dial->old_value = adjustment->value;
dial->old_lower = adjustment->lower;
dial->old_upper = adjustment->upper;
dial->old_value = gtk_adjustment_get_value (adjustment);
dial->old_lower = gtk_adjustment_get_lower (adjustment);
dial->old_upper = gtk_adjustment_get_upper (adjustment);
}
}
@@ -666,10 +666,10 @@ gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment,
dial = GTK_DIAL (data);
if (dial->old_value != adjustment->value)
if (dial->old_value != gtk_adjustment_get_value (adjustment))
{
gtk_dial_update (dial);
dial->old_value = adjustment->value;
dial->old_value = gtk_adjustment_get_value (adjustment);
}
}
+2 -1
View File
@@ -1,7 +1,8 @@
#include <gtk/gtk.h>
/* This is a callback function. The data arguments are ignored
* in this example. More on callbacks below. */
* in this example. More on callbacks below.
*/
static void
print_hello (GtkWidget *widget,
gpointer data)

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