[tepl] Rename TeplTabList -> TeplTabGroup
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tepl] Rename TeplTabList -> TeplTabGroup
- Date: Sat, 24 Jun 2017 15:49:59 +0000 (UTC)
commit d0a0b5a56d62e85139ce1c1abc8797a0005f72a3
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Jun 24 17:24:26 2017 +0200
Rename TeplTabList -> TeplTabGroup
To have a name like GActionGroup. So that it's less awkward that the
interface is implemented by TeplApplicationWindow (and also TeplTab).
docs/reference/tepl-3.0-sections.txt | 30 ++++----
docs/reference/tepl-docs.xml.in | 2 +-
po/POTFILES.in | 2 +-
tepl/Makefile.am | 4 +-
tepl/tepl-application-window.c | 60 ++++++++--------
tepl/tepl-application-window.h | 4 +-
tepl/tepl-notebook.c | 28 ++++----
tepl/{tepl-tab-list.c => tepl-tab-group.c} | 102 ++++++++++++++--------------
tepl/tepl-tab-group.h | 79 +++++++++++++++++++++
tepl/tepl-tab-list.h | 79 ---------------------
tepl/tepl-tab.c | 26 ++++----
tepl/tepl-types.h | 2 +-
tepl/tepl.h | 2 +-
13 files changed, 210 insertions(+), 210 deletions(-)
---
diff --git a/docs/reference/tepl-3.0-sections.txt b/docs/reference/tepl-3.0-sections.txt
index fd276ca..ccdec5c 100644
--- a/docs/reference/tepl-3.0-sections.txt
+++ b/docs/reference/tepl-3.0-sections.txt
@@ -93,7 +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_set_tab_group
tepl_application_window_get_statusbar
tepl_application_window_set_statusbar
tepl_application_window_connect_menu_to_statusbar
@@ -363,21 +363,21 @@ tepl_tab_get_type
</SECTION>
<SECTION>
-<FILE>tab-list</FILE>
-TeplTabList
-TeplTabListInterface
-tepl_tab_list_get_tabs
-tepl_tab_list_get_views
-tepl_tab_list_get_buffers
-tepl_tab_list_get_active_tab
-tepl_tab_list_get_active_view
-tepl_tab_list_get_active_buffer
+<FILE>tab-group</FILE>
+TeplTabGroup
+TeplTabGroupInterface
+tepl_tab_group_get_tabs
+tepl_tab_group_get_views
+tepl_tab_group_get_buffers
+tepl_tab_group_get_active_tab
+tepl_tab_group_get_active_view
+tepl_tab_group_get_active_buffer
<SUBSECTION Standard>
-TEPL_IS_TAB_LIST
-TEPL_TAB_LIST
-TEPL_TAB_LIST_GET_INTERFACE
-TEPL_TYPE_TAB_LIST
-tepl_tab_list_get_type
+TEPL_IS_TAB_GROUP
+TEPL_TAB_GROUP
+TEPL_TAB_GROUP_GET_INTERFACE
+TEPL_TYPE_TAB_GROUP
+tepl_tab_group_get_type
</SECTION>
<SECTION>
diff --git a/docs/reference/tepl-docs.xml.in b/docs/reference/tepl-docs.xml.in
index 5271944..9eee22f 100644
--- a/docs/reference/tepl-docs.xml.in
+++ b/docs/reference/tepl-docs.xml.in
@@ -21,7 +21,7 @@
<title>Framework</title>
<xi:include href="xml/application.xml"/>
<xi:include href="xml/application-window.xml"/>
- <xi:include href="xml/tab-list.xml"/>
+ <xi:include href="xml/tab-group.xml"/>
<xi:include href="xml/notebook.xml"/>
<xi:include href="xml/tab.xml"/>
<xi:include href="xml/view.xml"/>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5b230b0..7ca7415 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -22,6 +22,6 @@ tepl/tepl-menu-shell.c
tepl/tepl-metadata-manager.c
tepl/tepl-notebook.c
tepl/tepl-tab.c
-tepl/tepl-tab-list.c
+tepl/tepl-tab-group.c
tepl/tepl-utils.c
tepl/tepl-view.c
diff --git a/tepl/Makefile.am b/tepl/Makefile.am
index 8062f5b..ebfa007 100644
--- a/tepl/Makefile.am
+++ b/tepl/Makefile.am
@@ -34,7 +34,7 @@ tepl_public_headers = \
tepl-notebook.h \
tepl-types.h \
tepl-tab.h \
- tepl-tab-list.h \
+ tepl-tab-group.h \
tepl-utils.h \
tepl-view.h
@@ -60,7 +60,7 @@ tepl_public_c_files = \
tepl-metadata-manager.c \
tepl-notebook.c \
tepl-tab.c \
- tepl-tab-list.c \
+ tepl-tab-group.c \
tepl-utils.c \
tepl-view.c
diff --git a/tepl/tepl-application-window.c b/tepl/tepl-application-window.c
index 8d8cc92..8f197ed 100644
--- a/tepl/tepl-application-window.c
+++ b/tepl/tepl-application-window.c
@@ -25,7 +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-tab-group.h"
#include "tepl-utils.h"
/**
@@ -44,7 +44,7 @@
struct _TeplApplicationWindowPrivate
{
GtkApplicationWindow *gtk_window;
- TeplTabList *tab_list;
+ TeplTabGroup *tab_group;
GtkStatusbar *statusbar;
};
@@ -62,15 +62,15 @@ enum
static GParamSpec *properties[N_PROPERTIES];
-static void tepl_tab_list_interface_init (gpointer g_iface,
- gpointer iface_data);
+static void tepl_tab_group_interface_init (gpointer g_iface,
+ gpointer iface_data);
G_DEFINE_TYPE_WITH_CODE (TeplApplicationWindow,
tepl_application_window,
G_TYPE_OBJECT,
G_ADD_PRIVATE (TeplApplicationWindow)
- G_IMPLEMENT_INTERFACE (TEPL_TYPE_TAB_LIST,
- tepl_tab_list_interface_init))
+ G_IMPLEMENT_INTERFACE (TEPL_TYPE_TAB_GROUP,
+ tepl_tab_group_interface_init))
static void
tepl_application_window_get_property (GObject *object,
@@ -127,7 +127,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_clear_object (&tepl_window->priv->tab_group);
g_clear_object (&tepl_window->priv->statusbar);
G_OBJECT_CLASS (tepl_application_window_parent_class)->dispose (object);
@@ -177,36 +177,36 @@ tepl_application_window_class_init (TeplApplicationWindowClass *klass)
}
static GList *
-tepl_application_window_get_tabs (TeplTabList *tab_list)
+tepl_application_window_get_tabs (TeplTabGroup *tab_group)
{
- TeplApplicationWindow *tepl_window = TEPL_APPLICATION_WINDOW (tab_list);
+ TeplApplicationWindow *tepl_window = TEPL_APPLICATION_WINDOW (tab_group);
- if (tepl_window->priv->tab_list == NULL)
+ if (tepl_window->priv->tab_group == NULL)
{
return NULL;
}
- return tepl_tab_list_get_tabs (tepl_window->priv->tab_list);
+ return tepl_tab_group_get_tabs (tepl_window->priv->tab_group);
}
static TeplTab *
-tepl_application_window_get_active_tab (TeplTabList *tab_list)
+tepl_application_window_get_active_tab (TeplTabGroup *tab_group)
{
- TeplApplicationWindow *tepl_window = TEPL_APPLICATION_WINDOW (tab_list);
+ TeplApplicationWindow *tepl_window = TEPL_APPLICATION_WINDOW (tab_group);
- if (tepl_window->priv->tab_list == NULL)
+ if (tepl_window->priv->tab_group == NULL)
{
return NULL;
}
- return tepl_tab_list_get_active_tab (tepl_window->priv->tab_list);
+ return tepl_tab_group_get_active_tab (tepl_window->priv->tab_group);
}
static void
-tepl_tab_list_interface_init (gpointer g_iface,
- gpointer iface_data)
+tepl_tab_group_interface_init (gpointer g_iface,
+ gpointer iface_data)
{
- TeplTabListInterface *interface = g_iface;
+ TeplTabGroupInterface *interface = g_iface;
interface->get_tabs = tepl_application_window_get_tabs;
interface->get_active_tab = tepl_application_window_get_active_tab;
@@ -269,34 +269,34 @@ tepl_application_window_get_application_window (TeplApplicationWindow *tepl_wind
}
/**
- * tepl_application_window_set_tab_list:
+ * tepl_application_window_set_tab_group:
* @tepl_window: a #TeplApplicationWindow.
- * @tab_list: a #TeplTabList.
+ * @tab_group: a #TeplTabGroup.
*
- * 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
+ * Sets the #TeplTabGroup of @tepl_window. This function can be called only once,
+ * it is not possible to change the #TeplTabGroup (this restriction may be lifted
* in the future if there is a compelling use-case).
*
- * #TeplApplicationWindow implements the #TeplTabList interface by delegating
- * the requests to @tab_list.
+ * #TeplApplicationWindow implements the #TeplTabGroup interface by delegating
+ * the requests to @tab_group.
*
* Since: 3.0
*/
void
-tepl_application_window_set_tab_list (TeplApplicationWindow *tepl_window,
- TeplTabList *tab_list)
+tepl_application_window_set_tab_group (TeplApplicationWindow *tepl_window,
+ TeplTabGroup *tab_group)
{
g_return_if_fail (TEPL_IS_APPLICATION_WINDOW (tepl_window));
- g_return_if_fail (TEPL_IS_TAB_LIST (tab_list));
+ g_return_if_fail (TEPL_IS_TAB_GROUP (tab_group));
- if (tepl_window->priv->tab_list != NULL)
+ if (tepl_window->priv->tab_group != NULL)
{
- g_warning ("%s(): the TeplTabList has already been set, it can be set only once.",
+ g_warning ("%s(): the TeplTabGroup 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_window->priv->tab_group = g_object_ref_sink (tab_group);
}
/**
diff --git a/tepl/tepl-application-window.h b/tepl/tepl-application-window.h
index d403421..277e78d 100644
--- a/tepl/tepl-application-window.h
+++ b/tepl/tepl-application-window.h
@@ -59,8 +59,8 @@ 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);
+void tepl_application_window_set_tab_group (TeplApplicationWindow
*tepl_window,
+ TeplTabGroup
*tab_group);
GtkStatusbar * tepl_application_window_get_statusbar (TeplApplicationWindow
*tepl_window);
diff --git a/tepl/tepl-notebook.c b/tepl/tepl-notebook.c
index 86aaff4..c759409 100644
--- a/tepl/tepl-notebook.c
+++ b/tepl/tepl-notebook.c
@@ -18,16 +18,16 @@
*/
#include "tepl-notebook.h"
-#include "tepl-tab-list.h"
+#include "tepl-tab-group.h"
#include "tepl-tab.h"
/**
* SECTION:notebook
- * @Short_description: #GtkNotebook subclass implementing the #TeplTabList
+ * @Short_description: #GtkNotebook subclass implementing the #TeplTabGroup
* interface
* @Title: TeplNotebook
*
- * #TeplNotebook is a subclass of #GtkNotebook that implements the #TeplTabList
+ * #TeplNotebook is a subclass of #GtkNotebook that implements the #TeplTabGroup
* interface.
*/
@@ -36,15 +36,15 @@ struct _TeplNotebookPrivate
gint something;
};
-static void tepl_tab_list_interface_init (gpointer g_iface,
- gpointer iface_data);
+static void tepl_tab_group_interface_init (gpointer g_iface,
+ gpointer iface_data);
G_DEFINE_TYPE_WITH_CODE (TeplNotebook,
tepl_notebook,
GTK_TYPE_NOTEBOOK,
G_ADD_PRIVATE (TeplNotebook)
- G_IMPLEMENT_INTERFACE (TEPL_TYPE_TAB_LIST,
- tepl_tab_list_interface_init))
+ G_IMPLEMENT_INTERFACE (TEPL_TYPE_TAB_GROUP,
+ tepl_tab_group_interface_init))
static void
tepl_notebook_finalize (GObject *object)
@@ -62,9 +62,9 @@ tepl_notebook_class_init (TeplNotebookClass *klass)
}
static GList *
-tepl_notebook_get_tabs (TeplTabList *tab_list)
+tepl_notebook_get_tabs (TeplTabGroup *tab_group)
{
- GtkNotebook *notebook = GTK_NOTEBOOK (tab_list);
+ GtkNotebook *notebook = GTK_NOTEBOOK (tab_group);
GList *tabs = NULL;
gint n_pages;
gint page_num;
@@ -85,9 +85,9 @@ tepl_notebook_get_tabs (TeplTabList *tab_list)
}
static TeplTab *
-tepl_notebook_get_active_tab (TeplTabList *tab_list)
+tepl_notebook_get_active_tab (TeplTabGroup *tab_group)
{
- GtkNotebook *notebook = GTK_NOTEBOOK (tab_list);
+ GtkNotebook *notebook = GTK_NOTEBOOK (tab_group);
gint cur_page_num;
GtkWidget *cur_page_widget;
@@ -102,10 +102,10 @@ tepl_notebook_get_active_tab (TeplTabList *tab_list)
}
static void
-tepl_tab_list_interface_init (gpointer g_iface,
- gpointer iface_data)
+tepl_tab_group_interface_init (gpointer g_iface,
+ gpointer iface_data)
{
- TeplTabListInterface *interface = g_iface;
+ TeplTabGroupInterface *interface = g_iface;
interface->get_tabs = tepl_notebook_get_tabs;
interface->get_active_tab = tepl_notebook_get_active_tab;
diff --git a/tepl/tepl-tab-list.c b/tepl/tepl-tab-group.c
similarity index 50%
rename from tepl/tepl-tab-list.c
rename to tepl/tepl-tab-group.c
index 5e6dabf..0872c23 100644
--- a/tepl/tepl-tab-list.c
+++ b/tepl/tepl-tab-group.c
@@ -17,86 +17,86 @@
* along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "tepl-tab-list.h"
+#include "tepl-tab-group.h"
#include "tepl-tab.h"
/**
- * SECTION:tab-list
- * @Short_description: Interface for a list of #TeplTab's
- * @Title: TeplTabList
+ * SECTION:tab-group
+ * @Short_description: Interface for a group of #TeplTab's
+ * @Title: TeplTabGroup
*
- * The tepl_tab_list_get_tabs() function permits to get the list of #TeplTab's.
- * The tepl_tab_list_get_active_tab() function permits to get the #TeplTab
- * currently shown in the #TeplTabList.
+ * The tepl_tab_group_get_tabs() function permits to get the list of #TeplTab's.
+ * The tepl_tab_group_get_active_tab() function permits to get the #TeplTab
+ * currently shown in the #TeplTabGroup.
*
- * #TeplTabList also contains convenience functions to get #TeplView's and
+ * #TeplTabGroup also contains convenience functions to get #TeplView's and
* #TeplBuffer's instead of #TeplTab's.
*/
-G_DEFINE_INTERFACE (TeplTabList, tepl_tab_list, G_TYPE_OBJECT)
+G_DEFINE_INTERFACE (TeplTabGroup, tepl_tab_group, G_TYPE_OBJECT)
static GList *
-tepl_tab_list_get_tabs_default (TeplTabList *tab_list)
+tepl_tab_group_get_tabs_default (TeplTabGroup *tab_group)
{
return NULL;
}
static TeplTab *
-tepl_tab_list_get_active_tab_default (TeplTabList *tab_list)
+tepl_tab_group_get_active_tab_default (TeplTabGroup *tab_group)
{
return NULL;
}
static void
-tepl_tab_list_default_init (TeplTabListInterface *interface)
+tepl_tab_group_default_init (TeplTabGroupInterface *interface)
{
- interface->get_tabs = tepl_tab_list_get_tabs_default;
- interface->get_active_tab = tepl_tab_list_get_active_tab_default;
+ interface->get_tabs = tepl_tab_group_get_tabs_default;
+ interface->get_active_tab = tepl_tab_group_get_active_tab_default;
}
/**
- * tepl_tab_list_get_tabs:
- * @tab_list: a #TeplTabList.
+ * tepl_tab_group_get_tabs:
+ * @tab_group: a #TeplTabGroup.
*
- * Gets the list of #TeplTab's contained in @tab_list.
+ * Gets the list of #TeplTab's contained in @tab_group.
*
- * If @tab_list contains non-#TeplTab children, those will not be present in the
+ * If @tab_group contains non-#TeplTab children, those will not be present in the
* returned list. In other words, it is <emphasis>not</emphasis> guaranteed that
* the index of a #TeplTab in the returned #GList has the same child index in
- * the @tab_list container.
+ * the @tab_group container.
*
* Returns: (transfer container) (element-type TeplTab): the list of all the
- * #TeplTab's contained in @tab_list.
+ * #TeplTab's contained in @tab_group.
* Since: 3.0
*/
GList *
-tepl_tab_list_get_tabs (TeplTabList *tab_list)
+tepl_tab_group_get_tabs (TeplTabGroup *tab_group)
{
- g_return_val_if_fail (TEPL_IS_TAB_LIST (tab_list), NULL);
+ g_return_val_if_fail (TEPL_IS_TAB_GROUP (tab_group), NULL);
- return TEPL_TAB_LIST_GET_INTERFACE (tab_list)->get_tabs (tab_list);
+ return TEPL_TAB_GROUP_GET_INTERFACE (tab_group)->get_tabs (tab_group);
}
/**
- * tepl_tab_list_get_views:
- * @tab_list: a #TeplTabList.
+ * tepl_tab_group_get_views:
+ * @tab_group: a #TeplTabGroup.
*
* Convenience function.
*
* Returns: (transfer container) (element-type TeplView): like
- * tepl_tab_list_get_tabs(), but returns #TeplView's.
+ * tepl_tab_group_get_tabs(), but returns #TeplView's.
* Since: 3.0
*/
GList *
-tepl_tab_list_get_views (TeplTabList *tab_list)
+tepl_tab_group_get_views (TeplTabGroup *tab_group)
{
GList *tabs;
GList *views = NULL;
GList *l;
- g_return_val_if_fail (TEPL_IS_TAB_LIST (tab_list), NULL);
+ g_return_val_if_fail (TEPL_IS_TAB_GROUP (tab_group), NULL);
- tabs = tepl_tab_list_get_tabs (tab_list);
+ tabs = tepl_tab_group_get_tabs (tab_group);
for (l = tabs; l != NULL; l = l->next)
{
@@ -111,25 +111,25 @@ tepl_tab_list_get_views (TeplTabList *tab_list)
}
/**
- * tepl_tab_list_get_buffers:
- * @tab_list: a #TeplTabList.
+ * tepl_tab_group_get_buffers:
+ * @tab_group: a #TeplTabGroup.
*
* Convenience function.
*
* Returns: (transfer container) (element-type TeplBuffer): like
- * tepl_tab_list_get_tabs(), but returns #TeplBuffer's.
+ * tepl_tab_group_get_tabs(), but returns #TeplBuffer's.
* Since: 3.0
*/
GList *
-tepl_tab_list_get_buffers (TeplTabList *tab_list)
+tepl_tab_group_get_buffers (TeplTabGroup *tab_group)
{
GList *tabs;
GList *buffers = NULL;
GList *l;
- g_return_val_if_fail (TEPL_IS_TAB_LIST (tab_list), NULL);
+ g_return_val_if_fail (TEPL_IS_TAB_GROUP (tab_group), NULL);
- tabs = tepl_tab_list_get_tabs (tab_list);
+ tabs = tepl_tab_group_get_tabs (tab_group);
for (l = tabs; l != NULL; l = l->next)
{
@@ -144,24 +144,24 @@ tepl_tab_list_get_buffers (TeplTabList *tab_list)
}
/**
- * tepl_tab_list_get_active_tab:
- * @tab_list: a #TeplTabList.
+ * tepl_tab_group_get_active_tab:
+ * @tab_group: a #TeplTabGroup.
*
* Returns: (transfer none) (nullable): the #TeplTab currently shown in
- * @tab_list.
+ * @tab_group.
* Since: 3.0
*/
TeplTab *
-tepl_tab_list_get_active_tab (TeplTabList *tab_list)
+tepl_tab_group_get_active_tab (TeplTabGroup *tab_group)
{
- g_return_val_if_fail (TEPL_IS_TAB_LIST (tab_list), NULL);
+ g_return_val_if_fail (TEPL_IS_TAB_GROUP (tab_group), NULL);
- return TEPL_TAB_LIST_GET_INTERFACE (tab_list)->get_active_tab (tab_list);
+ return TEPL_TAB_GROUP_GET_INTERFACE (tab_group)->get_active_tab (tab_group);
}
/**
- * tepl_tab_list_get_active_view:
- * @tab_list: a #TeplTabList.
+ * tepl_tab_group_get_active_view:
+ * @tab_group: a #TeplTabGroup.
*
* Convenience function.
*
@@ -169,20 +169,20 @@ tepl_tab_list_get_active_tab (TeplTabList *tab_list)
* Since: 3.0
*/
TeplView *
-tepl_tab_list_get_active_view (TeplTabList *tab_list)
+tepl_tab_group_get_active_view (TeplTabGroup *tab_group)
{
TeplTab *active_tab;
- g_return_val_if_fail (TEPL_IS_TAB_LIST (tab_list), NULL);
+ g_return_val_if_fail (TEPL_IS_TAB_GROUP (tab_group), NULL);
- active_tab = tepl_tab_list_get_active_tab (tab_list);
+ active_tab = tepl_tab_group_get_active_tab (tab_group);
return active_tab != NULL ? tepl_tab_get_view (active_tab) : NULL;
}
/**
- * tepl_tab_list_get_active_buffer:
- * @tab_list: a #TeplTabList.
+ * tepl_tab_group_get_active_buffer:
+ * @tab_group: a #TeplTabGroup.
*
* Convenience function.
*
@@ -190,13 +190,13 @@ tepl_tab_list_get_active_view (TeplTabList *tab_list)
* Since: 3.0
*/
TeplBuffer *
-tepl_tab_list_get_active_buffer (TeplTabList *tab_list)
+tepl_tab_group_get_active_buffer (TeplTabGroup *tab_group)
{
TeplTab *active_tab;
- g_return_val_if_fail (TEPL_IS_TAB_LIST (tab_list), NULL);
+ g_return_val_if_fail (TEPL_IS_TAB_GROUP (tab_group), NULL);
- active_tab = tepl_tab_list_get_active_tab (tab_list);
+ active_tab = tepl_tab_group_get_active_tab (tab_group);
return active_tab != NULL ? tepl_tab_get_buffer (active_tab) : NULL;
}
diff --git a/tepl/tepl-tab-group.h b/tepl/tepl-tab-group.h
new file mode 100644
index 0000000..1ddca9f
--- /dev/null
+++ b/tepl/tepl-tab-group.h
@@ -0,0 +1,79 @@
+/*
+ * This file is part of Tepl, a text editor library.
+ *
+ * Copyright 2017 - Sébastien Wilmet <swilmet gnome org>
+ *
+ * Tepl is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * Tepl is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TEPL_TAB_GROUP_H
+#define TEPL_TAB_GROUP_H
+
+#if !defined (TEPL_H_INSIDE) && !defined (TEPL_COMPILATION)
+#error "Only <tepl/tepl.h> can be included directly."
+#endif
+
+#include <glib-object.h>
+#include <tepl/tepl-types.h>
+
+G_BEGIN_DECLS
+
+#define TEPL_TYPE_TAB_GROUP (tepl_tab_group_get_type ())
+#define TEPL_TAB_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEPL_TYPE_TAB_GROUP,
TeplTabGroup))
+#define TEPL_IS_TAB_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEPL_TYPE_TAB_GROUP))
+#define TEPL_TAB_GROUP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEPL_TYPE_TAB_GROUP,
TeplTabGroupInterface))
+
+typedef struct _TeplTabGroupInterface TeplTabGroupInterface;
+
+/**
+ * TeplTabGroupInterface:
+ * @parent_interface: The parent interface.
+ * @get_tabs: Virtual function pointer for tepl_tab_group_get_tabs(). By default,
+ * %NULL is returned. When implementing this vfunc, #GList nodes must be
+ * created only for #TeplTab children; if the #TeplTabGroup contains a
+ * non-#TeplTab child, it must be skipped. See the documentation of
+ * tepl_tab_group_get_tabs().
+ * @get_active_tab: Virtual function pointer for tepl_tab_group_get_active_tab().
+ * By default, %NULL is returned.
+ *
+ * The virtual function table for #TeplTabGroup.
+ *
+ * Since: 3.0
+ */
+struct _TeplTabGroupInterface
+{
+ GTypeInterface parent_interface;
+
+ GList * (*get_tabs) (TeplTabGroup *tab_group);
+
+ TeplTab * (*get_active_tab) (TeplTabGroup *tab_group);
+};
+
+GType tepl_tab_group_get_type (void);
+
+GList * tepl_tab_group_get_tabs (TeplTabGroup *tab_group);
+
+GList * tepl_tab_group_get_views (TeplTabGroup *tab_group);
+
+GList * tepl_tab_group_get_buffers (TeplTabGroup *tab_group);
+
+TeplTab * tepl_tab_group_get_active_tab (TeplTabGroup *tab_group);
+
+TeplView * tepl_tab_group_get_active_view (TeplTabGroup *tab_group);
+
+TeplBuffer * tepl_tab_group_get_active_buffer (TeplTabGroup *tab_group);
+
+G_END_DECLS
+
+#endif /* TEPL_TAB_GROUP_H */
diff --git a/tepl/tepl-tab.c b/tepl/tepl-tab.c
index 185a8de..5208538 100644
--- a/tepl/tepl-tab.c
+++ b/tepl/tepl-tab.c
@@ -21,7 +21,7 @@
#include "tepl-view.h"
#include "tepl-buffer.h"
#include "tepl-info-bar.h"
-#include "tepl-tab-list.h"
+#include "tepl-tab-group.h"
/**
* SECTION:tab
@@ -42,7 +42,7 @@
* the ::pack_view virtual function. Similarly, the way that #GtkInfoBar's are
* added can be customized with ::pack_info_bar.
*
- * #TeplTab implements the #TeplTabList interface, for a list of only one tab.
+ * #TeplTab implements the #TeplTabGroup interface, for a group of only one tab.
* It is useful for text editors that open each file in a separate window.
*/
@@ -60,15 +60,15 @@ enum
static GParamSpec *properties[N_PROPERTIES];
-static void tepl_tab_list_interface_init (gpointer g_iface,
- gpointer iface_data);
+static void tepl_tab_group_interface_init (gpointer g_iface,
+ gpointer iface_data);
G_DEFINE_TYPE_WITH_CODE (TeplTab,
tepl_tab,
GTK_TYPE_GRID,
G_ADD_PRIVATE (TeplTab)
- G_IMPLEMENT_INTERFACE (TEPL_TYPE_TAB_LIST,
- tepl_tab_list_interface_init))
+ G_IMPLEMENT_INTERFACE (TEPL_TYPE_TAB_GROUP,
+ tepl_tab_group_interface_init))
static GtkScrolledWindow *
create_scrolled_window (void)
@@ -250,22 +250,22 @@ tepl_tab_class_init (TeplTabClass *klass)
}
static GList *
-tepl_tab_get_tabs (TeplTabList *tab_list)
+tepl_tab_get_tabs (TeplTabGroup *tab_group)
{
- return g_list_append (NULL, TEPL_TAB (tab_list));
+ return g_list_append (NULL, TEPL_TAB (tab_group));
}
static TeplTab *
-tepl_tab_get_active_tab (TeplTabList *tab_list)
+tepl_tab_get_active_tab (TeplTabGroup *tab_group)
{
- return TEPL_TAB (tab_list);
+ return TEPL_TAB (tab_group);
}
static void
-tepl_tab_list_interface_init (gpointer g_iface,
- gpointer iface_data)
+tepl_tab_group_interface_init (gpointer g_iface,
+ gpointer iface_data)
{
- TeplTabListInterface *interface = g_iface;
+ TeplTabGroupInterface *interface = g_iface;
interface->get_tabs = tepl_tab_get_tabs;
interface->get_active_tab = tepl_tab_get_active_tab;
diff --git a/tepl/tepl-types.h b/tepl/tepl-types.h
index 389e945..ea10a1a 100644
--- a/tepl/tepl-types.h
+++ b/tepl/tepl-types.h
@@ -46,7 +46,7 @@ typedef struct _TeplInfoBar TeplInfoBar;
typedef struct _TeplMenuShell TeplMenuShell;
typedef struct _TeplNotebook TeplNotebook;
typedef struct _TeplTab TeplTab;
-typedef struct _TeplTabList TeplTabList;
+typedef struct _TeplTabGroup TeplTabGroup;
typedef struct _TeplView TeplView;
G_END_DECLS
diff --git a/tepl/tepl.h b/tepl/tepl.h
index 81d351a..6606f6e 100644
--- a/tepl/tepl.h
+++ b/tepl/tepl.h
@@ -46,7 +46,7 @@
#include <tepl/tepl-metadata-manager.h>
#include <tepl/tepl-notebook.h>
#include <tepl/tepl-tab.h>
-#include <tepl/tepl-tab-list.h>
+#include <tepl/tepl-tab-group.h>
#include <tepl/tepl-utils.h>
#include <tepl/tepl-view.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]