[gtk+/native-layout] Add some more goddamn accessors



commit 5438a7b608f79147859970988a9702744fe5662b
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Feb 9 13:40:58 2010 -0500

    Add some more goddamn accessors

 docs/reference/gtk/gtk-sections.txt |    4 ++
 gtk/gtk.symbols                     |    4 ++
 gtk/gtkwidget.c                     |   94 +++++++++++++++++++++++++++++++++++
 gtk/gtkwidget.h                     |   12 +++++
 4 files changed, 114 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt
index 7a19709..d79c5a8 100644
--- a/docs/reference/gtk/gtk-sections.txt
+++ b/docs/reference/gtk/gtk-sections.txt
@@ -5749,6 +5749,10 @@ gtk_widget_is_toplevel
 gtk_widget_set_window
 gtk_widget_set_receives_default
 gtk_widget_get_receives_default
+gtk_widget_set_realized
+gtk_widget_get_realized
+gtk_widget_set_mapped
+gtk_widget_set_mapped
 
 <SUBSECTION>
 gtk_requisition_copy
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index e09d34a..91acae8 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -5259,6 +5259,10 @@ gtk_widget_set_can_default
 gtk_widget_get_can_default
 gtk_widget_set_can_focus
 gtk_widget_get_can_focus
+gtk_widget_set_realized
+gtk_widget_get_realized
+gtk_widget_set_mapped
+gtk_widget_get_mapped
 #endif
 #endif
 
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8e9ad87..31591c0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5966,6 +5966,100 @@ gtk_widget_is_drawable (GtkWidget *widget)
 }
 
 /**
+ * gtk_widget_get_realized:
+ * @widget: a #GtkWidget
+ *
+ * Determines whether @widget is realized.
+ *
+ * Return value: %TRUE if @widget is realized, %FALSE otherwise
+ *
+ * Since: 2.20
+ **/
+gboolean
+gtk_widget_get_realized (GtkWidget *widget)
+{
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+
+  return (GTK_WIDGET_FLAGS (widget) & GTK_REALIZED) != 0;
+}
+
+/**
+ * gtk_widget_set_realized:
+ * @widget: a #GtkWidget
+ * @realized: %TRUE to mark the widget as realized
+ *
+ * Marks the widget as being realized.
+ *
+ * This function should only ever be called in a derived widget's
+ * "realize" or "unrealize" implementation.
+ *
+ * Since: 2.20
+ */
+void
+gtk_widget_set_realized (GtkWidget *widget,
+                         gboolean   realized)
+{
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  realized = realized != FALSE;
+
+  if (realized != gtk_widget_get_realized (widget))
+    {
+      if (realized)
+        GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+      else
+        GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED);
+    }
+}
+
+/**
+ * gtk_widget_get_mapped:
+ * @widget: a #GtkWidget
+ *
+ * Whether the widget is mapped.
+ *
+ * Return value: %TRUE if the widget is mapped, %FALSE otherwise.
+ *
+ * Since: 2.20
+ */
+gboolean
+gtk_widget_get_mapped (GtkWidget *widget)
+{
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+  return (GTK_WIDGET_FLAGS (widget) & GTK_MAPPED) != 0;
+}
+
+/**
+ * gtk_widget_set_mapped:
+ * @widget: a #GtkWidget
+ * @mapped: %TRUE to mark the widget as mapped
+ *
+ * Marks the widget as being realized.
+ *
+ * This function should only ever be called in a derived widget's
+ * "map" or "unmap" implementation.
+ *
+ * Since: 2.20
+ */
+void
+gtk_widget_set_mapped (GtkWidget *widget,
+                       gboolean   mapped)
+{
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  mapped = mapped != FALSE;
+
+  if (mapped != gtk_widget_get_mapped (widget))
+    {
+      if (mapped)
+        GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+      else
+        GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
+    }
+}
+
+/**
  * gtk_widget_set_app_paintable:
  * @widget: a #GtkWidget
  * @app_paintable: %TRUE if the application will paint on the widget
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index ddb8550..46d5f5f 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -880,6 +880,12 @@ void	gtk_widget_child_notify		  (GtkWidget	       *widget,
 					   const gchar	       *child_property);
 void	gtk_widget_thaw_child_notify	  (GtkWidget	       *widget);
 
+void       gtk_widget_set_realized        (GtkWidget           *widget,
+                                           gboolean             realized);
+gboolean   gtk_widget_get_realized        (GtkWidget           *widget);
+void       gtk_widget_set_mapped          (GtkWidget           *widget,
+                                           gboolean             mapped);
+gboolean   gtk_widget_get_mapped          (GtkWidget           *widget);
 void       gtk_widget_set_can_focus       (GtkWidget           *widget,
                                            gboolean             can_focus);
 gboolean   gtk_widget_get_can_focus       (GtkWidget           *widget);
@@ -922,6 +928,12 @@ gboolean              gtk_widget_get_has_window         (GtkWidget    *widget);
 
 gboolean              gtk_widget_is_toplevel            (GtkWidget    *widget);
 gboolean              gtk_widget_is_drawable            (GtkWidget    *widget);
+void                  gtk_widget_set_realized           (GtkWidget    *widget,
+                                                         gboolean      realized);
+gboolean              gtk_widget_get_realized           (GtkWidget    *widget);
+void                  gtk_widget_set_mapped             (GtkWidget    *widget,
+                                                         gboolean      mapped);
+gboolean              gtk_widget_get_mapped             (GtkWidget    *widget);
 
 void                  gtk_widget_set_app_paintable      (GtkWidget    *widget,
 							 gboolean      app_paintable);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]