summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtk.symbols3
-rw-r--r--gtk/gtkwidget.c58
-rw-r--r--gtk/gtkwidget.h20
3 files changed, 71 insertions, 10 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 2ac45f4363..f0e604149b 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -4778,6 +4778,9 @@ gtk_widget_trigger_tooltip_query
gtk_widget_unmap
gtk_widget_unparent
gtk_widget_unrealize
+gtk_widget_unref
+gtk_widget_get_allocation
+gtk_widget_get_window
#endif
#endif
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 79cda47a96..30560ba8f1 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -153,7 +153,8 @@ enum {
PROP_NO_SHOW_ALL,
PROP_HAS_TOOLTIP,
PROP_TOOLTIP_MARKUP,
- PROP_TOOLTIP_TEXT
+ PROP_TOOLTIP_TEXT,
+ PROP_WINDOW
};
typedef struct _GtkStateData GtkStateData;
@@ -673,6 +674,22 @@ gtk_widget_class_init (GtkWidgetClass *klass)
NULL,
GTK_PARAM_READWRITE));
+ /**
+ * GtkWidget:window:
+ *
+ * The widget's window or its parent window if it does not have a
+ * window (as indicated by the GTK_NO_WINDOW flag).
+ *
+ * Since: GSEAL-branch
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_WINDOW,
+ g_param_spec_object ("window",
+ P_("Window"),
+ P_("The widget's window or its parent window"),
+ GDK_TYPE_WINDOW,
+ GTK_PARAM_READABLE));
+
widget_signals[SHOW] =
g_signal_new (I_("show"),
G_TYPE_FROM_CLASS (gobject_class),
@@ -2585,6 +2602,9 @@ gtk_widget_get_property (GObject *object,
case PROP_TOOLTIP_MARKUP:
g_value_set_string (value, g_object_get_qdata (object, quark_tooltip_markup));
break;
+ case PROP_WINDOW:
+ g_value_set_object (value, gtk_widget_get_window (widget));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -9867,5 +9887,41 @@ gtk_widget_get_has_tooltip (GtkWidget *widget)
return has_tooltip;
}
+/**
+ * gtk_widget_get_allocation:
+ * @widget: a #GtkWidget
+ *
+ * Returns the widget's allocation as provided by its parent.
+ *
+ * Return value: current allocation of @widget.
+ *
+ * Since: GSEAL-branch
+ */
+GtkAllocation
+gtk_widget_get_allocation (GtkWidget *widget)
+{
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ return widget->allocation;
+}
+
+/**
+ * gtk_widget_get_window:
+ * @widget: a #GtkWidget
+ *
+ * Returns the widget's window or the parent window.
+ *
+ * Return value: @widget's window.
+ *
+ * Since: GSEAL-branch
+ */
+GdkWindow*
+gtk_widget_get_window (GtkWidget *widget)
+{
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ return widget->window;
+}
+
#define __GTK_WIDGET_C__
#include "gtkaliasdef.c"
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index f81b5dbf47..596b8eeac4 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -178,12 +178,12 @@ struct _GtkWidget
* state and saved_state go. we therefore don't waste any new
* space on this.
*/
- guint16 private_flags;
+ guint16 GSEAL (private_flags);
/* The state of the widget. There are actually only
* 5 widget states (defined in "gtkenums.h").
*/
- guint8 state;
+ guint8 GSEAL (state);
/* The saved state of the widget. When a widget's state
* is changed to GTK_STATE_INSENSITIVE via
@@ -191,7 +191,7 @@ struct _GtkWidget
* the old state is kept around in this field. The state
* will be restored once the widget gets sensitive again.
*/
- guint8 saved_state;
+ guint8 GSEAL (saved_state);
/* The widget's name. If the widget does not have a name
* (the name is NULL), then its name (as returned by
@@ -199,7 +199,7 @@ struct _GtkWidget
* Among other things, the widget name is used to determine
* the style to use for a widget.
*/
- gchar *name;
+ gchar *GSEAL (name);
/*< public >*/
@@ -208,25 +208,25 @@ struct _GtkWidget
* along with graphics contexts used to draw with and
* the font to use for text.
*/
- GtkStyle *style;
+ GtkStyle *GSEAL (style);
/* The widget's desired size.
*/
- GtkRequisition requisition;
+ GtkRequisition GSEAL (requisition);
/* The widget's allocated size.
*/
- GtkAllocation allocation;
+ GtkAllocation GSEAL (allocation);
/* The widget's window or its parent window if it does
* not have a window. (Which will be indicated by the
* GTK_NO_WINDOW flag being set).
*/
- GdkWindow *window;
+ GdkWindow *GSEAL (window);
/* The widget's parent.
*/
- GtkWidget *parent;
+ GtkWidget *GSEAL (parent);
};
struct _GtkWidgetClass
@@ -572,6 +572,8 @@ void gtk_widget_set_parent_window (GtkWidget *widget,
void gtk_widget_set_child_visible (GtkWidget *widget,
gboolean is_visible);
gboolean gtk_widget_get_child_visible (GtkWidget *widget);
+GtkAllocation gtk_widget_get_allocation (GtkWidget *widget);
+GdkWindow* gtk_widget_get_window (GtkWidget *widget);
GtkWidget *gtk_widget_get_parent (GtkWidget *widget);
GdkWindow *gtk_widget_get_parent_window (GtkWidget *widget);