/* GObject - GLib Type, Object, Parameter and Signal Library
- * Copyright (C) 2000 Red Hat, Inc.
+ * Copyright (C) 2000-2001 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
/* --- defines --- */
#define G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))->marshal == NULL)
#define G_CCLOSURE_SWAP_DATA(cclosure) (((GClosure*) (closure))->derivative_flag)
+#define G_CALLBACK(f) ((GCallback) (f))
/* -- typedefs --- */
typedef struct _GClosure GClosure;
typedef struct _GClosureNotifyData GClosureNotifyData;
-typedef gpointer GCallback;
+typedef gpointer GCallback;
typedef void (*GClosureNotify) (gpointer data,
GClosure *closure);
typedef void (*GClosureMarshal) (GClosure *closure,
- guint invocation_hint,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
+ gpointer invocation_hint,
gpointer marshal_data);
typedef struct _GCClosure GCClosure;
/*< public >*/ guint is_invalid : 1;
/*< private >*/ void (*marshal) (GClosure *closure,
- guint invocation_hint,
GValue /*out*/ *return_value,
guint n_param_values,
const GValue *param_values,
+ gpointer invocation_hint,
gpointer marshal_data);
/*< protected >*/ gpointer data;
* - order of inotifiers is random
* inotifiers may _not_ free/invalidate parameter values (e.g. ->data)
* - order of fnotifiers is random
- * - notifiers may only be removed before or during their invocation
+ * - each notifier may only be removed before or during its invocation
* - reference counting may only happen prior to fnotify invocation
* (in that sense, fnotifiers are really finalization handlers)
*/
GClosure* g_cclosure_new_swap (GCallback callback_func,
gpointer user_data,
GClosureNotify destroy_data);
-GClosure* g_signal_type_closure_new (GType itype,
+GClosure* g_signal_type_cclosure_new (GType itype,
guint struct_offset);
/* --- prototypes --- */
GClosure* g_closure_ref (GClosure *closure);
+void g_closure_sink (GClosure *closure);
void g_closure_unref (GClosure *closure);
/* intimidating */
GClosure* g_closure_new_simple (guint sizeof_closure,
GClosureMarshal meta_marshal);
void g_closure_invalidate (GClosure *closure);
void g_closure_invoke (GClosure *closure,
- guint invocation_hint,
GValue /*out*/ *return_value,
guint n_param_values,
- const GValue *param_values);
-
-
-/*
- data_object::destroy -> closure_invalidate();
- closure_invalidate() -> disconnect(closure);
- disconnect(closure) -> (unlink) closure_unref();
- closure_finalize() -> g_free (data_string);
-
- 1) need GObject and GType in glib
- 2) need GParam
- 3) need to resolve dtor cycles
- 4) need GSignal move
- 5) destroy on last caller ref or last data ref?
-
-
- random remarks:
- - don't mandate signals for GObject
- - OTOH, don't mandate GObject for GSignal
- - need marshaller repo with decent aliasing to base types
- - provide marshaller collection, virtually covering anything out there
- - at that point, still need GSignalCMarhsaller to g_signal_new() ?
- - can we combine varargs collect mechanisms with marshaller stubs?
- for out values (i.e. returntypes), that might get rid of the following
- point...
- - char* return signals with connections ala:
- connect({ return "static data that can't work"; }),
- connect({ return g_strdup ("properly duplicated string"); })
- won't work anymore. CRASH
-
- problems:
- - accumulator needs gboolean to indicate EMISSION_STOP
- - accumulator needs data
+ const GValue *param_values,
+ gpointer invocation_hint);
+
+
+/* FIXME:
+ OK: data_object::destroy -> closure_invalidate();
+ MIS: closure_invalidate() -> disconnect(closure);
+ MIS: disconnect(closure) -> (unlink) closure_unref();
+ OK: closure_finalize() -> g_free (data_string);
+
+ random remarks:
+ - need marshaller repo with decent aliasing to base types
+ - provide marshaller collection, virtually covering anything out there
*/