[gnome-builder] libide/gui: add some workspace helpers to install actions



commit f5794817c263ed47274b09d0634611a3df843841
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jul 28 08:43:42 2022 -0700

    libide/gui: add some workspace helpers to install actions

 src/libide/gui/ide-workspace.c | 29 +++++++++++++++++++
 src/libide/gui/ide-workspace.h | 63 +++++++++++++++++++++++++-----------------
 2 files changed, 67 insertions(+), 25 deletions(-)
---
diff --git a/src/libide/gui/ide-workspace.c b/src/libide/gui/ide-workspace.c
index 8dcb3571f..c302b6ff9 100644
--- a/src/libide/gui/ide-workspace.c
+++ b/src/libide/gui/ide-workspace.c
@@ -1428,3 +1428,32 @@ ide_workspace_add_grid_column (IdeWorkspace *self,
 
   IDE_WORKSPACE_GET_CLASS (self)->add_grid_column (self, position);
 }
+
+void
+ide_workspace_class_install_action (IdeWorkspaceClass     *klass,
+                                    const char            *action_name,
+                                    const char            *parameter_type,
+                                    IdeActionActivateFunc  activate)
+{
+  klass->action_mixin.object_class = G_OBJECT_CLASS (klass);
+
+  ide_action_mixin_install_action (&klass->action_mixin, action_name, parameter_type, activate);
+}
+
+void
+ide_workspace_class_install_property_action (IdeWorkspaceClass *klass,
+                                             const char        *action_name,
+                                             const char        *property_name)
+{
+  klass->action_mixin.object_class = G_OBJECT_CLASS (klass);
+
+  ide_action_mixin_install_property_action (&klass->action_mixin, action_name, property_name);
+}
+
+void
+ide_workspace_action_set_enabled (IdeWorkspace *self,
+                                  const char   *action_name,
+                                  gboolean      enabled)
+{
+  ide_action_mixin_set_enabled (self, action_name, enabled);
+}
diff --git a/src/libide/gui/ide-workspace.h b/src/libide/gui/ide-workspace.h
index f9e558ecd..ca2cabe5b 100644
--- a/src/libide/gui/ide-workspace.h
+++ b/src/libide/gui/ide-workspace.h
@@ -95,43 +95,56 @@ struct _IdeWorkspaceClass
 };
 
 IDE_AVAILABLE_IN_ALL
-void            ide_workspace_class_set_kind           (IdeWorkspaceClass *klass,
-                                                      const gchar       *kind);
+void            ide_workspace_class_install_action          (IdeWorkspaceClass     *klass,
+                                                             const char            *action_name,
+                                                             const char            *parameter_type,
+                                                             IdeActionActivateFunc  activate);
 IDE_AVAILABLE_IN_ALL
-IdeHeaderBar   *ide_workspace_get_header_bar           (IdeWorkspace      *self);
+void            ide_workspace_class_install_property_action (IdeWorkspaceClass     *klass,
+                                                             const char            *action_name,
+                                                             const char            *property_name);
 IDE_AVAILABLE_IN_ALL
-IdeContext     *ide_workspace_get_context              (IdeWorkspace      *self);
+void            ide_workspace_class_set_kind                (IdeWorkspaceClass     *klass,
+                                                             const gchar           *kind);
 IDE_AVAILABLE_IN_ALL
-GCancellable   *ide_workspace_get_cancellable          (IdeWorkspace      *self);
+void            ide_workspace_action_set_enabled            (IdeWorkspace          *self,
+                                                             const char            *action_name,
+                                                             gboolean               enabled);
 IDE_AVAILABLE_IN_ALL
-void            ide_workspace_foreach_page             (IdeWorkspace      *self,
-                                                        IdePageCallback    callback,
-                                                        gpointer           user_data);
+IdeHeaderBar   *ide_workspace_get_header_bar                (IdeWorkspace          *self);
 IDE_AVAILABLE_IN_ALL
-IdePage        *ide_workspace_get_most_recent_page     (IdeWorkspace      *self);
+IdeContext     *ide_workspace_get_context                   (IdeWorkspace          *self);
 IDE_AVAILABLE_IN_ALL
-IdeFrame       *ide_workspace_get_most_recent_frame    (IdeWorkspace      *self);
+GCancellable   *ide_workspace_get_cancellable               (IdeWorkspace          *self);
 IDE_AVAILABLE_IN_ALL
-PanelFrame     *ide_workspace_get_frame_at_position    (IdeWorkspace      *self,
-                                                        IdePanelPosition  *position);
+void            ide_workspace_foreach_page                  (IdeWorkspace          *self,
+                                                             IdePageCallback        callback,
+                                                             gpointer               user_data);
 IDE_AVAILABLE_IN_ALL
-void            ide_workspace_add_pane                 (IdeWorkspace      *self,
-                                                        IdePane           *pane,
-                                                        IdePanelPosition  *position);
+IdePage        *ide_workspace_get_most_recent_page          (IdeWorkspace          *self);
 IDE_AVAILABLE_IN_ALL
-void            ide_workspace_add_page                 (IdeWorkspace      *self,
-                                                        IdePage           *page,
-                                                        IdePanelPosition  *position);
+IdeFrame       *ide_workspace_get_most_recent_frame         (IdeWorkspace          *self);
 IDE_AVAILABLE_IN_ALL
-void            ide_workspace_add_grid_column          (IdeWorkspace      *self,
-                                                        guint              position);
+PanelFrame     *ide_workspace_get_frame_at_position         (IdeWorkspace          *self,
+                                                             IdePanelPosition      *position);
 IDE_AVAILABLE_IN_ALL
-PanelStatusbar *ide_workspace_get_statusbar            (IdeWorkspace      *self);
+void            ide_workspace_add_pane                      (IdeWorkspace          *self,
+                                                             IdePane               *pane,
+                                                             IdePanelPosition      *position);
 IDE_AVAILABLE_IN_ALL
-void            ide_workspace_add_overlay              (IdeWorkspace      *self,
-                                                        GtkWidget         *widget);
+void            ide_workspace_add_page                      (IdeWorkspace          *self,
+                                                             IdePage               *page,
+                                                             IdePanelPosition      *position);
 IDE_AVAILABLE_IN_ALL
-void            ide_workspace_remove_overlay           (IdeWorkspace      *self,
-                                                        GtkWidget         *widget);
+void            ide_workspace_add_grid_column               (IdeWorkspace          *self,
+                                                             guint                  position);
+IDE_AVAILABLE_IN_ALL
+PanelStatusbar *ide_workspace_get_statusbar                 (IdeWorkspace          *self);
+IDE_AVAILABLE_IN_ALL
+void            ide_workspace_add_overlay                   (IdeWorkspace          *self,
+                                                             GtkWidget             *widget);
+IDE_AVAILABLE_IN_ALL
+void            ide_workspace_remove_overlay                (IdeWorkspace          *self,
+                                                             GtkWidget             *widget);
 
 G_END_DECLS


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