[gnome-builder/wip/gtk4-port] libide/gui: Add getter for primary workspace omnibar



commit 259c291755bb209365155298e878fd8379ea8bab
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Apr 26 18:36:16 2022 -0300

    libide/gui: Add getter for primary workspace omnibar
    
    We'll need access to the omnibar to implement the buildui workspace
    addin.

 src/libide/gui/ide-primary-workspace.c | 18 ++++++++++++++++++
 src/libide/gui/ide-primary-workspace.h |  4 ++++
 2 files changed, 22 insertions(+)
---
diff --git a/src/libide/gui/ide-primary-workspace.c b/src/libide/gui/ide-primary-workspace.c
index 8a3a12d75..56aeb7574 100644
--- a/src/libide/gui/ide-primary-workspace.c
+++ b/src/libide/gui/ide-primary-workspace.c
@@ -60,6 +60,7 @@ struct _IdePrimaryWorkspace
   PanelPaned         *edge_bottom;
   IdeGrid            *grid;
   GtkOverlay         *overlay;
+  IdeOmniBar         *omni_bar;
 };
 
 G_DEFINE_FINAL_TYPE (IdePrimaryWorkspace, ide_primary_workspace, IDE_TYPE_WORKSPACE)
@@ -221,6 +222,7 @@ ide_primary_workspace_class_init (IdePrimaryWorkspaceClass *klass)
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, edge_start);
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, grid);
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, header_bar);
+  gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, omni_bar);
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, overlay);
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, project_title);
   gtk_widget_class_bind_template_child (widget_class, IdePrimaryWorkspace, run_button);
@@ -245,3 +247,19 @@ ide_primary_workspace_init (IdePrimaryWorkspace *self)
 
   _ide_primary_workspace_init_actions (self);
 }
+
+/**
+ * ide_primary_workspace_get_omni_bar:
+ * @self: an #IdePrimaryWorkspace
+ *
+ * Retrieves the #IdeOmniBar of @self.
+ *
+ * Returns: (transfer none): an #IdeOmniBar
+ */
+IdeOmniBar *
+ide_primary_workspace_get_omni_bar (IdePrimaryWorkspace *self)
+{
+  g_return_val_if_fail (IDE_IS_PRIMARY_WORKSPACE (self), NULL);
+
+  return self->omni_bar;
+}
diff --git a/src/libide/gui/ide-primary-workspace.h b/src/libide/gui/ide-primary-workspace.h
index 3c9be2113..b326ad52e 100644
--- a/src/libide/gui/ide-primary-workspace.h
+++ b/src/libide/gui/ide-primary-workspace.h
@@ -25,6 +25,7 @@
 #endif
 
 #include "ide-application.h"
+#include "ide-omni-bar.h"
 #include "ide-workspace.h"
 
 G_BEGIN_DECLS
@@ -34,4 +35,7 @@ G_BEGIN_DECLS
 IDE_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (IdePrimaryWorkspace, ide_primary_workspace, IDE, PRIMARY_WORKSPACE, IdeWorkspace)
 
+IDE_AVAILABLE_IN_ALL
+IdeOmniBar *ide_primary_workspace_get_omni_bar (IdePrimaryWorkspace *self);
+
 G_END_DECLS


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