Add missing AUTHORS and ChangeLog.
[gnt.git] / gnt-skel.c
blobafa91bf02eae70099f9f5313a73572e185c5df43
1 /**
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
6 * source distribution.
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
23 #include "gnt-skel.h"
25 enum
27 SIGS = 1,
30 static GntWidgetClass *parent_class = NULL;
31 static guint signals[SIGS] = { 0 };
33 static void
34 gnt_skel_draw(GntWidget *widget)
36 GNTDEBUG;
39 static void
40 gnt_skel_size_request(GntWidget *widget)
44 static void
45 gnt_skel_map(GntWidget *widget)
47 if (widget->priv.width == 0 || widget->priv.height == 0)
48 gnt_widget_size_request(widget);
49 GNTDEBUG;
52 static gboolean
53 gnt_skel_key_pressed(GntWidget *widget, const char *text)
55 return FALSE;
58 static void
59 gnt_skel_destroy(GntWidget *widget)
63 static void
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);
82 GNTDEBUG;
85 static void
86 gnt_skel_init(GTypeInstance *instance, gpointer class)
88 GNTDEBUG;
91 /******************************************************************************
92 * GntSkel API
93 *****************************************************************************/
94 GType
95 gnt_skel_get_gtype(void)
97 static GType type = 0;
99 if(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 */
108 sizeof(GntSkel),
109 0, /* n_preallocs */
110 gnt_skel_init, /* instance_init */
113 type = g_type_register_static(GNT_TYPE_WIDGET,
114 "GntSkel",
115 &info, 0);
118 return type;
121 GntWidget *gnt_skel_new()
123 GntWidget *widget = g_object_new(GNT_TYPE_SKEL, NULL);
124 GntSkel *skel = GNT_SKEL(widget);
126 return widget;