[epiphany-extensions/tabs-reloaded: 2/16] [tabs-reloaded] Add a first chunk of code



commit f23432c860b715109dd28b7c1db3cac77a7e2633
Author: Benjamin Otte <otte gnome org>
Date:   Wed Aug 5 11:32:30 2009 +0200

    [tabs-reloaded] Add a first chunk of code
    
    The tabs are listed in a tree view on the left now. Icon, title and
    close button are shown.
    No user interaction works at all.

 extensions/tabs-reloaded/Makefile.am               |   18 +-
 extensions/tabs-reloaded/ephy-tabs-manager.c       |  290 ++++++++++++++++++++
 extensions/tabs-reloaded/ephy-tabs-manager.h       |   72 +++++
 .../tabs-reloaded/ephy-tabs-reloaded-extension.c   |  173 ++++++++++++-
 extensions/tabs-reloaded/tabs-reloaded.c           |    3 +
 extensions/tabs-reloaded/tabs-reloaded.ui          |   61 ++++
 6 files changed, 607 insertions(+), 10 deletions(-)
---
diff --git a/extensions/tabs-reloaded/Makefile.am b/extensions/tabs-reloaded/Makefile.am
index 79bc76c..f3e5160 100644
--- a/extensions/tabs-reloaded/Makefile.am
+++ b/extensions/tabs-reloaded/Makefile.am
@@ -2,18 +2,20 @@ extensiondir = $(EXTENSIONS_DIR)
 extension_LTLIBRARIES = libtabsreloadedextension.la
 
 libtabsreloadedextension_la_SOURCES = \
-	ephy-tabs-reloaded-extension.c	\
-	ephy-tabs-reloaded-extension.h	\
+	ephy-tabs-manager.c \
+	ephy-tabs-manager.h \
+	ephy-tabs-reloaded-extension.c \
+	ephy-tabs-reloaded-extension.h \
 	tabs-reloaded.c
 
 libtabsreloadedextension_la_CPPFLAGS = \
-        -I$(top_srcdir)/include				\
-	-DSHARE_DIR=\"$(pkgdatadir)\"			\
-	-DEPHY_EXTENSIONS_LOCALEDIR=\"$(datadir)/locale\"  \
+        -I$(top_srcdir)/include	\
+	-DSHARE_DIR=\"$(pkgdatadir)\" \
+	-DEPHY_EXTENSIONS_LOCALEDIR=\"$(datadir)/locale\" \
 	$(AM_CPPFLAGS)
 
 libtabsreloadedextension_la_CFLAGS = \
-	$(EPIPHANY_DEPENDENCY_CFLAGS)	\
+	$(EPIPHANY_DEPENDENCY_CFLAGS) \
 	$(AM_CFLAGS)
 
 libtabsreloadedextension_la_LDFLAGS = \
@@ -21,6 +23,10 @@ libtabsreloadedextension_la_LDFLAGS = \
 	-export-symbols $(top_srcdir)/ephy-extension.symbols \
 	$(AM_LDFLAGS)
 
+gladedir = $(pkgdatadir)/glade
+glade_DATA = \
+	tabs-reloaded.ui
+
 extensioninidir = $(extensiondir)
 extensionini_in_files = tabs-reloaded.ephy-extension.in.in
 extensionini_DATA = $(extensionini_in_files:.ephy-extension.in.in=.ephy-extension)
