tearoffitem.c 1.46 KB
Newer Older
1 2
#include "config.h"

Mark McLoughlin's avatar
Mark McLoughlin committed
3
#include <libgnome/libgnome.h>
4
#include <gconf/gconf-client.h>
Mark McLoughlin's avatar
Mark McLoughlin committed
5

6
#include "menu.h"
7 8 9
#include "tearoffitem.h"

static void tearoff_item_class_init	(TearoffItemClass	*klass);
10
static void tearoff_item_instance_init	(TearoffItem	*tearoff_menu_item);
11

Jiri (George) Lebl's avatar
Jiri (George) Lebl committed
12 13
GType
tearoff_item_get_type (void)
14
{
15 16 17 18 19 20 21 22 23 24 25 26 27
	static GType object_type = 0;

	if (object_type == 0) {
		static const GTypeInfo object_info = {
                    sizeof (TearoffItemClass),
                    (GBaseInitFunc)         NULL,
                    (GBaseFinalizeFunc)     NULL,
                    (GClassInitFunc)        tearoff_item_class_init,
                    NULL,                   /* class_finalize */
                    NULL,                   /* class_data */
                    sizeof (TearoffItem),
                    0,                      /* n_preallocs */
                    (GInstanceInitFunc)     tearoff_item_instance_init
28 29
		};

30
		object_type = g_type_register_static (GTK_TYPE_TEAROFF_MENU_ITEM, "TearoffItem", &object_info, 0);
31 32
	}

33
	return object_type;
34 35 36
}

GtkWidget*
Mark McLoughlin's avatar
Mark McLoughlin committed
37
tearoff_item_new (void)
38
{
39
	g_return_val_if_fail (panel_menu_have_tearoff (), NULL);
Mark McLoughlin's avatar
Mark McLoughlin committed
40

41
	return GTK_WIDGET (g_object_new (tearoff_item_get_type (), NULL));
42 43 44 45 46 47 48 49 50
}

static void
tearoff_item_class_init(TearoffItemClass *klass)
{
	GtkMenuItemClass *menu_item_class;

	menu_item_class = (GtkMenuItemClass*) klass;

51
	menu_item_class->activate = NULL;
52 53 54
}

static void
55
tearoff_item_instance_init(TearoffItem *tearoff_menu_item)
56
{
57
	/* Empty */
58
}