2 * GNT - The GLib Ncurses Toolkit
4 * GNT is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
8 * This library is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
30 static GntWidgetClass
*parent_class
= NULL
;
31 static guint signals
[SIGS
] = { 0 };
34 gnt_skel_draw(GntWidget
*widget
)
40 gnt_skel_size_request(GntWidget
*widget
)
45 gnt_skel_map(GntWidget
*widget
)
47 if (widget
->priv
.width
== 0 || widget
->priv
.height
== 0)
48 gnt_widget_size_request(widget
);
53 gnt_skel_key_pressed(GntWidget
*widget
, const char *text
)
59 gnt_skel_destroy(GntWidget
*widget
)
64 gnt_skel_class_init(GntSkelClass
*klass
)
66 GObjectClass
*obj_class
= G_OBJECT_CLASS(klass
);
68 parent_class
= GNT_WIDGET_CLASS(klass
);
69 parent_class
->destroy
= gnt_skel_destroy
;
70 parent_class
->draw
= gnt_skel_draw
;
71 parent_class
->map
= gnt_skel_map
;
72 parent_class
->size_request
= gnt_skel_size_request
;
73 parent_class
->key_pressed
= gnt_skel_key_pressed
;
75 parent_class
->actions
= g_hash_table_duplicate(parent_class
->actions
, g_str_hash
,
76 g_str_equal
, NULL
, (GDestroyNotify
)gnt_widget_action_free
);
77 parent_class
->bindings
= g_hash_table_duplicate(parent_class
->bindings
, g_str_hash
,
78 g_str_equal
, NULL
, (GDestroyNotify
)gnt_widget_action_param_free
);
80 gnt_widget_actions_read(G_OBJECT_CLASS_TYPE(klass
), klass
);
86 gnt_skel_init(GTypeInstance
*instance
, gpointer
class)
91 /******************************************************************************
93 *****************************************************************************/
95 gnt_skel_get_gtype(void)
97 static GType type
= 0;
101 static const GTypeInfo info
= {
102 sizeof(GntSkelClass
),
103 NULL
, /* base_init */
104 NULL
, /* base_finalize */
105 (GClassInitFunc
)gnt_skel_class_init
,
106 NULL
, /* class_finalize */
107 NULL
, /* class_data */
110 gnt_skel_init
, /* instance_init */
113 type
= g_type_register_static(GNT_TYPE_WIDGET
,
121 GntWidget
*gnt_skel_new()
123 GntWidget
*widget
= g_object_new(GNT_TYPE_SKEL
, NULL
);
124 GntSkel
*skel
= GNT_SKEL(widget
);