diff --git a/extensions/tabs-reloaded/ephy-tabs-manager.c b/extensions/tabs-reloaded/ephy-tabs-manager.c
new file mode 100644
index 0000000..0c12f3e
--- /dev/null
+++ b/extensions/tabs-reloaded/ephy-tabs-manager.c
@@ -0,0 +1,290 @@
+/*
+ *  Copyright © 2009 Benjamin Otte
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "ephy-tabs-manager.h"
+#include "ephy-debug.h"
+
+#include <epiphany/epiphany.h>
+
+G_DEFINE_DYNAMIC_TYPE (EphyTabsManager, ephy_tabs_manager, GTK_TYPE_TREE_STORE)
+
+static void
+ephy_tabs_manager_detach (EphyTabsManager *manager)
+{
+  if (manager->notebook == NULL)
+    return;
+
+  g_signal_handlers_disconnect_matched (manager->notebook,
+                                        G_SIGNAL_MATCH_DATA,
+                                        0,
+                                        0,
+                                        NULL,
+                                        NULL,
+                                        manager);
+
+  gtk_tree_store_clear (GTK_TREE_STORE (manager));
+
+  g_object_unref (manager->notebook);
+  manager->notebook = NULL;
+}
+
+static void
+ephy_tabs_manager_finalize (GObject *object)
+{
+  EphyTabsManager *manager = EPHY_TABS_MANAGER (object);
+
+  ephy_tabs_manager_detach (manager);
+
+  G_OBJECT_CLASS (ephy_tabs_manager_parent_class)->finalize (object);
+}
+
+static void
+ephy_tabs_manager_class_init (EphyTabsManagerClass *class)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+  object_class->finalize = ephy_tabs_manager_finalize;
+}
+
+static void
+ephy_tabs_manager_class_finalize (EphyTabsManagerClass *class)
+{
+}
+
+static void
+ephy_tabs_manager_init (EphyTabsManager *extension)
+{
+  GType types[] = { EPHY_TYPE_EMBED };
+
+  gtk_tree_store_set_column_types (GTK_TREE_STORE (extension),
+                                   G_N_ELEMENTS (types),
+                                   types);
+}
+
+void
+ephy_tabs_manager_register (GTypeModule *module)
+{
+  ephy_tabs_manager_register_type (module);
+}
+
+EphyTabsManager *
+ephy_tabs_manager_new (void)
+{
+    return g_object_new (EPHY_TYPE_TABS_MANAGER, NULL);
+}
+
+static void
+ephy_tabs_manager_view_changed (GObject *view, GParamSpec *psepc, EphyTabsManager *manager)
+{
+  GtkTreeModel *model = GTK_TREE_MODEL (manager);
+  GtkTreeIter iter;
+  EphyEmbed *embed;
+  GtkTreePath *path;
+
+  embed = EPHY_EMBED (gtk_widget_get_parent (GTK_WIDGET (view)));
+  if (!ephy_tabs_manager_find_tab (manager, &iter, embed))
+    {
+      g_assert_not_reached ();
+    }
+
+  path = gtk_tree_model_get_path (model, &iter);
+  gtk_tree_model_row_changed (model, path, &iter);
+  gtk_tree_path_free (path);
+}
+
+/**
+ * ephy_tabs_manager_add_tab:
+ * @manager: the tab manager
+ * @embed: the tab to add
+ * @position: 0-indexed position to add the tab at or -1 for 
+ *            adding at the end.
+ *
+ * Adds a new tab to the manager.
+ **/
+void
+ephy_tabs_manager_add_tab (EphyTabsManager *manager,
+                           EphyEmbed *      embed,
+                           int              position)
+{
+  g_return_if_fail (EPHY_IS_TABS_MANAGER (manager));
+  g_return_if_fail (EPHY_IS_EMBED (embed));
+  g_return_if_fail (position >= -1);
+
+  gtk_tree_store_insert_with_values (GTK_TREE_STORE (manager),
+                                     NULL,
+                                     NULL,
+                                     position,
+                                     0, embed,
+                                     -1);
+
+  g_signal_connect (ephy_embed_get_web_view (embed),
+                    "notify",
+                    G_CALLBACK (ephy_tabs_manager_view_changed),
+                    manager);
+}
+
+/**
+ * ephy_tabs_manager_remove_tab:
+ * @manager: the tab manager
+ * @embed: the tab to remove
+ *
+ * Removes the given tab from the manager. The tab must be managed by
+ * the @manager.
+ **/
+void
+ephy_tabs_manager_remove_tab (EphyTabsManager *manager,
+                              EphyEmbed *      embed)
+{
+  GtkTreeIter iter;
+
+  g_return_if_fail (EPHY_IS_TABS_MANAGER (manager));
+  g_return_if_fail (EPHY_IS_EMBED (embed));
+
+  if (!ephy_tabs_manager_find_tab (manager, &iter, embed))
+    {
+      g_assert_not_reached ();
+    }
+
+  gtk_tree_store_remove (GTK_TREE_STORE (manager), &iter);
+}
+
+/**
+ * ephy_tabs_manager_get_tab:
+ * @manager: the manager
+ * @iter: a valid tree iter
+ *
+ * Gets the #EphyEmbed of the tab associated with @iter.
+ *
+ * Returns: the tab associated with @iter
+ **/
+EphyEmbed *
+ephy_tabs_manager_get_tab (EphyTabsManager *manager,
+                           GtkTreeIter *    iter)
+{
+  GValue value = { 0, };
+  EphyEmbed *embed;
+
+  g_return_val_if_fail (EPHY_IS_TABS_MANAGER (manager), NULL);
+  g_return_val_if_fail (iter != NULL, NULL);
+
+  gtk_tree_model_get_value (GTK_TREE_MODEL (manager), iter, 0, &value);
+  embed = EPHY_EMBED (g_value_get_object (&value));
+  g_value_unset (&value);
+
+  return embed;
+}
+
+/**
+ * ephy_tabs_manager_find_tab:
+ * @manager: the tab manager
+ * @iter: the iterator to initialize to point to @embed
+ * @embed: the tab to find
+ *
+ * Tries to find @embed in @manager. If successful, @iter is initialized
+ * to point to @embed and %TRUE is returned. If @embed is not managed by
+ * @manager, %FALSE is returned.
+ *
+ * Returns: %TRUE if @embed was found and @iter was initialized.
+ **/
+gboolean
+ephy_tabs_manager_find_tab (EphyTabsManager *manager,
+                            GtkTreeIter *    iter,
+                            EphyEmbed *      embed)
+{
+  GtkTreeModel *model;
+  gboolean valid;
+
+  g_return_val_if_fail (EPHY_IS_TABS_MANAGER (manager), FALSE);
+  g_return_val_if_fail (iter != NULL, FALSE);
+  g_return_val_if_fail (EPHY_IS_EMBED (embed), FALSE);
+
+  model = GTK_TREE_MODEL (manager);
+  for (valid = gtk_tree_model_get_iter_first (model, iter);
+       valid;
+       valid = gtk_tree_model_iter_next (model, iter))
+    {
+        EphyEmbed *check = ephy_tabs_manager_get_tab (manager, iter);
+        if (check == embed)
+          return TRUE;
+    }
+
+  return FALSE;
+}
+
+/*** NOTEBOOK MONITORING CODE ***/
+
+static void
+ephy_tabs_manager_page_added_cb (GtkNotebook *    notebook,
+                                 EphyEmbed *      child,
+                                 guint            page_num,
+                                 EphyTabsManager *manager)
+{
+  ephy_tabs_manager_add_tab (manager, child, page_num);
+}
+
+static void
+ephy_tabs_manager_page_removed_cb (GtkNotebook *    notebook,
+                                   EphyEmbed *      child,
+                                   guint            page_num,
+                                   EphyTabsManager *manager)
+{
+  ephy_tabs_manager_remove_tab (manager, child);
+}
+
+static void
+ephy_tabs_manager_page_reordered_cb (GtkNotebook *    notebook,
+                                     EphyEmbed *      child,
+                                     guint            page_num,
+                                     EphyTabsManager *manager)
+{
+  g_message ("implement reordered signal");
+}
+
+void
+ephy_tabs_manager_attach (EphyTabsManager *manager,
+                          GtkNotebook *    notebook)
+{
+  int i;
+
+  g_return_if_fail (EPHY_IS_TABS_MANAGER (manager));
+  g_return_if_fail (EPHY_IS_TABS_MANAGER (manager));
+
+  g_object_ref (notebook);
+  ephy_tabs_manager_detach (manager);
+  manager->notebook = notebook;
+
+  g_signal_connect_after (notebook, "page-added",
+                          G_CALLBACK (ephy_tabs_manager_page_added_cb),
+                          manager);
+  g_signal_connect_after (notebook, "page-removed",
+                          G_CALLBACK (ephy_tabs_manager_page_removed_cb),
+                          manager);
+  g_signal_connect_after (notebook, "page-reordered",
+                          G_CALLBACK (ephy_tabs_manager_page_reordered_cb),
+                          manager);
+
+  for (i = 0; i < gtk_notebook_get_n_pages (notebook); i++)
+    {
+      ephy_tabs_manager_add_tab (manager,
+                                 EPHY_EMBED (gtk_notebook_get_nth_page (notebook, i)),
+                                 -1);
+    }
+}
+
diff --git a/extensions/tabs-reloaded/ephy-tabs-manager.h b/extensions/tabs-reloaded/ephy-tabs-manager.h
new file mode 100644
index 0000000..abb2c28
--- /dev/null
+++ b/extensions/tabs-reloaded/ephy-tabs-manager.h
@@ -0,0 +1,72 @@
+/*
+ *  Copyright © 2009 Benjamin Otte
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef EPHY_TABS_MANAGER_H
+#define EPHY_TABS_MANAGER_H
+
+#include <epiphany/epiphany.h>
+
+G_BEGIN_DECLS
+
+#define EPHY_TYPE_TABS_MANAGER		(ephy_tabs_manager_get_type())
+#define EPHY_TABS_MANAGER(object)		(G_TYPE_CHECK_INSTANCE_CAST((object), EPHY_TYPE_TABS_MANAGER, EphyTabsManager))
+#define EPHY_TABS_MANAGER_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST((klass), EPHY_TYPE_TABS_MANAGER, EphyTabsManagerClass))
+#define EPHY_IS_TABS_MANAGER(object)		(G_TYPE_CHECK_INSTANCE_TYPE((object), EPHY_TYPE_TABS_MANAGER))
+#define EPHY_IS_TABS_MANAGER_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), EPHY_TYPE_TABS_MANAGER))
+#define EPHY_TABS_MANAGER_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_TABS_MANAGER, EphyTabsManagerClass))
+
+typedef struct _EphyTabsManager		EphyTabsManager;
+typedef struct _EphyTabsManagerClass	EphyTabsManagerClass;
+typedef struct _EphyTabsManagerPrivate	EphyTabsManagerPrivate;
+
+struct _EphyTabsManager
+{
+    GtkTreeStore                store;
+
+    GtkNotebook *               notebook;       /* notebook we are attached to */
+};
+
+struct _EphyTabsManagerClass
+{
+    GtkTreeStoreClass           store_class;
+};
+
+GType	                ephy_tabs_manager_get_type	(void);
+void                    ephy_tabs_manager_register      (GTypeModule *          module);
+
+EphyTabsManager *       ephy_tabs_manager_new           (void);
+
+void                    ephy_tabs_manager_add_tab       (EphyTabsManager *      manager,
+                                                         EphyEmbed *            embed,
+                                                         int                    position);
+void                    ephy_tabs_manager_remove_tab    (EphyTabsManager *      manager,
+                                                         EphyEmbed *            embed);
+
+EphyEmbed *             ephy_tabs_manager_get_tab       (EphyTabsManager *      manager,
+                                                         GtkTreeIter *          iter);
+gboolean                ephy_tabs_manager_find_tab      (EphyTabsManager *      manager,
+                                                         GtkTreeIter *          iter,
+                                                         EphyEmbed *            embed);
+
+void                    ephy_tabs_manager_attach        (EphyTabsManager *      manager,
+                                                         GtkNotebook *          notebook);
+
+
+G_END_DECLS
+
+#endif
diff --git a/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.c b/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.c
index db15be2..96c56e0 100644
--- a/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.c
+++ b/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.c
@@ -19,6 +19,7 @@
 #include "config.h"
 
 #include "ephy-tabs-reloaded-extension.h"
