gtk/gtksizerequest.c: Use G_DEFINE_INTERFACE macro

This commit is contained in:
Javier Jardón 2010-08-25 21:59:02 +02:00
parent 523ea1c656
commit 1b77e36a59

View File

@ -121,26 +121,19 @@ typedef struct {
static GQuark quark_cache = 0; static GQuark quark_cache = 0;
GType typedef GtkSizeRequestIface GtkSizeRequestInterface;
gtk_size_request_get_type (void) G_DEFINE_INTERFACE_WITH_CODE (GtkSizeRequest,
gtk_size_request,
GTK_TYPE_WIDGET,
quark_cache = g_quark_from_static_string ("gtk-size-request-cache"));
static void
gtk_size_request_default_init (GtkSizeRequestInterface *iface)
{ {
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);
quark_cache = g_quark_from_static_string ("gtk-size-request-cache");
}
return size_request_type;
} }
/* looks for a cached size request for this for_size. If not /* looks for a cached size request for this for_size. If not
* found, returns the oldest entry so it can be overwritten * found, returns the oldest entry so it can be overwritten
* *