urg, removed implementation of gtk_marshal_VOID__INT_INT_INT_INT. if
Wed Oct 25 20:47:41 2000 Tim Janik <timj@gtk.org> * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init): urg, removed implementation of gtk_marshal_VOID__INT_INT_INT_INT. if people do that, couldn't they at least give it a non-standard name? * gtk/gtktextlayout.c: arg! yet another implementation of gtk_marshal_VOID__INT_INT_INT_INT(), is this a conspiracy? * gtk/gtktextbuffer.c: gotcha! captured a vagabonding gtk_marshal_VOID__INT_POINTER_INT() implementation, braught it back home. now i know this _is_ a conspiracy. * gtk/gtkwidget.c (gtk_widget_class_init): marshaller fixups for ::state-changed. * gtk/gtkaccelgroup.c (gtk_accel_group_create_remove): (gtk_accel_group_create_add): marshaller signature fixups. * gtk/gtklistitem.c (gtk_list_item_class_init): signal creation fixups, pass in GTK_TYPE_SCROLL_TYPE instead of GTK_TYPE_ENUM. * gtk/gtkobject.[hc]: removed GTK_CONNECTED flag, it's not valid anymore. Tue Oct 24 23:59:21 2000 Tim Janik <timj@gtk.org> * docs/reference/Makefile.am: disabled SUBDIRS for the moment, since due to the signal system changes, it wouldn't build currently. to be fixed soon. * docs/Changes-2.0.txt: GtkSignal/GSignal updates. * gtk/gtkwidget.c: ::direction_changed takes an enum as argument, so it needs gtk_marshal_VOID__ENUM() instead of gtk_marshal_NONE__UINT(). * gdk/gdk*.c: adapted type registration functions. * gtk/gtkbindings.c: * gtk/gtkaccelgroup.c: operate on GSignalQuery, GtkSignalQuery is gone. * gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType. * gtk/gtkobject.c: (gtk_object_destroy): (gtk_object_shutdown): fixed recursion guards. basically we have to catch the case where any of GObject.shutdown() or gtk_object_destroy() is called during ::destroy, and avoid recursion there. * gtk/gtktypeutils.c: * gtk/maketypes.awk: awk-script hackup to provide gtk_type_init() with boxed_copy/boxed_free. this needs a more general solution based on a publically installed code-generator utility. * gtk/gtktypeutils.[hc]: compat aliased GTK_TYPE_BOXED to G_TYPE_BOXED, glib's gobject has support for that now. define GtkSignalMarshaller in terms of GSignalCMarshaller. Mon Oct 23 09:36:42 2000 Tim Janik <timj@gtk.org> * gtk/gtksignal.[hc]: * gtk/gtkmarshal.[hc]: * gtk/Makefile.am: generate marshallers with glib-genmarshal and don't compile gtkmarshal.c on its own anymore, just include it in gtksignal.c. removed #include <gtkmarshal.h>s all over the place, gtksignal.h takes care of that. * *.c: marshaller name fixups. * gtk/gtkmarshal.list: added a comment briefing the format. Sun Oct 22 23:14:39 2000 Tim Janik <timj@gtk.org> * gtk/gtksignal.[hc]: nuked old implementation. we mostly have compatibility macros here now. more specifically, most of the API is preserved (yes, _most_, nonwithstanding the following exceptions listed, the API is stil lHUGE ;) things that got removed completely: GtkSignalQuery, gtk_signal_query(), gtk_signal_n_emissions(), gtk_signal_n_emissions_by_name(), gtk_signal_handlers_destroy(), gtk_signal_set_funcs(), gtk_signal_handler_pending_by_id(), gtk_signal_add_emission_hook(), gtk_signal_add_emission_hook_full(), gtk_signal_remove_emission_hook(). non-functional functions variants: gtk_signal_add_emission_hook(), gtk_signal_remove_emission_hook(). the GtkCallbackMarshal argument to gtk_signal_connect_full() is not supported anymore. (gtk_signal_compat_matched): new internal function to aid implementation of the compatibility macros, it provides functionality to block/unblock/disconnect handlers based on func/data. * gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType, * *.c: adaptions to new type registration API signatures. Fri Oct 20 15:26:33 2000 Tim Janik <timj@gtk.org> * gtk/gtktypeutils.[hc]: removed G_TYPE_GTK_POINTER cludge.
This commit is contained in:
247
gtk/gtksignal.h
247
gtk/gtksignal.h
@ -28,178 +28,109 @@
|
||||
#define __GTK_SIGNAL_H__
|
||||
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtkenums.h>
|
||||
#include <gtk/gtkobject.h>
|
||||
#include <gtk/gtkmarshal.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_SIGNAL_OFFSET(struct, field) (GTK_STRUCT_OFFSET (struct, field))
|
||||
|
||||
|
||||
typedef void (*GtkSignalMarshal) (GtkObject *object,
|
||||
gpointer data,
|
||||
guint nparams,
|
||||
GtkArg *args,
|
||||
GtkType *arg_types,
|
||||
GtkType return_type);
|
||||
typedef void (*GtkSignalDestroy) (gpointer data);
|
||||
typedef gboolean (*GtkEmissionHook) (GtkObject *object,
|
||||
guint signal_id,
|
||||
guint n_params,
|
||||
GtkArg *params,
|
||||
gpointer data);
|
||||
|
||||
typedef struct _GtkSignalQuery GtkSignalQuery;
|
||||
|
||||
struct _GtkSignalQuery
|
||||
{
|
||||
GtkType object_type;
|
||||
guint signal_id;
|
||||
const gchar *signal_name;
|
||||
guint is_user_signal : 1;
|
||||
GtkSignalRunType signal_flags;
|
||||
GtkType return_val;
|
||||
guint nparams;
|
||||
const GtkType *params;
|
||||
};
|
||||
#define gtk_signal_default_marshaller gtk_marshal_VOID__VOID
|
||||
|
||||
|
||||
/* Application-level methods */
|
||||
guint gtk_signal_lookup (const gchar *name,
|
||||
GtkType object_type);
|
||||
gchar* gtk_signal_name (guint signal_id) G_GNUC_CONST;
|
||||
guint gtk_signal_n_emissions (GtkObject *object,
|
||||
guint signal_id);
|
||||
guint gtk_signal_n_emissions_by_name (GtkObject *object,
|
||||
const gchar *name);
|
||||
void gtk_signal_emit_stop (GtkObject *object,
|
||||
guint signal_id);
|
||||
void gtk_signal_emit_stop_by_name (GtkObject *object,
|
||||
const gchar *name);
|
||||
guint gtk_signal_connect (GtkObject *object,
|
||||
const gchar *name,
|
||||
GtkSignalFunc func,
|
||||
gpointer func_data);
|
||||
guint gtk_signal_connect_after (GtkObject *object,
|
||||
const gchar *name,
|
||||
GtkSignalFunc func,
|
||||
gpointer func_data);
|
||||
guint gtk_signal_connect_object (GtkObject *object,
|
||||
const gchar *name,
|
||||
GtkSignalFunc func,
|
||||
GtkObject *slot_object);
|
||||
guint gtk_signal_connect_object_after (GtkObject *object,
|
||||
const gchar *name,
|
||||
GtkSignalFunc func,
|
||||
GtkObject *slot_object);
|
||||
guint gtk_signal_connect_full (GtkObject *object,
|
||||
const gchar *name,
|
||||
GtkSignalFunc func,
|
||||
GtkCallbackMarshal marshal,
|
||||
gpointer data,
|
||||
GtkDestroyNotify destroy_func,
|
||||
gint object_signal,
|
||||
gint after);
|
||||
|
||||
void gtk_signal_connect_object_while_alive (GtkObject *object,
|
||||
const gchar *signal,
|
||||
GtkSignalFunc func,
|
||||
GtkObject *alive_object);
|
||||
void gtk_signal_connect_while_alive (GtkObject *object,
|
||||
const gchar *signal,
|
||||
GtkSignalFunc func,
|
||||
gpointer func_data,
|
||||
GtkObject *alive_object);
|
||||
|
||||
void gtk_signal_disconnect (GtkObject *object,
|
||||
guint handler_id);
|
||||
void gtk_signal_disconnect_by_func (GtkObject *object,
|
||||
GtkSignalFunc func,
|
||||
gpointer data);
|
||||
void gtk_signal_disconnect_by_data (GtkObject *object,
|
||||
gpointer data);
|
||||
void gtk_signal_handler_block (GtkObject *object,
|
||||
guint handler_id);
|
||||
void gtk_signal_handler_block_by_func (GtkObject *object,
|
||||
GtkSignalFunc func,
|
||||
gpointer data);
|
||||
void gtk_signal_handler_block_by_data (GtkObject *object,
|
||||
gpointer data);
|
||||
void gtk_signal_handler_unblock (GtkObject *object,
|
||||
guint handler_id);
|
||||
void gtk_signal_handler_unblock_by_func (GtkObject *object,
|
||||
GtkSignalFunc func,
|
||||
gpointer data);
|
||||
void gtk_signal_handler_unblock_by_data (GtkObject *object,
|
||||
gpointer data);
|
||||
guint gtk_signal_handler_pending (GtkObject *object,
|
||||
guint signal_id,
|
||||
gboolean may_be_blocked);
|
||||
guint gtk_signal_handler_pending_by_func (GtkObject *object,
|
||||
guint signal_id,
|
||||
gboolean may_be_blocked,
|
||||
GtkSignalFunc func,
|
||||
gpointer data);
|
||||
gint gtk_signal_handler_pending_by_id (GtkObject *object,
|
||||
guint handler_id,
|
||||
gboolean may_be_blocked);
|
||||
guint gtk_signal_add_emission_hook (guint signal_id,
|
||||
GtkEmissionHook hook_func,
|
||||
gpointer data);
|
||||
guint gtk_signal_add_emission_hook_full (guint signal_id,
|
||||
GtkEmissionHook hook_func,
|
||||
gpointer data,
|
||||
GDestroyNotify destroy);
|
||||
void gtk_signal_remove_emission_hook (guint signal_id,
|
||||
guint hook_id);
|
||||
|
||||
/* Report internal information about a signal. The caller has the
|
||||
* responsibility to invoke a subsequent g_free (returned_data); but
|
||||
* must not modify data pointed to by the members of GtkSignalQuery
|
||||
*/
|
||||
GtkSignalQuery* gtk_signal_query (guint signal_id);
|
||||
/* --- compat defines --- */
|
||||
#define GTK_SIGNAL_OFFSET GTK_STRUCT_OFFSET
|
||||
#define gtk_signal_init() g_type_init()
|
||||
#define gtk_signal_lookup g_signal_lookup
|
||||
#define gtk_signal_name g_signal_name
|
||||
#define gtk_signal_emit_stop g_signal_stop_emission
|
||||
#define gtk_signal_connect(o,s,f,d) gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 0, 0)
|
||||
#define gtk_signal_connect_after(o,s,f,d) gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 0, 1)
|
||||
#define gtk_signal_connect_object(o,s,f,d) gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 1, 0)
|
||||
#define gtk_signal_connect_object_after(o,s,f,d) gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 1, 1)
|
||||
#define gtk_signal_disconnect g_signal_handler_disconnect
|
||||
#define gtk_signal_handler_block g_signal_handler_block
|
||||
#define gtk_signal_handler_unblock g_signal_handler_unblock
|
||||
#define gtk_signal_disconnect_by_func(o,f,d) gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
|
||||
G_SIGNAL_MATCH_DATA, 0)
|
||||
#define gtk_signal_disconnect_by_data(o,d) gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 0)
|
||||
#define gtk_signal_handler_block_by_func(o,f,d) gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
|
||||
G_SIGNAL_MATCH_DATA, 1)
|
||||
#define gtk_signal_handler_block_by_data(o,d) gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 1)
|
||||
#define gtk_signal_handler_unblock_by_func(o,f,d) gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
|
||||
G_SIGNAL_MATCH_DATA, 2)
|
||||
#define gtk_signal_handler_unblock_by_data(o,d) gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 2)
|
||||
#define gtk_signal_handler_pending g_signal_has_handler_pending
|
||||
#define gtk_signal_handler_pending_by_func(o,s,b,f,d) (g_signal_handler_find ((o), G_SIGNAL_MATCH_ID | \
|
||||
G_SIGNAL_MATCH_FUNC | \
|
||||
G_SIGNAL_MATCH_DATA | \
|
||||
((b) ? 0 : G_SIGNAL_MATCH_UNBLOCKED), \
|
||||
(s), 0, (f), (d)) != 0)
|
||||
|
||||
|
||||
/* Widget-level methods */
|
||||
void gtk_signal_init (void);
|
||||
guint gtk_signal_new (const gchar *name,
|
||||
GtkSignalRunType signal_flags,
|
||||
GtkType object_type,
|
||||
guint function_offset,
|
||||
GtkSignalMarshaller marshaller,
|
||||
GtkType return_val,
|
||||
guint nparams,
|
||||
...);
|
||||
guint gtk_signal_newv (const gchar *name,
|
||||
GtkSignalRunType signal_flags,
|
||||
GtkType object_type,
|
||||
guint function_offset,
|
||||
GtkSignalMarshaller marshaller,
|
||||
GtkType return_val,
|
||||
guint nparams,
|
||||
GtkType *params);
|
||||
void gtk_signal_emit (GtkObject *object,
|
||||
guint signal_id,
|
||||
...);
|
||||
void gtk_signal_emit_by_name (GtkObject *object,
|
||||
const gchar *name,
|
||||
...);
|
||||
void gtk_signal_emitv (GtkObject *object,
|
||||
guint signal_id,
|
||||
GtkArg *params);
|
||||
void gtk_signal_emitv_by_name (GtkObject *object,
|
||||
const gchar *name,
|
||||
GtkArg *params);
|
||||
/* Non-public methods */
|
||||
void gtk_signal_handlers_destroy (GtkObject *object);
|
||||
void gtk_signal_set_funcs (GtkSignalMarshal marshal_func,
|
||||
GtkSignalDestroy destroy_func);
|
||||
|
||||
/* --- compat functions --- */
|
||||
guint gtk_signal_newv (const gchar *name,
|
||||
GtkSignalRunType signal_flags,
|
||||
GtkType object_type,
|
||||
guint function_offset,
|
||||
GtkSignalMarshaller marshaller,
|
||||
GtkType return_val,
|
||||
guint n_args,
|
||||
GtkType *args);
|
||||
guint gtk_signal_new (const gchar *name,
|
||||
GtkSignalRunType signal_flags,
|
||||
GtkType object_type,
|
||||
guint function_offset,
|
||||
GtkSignalMarshaller marshaller,
|
||||
GtkType return_val,
|
||||
guint n_args,
|
||||
...);
|
||||
void gtk_signal_emit_stop_by_name (GtkObject *object,
|
||||
const gchar *name);
|
||||
void gtk_signal_connect_object_while_alive (GtkObject *object,
|
||||
const gchar *signal,
|
||||
GtkSignalFunc func,
|
||||
GtkObject *alive_object);
|
||||
void gtk_signal_connect_while_alive (GtkObject *object,
|
||||
const gchar *signal,
|
||||
GtkSignalFunc func,
|
||||
gpointer func_data,
|
||||
GtkObject *alive_object);
|
||||
guint gtk_signal_connect_full (GtkObject *object,
|
||||
const gchar *name,
|
||||
GtkSignalFunc func,
|
||||
GtkCallbackMarshal unsupported,
|
||||
gpointer data,
|
||||
GtkDestroyNotify destroy_func,
|
||||
gint object_signal,
|
||||
gint after);
|
||||
void gtk_signal_emitv (GtkObject *object,
|
||||
guint signal_id,
|
||||
GtkArg *args);
|
||||
void gtk_signal_emit (GtkObject *object,
|
||||
guint signal_id,
|
||||
...);
|
||||
void gtk_signal_emit_by_name (GtkObject *object,
|
||||
const gchar *name,
|
||||
...);
|
||||
void gtk_signal_emitv_by_name (GtkObject *object,
|
||||
const gchar *name,
|
||||
GtkArg *args);
|
||||
void gtk_signal_compat_matched (GtkObject *object,
|
||||
GtkSignalFunc func,
|
||||
gpointer data,
|
||||
GSignalMatchType match,
|
||||
guint action);
|
||||
|
||||
|
||||
/* FIXME: non-functional relicts */
|
||||
typedef gpointer GtkEmissionHook;
|
||||
#define gtk_signal_add_emission_hook(i,h,d) (0)
|
||||
#define gtk_signal_remove_emission_hook(i,h) while (0)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user