[gnome-builder/wip/gtk4-port: 137/1774] libide/gui: cleanup workspaces and remove dead code




commit e1747e8b36a0f9d341d2b2942d97d8a12bc9ebae
Author: Christian Hergert <chergert redhat com>
Date:   Tue Mar 29 01:10:46 2022 -0700

    libide/gui: cleanup workspaces and remove dead code
    
    Lots to remove still here which won't be needed with various GTK 4
    features such as primary menu buttons and no more use of IdeSurface.

 src/libide/gui/ide-header-bar-shortcuts.c          | 68 ----------------------
 src/libide/gui/ide-notification-list-box-row.c     |  3 -
 .../gui/ide-notifications-button-popover-private.h | 31 ----------
 src/libide/gui/ide-notifications-button-popover.c  | 51 ----------------
 src/libide/gui/ide-notifications-button.c          |  1 -
 src/libide/gui/ide-primary-workspace-actions.c     |  6 +-
 ...i-private.h => ide-primary-workspace-private.h} |  7 +--
 src/libide/gui/ide-primary-workspace.c             |  3 +-
 src/libide/gui/ide-workspace-actions.c             | 44 ++------------
 src/libide/gui/ide-workspace.c                     |  1 -
 src/libide/gui/meson.build                         |  5 +-
 11 files changed, 11 insertions(+), 209 deletions(-)
---
diff --git a/src/libide/gui/ide-notification-list-box-row.c b/src/libide/gui/ide-notification-list-box-row.c
index 86be210a0..ab8f82479 100644
--- a/src/libide/gui/ide-notification-list-box-row.c
+++ b/src/libide/gui/ide-notification-list-box-row.c
@@ -22,9 +22,6 @@
 
 #include "config.h"
 
-#include <dazzle.h>
-
-#include "ide-gui-private.h"
 #include "ide-notification-list-box-row-private.h"
 
 struct _IdeNotificationListBoxRow
diff --git a/src/libide/gui/ide-notifications-button.c b/src/libide/gui/ide-notifications-button.c
index 4167502c9..815ae8b49 100644
--- a/src/libide/gui/ide-notifications-button.c
+++ b/src/libide/gui/ide-notifications-button.c
@@ -26,7 +26,6 @@
 
 #include "ide-notification-list-box-row-private.h"
 #include "ide-gui-global.h"
