annotate finch/libgnt/gntbindable.h @ 24461:ff275531cbf2

Send the SOAP faultcode to the callbacks for each Contact operation. They all just print a debug message like it did before, but this should allow for specific error handling. References #6755.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 01 Dec 2008 05:53:40 +0000
parents 24dfef623410
children 650ab9eb4b21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
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: 17718
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: 17718
diff changeset
3 * @ingroup gnt
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
4 */
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
5 /*
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
6 * GNT - The GLib Ncurses Toolkit
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
7 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
8 * GNT is the legal property of its developers, whose names are too numerous
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
10 * source distribution.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
11 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
12 * This library is free software; you can redistribute it and/or modify
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
13 * it under the terms of the GNU General Public License as published by
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
15 * (at your option) any later version.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
16 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
17 * This program is distributed in the hope that it will be useful,
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
20 * GNU General Public License for more details.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
21 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
22 * You should have received a copy of the GNU General Public License
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
23 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19120
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
25 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
26
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #ifndef GNT_BINDABLE_H
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #define GNT_BINDABLE_H
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include <stdio.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include <glib.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include <glib-object.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include <ncurses.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 #define GNT_TYPE_BINDABLE (gnt_bindable_get_gtype())
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 #define GNT_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_BINDABLE, GntBindable))
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 #define GNT_BINDABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_BINDABLE, GntBindableClass))
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 #define GNT_IS_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_BINDABLE))
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 #define GNT_IS_BINDABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_BINDABLE))
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 #define GNT_BINDABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_BINDABLE, GntBindableClass))
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41
16283
5187395d6b78 Debug is not necessary anymore, and don't crash on null text.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15931
diff changeset
42 #define GNTDEBUG
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43
15931
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15818
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: 15818
diff changeset
45 typedef struct _GntBindableClass GntBindableClass;
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46
15931
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15818
diff changeset
47 struct _GntBindable
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 GObject inherit;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51
15931
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15818
diff changeset
52 struct _GntBindableClass
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 GObjectClass parent;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 GHashTable *remaps; /* Key remaps */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 GHashTable *actions; /* name -> Action */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 GHashTable *bindings; /* key -> ActionParam */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59
17721
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
60 GntBindable * help_window;
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
61
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 void (*gnt_reserved2)(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 void (*gnt_reserved3)(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 void (*gnt_reserved4)(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 G_BEGIN_DECLS
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
69 /**
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
70 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
71 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
72 * @return
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
73 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 GType gnt_bindable_get_gtype(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 /******************/
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77 /* Key Remaps */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 /******************/
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 const char * gnt_bindable_remap_keys(GntBindable *bindable, const char *text);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 /******************/
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 /* Bindable Actions */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 /******************/
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 typedef gboolean (*GntBindableActionCallback) (GntBindable *bindable, GList *params);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 typedef gboolean (*GntBindableActionCallbackNoParam)(GntBindable *bindable);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86
15931
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15818
diff changeset
87 typedef struct _GntBindableAction GntBindableAction;
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15818
diff changeset
88 typedef struct _GntBindableActionParam GntBindableActionParam;
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89
15931
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15818
diff changeset
90 struct _GntBindableAction
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92 char *name; /* The name of the action */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 union {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94 gboolean (*action)(GntBindable *bindable, GList *params);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 gboolean (*action_noparam)(GntBindable *bindable);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 } u;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98
15931
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15818
diff changeset
99 struct _GntBindableActionParam
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 GntBindableAction *action;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 GList *list;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105 /*GntBindableAction *gnt_bindable_action_parse(const char *name);*/
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
107 /**
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
108 * Free a bindable action.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
109 *
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
110 * @param action The bindable action.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
111 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 void gnt_bindable_action_free(GntBindableAction *action);
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
113
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
114 /**
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
115 * Free a GntBindableActionParam.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
116 *
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
117 * @param param The GntBindableActionParam to free.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
118 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
119 void gnt_bindable_action_param_free(GntBindableActionParam *param);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
120
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
121 /**
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
122 * Register a bindable action for a class.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
123 *
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
124 * @param klass The class the binding is for.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
125 * @param name The name of the binding.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
126 * @param callback The callback for the binding.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
127 * @param trigger The default trigger for the binding, or @c NULL, followed by a NULL-terminated
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
128 * list of default parameters.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
129 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
130 void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, GntBindableActionCallback callback, const char *trigger, ...);
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
131
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
132 /**
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
133 * Register a key-binding to an existing action.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
134 *
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
135 * @param klass The class the binding is for.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
136 * @param name The name of the binding.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
137 * @param trigger A new trigger for the binding, followed by a @c NULL-terminated list of parameters for the callback.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
138 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
139 void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, const char *trigger, ...);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
141 /**
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
142 * Perform an action from a keybinding.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
143 *
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
144 * @param bindable The bindable object.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
145 * @param keys The key to trigger the action.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
146 *
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
147 * @return @c TRUE if the action was performed successfully, @c FALSE otherwise.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
148 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys);
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
150
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
151 /**
22871
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
152 * Discover if a key is bound.
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
153 *
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
154 * @param bindable The bindable object.
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
155 * @param keys The key to check for.
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
156 *
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
157 * @return @c TRUE if the the key has an action associated with it.
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
158 */
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
159 gboolean gnt_bindable_check_key(GntBindable *bindable, const char *keys);
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
160
24dfef623410 Check if a key is already bound before assigning a menu trigger
Richard Nelson <wabz@pidgin.im>
parents: 21253
diff changeset
161 /**
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
162 * Perform an action on a bindable object.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
163 *
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
164 * @param bindable The bindable object.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
165 * @param name The action to perform, followed by a @c NULL-terminated list of parameters.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
166 *
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
167 * @return @c TRUE if the action was performed successfully, @c FALSE otherwise.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16283
diff changeset
168 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170
17721
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
171 /**
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
172 * Returns a GntTree populated with "key" -> "binding" for the widget.
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20306
diff changeset
173 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20306
diff changeset
174 * @param bind The object to list the bindings for.
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
175 *
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
176 * @return The GntTree.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
177 */
17721
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
178 GntBindable * gnt_bindable_bindings_view(GntBindable *bind);
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
179
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
180 /**
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
181 * Builds a window that list the key bindings for a GntBindable object.
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
182 * From this window a user can select a listing to rebind a new key for the given action.
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20306
diff changeset
183 *
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
184 * @param bindable The object to list the bindings for.
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20306
diff changeset
185 *
20306
665d6d7eea83 applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents: 19680
diff changeset
186 * @return @c TRUE
17721
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
187 */
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
188
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
189 gboolean gnt_bindable_build_help_window(GntBindable *bindable);
3ee6ea8a66f8 Moved rebinding functionality into GntBindable.
Eric Polino <aluink@pidgin.im>
parents: 17718
diff changeset
190
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 G_END_DECLS
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 #endif /* GNT_BINDABLE_H */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194