[epiphany-extensions/tabs-reloaded: 2/9] Add stubs for tabs-reloaded extension



commit 595484970cece3ac591d9fcb07548ad555dfed40
Author: Benjamin Otte <otte gnome org>
Date:   Mon Aug 3 17:44:58 2009 +0200

    Add stubs for tabs-reloaded extension
    
    This extension is a way to draft the ideas outlined in
    http://live.gnome.org/Epiphany/FeatureDesign/TabbedBrowsingConcept
    without changing the browser.
    
    Once the functionality is agreed upon as a replacement for the current
    way of doing tabs, it should replace EphyNotebook in the core epiphany
    codebase.

 configure.ac                                       |    7 +-
 extensions/tabs-reloaded/Makefile.am               |   38 +++++++
 .../tabs-reloaded/ephy-tabs-reloaded-extension.c   |  107 ++++++++++++++++++++
 .../tabs-reloaded/ephy-tabs-reloaded-extension.h   |   54 ++++++++++
 extensions/tabs-reloaded/tabs-reloaded.c           |   42 ++++++++
 .../tabs-reloaded.ephy-extension.in.in             |   11 ++
 6 files changed, 256 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ead76f1..bbf0cce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -168,9 +168,9 @@ AM_CONDITIONAL([HAVE_OPENSP],[test "x$enable_opensp" = "xyes"])
 
 AC_MSG_CHECKING([which extensions to build])
 
-ALL_EXTENSIONS="actions adblock auto-reload auto-scroller certificates error-viewer extensions-manager-ui gestures greasemonkey java-console livehttpheaders page-info permissions push-scroller rss sample select-stylesheet sidebar smart-bookmarks soup-fly tab-groups tab-states"
-USEFUL_EXTENSIONS="actions adblock auto-reload auto-scroller certificates error-viewer extensions-manager-ui gestures java-console page-info push-scroller select-stylesheet sidebar smart-bookmarks soup-fly tab-groups tab-states"
-DEFAULT_EXTENSIONS="actions adblock auto-scroller certificates error-viewer extensions-manager-ui gestures java-console page-info push-scroller select-stylesheet sidebar smart-bookmarks soup-fly tab-groups tab-states greasemonkey"
+ALL_EXTENSIONS="actions adblock auto-reload auto-scroller certificates error-viewer extensions-manager-ui gestures greasemonkey java-console livehttpheaders page-info permissions push-scroller rss sample select-stylesheet sidebar smart-bookmarks soup-fly tab-groups tab-states tabs-reloaded"
+USEFUL_EXTENSIONS="actions adblock auto-reload auto-scroller certificates error-viewer extensions-manager-ui gestures java-console page-info push-scroller select-stylesheet sidebar smart-bookmarks soup-fly tab-groups tab-states tabs-reloaded"
+DEFAULT_EXTENSIONS="actions adblock auto-scroller certificates error-viewer extensions-manager-ui gestures java-console page-info push-scroller select-stylesheet sidebar smart-bookmarks soup-fly tab-groups tab-states greasemonkey tabs-reloaded"
 
 MOZILLA_ALL_EXTENSIONS="error-viewer java-console livehttpheaders page-info select-stylesheet smart-bookmarks"
 
@@ -317,6 +317,7 @@ extensions/smart-bookmarks/mozilla/Makefile
 extensions/soup-fly/Makefile
 extensions/tab-states/Makefile
 extensions/tab-groups/Makefile
+extensions/tabs-reloaded/Makefile
 extensions/java-console/Makefile
 extensions/java-console/mozilla/Makefile
 help/Makefile