-#include "ide-gui-private.h"
 
 /**
  * SECTION:ide-notifications-button:
diff --git a/src/libide/gui/ide-primary-workspace-actions.c b/src/libide/gui/ide-primary-workspace-actions.c
index 669b12225..e40563a99 100644
--- a/src/libide/gui/ide-primary-workspace-actions.c
+++ b/src/libide/gui/ide-primary-workspace-actions.c
@@ -23,12 +23,12 @@
 #include "config.h"
 
 #include <glib/gi18n.h>
-#include <libide-foundry.h>
 #include <libpeas/peas.h>
 
+#include <libide-foundry.h>
+
 #include "ide-gui-global.h"
-#include "ide-gui-private.h"
-#include "ide-primary-workspace.h"
+#include "ide-primary-workspace-private.h"
 
 typedef struct
 {
diff --git a/src/libide/gui/ide-gui-private.h b/src/libide/gui/ide-primary-workspace-private.h
similarity index 77%
rename from src/libide/gui/ide-gui-private.h
rename to src/libide/gui/ide-primary-workspace-private.h
index 8875b0d60..38d134025 100644
--- a/src/libide/gui/ide-gui-private.h
+++ b/src/libide/gui/ide-primary-workspace-private.h
@@ -1,6 +1,6 @@
-/* ide-gui-private.h
+/* ide-primary-workspace-private.h
  *
- * Copyright 2017-2019 Christian Hergert <chergert redhat com>
+ * Copyright 2017-2022 Christian Hergert <chergert redhat com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -20,13 +20,10 @@
 
 #pragma once
 
-#include "ide-header-bar.h"
 #include "ide-primary-workspace.h"
 
 G_BEGIN_DECLS
 
 void _ide_primary_workspace_init_actions (IdePrimaryWorkspace *self);
-void _ide_header_bar_init_shortcuts      (IdeHeaderBar        *self);
-void _ide_header_bar_show_menu           (IdeHeaderBar        *self);
 
 G_END_DECLS
diff --git a/src/libide/gui/ide-primary-workspace.c b/src/libide/gui/ide-primary-workspace.c
index aec26b9d2..024b8ba3d 100644
--- a/src/libide/gui/ide-primary-workspace.c
+++ b/src/libide/gui/ide-primary-workspace.c
@@ -23,11 +23,10 @@
 #include "config.h"
 
 #include "ide-gui-global.h"
-#include "ide-gui-private.h"
 #include "ide-header-bar.h"
 #include "ide-notifications-button.h"
 #include "ide-omni-bar.h"
-#include "ide-primary-workspace.h"
+#include "ide-primary-workspace-private.h"
 #include "ide-run-button.h"
 #include "ide-window-settings-private.h"
 
diff --git a/src/libide/gui/ide-workspace-actions.c b/src/libide/gui/ide-workspace-actions.c
index 7d75dc95c..63cae07ac 100644
--- a/src/libide/gui/ide-workspace-actions.c
+++ b/src/libide/gui/ide-workspace-actions.c
@@ -22,8 +22,10 @@
 
 #include "config.h"
 
+#include <libide-commands.h>
+
 #include "ide-gui-global.h"
-#include "ide-gui-private.h"
+#include "ide-workspace-private.h"
 
 static void
 ide_workspace_actions_close (GSimpleAction *action,
@@ -38,43 +40,6 @@ ide_workspace_actions_close (GSimpleAction *action,
   gtk_window_close (GTK_WINDOW (self));
 }
 
-static void
-ide_workspace_actions_show_menu (GSimpleAction *action,
-                                 GVariant      *param,
-                                 gpointer       user_data)
-{
-  IdeWorkspace *self = user_data;
-  GtkWidget *titlebar;
-
-  g_assert (G_IS_SIMPLE_ACTION (action));
-  g_assert (IDE_IS_WORKSPACE (self));
-
-  titlebar = gtk_window_get_titlebar (GTK_WINDOW (self));
-  if (GTK_IS_STACK (titlebar))
-    titlebar = gtk_stack_get_visible_child (GTK_STACK (titlebar));
-
-  if (IDE_IS_HEADER_BAR (titlebar))
-    _ide_header_bar_show_menu (IDE_HEADER_BAR (titlebar));
-}
-
-static void
-ide_workspace_actions_surface (GSimpleAction *action,
-                               GVariant      *param,
-                               gpointer       user_data)
-{
-  IdeWorkspace *self = user_data;
-  const gchar *surface;
-
-  g_assert (G_IS_SIMPLE_ACTION (action));
-  g_assert (param != NULL);
-  g_assert (g_variant_is_of_type (param, G_VARIANT_TYPE_STRING));
-  g_assert (IDE_IS_WORKSPACE (self));
-
-  surface = g_variant_get_string (param, NULL);
-
-  ide_workspace_set_visible_surface_name (self, surface);
-}
-
 static void
 ide_workspace_actions_command (GSimpleAction *action,
                                GVariant      *param,
@@ -94,11 +59,10 @@ ide_workspace_actions_command (GSimpleAction *action,
   context = ide_widget_get_context (GTK_WIDGET (self));
   command_manager = ide_command_manager_from_context (context);
 
-  _ide_command_manager_execute (command_manager, self, command);
+  ide_command_manager_execute (command_manager, GTK_WIDGET (self), command);
 }
 
 static const GActionEntry actions[] = {
-  { "show-menu", ide_workspace_actions_show_menu },
   { "close", ide_workspace_actions_close },
   { "command", ide_workspace_actions_command, "s" },
 };
diff --git a/src/libide/gui/ide-workspace.c b/src/libide/gui/ide-workspace.c
index bb2269818..b7199c771 100644
--- a/src/libide/gui/ide-workspace.c
+++ b/src/libide/gui/ide-workspace.c
@@ -25,7 +25,6 @@
 #include <libide-plugins.h>
 
 #include "ide-gui-global.h"
-#include "ide-gui-private.h"
 #include "ide-workspace-addin.h"
 #include "ide-workspace-private.h"
 #include "ide-workbench-private.h"
diff --git a/src/libide/gui/meson.build b/src/libide/gui/meson.build
index 71d325d85..732484aa3 100644
--- a/src/libide/gui/meson.build
+++ b/src/libide/gui/meson.build
@@ -43,13 +43,12 @@ install_headers(libide_gui_public_headers, subdir: libide_gui_header_subdir)
 libide_gui_private_headers = [
   'ide-application-private.h',
   'ide-environment-editor-row.h',
-  'ide-gui-private.h',
   'ide-keybindings.h',
   'ide-notification-list-box-row-private.h',
-  'ide-notifications-button-popover-private.h',
   'ide-notification-stack-private.h',
   'ide-notification-view-private.h',
   'ide-preferences-builtin-private.h',
+  'ide-primary-workspace-private.h',
   'ide-run-button.h',
   'ide-session-private.h',
   'ide-window-settings-private.h',
@@ -60,12 +59,10 @@ libide_gui_private_sources = [
   'ide-application-color.c',
   'ide-application-plugins.c',
   'ide-environment-editor-row.c',
-  'ide-header-bar-shortcuts.c',
   'ide-keybindings.c',
   'ide-notification-list-box-row.c',
   'ide-notification-stack.c',
   'ide-notification-view.c',
-  'ide-notifications-button-popover.c',
   'ide-preferences-builtin.c',
   'ide-primary-workspace-actions.c',
   'ide-run-button.c',


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