Gooey GUI Library
Loading...
Searching...
No Matches
gooey_signals.h File Reference
#include "utils/logger/gooey_logger_internal.h"

Go to the source code of this file.

Classes

struct  GooeySignal_Slot
 
struct  GooeySignal
 

Typedefs

typedef void(* GooeySignal_CallbackFunction) (void *context, void *data)
 
typedef struct GooeySignal_Slot GooeySignal_Slot
 

Functions

GooeySignal GooeySignal_Create (void)
 Creates a new signal object.
 
void GooeySignal_Link (GooeySignal *signal, GooeySignal_CallbackFunction callback, void *context)
 Links a callback function to a signal.
 
void GooeySignal_Emit (GooeySignal *signal, void *data)
 Emits a signal.
 
void GooeySignal_UnLinkAll (GooeySignal *signal)
 Unlinks all callbacks from a signal.
 

Typedef Documentation

◆ GooeySignal_CallbackFunction

typedef void(* GooeySignal_CallbackFunction) (void *context, void *data)

◆ GooeySignal_Slot

Function Documentation

◆ GooeySignal_Create()

GooeySignal GooeySignal_Create ( void  )

Creates a new signal object.

Signals are used to manage event handling and callbacks. This function initializes a new signal object.

Returns
GooeySignal The created signal object.

◆ GooeySignal_Emit()

void GooeySignal_Emit ( GooeySignal signal,
void *  data 
)

Emits a signal.

This function triggers the signal, invoking all linked callbacks in the order they were added.

Parameters
signalA pointer to the signal to emit.
dataA void pointer to the data.

◆ GooeySignal_Link()

void GooeySignal_Link ( GooeySignal signal,
GooeySignal_CallbackFunction  callback,
void *  context 
)

Links a callback function to a signal.

This function connects a signal to a specific callback function. When the signal is emitted, the callback function will be executed.

Parameters
signalA pointer to the signal to which the callback is linked.
callbackThe callback function to execute when the signal is emitted.
contextA user-defined context pointer passed to the callback.

◆ GooeySignal_UnLinkAll()

void GooeySignal_UnLinkAll ( GooeySignal signal)

Unlinks all callbacks from a signal.

Removes all callback functions linked to the specified signal, effectively clearing its event listeners.

Parameters
signalA pointer to the signal to modify.