Commit 33447a38 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

reverted marius change to expose the type systems internal type info data

Mon Dec  7 03:08:39 1998  Tim Janik  <timj@gtk.org>

        * 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  <timj@gtk.org>

        * 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.
parent 031aa464
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* 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 <timj@gtk.org>
* 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 <mvo@zagadka.ping.de>
* gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller.
......
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* 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 <timj@gtk.org>
* 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 <mvo@zagadka.ping.de>
* gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller.
......
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* 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 <timj@gtk.org>
* 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 <mvo@zagadka.ping.de>
* gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller.
......
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* 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 <timj@gtk.org>
* 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 <mvo@zagadka.ping.de>
* gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller.
......
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* 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 <timj@gtk.org>
* 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 <mvo@zagadka.ping.de>
* gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller.
......
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* 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 <timj@gtk.org>
* 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 <mvo@zagadka.ping.de>
* gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller.
......
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* 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 <timj@gtk.org>
* 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 <mvo@zagadka.ping.de>
* gtk/gtksignal.c (gtk_signal_newv): Allow a NULL marshaller.
......
......@@ -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);
}
......
......@@ -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
}
......
......@@ -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<n_no_stat_dirs; i++)
for (i = 0; i < n_no_stat_dirs; i++)
{
if (stat(no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0)
if (stat (no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0)
no_stat_dirs[i].present = TRUE;
}
}
......
......@@ -1091,6 +1091,7 @@ gtk_timeout_add_interp (guint32 interval,
gpointer data,
GtkDestroyNotify destroy)
{
g_message ("gtk_timeout_add_interp() is deprecated");
return gtk_timeout_add_full (interval, NULL, function, data, destroy);
}
......@@ -1252,6 +1253,7 @@ gtk_idle_add_interp (GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy)
{
g_message ("gtk_idle_add_interp() is deprecated");
return gtk_idle_add_full (GTK_PRIORITY_DEFAULT, NULL, marshal, data, destroy);
}
......
......@@ -86,18 +86,14 @@ guint gtk_quit_add_full (guint main_level,
GtkDestroyNotify destroy);
void gtk_quit_remove (guint quit_handler_id);
void gtk_quit_remove_by_data (gpointer data);
guint gtk_timeout_add (guint32 interval,
GtkFunction function,
gpointer data);
guint gtk_timeout_add_full (guint32 interval,
GtkFunction function,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy);
guint gtk_timeout_add (guint32 interval,
GtkFunction function,
gpointer data);
guint gtk_timeout_add_interp (guint32 interval,
GtkCallbackMarshal function,
gpointer data,
GtkDestroyNotify notify);
void gtk_timeout_remove (guint timeout_handler_id);
guint gtk_idle_add (GtkFunction function,
......@@ -110,9 +106,6 @@ guint gtk_idle_add_full (gint priority,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy);
guint gtk_idle_add_interp (GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy);
void gtk_idle_remove (guint idle_handler_id);
void gtk_idle_remove_by_data (gpointer data);
guint gtk_input_add_full (gint source,
......@@ -132,6 +125,15 @@ GdkEvent* gtk_get_current_event (void);
GtkWidget* gtk_get_event_widget (GdkEvent *event);
/* deprecated */
guint gtk_idle_add_interp (GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy);
guint gtk_timeout_add_interp (guint32 interval,
GtkCallbackMarshal function,
gpointer data,
GtkDestroyNotify notify);
#ifdef __cplusplus
}
#endif /* __cplusplus */
......
......@@ -43,7 +43,7 @@ typedef struct _GtkSignal GtkSignal;
typedef struct _GtkSignalHash GtkSignalHash;
typedef struct _GtkHandler GtkHandler;
typedef struct _GtkEmission GtkEmission;
typedef union _GtkEmissionAllocator GtkEmissionAllocator;
typedef struct _GtkEmissionHookData GtkEmissionHookData;
typedef struct _GtkDisconnectInfo GtkDisconnectInfo;
typedef void (*GtkSignalMarshaller0) (GtkObject *object,
......@@ -88,14 +88,18 @@ struct _GtkHandler
struct _GtkEmission
{
GtkObject *object;
guint signal_id;
GtkObject *object;
guint16 signal_id;
guint in_hook : 1;
GtkEmission *next;
};
union _GtkEmissionAllocator
struct _GtkEmissionHookData
{
GtkEmissionAllocator *next;
GtkEmission emission;
GtkObject *object;
guint signal_id;
guint n_params;
GtkArg *params;
};
struct _GtkDisconnectInfo
......@@ -132,13 +136,13 @@ static guint gtk_signal_connect_by_type (GtkObject *object,
gint no_marshal);
static guint gtk_alive_disconnecter (GtkDisconnectInfo *info);
static GtkEmission* gtk_emission_new (void);
static void gtk_emission_add (GList **emissions,
static void gtk_emission_add (GtkEmission **emissions,
GtkObject *object,
guint signal_type);
static void gtk_emission_remove (GList **emissions,
static void gtk_emission_remove (GtkEmission **emissions,
GtkObject *object,
guint signal_type);
static gint gtk_emission_check (GList *emissions,
static gint gtk_emission_check (GtkEmission *emissions,
GtkObject *object,
guint signal_type);
static gint gtk_handlers_run (GtkHandler *handlers,
......@@ -172,13 +176,13 @@ static guint gtk_n_signals = 0;
static GMemChunk *gtk_signal_hash_mem_chunk = NULL;
static GMemChunk *gtk_disconnect_info_mem_chunk = NULL;
static GtkHandler *gtk_handler_free_list = NULL;
static GtkEmissionAllocator *gtk_emission_free_list = NULL;
static GtkEmission *gtk_free_emissions = NULL;
static GList *current_emissions = NULL;
static GList *stop_emissions = NULL;
static GList *restart_emissions = NULL;
static GtkEmission *current_emissions = NULL;
static GtkEmission *stop_emissions = NULL;
static GtkEmission *restart_emissions = NULL;
static GtkSignal*
gtk_signal_next_and_invalidate (void)
......@@ -213,6 +217,8 @@ gtk_signal_next_and_invalidate (void)
new_signal_id = gtk_n_signals++;
gtk_n_free_signals--;
g_assert (gtk_n_signals < 65535);
signal = LOOKUP_SIGNAL_ID (new_signal_id);
if (signal)
......@@ -244,7 +250,7 @@ gtk_signal_init (void)
sizeof (GtkDisconnectInfo) * DISCONNECT_INFO_BLOCK_SIZE,
G_ALLOC_AND_FREE);
gtk_handler_free_list = NULL;
gtk_emission_free_list = NULL;
gtk_free_emissions = NULL;
gtk_signal_hash_table = g_hash_table_new (gtk_signal_hash,
gtk_signal_compare);
......@@ -268,6 +274,7 @@ gtk_signal_newv (const gchar *r_name,
gchar *name;
g_return_val_if_fail (r_name != NULL, 0);
g_return_val_if_fail (marshaller != NULL, 0);
g_return_val_if_fail (nparams < MAX_SIGNAL_PARAMS, 0);
if (nparams)
g_return_val_if_fail (params != NULL, 0);
......@@ -587,10 +594,17 @@ void
gtk_signal_emit_stop (GtkObject *object,
guint signal_id)
{
gint state;
g_return_if_fail (object != NULL);
g_return_if_fail (signal_id >= 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 (&current_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;