15817
|
1 #include "gnt-skel.h"
|
|
2
|
|
3 enum
|
|
4 {
|
|
5 SIGS = 1,
|
|
6 };
|
|
7
|
|
8 static GntWidgetClass *parent_class = NULL;
|
|
9 static guint signals[SIGS] = { 0 };
|
|
10
|
|
11 static void
|
|
12 gnt_skel_draw(GntWidget *widget)
|
|
13 {
|
|
14 GNTDEBUG;
|
|
15 }
|
|
16
|
|
17 static void
|
|
18 gnt_skel_size_request(GntWidget *widget)
|
|
19 {
|
|
20 }
|
|
21
|
|
22 static void
|
|
23 gnt_skel_map(GntWidget *widget)
|
|
24 {
|
|
25 if (widget->priv.width == 0 || widget->priv.height == 0)
|
|
26 gnt_widget_size_request(widget);
|
|
27 GNTDEBUG;
|
|
28 }
|
|
29
|
|
30 static gboolean
|
|
31 gnt_skel_key_pressed(GntWidget *widget, const char *text)
|
|
32 {
|
|
33 return FALSE;
|
|
34 }
|
|
35
|
|
36 static void
|
|
37 gnt_skel_destroy(GntWidget *widget)
|
|
38 {
|
|
39 }
|
|
40
|
|
41 static void
|
|
42 gnt_skel_class_init(GntSkelClass *klass)
|
|
43 {
|
|
44 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
|
|
45
|
|
46 parent_class = GNT_WIDGET_CLASS(klass);
|
|
47 parent_class->destroy = gnt_skel_destroy;
|
|
48 parent_class->draw = gnt_skel_draw;
|
|
49 parent_class->map = gnt_skel_map;
|
|
50 parent_class->size_request = gnt_skel_size_request;
|
|
51 parent_class->key_pressed = gnt_skel_key_pressed;
|
|
52
|
|
53 parent_class->actions = g_hash_table_duplicate(parent_class->actions, g_str_hash,
|
|
54 g_str_equal, NULL, (GDestroyNotify)gnt_widget_action_free);
|
|
55 parent_class->bindings = g_hash_table_duplicate(parent_class->bindings, g_str_hash,
|
|
56 g_str_equal, NULL, (GDestroyNotify)gnt_widget_action_param_free);
|
|
57
|
|
58 gnt_widget_actions_read(G_OBJECT_CLASS_TYPE(klass), klass);
|
|
59
|
|
60 GNTDEBUG;
|
|
61 }
|
|
62
|
|
63 static void
|
|
64 gnt_skel_init(GTypeInstance *instance, gpointer class)
|
|
65 {
|
|
66 GNTDEBUG;
|
|
67 }
|
|
68
|
|
69 /******************************************************************************
|
|
70 * GntSkel API
|
|
71 *****************************************************************************/
|
|
72 GType
|
|
73 gnt_skel_get_gtype(void)
|
|
74 {
|
|
75 static GType type = 0;
|
|
76
|
|
77 if(type == 0)
|
|
78 {
|
|
79 static const GTypeInfo info = {
|
|
80 sizeof(GntSkelClass),
|
|
81 NULL, /* base_init */
|
|
82 NULL, /* base_finalize */
|
|
83 (GClassInitFunc)gnt_skel_class_init,
|
|
84 NULL, /* class_finalize */
|
|
85 NULL, /* class_data */
|
|
86 sizeof(GntSkel),
|
|
87 0, /* n_preallocs */
|
|
88 gnt_skel_init, /* instance_init */
|
|
89 };
|
|
90
|
|
91 type = g_type_register_static(GNT_TYPE_WIDGET,
|
|
92 "GntSkel",
|
|
93 &info, 0);
|
|
94 }
|
|
95
|
|
96 return type;
|
|
97 }
|
|
98
|
|
99 GntWidget *gnt_skel_new()
|
|
100 {
|
|
101 GntWidget *widget = g_object_new(GNT_TYPE_SKEL, NULL);
|
|
102 GntSkel *skel = GNT_SKEL(widget);
|
|
103
|
|
104 return widget;
|
|
105 }
|
|
106
|