Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gsignal.h File Reference
#include <gobject/gclosure.h>
#include <gobject/gvalue.h>
#include <gobject/gparam.h>
#include <gobject/gmarshal.h>

Go to the source code of this file.

Data Structures

struct  _GSignalInvocationHint
 
struct  _GSignalQuery
 

Macros

#define G_SIGNAL_FLAGS_MASK   0x1ff
 
#define G_SIGNAL_MATCH_MASK   0x3f
 
#define G_SIGNAL_TYPE_STATIC_SCOPE   (G_TYPE_FLAG_RESERVED_ID_BIT)
 
#define g_clear_signal_handler(handler_id_ptr, instance)
 
#define g_signal_connect(instance, detailed_signal, c_handler, data)    g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)
 
#define g_signal_connect_after(instance, detailed_signal, c_handler, data)    g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)
 
#define g_signal_connect_swapped(instance, detailed_signal, c_handler, data)    g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)
 
#define g_signal_handlers_disconnect_by_func(instance, func, data)
 
#define g_signal_handlers_disconnect_by_data(instance, data)    g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (data))
 
#define g_signal_handlers_block_by_func(instance, func, data)
 
#define g_signal_handlers_unblock_by_func(instance, func, data)
 

Typedefs

typedef typedefG_BEGIN_DECLS struct _GSignalQuery GSignalQuery
 
typedef struct _GSignalInvocationHint GSignalInvocationHint
 
typedef GClosureMarshal GSignalCMarshaller
 
typedef GVaClosureMarshal GSignalCVaMarshaller
 
typedef gboolean(* GSignalEmissionHook) (GSignalInvocationHint *ihint, guint n_param_values, const GValue *param_values, gpointer data)
 
typedef gboolean(* GSignalAccumulator) (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer data)
 

Enumerations

enum  GSignalFlags {
  G_SIGNAL_RUN_FIRST = 1 << 0 , G_SIGNAL_RUN_LAST = 1 << 1 , G_SIGNAL_RUN_CLEANUP = 1 << 2 , G_SIGNAL_NO_RECURSE = 1 << 3 ,
  G_SIGNAL_DETAILED = 1 << 4 , G_SIGNAL_ACTION = 1 << 5 , G_SIGNAL_NO_HOOKS = 1 << 6 , G_SIGNAL_MUST_COLLECT = 1 << 7 ,
  G_SIGNAL_DEPRECATED = 1 << 8 , G_SIGNAL_ACCUMULATOR_FIRST_RUN = 1 << 17
}
 
enum  GConnectFlags { GOBJECT_AVAILABLE_ENUMERATOR_IN_2_74 = 0 , G_CONNECT_AFTER = 1 << 0 , G_CONNECT_SWAPPED = 1 << 1 }
 
enum  GSignalMatchType {
  G_SIGNAL_MATCH_ID = 1 << 0 , G_SIGNAL_MATCH_DETAIL = 1 << 1 , G_SIGNAL_MATCH_CLOSURE = 1 << 2 , G_SIGNAL_MATCH_FUNC = 1 << 3 ,
  G_SIGNAL_MATCH_DATA = 1 << 4 , G_SIGNAL_MATCH_UNBLOCKED = 1 << 5
}
 

Functions

GOBJECT_AVAILABLE_IN_ALL guint g_signal_newv (const gchar *signal_name, GType itype, GSignalFlags signal_flags, GClosure *class_closure, GSignalAccumulator accumulator, gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params, GType *param_types)
 
GOBJECT_AVAILABLE_IN_ALL guint g_signal_new_valist (const gchar *signal_name, GType itype, GSignalFlags signal_flags, GClosure *class_closure, GSignalAccumulator accumulator, gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params, va_list args)
 
GOBJECT_AVAILABLE_IN_ALL guint g_signal_new (const gchar *signal_name, GType itype, GSignalFlags signal_flags, guint class_offset, GSignalAccumulator accumulator, gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params,...)
 
GOBJECT_AVAILABLE_IN_ALL guint g_signal_new_class_handler (const gchar *signal_name, GType itype, GSignalFlags signal_flags, GCallback class_handler, GSignalAccumulator accumulator, gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params,...)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_set_va_marshaller (guint signal_id, GType instance_type, GSignalCVaMarshaller va_marshaller)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_emitv (const GValue *instance_and_params, guint signal_id, GQuark detail, GValue *return_value)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_emit_valist (gpointer instance, guint signal_id, GQuark detail, va_list var_args)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_emit (gpointer instance, guint signal_id, GQuark detail,...)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_emit_by_name (gpointer instance, const gchar *detailed_signal,...)
 
