It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.
Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.
So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.
The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
Turn find_widget_under_pointer() into internal API
_gtk_widget_find_at_coords() which is needed for fixing above
bug. This should actually be a public utility function, and will be
moved to another file when its final API has been decided.
(cherry picked from commit c4b1bbf3e2)
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API
https://bugzilla.gnome.org/show_bug.cgi?id=610474
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.
Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.
Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.
Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.
Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.
Gail and tests are updated as well.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
GtkIconSize is an extensible enumeration (via
gtk_icon_size_register()), so methods that claim to take/return a
GtkIconSize need to actually use "int" to work correctly with bindings
that are strict about enum values.
https://bugzilla.gnome.org/show_bug.cgi?id=604895
_gtk_tooltip_handle_event, which is called for many events in the GTK+
main loop, calls gtk_tooltip_set_last_window, which keeps a weak
reference to the last window we passed through. If the window being
set is the same than the last one there's really no need to update our
weak reference, so add a check for that and exit early.
Make the tooltip code a bit more robust for a case that only occurs when
GTK+ is used from a language binding. It looks like this case appears
because the memory management / ref counting is handled differently in
some of the language bindings. Instead of asserting, we will fail
silently. Also fix a think-o in gtk_tooltip_start_delay(). Patch from
O. Andrieu.
* gtk/gtktooltip.c (gtk_tooltip_trigger_query): Set the root
coordinates in the event correctly. Patch by Kristian Rietveld.
svn path=/trunk/; revision=22277
2008-05-28 Kristian Rietveld <kris@imendio.com>
Bug 504087 - make gtk_tooltip_set_custom a no-op for setting the
current widget again.
* gtk/gtktooltip.c (gtk_tooltip_set_custom),
(gtk_tooltip_reset), (gtk_tooltip_run_requery): use a
custom_was_reset field to check if the custom widget is set again in
the query-tooltip callback; if not, we set it to NULL. Based on a
patch by Xavier Claessens, insightful comments from Jean-Yves Lefort
and Christian Persch.
svn path=/trunk/; revision=20215
2008-02-15 Matthias Clasen <mclasen@redhat.com>
* configure.in: Go back to 2.13.0 as version for now,
as there was no consensus to do the jump.
* many other places: Update Since: tags.
svn path=/trunk/; revision=19586
2007-12-17 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltip.c (gtk_tooltip_finalize),
(gtk_tooltip_set_last_window): use a weak pointer to set last_window
to NULL as soon as it's destroyed. (#496546, patch from
Benjamin Berg).
svn path=/trunk/; revision=19189
2007-10-08 Kristian Rietveld <kris@imendio.com>
Fix#482841, patch by Karl Tomlinson.
* gtk/gtktooltip.c (gtk_tooltip_display_closed): use g_object_set_data
instead of g_object_set ...
(_gtk_tooltip_toggle_keyboard_mode),
(_gtk_tooltip_handle_event): connect to GdkDisplay::closed after
creating tooltip.
svn path=/trunk/; revision=18890
2007-08-21 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltip.c (_gtk_tooltip_handle_event): always set
hide_tooltip to TRUE if we are handling a leave notify event. (Fixes
#468245, reported by Dennis Jacobfeuerborn).
svn path=/trunk/; revision=18666
2007-08-21 Kristian Rietveld <kris@imendio.com>
Fix#457642, reported by Christian Persch.
* gtk/gtktooltip.c: added debugging output which can be compiled
in with a #define, annotated all coordinate translations in the
source code,
(find_widget_under_pointer): remove the "no-window correction";
always convert the coordinates from window relative to allocation
relative; after recursing through a container, translate the
coordinates from container allocation relative to child widget
allocation relative;
(find_topmost_widget_from_event): now we get allocation relative
coordinates here we do not have to distinguish no-window and window
widgets.
svn path=/trunk/; revision=18663
2007-07-31 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktooltip.c (gtk_tooltip_init): Make the label
wrap, for compatibility with the old tooltips code. This
fixes absurdly long tooltips in the color selector.
svn path=/trunk/; revision=18558