[tepl/wip/tab-list] ApplicationWindow: add set_tab_list()



commit 484c66b6c361d8e54618001fec62e6733c754e19
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jun 24 10:47:51 2017 +0200

    ApplicationWindow: add set_tab_list()

 docs/reference/tepl-3.0-sections.txt |    1 +
 tepl/tepl-application-window.c       |   31 +++++++++++++++++++++++++++++++
 tepl/tepl-application-window.h       |    3 +++
 3 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/tepl-3.0-sections.txt b/docs/reference/tepl-3.0-sections.txt
index cb1381e..2c7d182 100644
--- a/docs/reference/tepl-3.0-sections.txt
+++ b/docs/reference/tepl-3.0-sections.txt
@@ -93,6 +93,7 @@ tepl_application_get_type
 TeplApplicationWindow
 tepl_application_window_get_from_gtk_application_window
 tepl_application_window_get_application_window
+tepl_application_window_set_tab_list
 tepl_application_window_get_statusbar
 tepl_application_window_set_statusbar
 tepl_application_window_connect_menu_to_statusbar
diff --git a/tepl/tepl-application-window.c b/tepl/tepl-application-window.c
index 9b03fa7..35077ad 100644
--- a/tepl/tepl-application-window.c
+++ b/tepl/tepl-application-window.c
@@ -25,6 +25,7 @@
 #include "tepl-action-info-central-store.h"
 #include "tepl-menu-item.h"
 #include "tepl-menu-shell.h"
+#include "tepl-tab-list.h"
 #include "tepl-utils.h"
 
 /**
@@ -43,6 +44,7 @@
 struct _TeplApplicationWindowPrivate
 {
        GtkApplicationWindow *gtk_window;
+       TeplTabList *tab_list;
        GtkStatusbar *statusbar;
 };
 
@@ -117,6 +119,7 @@ tepl_application_window_dispose (GObject *object)
        TeplApplicationWindow *tepl_window = TEPL_APPLICATION_WINDOW (object);
 
        tepl_window->priv->gtk_window = NULL;
+       g_clear_object (&tepl_window->priv->tab_list);
 
        G_OBJECT_CLASS (tepl_application_window_parent_class)->dispose (object);
 }
@@ -221,6 +224,34 @@ tepl_application_window_get_application_window (TeplApplicationWindow *tepl_wind
 }
 
 /**
+ * tepl_application_window_set_tab_list:
+ * @tepl_window: a #TeplApplicationWindow.
+ * @tab_list: a #TeplTabList.
+ *
+ * Sets the #TeplTabList of @tepl_window. This function can be called only once,
+ * it is not possible to change the #TeplTabList (this restriction may be lifted
+ * in the future if there is a compelling use-case).
+ *
+ * Since: 3.0
+ */
+void
+tepl_application_window_set_tab_list (TeplApplicationWindow *tepl_window,
+                                     TeplTabList           *tab_list)
+{
+       g_return_if_fail (TEPL_IS_APPLICATION_WINDOW (tepl_window));
+       g_return_if_fail (TEPL_IS_TAB_LIST (tab_list));
+
+       if (tepl_window->priv->tab_list != NULL)
+       {
+               g_warning ("%s(): the TeplTabList has already been set, it can be set only once.",
+                          G_STRFUNC);
+               return;
+       }
+
+       tepl_window->priv->tab_list = g_object_ref_sink (tab_list);
+}
+
+/**
  * tepl_application_window_get_statusbar:
  * @tepl_window: a #TeplApplicationWindow.
  *
diff --git a/tepl/tepl-application-window.h b/tepl/tepl-application-window.h
index 9515eda..d403421 100644
--- a/tepl/tepl-application-window.h
+++ b/tepl/tepl-application-window.h
@@ -59,6 +59,9 @@ TeplApplicationWindow *       tepl_application_window_get_from_gtk_application_window
 
 GtkApplicationWindow * tepl_application_window_get_application_window          (TeplApplicationWindow 
*tepl_window);
 
+void                   tepl_application_window_set_tab_list                    (TeplApplicationWindow 
*tepl_window,
+                                                                                TeplTabList           
*tab_list);
+
 GtkStatusbar *         tepl_application_window_get_statusbar                   (TeplApplicationWindow 
*tepl_window);
 
 void                   tepl_application_window_set_statusbar                   (TeplApplicationWindow 
*tepl_window,


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