[gnome-builder/wip/gtk4-port: 102/1774] libide/gtk: more cleanup and removal from gui




commit 769e9a30599b5f7fb7e88e4afc2cfeaa1d8f9e75
Author: Christian Hergert <chergert redhat com>
Date:   Mon Mar 28 14:18:52 2022 -0700

    libide/gtk: more cleanup and removal from gui

 src/libide/gtk/ide-gtk.h         | 10 +++---
 src/libide/gui/ide-gui-global.c  | 78 ----------------------------------------
 src/libide/gui/ide-gui-global.h  |  7 ----
 src/libide/gui/ide-gui-private.h |  2 --
 4 files changed, 5 insertions(+), 92 deletions(-)
---
diff --git a/src/libide/gtk/ide-gtk.h b/src/libide/gtk/ide-gtk.h
index cbfa1eb57..a24a95688 100644
--- a/src/libide/gtk/ide-gtk.h
+++ b/src/libide/gtk/ide-gtk.h
@@ -31,11 +31,11 @@
 G_BEGIN_DECLS
 
 IDE_AVAILABLE_IN_ALL
-gboolean      ide_gtk_show_uri_on_window     (GtkWindow                *window,
-                                              const gchar              *uri,
-                                              gint64                    timestamp,
-                                              GError                  **error);
+gboolean ide_gtk_show_uri_on_window (GtkWindow   *window,
+                                     const char  *uri,
+                                     gint64       timestamp,
+                                     GError     **error);
 IDE_AVAILABLE_IN_ALL
-void          ide_gtk_window_present         (GtkWindow                *window);
+void     ide_gtk_window_present     (GtkWindow   *window);
 
 G_END_DECLS
diff --git a/src/libide/gui/ide-gui-global.c b/src/libide/gui/ide-gui-global.c
index dd6010af6..1ce6fede9 100644
--- a/src/libide/gui/ide-gui-global.c
+++ b/src/libide/gui/ide-gui-global.c
@@ -307,81 +307,3 @@ ide_widget_reveal_and_grab (GtkWidget *widget)
   show_parents (widget);
   gtk_widget_grab_focus (widget);
 }
-
-static void
-split_action_name (const gchar  *action_name,
-                   gchar       **prefix,
-                   gchar       **name)
-{
-  const gchar *dot;
-
-  g_assert (prefix != NULL);
-  g_assert (name != NULL);
-
-  *prefix = NULL;
-  *name = NULL;
-
-  if (action_name == NULL)
-    return;
-
-  dot = strchr (action_name, '.');
-
-  if (dot == NULL)
-    *name = g_strdup (action_name);
-  else
-    {
-      *prefix = g_strndup (action_name, dot - action_name);
-      *name = g_strdup (dot + 1);
-    }
-}
-
-gboolean
-_ide_gtk_widget_action_is_stateful (GtkWidget   *widget,
-                                    const gchar *action_name)
-{
-  g_autofree gchar *name = NULL;
-  g_autofree gchar *prefix = NULL;
-  GtkWidget *toplevel;
-  GApplication *app;
-  GActionGroup *group = NULL;
-
-  g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-  g_return_val_if_fail (action_name, FALSE);
-
-  split_action_name (action_name, &prefix, &name);
-
-  app = g_application_get_default ();
-  toplevel = gtk_widget_get_toplevel (widget);
-
-  while ((group == NULL) && (widget != NULL))
-    {
-      group = gtk_widget_get_action_group (widget, prefix);
-
-      if G_UNLIKELY (GTK_IS_POPOVER (widget))
-        {
-          GtkWidget *relative_to;
-
-          relative_to = gtk_popover_get_relative_to (GTK_POPOVER (widget));
-
-          if (relative_to != NULL)
-            widget = relative_to;
-          else
-            widget = gtk_widget_get_parent (widget);
-        }
-      else
-        {
-          widget = gtk_widget_get_parent (widget);
-        }
-    }
-
-  if (!group && g_str_equal (prefix, "win") && G_IS_ACTION_GROUP (toplevel))
-    group = G_ACTION_GROUP (toplevel);
-
-  if (!group && g_str_equal (prefix, "app") && G_IS_ACTION_GROUP (app))
-    group = G_ACTION_GROUP (app);
-
-  if (group && g_action_group_has_action (group, name))
-    return g_action_group_get_action_state_type (group, name) != NULL;
-
-  return FALSE;
-}
diff --git a/src/libide/gui/ide-gui-global.h b/src/libide/gui/ide-gui-global.h
index 3dc2f0497..99b01b5da 100644
--- a/src/libide/gui/ide-gui-global.h
+++ b/src/libide/gui/ide-gui-global.h
@@ -55,12 +55,5 @@ IDE_AVAILABLE_IN_3_32
 IdeWorkbench *ide_widget_get_workbench       (GtkWidget                *widget);
 IDE_AVAILABLE_IN_3_32
 IdeWorkspace *ide_widget_get_workspace       (GtkWidget                *widget);
-IDE_AVAILABLE_IN_3_32
-gboolean      ide_gtk_show_uri_on_window     (GtkWindow                *window,
-                                              const gchar              *uri,
-                                              gint64                    timestamp,
-                                              GError                  **error);
-IDE_AVAILABLE_IN_3_32
-void          ide_gtk_window_present         (GtkWindow                *window);
 
 G_END_DECLS
diff --git a/src/libide/gui/ide-gui-private.h b/src/libide/gui/ide-gui-private.h
index 0d66c10ec..874d0cd05 100644
--- a/src/libide/gui/ide-gui-private.h
+++ b/src/libide/gui/ide-gui-private.h
@@ -48,8 +48,6 @@ void      _ide_command_manager_unload_shortcuts (IdeCommandManager   *self,
 void      _ide_command_manager_execute          (IdeCommandManager   *self,
                                                  IdeWorkspace        *workspace,
                                                  const gchar         *command);
-gboolean  _ide_gtk_widget_action_is_stateful    (GtkWidget           *widget,
-                                                 const gchar         *action_name);
 void      _ide_primary_workspace_init_actions   (IdePrimaryWorkspace *self);
 void      _ide_workspace_init_actions           (IdeWorkspace        *self);
 GList    *_ide_workspace_get_mru_link           (IdeWorkspace        *self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]