Galago - desktop presence framework

galago-signals.h File Reference

Galago Signals API. More...

#include <libgalago/galago-object.h>
#include <libgalago/galago-value.h>
#include <libgalago/galago-hashtable.h>
#include <libgalago/galago-types.h>

Go to the source code of this file.


Signal Context API

GalagoSignalContext * galago_signal_context_new (void)
 Creates a signal context.
void galago_signal_context_destroy (GalagoSignalContext *signal_context)
 Destroys a signal context.
void galago_signal_context_freeze (GalagoSignalContext *signal_context)
 Freezes a signal context.
void galago_signal_context_thaw (GalagoSignalContext *signal_context)
 Thaws a signal context.
galago_bool galago_signal_context_is_frozen (const GalagoSignalContext *signal_context)
 Returns whether or not a signal context is frozen.
GalagoSignalHandler * galago_signal_context_find_handler (const GalagoSignalContext *signal_context, const void *object, const char *signal, GalagoCallback cb)
 Finds a signal handler with the specified object, signal name, and callback.
GalagoSignalHandler * galago_signal_context_find_handler_with_id (unsigned long id)
 Finds a signal handler with the specified ID.

Signals Subsystem API

galago_bool galago_signal_register (GalagoSignalContext *signal_context, const char *signal, GalagoMarshalFunc marshal, size_t num_values,...)
 Registers a signal in the signal context.
void galago_signal_unregister (GalagoSignalContext *signal_context, const char *signal)
 Unregisters a signal in the signal context.
unsigned long galago_signal_connect_class (GalagoObjectClass *klass, const char *signal, GalagoCallback cb, void *user_data)
 Connects a signal handler to a signal for all objects in a class.
unsigned long galago_signal_connect (void *obj, const char *signal, GalagoCallback cb, void *user_data)
 Connects a signal handler to a signal for an object.
void galago_signals_disconnect_by_id (unsigned long id)
 Disconnects a signal handler with the specified ID.
void galago_signal_emit (void *object, const char *signal,...)
 Emits a signal.
void galago_signal_emit_vargs (void *object, const char *signal, va_list args)
 Emits a signal, using a va_list of arguments.
void galago_signals_init (void)
 Initializes the signals subsystem.
void galago_signals_uninit (void)
 Uninitializes the signals subsystem.

Defines

#define GALAGO_SIGNAL_CONTEXT(obj)   (galago_class_get_signal_context(GALAGO_OBJECT_CLASS(obj)))

Typedefs

typedef _GalagoSignalHandler GalagoSignalHandler
typedef _GalagoSignalContext GalagoSignalContext
typedef void(* GalagoMarshalFunc )(GalagoCallback cb, GalagoObject *obj, const char *signal, va_list args, void *data)

Detailed Description

Galago Signals API.

Copyright:
(C) 2004-2005 Christian Hammond
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file galago-signals.h.


Function Documentation

unsigned long galago_signal_connect void *  obj,
const char *  signal,
GalagoCallback  cb,
void *  user_data
 

Connects a signal handler to a signal for an object.

Parameters:
obj The object to connect to, or NULL for all on the context.
signal The signal to connect to.
cb The callback function.
user_data User-specified data.
Returns:
The ID of the signal handler, or 0 if there was an error.

unsigned long galago_signal_connect_class GalagoObjectClass klass,
const char *  signal,
GalagoCallback  cb,
void *  user_data
 

Connects a signal handler to a signal for all objects in a class.

Parameters:
klass The class.
signal The signal to connect to.
cb The callback function.
user_data User-specified data.
Returns:
The ID of the signal handler, or 0 if there was an error.

void galago_signal_context_destroy GalagoSignalContext *  signal_context  ) 
 

Destroys a signal context.

Parameters:
signal_context The signal context.

GalagoSignalHandler* galago_signal_context_find_handler const GalagoSignalContext *  signal_context,
const void *  object,
const char *  signal,
GalagoCallback  cb
 

Finds a signal handler with the specified object, signal name, and callback.

Parameters:
signal_context The signal context.
object The object.
signal The signal.
cb The callback.
Returns:
The signal handler, if found, or NULL.

GalagoSignalHandler* galago_signal_context_find_handler_with_id unsigned long  id  ) 
 

Finds a signal handler with the specified ID.

Parameters:
id The signal handler ID.
Returns:
The signal handler, if fond, or NULL.

void galago_signal_context_freeze GalagoSignalContext *  signal_context  ) 
 

Freezes a signal context.

Parameters:
signal_context The signal context to freeze.

galago_bool galago_signal_context_is_frozen const GalagoSignalContext *  signal_context  ) 
 

Returns whether or not a signal context is frozen.

Parameters:
signal_context The signal context.
Returns:
TRUE if the signal context is frozen, or FALSE.

GalagoSignalContext* galago_signal_context_new void   ) 
 

Creates a signal context.

Returns:
The new signal context.

void galago_signal_context_thaw GalagoSignalContext *  signal_context  ) 
 

Thaws a signal context.

Parameters:
signal_context The signal context to thaw.

void galago_signal_emit void *  object,
const char *  signal,
  ...
 

Emits a signal.

Parameters:
object The object.
signal The signal name.
... The arguments list.

void galago_signal_emit_vargs void *  object,
const char *  signal,
va_list  args
 

Emits a signal, using a va_list of arguments.

Parameters:
object The object.
signal The signal name.
args The arguments list.

galago_bool galago_signal_register GalagoSignalContext *  signal_context,
const char *  signal,
GalagoMarshalFunc  marshal,
size_t  num_values,
  ...
 

Registers a signal in the signal context.

Parameters:
signal_context The signal context.
signal The signal name.
marshal The marshaller function.
num_values The number of values passed to the callback.
... The optional list of data types passed.
Returns:
TRUE if this signal was registered, or FALSE if there was an error or if signal is already registered.

void galago_signal_unregister GalagoSignalContext *  signal_context,
const char *  signal
 

Unregisters a signal in the signal context.

Parameters:
signal_context The signal context.
signal The signal name.

void galago_signals_disconnect_by_id unsigned long  id  ) 
 

Disconnects a signal handler with the specified ID.

Parameters:
id The signal handler ID.