GOBJECT_AVAILABLE_IN_ALL guint g_signal_lookup (const gchar *name, GType itype)
 
GOBJECT_AVAILABLE_IN_ALL const gcharg_signal_name (guint signal_id)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_query (guint signal_id, GSignalQuery *query)
 
GOBJECT_AVAILABLE_IN_ALL guintg_signal_list_ids (GType itype, guint *n_ids)
 
GOBJECT_AVAILABLE_IN_2_66 gboolean g_signal_is_valid_name (const gchar *name)
 
GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_parse_name (const gchar *detailed_signal, GType itype, guint *signal_id_p, GQuark *detail_p, gboolean force_detail_quark)
 
GOBJECT_AVAILABLE_IN_ALL GSignalInvocationHintg_signal_get_invocation_hint (gpointer instance)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_stop_emission (gpointer instance, guint signal_id, GQuark detail)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_stop_emission_by_name (gpointer instance, const gchar *detailed_signal)
 
GOBJECT_AVAILABLE_IN_ALL gulong g_signal_add_emission_hook (guint signal_id, GQuark detail, GSignalEmissionHook hook_func, gpointer hook_data, GDestroyNotify data_destroy)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_remove_emission_hook (guint signal_id, gulong hook_id)
 
GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_has_handler_pending (gpointer instance, guint signal_id, GQuark detail, gboolean may_be_blocked)
 
GOBJECT_AVAILABLE_IN_ALL gulong g_signal_connect_closure_by_id (gpointer instance, guint signal_id, GQuark detail, GClosure *closure, gboolean after)
 
GOBJECT_AVAILABLE_IN_ALL gulong g_signal_connect_closure (gpointer instance, const gchar *detailed_signal, GClosure *closure, gboolean after)
 
GOBJECT_AVAILABLE_IN_ALL gulong g_signal_connect_data (gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data, GClosureNotify destroy_data, GConnectFlags connect_flags)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_handler_block (gpointer instance, gulong handler_id)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_handler_unblock (gpointer instance, gulong handler_id)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_handler_disconnect (gpointer instance, gulong handler_id)
 
GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_handler_is_connected (gpointer instance, gulong handler_id)
 
GOBJECT_AVAILABLE_IN_ALL gulong g_signal_handler_find (gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data)
 
GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_block_matched (gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data)
 
GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_unblock_matched (gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data)
 
GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_disconnect_matched (gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data)
 
GOBJECT_AVAILABLE_IN_2_62 void g_clear_signal_handler (gulong *handler_id_ptr, gpointer instance)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_override_class_closure (guint signal_id, GType instance_type, GClosure *class_closure)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_override_class_handler (const gchar *signal_name, GType instance_type, GCallback class_handler)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_chain_from_overridden (const GValue *instance_and_params, GValue *return_value)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_chain_from_overridden_handler (gpointer instance,...)
 
GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_accumulator_true_handled (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy)
 
GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_accumulator_first_wins (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy)
 
GOBJECT_AVAILABLE_IN_ALL void g_signal_handlers_destroy (gpointer instance)
 
void _g_signals_destroy (GType itype)
 

Macro Definition Documentation

◆ g_clear_signal_handler

#define g_clear_signal_handler ( handler_id_ptr,
instance )
Value:
gpointer const _instance = (instance); \
gulong *const _handler_id_ptr = (handler_id_ptr); \
const gulong _handler_id = *_handler_id_ptr; \
\
if (_handler_id > 0) \
{ \
*_handler_id_ptr = 0; \
g_signal_handler_disconnect (_instance, _handler_id); \
} \
} G_STMT_END \
GOBJECT_AVAILABLE_MACRO_IN_2_62
#define G_STMT_START
Definition gmacros.h:989
unsigned long gulong
Definition gtypes.h:60
void * gpointer
Definition gtypes.h:109

Definition at line 464 of file gsignal.h.

