[gtk+/gtk-2-90: 162/200] Remove GTK_WIDGET_* macros



commit 9fa9d792a8c5170d5e84450127d7cf4d7fd82c26
Author: Javier Jardón <jjardon gnome org>
Date:   Thu Mar 25 00:23:36 2010 +0100

    Remove GTK_WIDGET_* macros

 docs/reference/gtk/glossary.xml     |    2 +-
 docs/reference/gtk/gtk-sections.txt |   22 ---
 docs/tutorial/gtk-tut.sgml          |    4 +-
 gtk/gtkprogress.c                   |    6 +-
 gtk/gtkprogressbar.c                |    2 +-
 gtk/gtkwidget.h                     |  278 -----------------------------------
 6 files changed, 7 insertions(+), 307 deletions(-)
---
diff --git a/docs/reference/gtk/glossary.xml b/docs/reference/gtk/glossary.xml
index 375b34e..9038c81 100644
--- a/docs/reference/gtk/glossary.xml
+++ b/docs/reference/gtk/glossary.xml
@@ -232,7 +232,7 @@
       <para>
 	Widgets that don't own the GdkWindow on which they draw are
 	called <glossterm linkend="no-window">no-window widgets</glossterm>.  
-        This can be tested with the GTK_WIDGET_NO_WINDOW() macro.  Normally, 
+        This can be tested with the gtk_widget_get_has_window() function.  Normally,
         these widgets draw on their parent's GdkWindow.
       </para>
 
diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt
index 468a568..7abe615 100644
--- a/docs/reference/gtk/gtk-sections.txt
+++ b/docs/reference/gtk/gtk-sections.txt
@@ -5318,29 +5318,7 @@ gtk_vseparator_get_type
 GtkWidget
 GtkWidgetClass
 GtkWidgetFlags
-GTK_WIDGET_TYPE
-GTK_WIDGET_STATE
-GTK_WIDGET_SAVED_STATE
 GTK_WIDGET_FLAGS
-GTK_WIDGET_TOPLEVEL
-GTK_WIDGET_NO_WINDOW
-GTK_WIDGET_REALIZED
-GTK_WIDGET_MAPPED
-GTK_WIDGET_VISIBLE
-GTK_WIDGET_DRAWABLE
-GTK_WIDGET_SENSITIVE
-GTK_WIDGET_PARENT_SENSITIVE
-GTK_WIDGET_IS_SENSITIVE
-GTK_WIDGET_CAN_FOCUS
-GTK_WIDGET_HAS_FOCUS
-GTK_WIDGET_CAN_DEFAULT
-GTK_WIDGET_RECEIVES_DEFAULT
-GTK_WIDGET_HAS_DEFAULT
-GTK_WIDGET_HAS_GRAB
-GTK_WIDGET_RC_STYLE
-GTK_WIDGET_COMPOSITE_CHILD
-GTK_WIDGET_APP_PAINTABLE
-GTK_WIDGET_DOUBLE_BUFFERED
 GTK_WIDGET_SET_FLAGS
 GTK_WIDGET_UNSET_FLAGS
 GtkCallback
diff --git a/docs/tutorial/gtk-tut.sgml b/docs/tutorial/gtk-tut.sgml
index ce927ec..1e7d3a7 100755
--- a/docs/tutorial/gtk-tut.sgml
+++ b/docs/tutorial/gtk-tut.sgml
@@ -5742,7 +5742,7 @@ static void calendar_select_font( GtkWidget    *button,
 			     calendar-&gt;font_dialog);
   }
   window = calendar-&gt;font_dialog;
-  if (!GTK_WIDGET_VISIBLE (window))
+  if (!gtk_widget_get_visible (window))
     gtk_widget_show (window);
   else
     gtk_widget_destroy (window);
@@ -9942,7 +9942,7 @@ protocols.</para>
 <para>An application capable of GTK+ drag-and-drop first defines and sets up
 the GTK+ widget(s) for drag-and-drop. Each widget can be a source
 and/or destination for drag-and-drop. Note that these GTK+ widgets must have
-an associated X Window, check using GTK_WIDGET_NO_WINDOW(widget)).</para>
+an associated X Window, check using gtk_widget_get_has_window (widget).</para>
 
 <para>Source widgets can send out drag data, thus allowing the user to drag
 things off of them, while destination widgets can receive drag data.
