Mercurial > pidgin
annotate finch/libgnt/gntbindable.h @ 18015:f8fc41570bf1
propagate from branch 'org.maemo.garage.pidgin.pidgin.pidgin-create-window' (head aa14d4a155af76ab7e3be4b5a92082e3bb2daa21)
to branch 'im.pidgin.rlaager.merging.for_2_1_0' (head c8c2bc1f0dd3a0a30b7be8b90114f176ab8c7943)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 20 May 2007 14:53:41 +0000 |
parents | 5187395d6b78 |
children | 8410511f4dbb |
rev | line source |
---|---|
15817 | 1 #ifndef GNT_BINDABLE_H |
2 #define GNT_BINDABLE_H | |
3 | |
4 #include <stdio.h> | |
5 #include <glib.h> | |
6 #include <glib-object.h> | |
7 #include <ncurses.h> | |
8 | |
9 #define GNT_TYPE_BINDABLE (gnt_bindable_get_gtype()) | |
10 #define GNT_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_BINDABLE, GntBindable)) | |
11 #define GNT_BINDABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_BINDABLE, GntBindableClass)) | |
12 #define GNT_IS_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_BINDABLE)) | |
13 #define GNT_IS_BINDABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_BINDABLE)) | |
14 #define GNT_BINDABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_BINDABLE, GntBindableClass)) | |
15 | |
16283
5187395d6b78
Debug is not necessary anymore, and don't crash on null text.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15928
diff
changeset
|
16 #define GNTDEBUG |
15817 | 17 |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
18 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
|
19 typedef struct _GntBindableClass GntBindableClass; |
15817 | 20 |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
21 struct _GntBindable |
15817 | 22 { |
23 GObject inherit; | |
24 }; | |
25 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
26 struct _GntBindableClass |
15817 | 27 { |
28 GObjectClass parent; | |
29 | |
30 GHashTable *remaps; /* Key remaps */ | |
31 GHashTable *actions; /* name -> Action */ | |
32 GHashTable *bindings; /* key -> ActionParam */ | |
33 | |
34 void (*gnt_reserved1)(void); | |
35 void (*gnt_reserved2)(void); | |
36 void (*gnt_reserved3)(void); | |
37 void (*gnt_reserved4)(void); | |
38 }; | |
39 | |
40 G_BEGIN_DECLS | |
41 | |
42 GType gnt_bindable_get_gtype(void); | |
43 | |
44 /******************/ | |
45 /* Key Remaps */ | |
46 /******************/ | |
47 const char * gnt_bindable_remap_keys(GntBindable *bindable, const char *text); | |
48 | |
49 /******************/ | |
50 /* Bindable Actions */ | |
51 /******************/ | |
52 typedef gboolean (*GntBindableActionCallback) (GntBindable *bindable, GList *params); | |
53 typedef gboolean (*GntBindableActionCallbackNoParam)(GntBindable *bindable); | |
54 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
55 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
|
56 typedef struct _GntBindableActionParam GntBindableActionParam; |
15817 | 57 |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
58 struct _GntBindableAction |
15817 | 59 { |
60 char *name; /* The name of the action */ | |
61 union { | |
62 gboolean (*action)(GntBindable *bindable, GList *params); | |
63 gboolean (*action_noparam)(GntBindable *bindable); | |
64 } u; | |
65 }; | |
66 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
67 struct _GntBindableActionParam |
15817 | 68 { |
69 GntBindableAction *action; | |
70 GList *list; | |
71 }; | |
72 | |
73 | |
74 /*GntBindableAction *gnt_bindable_action_parse(const char *name);*/ | |
75 | |
76 void gnt_bindable_action_free(GntBindableAction *action); | |
77 void gnt_bindable_action_param_free(GntBindableActionParam *param); | |
78 | |
79 void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, | |
80 GntBindableActionCallback callback, const char *trigger, ...); | |
81 void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, | |
82 const char *trigger, ...); | |
83 | |
84 gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys); | |
85 gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...); | |
86 | |
87 G_END_DECLS | |
88 | |
89 #endif /* GNT_BINDABLE_H */ | |
90 |