464#define g_clear_signal_handler(handler_id_ptr, instance) \
465 G_STMT_START { \
466 gpointer const _instance = (instance); \
467 gulong *const _handler_id_ptr = (handler_id_ptr); \
468 const gulong _handler_id = *_handler_id_ptr; \
469 \
470 if (_handler_id > 0) \
471 { \
472 *_handler_id_ptr = 0; \
473 g_signal_handler_disconnect (_instance, _handler_id); \
474 } \
475 } G_STMT_END \
476 GOBJECT_AVAILABLE_MACRO_IN_2_62

◆ g_signal_connect

#define g_signal_connect ( instance,
detailed_signal,
c_handler,
data )    g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)

g_signal_connect: @instance: the instance to connect to. @detailed_signal: a string of the form "signal-name::detail". @c_handler: the GCallback to connect. @data: data to pass to @c_handler calls.

Connects a [type@.nosp@m.GObj.nosp@m.ect.C.nosp@m.allb.nosp@m.ack] function to a signal for a particular object.

The handler will be called synchronously, before the default handler of the signal. [func@.nosp@m.GObj.nosp@m.ect.s.nosp@m.igna.nosp@m.l_emi.nosp@m.t] will not return control until all handlers are called.

See memory management of signal handlers for details on how to handle the return value and memory management of @data.

This function cannot fail. If the given signal doesn’t exist, a critical warning is emitted.

Returns: the handler ID, of type gulong (always greater than 0)

Definition at line 518 of file gsignal.h.

518#define g_signal_connect(instance, detailed_signal, c_handler, data) \
519 g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)

Referenced by activate(), and main().

◆ g_signal_connect_after

#define g_signal_connect_after ( instance,
detailed_signal,
c_handler,
data )    g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)

g_signal_connect_after: @instance: the instance to connect to. @detailed_signal: a string of the form "signal-name::detail". @c_handler: the GCallback to connect. @data: data to pass to @c_handler calls.

Connects a GCallback function to a signal for a particular object.

The handler will be called synchronously, after the default handler of the signal.

This function cannot fail. If the given signal doesn’t exist, a critical warning is emitted.

Returns: the handler ID, of type gulong (always greater than 0)

Definition at line 536 of file gsignal.h.

536#define g_signal_connect_after(instance, detailed_signal, c_handler, data) \
537 g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)

◆ g_signal_connect_swapped

#define g_signal_connect_swapped ( instance,
detailed_signal,
c_handler,
data )    g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)

g_signal_connect_swapped: @instance: the instance to connect to. @detailed_signal: a string of the form "signal-name::detail". @c_handler: the GCallback to connect. @data: data to pass to @c_handler calls.

Connects a GCallback function to a signal for a particular object.

The instance on which the signal is emitted and @data will be swapped when calling the handler. This is useful when calling pre-existing functions to operate purely on the @data, rather than the @instance: swapping the parameters avoids the need to write a wrapper function.

For example, this allows the shorter code: |[ g_signal_connect_swapped (button, "clicked", (GCallback) gtk_widget_hide, other_widget); ]|

Rather than the cumbersome: |[ static void button_clicked_cb (GtkButton *button, GtkWidget *other_widget) { gtk_widget_hide (other_widget); }

...

g_signal_connect (button, "clicked", (GCallback) button_clicked_cb, other_widget); ]|

This function cannot fail. If the given signal doesn’t exist, a critical warning is emitted.

Returns: the handler ID, of type gulong (always greater than 0)

Definition at line 577 of file gsignal.h.

577#define g_signal_connect_swapped(instance, detailed_signal, c_handler, data) \
578 g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)

◆ G_SIGNAL_FLAGS_MASK

#define G_SIGNAL_FLAGS_MASK   0x1ff

G_SIGNAL_FLAGS_MASK:

A mask for all GSignalFlags bits.

Definition at line 157 of file gsignal.h.

◆ g_signal_handlers_block_by_func

#define g_signal_handlers_block_by_func ( instance,
func,
data )
Value:
0, 0, NULL, (func), (data))
#define NULL
Definition gmacros.h:924
GSignalMatchType
Definition gsignal.h:190
@ G_SIGNAL_MATCH_DATA
Definition gsignal.h:195
@ G_SIGNAL_MATCH_FUNC
Definition gsignal.h:194
GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_block_matched(gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data)

