Mercurial > pidgin.yaz
annotate finch/libgnt/gnt-skel.c @ 18068:0b3d6ea61760
propagate from branch 'im.pidgin.pidgin' (head 4b50880d8517570eaa67d4cd9d88c5934bb832f1)
to branch 'im.pidgin.pidgin.2.1.0' (head fefd59692d4177b91d52f6d71b1565b76c88725d)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 07 Jun 2007 14:48:33 +0000 |
parents | 1cedd520cd18 |
children | 44b4e8bd759b |
rev | line source |
---|---|
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
1 /** |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
2 * GNT - The GLib Ncurses Toolkit |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
3 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
4 * GNT is the legal property of its developers, whose names are too numerous |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
5 * to list here. Please refer to the COPYRIGHT file distributed with this |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
6 * source distribution. |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
7 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
8 * This library is free software; you can redistribute it and/or modify |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
11 * (at your option) any later version. |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
12 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
16 * GNU General Public License for more details. |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
17 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
21 */ |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
22 |
15818 | 23 #include "gnt-skel.h" |
24 | |
25 enum | |
26 { | |
27 SIGS = 1, | |
28 }; | |
29 | |
30 static GntWidgetClass *parent_class = NULL; | |
31 static guint signals[SIGS] = { 0 }; | |
32 | |
33 static void | |
34 gnt_skel_draw(GntWidget *widget) | |
35 { | |
36 GNTDEBUG; | |
37 } | |
38 | |
39 static void | |
40 gnt_skel_size_request(GntWidget *widget) | |
41 { | |
42 } | |
43 | |
44 static void | |
45 gnt_skel_map(GntWidget *widget) | |
46 { | |
47 if (widget->priv.width == 0 || widget->priv.height == 0) | |
48 gnt_widget_size_request(widget); | |
49 GNTDEBUG; | |
50 } | |
51 | |
52 static gboolean | |
53 gnt_skel_key_pressed(GntWidget *widget, const char *text) | |
54 { | |
55 return FALSE; | |
56 } | |
57 | |
58 static void | |
59 gnt_skel_destroy(GntWidget *widget) | |
60 { | |
61 } | |
62 | |
63 static void | |
64 gnt_skel_class_init(GntSkelClass *klass) | |
65 { | |
66 GObjectClass *obj_class = G_OBJECT_CLASS(klass); | |
67 | |
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; | |
74 | |
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); | |
79 | |
80 gnt_widget_actions_read(G_OBJECT_CLASS_TYPE(klass), klass); | |
81 | |
82 GNTDEBUG; | |
83 } | |
84 | |
85 static void | |
86 gnt_skel_init(GTypeInstance *instance, gpointer class) | |
87 { | |
88 GNTDEBUG; | |
89 } | |
90 | |
91 /****************************************************************************** | |
92 * GntSkel API | |
93 *****************************************************************************/ | |
94 GType | |
95 gnt_skel_get_gtype(void) | |
96 { | |
97 static GType type = 0; | |
98 | |
99 if(type == 0) | |
100 { | |
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 */ | |
111 }; | |
112 | |
113 type = g_type_register_static(GNT_TYPE_WIDGET, | |
114 "GntSkel", | |
115 &info, 0); | |
116 } | |
117 | |
118 return type; | |
119 } | |
120 | |
121 GntWidget *gnt_skel_new() | |
122 { | |
123 GntWidget *widget = g_object_new(GNT_TYPE_SKEL, NULL); | |
124 GntSkel *skel = GNT_SKEL(widget); | |
125 | |
126 return widget; | |
127 } | |
128 |