Compare commits

..

311 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
347 changed files with 50211 additions and 43380 deletions
-1
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 \
+59
View File
@@ -1,3 +1,62 @@
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
==============================================
+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"
+63 -22
View File
@@ -10,7 +10,7 @@
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [99])
m4_define([gtk_micro_version], [0])
m4_define([gtk_micro_version], [3])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -242,6 +242,13 @@ AC_ARG_ENABLE(rebuilds,
[disable all source autogeneration rules])],,
[enable_rebuilds=yes])
AC_ARG_ENABLE(gtk2-dependency,
AC_HELP_STRING([--enable-gtk2-dependency],
[Do not build gtk-update-icon-cache and other shared tools]),,
[enable_gtk2_dependency=no])
AM_CONDITIONAL(BUILD_ICON_CACHE, [test "x$enable_gtk2_dependency" = xno])
AC_ARG_ENABLE(xkb,
[AC_HELP_STRING([--enable-xkb],
[support XKB extension [default=maybe]])],,
@@ -254,6 +261,22 @@ 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],
@@ -859,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 &&
@@ -1105,11 +1130,15 @@ if test "x$enable_x11_backend" == xyes; then
fi
# 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_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"
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
@@ -1122,32 +1151,44 @@ if test "x$enable_x11_backend" == xyes; 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"
X_EXTENSIONS="$X_EXTENSIONS 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"
X_EXTENSIONS="$X_EXTENSIONS Composite"
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"
X_EXTENSIONS="$X_EXTENSIONS DAMAGE"
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
@@ -1470,7 +1511,7 @@ GLIB_GSETTINGS
# GObject introspection
##################################################
GOBJECT_INTROSPECTION_CHECK([0.9.3])
GOBJECT_INTROSPECTION_CHECK([0.10.1])
##################################################
# Packagekit module
-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);
+3 -3
View File
@@ -135,7 +135,6 @@ content_files = \
x11.sgml \
gtk-query-immodules-3.0.xml \
gtk-update-icon-cache.xml \
gtk-builder-convert.xml \
visual_index.xml \
getting_started.xml \
overview.xml
@@ -329,6 +328,8 @@ HTML_IMAGES = \
$(srcdir)/images/layout-tbrl.png \
$(srcdir)/images/window-default.png \
$(srcdir)/images/hello-world.png \
$(srcdir)/images/grid-packing.png \
$(srcdir)/images/drawing.png \
$(srcdir)/images/switch.png \
$(srcdir)/images/linear.png \
$(srcdir)/images/ease.png \
@@ -374,8 +375,7 @@ EXTRA_DIST += version.xml.in
man_MANS = \
gtk-query-immodules-3.0.1 \
gtk-update-icon-cache.1 \
gtk-builder-convert.1
gtk-update-icon-cache.1
if ENABLE_MAN
+19 -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-building" revision="6 Sept 2001">
<refentry id="gtk-building">
<refmeta>
<refentrytitle>Compiling the GTK+ libraries</refentrytitle>
<manvolnum>3</manvolnum>
@@ -363,6 +363,10 @@ How to compile GTK+ itself
<group>
<arg>--enable-introspection=[no/auto/yes]</arg>
</group>
<group>
<arg>--enable-gtk2-dependency</arg>
<arg>--disable-gtk2-dependency</arg>
</group>
</cmdsynopsis>
</para>
@@ -559,6 +563,7 @@ How to compile GTK+ itself
supported backends are the quartz backend for OS X.
</para>
</formalpara>
<formalpara>
<title><systemitem>--enable-introspection</systemitem></title>
@@ -567,6 +572,19 @@ How to compile GTK+ itself
The default is 'auto'.
</para>
</formalpara>
<formalpara>
<title><systemitem>--enable-gtk2-dependency</systemitem> or
<systemitem>--disable-gtk2-dependency</systemitem></title>
<para>
Whether to rely on an exiting gtk-update-icon-cache utility
instead of building our own. Distributions which are shipping
both GTK+ 2.x and GTK+ 3 may want to use this option to
avoid file conflicts between these packages.
The default is to build gtk-update-icon-cache.
</para>
</formalpara>
</refsect1>
</refentry>
+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-compiling" revision="4 Feb 2001">
<refentry id="gtk-compiling">
<refmeta>
<refentrytitle>Compiling GTK+ Applications</refentrytitle>
<manvolnum>3</manvolnum>
+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 is directly included.</para></warning>
<para>We then proceed into the <function>main</function>() function of the
application, and we declare a <varname>window</varname> variable as a pointer
of type #GtkWidget.</para>
<para>The following line will call gtk_init(), which
is the initialization function for GTK+; this function will set up GTK+,
the type system, the connection to the windowing environment, etc. The
gtk_init() takes as arguments the pointers to the command line arguments
counter and string array; this allows GTK+ to parse specific command line
arguments that control the behavior of GTK+ itself. The parsed arguments
will be removed from the array, leaving the unrecognized ones for your
application to parse.</para>
<note><para>For more information on which command line arguments GTK+
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
Applications</link> section in this reference.</para></note>
<para>The call to gtk_window_new() will create a new #GtkWindow and store
it inside the <varname>window</varname> variable. The type of the window
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
by the windowing system: it will have a frame, a title bar and window
controls, depending on the platform.</para>
<para>In order to terminate the application when the #GtkWindow is
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
function. This function will terminate the GTK+ main loop started by calling
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
destroyed, either by explicitly calling gtk_widget_destroy() or when the
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
the Close window control button is clicked.</para>
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
can be displayed. All this work is done after the main loop has been
started.</para>
<para>The last line of interest is the call to gtk_main(). This function will
start the GTK+ main loop and will block the control flow of the
<function>main</function>() until the gtk_main_quit() function is
called.</para>
<para>The following example is slightly more complex, and tries to
showcase some of the capabilities of GTK+.</para>
<para>In the long tradition of programming languages and libraries,
it is called <emphasis>Hello, World</emphasis>.</para>
<para>
<inlinegraphic fileref="hello-world.png" format="PNG"></inlinegraphic>
</para>
<example id="gtk-getting-started-hello-world">
<title>Hello World in GTK+</title>
<programlisting>
<xi:include href="../../../../examples/hello-world.c" parse="text">
<informalexample><programlisting>
<xi:include href="../../../../examples/window-default.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
</programlisting></informalexample>
<para>You can compile the program above with GCC using:</para>
<para><literallayout>
<literal>gcc `pkg-config --cflags gtk+-3.0` -o window-default window-default.c `pkg-config --libs gtk+-3.0`</literal>
</literallayout></para>
<note><para>For more information on how to compile a GTK+ application, please
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
section in this reference.</para></note>
<para>All GTK+ applications will, of course, include
<filename>gtk/gtk.h</filename>, which declares functions, types and
macros required by GTK+ applications.</para>
<warning><para>Even if GTK+ installs multiple header files, only the
top-level <filename>gtk/gtk.h</filename> header can be directly included
by third party code. The compiler will abort with an error if any other
header is directly included.</para></warning>
<para>We then proceed into the <function>main</function>() function of the
application, and we declare a <varname>window</varname> variable as a pointer
of type #GtkWidget.</para>
<para>The following line will call gtk_init(), which
is the initialization function for GTK+; this function will set up GTK+,
the type system, the connection to the windowing environment, etc. The
gtk_init() takes as arguments the pointers to the command line arguments
counter and string array; this allows GTK+ to parse specific command line
arguments that control the behavior of GTK+ itself. The parsed arguments
will be removed from the array, leaving the unrecognized ones for your
application to parse.</para>
<note><para>For more information on which command line arguments GTK+
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
Applications</link> section in this reference.</para></note>
<para>The call to gtk_window_new() will create a new #GtkWindow and store
it inside the <varname>window</varname> variable. The type of the window
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
by the windowing system: it will have a frame, a title bar and window
controls, depending on the platform.</para>
<para>In order to terminate the application when the #GtkWindow is
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
function. This function will terminate the GTK+ main loop started by calling
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
destroyed, either by explicitly calling gtk_widget_destroy() or when the
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
the Close window control button is clicked.</para>
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
can be displayed. All this work is done after the main loop has been
started.</para>
<para>The last line of interest is the call to gtk_main(). This function will
start the GTK+ main loop and will block the control flow of the
main() until the gtk_main_quit() function is called.</para>
<para>While the program is running, GTK+ is receiving
<firstterm>events</firstterm>. These are typically input events caused by
the user interacting with your program, but also things like messages from
the window manager or other applications. GTK+ processes these and as a
result, <firstterm>signals</firstterm> may be emitted on your widgets.
Connecting handlers for these signals is how you normally make your
program do something in response to user input.</para>
<para>The following example is slightly more complex, and tries to
showcase some of the capabilities of GTK+.</para>
<para>In the long tradition of programming languages and libraries,
it is called <emphasis>Hello, World</emphasis>.</para>
<para>
<inlinegraphic fileref="hello-world.png" format="PNG"></inlinegraphic>
</para>
<example id="gtk-getting-started-hello-world">
<title>Hello World in GTK+</title>
<programlisting>
<xi:include href="../../../../examples/hello-world.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
</simplesect>
<simplesect>
<title>Packing</title>
<para>When creating an application, you'll want to put more than one widget
inside a window. Our first helloworld example only used one widget so we
could simply use a gtk_container_add() call to "pack" the widget into the
window. But when you want to put more than one widget into a window, it
it becomes important to control how each widget is positioned and sized.
This is where packing comes in.</para>
<para>GTK+ comes with a large variety of <firstterm>layout containers</firstterm>
whose purpose it is to control the layout of the child widgets that are
added to them. See <xref linkend="LayoutContainers"/> for an overview.</para>
<para>The following example shows how the GtkGrid container lets you
arrange several buttons:</para>
<para>
<inlinegraphic fileref="grid-packing.png" format="PNG"></inlinegraphic>
</para>
<example id="gtk-getting-started-grid-packing">
<title>Packing buttons</title>
<programlisting>
<xi:include href="../../../../examples/grid-packing.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
</simplesect>
<simplesect>
<title>Drawing</title>
<para>Many widgets, like buttons, do all their drawing themselves. You
just tell them the label you want to see, and they figure out what font
to use, draw the button outline and focus rectangle, etc. Sometimes, it
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
might be the right widget to use. It offers a canvas on which you can
draw by connecting to the #GtkWidget::draw signal.
</para>
<para>The contents of a widget often need to be partially or fully redrawn,
e.g. when another window is moved and uncovers part of the widget, or
when tie window containing it is resized. It is also possible to explicitly
cause part or all of the widget to be redrawn, by calling
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
details by providing a ready-to-use cairo context to the ::draw signal
handler.</para>
<para>The following example shows a ::draw signal handler. It is a bit
more complicated than the previous examples, since it also demonstrates
input event handling by means of ::button-press and ::motion-notify
handlers.</para>
<para>
<inlinegraphic fileref="drawing.png" format="PNG"></inlinegraphic>
</para>
<example id="gtk-getting-started-drawing">
<title>Drawing in response to input</title>
<programlisting>
<xi:include href="../../../../examples/drawing.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
</simplesect>
<simplesect>
<title>Building UIs</title>
<para>When construcing a more complicated interface, with dozens
or hundreds of widgets, doing all the setup work in C code is
cumbersome, and making changes becomes next to impossible.</para>
<para>Thankfully, GTK+ supports the separation of user interface
layout from your business logic, by using UI descriptions in an
XML format that can be parsed by the #GtkBuilder class.</para>
<example>
<title>Packing buttons with GtkBuilder</title>
<programlisting>
<xi:include href="../../../../examples/builder.c" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
The builder.ui file looks like this:
<programlisting>
<xi:include href="../../../../examples/builder.ui" parse="text">
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
</xi:include>
</programlisting>
</example>
<para>Note that GtkBuilder can also be used to construct objects
that are not widgets, such as tree models, adjustments, etc.
That is the reason the method we use here is called
gtk_builder_get_object() and returns a GObject* instead of a
GtkWidget*.</para>
<para>Normally, you would pass a full path to
gtk_builder_add_from_file() to make the execution of your program
independent of the current directory. A common location to install
UI descriptions and similar data is
<filename>/usr/share/<replaceable>appname</replaceable></filename>.
</para>
<para>It is also possible to embed the UI description in the source
code as a string and use gtk_builder_add_from_string() to load it.
But keeping the UI description in a separate file has several
advantages: It is then possible to make minor adjustments to the UI
without recompiling your program, and, more importantly, graphical
UI editors such as <ulink url="http://glade.gnome.org">glade</ulink>
can load the file and allow you to create and modify your UI by
point-and-click.</para>
</simplesect>
</chapter>
@@ -1,61 +0,0 @@
<refentry id="gtk-builder-convert">
<refmeta>
<refentrytitle>gtk-builder-convert</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>gtk-builder-convert</refname>
<refpurpose>Glade file conversion utility</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>gtk-builder-convert</command>
<arg choice="opt">--skip-windows</arg>
<arg choice="opt">--root <replaceable>name</replaceable></arg>
<arg choice="req">input</arg>
<arg choice="req">output</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1><title>Description</title>
<para><command>gtk-builder-convert</command> converts glade files
into XML files which can be loaded with GtkBuilder.
</para>
<para>
It expects the name of a glade file as the first argument, and writes
its output the file specified as the second argument.
</para>
</refsect1>
<refsect1><title>Options</title>
<variablelist>
<varlistentry>
<term>--skip-windows</term>
<term>-w</term>
<listitem><para>Convert everything but GtkWindow subclasses.</para></listitem>
</varlistentry>
<varlistentry>
<term>--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>
-1
View File
@@ -358,7 +358,6 @@
<title>GTK+ Tools</title>
<xi:include href="gtk-query-immodules-3.0.xml" />
<xi:include href="gtk-update-icon-cache.xml" />
<xi:include href="gtk-builder-convert.xml" />
</part>
<xi:include href="glossary.xml" />
+51 -2
View File
@@ -2482,9 +2482,11 @@ gtk_range_set_adjustment
gtk_range_get_inverted
gtk_range_set_inverted
gtk_range_get_value
gtk_range_set_value
gtk_range_set_increments
gtk_range_set_range
gtk_range_set_value
gtk_range_get_round_digits
gtk_range_set_round_digits
GtkSensitivityType
gtk_range_set_lower_stepper_sensitivity
gtk_range_get_lower_stepper_sensitivity
@@ -3446,6 +3448,7 @@ gtk_text_view_move_mark_onscreen
gtk_text_view_place_cursor_onscreen
gtk_text_view_get_visible_rect
gtk_text_view_get_iter_location
gtk_text_view_get_cursor_locations
gtk_text_view_get_line_at_y
gtk_text_view_get_line_yrange
gtk_text_view_get_iter_at_location
@@ -4490,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
@@ -4511,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>
@@ -4565,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>
@@ -4728,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>
@@ -4963,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
@@ -5270,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
@@ -5513,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
@@ -5547,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
@@ -6900,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>
@@ -6915,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
@@ -6937,6 +6984,8 @@ GtkAppChooserDialog
gtk_app_chooser_dialog_new
gtk_app_chooser_dialog_new_for_content_type
gtk_app_chooser_dialog_get_widget
gtk_app_chooser_dialog_set_heading
gtk_app_chooser_dialog_get_heading
<SUBSECTION Standard>
GtkAppChooserDialogClass
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