g_signal_handlers_block_by_func: @instance: The instance to block handlers from. @func: The C closure callback of the handlers (useless for non-C closures). @data: The closure data of the handlers' closures.

Blocks all handlers on an instance that match @func and @data.

Returns: The number of handlers that matched.

Definition at line 618 of file gsignal.h.

618#define g_signal_handlers_block_by_func(instance, func, data) \
619 g_signal_handlers_block_matched ((instance), \
620 (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
621 0, 0, NULL, (func), (data))

◆ g_signal_handlers_disconnect_by_data

#define g_signal_handlers_disconnect_by_data ( instance,
data )    g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (data))

g_signal_handlers_disconnect_by_data: @instance: The instance to remove handlers from @data: the closure data of the handlers' closures

Disconnects all handlers on an instance that match @data.

Returns: The number of handlers that matched.

Since: 2.32

Definition at line 605 of file gsignal.h.

605#define g_signal_handlers_disconnect_by_data(instance, data) \
606 g_signal_handlers_disconnect_matched ((instance), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (data))

◆ g_signal_handlers_disconnect_by_func

#define g_signal_handlers_disconnect_by_func ( instance,
func,
data )
Value:
0, 0, NULL, (func), (data))
GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_disconnect_matched(gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data)

g_signal_handlers_disconnect_by_func: @instance: The instance to remove handlers from. @func: The C closure callback of the handlers (useless for non-C closures). @data: The closure data of the handlers' closures.

Disconnects all handlers on an instance that match @func and @data.

Returns: The number of handlers that matched.

Definition at line 589 of file gsignal.h.

589#define g_signal_handlers_disconnect_by_func(instance, func, data) \
590 g_signal_handlers_disconnect_matched ((instance), \
591 (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
592 0, 0, NULL, (func), (data))

◆ g_signal_handlers_unblock_by_func

#define g_signal_handlers_unblock_by_func ( instance,
func,
data )
Value:
0, 0, NULL, (func), (data))
GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_unblock_matched(gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data)

g_signal_handlers_unblock_by_func: @instance: The instance to unblock handlers from. @func: The C closure callback of the handlers (useless for non-C closures). @data: The closure data of the handlers' closures.

Unblocks all handlers on an instance that match @func and @data.

Returns: The number of handlers that matched.

Definition at line 632 of file gsignal.h.

632#define g_signal_handlers_unblock_by_func(instance, func, data) \
633 g_signal_handlers_unblock_matched ((instance), \
634 (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), \
635 0, 0, NULL, (func), (data))

◆ G_SIGNAL_MATCH_MASK

#define G_SIGNAL_MATCH_MASK   0x3f

G_SIGNAL_MATCH_MASK:

A mask for all GSignalMatchType bits.

Definition at line 203 of file gsignal.h.

◆ G_SIGNAL_TYPE_STATIC_SCOPE

#define G_SIGNAL_TYPE_STATIC_SCOPE   (G_TYPE_FLAG_RESERVED_ID_BIT)

G_SIGNAL_TYPE_STATIC_SCOPE:

This macro flags signal argument types for which the signal system may assume that instances thereof remain persistent across all signal emissions they are used in. This is only useful for non ref-counted, value-copy types.

To flag a signal argument in this way, add | G_SIGNAL_TYPE_STATIC_SCOPE to the corresponding argument of g_signal_new(). |[ g_signal_new ("size_request", G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GtkWidgetClass, size_request), NULL, NULL, _gtk_marshal_VOID__BOXED, G_TYPE_NONE, 1, GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE); ]|

Definition at line 224 of file gsignal.h.

Typedef Documentation

◆ GSignalAccumulator

typedef gboolean(* GSignalAccumulator) (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer data)

GSignalAccumulator: @ihint: Signal invocation hint, see GSignalInvocationHint. @return_accu: Accumulator to collect callback return values in, this is the return value of the current signal emission. @handler_return: A GValue holding the return value of the signal handler. @data: Callback data that was specified when creating the signal.

The signal accumulator is a special callback function that can be used to collect return values of the various callbacks that are called during a signal emission.

The signal accumulator is specified at signal creation time, if it is left NULL, no accumulation of callback return values is performed. The return value of signal emissions is then the value returned by the last callback.

