Commit 888470ee authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]

Thu Feb 12 23:59:49 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
	  gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h

 	  Replaced all _interp functions with _full functions.
	  (_interp functions left in for compatibility until 0.99.5).
	  Difference: _full functions take _both_ a C-language callback and a
	  marshaller, and simply ignore the C-language callback
	  if the marshaller is present. This allows the destroy notification
	  to be used without marshalling.

	  gtk_selection_add_handler[_full]() regularized to agree
	  with other callbacks.

	  Also, added gtk_input_add_full() to the header file.
	  (gtk_input_add_interp() was never there)

	* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
	  Added new function gtk_idle_add_priority to create
	  an idle with a specified priority (default is zero)
	  constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
	  (redraws, resizes run at GTK_PRIORITY_INTERNAL)

	* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
  	  to gtkselection.c.
parent dd07df15
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h
Replaced all _interp functions with _full functions.
(_interp functions left in for compatibility until 0.99.5).
Difference: _full functions take _both_ a C-language callback and a
marshaller, and simply ignore the C-language callback
if the marshaller is present. This allows the destroy notification
to be used without marshalling.
gtk_selection_add_handler[_full]() regularized to agree
with other callbacks.
Also, added gtk_input_add_full() to the header file.
(gtk_input_add_interp() was never there)
* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
Added new function gtk_idle_add_priority to create
an idle with a specified priority (default is zero)
constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
(redraws, resizes run at GTK_PRIORITY_INTERNAL)
* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
to gtkselection.c.
* gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c
gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc:
Change style->white to style->base[] where appropriate.
Change the default style to make this apparent. (Yes, its
ugly... it can be removed later)
Tue Feb 10 15:01:44 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify
field, and gtk_object_set_data_full() to match.
* gtk/gtkobject.c (gtk_object_finalize): ObjectData structures
were being added to a free list, then forgotten about. Just
rely on GMemChunk instead.
2018-02-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkclist.c:
......
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h
Replaced all _interp functions with _full functions.
(_interp functions left in for compatibility until 0.99.5).
Difference: _full functions take _both_ a C-language callback and a
marshaller, and simply ignore the C-language callback
if the marshaller is present. This allows the destroy notification
to be used without marshalling.
gtk_selection_add_handler[_full]() regularized to agree
with other callbacks.
Also, added gtk_input_add_full() to the header file.
(gtk_input_add_interp() was never there)
* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
Added new function gtk_idle_add_priority to create
an idle with a specified priority (default is zero)
constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
(redraws, resizes run at GTK_PRIORITY_INTERNAL)
* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
to gtkselection.c.
* gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c
gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc:
Change style->white to style->base[] where appropriate.
Change the default style to make this apparent. (Yes, its
ugly... it can be removed later)
Tue Feb 10 15:01:44 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify
field, and gtk_object_set_data_full() to match.
* gtk/gtkobject.c (gtk_object_finalize): ObjectData structures
were being added to a free list, then forgotten about. Just
rely on GMemChunk instead.
2018-02-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkclist.c:
......
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h
Replaced all _interp functions with _full functions.
(_interp functions left in for compatibility until 0.99.5).
Difference: _full functions take _both_ a C-language callback and a
marshaller, and simply ignore the C-language callback
if the marshaller is present. This allows the destroy notification
to be used without marshalling.
gtk_selection_add_handler[_full]() regularized to agree
with other callbacks.
Also, added gtk_input_add_full() to the header file.
(gtk_input_add_interp() was never there)
* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
Added new function gtk_idle_add_priority to create
an idle with a specified priority (default is zero)
constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
(redraws, resizes run at GTK_PRIORITY_INTERNAL)
* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
to gtkselection.c.
* gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c
gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc:
Change style->white to style->base[] where appropriate.
Change the default style to make this apparent. (Yes, its
ugly... it can be removed later)
Tue Feb 10 15:01:44 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify
field, and gtk_object_set_data_full() to match.
* gtk/gtkobject.c (gtk_object_finalize): ObjectData structures
were being added to a free list, then forgotten about. Just
rely on GMemChunk instead.
2018-02-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkclist.c:
......
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h
Replaced all _interp functions with _full functions.
(_interp functions left in for compatibility until 0.99.5).
Difference: _full functions take _both_ a C-language callback and a
marshaller, and simply ignore the C-language callback
if the marshaller is present. This allows the destroy notification
to be used without marshalling.
gtk_selection_add_handler[_full]() regularized to agree
with other callbacks.
Also, added gtk_input_add_full() to the header file.
(gtk_input_add_interp() was never there)
* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
Added new function gtk_idle_add_priority to create
an idle with a specified priority (default is zero)
constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
(redraws, resizes run at GTK_PRIORITY_INTERNAL)
* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
to gtkselection.c.
* gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c
gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc:
Change style->white to style->base[] where appropriate.
Change the default style to make this apparent. (Yes, its
ugly... it can be removed later)
Tue Feb 10 15:01:44 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify
field, and gtk_object_set_data_full() to match.
* gtk/gtkobject.c (gtk_object_finalize): ObjectData structures
were being added to a free list, then forgotten about. Just
rely on GMemChunk instead.
2018-02-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkclist.c:
......
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h
Replaced all _interp functions with _full functions.
(_interp functions left in for compatibility until 0.99.5).
Difference: _full functions take _both_ a C-language callback and a
marshaller, and simply ignore the C-language callback
if the marshaller is present. This allows the destroy notification
to be used without marshalling.
gtk_selection_add_handler[_full]() regularized to agree
with other callbacks.
Also, added gtk_input_add_full() to the header file.
(gtk_input_add_interp() was never there)
* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
Added new function gtk_idle_add_priority to create
an idle with a specified priority (default is zero)
constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
(redraws, resizes run at GTK_PRIORITY_INTERNAL)
* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
to gtkselection.c.
* gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c
gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc:
Change style->white to style->base[] where appropriate.
Change the default style to make this apparent. (Yes, its
ugly... it can be removed later)
Tue Feb 10 15:01:44 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify
field, and gtk_object_set_data_full() to match.
* gtk/gtkobject.c (gtk_object_finalize): ObjectData structures
were being added to a free list, then forgotten about. Just
rely on GMemChunk instead.
2018-02-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkclist.c:
......
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h
Replaced all _interp functions with _full functions.
(_interp functions left in for compatibility until 0.99.5).
Difference: _full functions take _both_ a C-language callback and a
marshaller, and simply ignore the C-language callback
if the marshaller is present. This allows the destroy notification
to be used without marshalling.
gtk_selection_add_handler[_full]() regularized to agree
with other callbacks.
Also, added gtk_input_add_full() to the header file.
(gtk_input_add_interp() was never there)
* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
Added new function gtk_idle_add_priority to create
an idle with a specified priority (default is zero)
constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
(redraws, resizes run at GTK_PRIORITY_INTERNAL)
* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
to gtkselection.c.
* gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c
gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc:
Change style->white to style->base[] where appropriate.
Change the default style to make this apparent. (Yes, its
ugly... it can be removed later)
Tue Feb 10 15:01:44 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify
field, and gtk_object_set_data_full() to match.
* gtk/gtkobject.c (gtk_object_finalize): ObjectData structures
were being added to a free list, then forgotten about. Just
rely on GMemChunk instead.
2018-02-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkclist.c:
......
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h
Replaced all _interp functions with _full functions.
(_interp functions left in for compatibility until 0.99.5).
Difference: _full functions take _both_ a C-language callback and a
marshaller, and simply ignore the C-language callback
if the marshaller is present. This allows the destroy notification
to be used without marshalling.
gtk_selection_add_handler[_full]() regularized to agree
with other callbacks.
Also, added gtk_input_add_full() to the header file.
(gtk_input_add_interp() was never there)
* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
Added new function gtk_idle_add_priority to create
an idle with a specified priority (default is zero)
constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
(redraws, resizes run at GTK_PRIORITY_INTERNAL)
* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
to gtkselection.c.
* gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c
gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc:
Change style->white to style->base[] where appropriate.
Change the default style to make this apparent. (Yes, its
ugly... it can be removed later)
Tue Feb 10 15:01:44 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify
field, and gtk_object_set_data_full() to match.
* gtk/gtkobject.c (gtk_object_finalize): ObjectData structures
were being added to a free list, then forgotten about. Just
rely on GMemChunk instead.
2018-02-11 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkclist.c:
......
......@@ -1101,11 +1101,11 @@ gdk_timer_disable ()
}
gint
gdk_input_add_interp (gint source,
GdkInputCondition condition,
GdkInputFunction function,
gpointer data,
GdkDestroyNotify destroy)
gdk_input_add_full (gint source,
GdkInputCondition condition,
GdkInputFunction function,
gpointer data,
GdkDestroyNotify destroy)
{
static gint next_tag = 1;
GList *list;
......
......@@ -57,11 +57,12 @@ void gdk_timer_set (guint32 milliseconds);
void gdk_timer_enable (void);
void gdk_timer_disable (void);
gint gdk_input_add_interp (gint source,
gint gdk_input_add_full (gint source,
GdkInputCondition condition,
GdkInputFunction function,
gpointer data,
GdkDestroyNotify destroy);
#define gdk_input_add_interp gdk_input_add_full
gint gdk_input_add (gint source,
GdkInputCondition condition,
GdkInputFunction function,
......
......@@ -1101,11 +1101,11 @@ gdk_timer_disable ()
}
gint
gdk_input_add_interp (gint source,
GdkInputCondition condition,
GdkInputFunction function,
gpointer data,
GdkDestroyNotify destroy)
gdk_input_add_full (gint source,
GdkInputCondition condition,
GdkInputFunction function,
gpointer data,
GdkDestroyNotify destroy)
{
static gint next_tag = 1;
GList *list;
......
......@@ -428,17 +428,33 @@ gtk_container_foreach_unmarshal (GtkWidget *child,
void
gtk_container_foreach_interp (GtkContainer *container,
GtkCallbackMarshal callback,
GtkCallbackMarshal marshal,
gpointer callback_data,
GtkDestroyNotify notify)
{
GtkForeachData fdata;
fdata.container = GTK_OBJECT (container);
fdata.callback = callback;
fdata.callback_data = callback_data;
gtk_container_foreach_full (container, NULL, marshal,
callback_data, notify);
}
void
gtk_container_foreach_full (GtkContainer *container,
GtkCallback callback,
GtkCallbackMarshal marshal,
gpointer callback_data,
GtkDestroyNotify notify)
{
if (marshal)
{
GtkForeachData fdata;
gtk_container_foreach (container, gtk_container_foreach_unmarshal, &fdata);
fdata.container = GTK_OBJECT (container);
fdata.callback = marshal;
fdata.callback_data = callback_data;
gtk_container_foreach (container, gtk_container_foreach_unmarshal, &fdata);
}
else
gtk_container_foreach (container, callback, &callback_data);
notify (callback_data);
}
......
......@@ -89,7 +89,12 @@ void gtk_container_foreach (GtkContainer *container,
GtkCallback callback,
gpointer callback_data);
void gtk_container_foreach_interp (GtkContainer *container,
GtkCallbackMarshal callback,
GtkCallbackMarshal marshal,
gpointer callback_data,
GtkDestroyNotify notify);
void gtk_container_foreach_full (GtkContainer *container,
GtkCallback callback,
GtkCallbackMarshal marshal,
gpointer callback_data,
GtkDestroyNotify notify);
gint gtk_container_focus (GtkContainer *container,
......
......@@ -54,8 +54,8 @@ struct _GtkTimeoutFunction
guint32 start;
guint32 interval;
guint32 originterval;
gint interp;
GtkFunction function;
GtkCallbackMarshal marshal;
gpointer data;
GtkDestroyNotify destroy;
};
......@@ -63,7 +63,8 @@ struct _GtkTimeoutFunction
struct _GtkIdleFunction
{
gint tag;
gint interp;
gint priority;
GtkCallbackMarshal marshal;
GtkFunction function;
gpointer data;
GtkDestroyNotify destroy;
......@@ -593,16 +594,18 @@ gtk_invoke_key_snoopers (GtkWidget *grab_widget,
return return_val;
}
static gint
gtk_timeout_add_internal (guint32 interval,
gint interp,
GtkFunction function,
gpointer data,
GtkDestroyNotify destroy)
gint
gtk_timeout_add_full (guint32 interval,
GtkFunction function,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy)
{
static gint timeout_tag = 1;
GtkTimeoutFunction *timeoutf;
g_return_val_if_fail ((function != NULL) || (marshal != NULL), 0);
/* Create a new timeout function structure.
* The start time is the current time.
*/
......@@ -616,8 +619,8 @@ gtk_timeout_add_internal (guint32 interval,
timeoutf->start = gdk_time_get ();
timeoutf->interval = interval;
timeoutf->originterval = interval;
timeoutf->interp = interp;
timeoutf->function = function;
timeoutf->marshal = marshal;
timeoutf->data = data;
timeoutf->destroy = destroy;
......@@ -639,7 +642,7 @@ gtk_timeout_add (guint32 interval,
GtkFunction function,
gpointer data)
{
return gtk_timeout_add_internal (interval, FALSE, function, data, NULL);
return gtk_timeout_add_full (interval, function, FALSE, data, NULL);
}
gint
......@@ -648,9 +651,7 @@ gtk_timeout_add_interp (guint32 interval,
gpointer data,
GtkDestroyNotify destroy)
{
return gtk_timeout_add_internal (interval, TRUE,
(GtkFunction) function,
data, destroy);
return gtk_timeout_add_full (interval, NULL, function, data, destroy);
}
void
......@@ -698,15 +699,19 @@ gtk_timeout_remove (gint tag)
}
}
static gint
gtk_idle_add_internal (gint interp,
GtkFunction function,
gpointer data,
GtkDestroyNotify destroy)
gint
gtk_idle_add_full (gint priority,
GtkFunction function,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy)
{
static gint idle_tag = 1;
GtkIdleFunction *idlef;
GtkIdleFunction *idlef, *temp;
GList *tmp_list, *new_list;
g_return_val_if_fail ((function != NULL) || (marshal != NULL), 0);
if (!idle_mem_chunk)
idle_mem_chunk = g_mem_chunk_new ("idle mem chunk", sizeof (GtkIdleFunction),
1024, G_ALLOC_AND_FREE);
......@@ -714,16 +719,52 @@ gtk_idle_add_internal (gint interp,
idlef = g_chunk_new (GtkIdleFunction, idle_mem_chunk);
idlef->tag = idle_tag++;
idlef->interp = interp;
idlef->priority = priority;
idlef->function = function;
idlef->marshal = marshal;
idlef->data = data;
idlef->destroy = destroy;
/* Insert the idle function into the list of idle functions
* sorted by priority. This really should just use
* glist_insert_sorted, but that ignores duplicates
*/
tmp_list = idle_functions;
while (tmp_list)
{
temp = tmp_list->data;
if (idlef->priority < temp->priority)
{
new_list = g_list_alloc ();
new_list->data = idlef;
new_list->next = tmp_list;
new_list->prev = tmp_list->prev;
if (tmp_list->prev)
tmp_list->prev->next = new_list;
tmp_list->prev = new_list;
if (tmp_list == idle_functions)
idle_functions = new_list;
return idlef->tag;
}
tmp_list = tmp_list->next;
}
idle_functions = g_list_append (idle_functions, idlef);
return idlef->tag;
}
gint
gtk_idle_add_interp (GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy)
{
return gtk_idle_add_full (GTK_PRIORITY_DEFAULT, NULL, marshal, data, destroy);
}
static void
gtk_idle_destroy (GtkIdleFunction *idlef)
{
......@@ -736,15 +777,15 @@ gint
gtk_idle_add (GtkFunction function,
gpointer data)
{
return gtk_idle_add_internal (FALSE, function, data, NULL);
return gtk_idle_add_full (GTK_PRIORITY_DEFAULT, function, NULL, data, NULL);
}
gint
gtk_idle_add_interp (GtkCallbackMarshal function,
gpointer data,
GtkDestroyNotify destroy)
gint
gtk_idle_add_priority (gint priority,
GtkFunction function,
gpointer data)
{
return gtk_idle_add_internal (TRUE, (GtkFunction)function, data, destroy);
return gtk_idle_add_full (priority, function, NULL, data, NULL);
}
void
......@@ -855,6 +896,31 @@ gtk_destroy_input_function (GtkInputFunction *input)
g_free (input);
}
gint
gtk_input_add_full (gint source,
GdkInputCondition condition,
GdkInputFunction function,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy)
{
if (marshal)
{
GtkInputFunction *input = g_new (GtkInputFunction, 1);
input->callback = marshal;
input->data = data;
input->destroy = destroy;
return gdk_input_add_interp (source,
condition,
(GdkInputFunction) gtk_invoke_input_function,
input,
(GdkDestroyNotify) gtk_destroy_input_function);
}
else
return gdk_input_add_interp (source, condition, function, data, destroy);
}
gint
gtk_input_add_interp (gint source,
GdkInputCondition condition,
......@@ -862,15 +928,7 @@ gtk_input_add_interp (gint source,
gpointer data,
GtkDestroyNotify destroy)
{
GtkInputFunction *input = g_new (GtkInputFunction, 1);
input->callback = callback;
input->data = data;
input->destroy = destroy;
return gdk_input_add_interp (source,
condition,
(GdkInputFunction) gtk_invoke_input_function,
input,
(GdkDestroyNotify) gtk_destroy_input_function);
gdk_input_add_full (source, condition, NULL, callback, data);
}
void
......@@ -952,7 +1010,7 @@ gtk_timeout_insert (GtkTimeoutFunction *timeoutf)
static gint
gtk_invoke_timeout_function (GtkTimeoutFunction *timeoutf)
{
if (!timeoutf->interp)
if (!timeoutf->marshal)
return timeoutf->function (timeoutf->data);
else
{
......@@ -1040,7 +1098,7 @@ gtk_handle_timeouts ()
static gint
gtk_idle_invoke_function (GtkIdleFunction *idlef)
{
if (!idlef->interp)
if (!idlef->marshal)
return idlef->function (idlef->data);
else
{
......@@ -1049,9 +1107,9 @@ gtk_idle_invoke_function (GtkIdleFunction *idlef)
args[0].name = NULL;
args[0].type = GTK_TYPE_BOOL;
args[0].d.pointer_data = &ret_val;
((GtkCallbackMarshal)idlef->function) (NULL,
idlef->data,
0, args);
((GtkCallbackMarshal)idlef->marshal) (NULL,
idlef->data,
0, args);
return ret_val;
}
}
......@@ -1060,6 +1118,7 @@ static void
gtk_handle_current_idles ()
{
GList *tmp_list;
GList *tmp_list2;
GtkIdleFunction *idlef;
while (current_idles)
......@@ -1076,7 +1135,30 @@ gtk_handle_current_idles ()
}
else
{
idle_functions = g_list_concat (idle_functions, tmp_list);
/* Insert the idle function back into the list of idle
* functions at the end of the idles of this priority
*/
tmp_list2 = idle_functions;
while (tmp_list2 &&
(((GtkIdleFunction *)tmp_list2->data)->priority <= idlef->priority))
tmp_list2 = tmp_list2->next;
if (!tmp_list2)
idle_functions = g_list_concat (idle_functions, tmp_list);
else if (tmp_list2 == idle_functions)
{
tmp_list->next = idle_functions;
if (idle_functions)
idle_functions->prev = tmp_list;
idle_functions = tmp_list;
}
else
{
tmp_list->prev = tmp_list2->prev;
tmp_list->next = tmp_list2;
tmp_list2->prev->next = tmp_list;
tmp_list2->prev = tmp_list;
}
}
}
}
......@@ -1089,10 +1171,27 @@ gtk_handle_idle ()
*/
g_assert (current_idles == NULL);
/* Handle only the idle functions that have the highest priority */
if (idle_functions)
{
GList *tmp_list;
gint top_priority;
tmp_list = idle_functions;
top_priority = ((GtkIdleFunction *)tmp_list->data)->priority;
while (tmp_list &&
(((GtkIdleFunction *)tmp_list->data)->priority == top_priority))
tmp_list = tmp_list->next;
current_idles = idle_functions;
idle_functions = NULL;
idle_functions = tmp_list;
if (tmp_list)
{
tmp_list->prev->next = NULL;
tmp_list->prev = NULL;
}
gtk_handle_current_idles();
}
......
......@@ -27,6 +27,10 @@
extern "C" {
#endif /* __cplusplus */
#define GTK_PRIORITY_HIGH -20
#define GTK_PRIORITY_INTERNAL -10
#define GTK_PRIORITY_DEFAULT 0
#define GTK_PRIORITY_LOW 10