+79 -3
View File
@@ -606,6 +606,7 @@ gtk_fixed_get_preferred_height (GtkWidget *widget,
find-and-replace task. Please refer to the following table:
<table>
<tgroup cols="2">
<title>GdkRegion to cairo_region_t</title>
<thead>
<row><entry>GDK</entry><entry>cairo</entry></row>
</thead>
@@ -697,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
@@ -740,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>
@@ -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 -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>
+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>
+10
View File
@@ -22,9 +22,12 @@ 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
@@ -33,6 +36,9 @@ gtkitemfactory.sgml
gtklayout.sgml
gtklinkbutton.sgml
gtkmain.sgml
gtkmenu.sgml
gtkmenubar.sgml
gtkmenushell.sgml
gtkmessagedialog.sgml
gtknotebook.sgml
gtkobject.sgml
@@ -42,6 +48,7 @@ gtkpagesetupunixdialog.sgml
gtkpaned.sgml
gtkpapersize.sgml
gtkprinter.sgml
gtkprintjob.sgml
gtkprogressbar.sgml
gtkradioaction.sgml
gtkradiobutton.sgml
@@ -56,6 +63,7 @@ gtkscale.sgml
gtkscalebutton.sgml
gtkscrollbar.sgml
gtkscrolledwindow.sgml
gtkselection.sgml
gtkseparator.sgml
gtkseparatormenuitem.sgml
gtkseparatortoolitem.sgml
@@ -64,6 +72,7 @@ gtkstatusbar.sgml
gtkstyle.sgml
gtktesting.sgml
gtktextiter.sgml
gtktexttag.sgml
gtktexttagtable.sgml
gtktextview.sgml
gtktoggleaction.sgml
@@ -71,6 +80,7 @@ gtktoolbar.sgml
gtktoolitem.sgml
gtktooltip.sgml
gtktreednd.sgml
gtktreemodel.sgml
gtktreemodelfilter.sgml
gtktreeselection.sgml
gtktreesortable.sgml
-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:
-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.
-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:
-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>
+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>
+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 bloatpad
drawing_LDADD = $(LDADD) \
$(top_builddir)/gdk/libgdk-3.0.la
noinst_PROGRAMS = \
hello-world \
window-default \
bloatpad \
grid-packing \
drawing \
builder
EXTRA_DIST = builder.ui
+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;
}
+13 -7
View File
@@ -3,7 +3,8 @@ include $(top_srcdir)/Makefile.decl
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = \
--add-include-path=../gdk
--add-include-path=../gdk \
--warn-all
INTROSPECTION_COMPILER_ARGS = \
--includedir=$(srcdir) \
--includedir=.
@@ -107,7 +108,8 @@ gdk_private_headers = \
gdkinternals.h \
gdkintl.h \
gdkkeysprivate.h \
gdkvisualprivate.h
gdkvisualprivate.h \
gdkx.h
gdk_c_sources = \
gdk.c \
@@ -183,11 +185,13 @@ introspection_files = \
gdkenumtypes.h
Gdk-3.0.gir: libgdk-3.0.la Makefile
Gdk_3_0_gir_SCANNERFLAGS = --warn-all
Gdk_3_0_gir_SCANNERFLAGS = \
--c-include="gdk/gdk.h"
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
Gdk_3_0_gir_LIBS = libgdk-3.0.la
Gdk_3_0_gir_FILES = $(introspection_files)
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
Gdk_3_0_gir_EXPORT_PACKAGES = gdk-3.0
INTROSPECTION_GIRS += Gdk-3.0.gir
if USE_X11
@@ -232,15 +236,17 @@ x11_introspection_files = \
x11/gdkx11window.h
GdkX11-3.0.gir: libgdk-3.0.la Gdk-3.0.gir Makefile
GdkX11_3_0_gir_SCANNERFLAGS = --warn-all --strip-prefix=Gdk
GdkX11_3_0_gir_SCANNERFLAGS = \
--identifier-prefix=Gdk \
--c-include="gdk/gdkx.h" \
--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
GdkX11_3_0_gir_INCLUDES = Gio-2.0 Gdk-3.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
GdkX11_3_0_gir_LIBS = libgdk-3.0.la
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
GdkX11_3_0_gir_EXPORT_PACKAGES = gdk-x11-3.0
INTROSPECTION_GIRS += GdkX11-3.0.gir
introspection_files += $(filter-out x11/gdkx.h, $(x11_introspection_files))
endif # USE_X11
girdir = $(datadir)/gir-1.0
@@ -343,7 +349,7 @@ stamp-gc-h: $(top_builddir)/config.status
dist-hook: ../build/win32/vs9/gdk.vcproj
../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin
for F in $(libgdk_win32_3_0_la_SOURCES); do \
for F in $(libgdk_3_0_la_SOURCES); do \
case $$F in \
*.c) echo ' <File RelativePath="..\..\..\gdk\'$$F'" />' \
;; \
+9 -7
View File
@@ -129,7 +129,6 @@ static const GDebugKey gdk_debug_keys[] = {
{"dnd", GDK_DEBUG_DND},
{"xim", GDK_DEBUG_XIM},
{"nograbs", GDK_DEBUG_NOGRABS},
{"colormap", GDK_DEBUG_COLORMAP},
{"input", GDK_DEBUG_INPUT},
{"cursor", GDK_DEBUG_CURSOR},
{"multihead", GDK_DEBUG_MULTIHEAD},
@@ -268,7 +267,7 @@ gdk_pre_parse_libgtk_only (void)
/**
* gdk_parse_args:
* @argc: the number of command line arguments.
* @argv: the array of command line arguments.
* @argv: (inout) (array length=argc): the array of command line arguments.
*
* Parse command line arguments, and store for future
* use by calls to gdk_display_open().
@@ -707,7 +706,7 @@ gdk_threads_init (void)
}
/**
* gdk_threads_set_lock_functions:
* gdk_threads_set_lock_functions: (skip)
* @enter_fn: function called to guard GDK
* @leave_fn: function called to release the guard
*
@@ -777,7 +776,7 @@ gdk_threads_dispatch_free (gpointer data)
/**
* gdk_threads_add_idle_full:
* @priority: the priority of the idle source. Typically this will be in the
* range btweeen #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE
* range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE
* @function: function to call
* @data: data to pass to @function
* @notify: (allow-none): function to call when the idle is removed, or %NULL
@@ -827,6 +826,7 @@ gdk_threads_dispatch_free (gpointer data)
* Return value: the ID (greater than 0) of the event source.
*
* Since: 2.12
* Rename to: gdk_threads_add_idle
*/
guint
gdk_threads_add_idle_full (gint priority,
@@ -850,7 +850,7 @@ gdk_threads_add_idle_full (gint priority,
}
/**
* gdk_threads_add_idle:
* gdk_threads_add_idle: (skip)
* @function: function to call
* @data: data to pass to @function
*
@@ -929,6 +929,7 @@ gdk_threads_add_idle (GSourceFunc function,
* Return value: the ID (greater than 0) of the event source.
*
* Since: 2.12
* Rename to: gdk_threads_add_timeout
*/
guint
gdk_threads_add_timeout_full (gint priority,
@@ -954,7 +955,7 @@ gdk_threads_add_timeout_full (gint priority,
}
/**
* gdk_threads_add_timeout:
* gdk_threads_add_timeout: (skip)
* @interval: the time between calls to the function, in milliseconds
* (1/1000ths of a second)
* @function: function to call
@@ -995,6 +996,7 @@ gdk_threads_add_timeout (guint interval,
* Return value: the ID (greater than 0) of the event source.
*
* Since: 2.14
* Rename to: gdk_threads_add_timeout_seconds
*/
guint
gdk_threads_add_timeout_seconds_full (gint priority,
@@ -1020,7 +1022,7 @@ gdk_threads_add_timeout_seconds_full (gint priority,
}
/**
* gdk_threads_add_timeout_seconds:
* gdk_threads_add_timeout_seconds: (skip)
* @interval: the time between calls to the function, in seconds
* @function: function to call
* @data: data to pass to @function
+2 -2
View File
@@ -150,7 +150,7 @@ gdk_cursor_init (GdkCursor *cursor)
*
* Adds a reference to @cursor.
*
* Return value: Same @cursor that was passed in
* Return value: (transfer full): Same @cursor that was passed in
*
* Deprecated: 3.0: Use g_object_ref() instead
*/
@@ -355,7 +355,7 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display,
return GDK_DISPLAY_GET_CLASS (display)->get_cursor_for_pixbuf (display, pixbuf, x, y);
}
/**
/**
* gdk_cursor_get_display:
* @cursor: a #GdkCursor.
*
+40 -19
View File
@@ -273,7 +273,9 @@ gdk_device_dispose (GObject *object)
if (device->associated)
{
_gdk_device_set_associated_device (device->associated, NULL);
if (device->type == GDK_DEVICE_TYPE_MASTER)
_gdk_device_set_associated_device (device->associated, NULL);
g_object_unref (device->associated);
device->associated = NULL;
}
@@ -377,14 +379,17 @@ gdk_device_get_property (GObject *object,
}
/**
* gdk_device_get_state:
* gdk_device_get_state: (skip)
* @device: a #GdkDevice.
* @window: a #GdkWindow.
* @axes: an array of doubles to store the values of the axes of @device in,
* or %NULL.
* @mask: location to store the modifiers, or %NULL.
*
* Gets the current state of a pointer device relative to @window.
* Gets the current state of a pointer device relative to @window. As a slave
* device coordinates are those of its master pointer, This
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them, see gdk_device_grab().
*/
void
gdk_device_get_state (GdkDevice *device,
@@ -395,6 +400,8 @@ gdk_device_get_state (GdkDevice *device,
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
if (GDK_DEVICE_GET_CLASS (device)->get_state)
GDK_DEVICE_GET_CLASS (device)->get_state (device, window, axes, mask);
@@ -408,7 +415,10 @@ gdk_device_get_state (GdkDevice *device,
* @x: (out) (allow-none): location to store root window X coordinate of @device, or %NULL.
* @y: (out) (allow-none): location to store root window Y coordinate of @device, or %NULL.
*
* Gets the current location of @device.
* Gets the current location of @device. As a slave device
* coordinates are those of its master pointer, This function
* may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them, see gdk_device_grab().
*
* Since: 3.0
**/
@@ -427,6 +437,10 @@ gdk_device_get_position (GdkDevice *device,
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
display = gdk_device_get_display (device);
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
gdk_display_device_is_grabbed (display, device));
default_screen = gdk_display_get_default_screen (display);
_gdk_device_query_state (device,
@@ -454,6 +468,10 @@ gdk_device_get_position (GdkDevice *device,
* Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns
* %NULL if the window tree under @device is not known to GDK (for example, belongs to another application).
*
* As a slave device coordinates are those of its master pointer, This
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them, see gdk_device_grab().
*
* Returns: (transfer none): the #GdkWindow under the device position, or %NULL.
*
* Since: 3.0
@@ -468,6 +486,8 @@ gdk_device_get_window_at_position (GdkDevice *device,
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device), NULL);
window = _gdk_device_window_at_position (device, &tmp_x, &tmp_y, NULL, FALSE);
@@ -493,12 +513,12 @@ gdk_device_get_window_at_position (GdkDevice *device,
}
/**
* gdk_device_get_history:
* gdk_device_get_history: (skip)
* @device: a #GdkDevice
* @window: the window with respect to which which the event coordinates will be reported
* @start: starting timestamp for range of events to return
* @stop: ending timestamp for the range of events to return
* @events: (array length=n_events) (out) (transfer none): location to store a newly-allocated array of #GdkTimeCoord, or %NULL
* @events: (array length=n_events) (out) (transfer full): location to store a newly-allocated array of #GdkTimeCoord, or %NULL
* @n_events: location to store the length of @events, or %NULL
*
* Obtains the motion history for a pointer device; given a starting and
@@ -554,8 +574,8 @@ _gdk_device_allocate_history (GdkDevice *device,
}
/**
* gdk_device_free_history:
* @events: (inout) (transfer none): an array of #GdkTimeCoord.
* gdk_device_free_history: (skip)
* @events: an array of #GdkTimeCoord.
* @n_events: the length of the array.
*
* Frees an array of #GdkTimeCoord that was returned by gdk_device_get_history().
@@ -697,8 +717,8 @@ gdk_device_get_n_keys (GdkDevice *device)
* gdk_device_get_key:
* @device: a #GdkDevice.
* @index_: the index of the macro button to get.
* @keyval: return value for the keyval.
* @modifiers: return value for modifiers.
* @keyval: (out): return value for the keyval.
* @modifiers: (out): return value for modifiers.
*
* If @index_ has a valid keyval, this function will return %TRUE
* and fill in @keyval and @modifiers with the keyval settings.
@@ -912,9 +932,10 @@ _gdk_device_set_associated_device (GdkDevice *device,
* the list of slave devices attached to it, otherwise it will return
* %NULL
*
* Returns: (transfer container): the list of slave devices, or %NULL. The
* list must be freed with g_list_free(), the contents of the list
* are owned by GTK+ and should not be freed.
* Returns: (transfer container) (element-type GdkDevice): the list of
* slave devices, or %NULL. The list must be freed with
* g_list_free(), the contents of the list are owned by GTK+
* and should not be freed.
**/
GList *
gdk_device_list_slave_devices (GdkDevice *device)
@@ -1023,9 +1044,9 @@ gdk_device_list_axes (GdkDevice *device)
}
/**
* gdk_device_get_axis_value:
* gdk_device_get_axis_value: (skip)
* @device: a pointer #GdkDevice.
* @axes: pointer to an array of axes
* @axes: (array): pointer to an array of axes
* @axis_label: #GdkAtom with the axis label.
* @value: location to store the found value.
*
@@ -1070,11 +1091,11 @@ gdk_device_get_axis_value (GdkDevice *device,
}
/**
* gdk_device_get_axis:
* gdk_device_get_axis: (skip)
* @device: a #GdkDevice
* @axes: pointer to an array of axes
* @axes: (array): pointer to an array of axes
* @use: the use to look for
* @value: location to store the found value.
* @value: (out): location to store the found value.
*
* Interprets an array of double as axis values for a given device,
* and locates the value in the array for a given axis use.
@@ -1148,7 +1169,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
* @event_mask. In either mode, unreported events are discarded.
* @event_mask: specifies the event mask, which is used in accordance with
* @owner_events.
* @cursor: the cursor to display while the grab is active if the device is
* @cursor: (allow-none): the cursor to display while the grab is active if the device is
* a pointer. If this is %NULL then the normal cursors are used for
* @window and its descendants, and the cursor for @window is used
* elsewhere.
+16 -8
View File
@@ -597,7 +597,7 @@ _gdk_display_enable_motion_hints (GdkDisplay *display,
/**
* gdk_display_get_pointer:
* @display: a #GdkDisplay
* @screen: (allow-none): location to store the screen that the
* @screen: (out) (allow-none): location to store the screen that the
* cursor is on, or %NULL.
* @x: (out) (allow-none): location to store root window X coordinate of pointer, or %NULL.
* @y: (out) (allow-none): location to store root window Y coordinate of pointer, or %NULL.
@@ -913,7 +913,7 @@ switch_to_pointer_grab (GdkDisplay *display,
GdkPointerWindowInfo *info;
GList *old_grabs;
GdkModifierType state;
int x, y;
int x = 0, y = 0;
/* Temporarily unset pointer to make sure we send the crossing events below */
old_grabs = g_hash_table_lookup (display->device_grabs, device);
@@ -966,7 +966,14 @@ switch_to_pointer_grab (GdkDisplay *display,
g_object_unref (info->toplevel_under_pointer);
info->toplevel_under_pointer = NULL;
new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
/* Ungrabbed slave devices don't have a position by
* itself, rather depend on its master pointer, so
* it doesn't make sense to track any position for
* these after the grab
*/
if (grab || gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE)
new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
if (new_toplevel)
{
/* w is now toplevel and x,y in toplevel coords */
@@ -1571,7 +1578,8 @@ gdk_display_supports_clipboard_persistence (GdkDisplay *display)
* @display: a #GdkDisplay
* @clipboard_window: a #GdkWindow belonging to the clipboard owner
* @time_: a timestamp
* @targets: an array of targets that should be saved, or %NULL
* @targets: (array length=n_targets): an array of targets
* that should be saved, or %NULL
* if all available targets should be saved.
* @n_targets: length of the @targets array
*
@@ -1694,7 +1702,7 @@ gdk_event_send_client_message_for_display (GdkDisplay *display,
}
/**
* gdk_display_add_client_message_filter:
* gdk_display_add_client_message_filter: (skip)
* @display: a #GdkDisplay for which this message filter applies
* @message_type: the type of ClientMessage events to receive.
* This will be checked against the @message_type field
@@ -1718,7 +1726,7 @@ gdk_display_add_client_message_filter (GdkDisplay *display,
}
/**
* gdk_add_client_message_filter:
* gdk_add_client_message_filter: (skip)
* @message_type: the type of ClientMessage events to receive. This will be
* checked against the <structfield>message_type</structfield> field of the
* XClientMessage event struct.
@@ -1756,7 +1764,7 @@ gdk_display_real_get_app_launch_context (GdkDisplay *display)
* Returns a #GdkAppLaunchContext suitable for launching
* applications on the given display.
*
* Returns: a new #GdkAppLaunchContext for @display.
* Returns: (transfer full): a new #GdkAppLaunchContext for @display.
* Free with g_object_unref() when done
*
* Since: 3.0
@@ -1771,7 +1779,7 @@ gdk_display_get_app_launch_context (GdkDisplay *display)
* gdk_drag_get_protocol_for_display:
* @display: the #GdkDisplay where the destination window resides
* @xid: the windowing system id of the destination window.
* @protocol: location where the supported DND protocol is returned.
* @protocol: (out): location where the supported DND protocol is returned.
*
* Finds out the DND protocol supported by a window.
*
+2 -2
View File
@@ -335,7 +335,7 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
*
* Finds or creates an atom corresponding to a given string.
*
* Returns: the atom corresponding to @atom_name.
* Returns: (transfer none): the atom corresponding to @atom_name.
*/
GdkAtom
gdk_atom_intern (const gchar *atom_name,
@@ -361,7 +361,7 @@ gdk_atom_intern (const gchar *atom_name,
* ever unload the module again (e.g. do not use this function in
* GTK+ theme engines).
*
* Returns: the atom corresponding to @atom_name
* Returns: (transfer none): the atom corresponding to @atom_name
*
* Since: 2.10
*/
+1 -1
View File
@@ -445,7 +445,7 @@ gdk_drag_drop_succeeded (GdkDragContext *context)
*
* Returns the selection atom for the current source window.
*
* Return value: the selection atom, or %GDK_NONE
* Return value: (transfer none): the selection atom, or %GDK_NONE
*/
GdkAtom
gdk_drag_get_selection (GdkDragContext *context)
+41 -39
View File
@@ -503,9 +503,9 @@ gdk_event_copy (const GdkEvent *event)
{
GdkEventPrivate *new_private;
GdkEvent *new_event;
g_return_val_if_fail (event != NULL, NULL);
new_event = gdk_event_new (GDK_NOTHING);
new_private = (GdkEventPrivate *)new_event;
@@ -519,21 +519,22 @@ gdk_event_copy (const GdkEvent *event)
new_private->screen = private->screen;
new_private->device = private->device;
new_private->source_device = private->source_device;
}
switch (event->any.type)
{
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
new_event->key.string = g_strdup (event->key.string);
break;
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
if (event->crossing.subwindow != NULL)
g_object_ref (event->crossing.subwindow);
g_object_ref (event->crossing.subwindow);
break;
case GDK_DRAG_ENTER:
case GDK_DRAG_LEAVE:
case GDK_DRAG_MOTION:
@@ -542,28 +543,28 @@ gdk_event_copy (const GdkEvent *event)
case GDK_DROP_FINISHED:
g_object_ref (event->dnd.context);
break;
case GDK_EXPOSE:
case GDK_DAMAGE:
if (event->expose.region)
new_event->expose.region = cairo_region_copy (event->expose.region);
new_event->expose.region = cairo_region_copy (event->expose.region);
break;
case GDK_SETTING:
new_event->setting.name = g_strdup (new_event->setting.name);
break;
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
if (event->button.axes)
new_event->button.axes = g_memdup (event->button.axes,
if (event->button.axes)
new_event->button.axes = g_memdup (event->button.axes,
sizeof (gdouble) * gdk_device_get_n_axes (event->button.device));
break;
case GDK_MOTION_NOTIFY:
if (event->motion.axes)
new_event->motion.axes = g_memdup (event->motion.axes,
sizeof (gdouble) * gdk_device_get_n_axes (event->motion.device));
if (event->motion.axes)
new_event->motion.axes = g_memdup (event->motion.axes,
sizeof (gdouble) * gdk_device_get_n_axes (event->motion.device));
break;
default:
@@ -917,7 +918,7 @@ gdk_event_get_root_coords (const GdkEvent *event,
/**
* gdk_event_get_axis:
* @event: a #GdkEvent
* @axis_use: (out): the axis use to look for
* @axis_use: the axis use to look for
* @value: (out): location to store the value found
*
* Extract the axis value for a particular axis use from
@@ -1129,9 +1130,10 @@ gdk_event_get_device (const GdkEvent *event)
* @event: a #GdkEvent
* @device: a #GdkDevice
*
* Sets the slave device for @event to @device. The event
* must have been allocated by GTK+, for instance, by
* gdk_event_copy().
* Sets the slave device for @event to @device.
*
* The event must have been allocated by GTK+,
* for instance by gdk_event_copy().
*
* Since: 3.0
**/
@@ -1153,15 +1155,17 @@ gdk_event_set_source_device (GdkEvent *event,
* gdk_event_get_source_device:
* @event: a #GdkEvent
*
* This function returns the hardware (slave) #GdkDevice that has triggered the event,
* falling back to the virtual (master) device (as in gdk_event_get_device()) if the
* event wasn't caused by interaction with a hardware device. This may happen for
* example in synthesized crossing events after a #GdkWindow updates its geometry or
* a grab is acquired/released.
* This function returns the hardware (slave) #GdkDevice that has
* triggered the event, falling back to the virtual (master) device
* (as in gdk_event_get_device()) if the event wasn't caused by
* interaction with a hardware device. This may happen for example
* in synthesized crossing events after a #GdkWindow updates its
* geometry or a grab is acquired/released.
*
* If the event does not contain device field, this function will return %NULL.
* If the event does not contain a device field, this function will
* return %NULL.
*
* Returns: a #GdkDevice, or %NULL.
* Returns: (transfer none): a #GdkDevice, or %NULL.
*
* Since: 3.0
**/
@@ -1189,6 +1193,7 @@ gdk_event_get_source_device (const GdkEvent *event)
* @event: a valid #GdkEvent
*
* Request more motion notifies if @event is a motion notify hint event.
*
* This function should be used instead of gdk_window_get_pointer() to
* request further motion notifies, because it also works for extension
* events where motion notifies are provided for devices other than the
@@ -1196,7 +1201,7 @@ gdk_event_get_source_device (const GdkEvent *event)
* motion events from a %GDK_MOTION_NOTIFY event usually works like this:
*
* |[
* {
* {
* /&ast; motion_event handler &ast;/
* x = motion_event->x;
* y = motion_event->y;
@@ -1256,7 +1261,7 @@ gdk_events_get_axis_distances (GdkEvent *event1,
* gdk_events_get_distance:
* @event1: first #GdkEvent
* @event2: second #GdkEvent
* @distance: return location for the distance
* @distance: (out): return location for the distance
*
* If both events have X/Y information, the distance between both coordinates
* (as in a straight line going from @event1 to @event2) will be returned.
@@ -1279,7 +1284,7 @@ gdk_events_get_distance (GdkEvent *event1,
* gdk_events_get_angle:
* @event1: first #GdkEvent
* @event2: second #GdkEvent
* @angle: return location for the relative angle between both events
* @angle: (out): return location for the relative angle between both events
*
* If both events contain X/Y information, this function will return %TRUE
* and return in @angle the relative angle from @event1 to @event2. The rotation
@@ -1450,20 +1455,15 @@ gdk_get_show_events (void)
static void
gdk_synthesize_click (GdkDisplay *display,
GdkEvent *event,
gint nclicks)
GdkEvent *event,
gint nclicks)
{
GdkEvent temp_event;
GdkEvent *event_copy;
GList *link;
g_return_if_fail (event != NULL);
temp_event = *event;
temp_event.type = (nclicks == 2) ? GDK_2BUTTON_PRESS : GDK_3BUTTON_PRESS;
event_copy = gdk_event_copy (&temp_event);
link = _gdk_event_queue_append (display, event_copy);
event_copy = gdk_event_copy (event);
event_copy->type = (nclicks == 2) ? GDK_2BUTTON_PRESS : GDK_3BUTTON_PRESS;
_gdk_event_queue_append (display, event_copy);
}
void
@@ -1472,6 +1472,8 @@ _gdk_event_button_generate (GdkDisplay *display,
{
GdkMultipleClickInfo *info;
g_return_if_fail (event->type == GDK_BUTTON_PRESS);
info = g_hash_table_lookup (display->multiple_click_info, event->button.device);
if (G_UNLIKELY (!info))
+16 -11
View File
@@ -100,7 +100,7 @@ typedef union _GdkEvent GdkEvent;
/**
* GdkEventFunc:
* @event: the #GdkEvent to process.
* @data: user data set when the event handler was installed with
* @data: (closure): user data set when the event handler was installed with
* gdk_event_handler_set().
*
* Specifies the type of function passed to gdk_event_handler_set() to
@@ -491,8 +491,9 @@ struct _GdkEventVisibility
* @y: the y coordinate of the pointer relative to the window.
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
* the mouse.
* @state: a bit-mask representing the state of the modifier keys (e.g.
* Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
* @state: (type GdkModifierType): a bit-mask representing the state of
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
* buttons. See #GdkModifierType.
* @is_hint: set to 1 if this event is just a hint, see the
* %GDK_POINTER_MOTION_HINT_MASK value of #GdkEventMask.
* @device: the device where the event originated.
@@ -530,8 +531,9 @@ struct _GdkEventMotion
* @y: the y coordinate of the pointer relative to the window.
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
* the mouse.
* @state: a bit-mask representing the state of the modifier keys (e.g.
* Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
* @state: (type GdkModifierType): a bit-mask representing the state of
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
* buttons. See #GdkModifierType.
* @button: the button which was pressed or released, numbered from 1 to 5.
* Normally button 1 is the left mouse button, 2 is the middle button,
* and 3 is the right button. On 2-button mice, the middle button can
@@ -601,8 +603,9 @@ struct _GdkEventButton
* @time: the time of the event in milliseconds.
* @x: the x coordinate of the pointer relative to the window.
* @y: the y coordinate of the pointer relative to the window.
* @state: a bit-mask representing the state of the modifier keys (e.g.
* Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
* @state: (type GdkModifierType): a bit-mask representing the state of
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
* buttons. See #GdkModifierType.
* @direction: the direction to scroll to (one of %GDK_SCROLL_UP,
* %GDK_SCROLL_DOWN, %GDK_SCROLL_LEFT and %GDK_SCROLL_RIGHT).
* @device: the device where the event originated.
@@ -636,8 +639,9 @@ struct _GdkEventScroll
* @send_event: %TRUE if the event was sent explicitly (e.g. using
* <function>XSendEvent</function>).
* @time: the time of the event in milliseconds.
* @state: a bit-mask representing the state of the modifier keys (e.g.
* Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
* @state: (type GdkModifierType): a bit-mask representing the state of
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
* buttons. See #GdkModifierType.
* @keyval: the key that was pressed or released. See the
* <filename>&lt;gdk/gdkkeysyms.h&gt;</filename> header file for a
* complete list of GDK key codes.
@@ -696,8 +700,9 @@ struct _GdkEventKey
* %GDK_NOTIFY_ANCESTOR, %GDK_NOTIFY_VIRTUAL, %GDK_NOTIFY_NONLINEAR or
* %GDK_NOTIFY_NONLINEAR_VIRTUAL).
* @focus: %TRUE if @window is the focus window or an inferior.
* @state: a bit-mask representing the state of the modifier keys (e.g. Control,
* Shift and Alt) and the pointer buttons. See #GdkModifierType.
* @state: (type GdkModifierType): a bit-mask representing the state of
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
* buttons. See #GdkModifierType.
*
* Generated when the pointer enters or leaves a window.
*/
+11 -12
View File
@@ -74,18 +74,17 @@ struct _GdkClientFilter {
};
typedef enum {
GDK_DEBUG_MISC = 1 << 0,
GDK_DEBUG_EVENTS = 1 << 1,
GDK_DEBUG_DND = 1 << 2,
GDK_DEBUG_XIM = 1 << 3,
GDK_DEBUG_NOGRABS = 1 << 4,
GDK_DEBUG_COLORMAP = 1 << 5,
GDK_DEBUG_INPUT = 1 << 6,
GDK_DEBUG_CURSOR = 1 << 7,
GDK_DEBUG_MULTIHEAD = 1 << 8,
GDK_DEBUG_XINERAMA = 1 << 9,
GDK_DEBUG_DRAW = 1 <<10,
GDK_DEBUG_EVENTLOOP = 1 <<11
GDK_DEBUG_MISC = 1 << 0,
GDK_DEBUG_EVENTS = 1 << 1,
GDK_DEBUG_DND = 1 << 2,
GDK_DEBUG_XIM = 1 << 3,
GDK_DEBUG_NOGRABS = 1 << 4,
GDK_DEBUG_INPUT = 1 << 5,
GDK_DEBUG_CURSOR = 1 << 6,
GDK_DEBUG_MULTIHEAD = 1 << 7,
GDK_DEBUG_XINERAMA = 1 << 8,
GDK_DEBUG_DRAW = 1 << 9,
GDK_DEBUG_EVENTLOOP = 1 << 10
} GdkDebugFlag;
extern GList *_gdk_default_filters;
+10 -7
View File
@@ -284,7 +284,7 @@ gdk_keyval_is_lower (guint keyval)
return FALSE;
}
/**
/**
* gdk_keymap_get_default:
*
* Returns the #GdkKeymap attached to the default display.
@@ -366,8 +366,9 @@ gdk_keymap_get_num_lock_state (GdkKeymap *keymap)
* gdk_keymap_get_entries_for_keyval:
* @keymap: a #GdkKeymap
* @keyval: a keyval, such as %GDK_a, %GDK_Up, %GDK_Return, etc.
* @keys: (out): return location for an array of #GdkKeymapKey
* @n_keys: (out): return location for number of elements in returned array
* @keys: (out) (array length=n_keys) (transfer full): return location
* for an array of #GdkKeymapKey
* @n_keys: return location for number of elements in returned array
*
* Obtains a list of keycode/group/level combinations that will
* generate @keyval. Groups and levels are two kinds of keyboard mode;
@@ -396,8 +397,10 @@ gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
* gdk_keymap_get_entries_for_keycode:
* @keymap: a #GdkKeymap
* @hardware_keycode: a keycode
* @keys: (out): return location for array of #GdkKeymapKey, or %NULL
* @keyvals: (out): return location for array of keyvals, or %NULL
* @keys: (out) (array length=n_entries) (transfer full): return
* location for array of #GdkKeymapKey, or %NULL
* @keyvals: (out) (array length=n_entries) (transfer full): return
* location for array of keyvals, or %NULL
* @n_entries: length of @keys and @keyvals
*
* Returns the keyvals bound to @hardware_keycode.
@@ -531,7 +534,7 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
/**
* gdk_keymap_add_virtual_modifiers:
* @keymap: a #GdkKeymap
* @state: pointer to the modifier mask to change
* @state: (out): pointer to the modifier mask to change
*
* Adds virtual modifiers (i.e. Super, Hyper and Meta) which correspond
* to the real modifiers (i.e Mod2, Mod3, ...) in @modifiers.
@@ -557,7 +560,7 @@ gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
/**
* gdk_keymap_map_virtual_modifiers:
* @keymap: a #GdkKeymap
* @state: pointer to the modifier state to map
* @state: (out): pointer to the modifier state to map
*
* Maps the virtual modifiers (i.e. Super, Hyper and Meta) which
* are set in @state to their non-virtual counterparts (i.e. Mod2,
+22 -36
View File
@@ -87,15 +87,11 @@ gdk_offscreen_window_init (GdkOffscreenWindow *window)
static void
gdk_offscreen_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy)
gboolean recursing,
gboolean foreign_destroy)
{
GdkOffscreenWindow *offscreen;
offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
gdk_offscreen_window_set_embedder (window, NULL);
if (!recursing)
gdk_offscreen_window_hide (window);
}
@@ -334,7 +330,7 @@ gdk_offscreen_window_get_device_state (GdkWindow *window,
* If you need to keep this around over window resizes, you need to
* add a reference to it.
*
* Returns: The offscreen surface, or %NULL if not offscreen
* Returns: (transfer none): The offscreen surface, or %NULL if not offscreen
*/
cairo_surface_t *
gdk_offscreen_window_get_surface (GdkWindow *window)
@@ -367,14 +363,13 @@ gdk_offscreen_window_lower (GdkWindow *window)
static void
gdk_offscreen_window_move_resize_internal (GdkWindow *window,
gint x,
gint y,
gint width,
gint height,
gboolean send_expose_events)
gint x,
gint y,
gint width,
gint height,
gboolean send_expose_events)
{
GdkOffscreenWindow *offscreen;
gint dx, dy, dw, dh;
offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
@@ -386,11 +381,6 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
if (window->destroyed)
return;
dx = x - window->x;
dy = y - window->y;
dw = width - window->width;
dh = height - window->height;
window->x = x;
window->y = y;
@@ -421,7 +411,7 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window))
{
// TODO: Only invalidate new area, i.e. for larger windows
/* TODO: Only invalidate new area, i.e. for larger windows */
gdk_window_invalidate_rect (window, NULL, TRUE);
_gdk_synthesize_crossing_events_for_geometry_change (window);
}
@@ -429,16 +419,12 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
static void
gdk_offscreen_window_move_resize (GdkWindow *window,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
GdkOffscreenWindow *offscreen;
offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
if (!with_move)
{
x = window->x;
@@ -451,9 +437,9 @@ gdk_offscreen_window_move_resize (GdkWindow *window,
if (height < 0)
height = window->height;
gdk_offscreen_window_move_resize_internal (window, x, y,
width, height,
TRUE);
gdk_offscreen_window_move_resize_internal (window,
x, y, width, height,
TRUE);
}
static void
@@ -469,6 +455,8 @@ gdk_offscreen_window_show (GdkWindow *window,
static void
gdk_offscreen_window_hide (GdkWindow *window)
{
/* TODO: This needs updating to the new grab world */
#if 0
GdkOffscreenWindow *offscreen;
GdkDisplay *display;
@@ -479,8 +467,6 @@ gdk_offscreen_window_hide (GdkWindow *window)
/* May need to break grabs on children */
display = gdk_window_get_display (window);
/* TODO: This needs updating to the new grab world */
#if 0
if (display->pointer_grab.window != NULL)
{
if (is_parent_of (window, display->pointer_grab.window))
@@ -779,12 +765,12 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
impl_class->set_functions = NULL;
impl_class->begin_resize_drag = NULL;
impl_class->begin_move_drag = NULL;
impl_class->enable_synchronized_configure = NULL;
impl_class->enable_synchronized_configure = gdk_offscreen_window_do_nothing;
impl_class->configure_finished = NULL;
impl_class->set_opacity = NULL;
impl_class->set_composited = NULL;
impl_class->destroy_notify = NULL;
impl_class->register_dnd = NULL;
impl_class->register_dnd = gdk_offscreen_window_do_nothing;
impl_class->drag_begin = NULL;
impl_class->process_updates_recurse = gdk_offscreen_window_process_updates_recurse;
impl_class->sync_rendering = NULL;
+5 -3
View File
@@ -190,11 +190,13 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter,
}
/**
* gdk_pango_layout_line_get_clip_region:
* gdk_pango_layout_line_get_clip_region: (skip)
* @line: a #PangoLayoutLine
* @x_origin: X pixel where you intend to draw the layout line with this clip
* @y_origin: baseline pixel where you intend to draw the layout line with this clip
* @index_ranges: array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes
* @index_ranges: (array): array of byte indexes into the layout,
* where even members of array are start indexes and odd elements
* are end indexes
* @n_ranges: number of ranges in @index_ranges, i.e. half the size of @index_ranges
*
* Obtains a clip region which contains the areas where the given
@@ -239,7 +241,7 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
}
/**
* gdk_pango_layout_get_clip_region:
* gdk_pango_layout_get_clip_region: (skip)
* @layout: a #PangoLayout
* @x_origin: X pixel where you intend to draw the layout with this clip
* @y_origin: Y pixel where you intend to draw the layout with this clip
+1 -1
View File
@@ -53,7 +53,7 @@
* gdk_rectangle_union:
* @src1: a #GdkRectangle
* @src2: a #GdkRectangle
* @dest: return location for the union of @src1 and @src2
* @dest: (out): return location for the union of @src1 and @src2
*
* Calculates the union of two rectangles.
* The union of rectangles @src1 and @src2 is the smallest rectangle which
+3 -3
View File
@@ -272,7 +272,7 @@ gdk_rgba_parse (GdkRGBA *rgba,
/**
* gdk_rgba_hash:
* @p: a #GdkRGBA pointer.
* @p: (type GdkRGBA): a #GdkRGBA pointer.
*
* A hash function suitable for using for a hash
* table that stores #GdkRGBA<!-- -->s.
@@ -294,8 +294,8 @@ gdk_rgba_hash (gconstpointer p)
/**
* gdk_rgba_equal:
* @p1: a #GdkRGBA pointer.
* @p2: another #GdkRGBA pointer.
* @p1: (type GdkRGBA): a #GdkRGBA pointer.
* @p2: (type GdkRGBA): another #GdkRGBA pointer.
*
* Compares two RGBA colors.
*
+5 -4
View File
@@ -226,7 +226,7 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
}
/**
* gdk_selection_property_get:
* gdk_selection_property_get: (skip)
* @requestor: the window on which the data is stored
* @data: location to store a pointer to the retrieved data.
If the retrieval failed, %NULL we be stored here, otherwise, it
@@ -282,10 +282,11 @@ gdk_selection_convert (GdkWindow *requestor,
* @display: a #GdkDisplay
* @encoding: an atom representing the encoding of the text
* @format: the format of the property
* @text: the text to convert
* @text: (array length=length): the text to convert
* @length: the length of @text, in bytes
* @list: location to store the list of strings or %NULL. The
* list should be freed with g_strfreev().
* @list: (out) (array zero-terminated=1): location to store the list
* of strings or %NULL. The list should be freed with
* g_strfreev().
*
* Converts a text property in the given encoding to
* a list of UTF-8 strings.
+5 -3
View File
@@ -219,8 +219,9 @@ gdk_visual_get_best_with_both (gint depth,
/**
* gdk_query_depths:
* @depths: (out) (array): return location for available depths
* @count: (out): return location for number of available depths
* @depths: (out) (array length=count) (transfer none): return
* location for available depths
* @count: return location for number of available depths
*
* This function returns the available bit depths for the default
* screen. It's equivalent to listing the visuals
@@ -240,7 +241,8 @@ gdk_query_depths (gint **depths,
/**
* gdk_query_visual_types:
* @visual_types: return location for the available visual types
* @visual_types: (out) (array length=count) (transfer none): return
* location for the available visual types
* @count: return location for the number of available visual types
*
* This function returns the available visual types for the default
+55 -65
View File
@@ -384,7 +384,8 @@ gdk_window_class_init (GdkWindowClass *klass)
* The ::pick-embedded-child signal is emitted to find an embedded
* child at the given position.
*
* Returns: the #GdkWindow of the embedded child at @x, @y, or %NULL
* Returns: (transfer none): the #GdkWindow of the embedded child at
* @x, @y, or %NULL
*
* Since: 2.18
*/
@@ -405,8 +406,10 @@ gdk_window_class_init (GdkWindowClass *klass)
* @window: the offscreen window on which the signal is emitted
* @offscreen-x: x coordinate in the offscreen window
* @offscreen-y: y coordinate in the offscreen window
* @embedder-x: return location for the x coordinate in the embedder window
* @embedder-y: return location for the y coordinate in the embedder window
* @embedder-x: (out) (type double): return location for the x
* coordinate in the embedder window
* @embedder-y: (out) (type double): return location for the y
* coordinate in the embedder window
*
* The ::to-embedder signal is emitted to translate coordinates
* in an offscreen window to its embedder.
@@ -434,8 +437,10 @@ gdk_window_class_init (GdkWindowClass *klass)
* @window: the offscreen window on which the signal is emitted
* @embedder-x: x coordinate in the embedder window
* @embedder-y: y coordinate in the embedder window
* @offscreen-x: return location for the x coordinate in the offscreen window
* @offscreen-y: return location for the y coordinate in the offscreen window
* @offscreen-x: (out) (type double): return location for the x
* coordinate in the offscreen window
* @offscreen-y: (out) (type double): return location for the y
* coordinate in the offscreen window
*
* The ::from-embedder signal is emitted to translate coordinates
* in the embedder of an offscreen window to the offscreen window.
@@ -1246,7 +1251,7 @@ sync_native_window_stack_position (GdkWindow *window)
* more details. Note: to use this on displays other than the default
* display, @parent must be specified.
*
* Return value: (transfer none): the new #GdkWindow
* Return value: (transfer full): the new #GdkWindow
**/
GdkWindow*
gdk_window_new (GdkWindow *parent,
@@ -2075,7 +2080,7 @@ gdk_window_set_user_data (GdkWindow *window,
/**
* gdk_window_get_user_data:
* @window: a #GdkWindow
* @data: return location for user data
* @data: (out): return location for user data
*
* Retrieves the user data for @window, which is normally the widget
* that @window belongs to. See gdk_window_set_user_data().
@@ -2406,7 +2411,7 @@ gdk_window_peek_children (GdkWindow *window)
}
/**
* gdk_window_add_filter:
* gdk_window_add_filter: (skip)
* @window: a #GdkWindow
* @function: filter callback
* @data: data to pass to filter callback
@@ -2467,20 +2472,19 @@ gdk_window_add_filter (GdkWindow *window,
}
/**
* gdk_window_remove_filter:
* gdk_window_remove_filter: (skip)
* @window: a #GdkWindow
* @function: previously-added filter function
* @data: user data for previously-added filter function
*
* Remove a filter previously added with gdk_window_add_filter().
*
**/
*/
void
gdk_window_remove_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data)
GdkFilterFunc function,
gpointer data)
{
GList *tmp_list, *node;
GList *tmp_list;
GdkEventFilter *filter;
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
@@ -2493,17 +2497,16 @@ gdk_window_remove_filter (GdkWindow *window,
while (tmp_list)
{
filter = (GdkEventFilter *)tmp_list->data;
node = tmp_list;
tmp_list = tmp_list->next;
if ((filter->function == function) && (filter->data == data))
{
{
filter->flags |= GDK_EVENT_FILTER_REMOVED;
_gdk_event_filter_unref (window, filter);
_gdk_event_filter_unref (window, filter);
return;
}
return;
}
}
}
@@ -2672,7 +2675,7 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
static cairo_surface_t *
gdk_window_ref_impl_surface (GdkWindow *window)
{
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (window);
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_window_get_impl_window (window));
}
static cairo_t *
@@ -4431,8 +4434,8 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
* gdk_window_invalidate_maybe_recurse:
* @window: a #GdkWindow
* @region: a #cairo_region_t
* @child_func: function to use to decide if to recurse to a child,
* %NULL means never recurse.
* @child_func: (scope call): function to use to decide if to recurse
* to a child, %NULL means never recurse.
* @user_data: data passed to @child_func
*
* Adds @region to the update area for @window. The update area is the
@@ -4780,8 +4783,8 @@ gdk_window_set_debug_updates (gboolean setting)
* @flags: a mask indicating what portions of @geometry are set
* @width: desired width of window
* @height: desired height of the window
* @new_width: location to store resulting width
* @new_height: location to store resulting height
* @new_width: (out): location to store resulting width
* @new_height: (out): location to store resulting height
*
* Constrains a desired width and height according to a
* set of geometry hints (such as minimum and maximum size).
@@ -5896,25 +5899,20 @@ gdk_window_get_device_events (GdkWindow *window,
static void
gdk_window_move_resize_toplevel (GdkWindow *window,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
cairo_region_t *old_region, *new_region;
GdkWindowImplClass *impl_class;
gboolean expose;
int old_x, old_y, old_abs_x, old_abs_y;
int dx, dy;
gboolean is_resize;
expose = FALSE;
old_region = NULL;
old_x = window->x;
old_y = window->y;
is_resize = (width != -1) || (height != -1);
if (gdk_window_is_viewable (window) &&
@@ -5927,12 +5925,6 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
impl_class->move_resize (window, with_move, x, y, width, height);
dx = window->x - old_x;
dy = window->y - old_y;
old_abs_x = window->abs_x;
old_abs_y = window->abs_y;
/* Avoid recomputing for pure toplevel moves, for performance reasons */
if (is_resize)
recompute_visible_regions (window, TRUE, FALSE);
@@ -5942,8 +5934,7 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
new_region = cairo_region_copy (window->clip_region);
/* This is the newly exposed area (due to any resize),
* X will expose it, but lets do that without the
* roundtrip
* X will expose it, but lets do that without the roundtrip
*/
cairo_region_subtract (new_region, old_region);
gdk_window_invalidate_region_full (window, new_region, TRUE, CLEAR_BG_WINCLEARED);
@@ -6584,8 +6575,8 @@ gdk_window_set_background_pattern (GdkWindow *window,
* does not have its own background and reuses the parent's, %NULL is
* returned and you'll have to query it yourself.
*
* Returns: The pattern to use for the background or %NULL to use the
* parent's background.
* Returns: (transfer none): The pattern to use for the background or
* %NULL to use the parent's background.
*
* Since: 2.22
**/
@@ -6622,9 +6613,10 @@ update_cursor_foreach (GdkDisplay *display,
* there is no custom cursor set on the specified window, and it is
* using the cursor for its parent window.
*
* Return value: a #GdkCursor, or %NULL. The returned object is owned
* by the #GdkWindow and should not be unreferenced directly. Use
* gdk_window_set_cursor() to unset the cursor of the window
* Return value: (transfer none): a #GdkCursor, or %NULL. The returned
* object is owned by the #GdkWindow and should not be unreferenced
* directly. Use gdk_window_set_cursor() to unset the cursor of the
* window
*
* Since: 2.18
*/
@@ -6686,9 +6678,10 @@ gdk_window_set_cursor (GdkWindow *window,
* there is no custom cursor set on the specified window, and it is
* using the cursor for its parent window.
*
* Returns: a #GdkCursor, or %NULL. The returned object is owned
* by the #GdkWindow and should not be unreferenced directly. Use
* gdk_window_set_cursor() to unset the cursor of the window
* Returns: (transfer none): a #GdkCursor, or %NULL. The returned
* object is owned by the #GdkWindow and should not be unreferenced
* directly. Use gdk_window_set_cursor() to unset the cursor of the
* window
*
* Since: 3.0
**/
@@ -6921,8 +6914,8 @@ gdk_window_get_origin (GdkWindow *window,
* @window: a #GdkWindow
* @x: X coordinate in window
* @y: Y coordinate in window
* @root_x: return location for X coordinate
* @root_y: return location for Y coordinate
* @root_x: (out): return location for X coordinate
* @root_y: (out): return location for Y coordinate
*
* Obtains the position of a window position in root
* window coordinates. This is similar to
@@ -9052,14 +9045,11 @@ do_synthesize_crossing_event (gpointer data)
void
_gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window)
{
GdkDisplay *display;
GdkWindow *toplevel;
if (_gdk_native_windows)
return; /* We use the native crossing events if all native */
display = gdk_window_get_display (changed_window);
toplevel = get_event_toplevel (changed_window);
if (!toplevel->synthesize_crossing_event_queued)
@@ -10060,8 +10050,8 @@ gdk_window_set_transient_for (GdkWindow *window,
/**
* gdk_window_get_root_origin:
* @window: a toplevel #GdkWindow
* @x: return location for X position of window frame
* @y: return location for Y position of window frame
* @x: (out): return location for X position of window frame
* @y: (out): return location for Y position of window frame
*
* Obtains the top-left corner of the window manager frame in root
* window coordinates.
@@ -10484,7 +10474,7 @@ gdk_window_set_decorations (GdkWindow *window,
/**
* gdk_window_get_decorations:
* @window: The toplevel #GdkWindow to get the decorations from
* @decorations: The window decorations will be written here
* @decorations: (out): The window decorations will be written here
*
* Returns the decorations set on the GdkWindow with
* gdk_window_set_decorations().
@@ -10834,9 +10824,9 @@ gdk_test_simulate_button (GdkWindow *window,
* when rounded up).
* @pdelete: if %TRUE, delete the property after retrieving the
* data.
* @actual_property_type: location to store the actual type of
* the property.
* @actual_format: location to store the actual return format of the
* @actual_property_type: (out) (transfer none): location to store the
* actual type of the property.
* @actual_format: (out): location to store the actual return format of the
* data; either 8, 16 or 32 bits.
* @actual_length: location to store the length of the retrieved data, in
* bytes. Data returned in the 32 bit format is stored
@@ -10844,9 +10834,9 @@ gdk_test_simulate_button (GdkWindow *window,
* elements should be be calculated via
* @actual_length / sizeof(glong) to ensure portability to
* 64 bit systems.
* @data: location to store a pointer to the data. The retrieved
* data should be freed with g_free() when you are finished
* using it.
* @data: (out) (array length=actual_length) (transfer full): location
* to store a pointer to the data. The retrieved data should be
* freed with g_free() when you are finished using it.
*
* Retrieves a portion of the contents of a property. If the
* property does not exist, then the function returns %FALSE,
@@ -10889,7 +10879,7 @@ gdk_property_get (GdkWindow *window,
}
/**
* gdk_property_change:
* gdk_property_change: (skip)
* @window: a #GdkWindow
* @property: the property to change
* @type: the new type for the property. If @mode is
+33
View File
@@ -0,0 +1,33 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/* This is a kludge to be able to include gdk/gdkx.h from inside the
* GTK source tree.
* Also, this hopefully serves as a warning to new backends to put
* their header into the backend dir from the start.
*/
#include <gdk/x11/gdkx.h>
+6 -2
View File
@@ -24,8 +24,12 @@ gdk_color_SOURCES = gdk-color.c
gdk_color_LDADD = $(progs_ldadd)
TEST_PROGS += encoding
encoding_SOURCES = encoding.c
encoding_LDADD = $(progs_ldadd)
encoding_SOURCES = encoding.c
encoding_LDADD = $(progs_ldadd)
TEST_PROGS += display
display_SOURCES = display.c
display_LDADD = $(progs_ldadd)
CLEANFILES = \
cairosurface.png \
+74
View File
@@ -0,0 +1,74 @@
#include <stdlib.h>
#include <gdk/gdk.h>
static void
test_unset_display (void)
{
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
{
GdkDisplayManager *manager;
g_unsetenv ("DISPLAY");
g_assert (!gdk_init_check (NULL, NULL));
manager = gdk_display_manager_get ();
g_assert (manager != NULL);
g_assert (gdk_display_manager_get_default_display (manager) == NULL);
exit (0);
}
g_test_trap_assert_passed ();
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
{
g_unsetenv ("DISPLAY");
gdk_init (NULL, NULL);
exit (0);
}
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*cannot open display*");
}
static void
test_bad_display (void)
{
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
{
GdkDisplayManager *manager;
g_setenv ("DISPLAY", "poo", TRUE);
g_assert (!gdk_init_check (NULL, NULL));
manager = gdk_display_manager_get ();
g_assert (manager != NULL);
g_assert (gdk_display_manager_get_default_display (manager) == NULL);
exit (0);
}
g_test_trap_assert_passed ();
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
{
g_setenv ("DISPLAY", "poo", TRUE);
gdk_init (NULL, NULL);
exit (0);
}
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*cannot open display*");
}
int
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/display/unset-display", test_unset_display);
g_test_add_func ("/display/bad-display", test_bad_display);
return g_test_run ();
}
+1
View File
@@ -33,6 +33,7 @@ libgdk_win32_la_SOURCES = \
gdkdevice-wintab.c \
gdkdevice-wintab.h \
gdkdisplay-win32.c \
gdkdisplaymanager-win32.c \
gdkdnd-win32.c \
gdkevents-win32.c \
gdkgeometry-win32.c \
+135
View File
@@ -0,0 +1,135 @@
/* GDK - The GIMP Drawing Kit
* gdkdisplaymanager-win32.c
*
* Copyright 2010 Hans Breuer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "gdkwin32display.h"
#include "gdkwin32displaymanager.h"
#include "gdkprivate-win32.h"
#include "gdkdisplaymanagerprivate.h"
#include "gdkinternals.h"
struct _GdkWin32DisplayManager
{
GdkDisplayManager parent_instance;
};
struct _GdkWin32DisplayManagerClass
{
GdkDisplayManagerClass parent_instance;
};
G_DEFINE_TYPE (GdkWin32DisplayManager, gdk_win32_display_manager, GDK_TYPE_DISPLAY_MANAGER)
static GdkDisplay *
gdk_win32_display_manager_open_display (GdkDisplayManager *manager,
const gchar *name)
{
return _gdk_win32_display_open (name);
}
static GSList *
gdk_win32_display_manager_list_displays (GdkDisplayManager *manager)
{
return g_slist_append (NULL, gdk_display_get_default ());
}
static GdkDisplay *
gdk_win32_display_manager_get_default_display (GdkDisplayManager *manager)
{
return _gdk_win32_display_open (NULL);
}
static void
gdk_win32_display_manager_set_default_display (GdkDisplayManager *manager,
GdkDisplay *display)
{
g_assert (gdk_display_get_default () == display);
}
#include "../gdkkeynames.c"
static gchar *
gdk_win32_display_manager_get_keyval_name (GdkDisplayManager *manager,
guint keyval)
{
return _gdk_keyval_name (keyval);
}
static guint
gdk_win32_display_manager_lookup_keyval (GdkDisplayManager *manager,
const gchar *name)
{
return _gdk_keyval_from_name (name);
}
static void
gdk_win32_display_manager_keyval_convert_case (GdkDisplayManager *manager,
guint symbol,
guint *lower,
guint *upper)
{
/* FIXME implement this */
if (lower)
*lower = symbol;
if (upper)
*upper = symbol;
}
static void
gdk_win32_display_manager_init (GdkWin32DisplayManager *manager)
{
static once = TRUE;
/* relies on displaymanager being a singleton , but our init functions
* call gtk_diplay_maanger_get() again */
if (once)
{
once = FALSE;
_gdk_win32_windowing_init ();
}
}
static void
gdk_win32_display_manager_finalize (GObject *object)
{
g_error ("A GdkWin32DisplayManager object was finalized. This should not happen");
G_OBJECT_CLASS (gdk_win32_display_manager_parent_class)->finalize (object);
}
static void
gdk_win32_display_manager_class_init (GdkWin32DisplayManagerClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GdkDisplayManagerClass *manager_class = GDK_DISPLAY_MANAGER_CLASS (class);
object_class->finalize = gdk_win32_display_manager_finalize;
manager_class->open_display = gdk_win32_display_manager_open_display;
manager_class->list_displays = gdk_win32_display_manager_list_displays;
manager_class->set_default_display = gdk_win32_display_manager_set_default_display;
manager_class->get_default_display = gdk_win32_display_manager_get_default_display;
manager_class->atom_intern = _gdk_win32_display_manager_atom_intern;
manager_class->get_atom_name = _gdk_win32_display_manager_get_atom_name;
manager_class->lookup_keyval = gdk_win32_display_manager_lookup_keyval;
manager_class->get_keyval_name = gdk_win32_display_manager_get_keyval_name;
manager_class->keyval_convert_case = gdk_win32_display_manager_keyval_convert_case;
}
-3
View File
@@ -99,9 +99,7 @@
/* Define some combinations of GdkDebugFlags */
#define GDK_DEBUG_EVENTS_OR_COLORMAP (GDK_DEBUG_EVENTS|GDK_DEBUG_COLORMAP)
#define GDK_DEBUG_EVENTS_OR_INPUT (GDK_DEBUG_EVENTS|GDK_DEBUG_INPUT)
#define GDK_DEBUG_MISC_OR_COLORMAP (GDK_DEBUG_MISC|GDK_DEBUG_COLORMAP)
#define GDK_DEBUG_MISC_OR_EVENTS (GDK_DEBUG_MISC|GDK_DEBUG_EVENTS)
GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
@@ -109,7 +107,6 @@ GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
#define GDK_WINDOW_IS_WIN32(win) (GDK_IS_WINDOW_IMPL_WIN32 (win->impl))
typedef struct _GdkColormapPrivateWin32 GdkColormapPrivateWin32;
typedef struct _GdkWin32Cursor GdkWin32Cursor;
typedef struct _GdkWin32SingleFont GdkWin32SingleFont;
struct _GdkWin32Cursor
-4
View File
@@ -65,16 +65,12 @@ _gdk_visual_init (void)
system_visual = g_object_new (GDK_TYPE_VISUAL, NULL);
system_visual->screen = gdk_screen_get_default();
GDK_NOTE (COLORMAP, g_print ("BITSPIXEL=%d NUMCOLORS=%d\n",
bitspixel, numcolors));
if (rastercaps & RC_PALETTE)
{
const int sizepalette = GetDeviceCaps (_gdk_display_hdc, SIZEPALETTE);
gchar *max_colors = getenv ("GDK_WIN32_MAX_COLORS");
system_visual->type = GDK_VISUAL_PSEUDO_COLOR;
GDK_NOTE (COLORMAP, g_print ("SIZEPALETTE=%d\n", sizepalette));
g_assert (sizepalette == 256);
if (max_colors != NULL)
-3
View File
@@ -40,10 +40,7 @@ main (int argc,
if (gdk_settings_map[i].gdk_offset != accu)
g_error ("settings_map[%u].gdk_offset != %u\n", i, accu);
accu += strlen (gdk_settings_names + accu) + 1;
// g_print ("%u) ok.\n", i);
}
g_print ("checksettings: all ok.\n");
return 0;
}
+12 -14
View File
@@ -285,7 +285,7 @@ _gdk_x11_display_get_cursor_for_type (GdkDisplay *display,
}
/**
* gdk_x11_cursor_get_xdisplay:
* gdk_x11_cursor_get_xdisplay: (skip)
* @cursor: a #GdkCursor.
*
* Returns the display of a #GdkCursor.
@@ -301,7 +301,7 @@ gdk_x11_cursor_get_xdisplay (GdkCursor *cursor)
}
/**
* gdk_x11_cursor_get_xcursor:
* gdk_x11_cursor_get_xcursor: (skip)
* @cursor: a #GdkCursor.
*
* Returns the X cursor belonging to a #GdkCursor.
@@ -429,7 +429,7 @@ update_cursor (gpointer data,
if (!cursor)
return;
_gdk_x11_cursor_update_theme (cursor);
}
@@ -437,18 +437,18 @@ update_cursor (gpointer data,
* gdk_x11_display_set_cursor_theme:
* @display: a #GdkDisplay
* @theme: the name of the cursor theme to use, or %NULL to unset
* a previously set value
* a previously set value
* @size: the cursor size to use, or 0 to keep the previous size
*
* Sets the cursor theme from which the images for cursor
* should be taken.
*
* If the windowing system supports it, existing cursors created
* with gdk_cursor_new(), gdk_cursor_new_for_display() and
* gdk_cursor_new_for_name() are updated to reflect the theme
* should be taken.
*
* If the windowing system supports it, existing cursors created
* with gdk_cursor_new(), gdk_cursor_new_for_display() and
* gdk_cursor_new_for_name() are updated to reflect the theme
* change. Custom cursors constructed with
* gdk_cursor_new_from_pixbuf() will have to be handled
* by the application (GTK+ applications can learn about
* by the application (GTK+ applications can learn about
* cursor theme changes by listening for change notification
* for the corresponding #GtkSetting).
*
@@ -459,14 +459,12 @@ gdk_x11_display_set_cursor_theme (GdkDisplay *display,
const gchar *theme,
const gint size)
{
GdkX11Display *display_x11;
Display *xdisplay;
gchar *old_theme;
gint old_size;
g_return_if_fail (GDK_IS_DISPLAY (display));
display_x11 = GDK_X11_DISPLAY (display);
xdisplay = GDK_DISPLAY_XDISPLAY (display);
old_theme = XcursorGetTheme (xdisplay);
@@ -482,13 +480,13 @@ gdk_x11_display_set_cursor_theme (GdkDisplay *display,
XcursorSetTheme (xdisplay, theme);
if (size > 0)
XcursorSetDefaultSize (xdisplay, size);
g_slist_foreach (cursor_cache, update_cursor, NULL);
}
#else
static GdkPixbuf*
static GdkPixbuf*
gdk_x11_cursor_get_image (GdkCursor *cursor)
{
return NULL;
-4
View File
@@ -497,13 +497,11 @@ gdk_x11_device_xi_select_window_events (GdkDevice *device,
GdkEventMask event_mask)
{
XEventClass event_classes[MAX_DEVICE_CLASSES];
GdkX11DeviceXI *device_xi;
gint num_classes;
event_mask |= (GDK_PROXIMITY_IN_MASK |
GDK_PROXIMITY_OUT_MASK);
device_xi = GDK_X11_DEVICE_XI (device);
find_events (device, event_mask, event_classes, &num_classes);
XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (window),
@@ -590,14 +588,12 @@ _gdk_x11_device_xi_translate_axes (GdkDevice *device,
gdouble *x,
gdouble *y)
{
GdkX11DeviceXI *device_xi;
GdkWindow *impl_window;
gdouble root_x, root_y;
gdouble temp_x, temp_y;
gint n_axes;
gint i;
device_xi = GDK_X11_DEVICE_XI (device);
impl_window = _gdk_window_get_impl_window (window);
temp_x = temp_y = 0;
+14 -2
View File
@@ -362,6 +362,8 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
if (mask)
*mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state);
g_free (button_state.mask);
return TRUE;
}
@@ -449,7 +451,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
GdkWindow *window;
Window xwindow, root, child, last = None;
gdouble xroot_x, xroot_y, xwin_x, xwin_y;
XIButtonState button_state;
XIButtonState button_state = { 0 };
XIModifierState mod_state;
XIGroupState group_state;
@@ -501,6 +503,10 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
{
window = GDK_WINDOW (list->data);
xwindow = GDK_WINDOW_XID (window);
/* Free previous button mask, if any */
g_free (button_state.mask);
gdk_x11_display_error_trap_push (display);
XIQueryPointer (xdisplay,
device_xi2->device_id,
@@ -525,6 +531,8 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
XSetWindowAttributes attributes;
Window w;
g_free (button_state.mask);
w = XCreateWindow (xdisplay, xwindow, (int)xwin_x, (int)xwin_y, 1, 1, 0,
CopyFromParent, InputOnly, CopyFromParent,
0, &attributes);
@@ -558,6 +566,8 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
while (xwindow)
{
last = xwindow;
g_free (button_state.mask);
gdk_x11_display_error_trap_push (display);
XIQueryPointer (xdisplay,
device_xi2->device_id,
@@ -593,6 +603,8 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
if (mask)
*mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state);
g_free (button_state.mask);
return window;
}
@@ -677,7 +689,7 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
guint state = 0;
if (mods_state)
state = (guint) mods_state->effective;
state = (guint) mods_state->base | mods_state->latched | mods_state->locked;
if (buttons_state)
{
-2
View File
@@ -415,7 +415,6 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
{
GdkX11DeviceManagerCore *device_manager;
GdkWindow *window;
GdkWindowImplX11 *window_impl = NULL;
gboolean return_val;
GdkToplevelX11 *toplevel = NULL;
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
@@ -431,7 +430,6 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
return FALSE;
toplevel = _gdk_x11_window_get_toplevel (window);
window_impl = GDK_WINDOW_IMPL_X11 (window->impl);
g_object_ref (window);
}
+14 -49
View File
@@ -42,8 +42,7 @@ struct _GdkX11DeviceManagerXI2
GHashTable *id_table;
GList *master_devices;
GList *slave_devices;
GList *devices;
GdkDevice *client_pointer;
@@ -309,12 +308,7 @@ add_device (GdkX11DeviceManagerXI2 *device_manager,
GINT_TO_POINTER (dev->deviceid),
g_object_ref (device));
if (dev->use == XIMasterPointer || dev->use == XIMasterKeyboard)
device_manager->master_devices = g_list_append (device_manager->master_devices, device);
else if (dev->use == XISlavePointer || dev->use == XISlaveKeyboard || dev->use == XIFloatingSlave)
device_manager->slave_devices = g_list_append (device_manager->slave_devices, device);
else
g_warning ("Unhandled device: %s\n", gdk_device_get_name (device));
device_manager->devices = g_list_append (device_manager->devices, device);
if (emit_signal)
{
@@ -349,8 +343,7 @@ remove_device (GdkX11DeviceManagerXI2 *device_manager,
if (device)
{
device_manager->master_devices = g_list_remove (device_manager->master_devices, device);
device_manager->slave_devices = g_list_remove (device_manager->slave_devices, device);
device_manager->devices = g_list_remove (device_manager->devices, device);
g_signal_emit_by_name (device_manager, "device-removed", device);
@@ -418,10 +411,8 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
/* Initialize devices list */
for (i = 0; i < ndevices; i++)
{
GdkDevice *device;
dev = &info[i];
device = add_device (device_manager, dev, FALSE);
add_device (device_manager, dev, FALSE);
if (dev->use == XIMasterPointer ||
dev->use == XIMasterKeyboard)
@@ -469,11 +460,8 @@ gdk_x11_device_manager_xi2_dispose (GObject *object)
device_manager = GDK_X11_DEVICE_MANAGER_XI2 (object);
g_list_free_full (device_manager->master_devices, g_object_unref);
device_manager->master_devices = NULL;
g_list_free_full (device_manager->slave_devices, g_object_unref);
device_manager->slave_devices = NULL;
g_list_free_full (device_manager->devices, g_object_unref);
device_manager->devices = NULL;
if (device_manager->id_table)
{
@@ -489,37 +477,19 @@ gdk_x11_device_manager_xi2_list_devices (GdkDeviceManager *device_manager,
GdkDeviceType type)
{
GdkX11DeviceManagerXI2 *device_manager_xi2;
GList *list = NULL;
GList *cur, *list = NULL;
device_manager_xi2 = GDK_X11_DEVICE_MANAGER_XI2 (device_manager);
switch (type)
for (cur = device_manager_xi2->devices; cur; cur = cur->next)
{
case GDK_DEVICE_TYPE_MASTER:
list = device_manager_xi2->master_devices;
break;
case GDK_DEVICE_TYPE_SLAVE:
case GDK_DEVICE_TYPE_FLOATING:
{
GList *devs = device_manager_xi2->slave_devices;
GdkDevice *dev = cur->data;
while (devs)
{
GdkDevice *dev;
dev = devs->data;
devs = devs->next;
if (type == gdk_device_get_device_type (dev))
list = g_list_prepend (list, dev);
}
}
break;
default:
g_assert_not_reached ();
if (type == gdk_device_get_device_type (dev))
list = g_list_prepend (list, dev);
}
return g_list_copy (list);
return list;
}
static GdkDevice *
@@ -595,7 +565,6 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
{
GdkDisplay *display;
Display *xdisplay;
GdkDevice *device;
XIDeviceInfo *info;
int ndevices;
gint i;
@@ -608,7 +577,7 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
if (ev->info[i].flags & XIDeviceEnabled)
{
info = XIQueryDevice (xdisplay, ev->info[i].deviceid, &ndevices);
device = add_device (device_manager, &info[0], TRUE);
add_device (device_manager, &info[0], TRUE);
XIFreeDeviceInfo (info);
}
else if (ev->info[i].flags & XIDeviceDisabled)
@@ -898,18 +867,14 @@ translate_axes (GdkDevice *device,
XIValuatorState *valuators)
{
guint n_axes, i;
gint width, height;
gdouble *axes;
double *vals;
gdouble *vals;
g_object_get (device, "n-axes", &n_axes, NULL);
axes = g_new0 (gdouble, n_axes);
vals = valuators->values;
width = gdk_window_get_width (window);
height = gdk_window_get_height (window);
for (i = 0; i < valuators->mask_len * 8; i++)
{
GdkAxisUse use;
+3 -2
View File
@@ -1854,7 +1854,8 @@ gdk_x11_lookup_xdisplay (Display *xdisplay)
* Given the root window ID of one of the screen's of a #GdkDisplay,
* finds the screen.
*
* Return value: the #GdkScreen corresponding to @xrootwin, or %NULL.
* Return value: (transfer none): the #GdkScreen corresponding to
* @xrootwin, or %NULL.
**/
GdkScreen *
_gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
@@ -1873,7 +1874,7 @@ _gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
}
/**
* gdk_x11_display_get_xdisplay:
* gdk_x11_display_get_xdisplay: (skip)
* @display: a #GdkDisplay
* @returns: an X display.
*
+1 -1
View File
@@ -53,7 +53,7 @@ gdk_x11_display_manager_open_display (GdkDisplayManager *manager,
GdkDisplay *display;
display = _gdk_x11_display_open (name);
if (manager_x11->default_display == NULL)
if (manager_x11->default_display == NULL && display != NULL)
gdk_display_manager_set_default_display (manager, display);
return display;
-2
View File
@@ -272,7 +272,6 @@ _gdk_x11_window_translate (GdkWindow *window,
GC xgc;
GdkRectangle extents;
GdkWindow *parent;
int px, py;
/* We need to get data from subwindows here, because we might have
* shaped a native window over the moving region (with bg none,
@@ -281,7 +280,6 @@ _gdk_x11_window_translate (GdkWindow *window,
* so we copy from the toplevel with INCLUDE_INFERIORS.
*/
parent = window;
px = py = 0;
while (parent->parent != NULL &&
parent->parent->window_type != GDK_WINDOW_ROOT)
{
+2 -2
View File
@@ -435,7 +435,7 @@ gdk_x11_get_default_screen (void)
}
/**
* gdk_x11_get_default_root_xwindow:
* gdk_x11_get_default_root_xwindow: (skip)
*
* Gets the root window of the default screen
* (see gdk_x11_get_default_screen()).
@@ -449,7 +449,7 @@ gdk_x11_get_default_root_xwindow (void)
}
/**
* gdk_x11_get_default_xdisplay:
* gdk_x11_get_default_xdisplay: (skip)
*
* Gets the default GTK+ display.
*
+6 -6
View File
@@ -207,7 +207,7 @@ lookup_cached_xatom (GdkDisplay *display,
}
/**
* gdk_x11_atom_to_xatom_for_display:
* gdk_x11_atom_to_xatom_for_display: (skip)
* @display: A #GdkDisplay
* @atom: A #GdkAtom, or %GDK_NONE
*
@@ -298,7 +298,7 @@ _gdk_x11_precache_atoms (GdkDisplay *display,
}
/**
* gdk_x11_atom_to_xatom:
* gdk_x11_atom_to_xatom: (skip)
* @atom: A #GdkAtom
*
* Converts from a #GdkAtom to the X atom for the default GDK display
@@ -313,7 +313,7 @@ gdk_x11_atom_to_xatom (GdkAtom atom)
}
/**
* gdk_x11_xatom_to_atom_for_display:
* gdk_x11_xatom_to_atom_for_display: (skip)
* @display: A #GdkDisplay
* @xatom: an X atom
*
@@ -373,7 +373,7 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
}
/**
* gdk_x11_xatom_to_atom:
* gdk_x11_xatom_to_atom: (skip)
* @xatom: an X atom for the default GDK display
*
* Convert from an X atom for the default display to the corresponding
@@ -450,7 +450,7 @@ _gdk_x11_display_manager_get_atom_name (GdkDisplayManager *manager,
}
/**
* gdk_x11_get_xatom_by_name_for_display:
* gdk_x11_get_xatom_by_name_for_display: (skip)
* @display: a #GdkDisplay
* @atom_name: a string
*
@@ -472,7 +472,7 @@ gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display,
}
/**
* gdk_x11_get_xatom_by_name:
* gdk_x11_get_xatom_by_name: (skip)
* @atom_name: a string
*
* Returns the X atom for GDK's default display corresponding to @atom_name.
+1 -1
View File
@@ -265,7 +265,7 @@ gdk_x11_screen_get_monitor_plug_name (GdkScreen *screen,
}
/**
* gdk_x11_screen_get_monitor_output:
* gdk_x11_screen_get_monitor_output: (skip)
* @screen: a #GdkScreen
* @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
*
+8 -7
View File
@@ -576,11 +576,12 @@ _gdk_x11_display_text_property_to_utf8_list (GdkDisplay *display,
* gdk_x11_display_string_to_compound_text:
* @display: the #GdkDisplay where the encoding is defined
* @str: a nul-terminated string
* @encoding: location to store the encoding atom
* @encoding: (out) (transfer none): location to store the encoding atom
* (to be used as the type for the property)
* @format: location to store the format of the property
* @ctext: location to store newly allocated data for the property
* @length: the length of @text, in bytes
* @format: (out): location to store the format of the property
* @ctext: (out) (array length=length): location to store newly
* allocated data for the property
* @length: the length of @ctext, in bytes
*
* Convert a string from the encoding of the current
* locale into a form suitable for storing in a window property.
@@ -696,9 +697,9 @@ _gdk_x11_display_utf8_to_string_target (GdkDisplay *display,
* gdk_x11_display_utf8_to_compound_text:
* @display: a #GdkDisplay
* @str: a UTF-8 string
* @encoding: location to store resulting encoding
* @format: location to store format of the result
* @ctext: location to store the data of the result
* @encoding: (out): location to store resulting encoding
* @format: (out): location to store format of the result
* @ctext: (out) (array length=length): location to store the data of the result
* @length: location to store the length of the data
* stored in @ctext
*
+6 -3
View File
@@ -32,7 +32,8 @@
/* WARNING:
* You will need to update gdk_settings_map when adding a
* new setting, and make sure that checksettings does not
* fail before committing */
* fail before committing
*/
static const char gdk_settings_names[] =
"Net/DoubleClickTime\0" "gtk-double-click-time\0"
"Net/DoubleClickDistance\0" "gtk-double-click-distance\0"
@@ -77,8 +78,9 @@ static const char gdk_settings_names[] =
"Fontconfig/Timestamp\0" "gtk-fontconfig-timestamp\0"
"Net/SoundThemeName\0" "gtk-sound-theme-name\0"
"Net/EnableInputFeedbackSounds\0" "gtk-enable-input-feedback-sounds\0"
"Net/EnableEventSounds\0" "gtk-enable-event-sounds\0"
"Gtk/CursorBlinkTimeout\0" "gtk-cursor-blink-timeout\0";
"Net/EnableEventSounds\0" "gtk-enable-event-sounds\0"
"Gtk/CursorBlinkTimeout\0" "gtk-cursor-blink-timeout\0"
"Gtk/AutoMnemonics\0" "gtk-auto-mnemonics\0";
static const struct
@@ -131,4 +133,5 @@ static const struct
{ 1573, 1603 },
{ 1636, 1658 },
{ 1682, 1705 },
{ 1730, 1748 }
};
+3 -3
View File
@@ -462,8 +462,8 @@ _gdk_x11_screen_list_visuals (GdkScreen *screen)
*
* Looks up the #GdkVisual for a particular screen and X Visual ID.
*
* Returns: the #GdkVisual (owned by the screen object), or %NULL
* if the visual ID wasn't found.
* Returns: (transfer none): the #GdkVisual (owned by the screen
* object), or %NULL if the visual ID wasn't found.
*
* Since: 2.2
*/
@@ -564,7 +564,7 @@ _gdk_visual_get_x11_colormap (GdkVisual *visual)
}
/**
* gdk_x11_visual_get_xvisual:
* gdk_x11_visual_get_xvisual: (skip)
* @visual: a #GdkVisual.
*
* Returns the X visual belonging to a #GdkVisual.
+1 -1
View File
@@ -4663,7 +4663,7 @@ gdk_x11_get_server_time (GdkWindow *window)
}
/**
* gdk_x11_window_get_xid:
* gdk_x11_window_get_xid: (skip)
* @window: a native #GdkWindow.
*
* Returns the X resource (window) belonging to a #GdkWindow.
+29 -20
View File
@@ -3,7 +3,8 @@ include $(top_srcdir)/Makefile.decl
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = \
--add-include-path=../gdk
--add-include-path=../gdk \
--warn-all
INTROSPECTION_COMPILER_ARGS = \
--includedir=$(srcdir) \
--includedir=. \
@@ -173,7 +174,6 @@ gtk_public_h_sources = \
gtkcellarea.h \
gtkcellareacontext.h \
gtkcellareabox.h \
gtkcellareaboxcontext.h \
gtkcelleditable.h \
gtkcelllayout.h \
gtkcellrenderer.h \
@@ -305,6 +305,7 @@ gtk_public_h_sources = \
gtktable.h \
gtktearoffmenuitem.h \
gtktestutils.h \
gtktextattributes.h \
gtktextbuffer.h \
gtktextbufferrichtext.h \
gtktextchild.h \
@@ -381,6 +382,7 @@ gtk_private_h_sources = \
gtkappchooseronline.h \
gtkbuilderprivate.h \
gtkbuttonprivate.h \
gtkcellareaboxcontextprivate.h \
gtkcustompaperunixdialog.h \
gtkdndcursors.h \
gtkentryprivate.h \
@@ -420,6 +422,7 @@ gtk_private_h_sources = \
gtksettingsprivate.h \
gtksizegroup-private.h \
gtksocketprivate.h \
gtkstylecontextprivate.h \
gtktextbtree.h \
gtktextbufferserialize.h \
gtktextchildprivate.h \
@@ -626,6 +629,7 @@ gtk_base_c_sources = \
gtktable.c \
gtktearoffmenuitem.c \
gtktestutils.c \
gtktextattributes.c \
gtktextbtree.c \
gtktextbuffer.c \
gtktextbufferrichtext.c \
@@ -893,10 +897,10 @@ libgtk_3_0_la_LIBADD = $(libadd)
libgtk_3_0_la_DEPENDENCIES = $(deps)
#libgtk_win32_3_0_la_LDFLAGS = $(libtool_opts) -Wl,-luuid
#libgtk_win32_3_0_la_LIBADD = $(libadd) -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32
#libgtk_win32_3_0_la_DEPENDENCIES = $(gtk_def) $(gtk_win32_res) $(deps)
if USE_WIN32
libgtk_3_0_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 -luuid
libgtk_3_0_la_DEPENDENCIES += $(gtk_def) $(gtk_win32_res) $(deps)
libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols)
endif
@@ -907,7 +911,7 @@ endif
if USE_QUARTZ
install-mac-key-theme:
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Mac/gtk-3.0-key
$(mkdir_p) $(DESTDIR)$(datadir)/themes/Mac/gtk-3.0-key
$(INSTALL_DATA) $(srcdir)/gtkrc.key.mac $(DESTDIR)$(datadir)/themes/Mac/gtk-3.0-key/gtkrc
uninstall-mac-key-theme:
rm -f $(DESTDIR)$(datadir)/themes/Mac/gtk-3.0-key/gtkrc
@@ -930,11 +934,11 @@ dist-hook: ../build/win32/vs9/gtk.vcproj
# Install a RC file for the default GTK+ theme, and key themes
install-data-local: install-ms-lib install-def-file install-mac-key-theme
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Raleigh/gtk-3.0
$(mkdir_p) $(DESTDIR)$(datadir)/themes/Raleigh/gtk-3.0
$(INSTALL_DATA) $(srcdir)/gtkrc.default $(DESTDIR)$(datadir)/themes/Raleigh/gtk-3.0/gtkrc
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk-3.0-key
$(mkdir_p) $(DESTDIR)$(datadir)/themes/Default/gtk-3.0-key
$(INSTALL_DATA) $(srcdir)/gtkrc.key.default $(DESTDIR)$(datadir)/themes/Default/gtk-3.0-key/gtkrc
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0-key
$(mkdir_p) $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0-key
$(INSTALL_DATA) $(srcdir)/gtkrc.key.emacs $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0-key/gtkrc
uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-mac-key-theme
@@ -960,16 +964,20 @@ LDADDS = \
if HAVE_INTROSPECTION
introspection_files = \
$(filter-out %private.h gtktextlayout.h, $(gtkinclude_HEADERS)) \
$(filter-out %private.h gtktextdisplay.h gtktextlayout.h, $(gtkinclude_HEADERS)) \
$(gtk_base_c_sources) \
gtkprintoperation-unix.c \
gtktypebuiltins.h \
gtktypebuiltins.c
Gtk-3.0.gir: $(INTROSPECTION_SCANNER) libgtk-3.0.la $(top_builddir)/gdk/Gdk-3.0.gir Makefile
Gtk_3_0_gir_SCANNERFLAGS = --warn-all --add-include-path=$(top_builddir)/gdk
Gtk_3_0_gir_SCANNERFLAGS = \
--add-include-path=$(top_builddir)/gdk \
--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
if USE_X11
Gtk_3_0_gir_SCANNERFLAGS += --add-include-path=$(top_builddir)/gdk/x11
endif
Gtk_3_0_gir_SCANNERFLAGS += --c-include="gtk/gtk.h"
Gtk_3_0_gir_INCLUDES = Atk-1.0 Gdk-3.0
Gtk_3_0_gir_CFLAGS = \
$(INCLUDES) \
@@ -978,6 +986,7 @@ Gtk_3_0_gir_CFLAGS = \
-DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
Gtk_3_0_gir_LIBS = libgtk-3.0.la
Gtk_3_0_gir_FILES = $(introspection_files)
Gtk_3_0_gir_EXPORT_PACKAGES = gtk+-3.0
INTROSPECTION_GIRS += Gtk-3.0.gir
girdir = $(datadir)/gir-1.0
@@ -993,10 +1002,11 @@ endif
# Installed tools
#
bin_PROGRAMS = \
gtk-query-immodules-3.0 \
gtk-update-icon-cache
gtk-query-immodules-3.0
bin_SCRIPTS = gtk-builder-convert
if BUILD_ICON_CACHE
bin_PROGRAMS += gtk-update-icon-cache
endif
if OS_WIN32
@@ -1007,8 +1017,7 @@ if OS_WIN32
GTK_UPDATE_ICON_CACHE_MANIFEST = gtk-update-icon-cache.exe.manifest
bin_SCRIPTS += \
$(GTK_UPDATE_ICON_CACHE_MANIFEST)
bin_SCRIPTS = $(GTK_UPDATE_ICON_CACHE_MANIFEST)
$(GTK_UPDATE_ICON_CACHE_MANIFEST):
(echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' ; \
@@ -1035,8 +1044,10 @@ gtk_query_immodules_3_0_DEPENDENCIES = $(DEPS)
gtk_query_immodules_3_0_LDADD = $(LDADDS)
gtk_query_immodules_3_0_SOURCES = queryimmodules.c
if BUILD_ICON_CACHE
gtk_update_icon_cache_LDADD = $(GDK_PIXBUF_LIBS)
gtk_update_icon_cache_SOURCES = updateiconcache.c
endif
.PHONY: files test test-debug
@@ -1329,11 +1340,10 @@ stamp-icons: $(STOCK_ICONS)
) done \
&& touch stamp-icons
if CROSS_COMPILING
if USE_EXTERNAL_ICON_CACHE
gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE)
else
gtk_update_icon_cache_program = \
./gtk-update-icon-cache
gtk_update_icon_cache_program = ./gtk-update-icon-cache
endif
gtkbuiltincache.h: @REBUILD@ stamp-icons
@@ -1348,11 +1358,10 @@ EXTRA_DIST += \
line-arrow.xbm \
line-wrap.xbm \
tree_plus.xbm \
tree_minus.xbm \
tree_minus.xbm \
tree_minus.xpm \
tree_plus.xpm \
gtk.def \
gtk-builder-convert \
gtk-win32.rc \
gtk-win32.rc.in \
gtkwin32embed.h \
-772
View File
@@ -1,772 +0,0 @@
#!/usr/bin/env python
#
# Copyright (C) 2006-2008 Async Open Source
# Henrique Romano <henrique@async.com.br>
# Johan Dahlin <jdahlin@async.com.br>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# TODO:
# Toolbars
"""Usage: gtk-builder-convert-3.0 [OPTION] [INPUT] [OUTPUT]
Converts Glade files into XML files which can be loaded with GtkBuilder.
The [INPUT] file is
-w, --skip-windows Convert everything but GtkWindow subclasses.
-r, --root Convert only widget named root and its children
-h, --help display this help and exit
When OUTPUT is -, write to standard output.
Examples:
gtk-builder-convert-3.0 preference.glade preferences.ui
Report bugs to http://bugzilla.gnome.org/."""
import getopt
import os
import sys
from xml.dom import minidom, Node
DIALOGS = ['GtkDialog',
'GtkFileChooserDialog',
'GtkMessageDialog']
WINDOWS = ['GtkWindow'] + DIALOGS
# The subprocess is only available in Python 2.4+
try:
import subprocess
subprocess # pyflakes
except ImportError:
subprocess = None
def get_child_nodes(node):
assert node.tagName == 'object'
nodes = []
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName != 'child':
continue
nodes.append(child)
return nodes
def get_properties(node):
assert node.tagName == 'object'
properties = {}
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName != 'property':
continue
value = child.childNodes[0].data
properties[child.getAttribute('name')] = value
return properties
def get_property(node, property_name):
assert node.tagName == 'object'
properties = get_properties(node)
return properties.get(property_name)
def get_property_node(node, property_name):
assert node.tagName == 'object'
properties = {}
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName != 'property':
continue
if child.getAttribute('name') == property_name:
return child
def get_signal_nodes(node):
assert node.tagName == 'object'
signals = []
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName == 'signal':
signals.append(child)
return signals
def get_property_nodes(node):
assert node.tagName == 'object'
properties = []
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
# FIXME: handle comments
if child.tagName == 'property':
properties.append(child)
return properties
def get_accelerator_nodes(node):
assert node.tagName == 'object'
accelerators = []
for child in node.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName == 'accelerator':
accelerators.append(child)
return accelerators
def get_object_node(child_node):
assert child_node.tagName == 'child', child_node
nodes = []
for node in child_node.childNodes:
if node.nodeType != Node.ELEMENT_NODE:
continue
if node.tagName == 'object':
nodes.append(node)
assert len(nodes) == 1, nodes
return nodes[0]
def copy_properties(node, props, prop_dict):
assert node.tagName == 'object'
for prop_name in props:
child = get_property_node(node, prop_name)
if child is not None:
prop_dict[prop_name] = child
return node
class GtkBuilderConverter(object):
def __init__(self, skip_windows, root):
self.skip_windows = skip_windows
self.root = root
self.root_objects = []
self.objects = {}
#
# Public API
#
def parse_file(self, file):
self._dom = minidom.parse(file)
self._parse()
def parse_buffer(self, buffer):
self._dom = minidom.parseString(buffer)
self._parse()
def to_xml(self):
xml = self._dom.toprettyxml("", "")
return xml.encode('utf-8')
#
# Private
#
def _get_object(self, name):
return self.objects.get(name)
def _get_objects_by_attr(self, attribute, value):
return [w for w in self._dom.getElementsByTagName("object")
if w.getAttribute(attribute) == value]
def _create_object(self, obj_class, obj_id, template=None, properties=None):
"""
Creates a new <object> tag.
Optionally a name template can be provided which will be used
to avoid naming collisions.
The properties dictionary can either contain string values or Node
values. If a node is provided the name of the node will be overridden
by the dictionary key.
@param obj_class: class of the object (class tag)
@param obj_id: identifier of the object (id tag)
@param template: name template to use, for example 'button'
@param properties: dictionary of properties
@type properties: string or Node.
@returns: Newly created node of the object
"""
if template is not None:
count = 1
while True:
obj_id = template + str(count)
widget = self._get_object(obj_id)
if widget is None:
break
count += 1
obj = self._dom.createElement('object')
obj.setAttribute('class', obj_class)
obj.setAttribute('id', obj_id)
if properties:
for name, value in properties.items():
if isinstance(value, Node):
# Reuse the node, so translatable and context still will be
# set when converting nodes. See also #509153
prop = value
else:
prop = self._dom.createElement('property')
prop.appendChild(self._dom.createTextNode(value))
prop.setAttribute('name', str(name))
obj.appendChild(prop)
self.objects[obj_id] = obj
return obj
def _create_root_object(self, obj_class, template, properties=None):
obj = self._create_object(obj_class, None, template, properties)
self.root_objects.append(obj)
return obj
def _parse(self):
glade_iface = self._dom.getElementsByTagName("glade-interface")
assert glade_iface, ("Badly formed XML, there is "
"no <glade-interface> tag.")
# Rename glade-interface to interface
glade_iface[0].tagName = 'interface'
self._interface = glade_iface[0]
# Remove glade-interface doc type
for node in self._dom.childNodes:
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
if node.name == 'glade-interface':
self._dom.removeChild(node)
# Strip unsupported tags
for tag in ['requires', 'requires-version']:
for child in self._dom.getElementsByTagName(tag):
child.parentNode.removeChild(child)
if self.root:
self._strip_root(self.root)
# Rename widget to object
objects = self._dom.getElementsByTagName("widget")
for node in objects:
node.tagName = "object"
for node in objects:
self._convert(node.getAttribute("class"), node)
if self._get_object(node.getAttribute('id')) is not None:
print "WARNING: duplicate id \"" + node.getAttribute('id') + "\""
self.objects[node.getAttribute('id')] = node
# Convert Gazpachos UI tag
for node in self._dom.getElementsByTagName("ui"):
self._convert_ui(node)
# Convert accessibility tag
for node in self._dom.getElementsByTagName("accessibility"):
self._convert_accessibility(node)
# Output the newly created root objects and sort them
# by attribute id
# FIXME: Use sorted(self.root_objects,
# key=lambda n: n.getAttribute('id'),
# reverse=True):
# when we can depend on python 2.4 or higher
root_objects = self.root_objects[:]
root_objects.sort(lambda a, b: cmp(b.getAttribute('id'),
a.getAttribute('id')))
for obj in root_objects:
self._interface.childNodes.insert(0, obj)
def _convert(self, klass, node):
if klass == 'GtkNotebook':
self._packing_prop_to_child_attr(node, "type", "tab")
elif klass in ['GtkExpander', 'GtkFrame']:
self._packing_prop_to_child_attr(
node, "type", "label_item", "label")
elif klass == "GtkMenuBar":
self._convert_menu(node)
elif klass == "GtkMenu":
# Only convert toplevel popups
if node.parentNode == self._interface:
self._convert_menu(node, popup=True)
elif klass in WINDOWS and self.skip_windows:
self._remove_window(node)
self._default_widget_converter(node)
def _default_widget_converter(self, node):
klass = node.getAttribute("class")
for prop in get_property_nodes(node):
prop_name = prop.getAttribute("name")
if prop_name == "sizegroup":
self._convert_sizegroup(node, prop)
elif prop_name == "tooltip" and klass != "GtkAction":
prop.setAttribute("name", "tooltip-text")
elif prop_name in ["response_id", 'response-id']:
# It does not make sense to convert responses when
# we're not going to output dialogs
if self.skip_windows:
continue
object_id = node.getAttribute('id')
response = prop.childNodes[0].data
self._convert_dialog_response(node, object_id, response)
prop.parentNode.removeChild(prop)
elif prop_name == "adjustment":
self._convert_adjustment(prop)
elif prop_name == "items" and klass in ['GtkComboBox',
'GtkComboBoxEntry']:
self._convert_combobox_items(node, prop)
elif prop_name == "text" and klass == 'GtkTextView':
self._convert_textview_text(prop)
def _remove_window(self, node):
object_node = get_object_node(get_child_nodes(node)[0])
parent = node.parentNode
parent.removeChild(node)
parent.appendChild(object_node)
def _convert_menu(self, node, popup=False):
if node.hasAttribute('constructor'):
return
uimgr = self._create_root_object('GtkUIManager',
template='uimanager')
if popup:
name = 'popup'
else:
name = 'menubar'
menu = self._dom.createElement(name)
menu.setAttribute('name', node.getAttribute('id'))
node.setAttribute('constructor', uimgr.getAttribute('id'))
for child in get_child_nodes(node):
obj_node = get_object_node(child)
item = self._convert_menuitem(uimgr, obj_node)
menu.appendChild(item)
child.removeChild(obj_node)
child.parentNode.removeChild(child)
ui = self._dom.createElement('ui')
uimgr.appendChild(ui)
ui.appendChild(menu)
def _convert_menuitem(self, uimgr, obj_node):
children = get_child_nodes(obj_node)
name = 'menuitem'
if children:
child_node = children[0]
menu_node = get_object_node(child_node)
# Can be GtkImage, which will take care of later.
if menu_node.getAttribute('class') == 'GtkMenu':
name = 'menu'
object_class = obj_node.getAttribute('class')
if object_class in ['GtkMenuItem',
'GtkImageMenuItem',
'GtkCheckMenuItem',
'GtkRadioMenuItem']:
menu = self._dom.createElement(name)
elif object_class == 'GtkSeparatorMenuItem':
return self._dom.createElement('separator')
else:
raise NotImplementedError(object_class)
menu.setAttribute('action', obj_node.getAttribute('id'))
self._add_action_from_menuitem(uimgr, obj_node)
if children:
for child in get_child_nodes(menu_node):
obj_node = get_object_node(child)
item = self._convert_menuitem(uimgr, obj_node)
menu.appendChild(item)
child.removeChild(obj_node)
child.parentNode.removeChild(child)
return menu
def _menuitem_to_action(self, node, properties):
copy_properties(node, ['label', 'tooltip'], properties)
def _togglemenuitem_to_action(self, node, properties):
self._menuitem_to_action(node, properties)
copy_properties(node, ['active'], properties)
def _radiomenuitem_to_action(self, node, properties):
self._togglemenuitem_to_action(node, properties)
copy_properties(node, ['group'], properties)
def _add_action_from_menuitem(self, uimgr, node):
properties = {}
object_class = node.getAttribute('class')
object_id = node.getAttribute('id')
if object_class == 'GtkMenuItem':
name = 'GtkAction'
self._menuitem_to_action(node, properties)
elif object_class == 'GtkCheckMenuItem':
name = 'GtkToggleAction'
self._togglemenuitem_to_action(node, properties)
elif object_class == 'GtkRadioMenuItem':
name = 'GtkRadioAction'
self._radiomenuitem_to_action(node, properties)
elif object_class == 'GtkImageMenuItem':
name = 'GtkAction'
children = get_child_nodes(node)
if (children and
children[0].getAttribute('internal-child') == 'image'):
image = get_object_node(children[0])
child = get_property_node(image, 'stock')
if child is not None:
properties['stock_id'] = child
self._menuitem_to_action(node, properties)
elif object_class == 'GtkSeparatorMenuItem':
return
else:
raise NotImplementedError(object_class)
if get_property(node, 'use_stock') == 'True':
if 'label' in properties:
properties['stock_id'] = properties['label']
del properties['label']
properties['name'] = object_id
action = self._create_object(name,
object_id,
properties=properties)
for signal in get_signal_nodes(node):
signal_name = signal.getAttribute('name')
if signal_name in ['activate', 'toggled']:
action.appendChild(signal)
else:
print 'Unhandled signal %s::%s' % (node.getAttribute('class'),
signal_name)
if not uimgr.childNodes:
child = self._dom.createElement('child')
uimgr.appendChild(child)
group = self._create_object('GtkActionGroup', None,
template='actiongroup')
child.appendChild(group)
else:
group = uimgr.childNodes[0].childNodes[0]
child = self._dom.createElement('child')
group.appendChild(child)
child.appendChild(action)
for accelerator in get_accelerator_nodes(node):
signal_name = accelerator.getAttribute('signal')
if signal_name != 'activate':
print 'Unhandled accelerator signal for %s::%s' % (
node.getAttribute('class'), signal_name)
continue
accelerator.removeAttribute('signal')
child.appendChild(accelerator)
def _convert_sizegroup(self, node, prop):
# This is Gazpacho only
node.removeChild(prop)
obj = self._get_object(prop.childNodes[0].data)
if obj is None:
widgets = self._get_objects_by_attr("class", "GtkSizeGroup")
if widgets:
obj = widgets[-1]
else:
obj = self._create_root_object('GtkSizeGroup',
template='sizegroup')
widgets = obj.getElementsByTagName("widgets")
if widgets:
assert len(widgets) == 1
widgets = widgets[0]
else:
widgets = self._dom.createElement("widgets")
obj.appendChild(widgets)
member = self._dom.createElement("widget")
member.setAttribute("name", node.getAttribute("id"))
widgets.appendChild(member)
def _convert_dialog_response(self, node, object_name, response):
# 1) Get parent dialog node
while True:
# If we can't find the parent dialog, give up
if node == self._dom:
return
if (node.tagName == 'object' and
node.getAttribute('class') in DIALOGS):
dialog = node
break
node = node.parentNode
assert node
# 2) Get dialogs action-widgets tag, create if not found
for child in dialog.childNodes:
if child.nodeType != Node.ELEMENT_NODE:
continue
if child.tagName == 'action-widgets':
actions = child
break
else:
actions = self._dom.createElement("action-widgets")
dialog.appendChild(actions)
# 3) Add action-widget tag for the response
action = self._dom.createElement("action-widget")
action.setAttribute("response", response)
action.appendChild(self._dom.createTextNode(object_name))
actions.appendChild(action)
def _convert_adjustment(self, prop):
properties = {}
if prop.childNodes:
data = prop.childNodes[0].data
value, lower, upper, step, page, page_size = data.split(' ')
properties.update(value=value,
lower=lower,
upper=upper,
step_increment=step,
page_increment=page,
page_size=page_size)
else:
prop.appendChild(self._dom.createTextNode(""))
adj = self._create_root_object("GtkAdjustment",
template='adjustment',
properties=properties)
prop.childNodes[0].data = adj.getAttribute('id')
def _convert_combobox_items(self, node, prop):
parent = prop.parentNode
if not prop.childNodes:
parent.removeChild(prop)
return
translatable_attr = prop.attributes.get('translatable')
translatable = translatable_attr is not None and translatable_attr.value == 'yes'
has_context_attr = prop.attributes.get('context')
has_context = has_context_attr is not None and has_context_attr.value == 'yes'
comments_attr = prop.attributes.get('comments')
comments = comments_attr is not None and comments_attr.value or None
value = prop.childNodes[0].data
model = self._create_root_object("GtkListStore",
template="model")
columns = self._dom.createElement('columns')
model.appendChild(columns)
column = self._dom.createElement('column')
column.setAttribute('type', 'gchararray')
columns.appendChild(column)
data = self._dom.createElement('data')
model.appendChild(data)
if value.endswith('\n'):
value = value[:-1]
for item in value.split('\n'):
row = self._dom.createElement('row')
data.appendChild(row)
col = self._dom.createElement('col')
col.setAttribute('id', '0')
if translatable:
col.setAttribute('translatable', 'yes')
if has_context:
splitting = item.split('|', 1)
if len(splitting) == 2:
context, item = splitting
col.setAttribute('context', context)
if comments is not None:
col.setAttribute('comments', comments)
col.appendChild(self._dom.createTextNode(item))
row.appendChild(col)
model_prop = self._dom.createElement('property')
model_prop.setAttribute('name', 'model')
model_prop.appendChild(
self._dom.createTextNode(model.getAttribute('id')))
parent.appendChild(model_prop)
parent.removeChild(prop)
child = self._dom.createElement('child')
node.appendChild(child)
cell_renderer = self._create_object('GtkCellRendererText', None,
template='renderer')
child.appendChild(cell_renderer)
attributes = self._dom.createElement('attributes')
child.appendChild(attributes)
attribute = self._dom.createElement('attribute')
attributes.appendChild(attribute)
attribute.setAttribute('name', 'text')
attribute.appendChild(self._dom.createTextNode('0'))
def _convert_textview_text(self, prop):
if not prop.childNodes:
prop.parentNode.removeChild(prop)
return
data = prop.childNodes[0].data
if prop.hasAttribute('translatable'):
prop.removeAttribute('translatable')
tbuffer = self._create_root_object("GtkTextBuffer",
template='textbuffer',
properties=dict(text=data))
prop.childNodes[0].data = tbuffer.getAttribute('id')
prop.setAttribute('name', 'buffer')
def _packing_prop_to_child_attr(self, node, prop_name, prop_val,
attr_val=None):
for child in get_child_nodes(node):
packing_props = [p for p in child.childNodes if p.nodeName == "packing"]
if not packing_props:
continue
assert len(packing_props) == 1
packing_prop = packing_props[0]
properties = packing_prop.getElementsByTagName("property")
for prop in properties:
if (prop.getAttribute("name") != prop_name or
prop.childNodes[0].data != prop_val):
continue
packing_prop.removeChild(prop)
child.setAttribute(prop_name, attr_val or prop_val)
if len(properties) == 1:
child.removeChild(packing_prop)
def _convert_ui(self, node):
cdata = node.childNodes[0]
data = cdata.toxml().strip()
if not data.startswith("<![CDATA[") or not data.endswith("]]>"):
return
data = data[9:-3]
child = minidom.parseString(data).childNodes[0]
nodes = child.childNodes[:]
for child_node in nodes:
node.appendChild(child_node)
node.removeChild(cdata)
if not node.hasAttribute("id"):
return
# Updating references made by widgets
parent_id = node.parentNode.getAttribute("id")
for widget in self._get_objects_by_attr("constructor",
node.getAttribute("id")):
widget.getAttributeNode("constructor").value = parent_id
node.removeAttribute("id")
def _convert_accessibility(self, node):
objectNode = node.parentNode
parent_id = objectNode.getAttribute("id")
properties = {}
for node in node.childNodes:
if node.nodeName == 'atkproperty':
node.tagName = 'property'
properties[node.getAttribute('name')] = node
node.parentNode.removeChild(node)
elif node.nodeName == 'atkrelation':
node.tagName = 'relation'
relation_type = node.getAttribute('type')
relation_type = relation_type.replace('_', '-')
node.setAttribute('type', relation_type)
elif node.nodeName == 'atkaction':
node.tagName = 'action'
if properties:
child = self._dom.createElement('child')
child.setAttribute("internal-child", "accessible")
atkobject = self._create_object(
"AtkObject", None,
template='a11y-%s' % (parent_id,),
properties=properties)
child.appendChild(atkobject)
objectNode.appendChild(child)
def _strip_root(self, root_name):
for widget in self._dom.getElementsByTagName("widget"):
if widget.getAttribute('id') == root_name:
break
else:
raise SystemExit("Could not find an object called `%s'" % (
root_name))
for child in self._interface.childNodes[:]:
if child.nodeType != Node.ELEMENT_NODE:
continue
child.parentNode.removeChild(child)
self._interface.appendChild(widget)
def _indent(output):
if not subprocess:
return output
for directory in os.environ['PATH'].split(os.pathsep):
filename = os.path.join(directory, 'xmllint')
if os.path.exists(filename):
break
else:
return output
s = subprocess.Popen([filename, '--format', '-'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
s.stdin.write(output)
s.stdin.close()
return s.stdout.read()
def usage():
print __doc__
def main(args):
try:
opts, args = getopt.getopt(args[1:], "hwr:",
["help", "skip-windows", "root="])
except getopt.GetoptError:
usage()
return 2
if len(args) != 2:
usage()
return 2
input_filename, output_filename = args
skip_windows = False
split = False
root = None
for o, a in opts:
if o in ("-h", "--help"):
usage()
sys.exit()
elif o in ("-r", "--root"):
root = a
elif o in ("-w", "--skip-windows"):
skip_windows = True
conv = GtkBuilderConverter(skip_windows=skip_windows,
root=root)
conv.parse_file(input_filename)
xml = _indent(conv.to_xml())
if output_filename == "-":
print xml
else:
open(output_filename, 'w').write(xml)
print "Wrote", output_filename
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))
+1
View File
@@ -189,6 +189,7 @@
#include <gtk/gtksymboliccolor.h>
#include <gtk/gtktable.h>
#include <gtk/gtktearoffmenuitem.h>
#include <gtk/gtktextattributes.h>
#include <gtk/gtktextbuffer.h>
#include <gtk/gtktextbufferrichtext.h>
#include <gtk/gtktextchild.h>
+14 -14
View File
@@ -189,10 +189,14 @@ gtk_app_chooser_button_get_type G_GNUC_CONST;
gtk_app_chooser_button_new
gtk_app_chooser_button_set_active_custom_item
gtk_app_chooser_button_set_show_dialog_item
gtk_app_chooser_button_get_heading
gtk_app_chooser_button_set_heading
gtk_app_chooser_dialog_new
gtk_app_chooser_dialog_new_for_content_type
gtk_app_chooser_dialog_get_type G_GNUC_CONST
gtk_app_chooser_dialog_get_widget
gtk_app_chooser_dialog_get_heading
gtk_app_chooser_dialog_set_heading
gtk_app_chooser_widget_new
gtk_app_chooser_widget_get_show_all
gtk_app_chooser_widget_get_default_text
@@ -367,19 +371,6 @@ gtk_cell_area_add_with_properties
gtk_cell_area_apply_attributes
gtk_cell_area_attribute_connect
gtk_cell_area_attribute_disconnect
gtk_cell_area_box_context_copy
gtk_cell_area_box_context_get_group_height
gtk_cell_area_box_context_get_group_height_for_width
gtk_cell_area_box_context_get_group_width
gtk_cell_area_box_context_get_group_width_for_height
gtk_cell_area_box_context_get_heights
gtk_cell_area_box_context_get_orientation_allocs
gtk_cell_area_box_context_get_type
gtk_cell_area_box_context_get_widths
gtk_cell_area_box_context_push_group_height
gtk_cell_area_box_context_push_group_height_for_width
gtk_cell_area_box_context_push_group_width
gtk_cell_area_box_context_push_group_width_for_height
gtk_cell_area_box_get_spacing
gtk_cell_area_box_get_type G_GNUC_CONST
gtk_cell_area_box_init_groups
@@ -1348,7 +1339,7 @@ gtk_info_bar_set_message_type
gtk_info_bar_set_response_sensitive
gtk_init
gtk_init_check
#ifdef GDK_WINDOWING_WIN32
#ifdef G_OS_WIN32
gtk_init_abi_check
gtk_init_check_abi_check
#endif
@@ -2063,6 +2054,7 @@ gtk_range_get_lower_stepper_sensitivity
gtk_range_get_min_slider_size
gtk_range_get_range_rect
gtk_range_get_restrict_to_fill_level
gtk_range_get_round_digits
gtk_range_get_show_fill_level
gtk_range_get_slider_range
gtk_range_get_slider_size_fixed
@@ -2078,6 +2070,7 @@ gtk_range_set_lower_stepper_sensitivity
gtk_range_set_min_slider_size
gtk_range_set_range
gtk_range_set_restrict_to_fill_level
gtk_range_set_round_digits
gtk_range_set_show_fill_level
gtk_range_set_slider_size_fixed
gtk_range_set_upper_stepper_sensitivity
@@ -2461,6 +2454,7 @@ gtk_style_context_add_class
gtk_style_context_add_provider
gtk_style_context_add_provider_for_screen
gtk_style_context_add_region
gtk_style_context_cancel_animations
gtk_style_context_get
gtk_style_context_get_background_color
gtk_style_context_get_border
@@ -2498,6 +2492,7 @@ gtk_style_context_remove_region
gtk_style_context_reset_widgets
gtk_style_context_restore
gtk_style_context_save
gtk_style_context_scroll_animations
gtk_style_context_set_background
gtk_style_context_set_direction
gtk_style_context_set_junction_sides
@@ -2864,6 +2859,7 @@ gtk_text_view_get_accepts_tab
gtk_text_view_get_border_window_size
gtk_text_view_get_buffer
gtk_text_view_get_cursor_visible
gtk_text_view_get_cursor_locations
gtk_text_view_get_default_attributes
gtk_text_view_get_editable
gtk_text_view_get_hadjustment
@@ -3350,6 +3346,7 @@ gtk_tree_view_grid_lines_get_type G_GNUC_CONST
gtk_tree_view_insert_column
gtk_tree_view_insert_column_with_attributes G_GNUC_NULL_TERMINATED
gtk_tree_view_insert_column_with_data_func
gtk_tree_view_is_blank_at_pos
gtk_tree_view_is_rubber_banding_active
gtk_tree_view_map_expanded_rows
gtk_tree_view_move_column_after
@@ -3474,6 +3471,7 @@ gtk_widget_get_clipboard
gtk_widget_get_composite_name
gtk_widget_get_default_direction
gtk_widget_get_default_style
gtk_widget_get_device_enabled
gtk_widget_get_device_events
gtk_widget_get_direction
gtk_widget_get_display
@@ -3620,6 +3618,7 @@ gtk_widget_set_can_focus
gtk_widget_set_child_visible
gtk_widget_set_composite_name
gtk_widget_set_default_direction
gtk_widget_set_device_enabled
gtk_widget_set_device_events
gtk_widget_set_direction
gtk_widget_set_double_buffered
@@ -3767,6 +3766,7 @@ gtk_window_set_focus_on_map
gtk_window_set_geometry_hints
gtk_window_set_gravity
gtk_window_set_has_resize_grip
gtk_window_set_has_user_ref_count
gtk_window_set_icon
gtk_window_set_icon_from_file
gtk_window_set_icon_list
+12 -12
View File
@@ -1480,9 +1480,9 @@ gtk_about_dialog_set_website_label (GtkAboutDialog *about,
* Returns the string which are displayed in the authors tab
* of the secondary credits dialog.
*
* Return value: A %NULL-terminated string array containing
* the authors. The array is owned by the about dialog
* and must not be modified.
* Return value: (array zero-terminated=1) (transfer none): A
* %NULL-terminated string array containing the authors. The array is
* owned by the about dialog and must not be modified.
*
* Since: 2.6
*/
@@ -1535,9 +1535,9 @@ gtk_about_dialog_set_authors (GtkAboutDialog *about,
* Returns the string which are displayed in the documenters
* tab of the secondary credits dialog.
*
* Return value: A %NULL-terminated string array containing
* the documenters. The array is owned by the about dialog
* and must not be modified.
* Return value: (array zero-terminated=1) (transfer none): A
* %NULL-terminated string array containing the documenters. The
* array is owned by the about dialog and must not be modified.
*
* Since: 2.6
*/
@@ -1590,9 +1590,9 @@ gtk_about_dialog_set_documenters (GtkAboutDialog *about,
* Returns the string which are displayed in the artists tab
* of the secondary credits dialog.
*
* Return value: A %NULL-terminated string array containing
* the artists. The array is owned by the about dialog
* and must not be modified.
* Return value: (array zero-terminated=1) (transfer none): A
* %NULL-terminated string array containing the artists. The array is
* owned by the about dialog and must not be modified.
*
* Since: 2.6
*/
@@ -1706,9 +1706,9 @@ gtk_about_dialog_set_translator_credits (GtkAboutDialog *about,
*
* Returns the pixbuf displayed as logo in the about dialog.
*
* Return value: the pixbuf displayed as logo. The pixbuf is
* owned by the about dialog. If you want to keep a reference
* to it, you have to call g_object_ref() on it.
* Return value: (transfer none): the pixbuf displayed as logo. The
* pixbuf is owned by the about dialog. If you want to keep a
* reference to it, you have to call g_object_ref() on it.
*
* Since: 2.6
*/
+11 -6
View File
@@ -375,10 +375,11 @@ gtk_accel_groups_from_object (GObject *object)
/**
* gtk_accel_group_find:
* @accel_group: a #GtkAccelGroup
* @find_func: a function to filter the entries of @accel_group with
* @find_func: (scope call): a function to filter the entries
* of @accel_group with
* @data: data to pass to @find_func
* @returns: the key of the first entry passing @find_func. The key is
* owned by GTK+ and must not be freed.
* @returns: (transfer none): the key of the first entry passing
* @find_func. The key is owned by GTK+ and must not be freed.
*
* Finds the first entry in an accelerator group for which
* @find_func returns %TRUE and returns its #GtkAccelKey.
@@ -819,8 +820,11 @@ _gtk_accel_group_get_accelerables (GtkAccelGroup *accel_group)
* @accel_group: the accelerator group to query
* @accel_key: key value of the accelerator
* @accel_mods: modifier combination of the accelerator
* @n_entries: (allow-none): location to return the number of entries found, or %NULL
* @returns: (allow-none): an array of @n_entries #GtkAccelGroupEntry elements, or %NULL. The array is owned by GTK+ and must not be freed.
* @n_entries: (allow-none): location to return the number of entries found,
* or %NULL
* @returns: (transfer none) (array length=n_entries): an array of
* @n_entries #GtkAccelGroupEntry elements, or %NULL. The array is
* owned by GTK+ and must not be freed.
*
* Queries an accelerator group for all entries matching @accel_key and
* @accel_mods.
@@ -847,7 +851,8 @@ gtk_accel_group_query (GtkAccelGroup *accel_group,
/**
* gtk_accel_group_from_accel_closure:
* @closure: a #GClosure
* @returns: (allow-none): the #GtkAccelGroup to which @closure is connected, or %NULL.
* @returns: (transfer none): the #GtkAccelGroup to which @closure
* is connected, or %NULL.
*
* Finds the #GtkAccelGroup to which @closure is connected;
* see gtk_accel_group_connect().
+1 -1
View File
@@ -71,7 +71,7 @@ typedef gboolean (*GtkAccelGroupActivate) (GtkAccelGroup *accel_group,
* GtkAccelGroupFindFunc:
* @key:
* @closure:
* @data:
* @data: (closure):
*
* Since: 2.2
*/
+7 -6
View File
@@ -669,7 +669,7 @@ gtk_accel_map_load_fd (gint fd)
/**
* gtk_accel_map_load:
* @file_name: a file containing accelerator specifications,
* @file_name: (type filename): a file containing accelerator specifications,
* in the GLib file name encoding
*
* Parses a file previously saved with gtk_accel_map_save() for
@@ -780,8 +780,8 @@ gtk_accel_map_save_fd (gint fd)
/**
* gtk_accel_map_save:
* @file_name: the name of the file to contain accelerator specifications,
* in the GLib file name encoding
* @file_name: (type filename): the name of the file to contain
* accelerator specifications, in the GLib file name encoding
*
* Saves current accelerator specifications (accelerator path, key
* and modifiers) to @file_name.
@@ -807,8 +807,8 @@ gtk_accel_map_save (const gchar *file_name)
/**
* gtk_accel_map_foreach:
* @data: data to be passed into @foreach_func
* @foreach_func: function to be executed for each accel map entry which
* is not filtered out
* @foreach_func: (scope call): function to be executed for each accel
* map entry which is not filtered out
*
* Loops over the entries in the accelerator map whose accel path
* doesn't match any of the filters added with gtk_accel_map_add_filter(),
@@ -844,7 +844,8 @@ gtk_accel_map_foreach (gpointer data,
/**
* gtk_accel_map_foreach_unfiltered:
* @data: data to be passed into @foreach_func
* @foreach_func: function to be executed for each accel map entry
* @foreach_func: (scope call): function to be executed for each accel
* map entry
*
* Loops over all entries in the accelerator map, and execute
* @foreach_func on each. The signature of @foreach_func is that of
+12 -9
View File
@@ -506,10 +506,11 @@ gtk_action_buildable_get_name (GtkBuildable *buildable)
/**
* gtk_action_new:
* @name: A unique name for the action
* @label: (allow-none): the label displayed in menu items and on buttons, or %NULL
* @label: (allow-none): the label displayed in menu items and on buttons,
* or %NULL
* @tooltip: (allow-none): a tooltip for the action, or %NULL
* @stock_id: the stock icon to display in widgets representing the
* action, or %NULL
* @stock_id: (allow-none): the stock icon to display in widgets representing
* the action, or %NULL
*
* Creates a new #GtkAction object. To add the action to a
* #GtkActionGroup and set the accelerator for the action,
@@ -873,7 +874,7 @@ gtk_action_unblock_activate (GtkAction *action)
* This function is intended for use by action implementations to
* create icons displayed in the proxy widgets.
*
* Returns: (transfer full): a widget that displays the icon for this action.
* Returns: (transfer none): a widget that displays the icon for this action.
*
* Since: 2.4
*/
@@ -899,7 +900,7 @@ gtk_action_create_icon (GtkAction *action, GtkIconSize icon_size)
*
* Creates a menu item widget that proxies for the given action.
*
* Returns: (transfer full): a menu item connected to the action.
* Returns: (transfer none): a menu item connected to the action.
*
* Since: 2.4
*/
@@ -924,7 +925,7 @@ gtk_action_create_menu_item (GtkAction *action)
*
* Creates a toolbar item widget that proxies for the given action.
*
* Returns: (transfer full): a toolbar item connected to the action.
* Returns: (transfer none): a toolbar item connected to the action.
*
* Since: 2.4
*/
@@ -1705,8 +1706,9 @@ gtk_action_get_accel_path (GtkAction *action)
*
* Since: 2.8
*
* Returns: the accel closure for this action. The returned closure is
* owned by GTK+ and must not be unreffed or modified.
* Returns: (transfer none): the accel closure for this action. The
* returned closure is owned by GTK+ and must not be unreffed
* or modified.
*/
GClosure *
gtk_action_get_accel_closure (GtkAction *action)
@@ -1811,7 +1813,8 @@ gtk_action_disconnect_accelerator (GtkAction *action)
* item or the toolbar item it creates, this function returns an
* instance of that menu.
*
* Return value: (transfer full): the menu item provided by the action, or %NULL.
* Return value: (transfer none): the menu item provided by the
* action, or %NULL.
*
* Since: 2.12
*/
+12 -12
View File
@@ -1003,9 +1003,9 @@ gtk_action_group_list_actions (GtkActionGroup *action_group)
/**
* gtk_action_group_add_actions:
* gtk_action_group_add_actions: (skip)
* @action_group: the action group
* @entries: an array of action descriptions
* @entries: (array length=n_entries): an array of action descriptions
* @n_entries: the number of entries
* @user_data: data to pass to the action callbacks
*
@@ -1054,9 +1054,9 @@ shared_data_unref (gpointer data)
/**
* gtk_action_group_add_actions_full:
* gtk_action_group_add_actions_full: (skip)
* @action_group: the action group
* @entries: an array of action descriptions
* @entries: (array length=n_entries): an array of action descriptions
* @n_entries: the number of entries
* @user_data: data to pass to the action callbacks
* @destroy: destroy notification callback for @user_data
@@ -1134,9 +1134,9 @@ gtk_action_group_add_actions_full (GtkActionGroup *action_group,
}
/**
* gtk_action_group_add_toggle_actions:
* gtk_action_group_add_toggle_actions: (skip)
* @action_group: the action group
* @entries: an array of toggle action descriptions
* @entries: (array length=n_entries): an array of toggle action descriptions
* @n_entries: the number of entries
* @user_data: data to pass to the action callbacks
*
@@ -1162,9 +1162,9 @@ gtk_action_group_add_toggle_actions (GtkActionGroup *action_group,
/**
* gtk_action_group_add_toggle_actions_full:
* gtk_action_group_add_toggle_actions_full: (skip)
* @action_group: the action group
* @entries: an array of toggle action descriptions
* @entries: (array length=n_entries): an array of toggle action descriptions
* @n_entries: the number of entries
* @user_data: data to pass to the action callbacks
* @destroy: destroy notification callback for @user_data
@@ -1243,9 +1243,9 @@ gtk_action_group_add_toggle_actions_full (GtkActionGroup *action_gro
}
/**
* gtk_action_group_add_radio_actions:
* gtk_action_group_add_radio_actions: (skip)
* @action_group: the action group
* @entries: an array of radio action descriptions
* @entries: (array length=n_entries): an array of radio action descriptions
* @n_entries: the number of entries
* @value: the value of the action to activate initially, or -1 if
* no action should be activated
@@ -1276,9 +1276,9 @@ gtk_action_group_add_radio_actions (GtkActionGroup *action_group,
}
/**
* gtk_action_group_add_radio_actions_full:
* gtk_action_group_add_radio_actions_full: (skip)
* @action_group: the action group
* @entries: an array of radio action descriptions
* @entries: (array length=n_entries): an array of radio action descriptions
* @n_entries: the number of entries
* @value: the value of the action to activate initially, or -1 if
* no action should be activated
+8 -4
View File
@@ -753,10 +753,14 @@ gtk_alignment_set_padding (GtkAlignment *alignment,
/**
* gtk_alignment_get_padding:
* @alignment: a #GtkAlignment
* @padding_top: (allow-none): location to store the padding for the top of the widget, or %NULL
* @padding_bottom: (allow-none): location to store the padding for the bottom of the widget, or %NULL
* @padding_left: (allow-none): location to store the padding for the left of the widget, or %NULL
* @padding_right: (allow-none): location to store the padding for the right of the widget, or %NULL
* @padding_top: (out) (allow-none): location to store the padding for
* the top of the widget, or %NULL
* @padding_bottom: (out) (allow-none): location to store the padding
* for the bottom of the widget, or %NULL
* @padding_left: (out) (allow-none): location to store the padding
* for the left of the widget, or %NULL
* @padding_right: (out) (allow-none): location to store the padding
* for the right of the widget, or %NULL
*
* Gets the padding on the different sides of the widget.
* See gtk_alignment_set_padding ().

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