|
libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
Go to the source code of this file.
Macros | |
| #define | GblSignal_connect(...) |
DSL Macros | |
Helper macros for declaring and managing signals. | |
| #define | GBL_SIGNALS(instanceStruct, ...) |
| #define | GBL_SIGNALS_REGISTER(instanceStruct, ...) |
| #define | GBL_EMIT(emitter, ...) |
| #define | GBL_CONNECT(...) |
Functions | |
Installing | |
Methods for installing and uninstalling signals from a GblType. | |
| GBL_RESULT | GblSignal_install (GblType instanceType, const char *pName, GblMarshalFn pFnCMarshal, size_t argCount,...) |
| GBL_RESULT | GblSignal_uninstall (GblType instanceType, const char *pName) |
| GBL_RESULT | GblSignal_uninstallAll (GblType instanceType) |
Connecting | |
Methods for connecting/disconnecting signals and closures. | |
| GBL_RESULT | GblSignal_connect (GblInstance *pEmitter, const char *pSignalName, GblInstance *pReceiver, GblFnPtr pFnCCallback, void *pUserdata) |
| GBL_RESULT | GblSignal_connectClass (GblInstance *pEmitter, const char *pSignalName, GblInstance *pReceiver, GblType classType, size_t methodOffset) |
| GBL_RESULT | GblSignal_connectSignal (GblInstance *pEmitter, const char *pSignalName, GblInstance *pDstEmitter, const char *pDstSignalName) |
| GBL_RESULT | GblSignal_connectClosure (GblInstance *pEmitter, const char *pSignalName, GblInstance *pReceiver, GblClosure *pClosure) |
| size_t | GblSignal_disconnect (GblInstance *pEmitter, const char *pSignalName, GblInstance *pReceiver, GblClosure *pClosure) |
Blocking | |
Routines for temporarily disabling and enabling signal emission. | |
| GblBool | GblSignal_block (GblInstance *pInstance, const char *pSignalName, GblBool blocked) |
| GblBool | GblSignal_blockAll (GblInstance *pInstance, GblBool blocked) |
| GblBool | GblSignal_blocked (GblInstance *pInstance, const char *pSignalName) |
Emitting | |
Routines for firing signals to associated closures. | |
| GBL_RESULT | GblSignal_emit (GblInstance *pEmitter, const char *pSignalName,...) |
| GBL_RESULT | GblSignal_emitVaList (GblInstance *pEmitter, const char *pSignalName, va_list *pVarArgs) |
| GBL_RESULT | GblSignal_emitVariants (GblInstance *pEmitter, const char *pSignalName, GblVariant *pArgs) |
Querying | |
Routines for retrieving signal state information. | |
| size_t | GblSignal_connectionCount (GblInstance *pInstance, const char *pSignalName) |
| GblInstance * | GblSignal_emitter (void) |
| GblInstance * | GblSignal_receiver (void) |
Signals, connections, and related API.
This file contains the routines used for creating, managing, and emitting signals. For detailed information on how to use signals, refer to the Signals overview.
Definition in file gimbal_signal.h.
| #define GBL_SIGNALS | ( | instanceStruct, | |
| ... ) |
Declares a list of signals to be associated with the given instanceStruct.
Definition at line 30 of file gimbal_signal.h.
| #define GBL_SIGNALS_REGISTER | ( | instanceStruct, | |
| ... ) |
Registers the list of signals which has been associated with the given instanceStruct.
Definition at line 32 of file gimbal_signal.h.
| #define GBL_EMIT | ( | emitter, | |
| ... ) |
Emits a signal from the given emitter with the given name and arguments.
Definition at line 34 of file gimbal_signal.h.
| #define GBL_CONNECT | ( | ... | ) |
Connects the signal with the given name from the given emitter to a receiver with the given callback function and optional userdata.
Definition at line 36 of file gimbal_signal.h.
| #define GblSignal_connect | ( | ... | ) |
Definition at line 232 of file gimbal_signal.h.
| GBL_RESULT GblSignal_install | ( | GblType | instanceType, |
| const char * | pName, | ||
| GblMarshalFn | pFnCMarshal, | ||
| size_t | argCount, | ||
| ... ) |
Installs a named signal onto the given type, taking a number of arguments and an associated list of GblTypes representing each, along with a marshal which can handle forwarding such an invocation to a C callback function.
| GBL_RESULT GblSignal_uninstall | ( | GblType | instanceType, |
| const char * | pName ) |
Uninstalls the signal with the given name which was previously installed onto the given instanceType.
| GBL_RESULT GblSignal_uninstallAll | ( | GblType | instanceType | ) |
Uninstalls all signals which have been installed onto the associated instanceType.
| GBL_RESULT GblSignal_connect | ( | GblInstance * | pEmitter, |
| const char * | pSignalName, | ||
| GblInstance * | pReceiver, | ||
| GblFnPtr | pFnCCallback, | ||
| void * | pUserdata ) |
Connects the given C callback function, pFnCCallback, to the given pSignalName, which is emitted from the given pEmitter. pUserdata gets added to the associated closure and can be retrieved from within the callback with GblClosure_currentUserdata().
| GBL_RESULT GblSignal_connectClass | ( | GblInstance * | pEmitter, |
| const char * | pSignalName, | ||
| GblInstance * | pReceiver, | ||
| GblType | classType, | ||
| size_t | methodOffset ) |
Forwards the signal, pSignalName on pEmitter, to the virtual function at methodOffset located on the GblClass structure on classType.
| GBL_RESULT GblSignal_connectSignal | ( | GblInstance * | pEmitter, |
| const char * | pSignalName, | ||
| GblInstance * | pDstEmitter, | ||
| const char * | pDstSignalName ) |
Creates a forwarding signal by reemitting the pSignalName coming from pEmitter as pDstSignalName coming from pDstEmitter.
| GBL_RESULT GblSignal_connectClosure | ( | GblInstance * | pEmitter, |
| const char * | pSignalName, | ||
| GblInstance * | pReceiver, | ||
| GblClosure * | pClosure ) |
Connects the generic closure instance, GblClosure, on the given pReceiver, from the given pSignalName on the given pemitter.
| size_t GblSignal_disconnect | ( | GblInstance * | pEmitter, |
| const char * | pSignalName, | ||
| GblInstance * | pReceiver, | ||
| GblClosure * | pClosure ) |
Disconnects the given pClosure on the given pReceiver from the given pSignalName on the given pEmitter, returning the number of closure which were uninstalled.
| GblBool GblSignal_block | ( | GblInstance * | pInstance, |
| const char * | pSignalName, | ||
| GblBool | blocked ) |
Blocks pSignalName from being emitted from pInstance if blocked is true, otherwise enables its emission.
| GblBool GblSignal_blockAll | ( | GblInstance * | pInstance, |
| GblBool | blocked ) |
Blocks all signals from being emitted from pinstance if block is true, otherwise enables them.
| GblBool GblSignal_blocked | ( | GblInstance * | pInstance, |
| const char * | pSignalName ) |
Returns true if the signal is blocked on the given instance or if all signals are blocked, if no signal name is provided.
| GBL_RESULT GblSignal_emit | ( | GblInstance * | pEmitter, |
| const char * | pSignalName, | ||
| ... ) |
Fires pSignalName from pEmitter, with the given variadic argument list.
| GBL_RESULT GblSignal_emitVaList | ( | GblInstance * | pEmitter, |
| const char * | pSignalName, | ||
| va_list * | pVarArgs ) |
Equivalent to GblSignal_emit(), except taking arguments as a va_list* rather than variadic args.
| GBL_RESULT GblSignal_emitVariants | ( | GblInstance * | pEmitter, |
| const char * | pSignalName, | ||
| GblVariant * | pArgs ) |
Equivalent to GblSignal_emit(), except taking arguments as an array of GblVariants rather than variadic args.
| size_t GblSignal_connectionCount | ( | GblInstance * | pInstance, |
| const char * | pSignalName ) |
Returns the number of connections which have been registered for pSignalName on pInstance.
| GblInstance * GblSignal_emitter | ( | void | ) |
Returns a pointer to the GblInstance which emitted the acive signal or NULL if there isn't an active one.
| GblInstance * GblSignal_receiver | ( | void | ) |
Returns a pointer to the GblInstance which received the active signal or NULL if there isn't an active one.