Commit 1d82cc2f authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

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".
parent dedcbc99
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> Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org>
* gtk/gtkalignment.h: * gtk/gtkalignment.h:
......
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> Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org>
* gtk/gtkalignment.h: * gtk/gtkalignment.h:
......
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> Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org>
* gtk/gtkalignment.h: * gtk/gtkalignment.h:
......
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> Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org>
* gtk/gtkalignment.h: * gtk/gtkalignment.h:
......
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> Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org>
* gtk/gtkalignment.h: * gtk/gtkalignment.h:
......
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> Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org>
* gtk/gtkalignment.h: * gtk/gtkalignment.h:
......
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> Sun Jun 28 11:39:17 1998 Tim Janik <timj@gtk.org>
* gtk/gtkalignment.h: * gtk/gtkalignment.h:
......
...@@ -21,17 +21,29 @@ ...@@ -21,17 +21,29 @@
#define MIN_ARROW_SIZE 11 #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_class_init (GtkArrowClass *klass);
static void gtk_arrow_init (GtkArrow *arrow); static void gtk_arrow_init (GtkArrow *arrow);
static gint gtk_arrow_expose (GtkWidget *widget, static gint gtk_arrow_expose (GtkWidget *widget,
GdkEventExpose *event); 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) gtk_arrow_get_type (void)
{ {
static guint arrow_type = 0; static GtkType arrow_type = 0;
if (!arrow_type) if (!arrow_type)
{ {
...@@ -47,7 +59,7 @@ gtk_arrow_get_type (void) ...@@ -47,7 +59,7 @@ gtk_arrow_get_type (void)
(GtkClassInitFunc) NULL, (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; return arrow_type;
...@@ -56,13 +68,69 @@ gtk_arrow_get_type (void) ...@@ -56,13 +68,69 @@ gtk_arrow_get_type (void)
static void static void
gtk_arrow_class_init (GtkArrowClass *class) gtk_arrow_class_init (GtkArrowClass *class)
{ {
GtkObjectClass *object_class;
GtkWidgetClass *widget_class; GtkWidgetClass *widget_class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) 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; 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 static void
gtk_arrow_init (GtkArrow *arrow) gtk_arrow_init (GtkArrow *arrow)
{ {
......
...@@ -29,9 +29,11 @@ extern "C" { ...@@ -29,9 +29,11 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#define GTK_ARROW(obj) GTK_CHECK_CAST (obj, gtk_arrow_get_type (), GtkArrow) #define GTK_TYPE_ARROW (gtk_arrow_get_type ())
#define GTK_ARROW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_arrow_get_type (), GtkArrowClass) #define GTK_ARROW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_ARROW, GtkArrow))
#define GTK_IS_ARROW(obj) GTK_CHECK_TYPE (obj, gtk_arrow_get_type ()) #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; typedef struct _GtkArrow GtkArrow;
...@@ -51,7 +53,7 @@ struct _GtkArrowClass ...@@ -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, GtkWidget* gtk_arrow_new (GtkArrowType arrow_type,
GtkShadowType shadow_type); GtkShadowType shadow_type);
void gtk_arrow_set (GtkArrow *arrow, void gtk_arrow_set (GtkArrow *arrow,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment