From 33447a38564dbc0c0db28f9eb4efb86a16be1505 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Mon, 7 Dec 1998 02:31:19 +0000 Subject: [PATCH] reverted marius change to expose the type systems internal type info data Mon Dec 7 03:08:39 1998 Tim Janik * gtk/gtktypeutils.h: * gtk/gtktypeutils.c: reverted marius change to expose the type systems internal type info data to the user. if such functionality is required we should provide wrapped accessors, ala gtk_signal_query(). * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, since it destroys the possibility to implement automatic marshaller lookups some day, and it also disables third party code's ability to connect to any signal. also the GtkTypeInfo structures are dynamically allocated memory portions, so only the type system is really allowed to access that stuff. Mon Dec 7 01:32:18 1998 Tim Janik * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the Tab key on the entry. the focus shouldn't get lost even if completion is attempted from an empty entry, since an empty entry string does indeed have a valid completion meaning (complete all). (gtk_file_selection_init): cast the gchar array parameter in calls to gtk_clist_new_with_titles() to quit compiler warnings. (check_dir): the no_stat_dirs struct must not be const, since we do indeed modify its contents. * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission hook semantics. * gtk/gtksignal.h: * gtk/gtksignal.c: changed emission allocation, so we don't use a doubly linked list but link ourselfs (singly linked). changed emission hooks, they get the emision parameters passed as well now and are emitted during the actuall signal emission (after the RUN_FIRST class method, but prior to RUN_FIRST handlers). the existing restrictions do still apply to signal emission hooks, i.e. an emission may not be stopped or restarted from an emission hook. due to possibly huge perfomance impacts, frequent use of emision hooks is also not recommended. (gtk_signal_next_and_invalidate): added an assertments which explicits what the code assumes anyways: a maximum amount of 65535 signals. * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), gtk_container_foreach_full() should be used instead. * gtk/gtkmain.h: deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since we provide _full variants. * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide gtk_signal_connect_full() for long enough now. --- ChangeLog | 53 +++++++++++ ChangeLog.pre-2-0 | 53 +++++++++++ ChangeLog.pre-2-10 | 53 +++++++++++ ChangeLog.pre-2-2 | 53 +++++++++++ ChangeLog.pre-2-4 | 53 +++++++++++ ChangeLog.pre-2-6 | 53 +++++++++++ ChangeLog.pre-2-8 | 53 +++++++++++ gtk/gtkcontainer.c | 1 + gtk/gtkcontainer.h | 9 +- gtk/gtkfilesel.c | 19 ++-- gtk/gtkmain.c | 2 + gtk/gtkmain.h | 22 ++--- gtk/gtksignal.c | 218 +++++++++++++++++++++++---------------------- gtk/gtksignal.h | 15 ++-- gtk/gtktypeutils.c | 17 ---- gtk/gtktypeutils.h | 2 - gtk/testgtk.c | 8 +- tests/testgtk.c | 8 +- 18 files changed, 529 insertions(+), 163 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9db85d4ab..8a8c7f089c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,56 @@ +Mon Dec 7 03:08:39 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: reverted marius change to expose the type systems + internal type info data to the user. if such functionality is required + we should provide wrapped accessors, ala gtk_signal_query(). + + * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, + since it destroys the possibility to implement automatic marshaller + lookups some day, and it also disables third party code's ability to + connect to any signal. also the GtkTypeInfo structures are dynamically + allocated memory portions, so only the type system is really allowed + to access that stuff. + +Mon Dec 7 01:32:18 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the + Tab key on the entry. the focus shouldn't get lost even if completion + is attempted from an empty entry, since an empty entry string does + indeed have a valid completion meaning (complete all). + (gtk_file_selection_init): cast the gchar array parameter in calls to + gtk_clist_new_with_titles() to quit compiler warnings. + (check_dir): the no_stat_dirs struct must not be const, since we do + indeed modify its contents. + + * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission + hook semantics. + + * gtk/gtksignal.h: + * gtk/gtksignal.c: + changed emission allocation, so we don't use a doubly linked list + but link ourselfs (singly linked). + changed emission hooks, they get the emision parameters passed as + well now and are emitted during the actuall signal emission (after + the RUN_FIRST class method, but prior to RUN_FIRST handlers). + the existing restrictions do still apply to signal emission hooks, + i.e. an emission may not be stopped or restarted from an emission hook. + due to possibly huge perfomance impacts, frequent use of emision hooks + is also not recommended. + (gtk_signal_next_and_invalidate): added an + assertments which explicits what the code assumes anyways: a + maximum amount of 65535 signals. + + * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), + gtk_container_foreach_full() should be used instead. + + * gtk/gtkmain.h: + deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since + we provide _full variants. + + * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide + gtk_signal_connect_full() for long enough now. + 1998-12-06 Marius Vollmer * gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index c9db85d4ab..8a8c7f089c 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,56 @@ +Mon Dec 7 03:08:39 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: reverted marius change to expose the type systems + internal type info data to the user. if such functionality is required + we should provide wrapped accessors, ala gtk_signal_query(). + + * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, + since it destroys the possibility to implement automatic marshaller + lookups some day, and it also disables third party code's ability to + connect to any signal. also the GtkTypeInfo structures are dynamically + allocated memory portions, so only the type system is really allowed + to access that stuff. + +Mon Dec 7 01:32:18 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the + Tab key on the entry. the focus shouldn't get lost even if completion + is attempted from an empty entry, since an empty entry string does + indeed have a valid completion meaning (complete all). + (gtk_file_selection_init): cast the gchar array parameter in calls to + gtk_clist_new_with_titles() to quit compiler warnings. + (check_dir): the no_stat_dirs struct must not be const, since we do + indeed modify its contents. + + * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission + hook semantics. + + * gtk/gtksignal.h: + * gtk/gtksignal.c: + changed emission allocation, so we don't use a doubly linked list + but link ourselfs (singly linked). + changed emission hooks, they get the emision parameters passed as + well now and are emitted during the actuall signal emission (after + the RUN_FIRST class method, but prior to RUN_FIRST handlers). + the existing restrictions do still apply to signal emission hooks, + i.e. an emission may not be stopped or restarted from an emission hook. + due to possibly huge perfomance impacts, frequent use of emision hooks + is also not recommended. + (gtk_signal_next_and_invalidate): added an + assertments which explicits what the code assumes anyways: a + maximum amount of 65535 signals. + + * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), + gtk_container_foreach_full() should be used instead. + + * gtk/gtkmain.h: + deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since + we provide _full variants. + + * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide + gtk_signal_connect_full() for long enough now. + 1998-12-06 Marius Vollmer * gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c9db85d4ab..8a8c7f089c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,56 @@ +Mon Dec 7 03:08:39 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: reverted marius change to expose the type systems + internal type info data to the user. if such functionality is required + we should provide wrapped accessors, ala gtk_signal_query(). + + * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, + since it destroys the possibility to implement automatic marshaller + lookups some day, and it also disables third party code's ability to + connect to any signal. also the GtkTypeInfo structures are dynamically + allocated memory portions, so only the type system is really allowed + to access that stuff. + +Mon Dec 7 01:32:18 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the + Tab key on the entry. the focus shouldn't get lost even if completion + is attempted from an empty entry, since an empty entry string does + indeed have a valid completion meaning (complete all). + (gtk_file_selection_init): cast the gchar array parameter in calls to + gtk_clist_new_with_titles() to quit compiler warnings. + (check_dir): the no_stat_dirs struct must not be const, since we do + indeed modify its contents. + + * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission + hook semantics. + + * gtk/gtksignal.h: + * gtk/gtksignal.c: + changed emission allocation, so we don't use a doubly linked list + but link ourselfs (singly linked). + changed emission hooks, they get the emision parameters passed as + well now and are emitted during the actuall signal emission (after + the RUN_FIRST class method, but prior to RUN_FIRST handlers). + the existing restrictions do still apply to signal emission hooks, + i.e. an emission may not be stopped or restarted from an emission hook. + due to possibly huge perfomance impacts, frequent use of emision hooks + is also not recommended. + (gtk_signal_next_and_invalidate): added an + assertments which explicits what the code assumes anyways: a + maximum amount of 65535 signals. + + * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), + gtk_container_foreach_full() should be used instead. + + * gtk/gtkmain.h: + deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since + we provide _full variants. + + * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide + gtk_signal_connect_full() for long enough now. + 1998-12-06 Marius Vollmer * gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c9db85d4ab..8a8c7f089c 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,56 @@ +Mon Dec 7 03:08:39 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: reverted marius change to expose the type systems + internal type info data to the user. if such functionality is required + we should provide wrapped accessors, ala gtk_signal_query(). + + * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, + since it destroys the possibility to implement automatic marshaller + lookups some day, and it also disables third party code's ability to + connect to any signal. also the GtkTypeInfo structures are dynamically + allocated memory portions, so only the type system is really allowed + to access that stuff. + +Mon Dec 7 01:32:18 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the + Tab key on the entry. the focus shouldn't get lost even if completion + is attempted from an empty entry, since an empty entry string does + indeed have a valid completion meaning (complete all). + (gtk_file_selection_init): cast the gchar array parameter in calls to + gtk_clist_new_with_titles() to quit compiler warnings. + (check_dir): the no_stat_dirs struct must not be const, since we do + indeed modify its contents. + + * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission + hook semantics. + + * gtk/gtksignal.h: + * gtk/gtksignal.c: + changed emission allocation, so we don't use a doubly linked list + but link ourselfs (singly linked). + changed emission hooks, they get the emision parameters passed as + well now and are emitted during the actuall signal emission (after + the RUN_FIRST class method, but prior to RUN_FIRST handlers). + the existing restrictions do still apply to signal emission hooks, + i.e. an emission may not be stopped or restarted from an emission hook. + due to possibly huge perfomance impacts, frequent use of emision hooks + is also not recommended. + (gtk_signal_next_and_invalidate): added an + assertments which explicits what the code assumes anyways: a + maximum amount of 65535 signals. + + * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), + gtk_container_foreach_full() should be used instead. + + * gtk/gtkmain.h: + deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since + we provide _full variants. + + * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide + gtk_signal_connect_full() for long enough now. + 1998-12-06 Marius Vollmer * gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c9db85d4ab..8a8c7f089c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,56 @@ +Mon Dec 7 03:08:39 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: reverted marius change to expose the type systems + internal type info data to the user. if such functionality is required + we should provide wrapped accessors, ala gtk_signal_query(). + + * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, + since it destroys the possibility to implement automatic marshaller + lookups some day, and it also disables third party code's ability to + connect to any signal. also the GtkTypeInfo structures are dynamically + allocated memory portions, so only the type system is really allowed + to access that stuff. + +Mon Dec 7 01:32:18 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the + Tab key on the entry. the focus shouldn't get lost even if completion + is attempted from an empty entry, since an empty entry string does + indeed have a valid completion meaning (complete all). + (gtk_file_selection_init): cast the gchar array parameter in calls to + gtk_clist_new_with_titles() to quit compiler warnings. + (check_dir): the no_stat_dirs struct must not be const, since we do + indeed modify its contents. + + * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission + hook semantics. + + * gtk/gtksignal.h: + * gtk/gtksignal.c: + changed emission allocation, so we don't use a doubly linked list + but link ourselfs (singly linked). + changed emission hooks, they get the emision parameters passed as + well now and are emitted during the actuall signal emission (after + the RUN_FIRST class method, but prior to RUN_FIRST handlers). + the existing restrictions do still apply to signal emission hooks, + i.e. an emission may not be stopped or restarted from an emission hook. + due to possibly huge perfomance impacts, frequent use of emision hooks + is also not recommended. + (gtk_signal_next_and_invalidate): added an + assertments which explicits what the code assumes anyways: a + maximum amount of 65535 signals. + + * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), + gtk_container_foreach_full() should be used instead. + + * gtk/gtkmain.h: + deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since + we provide _full variants. + + * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide + gtk_signal_connect_full() for long enough now. + 1998-12-06 Marius Vollmer * gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c9db85d4ab..8a8c7f089c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,56 @@ +Mon Dec 7 03:08:39 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: reverted marius change to expose the type systems + internal type info data to the user. if such functionality is required + we should provide wrapped accessors, ala gtk_signal_query(). + + * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, + since it destroys the possibility to implement automatic marshaller + lookups some day, and it also disables third party code's ability to + connect to any signal. also the GtkTypeInfo structures are dynamically + allocated memory portions, so only the type system is really allowed + to access that stuff. + +Mon Dec 7 01:32:18 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the + Tab key on the entry. the focus shouldn't get lost even if completion + is attempted from an empty entry, since an empty entry string does + indeed have a valid completion meaning (complete all). + (gtk_file_selection_init): cast the gchar array parameter in calls to + gtk_clist_new_with_titles() to quit compiler warnings. + (check_dir): the no_stat_dirs struct must not be const, since we do + indeed modify its contents. + + * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission + hook semantics. + + * gtk/gtksignal.h: + * gtk/gtksignal.c: + changed emission allocation, so we don't use a doubly linked list + but link ourselfs (singly linked). + changed emission hooks, they get the emision parameters passed as + well now and are emitted during the actuall signal emission (after + the RUN_FIRST class method, but prior to RUN_FIRST handlers). + the existing restrictions do still apply to signal emission hooks, + i.e. an emission may not be stopped or restarted from an emission hook. + due to possibly huge perfomance impacts, frequent use of emision hooks + is also not recommended. + (gtk_signal_next_and_invalidate): added an + assertments which explicits what the code assumes anyways: a + maximum amount of 65535 signals. + + * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), + gtk_container_foreach_full() should be used instead. + + * gtk/gtkmain.h: + deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since + we provide _full variants. + + * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide + gtk_signal_connect_full() for long enough now. + 1998-12-06 Marius Vollmer * gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c9db85d4ab..8a8c7f089c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,56 @@ +Mon Dec 7 03:08:39 1998 Tim Janik + + * gtk/gtktypeutils.h: + * gtk/gtktypeutils.c: reverted marius change to expose the type systems + internal type info data to the user. if such functionality is required + we should provide wrapped accessors, ala gtk_signal_query(). + + * gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change, + since it destroys the possibility to implement automatic marshaller + lookups some day, and it also disables third party code's ability to + connect to any signal. also the GtkTypeInfo structures are dynamically + allocated memory portions, so only the type system is really allowed + to access that stuff. + +Mon Dec 7 01:32:18 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the + Tab key on the entry. the focus shouldn't get lost even if completion + is attempted from an empty entry, since an empty entry string does + indeed have a valid completion meaning (complete all). + (gtk_file_selection_init): cast the gchar array parameter in calls to + gtk_clist_new_with_titles() to quit compiler warnings. + (check_dir): the no_stat_dirs struct must not be const, since we do + indeed modify its contents. + + * gtk/testgtk.c (event_watcher): adapted prototype to fit new emission + hook semantics. + + * gtk/gtksignal.h: + * gtk/gtksignal.c: + changed emission allocation, so we don't use a doubly linked list + but link ourselfs (singly linked). + changed emission hooks, they get the emision parameters passed as + well now and are emitted during the actuall signal emission (after + the RUN_FIRST class method, but prior to RUN_FIRST handlers). + the existing restrictions do still apply to signal emission hooks, + i.e. an emission may not be stopped or restarted from an emission hook. + due to possibly huge perfomance impacts, frequent use of emision hooks + is also not recommended. + (gtk_signal_next_and_invalidate): added an + assertments which explicits what the code assumes anyways: a + maximum amount of 65535 signals. + + * gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(), + gtk_container_foreach_full() should be used instead. + + * gtk/gtkmain.h: + deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since + we provide _full variants. + + * gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide + gtk_signal_connect_full() for long enough now. + 1998-12-06 Marius Vollmer * gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller. diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index ceb0e83b31..c3576afd5b 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1154,6 +1154,7 @@ gtk_container_foreach_interp (GtkContainer *container, gpointer callback_data, GtkDestroyNotify notify) { + g_message ("gtk_container_foreach_interp() is deprecated"); gtk_container_foreach_full (container, NULL, marshal, callback_data, notify); } diff --git a/gtk/gtkcontainer.h b/gtk/gtkcontainer.h index a212f255d2..74047d58b9 100644 --- a/gtk/gtkcontainer.h +++ b/gtk/gtkcontainer.h @@ -109,10 +109,6 @@ void gtk_container_check_resize (GtkContainer *container); void gtk_container_foreach (GtkContainer *container, GtkCallback callback, gpointer callback_data); -void gtk_container_foreach_interp (GtkContainer *container, - GtkCallbackMarshal marshal, - gpointer callback_data, - GtkDestroyNotify notify); void gtk_container_foreach_full (GtkContainer *container, GtkCallback callback, GtkCallbackMarshal marshal, @@ -225,6 +221,11 @@ void gtk_container_unblock_resize (GtkContainer *container); /* Use gtk_container_check_resize() instead */ gint gtk_container_need_resize (GtkContainer *container); +/* use gtk_container_foreach_full() inistead */ +void gtk_container_foreach_interp (GtkContainer *container, + GtkCallbackMarshal marshal, + gpointer callback_data, + GtkDestroyNotify notify); #ifdef __cplusplus } diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 26bc7da030..1240f02264 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -407,7 +407,7 @@ gtk_file_selection_init (GtkFileSelection *filesel) gtk_widget_show (list_hbox); /* The directories clist */ - filesel->dir_list = gtk_clist_new_with_titles (1, dir_title); + filesel->dir_list = gtk_clist_new_with_titles (1, (gchar**) dir_title); gtk_widget_set_usize (filesel->dir_list, DIR_LIST_WIDTH, DIR_LIST_HEIGHT); gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row", (GtkSignalFunc) gtk_file_selection_dir_button, @@ -424,7 +424,7 @@ gtk_file_selection_init (GtkFileSelection *filesel) gtk_widget_show (scrolled_win); /* The files clist */ - filesel->file_list = gtk_clist_new_with_titles (1, file_title); + filesel->file_list = gtk_clist_new_with_titles (1, (gchar**) file_title); gtk_widget_set_usize (filesel->file_list, FILE_LIST_WIDTH, FILE_LIST_HEIGHT); gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row", (GtkSignalFunc) gtk_file_selection_file_button, @@ -1078,23 +1078,18 @@ gtk_file_selection_key_press (GtkWidget *widget, if (event->keyval == GDK_Tab) { - gboolean intercept; - fs = GTK_FILE_SELECTION (user_data); text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); - intercept = text && *text; - text = g_strdup (text); gtk_file_selection_populate (fs, text, TRUE); g_free (text); - if (intercept) - gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); - return intercept; + return TRUE; } return FALSE; @@ -2026,7 +2021,7 @@ check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs) * expensive. */ - static const struct { + static struct { gchar *name; gboolean present; struct stat statbuf; @@ -2043,9 +2038,9 @@ check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs) if (!initialized) { initialized = TRUE; - for (i=0; i= 1); - if (gtk_emission_check (current_emissions, object, signal_id)) + state = gtk_emission_check (current_emissions, object, signal_id); + if (state > 1) + g_warning ("gtk_signal_emit_stop(): emission (%u) for object `%s' cannot be stopped from emission hook", + signal_id, + gtk_type_name (GTK_OBJECT_TYPE (object))); + else if (state) { if (!gtk_emission_check (stop_emissions, object, signal_id)) gtk_emission_add (&stop_emissions, object, signal_id); @@ -623,21 +637,16 @@ guint gtk_signal_n_emissions (GtkObject *object, guint signal_id) { - GList *list; + GtkEmission *emission; guint n; g_return_val_if_fail (object != NULL, 0); g_return_val_if_fail (GTK_IS_OBJECT (object), 0); n = 0; - for (list = current_emissions; list; list = list->next) + for (emission = current_emissions; emission; emission = emission->next) { - GtkEmission *emission; - - emission = list->data; - - if ((emission->object == object) && - (emission->signal_id == signal_id)) + if (emission->object == object && emission->signal_id == signal_id) n++; } @@ -759,6 +768,8 @@ gtk_signal_connect_interp (GtkObject *object, GtkDestroyNotify destroy_func, gint after) { + g_message ("gtk_signal_connect_interp() is deprecated"); + return gtk_signal_connect_full (object, name, NULL, func, func_data, destroy_func, FALSE, after); } @@ -1346,16 +1357,10 @@ gtk_signal_real_emit (GtkObject *object, guint signal_id, GtkArg *params) { - static guint emission_hooks_called = 0; GtkSignal signal; GtkHandler *handlers; GtkSignalFunc signal_func; - - if (emission_hooks_called) - { - g_warning ("gtk_signal_real_emit() may not recurse from emission hooks"); - return; - } + GtkEmission *emission; /* gtk_handlers_run() expects a reentrant GtkSignal*, so we allocate * it locally on the stack. we save some lookups ourselves with this as well. @@ -1376,18 +1381,28 @@ gtk_signal_real_emit (GtkObject *object, signal_func); #endif /* G_ENABLE_DEBUG */ - if (signal.signal_flags & GTK_RUN_NO_RECURSE && - gtk_emission_check (current_emissions, object, signal_id)) + if (signal.signal_flags & GTK_RUN_NO_RECURSE) { - if (!gtk_emission_check (restart_emissions, object, signal_id)) - gtk_emission_add (&restart_emissions, object, signal_id); - - return; + gint state; + + state = gtk_emission_check (current_emissions, object, signal_id); + if (state) + { + if (state > 1) + g_warning ("gtk_signal_real_emit(): emission (%u) for object `%s' cannot be restarted from emission hook", + signal_id, + gtk_type_name (GTK_OBJECT_TYPE (object))); + else if (!gtk_emission_check (restart_emissions, object, signal_id)) + gtk_emission_add (&restart_emissions, object, signal_id); + + return; + } } gtk_object_ref (object); gtk_emission_add (¤t_emissions, object, signal_id); + emission = current_emissions; emission_restart: @@ -1410,6 +1425,19 @@ gtk_signal_real_emit (GtkObject *object, } } + if (signal.hook_list && !GTK_OBJECT_DESTROYED (object)) + { + GtkEmissionHookData data; + + data.object = object; + data.n_params = signal.nparams; + data.params = params; + data.signal_id = signal_id; + emission->in_hook = 1; + g_hook_list_marshal_check (signal.hook_list, TRUE, gtk_emission_hook_marshaller, &data); + emission->in_hook = 0; + } + if (GTK_OBJECT_CONNECTED (object)) { handlers = gtk_signal_get_handlers (object, signal_id); @@ -1475,19 +1503,6 @@ gtk_signal_real_emit (GtkObject *object, gtk_emission_remove (¤t_emissions, object, signal_id); - /* the hook invokation portion may not be moved! - */ - if (signal.hook_list && !GTK_OBJECT_DESTROYED (object)) - { - gpointer data[2]; - - data[0] = &signal; - data[1] = object; - emission_hooks_called++; - g_hook_list_marshal_check (signal.hook_list, TRUE, gtk_emission_hook_marshaller, &data); - emission_hooks_called--; - } - gtk_object_unref (object); } @@ -1646,15 +1661,15 @@ static gboolean gtk_emission_hook_marshaller (GHook *hook, gpointer data_p) { - gpointer *data = data_p; - GtkSignal *signal; + GtkEmissionHookData *data = data_p; GtkEmissionHook func; - signal = data[0]; func = hook->func; - if (!GTK_OBJECT_DESTROYED (data[1])) - return func (data[1], signal->signal_id, hook->data); + if (!GTK_OBJECT_DESTROYED (data->object)) + return func (data->object, data->signal_id, + data->n_params, data->params, + hook->data); else return TRUE; } @@ -1677,11 +1692,7 @@ gtk_signal_connect_by_type (GtkObject *object, g_return_val_if_fail (object != NULL, 0); g_return_val_if_fail (object->klass != NULL, 0); - /* A signal without a default marshaller can only take no_marshal - handlers. */ - signal = LOOKUP_SIGNAL_ID (signal_id); - g_return_val_if_fail (signal->marshaller || no_marshal, 0); /* Search through the signals for this object and make * sure the one we are adding is valid. We need to perform @@ -1744,36 +1755,38 @@ gtk_emission_new (void) { GtkEmission *emission; - if (!gtk_emission_free_list) + if (!gtk_free_emissions) { - GtkEmissionAllocator *emission_block; + GtkEmission *emission_block; guint i; - emission_block = g_new0 (GtkEmissionAllocator, EMISSION_BLOCK_SIZE); + emission_block = g_new0 (GtkEmission, EMISSION_BLOCK_SIZE); for (i = 1; i < EMISSION_BLOCK_SIZE; i++) { - (emission_block + i)->next = gtk_emission_free_list; - gtk_emission_free_list = (emission_block + i); + (emission_block + i)->next = gtk_free_emissions; + gtk_free_emissions = (emission_block + i); } - emission = &emission_block->emission; + emission = emission_block; } else { - emission = >k_emission_free_list->emission; - gtk_emission_free_list = gtk_emission_free_list->next; + emission = gtk_free_emissions; + gtk_free_emissions = emission->next; } emission->object = NULL; emission->signal_id = 0; + emission->in_hook = 0; + emission->next = NULL; return emission; } static void -gtk_emission_add (GList **emissions, - GtkObject *object, - guint signal_id) +gtk_emission_add (GtkEmission **emissions, + GtkObject *object, + guint signal_id) { GtkEmission *emission; @@ -1783,58 +1796,51 @@ gtk_emission_add (GList **emissions, emission = gtk_emission_new (); emission->object = object; emission->signal_id = signal_id; - - *emissions = g_list_prepend (*emissions, emission); + + emission->next = *emissions; + *emissions = emission; } static void -gtk_emission_remove (GList **emissions, - GtkObject *object, - guint signal_id) +gtk_emission_remove (GtkEmission **emissions, + GtkObject *object, + guint signal_id) { - GList *tmp; + GtkEmission *emission, *last; g_return_if_fail (emissions != NULL); - - tmp = *emissions; - while (tmp) - { - GtkEmissionAllocator *ea; - - ea = tmp->data; - - if ((ea->emission.object == object) && - (ea->emission.signal_id == signal_id)) - { - *emissions = g_list_remove_link (*emissions, tmp); - g_list_free (tmp); - ea->next = gtk_emission_free_list; - gtk_emission_free_list = ea; + last = NULL; + emission = *emissions; + while (emission) + { + if (emission->object == object && emission->signal_id == signal_id) + { + if (last) + last->next = emission->next; + else + *emissions = emission->next; + + emission->next = gtk_free_emissions; + gtk_free_emissions = emission; break; } - - tmp = tmp->next; + + last = emission; + emission = last->next; } } static gint -gtk_emission_check (GList *emissions, - GtkObject *object, - guint signal_id) +gtk_emission_check (GtkEmission *emission, + GtkObject *object, + guint signal_id) { - GtkEmission *emission; - GList *tmp; - - tmp = emissions; - while (tmp) + while (emission) { - emission = tmp->data; - tmp = tmp->next; - - if ((emission->object == object) && - (emission->signal_id == signal_id)) - return TRUE; + if (emission->object == object && emission->signal_id == signal_id) + return 1 + emission->in_hook; + emission = emission->next; } return FALSE; } diff --git a/gtk/gtksignal.h b/gtk/gtksignal.h index f9be8a870c..5287165b64 100644 --- a/gtk/gtksignal.h +++ b/gtk/gtksignal.h @@ -42,6 +42,8 @@ typedef void (*GtkSignalMarshal) (GtkObject *object, typedef void (*GtkSignalDestroy) (gpointer data); typedef gboolean (*GtkEmissionHook) (GtkObject *object, guint signal_id, + guint n_params, + GtkArg *params, gpointer data); @@ -123,12 +125,6 @@ guint gtk_signal_connect_full (GtkObject *object, GtkDestroyNotify destroy_func, gint object_signal, gint after); -guint gtk_signal_connect_interp (GtkObject *object, - const gchar *name, - GtkCallbackMarshal func, - gpointer data, - GtkDestroyNotify destroy_func, - gint after); void gtk_signal_connect_object_while_alive (GtkObject *object, const gchar *signal, @@ -189,6 +185,13 @@ void gtk_signal_set_funcs (GtkSignalMarshal marshal_func, */ GtkSignalQuery* gtk_signal_query (guint signal_id); +/* deprecated */ +guint gtk_signal_connect_interp (GtkObject *object, + const gchar *name, + GtkCallbackMarshal func, + gpointer data, + GtkDestroyNotify destroy_func, + gint after); #ifdef __cplusplus } diff --git a/gtk/gtktypeutils.c b/gtk/gtktypeutils.c index e515df6a19..b7fcf60f5e 100644 --- a/gtk/gtktypeutils.c +++ b/gtk/gtktypeutils.c @@ -257,23 +257,6 @@ gtk_type_unique (GtkType parent_type, return new_type; } -gboolean -gtk_type_get_info (GtkType type, - GtkTypeInfo *info) -{ - GtkTypeNode *node; - - if (info == NULL) - return FALSE; - - LOOKUP_TYPE_NODE (node, type); - if (node == NULL) - return FALSE; - - *info = node->type_info; - return TRUE; -} - gchar* gtk_type_name (GtkType type) { diff --git a/gtk/gtktypeutils.h b/gtk/gtktypeutils.h index 54e5137f9c..40e70c2c40 100644 --- a/gtk/gtktypeutils.h +++ b/gtk/gtktypeutils.h @@ -313,8 +313,6 @@ struct _GtkEnumValue void gtk_type_init (void); GtkType gtk_type_unique (GtkType parent_type, const GtkTypeInfo *type_info); -gboolean gtk_type_get_info (GtkType type, - GtkTypeInfo *info); void gtk_type_set_chunk_alloc (GtkType type, guint n_chunks); gchar* gtk_type_name (guint type); diff --git a/gtk/testgtk.c b/gtk/testgtk.c index 57e6147eb6..08e7edc599 100644 --- a/gtk/testgtk.c +++ b/gtk/testgtk.c @@ -5332,6 +5332,8 @@ static gboolean event_watcher_leave_id = 0; static gboolean event_watcher (GtkObject *object, guint signal_id, + guint n_params, + GtkArg *params, gpointer data) { g_print ("Watch: \"%s\" emitted for %s\n", @@ -5404,9 +5406,9 @@ create_event_watcher (void) gtk_widget_show (button); button = gtk_button_new_with_label ("Close"); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - dialog_window); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (gtk_widget_destroy), + (GtkObject*) dialog_window); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area), button, TRUE, TRUE, 0); diff --git a/tests/testgtk.c b/tests/testgtk.c index 57e6147eb6..08e7edc599 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -5332,6 +5332,8 @@ static gboolean event_watcher_leave_id = 0; static gboolean event_watcher (GtkObject *object, guint signal_id, + guint n_params, + GtkArg *params, gpointer data) { g_print ("Watch: \"%s\" emitted for %s\n", @@ -5404,9 +5406,9 @@ create_event_watcher (void) gtk_widget_show (button); button = gtk_button_new_with_label ("Close"); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - dialog_window); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (gtk_widget_destroy), + (GtkObject*) dialog_window); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area), button, TRUE, TRUE, 0);