remove _gtk_binding_signal_new().

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

	* gtk/gtkbindings.[ch]: remove _gtk_binding_signal_new().

	* gtk/gtkfilechooserdefault.c
	* gtk/gtkmenu.c
	* gtk/gtkmenushell.c
	* gtk/gtkscalebutton.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtkwidget.c: use g_signal_new_class_handler() instead. Add
	some missing I_() to the signal names.


svn path=/trunk/; revision=20874
This commit is contained in:
Michael Natterer 2008-07-21 09:48:20 +00:00 committed by Michael Natterer
parent c6bb5b4882
commit 7f00695920
11 changed files with 212 additions and 227 deletions

View File

@ -1,3 +1,16 @@
2008-07-21 Michael Natterer <mitch@imendio.com>
* gtk/gtkbindings.[ch]: remove _gtk_binding_signal_new().
* gtk/gtkfilechooserdefault.c
* gtk/gtkmenu.c
* gtk/gtkmenushell.c
* gtk/gtkscalebutton.c
* gtk/gtktextview.c
* gtk/gtktoolbar.c
* gtk/gtkwidget.c: use g_signal_new_class_handler() instead. Add
some missing I_() to the signal names.
2008-07-21 Michael Natterer <mitch@imendio.com>
* gtk/gtkspinbutton.c: remove g_return_if_fail() from private

View File

@ -1698,34 +1698,5 @@ _gtk_binding_reset_parsed (void)
}
}
guint
_gtk_binding_signal_new (const gchar *signal_name,
GType itype,
GSignalFlags signal_flags,
GCallback handler,
GSignalAccumulator accumulator,
gpointer accu_data,
GSignalCMarshaller c_marshaller,
GType return_type,
guint n_params,
...)
{
va_list args;
guint signal_id;
g_return_val_if_fail (signal_name != NULL, 0);
va_start (args, n_params);
signal_id = g_signal_new_valist (signal_name, itype, signal_flags,
g_cclosure_new (handler, NULL, NULL),
accumulator, accu_data, c_marshaller,
return_type, n_params, args);
va_end (args);
return signal_id;
}
#define __GTK_BINDINGS_C__
#include "gtkaliasdef.c"

View File

@ -154,21 +154,6 @@ void _gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
const gchar *signal_name,
GSList *binding_args);
/* Creates a signal with a fixed callback instead of a class offset;
* useful for key binding signals
*/
guint _gtk_binding_signal_new (const gchar *signal_name,
GType itype,
GSignalFlags signal_flags,
GCallback handler,
GSignalAccumulator accumulator,
gpointer accu_data,
GSignalCMarshaller c_marshaller,
GType return_type,
guint n_params,
...);
G_END_DECLS
#endif /* __GTK_BINDINGS_H__ */

View File