diff --git a/gtk/gtkprogress.c b/gtk/gtkprogress.c
index 8f46de4..fd5585f 100644
--- a/gtk/gtkprogress.c
+++ b/gtk/gtkprogress.c
@@ -274,7 +274,7 @@ static gboolean
 gtk_progress_expose (GtkWidget      *widget,
 		     GdkEventExpose *event)
 {
-  if (GTK_WIDGET_DRAWABLE (widget))
+  if (gtk_widget_is_drawable (widget))
     gdk_draw_drawable (widget->window,
 		       widget->style->black_gc,
 		       GTK_PROGRESS (widget)->offscreen_pixmap,
@@ -636,7 +636,7 @@ gtk_progress_set_text_alignment (GtkProgress *progress,
 	}
       g_object_thaw_notify (G_OBJECT (progress));
 
-      if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress)))
+      if (gtk_widget_is_drawable (GTK_WIDGET (progress)))
 	gtk_widget_queue_resize (GTK_WIDGET (progress));
     }
 }
@@ -703,7 +703,7 @@ gtk_progress_set_activity_mode (GtkProgress *progress,
       if (progress->activity_mode)
 	GTK_PROGRESS_GET_CLASS (progress)->act_mode_enter (progress);
 
-      if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress)))
+      if (gtk_widget_is_drawable (GTK_WIDGET (progress)))
 	gtk_widget_queue_resize (GTK_WIDGET (progress));
 
       g_object_notify (G_OBJECT (progress), "activity-mode");
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index d48f08f..853667d 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -1057,7 +1057,7 @@ gtk_progress_bar_pulse (GtkProgressBar *pbar)
   g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
 
   GTK_PROGRESS_GET_CLASS (pbar)->act_mode_enter (GTK_PROGRESS (pbar));
-  if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (pbar)))
+  if (gtk_widget_is_drawable (GTK_WIDGET (pbar)))
     gtk_widget_queue_resize (GTK_WIDGET (pbar));
 
   /* Sigh. */
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 5bd7fd9..38b2dca 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -138,49 +138,6 @@ typedef enum
 #define GTK_IS_WIDGET_CLASS(klass)	  (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
 #define GTK_WIDGET_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
 
