diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-06-01 15:44:13 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-06-01 15:44:13 +0000 |
commit | 1a6efe96a73531e25ea1e3b4d2d132223b57b6ff (patch) | |
tree | 9351043b14911d61bdaa24894ecf0a7b19146d1e /gdk | |
parent | f7ce63ab5fe1b2dadac9493272c38f30244e0c22 (diff) | |
download | gtk+-1a6efe96a73531e25ea1e3b4d2d132223b57b6ff.tar.gz |
Add GDK_TYPE_RECTANGLE.
Fri Jun 1 11:31:55 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrectangle.c (gdk_rectangle_get_type): Add
GDK_TYPE_RECTANGLE.
* gtk/gtkwidget.c (gtk_widget_class_init): Fix type
of allocation argument be GDK_TYPE_RECTANGLE.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdk.h | 2 | ||||
-rw-r--r-- | gdk/gdkrectangle.c | 24 |
2 files changed, 26 insertions, 0 deletions
@@ -126,6 +126,8 @@ void gdk_rectangle_union (GdkRectangle *src1, GdkRectangle *src2, GdkRectangle *dest); +#define GDK_TYPE_RECTANGLE (gdk_rectangle_get_type ()) + /* Conversion functions between wide char and multibyte strings. */ gchar *gdk_wcstombs (const GdkWChar *src); diff --git a/gdk/gdkrectangle.c b/gdk/gdkrectangle.c index 499112d2dc..27e181c535 100644 --- a/gdk/gdkrectangle.c +++ b/gdk/gdkrectangle.c @@ -81,3 +81,27 @@ gdk_rectangle_intersect (GdkRectangle *src1, return return_val; } + +static GdkRectangle * +gdk_rectangle_copy (const GdkRectangle *rectangle) +{ + GdkRectangle *result = g_new (GdkRectangle, 1); + *result = *rectangle; + + return result; +} + +GType +gdk_rectangle_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GdkRectangle", + NULL, + (GBoxedCopyFunc)gdk_rectangle_copy, + (GBoxedFreeFunc)g_free, + FALSE); + return our_type; +} + |