[gtk+/native-layout] Improve GTK_WIDGET_FLAGS() deprecation documentation
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/native-layout] Improve GTK_WIDGET_FLAGS() deprecation documentation
- Date: Sun, 4 Apr 2010 02:40:39 +0000 (UTC)
commit 74c758804065ae6fbeddb96d029136788bc1d856
Author: Javier Jardón <jjardon gnome org>
Date: Fri Mar 5 19:22:12 2010 +0100
Improve GTK_WIDGET_FLAGS() deprecation documentation
Also, use GTK_OBJECT_FLAGS() instead.
Note that some internal code still uses GTK_WIDGET_FLAGS().
https://bugzilla.gnome.org/show_bug.cgi?id=69872
gtk/gtkwidget.c | 28 ++++++++++++++--------------
gtk/gtkwidget.h | 10 +++++++++-
2 files changed, 23 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 80f20f1..e4de589 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2781,7 +2781,7 @@ gtk_widget_get_property (GObject *object,
g_value_set_boolean (value, (gtk_widget_get_receives_default (widget) != FALSE));
break;
case PROP_COMPOSITE_CHILD:
- g_value_set_boolean (value, (GTK_WIDGET_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0 );
+ g_value_set_boolean (value, (GTK_OBJECT_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0 );
break;
case PROP_STYLE:
g_value_set_object (value, gtk_widget_get_style (widget));
@@ -5499,7 +5499,7 @@ gtk_widget_get_can_focus (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_CAN_FOCUS) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_CAN_FOCUS) != 0;
}
/**
@@ -5593,7 +5593,7 @@ gtk_widget_get_can_default (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_CAN_DEFAULT) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_CAN_DEFAULT) != 0;
}
/**
@@ -5613,7 +5613,7 @@ gtk_widget_has_default (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_HAS_DEFAULT) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_HAS_DEFAULT) != 0;
}
/**
@@ -5694,7 +5694,7 @@ gtk_widget_get_receives_default (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_RECEIVES_DEFAULT) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_RECEIVES_DEFAULT) != 0;
}
/**
@@ -5715,7 +5715,7 @@ gtk_widget_has_grab (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_HAS_GRAB) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_HAS_GRAB) != 0;
}
/**
@@ -5944,7 +5944,7 @@ gtk_widget_is_toplevel (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_TOPLEVEL) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_TOPLEVEL) != 0;
}
/**
@@ -5963,8 +5963,8 @@ gtk_widget_is_drawable (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return ((GTK_WIDGET_FLAGS (widget) & GTK_VISIBLE) != 0 &&
- (GTK_WIDGET_FLAGS (widget) & GTK_MAPPED) != 0);
+ return (gtk_widget_get_visible (widget) &&
+ gtk_widget_get_mapped (widget));
}
/**
@@ -6115,7 +6115,7 @@ gtk_widget_get_app_paintable (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_APP_PAINTABLE) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_APP_PAINTABLE) != 0;
}
/**
@@ -6178,7 +6178,7 @@ gtk_widget_get_double_buffered (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_DOUBLE_BUFFERED) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_DOUBLE_BUFFERED) != 0;
}
/**
@@ -6440,7 +6440,7 @@ gtk_widget_has_rc_style (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- return (GTK_WIDGET_FLAGS (widget) & GTK_RC_STYLE) != 0;
+ return (GTK_OBJECT_FLAGS (widget) & GTK_RC_STYLE) != 0;
}
/**
@@ -8401,7 +8401,7 @@ gtk_widget_set_composite_name (GtkWidget *widget,
const gchar *name)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail ((GTK_WIDGET_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0);
+ g_return_if_fail ((GTK_OBJECT_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0);
g_return_if_fail (name != NULL);
if (!quark_composite_name)
@@ -8428,7 +8428,7 @@ gtk_widget_get_composite_name (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- if (((GTK_WIDGET_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0) && widget->parent)
+ if (((GTK_OBJECT_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0) && widget->parent)
return _gtk_container_child_composite_name (GTK_CONTAINER (widget->parent),
widget);
else
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 8de14d3..ce6e13e 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -189,7 +189,15 @@ typedef enum
*
* Returns the widget flags from @wid.
*
- * Deprecated: 2.20: Do not use it.
+ * Deprecated: 2.20: Use the proper function to test individual states:
+ * gtk_widget_get_app_paintable(), gtk_widget_get_can_default(),
+ * gtk_widget_get_can_focus(), gtk_widget_get_double_buffered(),
+ * gtk_widget_has_default(), gtk_widget_is_drawable(),
+ * gtk_widget_has_focus(), gtk_widget_has_grab(), gtk_widget_get_mapped(),
+ * gtk_widget_get_has_window(), gtk_widget_has_rc_style(),
+ * gtk_widget_get_realized(), gtk_widget_get_receives_default(),
+ * gtk_widget_get_sensitive(), gtk_widget_is_sensitive(),
+ * gtk_widget_is_toplevel() or gtk_widget_get_visible().
*/
#define GTK_WIDGET_FLAGS(wid) (GTK_OBJECT_FLAGS (wid))
/* FIXME: Deprecating GTK_WIDGET_FLAGS requires fixing GTK internals. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]