diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-06-20 06:57:50 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-06-20 06:57:50 +0800 |
commit | 37a1f2f5e2544db814a79631d4f4b958f6dba9a8 (patch) | |
tree | 96337a05b2e5216168203b7d1fb507e696ca4f17 /src/ephy-tab.c | |
parent | b3dec5832fbbefc25e0efac92476a67130620ce5 (diff) | |
download | gsoc2013-epiphany-37a1f2f5e2544db814a79631d4f4b958f6dba9a8.tar gsoc2013-epiphany-37a1f2f5e2544db814a79631d4f4b958f6dba9a8.tar.gz gsoc2013-epiphany-37a1f2f5e2544db814a79631d4f4b958f6dba9a8.tar.bz2 gsoc2013-epiphany-37a1f2f5e2544db814a79631d4f4b958f6dba9a8.tar.lz gsoc2013-epiphany-37a1f2f5e2544db814a79631d4f4b958f6dba9a8.tar.xz gsoc2013-epiphany-37a1f2f5e2544db814a79631d4f4b958f6dba9a8.tar.zst gsoc2013-epiphany-37a1f2f5e2544db814a79631d4f4b958f6dba9a8.zip |
Move the context popup menu to ephy-window.c. If there's no background
2003-06-20 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-tab.h:
* src/ephy-tab.c: (popup_menu_at_coords), (ephy_tab_show_embed_popup),
(ephy_tab_context_menu_cb), (ephy_tab_set_event):
* src/ephy-window.c: (popup_menu_at_coords), (show_embed_popup),
(tab_context_menu_cb), (ephy_window_set_active_tab):
Move the context popup menu to ephy-window.c.
If there's no background image, disable the SaveBackgroundAs
menu entry.
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r-- | src/ephy-tab.c | 100 |
1 files changed, 1 insertions, 99 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c index 35a50e712..5aab758b2 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -876,7 +876,7 @@ ephy_tab_size_to_cb (EphyEmbed *embed, gint width, gint height, g_list_free (tabs); } -static void +void ephy_tab_set_event (EphyTab *tab, EphyEmbedEvent *event) { @@ -885,71 +885,6 @@ ephy_tab_set_event (EphyTab *tab, tab->priv->event = event; } -static void -popup_menu_at_coords (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, - gpointer user_data) -{ - EphyEmbedEvent *event = user_data; - - *x = event->x; - *y = event->y; - *push_in = FALSE; -} - -static void -ephy_tab_show_embed_popup (EphyTab *tab, EphyEmbedEvent *event) -{ - EmbedEventContext context; - const char *popup; - const GValue *value; - gboolean framed; - EphyWindow *window; - char *path; - GtkWidget *widget; - - g_return_if_fail (IS_EPHY_TAB (tab)); - window = tab->priv->window; - - ephy_embed_event_get_property (event, "framed_page", &value); - framed = g_value_get_int (value); - - ephy_embed_event_get_context (event, &context); - - if ((context & EMBED_CONTEXT_LINK) && - (context & EMBED_CONTEXT_IMAGE)) - { - popup = "EphyImageLinkPopup"; - } - else if (context & EMBED_CONTEXT_LINK) - { - popup = "EphyLinkPopup"; - } - else if (context & EMBED_CONTEXT_IMAGE) - { - popup = "EphyImagePopup"; - } - else if (context & EMBED_CONTEXT_INPUT) - { - popup = "EphyInputPopup"; - } - else - { - popup = framed ? "EphyFramedDocumentPopup" : - "EphyDocumentPopup"; - } - - path = g_strconcat ("/popups/", popup, NULL); - widget = egg_menu_merge_get_widget (EGG_MENU_MERGE (window->ui_merge), - path); - g_free (path); - - g_return_if_fail (widget != NULL); - - ephy_tab_set_event (tab, event); - gtk_menu_popup (GTK_MENU (widget), NULL, NULL, popup_menu_at_coords, event, 2, - gtk_get_current_event_time ()); -} - static gint ephy_tab_dom_mouse_click_cb (EphyEmbed *embed, EphyEmbedEvent *event, @@ -993,36 +928,6 @@ ephy_tab_dom_mouse_click_cb (EphyEmbed *embed, return FALSE; } -static gint -ephy_tab_context_menu_cb (EphyEmbed *embed, - EphyEmbedEvent *event, - EphyTab *tab) -{ - EphyWindow *window; - EphyEmbedEventType type; - - g_assert (IS_EPHY_EMBED_EVENT(event)); - - window = ephy_tab_get_window (tab); - g_return_val_if_fail (window != NULL, FALSE); - - ephy_embed_event_get_event_type (event, &type); - - if (type == EPHY_EMBED_EVENT_MOUSE_BUTTON3) - { - ephy_tab_show_embed_popup (tab, event); - } - else - { - int x, y; - - ephy_embed_event_get_coords (event, &x, &y); - ephy_tab_show_embed_popup (tab, event); - } - - return FALSE; -} - static void ephy_tab_security_change_cb (EphyEmbed *embed, EmbedSecurityLevel level, EphyTab *tab) @@ -1119,9 +1024,6 @@ ephy_tab_init (EphyTab *tab) g_signal_connect (embed, "ge_size_to", G_CALLBACK (ephy_tab_size_to_cb), tab); - g_signal_connect (embed, "ge_context_menu", - G_CALLBACK (ephy_tab_context_menu_cb), - tab); g_signal_connect (embed, "ge_dom_mouse_click", G_CALLBACK (ephy_tab_dom_mouse_click_cb), tab); |