+#include "ephy-tabs-manager.h"
 #include "ephy-debug.h"
 
 #include <epiphany/epiphany.h>
@@ -31,6 +32,8 @@ static GObjectClass *parent_class = NULL;
 
 static GType type = 0;
 
+static GQuark tabs_reloaded_quark;
+
 GType
 ephy_tabs_reloaded_extension_get_type (void)
 {
@@ -74,23 +77,185 @@ ephy_tabs_reloaded_extension_register_type (GTypeModule *module)
 }
 
 static void
+pixbuf_renderer_cell_data_func (GtkCellLayout *  column,
+                                GtkCellRenderer *renderer,
+                                GtkTreeModel *   model,
+                                GtkTreeIter *    iter,
+                                gpointer         unused)
+{
+  EphyEmbed *embed;
+  EphyWebView *view;
+  
+  embed = ephy_tabs_manager_get_tab (EPHY_TABS_MANAGER (model),
+                                     iter);
+  view = ephy_embed_get_web_view (embed);
+
+  g_object_set (renderer,
+                "pixbuf", ephy_web_view_get_icon (view),
+                NULL);
+}
+
+static void
+text_renderer_cell_data_func (GtkCellLayout *  column,
+                              GtkCellRenderer *renderer,
+                              GtkTreeModel *   model,
+                              GtkTreeIter *    iter,
+                              gpointer         unused)
+{
+  EphyEmbed *embed;
+  EphyWebView *view;
+  
+  embed = ephy_tabs_manager_get_tab (EPHY_TABS_MANAGER (model),
+                                     iter);
+  view = ephy_embed_get_web_view (embed);
+
+  g_object_set (renderer,
+                "text", ephy_web_view_get_title (view),
+                NULL);
+}
+
+static void
+sanitize_tree_view (GtkTreeView *view)
+{
+  static const GtkCellLayoutDataFunc funcs[] = {
+    pixbuf_renderer_cell_data_func,
+    text_renderer_cell_data_func,
+    NULL /* close button */
+  };
+  GtkCellLayout *column;
+  GtkCellRenderer *renderer;
+  GList *renderers, *walk;
+  guint column_id, renderer_id;
+
+  renderer_id = 0;
+  for (column_id = 0;; column_id++)
+    {
+      column = GTK_CELL_LAYOUT (gtk_tree_view_get_column (view, column_id));
+      if (column == NULL)
+        break;
+      renderers = gtk_cell_layout_get_cells (column);
+      for (walk = renderers; walk; walk = g_list_next (walk))
+        {
+          renderer = walk->data;
+          if (funcs[renderer_id])
+            gtk_cell_layout_set_cell_data_func (column,
+                                                renderer,
+                                                funcs[renderer_id],
+                                                NULL,
+                                                NULL);
+          renderer_id++;
+        }
+    }
+
+  /* 
+   * If this fails, someone modified the ui file to contain different
+   * cell renderers and we need to add or remove data functions from 
+   * the funcs array above to match that change.
+   */
+  g_assert (renderer_id == G_N_ELEMENTS (funcs));
+}
+
+static void
 impl_attach_window (EphyExtension *extension,
-			EphyWindow *window)
+		    EphyWindow *   window)
 {
-        g_print ("attach window");
+	GtkBuilder *builder;
+	GError *error = NULL;
+        GtkWidget *tabs, *notebook, *parent;
+        GValue position = { 0, };
+        EphyTabsManager *manager;
+
+	builder = gtk_builder_new ();
+	gtk_builder_add_from_file (builder, SHARE_DIR "/glade/tabs-reloaded.ui", &error);
+	if (error)
+	{
+		g_warning ("Unable to load UI file: %s", error->message);
+		g_error_free (error);
+		return;
+	}
+
+        notebook = ephy_window_get_notebook (window);
+
+	tabs = (GtkWidget *) gtk_builder_get_object (builder, "TabView");
+        sanitize_tree_view (GTK_TREE_VIEW (tabs));
+        manager = ephy_tabs_manager_new ();
+        ephy_tabs_manager_attach (manager, GTK_NOTEBOOK (notebook));
+        gtk_tree_view_set_model (GTK_TREE_VIEW (tabs), GTK_TREE_MODEL (manager));
+        g_object_unref (manager);
+
+	tabs = (GtkWidget *) gtk_builder_get_object (builder, "TabBox");
+        g_return_if_fail (GTK_IS_PANED (tabs));
+        parent = gtk_widget_get_parent (notebook);
+
+	/* Add the sidebar and the current notebook to a
+	 * GtkHPaned, and add the hpaned to where the notebook
+	 * currently is */
+	g_value_init (&position, G_TYPE_INT);
+	gtk_container_child_get_property (GTK_CONTAINER (parent),
+					  notebook, "position", &position);
+
+	g_object_ref (notebook);
+	gtk_container_remove (GTK_CONTAINER (parent), notebook);
+	gtk_paned_add2 (GTK_PANED (tabs), notebook);
+	g_object_unref (notebook);
+
+	/* work-around for http://bugzilla.gnome.org/show_bug.cgi?id=169116 */
+	gtk_widget_hide (notebook);
+	gtk_widget_show (notebook);
+
+	gtk_container_add (GTK_CONTAINER (parent), tabs);
+	gtk_container_child_set_property (GTK_CONTAINER (parent),
+					  tabs, "position", &position);
+	g_value_unset (&position);
+
+	g_object_unref (builder);
+        g_object_set_qdata (G_OBJECT (window), tabs_reloaded_quark, tabs);
 }
 
 static void
 impl_detach_window (EphyExtension *ext,
-			EphyWindow *window)
+		    EphyWindow *   window)
 {
-        g_print ("detach window");
+        GtkWidget *tabs, *notebook, *parent;
+        GValue position = { 0, };
+        
+        tabs = g_object_steal_qdata (G_OBJECT (window), tabs_reloaded_quark);
+        if (tabs == NULL)
+                return;
+
+	notebook = gtk_paned_get_child2 (GTK_PANED (tabs));
+	parent = gtk_widget_get_parent (tabs);
+
+	/* Remove the Sidebar, replacing our hpaned with the
+	 * notebook itself */
+	g_value_init (&position, G_TYPE_INT);
+	gtk_container_child_get_property (GTK_CONTAINER (parent),
+					  tabs, "position", &position);
+
+	g_object_ref (notebook);
+	gtk_container_remove (GTK_CONTAINER (tabs), notebook);
+	gtk_container_remove (GTK_CONTAINER (parent), tabs);
+
+	gtk_container_add (GTK_CONTAINER (parent), notebook);
+
+	/* work-around for http://bugzilla.gnome.org/show_bug.cgi?id=169116 */
+        gtk_widget_hide (notebook);
+	gtk_widget_show (notebook);
+
+	g_object_unref (notebook);
+
+	gtk_container_child_set_property (GTK_CONTAINER (parent),
+					  notebook, "position", &position);
+
+	g_value_unset (&position);
 }
 
 static void
 ephy_tabs_reloaded_extension_init (EphyTabsReloadedExtension *extension)
 {
 	LOG ("EphyTabsReloadedExtension initialising");
+
+        tabs_reloaded_quark = g_quark_from_static_string ("ephy-tabs-reloaded");
 }
 
 static void
