| 122 * Register a bindable action for a class. |
122 * Register a bindable action for a class. |
| 123 * |
123 * |
| 124 * @klass: The class the binding is for. |
124 * @klass: The class the binding is for. |
| 125 * @name: The name of the binding. |
125 * @name: The name of the binding. |
| 126 * @callback: The callback for the binding. |
126 * @callback: The callback for the binding. |
| 127 * @trigger: The default trigger for the binding, or @c NULL, followed by a NULL-terminated |
127 * @trigger: The default trigger for the binding, or %NULL, followed by a NULL-terminated |
| 128 * list of default parameters. |
128 * list of default parameters. |
| 129 */ |
129 */ |
| 130 void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, GntBindableActionCallback callback, const char *trigger, ...); |
130 void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, GntBindableActionCallback callback, const char *trigger, ...); |
| 131 |
131 |
| 132 /** |
132 /** |
| 133 * Register a key-binding to an existing action. |
133 * Register a key-binding to an existing action. |
| 134 * |
134 * |
| 135 * @klass: The class the binding is for. |
135 * @klass: The class the binding is for. |
| 136 * @name: The name of the binding. |
136 * @name: The name of the binding. |
| 137 * @trigger: A new trigger for the binding, followed by a @c NULL-terminated list of parameters for the callback. |
137 * @trigger: A new trigger for the binding, followed by a %NULL-terminated list of parameters for the callback. |
| 138 */ |
138 */ |
| 139 void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, const char *trigger, ...); |
139 void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, const char *trigger, ...); |
| 140 |
140 |
| 141 /** |
141 /** |
| 142 * Perform an action from a keybinding. |
142 * Perform an action from a keybinding. |
| 143 * |
143 * |
| 144 * @bindable: The bindable object. |
144 * @bindable: The bindable object. |
| 145 * @keys: The key to trigger the action. |
145 * @keys: The key to trigger the action. |
| 146 * |
146 * |
| 147 * Returns: @c TRUE if the action was performed successfully, @c FALSE otherwise. |
147 * Returns: %TRUE if the action was performed successfully, %FALSE otherwise. |
| 148 */ |
148 */ |
| 149 gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys); |
149 gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys); |
| 150 |
150 |
| 151 /** |
151 /** |
| 152 * Discover if a key is bound. |
152 * Discover if a key is bound. |
| 153 * |
153 * |
| 154 * @bindable: The bindable object. |
154 * @bindable: The bindable object. |
| 155 * @keys: The key to check for. |
155 * @keys: The key to check for. |
| 156 * |
156 * |
| 157 * Returns: @c TRUE if the the key has an action associated with it. |
157 * Returns: %TRUE if the the key has an action associated with it. |
| 158 */ |
158 */ |
| 159 gboolean gnt_bindable_check_key(GntBindable *bindable, const char *keys); |
159 gboolean gnt_bindable_check_key(GntBindable *bindable, const char *keys); |
| 160 |
160 |
| 161 /** |
161 /** |
| 162 * Perform an action on a bindable object. |
162 * Perform an action on a bindable object. |
| 163 * |
163 * |
| 164 * @bindable: The bindable object. |
164 * @bindable: The bindable object. |
| 165 * @name: The action to perform, followed by a @c NULL-terminated list of parameters. |
165 * @name: The action to perform, followed by a %NULL-terminated list of parameters. |
| 166 * |
166 * |
| 167 * Returns: @c TRUE if the action was performed successfully, @c FALSE otherwise. |
167 * Returns: %TRUE if the action was performed successfully, %FALSE otherwise. |
| 168 */ |
168 */ |
| 169 gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...) G_GNUC_NULL_TERMINATED; |
169 gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...) G_GNUC_NULL_TERMINATED; |
| 170 |
170 |
| 171 /** |
171 /** |
| 172 * Returns a GntTree populated with "key" -> "binding" for the widget. |
172 * Returns a GntTree populated with "key" -> "binding" for the widget. |