Returns: The accumulator function returns whether the signal emission should be aborted. Returning TRUE will continue with the signal emission. Returning FALSE will abort the current emission. Since 2.62, returning FALSE will skip to the CLEANUP stage. In this case, emission will occur as normal in the CLEANUP stage and the handler's return value will be accumulated.

Definition at line 103 of file gsignal.h.

◆ GSignalCMarshaller

GSignalCMarshaller:

This is the signature of marshaller functions, required to marshall arrays of parameter values to signal emissions into C language callback invocations.

It is merely an alias to GClosureMarshal since the GClosure mechanism takes over responsibility of actual function invocation for the signal system.

Definition at line 47 of file gsignal.h.

◆ GSignalCVaMarshaller

GSignalCVaMarshaller:

This is the signature of va_list marshaller functions, an optional marshaller that can be used in some situations to avoid marshalling the signal argument into GValues.

Definition at line 55 of file gsignal.h.

◆ GSignalEmissionHook

typedef gboolean(* GSignalEmissionHook) (GSignalInvocationHint *ihint, guint n_param_values, const GValue *param_values, gpointer data)

GSignalEmissionHook: @ihint: Signal invocation hint, see GSignalInvocationHint. @n_param_values: the number of parameters to the function, including the instance on which the signal was emitted. @param_values: (array length=n_param_values): the instance on which the signal was emitted, followed by the parameters of the emission. @data: user data associated with the hook.

A simple function pointer to get invoked when the signal is emitted.

Emission hooks allow you to tie a hook to the signal type, so that it will trap all emissions of that signal, from any object.

You may not attach these to signals created with the G_SIGNAL_NO_HOOKS flag.

Returns: whether it wants to stay connected. If it returns FALSE, the signal hook is disconnected (and destroyed).

Definition at line 75 of file gsignal.h.

◆ GSignalInvocationHint

Definition at line 35 of file gsignal.h.

◆ GSignalQuery

typedef typedefG_BEGIN_DECLS struct _GSignalQuery GSignalQuery

Definition at line 34 of file gsignal.h.

Enumeration Type Documentation

◆ GConnectFlags

GConnectFlags: @G_CONNECT_DEFAULT: Default behaviour (no special flags). Since: 2.74 @G_CONNECT_AFTER: If set, the handler should be called after the default handler of the signal. Normally, the handler is called before the default handler. @G_CONNECT_SWAPPED: If set, the instance and data should be swapped when calling the handler; see g_signal_connect_swapped() for an example.

The connection flags are used to specify the behaviour of a signal's connection.

Enumerator
GOBJECT_AVAILABLE_ENUMERATOR_IN_2_74 
G_CONNECT_AFTER 
G_CONNECT_SWAPPED 

Definition at line 170 of file gsignal.h.