diff --git a/extensions/tabs-reloaded/tabs-reloaded.c b/extensions/tabs-reloaded/tabs-reloaded.c
index 3cf942f..2c56acc 100644
--- a/extensions/tabs-reloaded/tabs-reloaded.c
+++ b/extensions/tabs-reloaded/tabs-reloaded.c
@@ -18,6 +18,7 @@
 
 #include "config.h"
 
+#include "ephy-tabs-manager.h"
 #include "ephy-tabs-reloaded-extension.h"
 
 #include <gmodule.h>
@@ -32,6 +33,8 @@ register_module (GTypeModule *module)
 	
 	extension_type = ephy_tabs_reloaded_extension_register_type (module);
 
+        ephy_tabs_manager_register (module);
+
 #ifdef ENABLE_NLS
 	/* Initialise i18n */
 	bindtextdomain (GETTEXT_PACKAGE, EPHY_EXTENSIONS_LOCALEDIR);
diff --git a/extensions/tabs-reloaded/tabs-reloaded.ui b/extensions/tabs-reloaded/tabs-reloaded.ui
new file mode 100644
index 0000000..06616c8
--- /dev/null
+++ b/extensions/tabs-reloaded/tabs-reloaded.ui
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkHPaned" id="TabBox">
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <property name="position">150</property>
+    <property name="position_set">True</property>
+    <child>
+      <object class="GtkScrolledWindow" id="scrolledwindow1">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="hscrollbar_policy">never</property>
+        <property name="vscrollbar_policy">automatic</property>
+        <child>
+          <object class="GtkTreeView" id="TabView">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="headers_visible">False</property>
+            <property name="headers_clickable">False</property>
+            <property name="search_column">0</property>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                <property name="title">column</property>
+                <property name="expand">True</property>
+                <child>
+                  <object class="GtkCellRendererPixbuf" id="icon"/>
+                </child>
+                <child>
+                  <object class="GtkCellRendererText" id="title">
+                    <property name="width">1</property>
+                    <property name="ellipsize">end</property>
+                    <property name="single_paragraph_mode">True</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                <property name="title">column</property>
+                <child>
+                  <object class="GtkCellRendererPixbuf" id="close">
+                    <property name="stock_id">gtk-close</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="resize">False</property>
+        <property name="shrink">True</property>
+      </packing>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+  </object>
+</interface>



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