aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-07-13 16:52:36 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-07-13 16:52:36 +0800
commit9f70e82e7fd4d8888f55c63cf3eb911d27b0fbec (patch)
tree089536612813c5504f5fe5a35184e3ff23a8adcd /plugins
parentf73556913d8a794f6c8ed17a7664d0a2f61635da (diff)
downloadgsoc2013-epiphany-9f70e82e7fd4d8888f55c63cf3eb911d27b0fbec.tar
gsoc2013-epiphany-9f70e82e7fd4d8888f55c63cf3eb911d27b0fbec.tar.gz
gsoc2013-epiphany-9f70e82e7fd4d8888f55c63cf3eb911d27b0fbec.tar.bz2
gsoc2013-epiphany-9f70e82e7fd4d8888f55c63cf3eb911d27b0fbec.tar.lz
gsoc2013-epiphany-9f70e82e7fd4d8888f55c63cf3eb911d27b0fbec.tar.xz
gsoc2013-epiphany-9f70e82e7fd4d8888f55c63cf3eb911d27b0fbec.tar.zst
gsoc2013-epiphany-9f70e82e7fd4d8888f55c63cf3eb911d27b0fbec.zip
2003-07-13 Marco Pesenti Gritti <marco@it.gnome.org>
* Makefile.am: * configure.in: * embed/Makefile.am: * embed/ephy-embed-shell.c: (ephy_embed_shell_get_favicon_cache), (impl_get_downloader_view): * embed/ephy-embed-shell.h: * embed/ephy-embed-single.c: * embed/ephy-embed-single.h: * embed/mozilla/ProgressListener.cpp: * embed/mozilla/mozilla-embed.cpp: * lib/Makefile.am: * lib/ephy-langs.h: * lib/ephy-node.c: (unref_signal_objects), (ephy_node_signal_connect_object): * plugins/Makefile.am: * plugins/sample/Makefile.am: * plugins/sample/sample.c: (bmk_added), (bmk_removed), (bmk_changed), (switch_page_cb), (window_focus_in_cb), (location_changed_cb), (tab_added_cb), (new_window_cb), (plugin_init): * src/Makefile.am: * src/bookmarks/Makefile.am: * src/bookmarks/ephy-bookmark-action.c: (ephy_bookmark_action_sync_icon): * src/bookmarks/ephy-bookmark-properties.c: (set_window_icon), (ephy_bookmark_properties_init): * src/bookmarks/ephy-bookmarks-editor.c: (provide_favicon), (ephy_bookmarks_editor_init): * src/bookmarks/ephy-bookmarks.c: (update_favorites_menus): * src/bookmarks/ephy-topic-action.c: (build_bookmarks_menu): * src/ephy-automation.c: (impl_ephy_automation_loadurl), (impl_ephy_automation_quit), (impl_ephy_automation_load_session): * src/ephy-favicon-action.c: (ephy_favicon_action_init): * src/ephy-history-window.c: (confirmation_dialog_response_cb), (provide_favicon): * src/ephy-location-action.c: (connect_proxy): * src/ephy-notebook.c: (sync_icon): * src/ephy-shell.c: (ephy_shell_get_active_window), (ephy_shell_get_session), (ephy_shell_get_autocompletion), (ephy_shell_get_toolbars_model): * src/ephy-shell.h: * src/ephy-tab.c: (ephy_tab_net_state_cb), (ephy_tab_init), (ephy_tab_get_action): * src/ephy-tab.h: * src/ephy-tabs-menu.c: (ephy_tabs_menu_update): * src/ephy-window.c: (ephy_window_fullscreen), (ephy_window_unfullscreen), (sync_tab_icon), (ephy_window_init), (remove_from_session), (ephy_window_get_active_tab):
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Makefile.am6
-rw-r--r--plugins/sample/Makefile.am10
-rw-r--r--plugins/sample/sample.c82
3 files changed, 86 insertions, 12 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 456e189f4..8496a69ed 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1 +1,5 @@
-SUBDIRS = sample
+SUBDIRS =
+
+if ENABLE_SAMPLE_PLUGIN
+SUBDIRS += sample
+endif
diff --git a/plugins/sample/Makefile.am b/plugins/sample/Makefile.am
index 61f621445..45b79e024 100644
--- a/plugins/sample/Makefile.am
+++ b/plugins/sample/Makefile.am
@@ -1,11 +1,7 @@
plugindir = $(libdir)/epiphany/plugins
INCLUDES = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/bookmarks \
- -I$(top_srcdir)/lib \
- -I$(top_srcdir)/lib/egg \
- -I$(top_srcdir)/embed \
+ -I/opt/gnome/include/epiphany-1.0 \
$(EPIPHANY_DEPENDENCY_CFLAGS) \
-DSHARE_DIR=\"$(pkgdatadir)\" \
-DG_DISABLE_DEPRECATED \
@@ -14,7 +10,7 @@ INCLUDES = \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGNOME_DISABLE_DEPRECATED
-plugin_LTLIBRARIES = libephy.la
+plugin_LTLIBRARIES = libsample.la
-libephy_la_SOURCES = \
+libsample_la_SOURCES = \
sample.c
diff --git a/plugins/sample/sample.c b/plugins/sample/sample.c
index e19450401..c36352e6f 100644
--- a/plugins/sample/sample.c
+++ b/plugins/sample/sample.c
@@ -20,23 +20,97 @@
#include <gmodule.h>
#include <glib-object.h>
-#include "ephy-shell.h"
+#include "epiphany/ephy-shell.h"
+#include "epiphany/session.h"
static void
-bmks_changed (EphyBookmarks *bookmarks)
+bmk_added (EphyNode *node, EphyNode *child)
{
- g_print ("Bookmarks changed !\n");
+ g_print ("Bookmark added\n");
+}
+
+static void
+bmk_removed (EphyNode *node, EphyNode *child)
+{
+ g_print ("Bookmark removed\n");
+}
+
+static void
+bmk_changed (EphyNode *node, EphyNode *child)
+{
+ g_print ("Bookmark changed\n");
+}
+
+static void
+switch_page_cb (GtkWidget *widget)
+{
+ GtkWidget *toplevel;
+ EphyTab *tab;
+
+ toplevel = gtk_widget_get_toplevel (widget);
+
+ tab = ephy_window_get_active_tab (EPHY_WINDOW (toplevel));
+ g_print ("New active tab is %p\n", tab);
+}
+
+static void
+window_focus_in_cb (GtkWidget *widget, GdkEventFocus *event)
+{
+ EphyTab *tab;
+
+ tab = ephy_window_get_active_tab (EPHY_WINDOW (widget));
+ g_print ("New active tab is %p\n", tab);
+}
+
+static void
+location_changed_cb (EphyEmbed *embed, char *location)
+{
+ g_print ("New location %s\n", location);
+}
+
+static void
+tab_added_cb (GtkWidget *nb, GtkWidget *child)
+{
+ g_signal_connect (child, "ge_location",
+ G_CALLBACK (location_changed_cb), NULL);
+}
+
+static void
+new_window_cb (Session *session, EphyWindow *window)
+{
+ GtkWidget *nb;
+
+ nb = ephy_window_get_notebook (window);
+
+ g_signal_connect (window, "focus_in_event",
+ G_CALLBACK (window_focus_in_cb), NULL);
+ g_signal_connect (nb, "switch_page",
+ G_CALLBACK (switch_page_cb), NULL);
+ g_signal_connect (nb, "tab_added",
+ G_CALLBACK (tab_added_cb), NULL);
}
G_MODULE_EXPORT void
plugin_init (GTypeModule *module)
{
EphyBookmarks *bookmarks;
+ Session *session;
+ EphyNode *bmks;
g_print ("plugin init\n");
bookmarks = ephy_shell_get_bookmarks (ephy_shell);
- g_signal_connect (bookmarks, "tree_changed", G_CALLBACK (bmks_changed), NULL);
+ bmks = ephy_bookmarks_get_bookmarks (bookmarks);
+ ephy_node_signal_connect_object (bmks, EPHY_NODE_CHILD_ADDED,
+ (EphyNodeCallback) bmk_added, NULL);
+ ephy_node_signal_connect_object (bmks, EPHY_NODE_CHILD_CHANGED,
+ (EphyNodeCallback) bmk_changed, NULL);
+ ephy_node_signal_connect_object (bmks, EPHY_NODE_CHILD_REMOVED,
+ (EphyNodeCallback) bmk_removed, NULL);
+
+ session = SESSION (ephy_shell_get_session (ephy_shell));
+ g_signal_connect (session, "new_window",
+ G_CALLBACK (new_window_cb), NULL);
}
G_MODULE_EXPORT void