diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-08-25 21:59:02 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-08-26 00:33:56 +0200 |
commit | 1b77e36a5943491d27a1991c30f9e79659b1db94 (patch) | |
tree | 48e13345c410adba6765c315bc75dec9b7fa23c3 | |
parent | 523ea1c65614bed598a4d8e52e2981e7fe098f09 (diff) | |
download | gtk+-1b77e36a5943491d27a1991c30f9e79659b1db94.tar.gz |
gtk/gtksizerequest.c: Use G_DEFINE_INTERFACE macro
-rw-r--r-- | gtk/gtksizerequest.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index 908cc39be0..02d2e79cb5 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -121,26 +121,19 @@ typedef struct { static GQuark quark_cache = 0; -GType -gtk_size_request_get_type (void) -{ - static GType size_request_type = 0; - - if (G_UNLIKELY(!size_request_type)) - { - size_request_type = - g_type_register_static_simple (G_TYPE_INTERFACE, I_("GtkSizeRequest"), - sizeof (GtkSizeRequestIface), - NULL, 0, NULL, 0); - - g_type_interface_add_prerequisite (size_request_type, GTK_TYPE_WIDGET); +typedef GtkSizeRequestIface GtkSizeRequestInterface; +G_DEFINE_INTERFACE_WITH_CODE (GtkSizeRequest, + gtk_size_request, + GTK_TYPE_WIDGET, + quark_cache = g_quark_from_static_string ("gtk-size-request-cache")); - quark_cache = g_quark_from_static_string ("gtk-size-request-cache"); - } - return size_request_type; +static void +gtk_size_request_default_init (GtkSizeRequestInterface *iface) +{ } + /* looks for a cached size request for this for_size. If not * found, returns the oldest entry so it can be overwritten * |