[gtk/wip/matthiasc/focus2: 28/32] window: Remove ::set-focus
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/focus2: 28/32] window: Remove ::set-focus
- Date: Sun, 3 Mar 2019 19:10:54 +0000 (UTC)
commit aae1c0949d17fef0c43edb5bdf734037224ff481
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Mar 3 08:25:42 2019 -0500
window: Remove ::set-focus
The focus-widget is now a property, so we don't need
this signal anymore.
gtk/gtkwindow.c | 64 +++++++++++++++------------------------------------------
gtk/gtkwindow.h | 5 -----
2 files changed, 17 insertions(+), 52 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index a4d3bfd4ea..78f5b427b7 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -299,7 +299,6 @@ static const char *dnd_dest_targets [] = {
#endif
enum {
- SET_FOCUS,
ACTIVATE_FOCUS,
ACTIVATE_DEFAULT,
KEYS_CHANGED,
@@ -436,8 +435,6 @@ static void gtk_window_remove (GtkContainer *container,
static void gtk_window_forall (GtkContainer *container,
GtkCallback callback,
gpointer callback_data);
-static void gtk_window_real_set_focus (GtkWindow *window,
- GtkWidget *focus);
static void gtk_window_real_activate_default (GtkWindow *window);
static void gtk_window_real_activate_focus (GtkWindow *window);
@@ -832,8 +829,6 @@ gtk_window_class_init (GtkWindowClass *klass)
container_class->remove = gtk_window_remove;
container_class->forall = gtk_window_forall;
- klass->set_focus = gtk_window_real_set_focus;
-
klass->activate_default = gtk_window_real_activate_default;
klass->activate_focus = gtk_window_real_activate_focus;
klass->keys_changed = gtk_window_keys_changed;
@@ -1136,24 +1131,6 @@ gtk_window_class_init (GtkWindowClass *klass)
g_object_class_install_properties (gobject_class, LAST_ARG, window_props);
gtk_root_install_properties (gobject_class, LAST_ARG);
- /**
- * GtkWindow:set-focus:
- * @window: the window which received the signal
- * @widget: (nullable): the newly focused widget (or %NULL for no focus)
- *
- * This signal is emitted whenever the currently focused widget in
- * this window changes.
- */
- window_signals[SET_FOCUS] =
- g_signal_new (I_("set-focus"),
- G_TYPE_FROM_CLASS (gobject_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GtkWindowClass, set_focus),
- NULL, NULL,
- NULL,
- G_TYPE_NONE, 1,
- GTK_TYPE_WIDGET);
-
/**
* GtkWindow::activate-focus:
* @window: the window which received the signal
@@ -2794,27 +2771,6 @@ gtk_window_get_role (GtkWindow *window)
return priv->wm_role;
}
-/**
- * gtk_window_set_focus:
- * @window: a #GtkWindow
- * @focus: (allow-none): widget to be the new focus widget, or %NULL to unset
- * any focus widget for the toplevel window.
- *
- * If @focus is not the current focus widget, and is focusable, sets
- * it as the focus widget for the window. If @focus is %NULL, unsets
- * the focus widget for this window. To set the focus to a particular
- * widget in the toplevel, it is usually more convenient to use
- * gtk_widget_grab_focus() instead of this function.
- **/
-void
-gtk_window_set_focus (GtkWindow *window,
- GtkWidget *focus)
-{
- g_return_if_fail (GTK_IS_WINDOW (window));
-
- g_signal_emit (window, window_signals[SET_FOCUS], 0, focus);
-}
-
/**
* gtk_window_set_default:
* @window: a #GtkWindow
@@ -7270,10 +7226,24 @@ can_focus_widget (GtkWidget *widget)
return TRUE;
}
-static void
-gtk_window_real_set_focus (GtkWindow *window,
- GtkWidget *focus)
+/**
+ * gtk_window_set_focus:
+ * @window: a #GtkWindow
+ * @focus: (allow-none): widget to be the new focus widget, or %NULL to unset
+ * any focus widget for the toplevel window.
+ *
+ * If @focus is not the current focus widget, and is focusable, sets
+ * it as the focus widget for the window. If @focus is %NULL, unsets
+ * the focus widget for this window. To set the focus to a particular
+ * widget in the toplevel, it is usually more convenient to use
+ * gtk_widget_grab_focus() instead of this function.
+ **/
+void
+gtk_window_set_focus (GtkWindow *window,
+ GtkWidget *focus)
{
+ g_return_if_fail (GTK_IS_WINDOW (window));
+
if (focus && !can_focus_widget (focus))
return;
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index fb30ab99b8..280658b278 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -70,11 +70,6 @@ struct _GtkWindowClass
{
GtkBinClass parent_class;
- /*< public >*/
-
- void (* set_focus) (GtkWindow *window,
- GtkWidget *focus);
-
/* G_SIGNAL_ACTION signals for keybindings */
void (* activate_focus) (GtkWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]