gwenhywfar 5.12.0
gwensignal.h File Reference
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/types.h>
#include <gwenhywfar/list2.h>
Include dependency graph for gwensignal.h:

Go to the source code of this file.

Typedefs

typedef struct GWEN_SIGNAL GWEN_SIGNAL
typedef struct GWEN_SIGNALOBJECT GWEN_SIGNALOBJECT
typedef struct GWEN_SLOT GWEN_SLOT
typedef int GWENHYWFAR_CB(* GWEN_SLOT_FUNCTION) (GWEN_SLOT *slot, void *userData, void *pArg1, void *pArg2, int iArg3, int iArg4)

Functions

SignalObject
GWENHYWFAR_API int GWEN_Signal_Connect (GWEN_SIGNAL *sig, GWEN_SLOT *slot)
GWENHYWFAR_API int GWEN_Signal_Disconnect (GWEN_SIGNAL *sig, GWEN_SLOT *slot)
GWENHYWFAR_API int GWEN_Signal_Emit (GWEN_SIGNAL *sig, void *pArg1, void *pArg2, int iArg3, int iArg4)
GWENHYWFAR_API void GWEN_Signal_free (GWEN_SIGNAL *sig)
GWENHYWFAR_API GWEN_SIGNALOBJECTGWEN_Signal_GetSignalObject (const GWEN_SIGNAL *sig)
GWENHYWFAR_API GWEN_SIGNALGWEN_Signal_new (GWEN_SIGNALOBJECT *so, const char *derivedType, const char *name, const char *typeOfArg1, const char *typeOfArg2)
GWENHYWFAR_API GWEN_SIGNALGWEN_SignalObject_FindSignal (const GWEN_SIGNALOBJECT *so, const char *name, const char *typeOfArg1, const char *typeOfArg2)
GWENHYWFAR_API GWEN_SLOTGWEN_SignalObject_FindSlot (const GWEN_SIGNALOBJECT *so, const char *name, const char *typeOfArg1, const char *typeOfArg2)
GWENHYWFAR_API void GWEN_SignalObject_free (GWEN_SIGNALOBJECT *so)
GWENHYWFAR_API GWEN_SIGNALOBJECTGWEN_SignalObject_new (void)
GWENHYWFAR_API void GWEN_SignalObject_RemoveForDerivedType (GWEN_SIGNALOBJECT *so, const char *derivedType)
GWENHYWFAR_API void GWEN_Slot_free (GWEN_SLOT *slot)
GWENHYWFAR_API GWEN_SIGNALOBJECTGWEN_Slot_GetSignalObject (const GWEN_SLOT *slot)
GWENHYWFAR_API GWEN_SLOTGWEN_Slot_new (GWEN_SIGNALOBJECT *so, const char *derivedType, const char *name, const char *typeOfArg1, const char *typeOfArg2, GWEN_SLOT_FUNCTION fn, void *userData)

Typedef Documentation

◆ GWEN_SIGNAL

typedef struct GWEN_SIGNAL GWEN_SIGNAL

Definition at line 67 of file gwensignal.h.

◆ GWEN_SIGNALOBJECT

Definition at line 65 of file gwensignal.h.

◆ GWEN_SLOT

typedef struct GWEN_SLOT GWEN_SLOT

Definition at line 69 of file gwensignal.h.

◆ GWEN_SLOT_FUNCTION

typedef int GWENHYWFAR_CB(* GWEN_SLOT_FUNCTION) (GWEN_SLOT *slot, void *userData, void *pArg1, void *pArg2, int iArg3, int iArg4)

This is the prototype for the slot function. If there is a problem in the function it should return 1, otherwise 0.

Definition at line 76 of file gwensignal.h.

Function Documentation

◆ GWEN_Signal_Connect()

GWENHYWFAR_API int GWEN_Signal_Connect ( GWEN_SIGNAL * sig,
GWEN_SLOT * slot )

Definition at line 406 of file gwensignal.c.

References DBG_ERROR, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, GWEN_Signal_List2_HasSignal(), and GWEN_Slot_List2_HasSlot().

Here is the call graph for this function:

◆ GWEN_Signal_Disconnect()

GWENHYWFAR_API int GWEN_Signal_Disconnect ( GWEN_SIGNAL * sig,
GWEN_SLOT * slot )

Definition at line 446 of file gwensignal.c.

References DBG_ERROR, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, GWEN_Signal_List2_HasSignal(), and GWEN_Slot_List2_HasSlot().

Here is the call graph for this function:

◆ GWEN_Signal_Emit()

GWENHYWFAR_API int GWEN_Signal_Emit ( GWEN_SIGNAL * sig,
void * pArg1,
void * pArg2,
int iArg3,
int iArg4 )

This function calls the slot function of all connected slots. If any of the slot functions called returns with code 1 then this function will return 1, too. Otherwise 0 is returned. This means that this function will only return 0 if every called slot function returns 0.

