Mercurial > pidgin
annotate finch/libgnt/gntbindable.h @ 18837:b5d6e360eca0
propagate from branch 'im.pidgin.pidgin' (head 5e5168d639fb9a3a29ab3fe44b976d6d25924403)
to branch 'libgnt.pygnt' (head ec6a81b752b20677effe5ad3da03b7a1dbc922bf)
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Tue, 07 Aug 2007 21:45:31 +0000 |
parents | 5c6f019e48f8 |
children | b25cb0775be3 |
rev | line source |
---|---|
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
1 /** |
18303
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18049
diff
changeset
|
2 * @file gntbindable.h Bindable API |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18049
diff
changeset
|
3 * @ingroup gnt |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18049
diff
changeset
|
4 */ |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18049
diff
changeset
|
5 /* |
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
6 * GNT - The GLib Ncurses Toolkit |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
7 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
8 * 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:
16283
diff
changeset
|
9 * 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:
16283
diff
changeset
|
10 * source distribution. |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
11 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
12 * 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:
16283
diff
changeset
|
13 * 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:
16283
diff
changeset
|
14 * 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:
16283
diff
changeset
|
15 * (at your option) any later version. |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
16 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
17 * 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:
16283
diff
changeset
|
18 * 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:
16283
diff
changeset
|
19 * 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:
16283
diff
changeset
|
20 * GNU General Public License for more details. |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
21 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
22 * 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:
16283
diff
changeset
|
23 * 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:
16283
diff
changeset
|
24 * 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:
16283
diff
changeset
|
25 */ |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
26 |
15817 | 27 #ifndef GNT_BINDABLE_H |
28 #define GNT_BINDABLE_H | |
29 | |
30 #include <stdio.h> | |
31 #include <glib.h> | |
32 #include <glib-object.h> | |
33 #include <ncurses.h> | |
34 | |
35 #define GNT_TYPE_BINDABLE (gnt_bindable_get_gtype()) | |
36 #define GNT_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_BINDABLE, GntBindable)) | |
37 #define GNT_BINDABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_BINDABLE, GntBindableClass)) | |
38 #define GNT_IS_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_BINDABLE)) | |
39 #define GNT_IS_BINDABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_BINDABLE)) | |
40 #define GNT_BINDABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_BINDABLE, GntBindableClass)) | |
41 | |
16283
5187395d6b78
Debug is not necessary anymore, and don't crash on null text.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15928
diff
changeset
|
42 #define GNTDEBUG |
15817 | 43 |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
44 typedef struct _GntBindable GntBindable; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
45 typedef struct _GntBindableClass GntBindableClass; |
15817 | 46 |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
47 struct _GntBindable |
15817 | 48 { |
49 GObject inherit; | |
50 }; | |
51 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
52 struct _GntBindableClass |
15817 | 53 { |
54 GObjectClass parent; | |
55 | |
56 GHashTable *remaps; /* Key remaps */ | |
57 GHashTable *actions; /* name -> Action */ | |
58 GHashTable *bindings; /* key -> ActionParam */ | |
59 | |
60 void (*gnt_reserved1)(void); | |
61 void (*gnt_reserved2)(void); | |
62 void (*gnt_reserved3)(void); | |
63 void (*gnt_reserved4)(void); | |
64 }; | |
65 | |
66 G_BEGIN_DECLS | |
67 | |
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
68 /** |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
69 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
70 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
71 * @return |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
72 */ |
15817 | 73 GType gnt_bindable_get_gtype(void); |
74 | |
75 /******************/ | |
76 /* Key Remaps */ | |
77 /******************/ | |
78 const char * gnt_bindable_remap_keys(GntBindable *bindable, const char *text); | |
79 | |
80 /******************/ | |
81 /* Bindable Actions */ | |
82 /******************/ | |
83 typedef gboolean (*GntBindableActionCallback) (GntBindable *bindable, GList *params); | |
84 typedef gboolean (*GntBindableActionCallbackNoParam)(GntBindable *bindable); | |
85 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
86 typedef struct _GntBindableAction GntBindableAction; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
87 typedef struct _GntBindableActionParam GntBindableActionParam; |
15817 | 88 |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
89 struct _GntBindableAction |
15817 | 90 { |
91 char *name; /* The name of the action */ | |
92 union { | |
93 gboolean (*action)(GntBindable *bindable, GList *params); | |
94 gboolean (*action_noparam)(GntBindable *bindable); | |
95 } u; | |
96 }; | |
97 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
98 struct _GntBindableActionParam |
15817 | 99 { |
100 GntBindableAction *action; | |
101 GList *list; | |
102 }; | |
103 | |
104 /*GntBindableAction *gnt_bindable_action_parse(const char *name);*/ | |
105 | |
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
106 /** |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
107 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
108 * @param action |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
109 */ |
15817 | 110 void gnt_bindable_action_free(GntBindableAction *action); |
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
111 |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
112 /** |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
113 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
114 * @param param |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
115 */ |
15817 | 116 void gnt_bindable_action_param_free(GntBindableActionParam *param); |
117 | |
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
118 /** |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
119 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
120 * @param klass |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
121 * @param name |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
122 * @param callback |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
123 * @param trigger |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
124 */ |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
125 void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, GntBindableActionCallback callback, const char *trigger, ...); |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
126 |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
127 /** |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
128 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
129 * @param klass |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
130 * @param name |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
131 * @param trigger |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
132 */ |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
133 void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, const char *trigger, ...); |
15817 | 134 |
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
135 /** |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
136 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
137 * @param bindable |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
138 * @param keys |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
139 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
140 * @return |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
141 */ |
15817 | 142 gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys); |
18049
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
143 |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
144 /** |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
145 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
146 * @param bindable |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
147 * @param name |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
148 * |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
149 * @return |
1cedd520cd18
Doxygen skeleton and license info for gnt files.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16283
diff
changeset
|
150 */ |
15817 | 151 gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...); |
152 | |
153 G_END_DECLS | |
154 | |
155 #endif /* GNT_BINDABLE_H */ | |
156 |