[cairo-commit] gtkcairo/gtkcairo gtkcairo.c,1.2,1.3 gtkcairo.h,1.2,1.3
Evan Martin
commit at pdx.freedesktop.org
Mon Nov 24 20:34:22 PST 2003
Committed by: martine
Update of /cvs/cairo/gtkcairo/gtkcairo
In directory pdx:/tmp/cvs-serv11631/gtkcairo
Modified Files:
gtkcairo.c gtkcairo.h
Log Message:
gtkcairo.c, gtkcairo.h: Add a "redraw" signal.
Index: gtkcairo.c
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gtkcairo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** gtkcairo.c 19 Nov 2003 18:57:47 -0000 1.2
--- gtkcairo.c 25 Nov 2003 04:34:20 -0000 1.3
***************
*** 41,54 ****
#include "gtkcairo.h"
struct _GtkCairo
{
! GtkWidget widget;
! cairo_t *cairo;
};
struct _GtkCairoClass
{
! GtkWidgetClass parent_class;
};
--- 41,60 ----
#include "gtkcairo.h"
+ enum {
+ REDRAW,
+ LAST_SIGNAL
+ };
+
struct _GtkCairo
{
! GtkWidget widget;
! cairo_t *cairo;
};
struct _GtkCairoClass
{
! GtkWidgetClass parent_class;
! void (*redraw)(GtkCairo *, cairo_t *c);
};
***************
*** 63,66 ****
--- 69,73 ----
static GtkWidgetClass *parent_class = NULL;
+ static guint signals[LAST_SIGNAL] = { 0 };
GType
***************
*** 98,102 ****
widget_class = (GtkWidgetClass*) class;
! parent_class = gtk_type_class (gtk_widget_get_type ());
object_class->destroy = gtk_cairo_destroy;
--- 105,109 ----
widget_class = (GtkWidgetClass*) class;
! parent_class = gtk_type_class(GTK_TYPE_WIDGET);
object_class->destroy = gtk_cairo_destroy;
***************
*** 105,108 ****
--- 112,123 ----
widget_class->expose_event = gtk_cairo_expose;
widget_class->size_allocate = gtk_cairo_size_allocate;
+
+ signals[REDRAW] = g_signal_new("redraw",
+ GTK_TYPE_CAIRO,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(GtkCairoClass, redraw),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1, G_TYPE_POINTER);
}
***************
*** 118,122 ****
GtkWidget *gtkcairo;
! gtkcairo = GTK_WIDGET(g_object_new(gtk_cairo_get_type(), NULL));
gtk_widget_queue_draw(GTK_WIDGET(gtkcairo));
--- 133,137 ----
GtkWidget *gtkcairo;
! gtkcairo = GTK_WIDGET(g_object_new(GTK_TYPE_CAIRO, NULL));
gtk_widget_queue_draw(GTK_WIDGET(gtkcairo));
***************
*** 214,217 ****
--- 229,234 ----
/* XXX :X11-specific */
+ g_signal_emit_by_name(gtkcairo, "redraw", gtkcairo->cairo);
+
return FALSE;
}
Index: gtkcairo.h
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gtkcairo.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** gtkcairo.h 19 Nov 2003 18:57:47 -0000 1.2
--- gtkcairo.h 25 Nov 2003 04:34:20 -0000 1.3
***************
*** 40,46 ****
#endif /* __cplusplus */
! #define GTK_CAIRO(obj) GTK_CHECK_CAST (obj, gtk_cairo_get_type (), GtkCairo)
! #define GTK_CAIRO_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_cairo_get_type (), GtkCairoClass)
! #define GTK_IS_CAIRO(obj) GTK_CHECK_TYPE (obj, gtk_cairo_get_type ())
typedef struct _GtkCairo GtkCairo;
--- 40,47 ----
#endif /* __cplusplus */
! #define GTK_TYPE_CAIRO (gtk_cairo_get_type())
! #define GTK_CAIRO(obj) GTK_CHECK_CAST (obj, GTK_TYPE_CAIRO, GtkCairo)
! #define GTK_CAIRO_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, GTK_TYPE_CAIRO, GtkCairoClass)
! #define GTK_IS_CAIRO(obj) GTK_CHECK_TYPE (obj, GTK_TYPE_CAIRO)
typedef struct _GtkCairo GtkCairo;
More information about the cairo-commit
mailing list