[gnome-builder] project-tree: add helper to locate IdeTree
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] project-tree: add helper to locate IdeTree
- Date: Mon, 26 Oct 2020 21:25:39 +0000 (UTC)
commit ebf2d34d1a33db1302dbb8a8505b6eac085c18e1
Author: Christian Hergert <chergert redhat com>
Date: Mon Oct 26 14:13:43 2020 -0700
project-tree: add helper to locate IdeTree
This can be used by future project-tree addins to locate the IdeTree
for the project.
Related #1320
src/plugins/project-tree/gbp-project-tree-pane.c | 8 ++++++++
src/plugins/project-tree/gbp-project-tree-pane.h | 4 ++++
src/plugins/project-tree/gbp-project-tree-workspace-addin.c | 8 ++++++++
src/plugins/project-tree/gbp-project-tree-workspace-addin.h | 4 +++-
4 files changed, 23 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/project-tree/gbp-project-tree-pane.c
b/src/plugins/project-tree/gbp-project-tree-pane.c
index 9070e4b92..22c62879d 100644
--- a/src/plugins/project-tree/gbp-project-tree-pane.c
+++ b/src/plugins/project-tree/gbp-project-tree-pane.c
@@ -60,3 +60,11 @@ gbp_project_tree_pane_init (GbpProjectTreePane *self)
_gbp_project_tree_pane_init_actions (self);
}
+
+GbpProjectTree *
+gbp_project_tree_pane_get_tree (GbpProjectTreePane *self)
+{
+ g_return_val_if_fail (GBP_IS_PROJECT_TREE_PANE (self), NULL);
+
+ return GBP_PROJECT_TREE (self->tree);
+}
diff --git a/src/plugins/project-tree/gbp-project-tree-pane.h
b/src/plugins/project-tree/gbp-project-tree-pane.h
index 9a47d78eb..680f59e25 100644
--- a/src/plugins/project-tree/gbp-project-tree-pane.h
+++ b/src/plugins/project-tree/gbp-project-tree-pane.h
@@ -22,10 +22,14 @@
#include <libide-gui.h>
+#include "gbp-project-tree.h"
+
G_BEGIN_DECLS
#define GBP_TYPE_PROJECT_TREE_PANE (gbp_project_tree_pane_get_type())
G_DECLARE_FINAL_TYPE (GbpProjectTreePane, gbp_project_tree_pane, GBP, PROJECT_TREE_PANE, IdePane)
+GbpProjectTree *gbp_project_tree_pane_get_tree (GbpProjectTreePane *self);
+
G_END_DECLS
diff --git a/src/plugins/project-tree/gbp-project-tree-workspace-addin.c
b/src/plugins/project-tree/gbp-project-tree-workspace-addin.c
index 3aecea2bf..4b82549ed 100644
--- a/src/plugins/project-tree/gbp-project-tree-workspace-addin.c
+++ b/src/plugins/project-tree/gbp-project-tree-workspace-addin.c
@@ -102,3 +102,11 @@ static void
gbp_project_tree_workspace_addin_init (GbpProjectTreeWorkspaceAddin *self)
{
}
+
+GbpProjectTree *
+gbp_project_tree_workspace_addin_get_tree (GbpProjectTreeWorkspaceAddin *self)
+{
+ g_return_val_if_fail (GBP_IS_PROJECT_TREE_WORKSPACE_ADDIN (self), NULL);
+
+ return gbp_project_tree_pane_get_tree (self->pane);
+}
diff --git a/src/plugins/project-tree/gbp-project-tree-workspace-addin.h
b/src/plugins/project-tree/gbp-project-tree-workspace-addin.h
index 796a0163c..f7565e273 100644
--- a/src/plugins/project-tree/gbp-project-tree-workspace-addin.h
+++ b/src/plugins/project-tree/gbp-project-tree-workspace-addin.h
@@ -20,7 +20,7 @@
#pragma once
-#include <glib-object.h>
+#include "gbp-project-tree.h"
G_BEGIN_DECLS
@@ -28,4 +28,6 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GbpProjectTreeWorkspaceAddin, gbp_project_tree_workspace_addin, GBP,
PROJECT_TREE_WORKSPACE_ADDIN, GObject)
+GbpProjectTree *gbp_project_tree_workspace_addin_get_tree (GbpProjectTreeWorkspaceAddin *self);
+
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]