sl@0
|
1 |
/* GObject - GLib Type, Object, Parameter and Signal Library
|
sl@0
|
2 |
* Copyright (C) 2000-2001 Red Hat, Inc.
|
sl@0
|
3 |
* Portions copyright (c) 2006-2009 Nokia Corporation. All rights reserved.
|
sl@0
|
4 |
* This library is free software; you can redistribute it and/or
|
sl@0
|
5 |
* modify it under the terms of the GNU Lesser General Public
|
sl@0
|
6 |
* License as published by the Free Software Foundation; either
|
sl@0
|
7 |
* version 2 of the License, or (at your option) any later version.
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* This library is distributed in the hope that it will be useful,
|
sl@0
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
sl@0
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
sl@0
|
12 |
* Lesser General Public License for more details.
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* You should have received a copy of the GNU Lesser General
|
sl@0
|
15 |
* Public License along with this library; if not, write to the
|
sl@0
|
16 |
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
sl@0
|
17 |
* Boston, MA 02111-1307, USA.
|
sl@0
|
18 |
*/
|
sl@0
|
19 |
#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
|
sl@0
|
20 |
#error "Only <glib-object.h> can be included directly."
|
sl@0
|
21 |
#endif
|
sl@0
|
22 |
|
sl@0
|
23 |
#ifndef __G_SIGNAL_H__
|
sl@0
|
24 |
#define __G_SIGNAL_H__
|
sl@0
|
25 |
|
sl@0
|
26 |
#include <gobject/gclosure.h>
|
sl@0
|
27 |
#include <gobject/gvalue.h>
|
sl@0
|
28 |
#include <gobject/gparam.h>
|
sl@0
|
29 |
#include <gobject/gmarshal.h>
|
sl@0
|
30 |
|
sl@0
|
31 |
G_BEGIN_DECLS
|
sl@0
|
32 |
|
sl@0
|
33 |
/* --- typedefs --- */
|
sl@0
|
34 |
typedef struct _GSignalQuery GSignalQuery;
|
sl@0
|
35 |
typedef struct _GSignalInvocationHint GSignalInvocationHint;
|
sl@0
|
36 |
/**
|
sl@0
|
37 |
* GSignalCMarshaller:
|
sl@0
|
38 |
*
|
sl@0
|
39 |
* This is the signature of marshaller functions, required to marshall
|
sl@0
|
40 |
* arrays of parameter values to signal emissions into C language callback
|
sl@0
|
41 |
* invocations. It is merely an alias to #GClosureMarshal since the #GClosure
|
sl@0
|
42 |
* mechanism takes over responsibility of actual function invocation for the
|
sl@0
|
43 |
* signal system.
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
typedef GClosureMarshal GSignalCMarshaller;
|
sl@0
|
46 |
/**
|
sl@0
|
47 |
* GSignalEmissionHook:
|
sl@0
|
48 |
* @ihint: Signal invocation hint, see #GSignalInvocationHint.
|
sl@0
|
49 |
* @n_param_values: the number of parameters to the function, including
|
sl@0
|
50 |
* the instance on which the signal was emitted.
|
sl@0
|
51 |
* @param_values: the instance on which the signal was emitted, followed by the
|
sl@0
|
52 |
* parameters of the emission.
|
sl@0
|
53 |
* @data: user data associated with the hook.
|
sl@0
|
54 |
*
|
sl@0
|
55 |
* A simple function pointer to get invoked when the signal is emitted. This
|
sl@0
|
56 |
* allows you to tie a hook to the signal type, so that it will trap all
|
sl@0
|
57 |
* emissions of that signal, from any object.
|
sl@0
|
58 |
*
|
sl@0
|
59 |
* You may not attach these to signals created with the #G_SIGNAL_NO_HOOKS flag.
|
sl@0
|
60 |
*
|
sl@0
|
61 |
* Returns: whether it wants to stay connected. If it returns %FALSE, the signal
|
sl@0
|
62 |
* hook is disconnected (and destroyed).
|
sl@0
|
63 |
*/
|
sl@0
|
64 |
typedef gboolean (*GSignalEmissionHook) (GSignalInvocationHint *ihint,
|
sl@0
|
65 |
guint n_param_values,
|
sl@0
|
66 |
const GValue *param_values,
|
sl@0
|
67 |
gpointer data);
|
sl@0
|
68 |
/**
|
sl@0
|
69 |
* GSignalAccumulator:
|
sl@0
|
70 |
* @ihint: Signal invocation hint, see #GSignalInvocationHint.
|
sl@0
|
71 |
* @return_accu: Accumulator to collect callback return values in, this
|
sl@0
|
72 |
* is the return value of the current signal emission.
|
sl@0
|
73 |
* @handler_return: A #GValue holding the return value of the signal handler.
|
sl@0
|
74 |
* @data: Callback data that was specified when creating the signal.
|
sl@0
|
75 |
*
|
sl@0
|
76 |
* The signal accumulator is a special callback function that can be used
|
sl@0
|
77 |
* to collect return values of the various callbacks that are called
|
sl@0
|
78 |
* during a signal emission. The signal accumulator is specified at signal
|
sl@0
|
79 |
* creation time, if it is left %NULL, no accumulation of callback return
|
sl@0
|
80 |
* values is performed. The return value of signal emissions is then the
|
sl@0
|
81 |
* value returned by the last callback.
|
sl@0
|
82 |
*
|
sl@0
|
83 |
* Returns: The accumulator function returns whether the signal emission
|
sl@0
|
84 |
* should be aborted. Returning %FALSE means to abort the
|
sl@0
|
85 |
* current emission and %TRUE is returned for continuation.
|
sl@0
|
86 |
*/
|
sl@0
|
87 |
typedef gboolean (*GSignalAccumulator) (GSignalInvocationHint *ihint,
|
sl@0
|
88 |
GValue *return_accu,
|
sl@0
|
89 |
const GValue *handler_return,
|
sl@0
|
90 |
gpointer data);
|
sl@0
|
91 |
|
sl@0
|
92 |
|
sl@0
|
93 |
/* --- run, match and connect types --- */
|
sl@0
|
94 |
/**
|
sl@0
|
95 |
* GSignalFlags:
|
sl@0
|
96 |
* @G_SIGNAL_RUN_FIRST: Invoke the object method handler in the first emission stage.
|
sl@0
|
97 |
* @G_SIGNAL_RUN_LAST: Invoke the object method handler in the third emission stage.
|
sl@0
|
98 |
* @G_SIGNAL_RUN_CLEANUP: Invoke the object method handler in the last emission stage.
|
sl@0
|
99 |
* @G_SIGNAL_NO_RECURSE: Signals being emitted for an object while currently being in
|
sl@0
|
100 |
* emission for this very object will not be emitted recursively,
|
sl@0
|
101 |
* but instead cause the first emission to be restarted.
|
sl@0
|
102 |
* @G_SIGNAL_DETAILED: This signal supports "::detail" appendices to the signal name
|
sl@0
|
103 |
* upon handler connections and emissions.
|
sl@0
|
104 |
* @G_SIGNAL_ACTION: Action signals are signals that may freely be emitted on alive
|
sl@0
|
105 |
* objects from user code via g_signal_emit() and friends, without
|
sl@0
|
106 |
* the need of being embedded into extra code that performs pre or
|
sl@0
|
107 |
* post emission adjustments on the object. They can also be thought
|
sl@0
|
108 |
* of as object methods which can be called generically by
|
sl@0
|
109 |
* third-party code.
|
sl@0
|
110 |
* @G_SIGNAL_NO_HOOKS: No emissions hooks are supported for this signal.
|
sl@0
|
111 |
*
|
sl@0
|
112 |
* The signal flags are used to specify a signal's behaviour, the overall
|
sl@0
|
113 |
* signal description outlines how especially the RUN flags control the
|
sl@0
|
114 |
* stages of a signal emission.
|
sl@0
|
115 |
*/
|
sl@0
|
116 |
typedef enum
|
sl@0
|
117 |
{
|
sl@0
|
118 |
G_SIGNAL_RUN_FIRST = 1 << 0,
|
sl@0
|
119 |
G_SIGNAL_RUN_LAST = 1 << 1,
|
sl@0
|
120 |
G_SIGNAL_RUN_CLEANUP = 1 << 2,
|
sl@0
|
121 |
G_SIGNAL_NO_RECURSE = 1 << 3,
|
sl@0
|
122 |
G_SIGNAL_DETAILED = 1 << 4,
|
sl@0
|
123 |
G_SIGNAL_ACTION = 1 << 5,
|
sl@0
|
124 |
G_SIGNAL_NO_HOOKS = 1 << 6
|
sl@0
|
125 |
} GSignalFlags;
|
sl@0
|
126 |
/**
|
sl@0
|
127 |
* G_SIGNAL_FLAGS_MASK:
|
sl@0
|
128 |
*
|
sl@0
|
129 |
* A mask for all #GSignalFlags bits.
|
sl@0
|
130 |
*/
|
sl@0
|
131 |
#define G_SIGNAL_FLAGS_MASK 0x7f
|
sl@0
|
132 |
/**
|
sl@0
|
133 |
* GConnectFlags:
|
sl@0
|
134 |
* @G_CONNECT_AFTER: whether the handler should be called before or after the
|
sl@0
|
135 |
* default handler of the signal.
|
sl@0
|
136 |
* @G_CONNECT_SWAPPED: whether the instance and data should be swapped when
|
sl@0
|
137 |
* calling the handler.
|
sl@0
|
138 |
*
|
sl@0
|
139 |
* The connection flags are used to specify the behaviour of a signal's
|
sl@0
|
140 |
* connection.
|
sl@0
|
141 |
*/
|
sl@0
|
142 |
typedef enum
|
sl@0
|
143 |
{
|
sl@0
|
144 |
G_CONNECT_AFTER = 1 << 0,
|
sl@0
|
145 |
G_CONNECT_SWAPPED = 1 << 1
|
sl@0
|
146 |
} GConnectFlags;
|
sl@0
|
147 |
/**
|
sl@0
|
148 |
* GSignalMatchType:
|
sl@0
|
149 |
* @G_SIGNAL_MATCH_ID: The signal id must be equal.
|
sl@0
|
150 |
* @G_SIGNAL_MATCH_DETAIL: The signal detail be equal.
|
sl@0
|
151 |
* @G_SIGNAL_MATCH_CLOSURE: The closure must be the same.
|
sl@0
|
152 |
* @G_SIGNAL_MATCH_FUNC: The C closure callback must be the same.
|
sl@0
|
153 |
* @G_SIGNAL_MATCH_DATA: The closure data must be the same.
|
sl@0
|
154 |
* @G_SIGNAL_MATCH_UNBLOCKED: Only unblocked signals may matched.
|
sl@0
|
155 |
*
|
sl@0
|
156 |
* The match types specify what g_signal_handlers_block_matched(),
|
sl@0
|
157 |
* g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched()
|
sl@0
|
158 |
* match signals by.
|
sl@0
|
159 |
*/
|
sl@0
|
160 |
typedef enum
|
sl@0
|
161 |
{
|
sl@0
|
162 |
G_SIGNAL_MATCH_ID = 1 << 0,
|
sl@0
|
163 |
G_SIGNAL_MATCH_DETAIL = 1 << 1,
|
sl@0
|
164 |
G_SIGNAL_MATCH_CLOSURE = 1 << 2,
|
sl@0
|
165 |
G_SIGNAL_MATCH_FUNC = 1 << 3,
|
sl@0
|
166 |
G_SIGNAL_MATCH_DATA = 1 << 4,
|
sl@0
|
167 |
G_SIGNAL_MATCH_UNBLOCKED = 1 << 5
|
sl@0
|
168 |
} GSignalMatchType;
|
sl@0
|
169 |
/**
|
sl@0
|
170 |
* G_SIGNAL_MATCH_MASK:
|
sl@0
|
171 |
*
|
sl@0
|
172 |
* A mask for all #GSignalMatchType bits.
|
sl@0
|
173 |
*/
|
sl@0
|
174 |
#define G_SIGNAL_MATCH_MASK 0x3f
|
sl@0
|
175 |
/**
|
sl@0
|
176 |
* G_SIGNAL_TYPE_STATIC_SCOPE:
|
sl@0
|
177 |
*
|
sl@0
|
178 |
* This macro flags signal argument types for which the signal system may
|
sl@0
|
179 |
* assume that instances thereof remain persistent across all signal emissions
|
sl@0
|
180 |
* they are used in. This is only useful for non ref-counted, value-copy types.
|
sl@0
|
181 |
*
|
sl@0
|
182 |
* To flag a signal argument in this way, add
|
sl@0
|
183 |
* <literal>| G_SIGNAL_TYPE_STATIC_SCOPE</literal> to the corresponding argument
|
sl@0
|
184 |
* of g_signal_new().
|
sl@0
|
185 |
* |[
|
sl@0
|
186 |
* g_signal_new ("size_request",
|
sl@0
|
187 |
* G_TYPE_FROM_CLASS (gobject_class),
|
sl@0
|
188 |
* G_SIGNAL_RUN_FIRST,
|
sl@0
|
189 |
* G_STRUCT_OFFSET (GtkWidgetClass, size_request),
|
sl@0
|
190 |
* NULL, NULL,
|
sl@0
|
191 |
* _gtk_marshal_VOID__BOXED,
|
sl@0
|
192 |
* G_TYPE_NONE, 1,
|
sl@0
|
193 |
* GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
|
sl@0
|
194 |
* ]|
|
sl@0
|
195 |
*/
|
sl@0
|
196 |
#define G_SIGNAL_TYPE_STATIC_SCOPE (G_TYPE_FLAG_RESERVED_ID_BIT)
|
sl@0
|
197 |
|
sl@0
|
198 |
|
sl@0
|
199 |
/* --- signal information --- */
|
sl@0
|
200 |
/**
|
sl@0
|
201 |
* GSignalInvocationHint:
|
sl@0
|
202 |
* @signal_id: The signal id of the signal invoking the callback
|
sl@0
|
203 |
* @detail: The detail passed on for this emission
|
sl@0
|
204 |
* @run_type: The stage the signal emission is currently in, this
|
sl@0
|
205 |
* field will contain one of %G_SIGNAL_RUN_FIRST,
|
sl@0
|
206 |
* %G_SIGNAL_RUN_LAST or %G_SIGNAL_RUN_CLEANUP.
|
sl@0
|
207 |
*
|
sl@0
|
208 |
* The #GSignalInvocationHint structure is used to pass on additional information
|
sl@0
|
209 |
* to callbacks during a signal emission.
|
sl@0
|
210 |
*/
|
sl@0
|
211 |
struct _GSignalInvocationHint
|
sl@0
|
212 |
{
|
sl@0
|
213 |
guint signal_id;
|
sl@0
|
214 |
GQuark detail;
|
sl@0
|
215 |
GSignalFlags run_type;
|
sl@0
|
216 |
};
|
sl@0
|
217 |
/**
|
sl@0
|
218 |
* GSignalQuery:
|
sl@0
|
219 |
* @signal_id: The signal id of the signal being queried, or 0 if the
|
sl@0
|
220 |
* signal to be queried was unknown.
|
sl@0
|
221 |
* @signal_name: The signal name.
|
sl@0
|
222 |
* @itype: The interface/instance type that this signal can be emitted for.
|
sl@0
|
223 |
* @signal_flags: The signal flags as passed in to g_signal_new().
|
sl@0
|
224 |
* @return_type: The return type for user callbacks.
|
sl@0
|
225 |
* @n_params: The number of parameters that user callbacks take.
|
sl@0
|
226 |
* @param_types: The individual parameter types for user callbacks, note that the
|
sl@0
|
227 |
* effective callback signature is:
|
sl@0
|
228 |
* <programlisting>
|
sl@0
|
229 |
* @return_type callback (#gpointer data1,
|
sl@0
|
230 |
* [#param_types param_names,]
|
sl@0
|
231 |
* #gpointer data2);
|
sl@0
|
232 |
* </programlisting>
|
sl@0
|
233 |
*
|
sl@0
|
234 |
* A structure holding in-depth information for a specific signal. It is
|
sl@0
|
235 |
* filled in by the g_signal_query() function.
|
sl@0
|
236 |
*/
|
sl@0
|
237 |
struct _GSignalQuery
|
sl@0
|
238 |
{
|
sl@0
|
239 |
guint signal_id;
|
sl@0
|
240 |
const gchar *signal_name;
|
sl@0
|
241 |
GType itype;
|
sl@0
|
242 |
GSignalFlags signal_flags;
|
sl@0
|
243 |
GType return_type; /* mangled with G_SIGNAL_TYPE_STATIC_SCOPE flag */
|
sl@0
|
244 |
guint n_params;
|
sl@0
|
245 |
const GType *param_types; /* mangled with G_SIGNAL_TYPE_STATIC_SCOPE flag */
|
sl@0
|
246 |
};
|
sl@0
|
247 |
|
sl@0
|
248 |
|
sl@0
|
249 |
/* --- signals --- */
|
sl@0
|
250 |
IMPORT_C guint g_signal_newv (const gchar *signal_name,
|
sl@0
|
251 |
GType itype,
|
sl@0
|
252 |
GSignalFlags signal_flags,
|
sl@0
|
253 |
GClosure *class_closure,
|
sl@0
|
254 |
GSignalAccumulator accumulator,
|
sl@0
|
255 |
gpointer accu_data,
|
sl@0
|
256 |
GSignalCMarshaller c_marshaller,
|
sl@0
|
257 |
GType return_type,
|
sl@0
|
258 |
guint n_params,
|
sl@0
|
259 |
GType *param_types);
|
sl@0
|
260 |
IMPORT_C guint g_signal_new_valist (const gchar *signal_name,
|
sl@0
|
261 |
GType itype,
|
sl@0
|
262 |
GSignalFlags signal_flags,
|
sl@0
|
263 |
GClosure *class_closure,
|
sl@0
|
264 |
GSignalAccumulator accumulator,
|
sl@0
|
265 |
gpointer accu_data,
|
sl@0
|
266 |
GSignalCMarshaller c_marshaller,
|
sl@0
|
267 |
GType return_type,
|
sl@0
|
268 |
guint n_params,
|
sl@0
|
269 |
va_list args);
|
sl@0
|
270 |
IMPORT_C guint g_signal_new (const gchar *signal_name,
|
sl@0
|
271 |
GType itype,
|
sl@0
|
272 |
GSignalFlags signal_flags,
|
sl@0
|
273 |
guint class_offset,
|
sl@0
|
274 |
GSignalAccumulator accumulator,
|
sl@0
|
275 |
gpointer accu_data,
|
sl@0
|
276 |
GSignalCMarshaller c_marshaller,
|
sl@0
|
277 |
GType return_type,
|
sl@0
|
278 |
guint n_params,
|
sl@0
|
279 |
...);
|
sl@0
|
280 |
IMPORT_C guint g_signal_new_class_handler (const gchar *signal_name,
|
sl@0
|
281 |
GType itype,
|
sl@0
|
282 |
GSignalFlags signal_flags,
|
sl@0
|
283 |
GCallback class_handler,
|
sl@0
|
284 |
GSignalAccumulator accumulator,
|
sl@0
|
285 |
gpointer accu_data,
|
sl@0
|
286 |
GSignalCMarshaller c_marshaller,
|
sl@0
|
287 |
GType return_type,
|
sl@0
|
288 |
guint n_params,
|
sl@0
|
289 |
...);
|
sl@0
|
290 |
|
sl@0
|
291 |
IMPORT_C void g_signal_emitv (const GValue *instance_and_params,
|
sl@0
|
292 |
guint signal_id,
|
sl@0
|
293 |
GQuark detail,
|
sl@0
|
294 |
GValue *return_value);
|
sl@0
|
295 |
IMPORT_C void g_signal_emit_valist (gpointer instance,
|
sl@0
|
296 |
guint signal_id,
|
sl@0
|
297 |
GQuark detail,
|
sl@0
|
298 |
va_list var_args);
|
sl@0
|
299 |
IMPORT_C void g_signal_emit (gpointer instance,
|
sl@0
|
300 |
guint signal_id,
|
sl@0
|
301 |
GQuark detail,
|
sl@0
|
302 |
...);
|
sl@0
|
303 |
IMPORT_C void g_signal_emit_by_name (gpointer instance,
|
sl@0
|
304 |
const gchar *detailed_signal,
|
sl@0
|
305 |
...);
|
sl@0
|
306 |
IMPORT_C guint g_signal_lookup (const gchar *name,
|
sl@0
|
307 |
GType itype);
|
sl@0
|
308 |
IMPORT_C G_CONST_RETURN gchar* g_signal_name (guint signal_id);
|
sl@0
|
309 |
IMPORT_C void g_signal_query (guint signal_id,
|
sl@0
|
310 |
GSignalQuery *query);
|
sl@0
|
311 |
IMPORT_C guint* g_signal_list_ids (GType itype,
|
sl@0
|
312 |
guint *n_ids);
|
sl@0
|
313 |
IMPORT_C gboolean g_signal_parse_name (const gchar *detailed_signal,
|
sl@0
|
314 |
GType itype,
|
sl@0
|
315 |
guint *signal_id_p,
|
sl@0
|
316 |
GQuark *detail_p,
|
sl@0
|
317 |
gboolean force_detail_quark);
|
sl@0
|
318 |
IMPORT_C GSignalInvocationHint* g_signal_get_invocation_hint (gpointer instance);
|
sl@0
|
319 |
|
sl@0
|
320 |
|
sl@0
|
321 |
/* --- signal emissions --- */
|
sl@0
|
322 |
IMPORT_C void g_signal_stop_emission (gpointer instance,
|
sl@0
|
323 |
guint signal_id,
|
sl@0
|
324 |
GQuark detail);
|
sl@0
|
325 |
IMPORT_C void g_signal_stop_emission_by_name (gpointer instance,
|
sl@0
|
326 |
const gchar *detailed_signal);
|
sl@0
|
327 |
IMPORT_C gulong g_signal_add_emission_hook (guint signal_id,
|
sl@0
|
328 |
GQuark detail,
|
sl@0
|
329 |
GSignalEmissionHook hook_func,
|
sl@0
|
330 |
gpointer hook_data,
|
sl@0
|
331 |
GDestroyNotify data_destroy);
|
sl@0
|
332 |
IMPORT_C void g_signal_remove_emission_hook (guint signal_id,
|
sl@0
|
333 |
gulong hook_id);
|
sl@0
|
334 |
|
sl@0
|
335 |
|
sl@0
|
336 |
/* --- signal handlers --- */
|
sl@0
|
337 |
IMPORT_C gboolean g_signal_has_handler_pending (gpointer instance,
|
sl@0
|
338 |
guint signal_id,
|
sl@0
|
339 |
GQuark detail,
|
sl@0
|
340 |
gboolean may_be_blocked);
|
sl@0
|
341 |
IMPORT_C gulong g_signal_connect_closure_by_id (gpointer instance,
|
sl@0
|
342 |
guint signal_id,
|
sl@0
|
343 |
GQuark detail,
|
sl@0
|
344 |
GClosure *closure,
|
sl@0
|
345 |
gboolean after);
|
sl@0
|
346 |
IMPORT_C gulong g_signal_connect_closure (gpointer instance,
|
sl@0
|
347 |
const gchar *detailed_signal,
|
sl@0
|
348 |
GClosure *closure,
|
sl@0
|
349 |
gboolean after);
|
sl@0
|
350 |
IMPORT_C gulong g_signal_connect_data (gpointer instance,
|
sl@0
|
351 |
const gchar *detailed_signal,
|
sl@0
|
352 |
GCallback c_handler,
|
sl@0
|
353 |
gpointer data,
|
sl@0
|
354 |
GClosureNotify destroy_data,
|
sl@0
|
355 |
GConnectFlags connect_flags);
|
sl@0
|
356 |
IMPORT_C void g_signal_handler_block (gpointer instance,
|
sl@0
|
357 |
gulong handler_id);
|
sl@0
|
358 |
IMPORT_C void g_signal_handler_unblock (gpointer instance,
|
sl@0
|
359 |
gulong handler_id);
|
sl@0
|
360 |
IMPORT_C void g_signal_handler_disconnect (gpointer instance,
|
sl@0
|
361 |
gulong handler_id);
|
sl@0
|
362 |
IMPORT_C gboolean g_signal_handler_is_connected (gpointer instance,
|
sl@0
|
363 |
gulong handler_id);
|
sl@0
|
364 |
IMPORT_C gulong g_signal_handler_find (gpointer instance,
|
sl@0
|
365 |
GSignalMatchType mask,
|
sl@0
|
366 |
guint signal_id,
|
sl@0
|
367 |
GQuark detail,
|
sl@0
|
368 |
GClosure *closure,
|
sl@0
|
369 |
gpointer func,
|
sl@0
|
370 |
gpointer data);
|
sl@0
|
371 |
IMPORT_C guint g_signal_handlers_block_matched (gpointer instance,
|
sl@0
|
372 |
GSignalMatchType mask,
|
sl@0
|
373 |
guint signal_id,
|
sl@0
|
374 |
GQuark detail,
|
sl@0
|
375 |
GClosure *closure,
|
sl@0
|
376 |
gpointer func,
|
sl@0
|
377 |
gpointer data);
|
sl@0
|
378 |
IMPORT_C guint g_signal_handlers_unblock_matched (gpointer instance,
|
sl@0
|
379 |
GSignalMatchType mask,
|
sl@0
|
380 |
guint signal_id,
|
sl@0
|
381 |
GQuark detail,
|
sl@0
|
382 |
GClosure *closure,
|
sl@0
|
383 |
gpointer func,
|
sl@0
|
384 |
gpointer data);
|
sl@0
|
385 |
IMPORT_C guint g_signal_handlers_disconnect_matched (gpointer instance,
|
sl@0
|
386 |
GSignalMatchType mask,
|
sl@0
|
387 |
guint signal_id,
|
sl@0
|
388 |
GQuark detail,
|
sl@0
|
389 |
GClosure *closure,
|
sl@0
|
390 |
gpointer func,
|
sl@0
|
391 |
gpointer data);
|
sl@0
|
392 |
|
sl@0
|
393 |
|
sl@0
|
394 |
/* --- overriding and chaining --- */
|
sl@0
|
395 |
IMPORT_C void g_signal_override_class_closure (guint signal_id,
|
sl@0
|
396 |
GType instance_type,
|
sl@0
|
397 |
GClosure *class_closure);
|
sl@0
|
398 |
IMPORT_C void g_signal_override_class_handler (const gchar *signal_name,
|
sl@0
|
399 |
GType instance_type,
|
sl@0
|
400 |
GCallback class_handler);
|
sl@0
|
401 |
IMPORT_C void g_signal_chain_from_overridden (const GValue *instance_and_params,
|
sl@0
|
402 |
GValue *return_value);
|
sl@0
|
403 |
IMPORT_C void g_signal_chain_from_overridden_handler (gpointer instance,
|
sl@0
|
404 |
...);
|
sl@0
|
405 |
|
sl@0
|
406 |
|
sl@0
|
407 |
/* --- convenience --- */
|
sl@0
|
408 |
/**
|
sl@0
|
409 |
* g_signal_connect:
|
sl@0
|
410 |
* @instance: the instance to connect to.
|
sl@0
|
411 |
* @detailed_signal: a string of the form "signal-name::detail".
|
sl@0
|
412 |
* @c_handler: the #GCallback to connect.
|
sl@0
|
413 |
* @data: data to pass to @c_handler calls.
|
sl@0
|
414 |
*
|
sl@0
|
415 |
* Connects a #GCallback function to a signal for a particular object.
|
sl@0
|
416 |
*
|
sl@0
|
417 |
* The handler will be called before the default handler of the signal.
|
sl@0
|
418 |
*
|
sl@0
|
419 |
* Returns: the handler id
|
sl@0
|
420 |
*/
|
sl@0
|
421 |
#define g_signal_connect(instance, detailed_signal, c_handler, data) \
|
sl@0
|
422 |
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)
|
sl@0
|
423 |
/**
|
sl@0
|
424 |
* g_signal_connect_after:
|
sl@0
|
425 |
* @instance: the instance to connect to.
|
sl@0
|
426 |
* @detailed_signal: a string of the form "signal-name::detail".
|
sl@0
|
427 |
* @c_handler: the #GCallback to connect.
|
sl@0
|
428 |
* @data: data to pass to @c_handler calls.
|
sl@0
|
429 |
*
|
sl@0
|
430 |
* Connects a #GCallback function to a signal for a particular object.
|
sl@0
|
431 |
*
|
sl@0
|
432 |
* The handler will be called after the default handler of the signal.
|
sl@0
|
433 |
*
|
sl@0
|
434 |
* Returns: the handler id
|
sl@0
|
435 |
*/
|
sl@0
|
436 |
#define g_signal_connect_after(instance, detailed_signal, c_handler, data) \
|
sl@0
|
437 |
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)
|
sl@0
|
438 |
/**
|
sl@0
|
439 |
* g_signal_connect_swapped:
|
sl@0
|
440 |
* @instance: the instance to connect to.
|
sl@0
|
441 |
* @detailed_signal: a string of the form "signal-name::detail".
|
sl@0
|
442 |
* @c_handler: the #GCallback to connect.
|
sl@0
|
443 |
* @data: data to pass to @c_handler calls.
|
sl@0
|
444 |
*
|
sl@0
|
445 |
* Connects a #GCallback function to a signal for a particular object.
|
sl@0
|
446 |
*
|
sl@0
|
447 |
* The instance on which the signal is emitted and @data will be swapped when
|
sl@0
|
448 |
* calling the handler.
|
sl@0
|
449 |
*
|
sl@0
|
450 |
* Returns: the handler id
|
sl@0
|
451 |
*/
|
sl@0
|
452 |
#define g_signal_connect_swapped(instance, detailed_signal, c_handler, data) \
|
sl@0
|
453 |
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)
|
sl@0
|
454 |
/**
|
sl@0
|
455 |
* g_signal_handlers_disconnect_by_func:
|
sl@0
|
456 |
* @instance: The instance to remove handlers from.
|
sl@0
|
457 |
* @func: The C closure callback of the handlers (useless for non-C closures).
|
sl@0
|
458 |
* @data: The closure data of the handlers' closures.
|
sl@0
|
459 |
*
|
sl@0
|
460 |
* Disconnects all handlers on an instance that match @func and @data.
|
sl@0
|
461 |
*
|
sl@0
|
462 |
* Returns: The number of handlers that matched.
|
sl@0
|
463 |
*/
|
sl@0
|
464 |
#define g_signal_handlers_disconnect_by_func(instance, func, data) \
|
sl@0
|
465 |
g_signal_handlers_disconnect_matched ((instance), \
|
sl@0
|
466 |
(GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
|
sl@0
|
467 |
0, 0, NULL, (func), (data))
|
sl@0
|
468 |
/**
|
sl@0
|
469 |
* g_signal_handlers_block_by_func:
|
sl@0
|
470 |
* @instance: The instance to block handlers from.
|
sl@0
|
471 |
* @func: The C closure callback of the handlers (useless for non-C closures).
|
sl@0
|
472 |
* @data: The closure data of the handlers' closures.
|
sl@0
|
473 |
*
|
sl@0
|
474 |
* Blocks all handlers on an instance that match @func and @data.
|
sl@0
|
475 |
*
|
sl@0
|
476 |
* Returns: The number of handlers that matched.
|
sl@0
|
477 |
*/
|
sl@0
|
478 |
#define g_signal_handlers_block_by_func(instance, func, data) \
|
sl@0
|
479 |
g_signal_handlers_block_matched ((instance), \
|
sl@0
|
480 |
(GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
|
sl@0
|
481 |
0, 0, NULL, (func), (data))
|
sl@0
|
482 |
/**
|
sl@0
|
483 |
* g_signal_handlers_unblock_by_func:
|
sl@0
|
484 |
* @instance: The instance to unblock handlers from.
|
sl@0
|
485 |
* @func: The C closure callback of the handlers (useless for non-C closures).
|
sl@0
|
486 |
* @data: The closure data of the handlers' closures.
|
sl@0
|
487 |
*
|
sl@0
|
488 |
* Unblocks all handlers on an instance that match @func and @data.
|
sl@0
|
489 |
*
|
sl@0
|
490 |
* Returns: The number of handlers that matched.
|
sl@0
|
491 |
*/
|
sl@0
|
492 |
#define g_signal_handlers_unblock_by_func(instance, func, data) \
|
sl@0
|
493 |
g_signal_handlers_unblock_matched ((instance), \
|
sl@0
|
494 |
(GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
|
sl@0
|
495 |
0, 0, NULL, (func), (data))
|
sl@0
|
496 |
|
sl@0
|
497 |
|
sl@0
|
498 |
IMPORT_C gboolean g_signal_accumulator_true_handled (GSignalInvocationHint *ihint,
|
sl@0
|
499 |
GValue *return_accu,
|
sl@0
|
500 |
const GValue *handler_return,
|
sl@0
|
501 |
gpointer dummy);
|
sl@0
|
502 |
|
sl@0
|
503 |
/*< private >*/
|
sl@0
|
504 |
IMPORT_C void g_signal_handlers_destroy (gpointer instance);
|
sl@0
|
505 |
void _g_signals_destroy (GType itype);
|
sl@0
|
506 |
|
sl@0
|
507 |
G_END_DECLS
|
sl@0
|
508 |
|
sl@0
|
509 |
#endif /* __G_SIGNAL_H__ */
|