Definition at line 472 of file gwensignal.c.

References DBG_DEBUG, and GWEN_LOGDOMAIN.

◆ GWEN_Signal_free()

GWENHYWFAR_API void GWEN_Signal_free ( GWEN_SIGNAL * sig)

Definition at line 315 of file gwensignal.c.

References DBG_ERROR, GWEN_FREE_OBJECT, and GWEN_LOGDOMAIN.

Referenced by GWEN_Signal__List2_freeAll_cb(), GWEN_Signal_new(), and GWEN_SignalObject_RemoveForDerivedType().

Here is the caller graph for this function:

◆ GWEN_Signal_GetSignalObject()

GWENHYWFAR_API GWEN_SIGNALOBJECT * GWEN_Signal_GetSignalObject ( const GWEN_SIGNAL * sig)

Definition at line 398 of file gwensignal.c.

◆ GWEN_Signal_new()

GWENHYWFAR_API GWEN_SIGNAL * GWEN_Signal_new ( GWEN_SIGNALOBJECT * so,
const char * derivedType,
const char * name,
const char * typeOfArg1,
const char * typeOfArg2 )

Definition at line 284 of file gwensignal.c.

References GWEN_NEW_OBJECT, GWEN_Signal_free(), GWEN_SignalObject_AddSignal(), and GWEN_SignalObject_MkTypeId().

Here is the call graph for this function:

◆ GWEN_SignalObject_FindSignal()

GWENHYWFAR_API GWEN_SIGNAL * GWEN_SignalObject_FindSignal ( const GWEN_SIGNALOBJECT * so,
const char * name,
const char * typeOfArg1,
const char * typeOfArg2 )

Definition at line 114 of file gwensignal.c.

References GWEN_SignalObject__findSignal(), and GWEN_SignalObject_MkTypeId().

Here is the call graph for this function:

◆ GWEN_SignalObject_FindSlot()

GWENHYWFAR_API GWEN_SLOT * GWEN_SignalObject_FindSlot ( const GWEN_SIGNALOBJECT * so,
const char * name,
const char * typeOfArg1,
const char * typeOfArg2 )

Definition at line 168 of file gwensignal.c.

References GWEN_SignalObject__findSlot(), and GWEN_SignalObject_MkTypeId().

Here is the call graph for this function:

◆ GWEN_SignalObject_free()

GWENHYWFAR_API void GWEN_SignalObject_free ( GWEN_SIGNALOBJECT * so)

Definition at line 59 of file gwensignal.c.

References GWEN_FREE_OBJECT, GWEN_Signal_List2_freeAll(), and GWEN_Slot_List2_freeAll().

Here is the call graph for this function:

◆ GWEN_SignalObject_new()

GWENHYWFAR_API GWEN_SIGNALOBJECT * GWEN_SignalObject_new ( void )

Definition at line 46 of file gwensignal.c.

References GWEN_NEW_OBJECT, and GWEN_SignalObject_new().

Referenced by GWEN_SignalObject_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SignalObject_RemoveForDerivedType()

GWENHYWFAR_API void GWEN_SignalObject_RemoveForDerivedType ( GWEN_SIGNALOBJECT * so,
const char * derivedType )

This function removes all signals and slots for the given derived type. This function can be used from within the FREEDATA function of the GWEN_INHERIT framework.

Definition at line 222 of file gwensignal.c.

References GWEN_Signal_free(), GWEN_SignalObject_MkTypeId(), and GWEN_Slot_free().

Here is the call graph for this function:

◆ GWEN_Slot_free()

GWENHYWFAR_API void GWEN_Slot_free ( GWEN_SLOT * slot)

Definition at line 547 of file gwensignal.c.

References DBG_ERROR, GWEN_FREE_OBJECT, and GWEN_LOGDOMAIN.

Referenced by GWEN_SignalObject_RemoveForDerivedType(), GWEN_Slot__List2_freeAll_cb(), and GWEN_Slot_new().

Here is the caller graph for this function:

◆ GWEN_Slot_GetSignalObject()

GWENHYWFAR_API GWEN_SIGNALOBJECT * GWEN_Slot_GetSignalObject ( const GWEN_SLOT * slot)

Definition at line 627 of file gwensignal.c.

◆ GWEN_Slot_new()

GWENHYWFAR_API GWEN_SLOT * GWEN_Slot_new ( GWEN_SIGNALOBJECT * so,
const char * derivedType,
const char * name,
const char * typeOfArg1,
const char * typeOfArg2,
GWEN_SLOT_FUNCTION fn,
void * userData )

Definition at line 513 of file gwensignal.c.

References GWEN_NEW_OBJECT, GWEN_SignalObject_AddSlot(), GWEN_SignalObject_MkTypeId(), and GWEN_Slot_free().

Here is the call graph for this function: