diff options
author | Tim Janik <timj@gtk.org> | 1998-06-29 11:41:46 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-06-29 11:41:46 +0000 |
commit | 1d82cc2f2ed92395635e9cce3d628ddd0e8696d1 (patch) | |
tree | d888e25453e800e3e81d2142349051f3d9d0d1d4 | |
parent | dedcbc99188e155a7341b73e034ce404eb1192ac (diff) | |
download | gdk-pixbuf-1d82cc2f2ed92395635e9cce3d628ddd0e8696d1.tar.gz |
GtkType and macro fixups. widget argument implementation:
Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org>
* gtk/gtkarrow.h: GtkType and macro fixups.
* gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type",
"GtkArrow::shadow_type".
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 6 | ||||
-rw-r--r-- | gtk/gtkarrow.c | 74 | ||||
-rw-r--r-- | gtk/gtkarrow.h | 10 |
9 files changed, 119 insertions, 7 deletions
@@ -1,3 +1,9 @@ +Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org> + + * gtk/gtkarrow.h: GtkType and macro fixups. + * gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type", + "GtkArrow::shadow_type". + Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org> * gtk/gtkalignment.h: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index a6ceff301..00a9e911f 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org> + + * gtk/gtkarrow.h: GtkType and macro fixups. + * gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type", + "GtkArrow::shadow_type". + Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org> * gtk/gtkalignment.h: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a6ceff301..00a9e911f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org> + + * gtk/gtkarrow.h: GtkType and macro fixups. + * gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type", + "GtkArrow::shadow_type". + Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org> * gtk/gtkalignment.h: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index a6ceff301..00a9e911f 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org> + + * gtk/gtkarrow.h: GtkType and macro fixups. + * gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type", + "GtkArrow::shadow_type". + Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org> * gtk/gtkalignment.h: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index a6ceff301..00a9e911f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org> + + * gtk/gtkarrow.h: GtkType and macro fixups. + * gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type", + "GtkArrow::shadow_type". + Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org> * gtk/gtkalignment.h: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index a6ceff301..00a9e911f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org> + + * gtk/gtkarrow.h: GtkType and macro fixups. + * gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type", + "GtkArrow::shadow_type". + Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org> * gtk/gtkalignment.h: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index a6ceff301..00a9e911f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org> + + * gtk/gtkarrow.h: GtkType and macro fixups. + * gtk/gtkarrow.c: widget argument implementation: "GtkArrow::arrow_type", + "GtkArrow::shadow_type". + Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org> * gtk/gtkalignment.h: diff --git a/gtk/gtkarrow.c b/gtk/gtkarrow.c index 1e07ac270..54b543bc0 100644 --- a/gtk/gtkarrow.c +++ b/gtk/gtkarrow.c @@ -21,17 +21,29 @@ #define MIN_ARROW_SIZE 11 +enum { + ARG_0, + ARG_ARROW_TYPE, + ARG_SHADOW_TYPE +}; + static void gtk_arrow_class_init (GtkArrowClass *klass); static void gtk_arrow_init (GtkArrow *arrow); static gint gtk_arrow_expose (GtkWidget *widget, GdkEventExpose *event); +static void gtk_arrow_set_arg (GtkObject *object, + GtkArg *arg, + guint arg_id); +static void gtk_arrow_get_arg (GtkObject *object, + GtkArg *arg, + guint arg_id); -guint +GtkType gtk_arrow_get_type (void) { - static guint arrow_type = 0; + static GtkType arrow_type = 0; if (!arrow_type) { @@ -47,7 +59,7 @@ gtk_arrow_get_type (void) (GtkClassInitFunc) NULL, }; - arrow_type = gtk_type_unique (gtk_misc_get_type (), &arrow_info); + arrow_type = gtk_type_unique (GTK_TYPE_MISC, &arrow_info); } return arrow_type; @@ -56,14 +68,70 @@ gtk_arrow_get_type (void) static void gtk_arrow_class_init (GtkArrowClass *class) { + GtkObjectClass *object_class; GtkWidgetClass *widget_class; + object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; + gtk_object_add_arg_type ("GtkArrow::arrow_type", GTK_TYPE_ARROW_TYPE, GTK_ARG_READWRITE, ARG_ARROW_TYPE); + gtk_object_add_arg_type ("GtkArrow::shadow_type", GTK_TYPE_SHADOW_TYPE, GTK_ARG_READWRITE, ARG_SHADOW_TYPE); + + object_class->set_arg = gtk_arrow_set_arg; + object_class->get_arg = gtk_arrow_get_arg; + widget_class->expose_event = gtk_arrow_expose; } static void +gtk_arrow_set_arg (GtkObject *object, + GtkArg *arg, + guint arg_id) +{ + GtkArrow *arrow; + + arrow = GTK_ARROW (object); + + switch (arg_id) + { + case ARG_ARROW_TYPE: + gtk_arrow_set (arrow, + GTK_VALUE_ENUM (*arg), + arrow->shadow_type); + break; + case ARG_SHADOW_TYPE: + gtk_arrow_set (arrow, + arrow->arrow_type, + GTK_VALUE_ENUM (*arg)); + break; + default: + break; + } +} + +static void +gtk_arrow_get_arg (GtkObject *object, + GtkArg *arg, + guint arg_id) +{ + GtkArrow *arrow; + + arrow = GTK_ARROW (object); + switch (arg_id) + { + case ARG_ARROW_TYPE: + GTK_VALUE_ENUM (*arg) = arrow->arrow_type; + break; + case ARG_SHADOW_TYPE: + GTK_VALUE_ENUM (*arg) = arrow->shadow_type; + break; + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + +static void gtk_arrow_init (GtkArrow *arrow) { GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW); diff --git a/gtk/gtkarrow.h b/gtk/gtkarrow.h index e0ce41ad7..bc495cc97 100644 --- a/gtk/gtkarrow.h +++ b/gtk/gtkarrow.h @@ -29,9 +29,11 @@ extern "C" { #endif /* __cplusplus */ -#define GTK_ARROW(obj) GTK_CHECK_CAST (obj, gtk_arrow_get_type (), GtkArrow) -#define GTK_ARROW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_arrow_get_type (), GtkArrowClass) -#define GTK_IS_ARROW(obj) GTK_CHECK_TYPE (obj, gtk_arrow_get_type ()) +#define GTK_TYPE_ARROW (gtk_arrow_get_type ()) +#define GTK_ARROW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_ARROW, GtkArrow)) +#define GTK_ARROW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ARROW, GtkArrowClass)) +#define GTK_IS_ARROW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_ARROW)) +#define GTK_IS_ARROW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ARROW)) typedef struct _GtkArrow GtkArrow; @@ -51,7 +53,7 @@ struct _GtkArrowClass }; -guint gtk_arrow_get_type (void); +GtkType gtk_arrow_get_type (void); GtkWidget* gtk_arrow_new (GtkArrowType arrow_type, GtkShadowType shadow_type); void gtk_arrow_set (GtkArrow *arrow, |