diff --git a/extensions/tabs-reloaded/Makefile.am b/extensions/tabs-reloaded/Makefile.am
new file mode 100644
index 0000000..79bc76c
--- /dev/null
+++ b/extensions/tabs-reloaded/Makefile.am
@@ -0,0 +1,38 @@
+extensiondir = $(EXTENSIONS_DIR)
+extension_LTLIBRARIES = libtabsreloadedextension.la
+
+libtabsreloadedextension_la_SOURCES = \
+	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\"  \
+	$(AM_CPPFLAGS)
+
+libtabsreloadedextension_la_CFLAGS = \
+	$(EPIPHANY_DEPENDENCY_CFLAGS)	\
+	$(AM_CFLAGS)
+
+libtabsreloadedextension_la_LDFLAGS = \
+	-module -avoid-version \
+	-export-symbols $(top_srcdir)/ephy-extension.symbols \
+	$(AM_LDFLAGS)
+
+extensioninidir = $(extensiondir)
+extensionini_in_files = tabs-reloaded.ephy-extension.in.in
+extensionini_DATA = $(extensionini_in_files:.ephy-extension.in.in=.ephy-extension)
+
+%.ephy-extension.in: %.ephy-extension.in.in $(extension_LTLIBRARIES)
+	sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
+	    -e "s|%EXTENSION_DIR%|$(extensiondir)|" \
+	$< > $@
+
+ EPIPHANY_EXTENSION_RULE@
+
+CLEANFILES = $(extensionini_DATA)
+DISTCLEANFILES = $(extensionini_DATA)
+
+EXTRA_DIST = $(extensionini_in_files)
diff --git a/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.c b/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.c
new file mode 100644
index 0000000..db15be2
--- /dev/null
+++ b/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.c
@@ -0,0 +1,107 @@
+/*
+ *  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-reloaded-extension.h"
+#include "ephy-debug.h"
+
+#include <epiphany/epiphany.h>
+
+static void ephy_tabs_reloaded_extension_class_init (EphyTabsReloadedExtensionClass *class);
+static void ephy_tabs_reloaded_extension_iface_init (EphyExtensionIface *iface);
+static void ephy_tabs_reloaded_extension_init	 (EphyTabsReloadedExtension *extension);
+
+static GObjectClass *parent_class = NULL;
+
+static GType type = 0;
+
+GType
+ephy_tabs_reloaded_extension_get_type (void)
+{
+	return type;
+}
+
+GType
+ephy_tabs_reloaded_extension_register_type (GTypeModule *module)
+{
+	const GTypeInfo our_info =
+	{
+		sizeof (EphyTabsReloadedExtensionClass),
+		NULL,	/* base_init */
+		NULL, /* base_finalize */
+		(GClassInitFunc) ephy_tabs_reloaded_extension_class_init,
+		NULL,
+		NULL, /* class_data */
+		sizeof (EphyTabsReloadedExtension),
+		0,	/* n_preallocs */
+		(GInstanceInitFunc) ephy_tabs_reloaded_extension_init
+	};
+
+	const GInterfaceInfo extension_info =
+	{
+		(GInterfaceInitFunc) ephy_tabs_reloaded_extension_iface_init,
+		NULL,
+		NULL
+	};
+
+	type = g_type_module_register_type (module,
+					    G_TYPE_OBJECT,
+					    "EphyTabsReloadedExtension",
+					    &our_info, 0);
+	
+	g_type_module_add_interface (module,
+				     type,
+				     EPHY_TYPE_EXTENSION,
+				     &extension_info);
+	
+	return type;
+}
+
+static void
+impl_attach_window (EphyExtension *extension,
+			EphyWindow *window)
+{
+        g_print ("attach window");
+}
+
+static void
+impl_detach_window (EphyExtension *ext,
+			EphyWindow *window)
+{
+        g_print ("detach window");
+}
+
+static void
+ephy_tabs_reloaded_extension_init (EphyTabsReloadedExtension *extension)
+{
+	LOG ("EphyTabsReloadedExtension initialising");
+}
+
+static void
+ephy_tabs_reloaded_extension_iface_init (EphyExtensionIface *iface)
+{
+	iface->attach_window = impl_attach_window;
+	iface->detach_window = impl_detach_window;
+}
+
+static void
+ephy_tabs_reloaded_extension_class_init (EphyTabsReloadedExtensionClass *class)
+{
+	parent_class = (GObjectClass *) g_type_class_peek_parent (class);
+}
diff --git a/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.h b/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.h
new file mode 100644
index 0000000..e926d8c
--- /dev/null
+++ b/extensions/tabs-reloaded/ephy-tabs-reloaded-extension.h
@@ -0,0 +1,54 @@
+/*
+ *  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_RELOADED_EXTENSION_H
+#define EPHY_TABS_RELOADED_EXTENSION_H
+
+#include <glib-object.h>
+#include <gmodule.h>
+
+G_BEGIN_DECLS
+
+#define EPHY_TYPE_TABS_RELOADED_EXTENSION		(ephy_tabs_reloaded_extension_get_type())
+#define EPHY_TABS_RELOADED_EXTENSION(object)		(G_TYPE_CHECK_INSTANCE_CAST((object), EPHY_TYPE_TABS_RELOADED_EXTENSION, EphyTabsReloadedExtension))
+#define EPHY_TABS_RELOADED_EXTENSION_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST((klass), EPHY_TYPE_TABS_RELOADED_EXTENSION, EphyTabsReloadedExtensionClass))
+#define EPHY_IS_TABS_RELOADED_EXTENSION(object)		(G_TYPE_CHECK_INSTANCE_TYPE((object), EPHY_TYPE_TABS_RELOADED_EXTENSION))
+#define EPHY_IS_TABS_RELOADED_EXTENSION_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), EPHY_TYPE_TABS_RELOADED_EXTENSION))
+#define EPHY_TABS_RELOADED_EXTENSION_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_TABS_RELOADED_EXTENSION, EphyTabsReloadedExtensionClass))
+
+typedef struct _EphyTabsReloadedExtension		EphyTabsReloadedExtension;
+typedef struct _EphyTabsReloadedExtensionClass	        EphyTabsReloadedExtensionClass;
+typedef struct _EphyTabsReloadedExtensionPrivate	EphyTabsReloadedExtensionPrivate;
+
+struct _EphyTabsReloadedExtensionClass
+{
+	GObjectClass	parent_class;
+};
+
+struct _EphyTabsReloadedExtension
+{
+	GObject	parent_object;
+};
+
+GType	ephy_tabs_reloaded_extension_get_type	(void);
+
+GType	ephy_tabs_reloaded_extension_register_type	(GTypeModule *module);
+
+G_END_DECLS
+
+#endif
diff --git a/extensions/tabs-reloaded/tabs-reloaded.c b/extensions/tabs-reloaded/tabs-reloaded.c
new file mode 100644
index 0000000..3cf942f
--- /dev/null
+++ b/extensions/tabs-reloaded/tabs-reloaded.c
@@ -0,0 +1,42 @@
+/*
+ *  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-reloaded-extension.h"
+
+#include <gmodule.h>
+#include <glib/gi18n-lib.h>
+
+G_MODULE_EXPORT GType register_module (GTypeModule *module);
+
+G_MODULE_EXPORT GType
+register_module (GTypeModule *module)
+{
+	GType extension_type;
+	
+	extension_type = ephy_tabs_reloaded_extension_register_type (module);
+
+#ifdef ENABLE_NLS
+	/* Initialise i18n */
+	bindtextdomain (GETTEXT_PACKAGE, EPHY_EXTENSIONS_LOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif
+
+	return extension_type;
+}
diff --git a/extensions/tabs-reloaded/tabs-reloaded.ephy-extension.in.in b/extensions/tabs-reloaded/tabs-reloaded.ephy-extension.in.in
new file mode 100644
index 0000000..23178bf
--- /dev/null
+++ b/extensions/tabs-reloaded/tabs-reloaded.ephy-extension.in.in
@@ -0,0 +1,11 @@
+[Epiphany Extension]
+_Name=Tabs Reloaded
+_Description=A new way to handle tabs in Epiphany
+Authors=Benjamin Otte <otte gnome org>
+Version=1
+URL=http://live.gnome.org/Epiphany/FeatureDesign/TabbedBrowsingConcept
+
+
+[Loader]
+Type=shlib
+Library=%EXTENSION_DIR%/%LIBRARY%



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