use the simpler g_signal_override_class_handler() instead of

2008-07-21  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktoolbar.c (gtk_toolbar_class_init): use the simpler
	g_signal_override_class_handler() instead of
	g_signal_override_class_closure().

	* gtk/gtktextview.c (gtk_text_view_class_init): ditto.

	(gtk_text_view_compat_move_focus): chain up using
	g_signal_chain_from_overridden_handler() instead of the generic
	g_signal_chain_from_overridden() which needs manual fiddling with
	millions of GValues.


svn path=/trunk/; revision=20880
This commit is contained in:
Michael Natterer 2008-07-21 12:27:30 +00:00 committed by Michael Natterer
parent d7cc567e33
commit b06c30bb51
3 changed files with 22 additions and 25 deletions

View File

@ -1,3 +1,16 @@
2008-07-21 Michael Natterer <mitch@imendio.com>
* gtk/gtktoolbar.c (gtk_toolbar_class_init): use the simpler
g_signal_override_class_handler() instead of
g_signal_override_class_closure().
* gtk/gtktextview.c (gtk_text_view_class_init): ditto.
(gtk_text_view_compat_move_focus): chain up using
g_signal_chain_from_overridden_handler() instead of the generic
g_signal_chain_from_overridden() which needs manual fiddling with
millions of GValues.
2008-07-21 Michael Natterer <mitch@imendio.com> 2008-07-21 Michael Natterer <mitch@imendio.com>
* gtk/gtkuimanager.c: remove redundant include. * gtk/gtkuimanager.c: remove redundant include.

View File

@ -492,14 +492,12 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
widget_class->expose_event = gtk_text_view_expose_event; widget_class->expose_event = gtk_text_view_expose_event;
widget_class->focus = gtk_text_view_focus; widget_class->focus = gtk_text_view_focus;
/* need to override the base class function via override_class_closure, /* need to override the base class function via override_class_handler,
* because the signal slot is not available in GtkWidgetCLass * because the signal slot is not available in GtkWidgetCLass
*/ */
g_signal_override_class_closure (g_signal_lookup ("move-focus", g_signal_override_class_handler ("move-focus",
GTK_TYPE_WIDGET),
GTK_TYPE_TEXT_VIEW, GTK_TYPE_TEXT_VIEW,
g_cclosure_new (G_CALLBACK (gtk_text_view_move_focus), G_CALLBACK (gtk_text_view_move_focus));
NULL, NULL));
widget_class->drag_begin = gtk_text_view_drag_begin; widget_class->drag_begin = gtk_text_view_drag_begin;
widget_class->drag_end = gtk_text_view_drag_end; widget_class->drag_end = gtk_text_view_drag_end;
@ -5756,22 +5754,10 @@ gtk_text_view_compat_move_focus (GtkTextView *text_view,
{ {
/* if this is a signal emission, chain up */ /* if this is a signal emission, chain up */
GValue instance_and_params[2] = { { 0, }, { 0, } }; gboolean retval;
GValue return_value = { 0, };
g_value_init (&instance_and_params[0], GTK_TYPE_WIDGET); g_signal_chain_from_overridden_handler (text_view,
g_value_set_object (&instance_and_params[0], text_view); direction_type, &retval);
g_value_init (&instance_and_params[1], GTK_TYPE_DIRECTION_TYPE);
g_value_set_enum (&instance_and_params[1], direction_type);
g_value_init (&return_value, G_TYPE_BOOLEAN);
g_signal_chain_from_overridden (instance_and_params, &return_value);
g_value_unset (&instance_and_params[0]);
g_value_unset (&instance_and_params[1]);
g_value_unset (&return_value);
} }
else else
{ {

View File

@ -378,14 +378,12 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
widget_class->style_set = gtk_toolbar_style_set; widget_class->style_set = gtk_toolbar_style_set;
widget_class->focus = gtk_toolbar_focus; widget_class->focus = gtk_toolbar_focus;
/* need to override the base class function via override_class_closure, /* need to override the base class function via override_class_handler,
* because the signal slot is not available in GtkWidgetClass * because the signal slot is not available in GtkWidgetClass
*/ */
g_signal_override_class_closure (g_signal_lookup ("move_focus", g_signal_override_class_handler ("move-focus",
GTK_TYPE_WIDGET),
GTK_TYPE_TOOLBAR, GTK_TYPE_TOOLBAR,
g_cclosure_new (G_CALLBACK (gtk_toolbar_move_focus), G_CALLBACK (gtk_toolbar_move_focus));
NULL, NULL));
widget_class->screen_changed = gtk_toolbar_screen_changed; widget_class->screen_changed = gtk_toolbar_screen_changed;
widget_class->realize = gtk_toolbar_realize; widget_class->realize = gtk_toolbar_realize;