[gnome-builder] workbench: add get_active_workspace() helper.



commit 7d4945c8414a66f2d32009adc88bb67088b4f6e4
Author: Christian Hergert <christian hergert me>
Date:   Tue Sep 9 22:12:35 2014 -0700

    workbench: add get_active_workspace() helper.

 src/workbench/gb-workbench.c |   12 ++++++++++++
 src/workbench/gb-workbench.h |    3 ++-
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index 35aad4c..e2662bb 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -91,6 +91,18 @@ gb_workbench_action_set (GbWorkbench *workbench,
   va_end (args);
 }
 
+GbWorkspace *
+gb_workbench_get_active_workspace (GbWorkbench *workbench)
+{
+   GtkWidget *child;
+
+   g_return_val_if_fail (GB_IS_WORKBENCH (workbench), NULL);
+
+   child = gtk_stack_get_visible_child (workbench->priv->stack);
+
+   return GB_WORKSPACE (child);
+}
+
 static void
 gb_workbench_workspace_changed (GbWorkbench *workbench,
                                 GbWorkspace *workspace)
diff --git a/src/workbench/gb-workbench.h b/src/workbench/gb-workbench.h
index c999914..1d5383e 100644
--- a/src/workbench/gb-workbench.h
+++ b/src/workbench/gb-workbench.h
@@ -53,7 +53,8 @@ struct _GbWorkbenchClass
                              GbWorkspace *workspace);
 };
 
-GType gb_workbench_get_type (void) G_GNUC_CONST;
+GType        gb_workbench_get_type             (void) G_GNUC_CONST;
+GbWorkspace *gb_workbench_get_active_workspace (GbWorkbench *workbench);
 
 G_END_DECLS
 


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