diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2004-07-02 17:03:42 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2004-07-02 17:03:42 +0800 |
commit | 6dadef323fb59daefac69200014b1d5f238a911a (patch) | |
tree | f44b28f70a91dee49b95ebbc8d5c7a86a7ea9f3c /src/bookmarks | |
parent | 5788200966658bf840916954af8718426d33c177 (diff) | |
download | gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.gz gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.bz2 gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.lz gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.xz gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.zst gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.zip |
Move in the bookmarks dir.
2004-07-02 Marco Pesenti Gritti <marco@gnome.org>
* src/bookmarks/ephy-favorites-menu.c:
* src/bookmarks/ephy-favorites-menu.h:
Move in the bookmarks dir.
* lib/ephy-gui.c: (ephy_gui_select_row_by_key),
(ephy_gui_is_middle_click):
* lib/ephy-gui.h:
Add a function to check if menus was activated
by a middle or a ctrl+click (which is equivalent in epiphany)
* lib/ephy-marshal.list:
* src/Makefile.am:
* src/bookmarks/Makefile.am:
* src/bookmarks/ephy-bookmark-action.c: (activate_cb),
(ephy_bookmark_action_class_init):
* src/bookmarks/ephy-bookmark-action.h:
* src/bookmarks/ephy-bookmarks-menu.c: (open_bookmark_cb),
(create_menu):
* src/bookmarks/ephy-bookmarksbar.c: (bookmark_open_in_tab_cb),
(bookmark_open_cb), (ephy_bookmarksbar_action_request):
* src/bookmarks/ephy-topic-action.c: (menu_activate_cb),
(ephy_topic_action_class_init):
* src/bookmarks/ephy-topic-action.h:
Add signals to open bookmarks in new window/tab. I'll need
them for context menus.
Use them for middle/ctrl click.
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/Makefile.am | 6 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 32 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.h | 6 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-menu.c | 6 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarksbar.c | 56 | ||||
-rw-r--r-- | src/bookmarks/ephy-favorites-menu.c | 297 | ||||
-rw-r--r-- | src/bookmarks/ephy-favorites-menu.h | 59 | ||||
-rw-r--r-- | src/bookmarks/ephy-topic-action.c | 37 | ||||
-rw-r--r-- | src/bookmarks/ephy-topic-action.h | 9 |
9 files changed, 449 insertions, 59 deletions
diff --git a/src/bookmarks/Makefile.am b/src/bookmarks/Makefile.am index 3b2b130ae..9f26dd2b4 100644 --- a/src/bookmarks/Makefile.am +++ b/src/bookmarks/Makefile.am @@ -30,8 +30,9 @@ NOINST_H_FILES = \ ephy-bookmarks-import.h \ ephy-bookmarks-menu.h \ ephy-bookmarksbar-model.h \ - ephy-bookmarksbar.h \ + ephy-bookmarksbar.h \ ephy-bookmark-properties.h \ + ephy-favorites-menu.h \ ephy-new-bookmark.h \ ephy-topic-action.h \ ephy-topics-selector.h @@ -44,8 +45,9 @@ libephybookmarks_la_SOURCES = \ ephy-bookmarks-import.c \ ephy-bookmarks-menu.c \ ephy-bookmarksbar-model.c \ - ephy-bookmarksbar.c \ + ephy-bookmarksbar.c \ ephy-bookmark-properties.c \ + ephy-favorites-menu.c \ ephy-new-bookmark.c \ ephy-topic-action.c \ ephy-topics-selector.c \ diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 21b094bae..2b44f1a5a 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -27,6 +27,7 @@ #include <gtk/gtktoolitem.h> #include "ephy-bookmark-action.h" +#include "ephy-marshal.h" #include "ephy-dnd.h" #include "ephy-bookmarksbar.h" #include "ephy-bookmarks.h" @@ -34,6 +35,7 @@ #include "ephy-shell.h" #include "ephy-string.h" #include "ephy-debug.h" +#include "ephy-gui.h" #include <string.h> @@ -75,7 +77,8 @@ enum enum { - GO_LOCATION, + OPEN, + OPEN_IN_TAB, LAST_SIGNAL }; @@ -342,7 +345,14 @@ activate_cb (GtkWidget *widget, GtkAction *action) } } - g_signal_emit (action, signals[GO_LOCATION], 0, location); + if (ephy_gui_is_middle_click ()) + { + g_signal_emit (action, signals[OPEN_IN_TAB], 0, location, FALSE); + } + else + { + g_signal_emit (action, signals[OPEN], 0, location); + } g_free (location); g_free (text); @@ -580,17 +590,29 @@ ephy_bookmark_action_class_init (EphyBookmarkActionClass *class) object_class->set_property = ephy_bookmark_action_set_property; object_class->get_property = ephy_bookmark_action_get_property; - signals[GO_LOCATION] = - g_signal_new ("go_location", + signals[OPEN] = + g_signal_new ("open", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EphyBookmarkActionClass, go_location), + G_STRUCT_OFFSET (EphyBookmarkActionClass, open), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); + signals[OPEN_IN_TAB] = + g_signal_new ("open_in_tab", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EphyBookmarkActionClass, open_in_tab), + NULL, NULL, + ephy_marshal_VOID__STRING_BOOLEAN, + G_TYPE_NONE, + 2, + G_TYPE_STRING, + G_TYPE_BOOLEAN); + g_object_class_install_property (object_class, PROP_BOOKMARK_ID, g_param_spec_int ("bookmark_id", diff --git a/src/bookmarks/ephy-bookmark-action.h b/src/bookmarks/ephy-bookmark-action.h index 1762ed315..8a4cd9e61 100644 --- a/src/bookmarks/ephy-bookmark-action.h +++ b/src/bookmarks/ephy-bookmark-action.h @@ -47,7 +47,11 @@ struct _EphyBookmarkActionClass { GtkActionClass parent_class; - void (*go_location) (EphyBookmarkAction *action, char *location); + void (*open) (EphyBookmarkAction *action, + char *address); + void (*open_in_tab) (EphyBookmarkAction *action, + char *address, + gboolean new_window); }; GType ephy_bookmark_action_get_type (void); diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c index 601027aa2..77427c4d2 100644 --- a/src/bookmarks/ephy-bookmarks-menu.c +++ b/src/bookmarks/ephy-bookmarks-menu.c @@ -111,7 +111,7 @@ ephy_bookmarks_menu_clean (EphyBookmarksMenu *menu) } static void -go_location_cb (GtkAction *action, char *location, EphyWindow *window) +open_bookmark_cb (GtkAction *action, char *location, EphyWindow *window) { ephy_window_load_url (window, location); } @@ -219,8 +219,8 @@ create_menu (EphyBookmarksMenu *menu, EphyNode *node, const char *path) gtk_action_set_accel_path (action, accel_path); gtk_action_group_add_action (p->action_group, action); g_object_unref (action); - g_signal_connect (action, "go_location", - G_CALLBACK (go_location_cb), p->window); + g_signal_connect (action, "open", + G_CALLBACK (open_bookmark_cb), p->window); gtk_ui_manager_add_ui (p->merge, p->ui_id, path, name, verb, diff --git a/src/bookmarks/ephy-bookmarksbar.c b/src/bookmarks/ephy-bookmarksbar.c index 3945ff1dd..3d3bfd72e 100644 --- a/src/bookmarks/ephy-bookmarksbar.c +++ b/src/bookmarks/ephy-bookmarksbar.c @@ -123,48 +123,24 @@ open_in_tabs_cb (GtkAction *action, GList *uri_list, EphyBookmarksBar *toolbar) } static void -go_location_cb (GtkAction *action, char *location, EphyBookmarksBar *toolbar) +bookmark_open_in_tab_cb (GtkAction *action, char *location, + gboolean new_window, EphyBookmarksBar *toolbar) { - EphyWindow *window = toolbar->priv->window; - GdkEvent *event; - gboolean new_tab = FALSE; + EphyNewTabFlags flags = EPHY_NEW_TAB_OPEN_PAGE; - g_return_if_fail (window != NULL); - - event = gtk_get_current_event (); - if (event != NULL) + if (!new_window) { - if (event->type == GDK_BUTTON_RELEASE) - { - guint modifiers, button, state; - - modifiers = gtk_accelerator_get_default_mod_mask (); - button = event->button.button; - state = event->button.state; - - /* middle-click or control-click */ - if ((button == 1 && ((state & modifiers) == GDK_CONTROL_MASK)) || - (button == 2)) - { - new_tab = TRUE; - } - } - - gdk_event_free (event); + flags |= EPHY_NEW_TAB_IN_EXISTING_WINDOW; } - if (new_tab) - { - ephy_shell_new_tab (ephy_shell, window, - ephy_window_get_active_tab (window), - location, - EPHY_NEW_TAB_OPEN_PAGE | - EPHY_NEW_TAB_IN_EXISTING_WINDOW); - } - else - { - ephy_window_load_url (window, location); - } + ephy_shell_new_tab (ephy_shell, toolbar->priv->window, NULL, + location, flags); +} + +static void +bookmark_open_cb (GtkAction *action, char *location, EphyBookmarksBar *toolbar) +{ + ephy_window_load_url (toolbar->priv->window, location); } static gboolean @@ -267,8 +243,10 @@ ephy_bookmarksbar_action_request (EggEditableToolbar *eggtoolbar, g_return_if_fail (action != NULL); - g_signal_connect (action, "go_location", - G_CALLBACK (go_location_cb), toolbar); + g_signal_connect (action, "open", + G_CALLBACK (bookmark_open_cb), toolbar); + g_signal_connect (action, "open_in_tab", + G_CALLBACK (bookmark_open_in_tab_cb), toolbar); gtk_action_group_add_action (toolbar->priv->action_group, action); g_object_unref (action); diff --git a/src/bookmarks/ephy-favorites-menu.c b/src/bookmarks/ephy-favorites-menu.c new file mode 100644 index 000000000..f2ef1e814 --- /dev/null +++ b/src/bookmarks/ephy-favorites-menu.c @@ -0,0 +1,297 @@ +/* + * Copyright (C) 2002 Ricardo Fernández Pascual + * Copyright (C) 2003 Marco Pesenti Gritti + * + * 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. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ephy-favorites-menu.h" +#include "ephy-bookmark-action.h" +#include "ephy-shell.h" +#include "ephy-debug.h" + +#include <gtk/gtkuimanager.h> +#include <glib/gprintf.h> + +#define EPHY_FAVORITES_MENU_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_FAVORITES_MENU, EphyFavoritesMenuPrivate)) + +struct _EphyFavoritesMenuPrivate +{ + EphyWindow *window; + EphyBookmarks *bookmarks; + GtkActionGroup *action_group; + guint ui_id; + guint update_tag; +}; + +static void ephy_favorites_menu_class_init (EphyFavoritesMenuClass *klass); +static void ephy_favorites_menu_init (EphyFavoritesMenu *menu); +static void ephy_favorites_menu_finalize (GObject *o); + +enum +{ + PROP_0, + PROP_WINDOW +}; + +static gpointer parent_class; + +GType +ephy_favorites_menu_get_type (void) +{ + static GType ephy_favorites_menu_type = 0; + + if (ephy_favorites_menu_type == 0) + { + static const GTypeInfo our_info = + { + sizeof (EphyFavoritesMenuClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) ephy_favorites_menu_class_init, + NULL, + NULL, /* class_data */ + sizeof (EphyFavoritesMenu), + 0, /* n_preallocs */ + (GInstanceInitFunc) ephy_favorites_menu_init + }; + + ephy_favorites_menu_type = g_type_register_static (G_TYPE_OBJECT, + "EphyFavoritesMenu", + &our_info, 0); + } + return ephy_favorites_menu_type; +} + +static void +ephy_favorites_menu_clean (EphyFavoritesMenu *menu) +{ + EphyFavoritesMenuPrivate *p = menu->priv; + GtkUIManager *merge = GTK_UI_MANAGER (p->window->ui_merge); + + if (p->ui_id > 0) + { + gtk_ui_manager_remove_ui (merge, p->ui_id); + gtk_ui_manager_ensure_update (merge); + p->ui_id = 0; + } + + if (p->action_group != NULL) + { + gtk_ui_manager_remove_action_group (merge, p->action_group); + g_object_unref (p->action_group); + } +} + +static void +open_bookmark_cb (GtkAction *action, char *location, EphyWindow *window) +{ + ephy_window_load_url (window, location); +} + +static void +ephy_favorites_menu_rebuild (EphyFavoritesMenu *menu) +{ + EphyFavoritesMenuPrivate *p = menu->priv; + gint i; + EphyNode *fav; + GPtrArray *children; + GtkUIManager *merge = GTK_UI_MANAGER (p->window->ui_merge); + + LOG ("Rebuilding favorites menu") + + START_PROFILER ("Rebuild favorites menu") + + ephy_favorites_menu_clean (menu); + + fav = ephy_bookmarks_get_favorites (p->bookmarks); + children = ephy_node_get_children (fav); + + p->action_group = gtk_action_group_new ("FavoritesActions"); + gtk_ui_manager_insert_action_group (merge, p->action_group, 0); + p->ui_id = gtk_ui_manager_new_merge_id (merge); + + for (i = 0; i < children->len; i++) + { + char verb[20]; + char name[20]; + char accel_path[48]; + EphyNode *node; + GtkAction *action; + + g_snprintf (verb, sizeof (verb),"GoFav%d", i); + g_snprintf (name, sizeof (name), "GoFav%dMenu", i); + g_snprintf (accel_path, sizeof (accel_path), + "<Actions>/FavoritesActions/%s", verb); + + node = g_ptr_array_index (children, i); + + action = ephy_bookmark_action_new (verb, + ephy_node_get_id (node)); + gtk_action_set_accel_path (action, accel_path); + gtk_action_group_add_action (p->action_group, action); + g_object_unref (action); + g_signal_connect (action, "open", + G_CALLBACK (open_bookmark_cb), p->window); + + gtk_ui_manager_add_ui (merge, p->ui_id, + "/menubar/GoMenu", + name, verb, + GTK_UI_MANAGER_MENUITEM, FALSE); + } + + STOP_PROFILER ("Rebuild favorites menu") +} + +static void +ephy_favorites_menu_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + EphyFavoritesMenu *menu = EPHY_FAVORITES_MENU (object); + + switch (prop_id) + { + case PROP_WINDOW: + menu->priv->window = g_value_get_object (value); + ephy_favorites_menu_rebuild (menu); + break; + } +} + +static void +ephy_favorites_menu_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + EphyFavoritesMenu *menu = EPHY_FAVORITES_MENU (object); + + switch (prop_id) + { + case PROP_WINDOW: + g_value_set_object (value, menu->priv->window); + break; + } +} + + +static void +ephy_favorites_menu_class_init (EphyFavoritesMenuClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + object_class->finalize = ephy_favorites_menu_finalize; + object_class->set_property = ephy_favorites_menu_set_property; + object_class->get_property = ephy_favorites_menu_get_property; + + g_object_class_install_property (object_class, + PROP_WINDOW, + g_param_spec_object ("window", + "Window", + "Parent window", + EPHY_TYPE_WINDOW, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + g_type_class_add_private (object_class, sizeof(EphyFavoritesMenuPrivate)); +} + +static gboolean +do_updates (EphyFavoritesMenu *menu) +{ + ephy_favorites_menu_rebuild (menu); + + menu->priv->update_tag = 0; + + /* don't run again */ + return FALSE; +} + +static void +fav_removed_cb (EphyNode *node, + EphyNode *child, + guint old_index, + EphyFavoritesMenu *menu) +{ + if (menu->priv->update_tag == 0) + { + menu->priv->update_tag = g_idle_add((GSourceFunc)do_updates, menu); + } +} + +static void +fav_added_cb (EphyNode *node, + EphyNode *child, + EphyFavoritesMenu *menu) +{ + if (menu->priv->update_tag == 0) + { + menu->priv->update_tag = g_idle_add((GSourceFunc)do_updates, menu); + } +} + +static void +ephy_favorites_menu_init (EphyFavoritesMenu *menu) +{ + EphyFavoritesMenuPrivate *p = EPHY_FAVORITES_MENU_GET_PRIVATE (menu); + EphyNode *fav; + menu->priv = p; + + menu->priv->bookmarks = ephy_shell_get_bookmarks (ephy_shell); + menu->priv->ui_id = 0; + menu->priv->update_tag = 0; + menu->priv->action_group = NULL; + + fav = ephy_bookmarks_get_favorites (menu->priv->bookmarks); + ephy_node_signal_connect_object (fav, + EPHY_NODE_CHILD_REMOVED, + (EphyNodeCallback) fav_removed_cb, + G_OBJECT (menu)); + ephy_node_signal_connect_object (fav, + EPHY_NODE_CHILD_ADDED, + (EphyNodeCallback) fav_added_cb, + G_OBJECT (menu)); +} + +static void +ephy_favorites_menu_finalize (GObject *o) +{ + EphyFavoritesMenu *menu = EPHY_FAVORITES_MENU (o); + + if (menu->priv->action_group != NULL) + { + g_object_unref (menu->priv->action_group); + } + + G_OBJECT_CLASS (parent_class)->finalize (o); +} + +EphyFavoritesMenu * +ephy_favorites_menu_new (EphyWindow *window) +{ + return g_object_new (EPHY_TYPE_FAVORITES_MENU, + "window", window, + NULL); +} diff --git a/src/bookmarks/ephy-favorites-menu.h b/src/bookmarks/ephy-favorites-menu.h new file mode 100644 index 000000000..48c6fbd27 --- /dev/null +++ b/src/bookmarks/ephy-favorites-menu.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2002 Ricardo Fernández Pascual + * Copyright (C) 2003 Marco Pesenti Gritti + * + * 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. + * + * $Id$ + */ + +#ifndef EPHY_FAVORITES_MENU_H +#define EPHY_FAVORITES_MENU_H + +#include "ephy-window.h" + +G_BEGIN_DECLS + +#define EPHY_TYPE_FAVORITES_MENU (ephy_favorites_menu_get_type()) +#define EPHY_FAVORITES_MENU(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EPHY_TYPE_FAVORITES_MENU, EphyFavoritesMenu)) +#define EPHY_FAVORITES_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EPHY_TYPE_FAVORITES_MENU, EphyFavoritesMenuClass)) +#define EPHY_IS_FAVORITES_MENU(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EPHY_TYPE_FAVORITES_MENU)) +#define EPHY_IS_FAVORITES_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EPHY_TYPE_FAVORITES_MENU)) +#define EPHY_FAVORITES_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_FAVORITES_MENU, EphyFavoritesMenuClass)) + +typedef struct _EphyFavoritesMenu EphyFavoritesMenu; +typedef struct _EphyFavoritesMenuClass EphyFavoritesMenuClass; +typedef struct _EphyFavoritesMenuPrivate EphyFavoritesMenuPrivate; + +struct _EphyFavoritesMenuClass +{ + GObjectClass parent_class; +}; + +struct _EphyFavoritesMenu +{ + GObject parent_object; + + /*< private >*/ + EphyFavoritesMenuPrivate *priv; +}; + +GType ephy_favorites_menu_get_type (void); + +EphyFavoritesMenu *ephy_favorites_menu_new (EphyWindow *window); + +G_END_DECLS + +#endif diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index 2f0ac30f9..76503124a 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -34,6 +34,7 @@ #include "ephy-debug.h" #include "ephy-gui.h" #include "ephy-string.h" +#include "ephy-marshal.h" static void ephy_topic_action_init (EphyTopicAction *action); static void ephy_topic_action_class_init (EphyTopicActionClass *class); @@ -54,7 +55,8 @@ enum enum { - GO_LOCATION, + OPEN, + OPEN_IN_TAB, OPEN_IN_TABS, LAST_SIGNAL }; @@ -143,8 +145,17 @@ menu_activate_cb (GtkWidget *item, GtkAction *action) node = g_object_get_data (G_OBJECT (item), "node"); location = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_LOCATION); - g_signal_emit (action, ephy_topic_action_signals[GO_LOCATION], - 0, location); + + if (ephy_gui_is_middle_click ()) + { + g_signal_emit (action, ephy_topic_action_signals[OPEN_IN_TAB], + 0, location, FALSE); + } + else + { + g_signal_emit (action, ephy_topic_action_signals[OPEN], + 0, location); + } } static void @@ -609,22 +620,34 @@ ephy_topic_action_class_init (EphyTopicActionClass *class) object_class->set_property = ephy_topic_action_set_property; object_class->get_property = ephy_topic_action_get_property; - ephy_topic_action_signals[GO_LOCATION] = - g_signal_new ("go_location", + ephy_topic_action_signals[OPEN] = + g_signal_new ("open", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EphyTopicActionClass, go_location), + G_STRUCT_OFFSET (EphyTopicActionClass, open), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); + ephy_topic_action_signals[OPEN_IN_TAB] = + g_signal_new ("open_in_tab", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EphyTopicActionClass, open_in_tab), + NULL, NULL, + ephy_marshal_VOID__STRING_BOOLEAN, + G_TYPE_NONE, + 2, + G_TYPE_STRING, + G_TYPE_BOOLEAN); + ephy_topic_action_signals[OPEN_IN_TABS] = g_signal_new ("open_in_tabs", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EphyTopicActionClass, go_location), + G_STRUCT_OFFSET (EphyTopicActionClass, open_in_tabs), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, diff --git a/src/bookmarks/ephy-topic-action.h b/src/bookmarks/ephy-topic-action.h index 6a74d1238..fa04e2d06 100644 --- a/src/bookmarks/ephy-topic-action.h +++ b/src/bookmarks/ephy-topic-action.h @@ -47,8 +47,13 @@ struct _EphyTopicActionClass { GtkActionClass parent_class; - void (*go_location) (EphyTopicAction *action, char *location); - void (*open_in_tabs) (EphyTopicAction *action, GList *uri_list); + void (*open) (EphyTopicAction *action, + char *address); + void (*open_in_tab) (EphyTopicAction *action, + char *address, + gboolean new_window); + void (*open_in_tabs) (EphyTopicAction *action, + GList *uri_list); }; GType ephy_topic_action_get_type (void); |