diff console/libgnt/gntwidget.h @ 13878:0d0ab1e39d0a

[gaim-migrate @ 16355] Change the behaviour of the widgets about how they update themselves. This makes things a little better, and hopefully easier to build more stuff on top of this. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 27 Jun 2006 02:33:55 +0000
parents 0e1e59770cb0
children 9d66969a2e32
line wrap: on
line diff
--- a/console/libgnt/gntwidget.h	Mon Jun 26 19:54:53 2006 +0000
+++ b/console/libgnt/gntwidget.h	Tue Jun 27 02:33:55 2006 +0000
@@ -17,8 +17,7 @@
 #define GNT_WIDGET_SET_FLAGS(obj, flags)		(GNT_WIDGET_FLAGS(obj) |= flags)
 #define GNT_WIDGET_UNSET_FLAGS(obj, flags)	(GNT_WIDGET_FLAGS(obj) &= ~(flags))
 #define GNT_WIDGET_IS_FLAG_SET(obj, flags)	(GNT_WIDGET_FLAGS(obj) & (flags))
-#define	DEBUG
-//#define	DEBUG	printf("%s\n", __FUNCTION__)
+#define	DEBUG	fprintf(stderr, "%s\n", __FUNCTION__)
 
 typedef struct _GnWidget			GntWidget;
 typedef struct _GnWidgetPriv		GntWidgetPriv;
@@ -28,16 +27,18 @@
 
 typedef enum _GnWidgetFlags
 {
-	GNT_WIDGET_DESTROYING	= 1 << 0,
-	GNT_WIDGET_CAN_TAKE_FOCUS= 1 << 1,
-	GNT_WIDGET_MAPPED 		= 1 << 2,
+	GNT_WIDGET_DESTROYING     = 1 << 0,
+	GNT_WIDGET_CAN_TAKE_FOCUS = 1 << 1,
+	GNT_WIDGET_MAPPED         = 1 << 2,
 	/* XXX: Need to set the following two as properties, and setup a callback whenever these
 	 * get chnaged. */
-	GNT_WIDGET_NO_BORDER		= 1 << 3,
-	GNT_WIDGET_NO_SHADOW		= 1 << 4,
-	GNT_WIDGET_HAS_FOCUS		= 1 << 5
+	GNT_WIDGET_NO_BORDER      = 1 << 3,
+	GNT_WIDGET_NO_SHADOW      = 1 << 4,
+	GNT_WIDGET_HAS_FOCUS      = 1 << 5,
+	GNT_WIDGET_DRAWING        = 1 << 6
 } GntWidgetFlags;
 
+/* XXX: I'll have to ask grim what he's using this for in guifications. */
 typedef enum _GnParamFlags
 {
 	GNT_PARAM_SERIALIZABLE	= 1 << G_PARAM_USER_SHIFT
@@ -112,6 +113,10 @@
 
 void gnt_widget_set_name(GntWidget *widget, const char *name);
 
+/* Widget-subclasses should call this from the draw-callback.
+ * Applications should just call gnt_widget_draw instead of this. */
+void gnt_widget_queue_update(GntWidget *widget);
+
 G_END_DECLS
 
 #endif /* GNT_WIDGET_H */