-/* Macros for extracting various fields from GtkWidget and GtkWidgetClass.
- */
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_TYPE:
- * @wid: a #GtkWidget.
- *
- * Gets the type of a widget.
- *
- * Deprecated: 2.20: Use G_OBJECT_TYPE() instead.
- */
-#define GTK_WIDGET_TYPE(wid)		  (GTK_OBJECT_TYPE (wid))
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_STATE:
- * @wid: a #GtkWidget.
- *
- * Returns the current state of the widget, as a #GtkStateType.
- *
- * Deprecated: 2.20: Use gtk_widget_get_state() instead.
- */
-#define GTK_WIDGET_STATE(wid)		  (GTK_WIDGET (wid)->state)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_SAVED_STATE:
- * @wid: a #GtkWidget.
- *
- * Returns the saved state of the widget, as a #GtkStateType.
- *
- * The saved state will be restored when a widget gets sensitive
- * again, after it has been made insensitive with gtk_widget_set_state()
- * or gtk_widget_set_sensitive().
- *
- * Deprecated: 2.20: Do not used it.
- */
-#define GTK_WIDGET_SAVED_STATE(wid)	  (GTK_WIDGET (wid)->saved_state)
-#endif
-
-
 /* Macros for extracting the widget flags from GtkWidget.
  */
 /**
@@ -202,241 +159,6 @@ typedef enum
 #define GTK_WIDGET_FLAGS(wid)		  (GTK_OBJECT_FLAGS (wid))
 /* FIXME: Deprecating GTK_WIDGET_FLAGS requires fixing GTK internals. */
 
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_TOPLEVEL:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is a toplevel widget.
- *
- * Deprecated: 2.20: Use gtk_widget_is_toplevel() instead.
- */
-#define GTK_WIDGET_TOPLEVEL(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_NO_WINDOW:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget doesn't have an own #GdkWindow.
- *
- * Deprecated: 2.20: Use gtk_widget_get_has_window() instead.
- */
-#define GTK_WIDGET_NO_WINDOW(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_REALIZED:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is realized.
- *
- * Deprecated: 2.20: Use gtk_widget_get_realized() instead.
- */
-#define GTK_WIDGET_REALIZED(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_MAPPED:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is mapped.
- *
- * Deprecated: 2.20: Use gtk_widget_get_mapped() instead.
- */
-#define GTK_WIDGET_MAPPED(wid)		  ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_VISIBLE:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is visible.
- *
- * Deprecated: 2.20: Use gtk_widget_get_visible() instead.
- */
-#define GTK_WIDGET_VISIBLE(wid)		  ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_DRAWABLE:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is mapped and visible.
- *
- * Deprecated: 2.20: Use gtk_widget_is_drawable() instead.
- */
-#define GTK_WIDGET_DRAWABLE(wid)	  (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid))
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_SENSITIVE:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the #GTK_SENSITIVE flag has be set on the widget.
- *
- * Deprecated: 2.20: Use gtk_widget_get_sensitive() instead.
- */
-#define GTK_WIDGET_SENSITIVE(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_PARENT_SENSITIVE:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the #GTK_PARENT_SENSITIVE flag has be set on the widget.
- *
- * Deprecated: 2.20: Use gtk_widget_get_sensitive() on the parent widget instead.
- */
-#define GTK_WIDGET_PARENT_SENSITIVE(wid)  ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_IS_SENSITIVE:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is effectively sensitive.
- *
- * Deprecated: 2.20: Use gtk_widget_is_sensitive() instead.
- */
-#define GTK_WIDGET_IS_SENSITIVE(wid)	  (GTK_WIDGET_SENSITIVE (wid) && \
-					   GTK_WIDGET_PARENT_SENSITIVE (wid))
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_CAN_FOCUS:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is able to handle focus grabs.
- *
- * Deprecated: 2.20: Use gtk_widget_get_can_focus() instead.
- */
-#define GTK_WIDGET_CAN_FOCUS(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_HAS_FOCUS:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget has grabbed the focus and no other
- * widget has done so more recently.
- *
- * Deprecated: 2.20: Use gtk_widget_has_focus() instead.
- */
-#define GTK_WIDGET_HAS_FOCUS(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_CAN_DEFAULT:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is allowed to receive the default action
- * via gtk_widget_grab_default().
- *
- * Deprecated: 2.20: Use gtk_widget_get_can_default() instead.
- */
-#define GTK_WIDGET_CAN_DEFAULT(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_HAS_DEFAULT:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget currently is receiving the default action.
- *
- * Deprecated: 2.20: Use gtk_widget_has_default() instead.
- */
-#define GTK_WIDGET_HAS_DEFAULT(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_HAS_GRAB:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is in the grab_widgets stack, and will be
- * the preferred one for receiving events other than ones of cosmetic value.
- *
- * Deprecated: 2.20: Use gtk_widget_has_grab() instead.
- */
-#define GTK_WIDGET_HAS_GRAB(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_RC_STYLE:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget's style has been looked up through the rc
- * mechanism.
- *
- * Deprecated: 2.20: Use gtk_widget_has_rc_style() instead.
- */
-#define GTK_WIDGET_RC_STYLE(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_COMPOSITE_CHILD:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget is a composite child of its parent.
- *
- * Deprecated: 2.20: Use the #GtkWidget:composite-child property instead.
- */
-#define GTK_WIDGET_COMPOSITE_CHILD(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_APP_PAINTABLE:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the #GTK_APP_PAINTABLE flag has been set on the widget.
- *
- * Deprecated: 2.20: Use gtk_widget_get_app_paintable() instead.
- */
-#define GTK_WIDGET_APP_PAINTABLE(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_RECEIVES_DEFAULT:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the widget when focused will receive the default action
- * even if there is a different widget set as default.
- *
- * Deprecated: 2.20: Use gtk_widget_get_receives_default() instead.
- */
-#define GTK_WIDGET_RECEIVES_DEFAULT(wid)  ((GTK_WIDGET_FLAGS (wid) & GTK_RECEIVES_DEFAULT) != 0)
-#endif
-
-#ifndef GTK_DISABLE_DEPRECATED
-/**
- * GTK_WIDGET_DOUBLE_BUFFERED:
- * @wid: a #GtkWidget.
- *
- * Evaluates to %TRUE if the #GTK_DOUBLE_BUFFERED flag has been set on the widget.
- *
- * Deprecated: 2.20: Use gtk_widget_get_double_buffered() instead.
- */
-#define GTK_WIDGET_DOUBLE_BUFFERED(wid)	  ((GTK_WIDGET_FLAGS (wid) & GTK_DOUBLE_BUFFERED) != 0)
-#endif
-
-
 /* Macros for setting and clearing widget flags.
  */
 /**



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