]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkfixed.c
Deprecate widget flag: GTK_WIDGET_VISIBLE
[~andy/gtk] / gtk / gtkfixed.c
index d2465e9adc668c190080e67afdd032d1e533c050..05a5a1e0f0c43e378b41adfa98068a98add02418 100644 (file)
@@ -24,7 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include <config.h>
+#include "config.h"
 #include "gtkfixed.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
@@ -61,7 +61,7 @@ static void gtk_fixed_get_child_property (GtkContainer *container,
                                           GValue       *value,
                                           GParamSpec   *pspec);
 
-G_DEFINE_TYPE (GtkFixed, gtk_fixed, GTK_TYPE_CONTAINER);
+G_DEFINE_TYPE (GtkFixed, gtk_fixed, GTK_TYPE_CONTAINER)
 
 static void
 gtk_fixed_class_init (GtkFixedClass *class)
@@ -114,8 +114,8 @@ gtk_fixed_child_type (GtkContainer     *container)
 static void
 gtk_fixed_init (GtkFixed *fixed)
 {
-  GTK_WIDGET_SET_FLAGS (fixed, GTK_NO_WINDOW);
+  gtk_widget_set_has_window (GTK_WIDGET (fixed), FALSE);
+
   fixed->children = NULL;
 }
 
@@ -201,7 +201,8 @@ gtk_fixed_move_internal (GtkFixed       *fixed,
 
   gtk_widget_thaw_child_notify (widget);
   
-  if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (fixed))
+  if (gtk_widget_get_visible (widget) &&
+      gtk_widget_get_visible (GTK_WIDGET (fixed)))
     gtk_widget_queue_resize (GTK_WIDGET (fixed));
 }
 
@@ -272,7 +273,7 @@ gtk_fixed_realize (GtkWidget *widget)
   GdkWindowAttr attributes;
   gint attributes_mask;
 
-  if (GTK_WIDGET_NO_WINDOW (widget))
+  if (!gtk_widget_get_has_window (widget))
     GTK_WIDGET_CLASS (gtk_fixed_parent_class)->realize (widget);
   else
     {
@@ -319,7 +320,7 @@ gtk_fixed_size_request (GtkWidget      *widget,
       child = children->data;
       children = children->next;
 
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
        {
           gtk_widget_size_request (child->widget, &child_requisition);
 
@@ -351,7 +352,7 @@ gtk_fixed_size_allocate (GtkWidget     *widget,
 
   widget->allocation = *allocation;
 
-  if (!GTK_WIDGET_NO_WINDOW (widget))
+  if (gtk_widget_get_has_window (widget))
     {
       if (GTK_WIDGET_REALIZED (widget))
        gdk_window_move_resize (widget->window,
@@ -369,13 +370,13 @@ gtk_fixed_size_allocate (GtkWidget     *widget,
       child = children->data;
       children = children->next;
       
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
        {
          gtk_widget_get_child_requisition (child->widget, &child_requisition);
          child_allocation.x = child->x + border_width;
          child_allocation.y = child->y + border_width;
 
-         if (GTK_WIDGET_NO_WINDOW (widget))
+         if (!gtk_widget_get_has_window (widget))
            {
              child_allocation.x += widget->allocation.x;
              child_allocation.y += widget->allocation.y;
@@ -401,9 +402,11 @@ gtk_fixed_remove (GtkContainer *container,
 {
   GtkFixed *fixed;
   GtkFixedChild *child;
+  GtkWidget *widget_container;
   GList *children;
 
   fixed = GTK_FIXED (container);
+  widget_container = GTK_WIDGET (container);
 
   children = fixed->children;
   while (children)
@@ -412,7 +415,7 @@ gtk_fixed_remove (GtkContainer *container,
 
       if (child->widget == widget)
        {
-         gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+         gboolean was_visible = gtk_widget_get_visible (widget);
          
          gtk_widget_unparent (widget);
 
@@ -420,8 +423,8 @@ gtk_fixed_remove (GtkContainer *container,
          g_list_free (children);
          g_free (child);
 
-         if (was_visible && GTK_WIDGET_VISIBLE (container))
-           gtk_widget_queue_resize (GTK_WIDGET (container));
+         if (was_visible && gtk_widget_get_visible (widget_container))
+           gtk_widget_queue_resize (widget_container);
 
          break;
        }
@@ -436,14 +439,10 @@ gtk_fixed_forall (GtkContainer *container,
                  GtkCallback   callback,
                  gpointer      callback_data)
 {
-  GtkFixed *fixed;
+  GtkFixed *fixed = GTK_FIXED (container);
   GtkFixedChild *child;
   GList *children;
 
-  g_return_if_fail (callback != NULL);
-
-  fixed = GTK_FIXED (container);
-
   children = fixed->children;
   while (children)
     {
@@ -467,6 +466,8 @@ gtk_fixed_forall (GtkContainer *container,
  * 
  * This function was added to provide an easy migration path for
  * older applications which may expect #GtkFixed to have a separate window.
+ *
+ * Deprecated: 2.20: Use gtk_widget_set_has_window() instead.
  **/
 void
 gtk_fixed_set_has_window (GtkFixed *fixed,
@@ -475,12 +476,9 @@ gtk_fixed_set_has_window (GtkFixed *fixed,
   g_return_if_fail (GTK_IS_FIXED (fixed));
   g_return_if_fail (!GTK_WIDGET_REALIZED (fixed));
 
-  if (!has_window != GTK_WIDGET_NO_WINDOW (fixed))
+  if (has_window != gtk_widget_get_has_window (GTK_WIDGET (fixed)))
     {
-      if (has_window)
-       GTK_WIDGET_UNSET_FLAGS (fixed, GTK_NO_WINDOW);
-      else
-       GTK_WIDGET_SET_FLAGS (fixed, GTK_NO_WINDOW);
+      gtk_widget_set_has_window (GTK_WIDGET (fixed), has_window);
     }
 }
 
@@ -489,16 +487,18 @@ gtk_fixed_set_has_window (GtkFixed *fixed,
  * @fixed: a #GtkWidget
  * 
  * Gets whether the #GtkFixed has its own #GdkWindow.
- * See gdk_fixed_set_has_window().
+ * See gtk_fixed_set_has_window().
  * 
  * Return value: %TRUE if @fixed has its own window.
+ *
+ * Deprecated: 2.20: Use gtk_widget_get_has_window() instead.
  **/
 gboolean
 gtk_fixed_get_has_window (GtkFixed *fixed)
 {
   g_return_val_if_fail (GTK_IS_FIXED (fixed), FALSE);
 
-  return !GTK_WIDGET_NO_WINDOW (fixed);
+  return gtk_widget_get_has_window (GTK_WIDGET (fixed));
 }
 
 #define __GTK_FIXED_C__