171{
172 G_CONNECT_DEFAULT GOBJECT_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
173 G_CONNECT_AFTER = 1 << 0,
174 G_CONNECT_SWAPPED = 1 << 1
GConnectFlags
Definition gsignal.h:171
@ G_CONNECT_AFTER
Definition gsignal.h:173
@ G_CONNECT_SWAPPED
Definition gsignal.h:174
@ GOBJECT_AVAILABLE_ENUMERATOR_IN_2_74
Definition gsignal.h:172

◆ GSignalFlags

GSignalFlags: @G_SIGNAL_RUN_FIRST: Invoke the object method handler in the first emission stage. @G_SIGNAL_RUN_LAST: Invoke the object method handler in the third emission stage. @G_SIGNAL_RUN_CLEANUP: Invoke the object method handler in the last emission stage. @G_SIGNAL_NO_RECURSE: Signals being emitted for an object while currently being in emission for this very object will not be emitted recursively, but instead cause the first emission to be restarted. @G_SIGNAL_DETAILED: This signal supports "::detail" appendices to the signal name upon handler connections and emissions. @G_SIGNAL_ACTION: Action signals are signals that may freely be emitted on alive objects from user code via g_signal_emit() and friends, without the need of being embedded into extra code that performs pre or post emission adjustments on the object. They can also be thought of as object methods which can be called generically by third-party code. @G_SIGNAL_NO_HOOKS: No emissions hooks are supported for this signal. @G_SIGNAL_MUST_COLLECT: Varargs signal emission will always collect the arguments, even if there are no signal handlers connected. Since 2.30. @G_SIGNAL_DEPRECATED: The signal is deprecated and will be removed in a future version. A warning will be generated if it is connected while running with G_ENABLE_DIAGNOSTIC=1. Since 2.32. @G_SIGNAL_ACCUMULATOR_FIRST_RUN: Only used in GSignalAccumulator accumulator functions for the GSignalInvocationHint::run_type field to mark the first call to the accumulator function for a signal emission. Since 2.68.

The signal flags are used to specify a signal's behaviour.

Enumerator
G_SIGNAL_RUN_FIRST 
G_SIGNAL_RUN_LAST 
G_SIGNAL_RUN_CLEANUP 
G_SIGNAL_NO_RECURSE 
G_SIGNAL_DETAILED 
G_SIGNAL_ACTION 
G_SIGNAL_NO_HOOKS 
G_SIGNAL_MUST_COLLECT 
G_SIGNAL_DEPRECATED 
G_SIGNAL_ACCUMULATOR_FIRST_RUN 

Definition at line 138 of file gsignal.h.

139{
140 G_SIGNAL_RUN_FIRST = 1 << 0,
141 G_SIGNAL_RUN_LAST = 1 << 1,
142 G_SIGNAL_RUN_CLEANUP = 1 << 2,
143 G_SIGNAL_NO_RECURSE = 1 << 3,
144 G_SIGNAL_DETAILED = 1 << 4,
145 G_SIGNAL_ACTION = 1 << 5,
146 G_SIGNAL_NO_HOOKS = 1 << 6,
147 G_SIGNAL_MUST_COLLECT = 1 << 7,
148 G_SIGNAL_DEPRECATED = 1 << 8,
149 /* normal signal flags until 1 << 16 */
GSignalFlags
Definition gsignal.h:139
@ G_SIGNAL_NO_HOOKS
Definition gsignal.h:146
@ G_SIGNAL_MUST_COLLECT
Definition gsignal.h:147
@ G_SIGNAL_RUN_FIRST
Definition gsignal.h:140
@ G_SIGNAL_ACCUMULATOR_FIRST_RUN
Definition gsignal.h:150
@ G_SIGNAL_RUN_LAST
Definition gsignal.h:141
@ G_SIGNAL_NO_RECURSE
Definition gsignal.h:143
@ G_SIGNAL_DEPRECATED
Definition gsignal.h:148
@ G_SIGNAL_ACTION
Definition gsignal.h:145
@ G_SIGNAL_DETAILED
Definition gsignal.h:144
@ G_SIGNAL_RUN_CLEANUP
Definition gsignal.h:142

◆ GSignalMatchType

GSignalMatchType: @G_SIGNAL_MATCH_ID: The signal id must be equal. @G_SIGNAL_MATCH_DETAIL: The signal detail must be equal. @G_SIGNAL_MATCH_CLOSURE: The closure must be the same. @G_SIGNAL_MATCH_FUNC: The C closure callback must be the same. @G_SIGNAL_MATCH_DATA: The closure data must be the same. @G_SIGNAL_MATCH_UNBLOCKED: Only unblocked signals may be matched.

The match types specify what g_signal_handlers_block_matched(), g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched() match signals by.

Enumerator
G_SIGNAL_MATCH_ID 
G_SIGNAL_MATCH_DETAIL 
G_SIGNAL_MATCH_CLOSURE 
G_SIGNAL_MATCH_FUNC 
G_SIGNAL_MATCH_DATA 
G_SIGNAL_MATCH_UNBLOCKED 

Definition at line 189 of file gsignal.h.

190{
191 G_SIGNAL_MATCH_ID = 1 << 0,
192 G_SIGNAL_MATCH_DETAIL = 1 << 1,
193 G_SIGNAL_MATCH_CLOSURE = 1 << 2,
194 G_SIGNAL_MATCH_FUNC = 1 << 3,
195 G_SIGNAL_MATCH_DATA = 1 << 4,
@ G_SIGNAL_MATCH_DETAIL
Definition gsignal.h:192
@ G_SIGNAL_MATCH_UNBLOCKED
Definition gsignal.h:196
@ G_SIGNAL_MATCH_ID
Definition gsignal.h:191
@ G_SIGNAL_MATCH_CLOSURE
Definition gsignal.h:193

Function Documentation

◆ _g_signals_destroy()

void _g_signals_destroy ( GType itype)

◆ g_clear_signal_handler()

GOBJECT_AVAILABLE_IN_2_62 void g_clear_signal_handler ( gulong * handler_id_ptr,
gpointer instance )

◆ g_signal_accumulator_first_wins()

GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_accumulator_first_wins ( GSignalInvocationHint * ihint,
GValue * return_accu,
const GValue * handler_return,
gpointer dummy )

◆ g_signal_accumulator_true_handled()

GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_accumulator_true_handled ( GSignalInvocationHint * ihint,
GValue * return_accu,
const GValue * handler_return,
gpointer dummy )

◆ g_signal_add_emission_hook()

GOBJECT_AVAILABLE_IN_ALL gulong g_signal_add_emission_hook ( guint signal_id,
GQuark detail,
GSignalEmissionHook hook_func,
gpointer hook_data,
GDestroyNotify data_destroy )

◆ g_signal_chain_from_overridden()

GOBJECT_AVAILABLE_IN_ALL void g_signal_chain_from_overridden ( const GValue * instance_and_params,
GValue * return_value )

◆ g_signal_chain_from_overridden_handler()

GOBJECT_AVAILABLE_IN_ALL void g_signal_chain_from_overridden_handler ( gpointer instance,
... )

◆ g_signal_connect_closure()

GOBJECT_AVAILABLE_IN_ALL gulong g_signal_connect_closure ( gpointer instance,
const gchar * detailed_signal,
GClosure * closure,
gboolean after )

◆ g_signal_connect_closure_by_id()

GOBJECT_AVAILABLE_IN_ALL gulong g_signal_connect_closure_by_id ( gpointer instance,
guint signal_id,
GQuark detail,
GClosure * closure,
gboolean after )

◆ g_signal_connect_data()

GOBJECT_AVAILABLE_IN_ALL gulong g_signal_connect_data ( gpointer instance,
const gchar * detailed_signal,
GCallback c_handler,
gpointer data,
GClosureNotify destroy_data,
GConnectFlags connect_flags )

◆ g_signal_emit()

GOBJECT_AVAILABLE_IN_ALL void g_signal_emit ( gpointer instance,
guint signal_id,
GQuark detail,
... )

◆ g_signal_emit_by_name()

GOBJECT_AVAILABLE_IN_ALL void g_signal_emit_by_name ( gpointer instance,
const gchar * detailed_signal,
... )

◆ g_signal_emit_valist()

GOBJECT_AVAILABLE_IN_ALL void g_signal_emit_valist ( gpointer instance,
guint signal_id,
GQuark detail,
va_list var_args )

◆ g_signal_emitv()

GOBJECT_AVAILABLE_IN_ALL void g_signal_emitv ( const GValue * instance_and_params,
guint signal_id,
GQuark detail,
GValue * return_value )

◆ g_signal_get_invocation_hint()

GOBJECT_AVAILABLE_IN_ALL GSignalInvocationHint * g_signal_get_invocation_hint ( gpointer instance)

◆ g_signal_handler_block()

GOBJECT_AVAILABLE_IN_ALL void g_signal_handler_block ( gpointer instance,
gulong handler_id )

◆ g_signal_handler_disconnect()

GOBJECT_AVAILABLE_IN_ALL void g_signal_handler_disconnect ( gpointer instance,
gulong handler_id )

◆ g_signal_handler_find()

GOBJECT_AVAILABLE_IN_ALL gulong g_signal_handler_find ( gpointer instance,
GSignalMatchType mask,
guint signal_id,
GQuark detail,
GClosure * closure,
gpointer func,
gpointer data )

◆ g_signal_handler_is_connected()

GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_handler_is_connected ( gpointer instance,
gulong handler_id )

◆ g_signal_handler_unblock()

GOBJECT_AVAILABLE_IN_ALL void g_signal_handler_unblock ( gpointer instance,
gulong handler_id )

◆ g_signal_handlers_block_matched()

GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_block_matched ( gpointer instance,
GSignalMatchType mask,
guint signal_id,
GQuark detail,
GClosure * closure,
gpointer func,
gpointer data )

◆ g_signal_handlers_destroy()

GOBJECT_AVAILABLE_IN_ALL void g_signal_handlers_destroy ( gpointer instance)

◆ g_signal_handlers_disconnect_matched()

GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_disconnect_matched ( gpointer instance,
GSignalMatchType mask,
guint signal_id,
GQuark detail,
GClosure * closure,
gpointer func,
gpointer data )

◆ g_signal_handlers_unblock_matched()

GOBJECT_AVAILABLE_IN_ALL guint g_signal_handlers_unblock_matched ( gpointer instance,
GSignalMatchType mask,
guint signal_id,
GQuark detail,
GClosure * closure,
gpointer func,
gpointer data )

◆ g_signal_has_handler_pending()

GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_has_handler_pending ( gpointer instance,
guint signal_id,
GQuark detail,
gboolean may_be_blocked )

◆ g_signal_is_valid_name()

GOBJECT_AVAILABLE_IN_2_66 gboolean g_signal_is_valid_name ( const gchar * name)

◆ g_signal_list_ids()

GOBJECT_AVAILABLE_IN_ALL guint * g_signal_list_ids ( GType itype,
guint * n_ids )

◆ g_signal_lookup()

GOBJECT_AVAILABLE_IN_ALL guint g_signal_lookup ( const gchar * name,
GType itype )

◆ g_signal_name()

GOBJECT_AVAILABLE_IN_ALL const gchar * g_signal_name ( guint signal_id)

◆ g_signal_new()

GOBJECT_AVAILABLE_IN_ALL guint g_signal_new ( const gchar * signal_name,
GType itype,
GSignalFlags signal_flags,
guint class_offset,
GSignalAccumulator accumulator,
gpointer accu_data,
GSignalCMarshaller c_marshaller,
GType return_type,
guint n_params,
... )

◆ g_signal_new_class_handler()

GOBJECT_AVAILABLE_IN_ALL guint g_signal_new_class_handler ( const gchar * signal_name,
GType itype,
GSignalFlags signal_flags,
GCallback class_handler,
GSignalAccumulator accumulator,
gpointer accu_data,
GSignalCMarshaller c_marshaller,
GType return_type,
guint n_params,
... )

◆ g_signal_new_valist()

GOBJECT_AVAILABLE_IN_ALL guint g_signal_new_valist ( const gchar * signal_name,
GType itype,
GSignalFlags signal_flags,
GClosure * class_closure,
GSignalAccumulator accumulator,
gpointer accu_data,
GSignalCMarshaller c_marshaller,
GType return_type,
guint n_params,
va_list args )

◆ g_signal_newv()

GOBJECT_AVAILABLE_IN_ALL guint g_signal_newv ( const gchar * signal_name,
GType itype,
GSignalFlags signal_flags,
GClosure * class_closure,
GSignalAccumulator accumulator,
gpointer accu_data,
GSignalCMarshaller c_marshaller,
GType return_type,
guint n_params,
GType * param_types )

◆ g_signal_override_class_closure()

GOBJECT_AVAILABLE_IN_ALL void g_signal_override_class_closure ( guint signal_id,
GType instance_type,
GClosure * class_closure )

◆ g_signal_override_class_handler()

GOBJECT_AVAILABLE_IN_ALL void g_signal_override_class_handler ( const gchar * signal_name,
GType instance_type,
GCallback class_handler )

◆ g_signal_parse_name()

GOBJECT_AVAILABLE_IN_ALL gboolean g_signal_parse_name ( const gchar * detailed_signal,
GType itype,
guint * signal_id_p,
GQuark * detail_p,
gboolean force_detail_quark )

◆ g_signal_query()

GOBJECT_AVAILABLE_IN_ALL void g_signal_query ( guint signal_id,
GSignalQuery * query )

◆ g_signal_remove_emission_hook()

GOBJECT_AVAILABLE_IN_ALL void g_signal_remove_emission_hook ( guint signal_id,
gulong hook_id )

◆ g_signal_set_va_marshaller()

GOBJECT_AVAILABLE_IN_ALL void g_signal_set_va_marshaller ( guint signal_id,
GType instance_type,
GSignalCVaMarshaller va_marshaller )

◆ g_signal_stop_emission()

GOBJECT_AVAILABLE_IN_ALL void g_signal_stop_emission ( gpointer instance,
guint signal_id,
GQuark detail )

◆ g_signal_stop_emission_by_name()

GOBJECT_AVAILABLE_IN_ALL void g_signal_stop_emission_by_name ( gpointer instance,
const gchar * detailed_signal )