Mercurial > pidgin
annotate finch/libgnt/gnt-skel.c @ 22217:ad357ca94de9
We will probably eventually use purple_object_[get|set]_ui_data. Until then, this will do.
| author | Sadrul Habib Chowdhury <imadil@gmail.com> |
|---|---|
| date | Sat, 26 Jan 2008 22:33:08 +0000 |
| parents | 44b4e8bd759b |
| children |
| rev | line source |
|---|---|
|
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
1 /** |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
2 * GNT - The GLib Ncurses Toolkit |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
3 * |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
4 * GNT is the legal property of its developers, whose names are too numerous |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
5 * to list here. Please refer to the COPYRIGHT file distributed with this |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
6 * source distribution. |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
7 * |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
8 * This library is free software; you can redistribute it and/or modify |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
11 * (at your option) any later version. |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
12 * |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
16 * GNU General Public License for more details. |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
17 * |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
|
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17928
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
21 */ |
|
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15817
diff
changeset
|
22 |
| 15817 | 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 |
