[tepl/wip/tab-list] Implement TeplTabList interface



commit f87de9efb84a8fa32cdde32be812bc69cc3c5c0b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jun 24 07:06:03 2017 +0200

    Implement TeplTabList interface

 po/POTFILES.in       |    1 +
 tepl/Makefile.am     |    2 +
 tepl/tepl-tab-list.c |   36 ++++++++++++++++++++++++++++++++++
 tepl/tepl-tab-list.h |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tepl/tepl-types.h    |    1 +
 tepl/tepl.h          |    1 +
 6 files changed, 93 insertions(+), 0 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 88ab969..de15d83 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -21,5 +21,6 @@ tepl/tepl-menu-item.c
 tepl/tepl-menu-shell.c
 tepl/tepl-metadata-manager.c
 tepl/tepl-tab.c
+tepl/tepl-tab-list.c
 tepl/tepl-utils.c
 tepl/tepl-view.c
diff --git a/tepl/Makefile.am b/tepl/Makefile.am
index a292039..a8d5e85 100644
--- a/tepl/Makefile.am
+++ b/tepl/Makefile.am
@@ -33,6 +33,7 @@ tepl_public_headers =                         \
        tepl-metadata-manager.h                 \
        tepl-types.h                            \
        tepl-tab.h                              \
+       tepl-tab-list.h                         \
        tepl-utils.h                            \
        tepl-view.h
 
@@ -57,6 +58,7 @@ tepl_public_c_files =                         \
        tepl-menu-shell.c                       \
        tepl-metadata-manager.c                 \
        tepl-tab.c                              \
+       tepl-tab-list.c                         \
        tepl-utils.c                            \
        tepl-view.c
 
diff --git a/tepl/tepl-tab-list.c b/tepl/tepl-tab-list.c
new file mode 100644
index 0000000..1e3ea84
--- /dev/null
+++ b/tepl/tepl-tab-list.c
@@ -0,0 +1,36 @@
+/*
+ * 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/>.
+ */
+
+#include "tepl-tab-list.h"
+
+G_DEFINE_INTERFACE (TeplTabList, tepl_tab_list, G_TYPE_OBJECT)
+
+static void
+tepl_tab_list_default_init (TeplTabListInterface *interface)
+{
+       /* Add properties and signals to the interface here. */
+}
+
+void
+tepl_tab_list_do_something (TeplTabList *tab_list)
+{
+       g_return_if_fail (TEPL_IS_TAB_LIST (tab_list));
+
+       TEPL_TAB_LIST_GET_INTERFACE (tab_list)->do_something (tab_list);
+}
diff --git a/tepl/tepl-tab-list.h b/tepl/tepl-tab-list.h
new file mode 100644
index 0000000..b2f8818
--- /dev/null
+++ b/tepl/tepl-tab-list.h
@@ -0,0 +1,52 @@
+/*
+ * 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_LIST_H
+#define TEPL_TAB_LIST_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_LIST               (tepl_tab_list_get_type ())
+#define TEPL_TAB_LIST(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEPL_TYPE_TAB_LIST, 
TeplTabList))
+#define TEPL_IS_TAB_LIST(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEPL_TYPE_TAB_LIST))
+#define TEPL_TAB_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEPL_TYPE_TAB_LIST, 
TeplTabListInterface))
+
+typedef struct _TeplTabListInterface TeplTabListInterface;
+
+struct _TeplTabListInterface
+{
+       GTypeInterface parent_interface;
+
+       void (*do_something) (TeplTabList *tab_list);
+};
+
+GType          tepl_tab_list_get_type          (void);
+
+void tepl_tab_list_do_something (TeplTabList *tab_list);
+
+G_END_DECLS
+
+#endif /* TEPL_TAB_LIST_H */
diff --git a/tepl/tepl-types.h b/tepl/tepl-types.h
index 0d4d3db..b988e49 100644
--- a/tepl/tepl-types.h
+++ b/tepl/tepl-types.h
@@ -45,6 +45,7 @@ typedef struct _TeplGutterRendererFolds               TeplGutterRendererFolds;
 typedef struct _TeplInfoBar                    TeplInfoBar;
 typedef struct _TeplMenuShell                  TeplMenuShell;
 typedef struct _TeplTab                                TeplTab;
+typedef struct _TeplTabList                    TeplTabList;
 typedef struct _TeplView                       TeplView;
 
 G_END_DECLS
diff --git a/tepl/tepl.h b/tepl/tepl.h
index 5729971..d9d75fa 100644
--- a/tepl/tepl.h
+++ b/tepl/tepl.h
@@ -45,6 +45,7 @@
 #include <tepl/tepl-menu-shell.h>
 #include <tepl/tepl-metadata-manager.h>
 #include <tepl/tepl-tab.h>
+#include <tepl/tepl-tab-list.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]