[aisleriot] window: Add accessors for the UI manager and action group



commit 3c5c5a99b3a89b10e562354ad211ea489fa0e915
Author: Christian Persch <chpe gnome org>
Date:   Sat Oct 27 18:19:36 2012 +0200

    window: Add accessors for the UI manager and action group

 src/window.c |   25 +++++++++++++++++++++++++
 src/window.h |    5 +++++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/window.c b/src/window.c
index 4229051..56e8c1f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2592,6 +2592,31 @@ aisleriot_window_new (gboolean freecell_mode)
                        NULL);
 }
 
+/**
+ * aisleriot_window_get_ui_manager:
+ * @window:
+ *
+ * Returns: (transfer none): the window's #GtkUIManager
+ */
+GtkUIManager *
+aisleriot_window_get_ui_manager (AisleriotWindow *window)
+{
+  return window->priv->ui_manager;
+}
+
+/**
+ * aisleriot_window_get_ui_manager:
+ * @window:
+ *
+ * Returns: (transfer none): the window's #GtkUIManager
+ */
+GtkAction *
+aisleriot_window_get_action (AisleriotWindow *window,
+                             const char *action_name)
+{
+  return gtk_action_group_get_action (window->priv->action_group, action_name);
+}
+
 typedef struct {
   AisleriotWindow *window;
   char *game_module;
diff --git a/src/window.h b/src/window.h
index e549cee..d67b659 100644
--- a/src/window.h
+++ b/src/window.h
@@ -47,6 +47,11 @@ GType aisleriot_window_get_type (void);
 
 GtkWidget *aisleriot_window_new (gboolean freecell_mode);
 
+GtkUIManager *aisleriot_window_get_ui_manager (AisleriotWindow *window);
+
+GtkAction *aisleriot_window_get_action (AisleriotWindow *window,
+                                        const char *action_name);
+
 void aisleriot_window_set_game_module (AisleriotWindow * window,
                                        const char *game_module,
                                        GRand *rand);


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