@ -540,7 +540,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
* Since: 2.12
*/
combo_box_signals[MOVE_ACTIVE] =
_gtk_binding_signal_new (I_("move-active"),
g_signal_new_class_handler (I_("move-active"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_combo_box_real_move_active),
@ -562,7 +562,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
* Since: 2.12
*/
combo_box_signals[POPUP] =
_gtk_binding_signal_new (I_("popup"),
g_signal_new_class_handler (I_("popup"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_combo_box_real_popup),
@ -582,7 +582,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
* Since: 2.12
*/
combo_box_signals[POPDOWN] =
_gtk_binding_signal_new (I_("popdown"),
g_signal_new_class_handler (I_("popdown"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_combo_box_real_popdown),

View File

@ -570,87 +570,97 @@ _gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class)
widget_class->size_allocate = gtk_file_chooser_default_size_allocate;
signals[LOCATION_POPUP] =
_gtk_binding_signal_new (I_("location-popup"),
g_signal_new_class_handler (I_("location-popup"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (location_popup_handler),
NULL, NULL,
_gtk_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
signals[LOCATION_POPUP_ON_PASTE] =
_gtk_binding_signal_new ("location-popup-on-paste",
g_signal_new_class_handler (I_("location-popup-on-paste"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (location_popup_on_paste_handler),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[LOCATION_TOGGLE_POPUP] =
_gtk_binding_signal_new (I_("location-toggle-popup"),
g_signal_new_class_handler (I_("location-toggle-popup"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (location_toggle_popup_handler),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[UP_FOLDER] =
_gtk_binding_signal_new (I_("up-folder"),
g_signal_new_class_handler (I_("up-folder"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (up_folder_handler),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[DOWN_FOLDER] =
_gtk_binding_signal_new (I_("down-folder"),
g_signal_new_class_handler (I_("down-folder"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (down_folder_handler),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[HOME_FOLDER] =
_gtk_binding_signal_new (I_("home-folder"),
g_signal_new_class_handler (I_("home-folder"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (home_folder_handler),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[DESKTOP_FOLDER] =
_gtk_binding_signal_new (I_("desktop-folder"),
g_signal_new_class_handler (I_("desktop-folder"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (desktop_folder_handler),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[QUICK_BOOKMARK] =
_gtk_binding_signal_new (I_("quick-bookmark"),
g_signal_new_class_handler (I_("quick-bookmark"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (quick_bookmark_handler),
NULL, NULL,
_gtk_marshal_VOID__INT,
G_TYPE_NONE, 1, G_TYPE_INT);
signals[SHOW_HIDDEN] =
_gtk_binding_signal_new ("show-hidden",
g_signal_new_class_handler (I_("show-hidden"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (show_hidden_handler),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[SEARCH_SHORTCUT] =
_gtk_binding_signal_new ("search-shortcut",
g_signal_new_class_handler (I_("search-shortcut"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (search_shortcut_handler),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[RECENT_SHORTCUT] =
_gtk_binding_signal_new ("recent-shortcut",
g_signal_new_class_handler (I_("recent-shortcut"),
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
G_CALLBACK (recent_shortcut_handler),

View File

@ -479,7 +479,7 @@ gtk_menu_class_init (GtkMenuClass *class)
menu_shell_class->move_current = gtk_menu_move_current;
menu_signals[MOVE_SCROLL] =
_gtk_binding_signal_new (I_("move_scroll"),
g_signal_new_class_handler (I_("move_scroll"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_menu_real_move_scroll),

View File

@ -250,6 +250,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
menu_shell_signals[SELECTION_DONE] =
g_signal_new (I_("selection-done"),
G_OBJECT_CLASS_TYPE (object_class),
@ -258,6 +259,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
menu_shell_signals[MOVE_CURRENT] =
g_signal_new (I_("move_current"),
G_OBJECT_CLASS_TYPE (object_class),
@ -267,6 +269,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
_gtk_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
GTK_TYPE_MENU_DIRECTION_TYPE);
menu_shell_signals[ACTIVATE_CURRENT] =
g_signal_new (I_("activate_current"),
G_OBJECT_CLASS_TYPE (object_class),
@ -276,6 +279,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
_gtk_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
menu_shell_signals[CANCEL] =
g_signal_new (I_("cancel"),
G_OBJECT_CLASS_TYPE (object_class),
@ -284,8 +288,9 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
menu_shell_signals[CYCLE_FOCUS] =
_gtk_binding_signal_new (I_("cycle_focus"),
g_signal_new_class_handler (I_("cycle_focus"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_real_menu_shell_cycle_focus),
@ -293,6 +298,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
_gtk_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
GTK_TYPE_DIRECTION_TYPE);
/**
* GtkMenuShell::move-selected:
* @menu_shell: the object on which the signal is emitted

View File

@ -282,7 +282,7 @@ gtk_scale_button_class_init (GtkScaleButtonClass *klass)
* Since: 2.12
*/
signals[POPUP] =
_gtk_binding_signal_new (I_("popup"),
g_signal_new_class_handler (I_("popup"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_scale_button_popup),
@ -303,7 +303,7 @@ gtk_scale_button_class_init (GtkScaleButtonClass *klass)
* Since: 2.12
*/
signals[POPDOWN] =
_gtk_binding_signal_new (I_("popdown"),
g_signal_new_class_handler (I_("popdown"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_scale_button_popdown),

View File

@ -756,7 +756,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
* There are no default bindings for this signal.
*/
signals[MOVE_VIEWPORT] =
_gtk_binding_signal_new (I_("move_viewport"),
g_signal_new_class_handler (I_("move_viewport"),
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_text_view_move_viewport),
@ -951,7 +951,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
* for selecting and Shift-Ctrl-a and Ctrl-\ for unselecting.
*/
signals[SELECT_ALL] =
_gtk_binding_signal_new (I_("select_all"),
g_signal_new_class_handler (I_("select_all"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_text_view_select_all),
@ -970,7 +970,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
* The default binding for this signal is F7.
*/
signals[TOGGLE_CURSOR_VISIBLE] =
_gtk_binding_signal_new (I_("toggle_cursor_visible"),
g_signal_new_class_handler (I_("toggle_cursor_visible"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_text_view_toggle_cursor_visible),

View File

@ -478,7 +478,7 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
* Return value: %TRUE if the signal was handled, %FALSE if not
*/
toolbar_signals[FOCUS_HOME_OR_END] =
_gtk_binding_signal_new (I_("focus_home_or_end"),
g_signal_new_class_handler (I_("focus_home_or_end"),
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_toolbar_focus_home_or_end),

View File

@ -914,7 +914,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
G_TYPE_BOOLEAN, 1,
GTK_TYPE_DIRECTION_TYPE);
widget_signals[MOVE_FOCUS] =
_gtk_binding_signal_new (I_("move_focus"),
g_signal_new_class_handler (I_("move_focus"),
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_widget_real_move_focus),
@ -1106,7 +1106,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
* Since: 2.12
**/
widget_signals[KEYNAV_FAILED] =
_gtk_binding_signal_new (I_("keynav-failed"),
g_signal_new_class_handler (I_("keynav-failed"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
G_CALLBACK (gtk_widget_real_keynav_failed),