galago-signals.h
Go to the documentation of this file.00001
00021 #ifndef _GALAGO_SIGNALS_H_
00022 #define _GALAGO_SIGNALS_H_
00023
00024 typedef struct _GalagoSignalHandler GalagoSignalHandler;
00025 typedef struct _GalagoSignalContext GalagoSignalContext;
00026
00027 #include <libgalago/galago-object.h>
00028 #include <libgalago/galago-value.h>
00029
00030 typedef void (*GalagoMarshalFunc)(GalagoCallback cb, GalagoObject *obj,
00031 const char *signal, va_list args,
00032 void *data);
00033
00034 #define GALAGO_SIGNAL_CONTEXT(obj) \
00035 (galago_class_get_signal_context(GALAGO_OBJECT_CLASS(obj)))
00036
00037 #include <libgalago/galago-hashtable.h>
00038 #include <libgalago/galago-types.h>
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00044
00046
00054 GalagoSignalContext *galago_signal_context_new(void);
00055
00061 void galago_signal_context_destroy(GalagoSignalContext *signal_context);
00062
00068 void galago_signal_context_freeze(GalagoSignalContext *signal_context);
00069
00075 void galago_signal_context_thaw(GalagoSignalContext *signal_context);
00076
00084 galago_bool galago_signal_context_is_frozen(
00085 const GalagoSignalContext *signal_context);
00086
00097 GalagoSignalHandler *galago_signal_context_find_handler(
00098 const GalagoSignalContext *signal_context, const void *object,
00099 const char *signal, GalagoCallback cb);
00100
00108 GalagoSignalHandler *galago_signal_context_find_handler_with_id(
00109 unsigned long id);
00110
00113
00115
00130 galago_bool galago_signal_register(GalagoSignalContext *signal_context,
00131 const char *signal,
00132 GalagoMarshalFunc marshal,
00133 size_t num_values, ...);
00134
00141 void galago_signal_unregister(GalagoSignalContext *signal_context,
00142 const char *signal);
00143
00154 unsigned long galago_signal_connect_class(GalagoObjectClass *klass,
00155 const char *signal,
00156 GalagoCallback cb, void *user_data);
00157
00168 unsigned long galago_signal_connect(void *obj, const char *signal,
00169 GalagoCallback cb, void *user_data);
00170
00176 void galago_signals_disconnect_by_id(unsigned long id);
00177
00185 void galago_signal_emit(void *object, const char *signal, ...);
00186
00194 void galago_signal_emit_vargs(void *object, const char *signal, va_list args);
00195
00199 void galago_signals_init(void);
00200
00204 void galago_signals_uninit(void);
00205
00208 #ifdef __cplusplus
00209 }
00210 #endif
00211
00212 #endif