aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-08-30 20:34:34 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-08-30 20:34:34 +0800
commit676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0 (patch)
tree5912819b0ffde208dca101c2237342226e7a203c
parenta03cfa7451bad9af112897db73bd7eecc43e2f2c (diff)
downloadgsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.gz
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.bz2
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.lz
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.xz
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.tar.zst
gsoc2013-epiphany-676d6d40cf906f7fd2c626ec21ef66e28c5aa3f0.zip
Complete gtk 2.3 port. It doesnt run here but it could be my env.
2003-08-30 Marco Pesenti Gritti <marco@gnome.org> * src/ephy-encoding-menu.c: (ephy_encoding_menu_verb_cb): * src/ephy-favicon-action.c: (create_tool_item): * src/ephy-favicon-action.h: * src/ephy-favorites-menu.c: (ephy_favorites_menu_clean): * src/ephy-go-action.c: (create_tool_item), (create_menu_proxy_cb): * src/ephy-go-action.h: * src/ephy-history-window.c: (ephy_history_window_construct): * src/ephy-location-action.c: (ephy_location_action_get_widget): * src/ephy-location-action.h: * src/ephy-navigation-action.c: * src/ephy-navigation-action.h: * src/ephy-spinner-action.c: (create_tool_item), (item_parent_set_cb): * src/ephy-spinner-action.h: * src/ephy-tab.c: (ephy_tab_init): * src/ephy-tabs-menu.c: (ephy_tabs_menu_clean), (tab_set_action_accelerator), (ephy_tabs_menu_update): * src/ephy-window.c: (ephy_window_state_event_cb), (setup_window), (update_layout_toggles): * src/popup-commands.c: * src/ppview-toolbar.c: (ppview_toolbar_set_window), (ppview_toolbar_init): * src/toolbar.c: (toolbar_activate_location): * src/window-commands.c: (window_cmd_view_bookmarks_bar), (window_cmd_view_toolbar), (window_cmd_view_statusbar), (window_cmd_view_fullscreen): Complete gtk 2.3 port. It doesnt run here but it could be my env.
-rw-r--r--ChangeLog32
-rw-r--r--src/ephy-encoding-menu.c12
-rw-r--r--src/ephy-favicon-action.c7
-rw-r--r--src/ephy-favicon-action.h3
-rw-r--r--src/ephy-favorites-menu.c5
-rw-r--r--src/ephy-go-action.c10
-rw-r--r--src/ephy-go-action.h2
-rw-r--r--src/ephy-history-window.c38
-rw-r--r--src/ephy-location-action.c2
-rw-r--r--src/ephy-location-action.h3
-rw-r--r--src/ephy-navigation-action.c3
-rw-r--r--src/ephy-navigation-action.h3
-rw-r--r--src/ephy-spinner-action.c13
-rw-r--r--src/ephy-spinner-action.h3
-rw-r--r--src/ephy-tab.c3
-rw-r--r--src/ephy-tabs-menu.c35
-rw-r--r--src/ephy-window.c64
-rw-r--r--src/popup-commands.c1
-rwxr-xr-xsrc/ppview-toolbar.c44
-rwxr-xr-xsrc/toolbar.c6
-rw-r--r--src/window-commands.c14
21 files changed, 161 insertions, 142 deletions
diff --git a/ChangeLog b/ChangeLog
index 55749d02a..8135de70d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2003-08-30 Marco Pesenti Gritti <marco@gnome.org>
+
+ * src/ephy-encoding-menu.c: (ephy_encoding_menu_verb_cb):
+ * src/ephy-favicon-action.c: (create_tool_item):
+ * src/ephy-favicon-action.h:
+ * src/ephy-favorites-menu.c: (ephy_favorites_menu_clean):
+ * src/ephy-go-action.c: (create_tool_item), (create_menu_proxy_cb):
+ * src/ephy-go-action.h:
+ * src/ephy-history-window.c: (ephy_history_window_construct):
+ * src/ephy-location-action.c: (ephy_location_action_get_widget):
+ * src/ephy-location-action.h:
+ * src/ephy-navigation-action.c:
+ * src/ephy-navigation-action.h:
+ * src/ephy-spinner-action.c: (create_tool_item),
+ (item_parent_set_cb):
+ * src/ephy-spinner-action.h:
+ * src/ephy-tab.c: (ephy_tab_init):
+ * src/ephy-tabs-menu.c: (ephy_tabs_menu_clean),
+ (tab_set_action_accelerator), (ephy_tabs_menu_update):
+ * src/ephy-window.c: (ephy_window_state_event_cb), (setup_window),
+ (update_layout_toggles):
+ * src/popup-commands.c:
+ * src/ppview-toolbar.c: (ppview_toolbar_set_window),
+ (ppview_toolbar_init):
+ * src/toolbar.c: (toolbar_activate_location):
+ * src/window-commands.c: (window_cmd_view_bookmarks_bar),
+ (window_cmd_view_toolbar), (window_cmd_view_statusbar),
+ (window_cmd_view_fullscreen):
+
+ Complete gtk 2.3 port. It doesnt run here but it could be
+ my env.
+
2003-08-29 Marco Pesenti Gritti <marco@gnome.org>
* configure.in:
diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c
index 8a45be281..6e44952d6 100644
--- a/src/ephy-encoding-menu.c
+++ b/src/ephy-encoding-menu.c
@@ -22,12 +22,11 @@
#include "ephy-encoding-menu.h"
#include "ephy-string.h"
-#include "egg-menu-merge.h"
#include "ephy-shell.h"
#include "ephy-debug.h"
#include <bonobo/bonobo-i18n.h>
-
+#include <gtk/gtkuimanager.h>
#include <string.h>
/**
@@ -186,16 +185,19 @@ ephy_encoding_menu_verb_cb (GtkAction *action,
{
EphyWindow *window;
EphyEmbed *embed;
- gchar *encoding;
+ const char *encoding;
+ const char *action_name;
window = menu->priv->window;
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- if (strncmp (action->name, "Encoding", 8) == 0)
+ action_name = gtk_action_get_name (action);
+
+ if (strncmp (action_name, "Encoding", 8) == 0)
{
- encoding = action->name + 8;
+ encoding = action_name + 8;
LOG ("Switching to encoding %s", encoding)
diff --git a/src/ephy-favicon-action.c b/src/ephy-favicon-action.c
index bb9707b5d..86b567095 100644
--- a/src/ephy-favicon-action.c
+++ b/src/ephy-favicon-action.c
@@ -17,7 +17,6 @@
*/
#include "ephy-favicon-action.h"
-#include "eggtoolitem.h"
#include "ephy-window.h"
#include "ephy-tab.h"
#include "ephy-dnd.h"
@@ -26,6 +25,10 @@
#include "ephy-event-box.h"
#include "ephy-debug.h"
+#include <gtk/gtktoolitem.h>
+#include <gtk/gtkimage.h>
+#include <gtk/gtkstock.h>
+
static GtkTargetEntry url_drag_types [] =
{
{ EPHY_DND_URI_LIST_TYPE, 0, 0 },
@@ -127,7 +130,7 @@ create_tool_item (GtkAction *action)
GtkWidget *ebox;
GtkWidget *item;
- item = GTK_WIDGET (egg_tool_item_new ());
+ item = GTK_WIDGET (gtk_tool_item_new ());
ebox = ephy_event_box_new ();
image = gtk_image_new ();
diff --git a/src/ephy-favicon-action.h b/src/ephy-favicon-action.h
index 88a59cd6e..b77a9ca61 100644
--- a/src/ephy-favicon-action.h
+++ b/src/ephy-favicon-action.h
@@ -19,8 +19,7 @@
#ifndef EPHY_FAVICON_ACTION_H
#define EPHY_FAVICON_ACTION_H
-#include <gtk/gtk.h>
-#include <egg-action.h>
+#include <gtk/gtkaction.h>
#define EPHY_TYPE_FAVICON_ACTION (ephy_favicon_action_get_type ())
#define EPHY_FAVICON_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_FAVICON_ACTION, EphyFaviconAction))
diff --git a/src/ephy-favorites-menu.c b/src/ephy-favorites-menu.c
index 4138098f3..91e28e4b9 100644
--- a/src/ephy-favorites-menu.c
+++ b/src/ephy-favorites-menu.c
@@ -21,11 +21,12 @@
#endif
#include "ephy-favorites-menu.h"
-#include "egg-menu-merge.h"
#include "ephy-bookmark-action.h"
#include "ephy-shell.h"
#include "ephy-debug.h"
+#include <gtk/gtkuimanager.h>
+
/**
* Private data
*/
@@ -88,7 +89,7 @@ ephy_favorites_menu_clean (EphyFavoritesMenu *wrhm)
if (p->ui_id > 0)
{
gtk_ui_manager_remove_ui (merge, p->ui_id);
- gtk_ui_manager_ensure_update (merge);
+ /* FIXME gtk_ui_manager_ensure_update (merge); */
p->ui_id = 0;
}
diff --git a/src/ephy-go-action.c b/src/ephy-go-action.c
index 5c2579a98..df68913ca 100644
--- a/src/ephy-go-action.c
+++ b/src/ephy-go-action.c
@@ -22,11 +22,11 @@
#endif
#include "ephy-go-action.h"
+#include "ephy-debug.h"
-#include <gtk/gtk.h>
#include <bonobo/bonobo-i18n.h>
-#include "eggtoolitem.h"
-#include "ephy-debug.h"
+#include <gtk/gtktoolitem.h>
+#include <gtk/gtkbutton.h>
#define MENU_ID "ephy-go-action-menu-id"
@@ -75,7 +75,7 @@ create_tool_item (GtkAction *action)
GtkWidget *button;
GtkWidget *item;
- item = GTK_WIDGET (egg_tool_item_new ());
+ item = GTK_WIDGET (gtk_tool_item_new ());
button = gtk_button_new_with_label (_("Go"));
gtk_button_set_relief(GTK_BUTTON (button), GTK_RELIEF_NONE);
@@ -110,7 +110,7 @@ create_menu_proxy_cb (GtkToolItem *item, GtkAction *action)
GTK_ACTION_GET_CLASS (action)->connect_proxy (action, menu_item);
- egg_tool_item_set_proxy_menu_item (item, MENU_ID, menu_item);
+ gtk_tool_item_set_proxy_menu_item (item, MENU_ID, menu_item);
return TRUE;
}
diff --git a/src/ephy-go-action.h b/src/ephy-go-action.h
index 505280a02..7cb04e79c 100644
--- a/src/ephy-go-action.h
+++ b/src/ephy-go-action.h
@@ -19,7 +19,7 @@
#ifndef EPHY_GO_ACTION_H
#define EPHY_GO_ACTION_H
-#include <egg-action.h>
+#include <gtk/gtkaction.h>
#define EPHY_TYPE_GO_ACTION (ephy_go_action_get_type ())
#define EPHY_GO_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_GO_ACTION, EphyGoAction))
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 495d0e2f1..26a2cdf43 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -27,6 +27,9 @@
#include <gtk/gtkscrolledwindow.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkvbox.h>
+#include <gtk/gtkactiongroup.h>
+#include <gtk/gtktoggleaction.h>
+#include <gtk/gtkuimanager.h>
#include <gdk/gdkkeysyms.h>
#include <bonobo/bonobo-i18n.h>
#include <libgnomeui/gnome-stock-icons.h>
@@ -37,9 +40,6 @@
#include "ephy-history-window.h"
#include "ephy-shell.h"
#include "ephy-dnd.h"
-#include "egg-action-group.h"
-#include "egg-toggle-action.h"
-#include "egg-menu-merge.h"
#include "ephy-state.h"
#include "window-commands.h"
#include "ephy-file-helpers.h"
@@ -119,7 +119,7 @@ enum
static GObjectClass *parent_class = NULL;
-static GtkActionGroupEntry ephy_history_ui_entries [] = {
+static GtkActionEntry ephy_history_ui_entries [] = {
/* Toplevel */
{ "File", NULL, N_("_File") },
{ "Edit", NULL, N_("_Edit") },
@@ -141,24 +141,24 @@ static GtkActionGroupEntry ephy_history_ui_entries [] = {
G_CALLBACK (cmd_bookmark_link) },
{ "Close", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",
N_("Close the history window"),
- G_CALLBACK (cmd_close), NULL },
+ G_CALLBACK (cmd_close) },
/* Edit Menu */
{ "Cut", GTK_STOCK_CUT, N_("Cu_t"), "<control>X",
N_("Cut the selection"),
- G_CALLBACK (cmd_cut), NULL },
+ G_CALLBACK (cmd_cut) },
{ "Copy", GTK_STOCK_COPY, N_("_Copy"), "<control>C",
N_("Copy the selection"),
- G_CALLBACK (cmd_copy), NULL },
+ G_CALLBACK (cmd_copy) },
{ "Paste", GTK_STOCK_PASTE, N_("_Paste"), "<control>V",
N_("Paste the clipboard"),
- G_CALLBACK (cmd_paste), NULL },
+ G_CALLBACK (cmd_paste) },
{ "SelectAll", NULL, N_("Select _All"), "<control>A",
N_("Select all history links or text"),
- G_CALLBACK (cmd_select_all), NULL },
+ G_CALLBACK (cmd_select_all) },
{ "Clear", GTK_STOCK_CLEAR, N_("C_lear History"), NULL,
N_("Clear your browsing history"),
- G_CALLBACK (cmd_clear), NULL },
+ G_CALLBACK (cmd_clear) },
/* View Menu */
/* { "ViewTitle", NULL, N_("_Title"), NULL,
@@ -177,7 +177,7 @@ static GtkActionGroupEntry ephy_history_ui_entries [] = {
G_CALLBACK (cmd_help_contents) },
{ "HelpAbout", GNOME_STOCK_ABOUT, N_("_About"), NULL,
N_("Display credits for the web browser creators"),
- G_CALLBACK (window_cmd_help_about), NULL },
+ G_CALLBACK (window_cmd_help_about) },
};
static guint ephy_history_ui_n_entries = G_N_ELEMENTS (ephy_history_ui_entries);
@@ -945,7 +945,7 @@ ephy_history_window_construct (EphyHistoryWindow *editor)
GtkActionGroup *action_group;
GtkAction *action;
GdkPixbuf *icon;
- int i, col_id;
+ int col_id;
gtk_window_set_title (GTK_WINDOW (editor), _("History"));
@@ -958,11 +958,6 @@ ephy_history_window_construct (EphyHistoryWindow *editor)
g_signal_connect (editor, "delete_event",
G_CALLBACK (delete_event_cb), NULL);
- for (i = 0; i < ephy_history_ui_n_entries; i++)
- {
- ephy_history_ui_entries[i].user_data = editor;
- }
-
editor->priv->menu_dock = gtk_vbox_new (FALSE, 0);
gtk_widget_show (editor->priv->menu_dock);
gtk_container_add (GTK_CONTAINER (editor), editor->priv->menu_dock);
@@ -971,20 +966,21 @@ ephy_history_window_construct (EphyHistoryWindow *editor)
g_signal_connect (ui_merge, "add_widget", G_CALLBACK (add_widget), editor);
action_group = gtk_action_group_new ("PopupActions");
gtk_action_group_add_actions (action_group, ephy_history_ui_entries,
- ephy_history_ui_n_entries);
+ ephy_history_ui_n_entries, editor);
gtk_ui_manager_insert_action_group (ui_merge,
action_group, 0);
gtk_ui_manager_add_ui_from_file (ui_merge,
ephy_file ("epiphany-history-window-ui.xml"),
NULL);
- gtk_window_add_accel_group (GTK_WINDOW (editor), ui_merge->accel_group);
- gtk_ui_manager_ensure_update (ui_merge);
+ gtk_window_add_accel_group (GTK_WINDOW (editor),
+ gtk_ui_manager_get_accel_group (ui_merge));
+ /* FIXME gtk_ui_manager_ensure_update (ui_merge);*/
editor->priv->ui_merge = ui_merge;
editor->priv->action_group = action_group;
/* Fixme: We should implement gconf prefs for monitoring this setting */
action = gtk_action_group_get_action (action_group, "ViewTitle");
- egg_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
hpaned = gtk_hpaned_new ();
gtk_container_set_border_width (GTK_CONTAINER (hpaned), 0);
diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c
index 5706f3eb3..bd28e8e6a 100644
--- a/src/ephy-location-action.c
+++ b/src/ephy-location-action.c
@@ -150,7 +150,7 @@ ephy_location_action_get_widget (EphyLocationAction *action)
{
GSList *slist;
- slist = GTK_ACTION (action)->proxies;
+ slist = gtk_action_get_proxies (GTK_ACTION (action));
if (slist)
{
diff --git a/src/ephy-location-action.h b/src/ephy-location-action.h
index 48e0e0f4f..2c169c462 100644
--- a/src/ephy-location-action.h
+++ b/src/ephy-location-action.h
@@ -19,8 +19,7 @@
#ifndef EPHY_LOCATION_ACTION_H
#define EPHY_LOCATION_ACTION_H
-#include <gtk/gtk.h>
-#include <egg-action.h>
+#include <gtk/gtkaction.h>
#define EPHY_TYPE_LOCATION_ACTION (ephy_location_action_get_type ())
#define EPHY_LOCATION_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_LOCATION_ACTION, EphyLocationAction))
diff --git a/src/ephy-navigation-action.c b/src/ephy-navigation-action.c
index 3ac904aa9..81a14ad67 100644
--- a/src/ephy-navigation-action.c
+++ b/src/ephy-navigation-action.c
@@ -22,6 +22,9 @@
#include "ephy-string.h"
#include "ephy-debug.h"
+#include <gtk/gtkimage.h>
+#include <gtk/gtkimagemenuitem.h>
+
static void ephy_navigation_action_init (EphyNavigationAction *action);
static void ephy_navigation_action_class_init (EphyNavigationActionClass *class);
diff --git a/src/ephy-navigation-action.h b/src/ephy-navigation-action.h
index 4990e030d..0eb169f5b 100644
--- a/src/ephy-navigation-action.h
+++ b/src/ephy-navigation-action.h
@@ -19,8 +19,7 @@
#ifndef EPHY_NAVIGATION_ACTION_H
#define EPHY_NAVIGATION_ACTION_H
-#include <gtk/gtk.h>
-#include <egg-action.h>
+#include <gtk/gtkaction.h>
#define EPHY_TYPE_NAVIGATION_ACTION (ephy_navigation_action_get_type ())
#define EPHY_NAVIGATION_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_NAVIGATION_ACTION, EphyNavigationAction))
diff --git a/src/ephy-spinner-action.c b/src/ephy-spinner-action.c
index df5db6f9a..39140fe61 100644
--- a/src/ephy-spinner-action.c
+++ b/src/ephy-spinner-action.c
@@ -18,8 +18,9 @@
#include "ephy-spinner-action.h"
#include "ephy-spinner.h"
-#include "eggtoolitem.h"
-#include "eggtoolbar.h"
+
+#include <gtk/gtktoolitem.h>
+#include <gtk/gtktoolbar.h>
static void ephy_spinner_action_init (EphySpinnerAction *action);
static void ephy_spinner_action_class_init (EphySpinnerActionClass *class);
@@ -88,13 +89,13 @@ create_tool_item (GtkAction *action)
GtkWidget *item;
GtkWidget *spinner;
- item = GTK_WIDGET (egg_tool_item_new ());
+ item = GTK_WIDGET (gtk_tool_item_new ());
spinner = ephy_spinner_new ();
gtk_widget_show (spinner);
gtk_container_add (GTK_CONTAINER (item), spinner);
- egg_tool_item_set_pack_end (GTK_TOOL_ITEM (item), TRUE);
- egg_tool_item_set_homogeneous (GTK_TOOL_ITEM (item), FALSE);
+ gtk_tool_item_set_pack_end (GTK_TOOL_ITEM (item), TRUE);
+ gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (item), FALSE);
g_object_set_data (G_OBJECT (item), "spinner", spinner);
return item;
@@ -128,7 +129,7 @@ item_parent_set_cb (GtkWidget *item, GtkWidget *previous_parent)
G_CALLBACK (toolbar_style_sync),
item, 0);
- style = egg_toolbar_get_style (toolbar);
+ style = gtk_toolbar_get_style (toolbar);
toolbar_style_sync (toolbar, style, item);
}
diff --git a/src/ephy-spinner-action.h b/src/ephy-spinner-action.h
index d867e8a9d..339596c66 100644
--- a/src/ephy-spinner-action.h
+++ b/src/ephy-spinner-action.h
@@ -19,8 +19,7 @@
#ifndef EPHY_SPINNER_ACTION_H
#define EPHY_SPINNER_ACTION_H
-#include <gtk/gtk.h>
-#include <egg-action.h>
+#include <gtk/gtkaction.h>
#define EPHY_TYPE_SPINNER_ACTION (ephy_spinner_action_get_type ())
#define EPHY_SPINNER_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_SPINNER_ACTION, EphySpinnerAction))
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 27df3274b..4678b565c 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -28,7 +28,6 @@
#include "ephy-prefs.h"
#include "ephy-embed-prefs.h"
#include "ephy-debug.h"
-#include "egg-menu-merge.h"
#include "ephy-string.h"
#include "ephy-notebook.h"
#include "ephy-file-helpers.h"
@@ -49,6 +48,7 @@
#include <gtk/gtkselection.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkmenu.h>
+#include <gtk/gtkuimanager.h>
#include <string.h>
struct EphyTabPrivate
@@ -1001,6 +1001,7 @@ ephy_tab_init (EphyTab *tab)
tab->priv->address_expire = TAB_ADDRESS_EXPIRE_NOW;
tab->priv->embed = ephy_embed_new (G_OBJECT(single));
+ g_assert (tab->priv->embed != NULL);
embed = G_OBJECT (tab->priv->embed);
embed_widget = G_OBJECT (tab->priv->embed);
diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c
index 24bed0848..a7c9a265f 100644
--- a/src/ephy-tabs-menu.c
+++ b/src/ephy-tabs-menu.c
@@ -22,12 +22,13 @@
#include "ephy-tabs-menu.h"
#include "ephy-string.h"
-#include "egg-menu-merge.h"
#include "ephy-marshal.h"
#include "ephy-shell.h"
#include "ephy-debug.h"
-#include "egg-action.h"
+#include <gtk/gtkaccelmap.h>
+#include <gtk/gtkaction.h>
+#include <gtk/gtkuimanager.h>
#include <string.h>
#include <stdlib.h>
#include <libxml/entities.h>
@@ -166,7 +167,7 @@ ephy_tabs_menu_clean (EphyTabsMenu *menu)
if (p->ui_id > 0)
{
gtk_ui_manager_remove_ui (merge, p->ui_id);
- gtk_ui_manager_ensure_update (merge);
+/* FIXME gtk_ui_manager_ensure_update (merge); */
p->ui_id = 0;
}
@@ -205,25 +206,24 @@ ephy_tabs_menu_new (EphyWindow *window)
NULL));
}
-/* This code is from GtkActionGroup:
- * Ideally either GtkAction should support setting an accelerator from
- * a string or GtkActionGroup would support adding single EggActionEntry's
- * to an action group.
- */
static void
tab_set_action_accelerator (GtkActionGroup *action_group,
GtkAction *action,
guint tab_number)
{
+ const char *action_name, *action_group_name;
char *accel_path = NULL;
char accel[7];
gint accel_number;
guint accel_key;
GdkModifierType accel_mods;
+ action_name = gtk_action_get_name (action);
+ action_group_name = gtk_action_group_get_name (action_group);
+
/* set the accel path for the menu item */
- accel_path = g_strconcat ("<Actions>/", action_group->name, "/",
- action->name, NULL);
+ accel_path = g_strconcat ("<Actions>/", action_group_name, "/",
+ action_name, NULL);
/* Only the first ten tabs get accelerators starting from 1 through 0 */
if (tab_number < 10)
@@ -237,17 +237,13 @@ tab_set_action_accelerator (GtkActionGroup *action_group,
if (accel_key != 0)
{
- gtk_accel_map_change_entry (accel_path, accel_key,
- accel_mods, TRUE);
+ gtk_action_set_accel_path (action, accel_path);
}
}
else
{
- gtk_accel_map_change_entry (accel_path, 0, 0, TRUE);
+ gtk_action_set_accel_path (action, accel_path);
}
-
- action->accel_quark = g_quark_from_string (accel_path);
- g_free (accel_path);
}
void
@@ -288,17 +284,20 @@ ephy_tabs_menu_update (EphyTabsMenu *menu)
for (l = tabs; l != NULL; l = l->next)
{
+ const char *action_name;
+
tab = (EphyTab *) l->data;
action = GTK_ACTION (ephy_tab_get_action (tab));
+ action_name = gtk_action_get_name (action);
tab_set_action_accelerator (p->action_group, action, i);
gtk_action_group_add_action (p->action_group, action);
g_string_append (xml, "<menuitem name=\"");
- g_string_append (xml, action->name);
+ g_string_append (xml, action_name);
g_string_append (xml, "Menu\" verb=\"");
- g_string_append (xml, action->name);
+ g_string_append (xml, action_name);
g_string_append (xml, "\"/>\n");
++i;
diff --git a/src/ephy-window.c b/src/ephy-window.c
index a91808532..133dac98d 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -55,11 +55,11 @@
#include <X11/Xlib.h>
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
-#include "egg-action-group.h"
-#include "egg-menu-merge.h"
-#include "egg-toggle-action.h"
+#include <gtk/gtkactiongroup.h>
+#include <gtk/gtkuimanager.h>
+#include <gtk/gtktoggleaction.h>
-static GtkActionGroupEntry ephy_menu_entries [] = {
+static GtkActionEntry ephy_menu_entries [] = {
/* Toplevel */
{ "File", NULL, N_("_File") },
@@ -134,16 +134,16 @@ static GtkActionGroupEntry ephy_menu_entries [] = {
G_CALLBACK (window_cmd_view_reload) },
{ "ViewToolbar", NULL, N_("_Toolbar"), "<shift><control>T",
N_("Show or hide toolbar"),
- G_CALLBACK (window_cmd_view_toolbar), TOGGLE_ACTION },
+ G_CALLBACK (window_cmd_view_toolbar), TRUE },
{ "ViewBookmarksBar", NULL, N_("_Bookmarks Bar"), NULL,
N_("Show or hide bookmarks bar"),
- G_CALLBACK (window_cmd_view_bookmarks_bar), NULL, TOGGLE_ACTION },
+ G_CALLBACK (window_cmd_view_bookmarks_bar), TRUE },
{ "ViewStatusbar", NULL, N_("St_atusbar"), NULL,
N_("Show or hide statusbar"),
- G_CALLBACK (window_cmd_view_statusbar), TOGGLE_ACTION },
+ G_CALLBACK (window_cmd_view_statusbar), TRUE },
{ "ViewFullscreen", EPHY_STOCK_FULLSCREEN, N_("_Fullscreen"), "F11",
N_("Browse at full screen"),
- G_CALLBACK (window_cmd_view_fullscreen), TOGGLE_ACTION},
+ G_CALLBACK (window_cmd_view_fullscreen), TRUE},
{ "ViewZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "<control>plus",
N_("Increase the text size"),
G_CALLBACK (window_cmd_view_zoom_in) },
@@ -153,7 +153,7 @@ static GtkActionGroupEntry ephy_menu_entries [] = {
{ "ViewZoomNormal", GTK_STOCK_ZOOM_100, N_("_Normal Size"), NULL,
N_("Use the normal text size"),
G_CALLBACK (window_cmd_view_zoom_normal) },
- { "ViewEncoding", N_("_Encoding"), NULL, NULL, NULL, NULL, NULL },
+ { "ViewEncoding", N_("_Encoding"), NULL, NULL, NULL, NULL },
{ "ViewPageSource", EPHY_STOCK_VIEWSOURCE, N_("_Page Source"), "<control>U",
N_("View the source code of the page"),
G_CALLBACK (window_cmd_view_page_source) },
@@ -213,7 +213,7 @@ static GtkActionGroupEntry ephy_menu_entries [] = {
};
static guint ephy_menu_n_entries = G_N_ELEMENTS (ephy_menu_entries);
-static GtkActionGroupEntry ephy_popups_entries [] = {
+static GtkActionEntry ephy_popups_entries [] = {
/* Document */
{ "SaveBackgroundAs", NULL, N_("_Save Background As..."), NULL,
NULL, G_CALLBACK (popup_cmd_save_background_as) },
@@ -231,30 +231,30 @@ static GtkActionGroupEntry ephy_popups_entries [] = {
/* Links */
{ "OpenLink", GTK_STOCK_OPEN, N_("_Open Link"),
- NULL, G_CALLBACK (popup_cmd_open_link) },
+ NULL, NULL, G_CALLBACK (popup_cmd_open_link) },
{ "OpenLinkInNewWindow", NULL, N_("Open Link in _New Window"), NULL,
NULL, G_CALLBACK (popup_cmd_link_in_new_window) },
{ "OpenLinkInNewTab", NULL, N_("Open Link in New _Tab"),
- NULL, G_CALLBACK (popup_cmd_link_in_new_tab) },
+ NULL, NULL, G_CALLBACK (popup_cmd_link_in_new_tab) },
{ "DownloadLink", GTK_STOCK_SAVE, N_("_Download Link..."), NULL,
NULL, G_CALLBACK (popup_cmd_download_link) },
- { "BookmarkLink", EPHY_STOCK_BOOKMARK_PAGE, N_("_Bookmark Link..."), NULL,
- NULL, G_CALLBACK (popup_cmd_bookmark_link), NULL },
+ { "BookmarkLink", EPHY_STOCK_BOOKMARK_PAGE, N_("_Bookmark Link..."),
+ NULL, NULL, G_CALLBACK (popup_cmd_bookmark_link) },
{ "CopyLinkAddress", NULL, N_("_Copy Link Address"), NULL,
- NULL, G_CALLBACK (popup_cmd_copy_link_address), NULL },
+ NULL, G_CALLBACK (popup_cmd_copy_link_address) },
/* Images */
{ "OpenImage", GTK_STOCK_OPEN, N_("Open _Image"), GTK_STOCK_OPEN,
- NULL, G_CALLBACK (popup_cmd_open_image), NULL },
+ NULL, G_CALLBACK (popup_cmd_open_image) },
{ "OpenImageInNewWindow", NULL, N_("Open Image in New _Window"), NULL,
NULL, G_CALLBACK (popup_cmd_image_in_new_window) },
{ "OpenImageInNewTab", NULL, N_("Open Image in New T_ab"), NULL,
NULL, G_CALLBACK (popup_cmd_image_in_new_tab) },
{ "SaveImageAs", GTK_STOCK_SAVE_AS, N_("_Save Image As..."), NULL,
NULL, G_CALLBACK (popup_cmd_save_image_as) },
- { "SetImageAsBackground", N_("_Use Image As Background"), NULL,
+ { "SetImageAsBackground", NULL, N_("_Use Image As Background"), NULL,
NULL, G_CALLBACK (popup_cmd_set_image_as_background) },
- { "CopyImageLocation", N_("Copy I_mage Address"), NULL,
+ { "CopyImageLocation", NULL, N_("Copy I_mage Address"), NULL,
NULL, G_CALLBACK (popup_cmd_copy_image_location) },
};
static guint ephy_popups_n_entries = G_N_ELEMENTS (ephy_popups_entries);
@@ -628,7 +628,7 @@ ephy_window_state_event_cb (GtkWidget *widget, GdkEventWindowState *event, EphyW
action = gtk_action_group_get_action (window->priv->action_group,
"ViewFullscreen");
- egg_toggle_action_set_active (GTK_TOGGLE_ACTION (action), fullscreen);
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), fullscreen);
}
return FALSE;
@@ -641,7 +641,6 @@ setup_window (EphyWindow *window)
GtkAction *action;
GtkUIManager *merge;
GtkWidget *menu;
- int i;
window->priv->main_vbox = gtk_vbox_new (FALSE, 0);
gtk_widget_show (window->priv->main_vbox);
@@ -654,21 +653,11 @@ setup_window (EphyWindow *window)
GTK_WIDGET (window->priv->menu_dock),
FALSE, TRUE, 0);
- for (i = 0; i < ephy_menu_n_entries; i++)
- {
- ephy_menu_entries[i].user_data = window;
- }
-
- for (i = 0; i < ephy_popups_n_entries; i++)
- {
- ephy_popups_entries[i].user_data = window;
- }
-
merge = gtk_ui_manager_new ();
action_group = gtk_action_group_new ("WindowActions");
gtk_action_group_add_actions (action_group, ephy_menu_entries,
- ephy_menu_n_entries);
+ ephy_menu_n_entries, window);
gtk_ui_manager_insert_action_group (merge, action_group, 0);
window->priv->action_group = action_group;
action = gtk_action_group_get_action (action_group, "FileOpen");
@@ -693,7 +682,7 @@ setup_window (EphyWindow *window)
action_group = gtk_action_group_new ("PopupsActions");
gtk_action_group_add_actions (action_group, ephy_popups_entries,
- ephy_popups_n_entries);
+ ephy_popups_n_entries, window);
gtk_ui_manager_insert_action_group (merge, action_group, 0);
window->priv->popups_action_group = action_group;
@@ -701,8 +690,9 @@ setup_window (EphyWindow *window)
g_signal_connect (merge, "add_widget", G_CALLBACK (add_widget), window);
gtk_ui_manager_add_ui_from_file
(merge, ephy_file ("epiphany-ui.xml"), NULL);
- gtk_window_add_accel_group (GTK_WINDOW (window), merge->accel_group);
- gtk_ui_manager_ensure_update (merge);
+ gtk_window_add_accel_group (GTK_WINDOW (window),
+ gtk_ui_manager_get_accel_group (merge));
+/*FIXME gtk_ui_manager_ensure_update (merge);*/
menu = gtk_ui_manager_get_widget (merge, "/menu/EditMenu");
g_signal_connect (menu, "activate", G_CALLBACK (menu_activate_cb), window);
@@ -1558,15 +1548,15 @@ update_layout_toggles (EphyWindow *window)
GtkAction *action;
action = gtk_action_group_get_action (action_group, "ViewToolbar");
- egg_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
mask & EMBED_CHROME_TOOLBARON);
action = gtk_action_group_get_action (action_group, "ViewBookmarksBar");
- egg_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
mask & EMBED_CHROME_BOOKMARKSBARON);
action = gtk_action_group_get_action (action_group, "ViewStatusbar");
- egg_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
mask & EMBED_CHROME_STATUSBARON);
}
diff --git a/src/popup-commands.c b/src/popup-commands.c
index 54b512722..8a9548510 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <bonobo/bonobo-i18n.h>
+#include <gtk/gtkclipboard.h>
static EphyEmbedEvent *
get_event_info (EphyWindow *window)
diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c
index 76978414b..ec4e72d6d 100755
--- a/src/ppview-toolbar.c
+++ b/src/ppview-toolbar.c
@@ -25,12 +25,12 @@
#include "ephy-bonobo-extensions.h"
#include "ephy-string.h"
#include "ephy-gui.h"
-#include "egg-menu-merge.h"
#include <string.h>
#include <bonobo/bonobo-i18n.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkmenu.h>
+#include <gtk/gtkuimanager.h>
static void ppview_toolbar_class_init (PPViewToolbarClass *klass);
static void ppview_toolbar_init (PPViewToolbar *t);
@@ -85,27 +85,27 @@ static void
toolbar_cmd_ppv_close (GtkUIManager *merge,
PPViewToolbar *t);
-static GtkActionGroupEntry entries [] = {
- { "PPVGotoFirst", N_("First"),
- GTK_STOCK_GOTO_FIRST, NULL,
+static GtkActionEntry entries [] = {
+ { "PPVGotoFirst", GTK_STOCK_GOTO_FIRST,
+ N_("First"), NULL,
N_("Go to the first page"),
- (GCallback)toolbar_cmd_ppv_goto_first, NULL },
- { "PPVGotoLast", N_("Last"),
- GTK_STOCK_GOTO_LAST, NULL,
+ (GCallback)toolbar_cmd_ppv_goto_first },
+ { "PPVGotoLast", GTK_STOCK_GOTO_LAST,
+ N_("Last"), NULL,
N_("Go to the last page"),
- (GCallback)toolbar_cmd_ppv_goto_last, NULL },
- { "PPVGoBack", N_("Previous"),
- GTK_STOCK_GO_BACK, NULL,
+ (GCallback)toolbar_cmd_ppv_goto_last },
+ { "PPVGoBack", GTK_STOCK_GO_BACK,
+ N_("Previous"), NULL,
N_("Go to the previous page"),
- (GCallback)toolbar_cmd_ppv_go_back, NULL },
- { "PPVGoForward", N_("Next"),
- GTK_STOCK_GO_FORWARD, NULL,
+ (GCallback)toolbar_cmd_ppv_go_back },
+ { "PPVGoForward", GTK_STOCK_GO_FORWARD,
+ N_("Next"), NULL,
N_("Go to next page"),
- (GCallback)toolbar_cmd_ppv_go_forward, NULL },
- { "PPVClose", N_("Close"),
- GTK_STOCK_CLOSE, NULL,
+ (GCallback)toolbar_cmd_ppv_go_forward },
+ { "PPVClose", GTK_STOCK_CLOSE,
+ N_("Close"), NULL,
N_("Close print preview"),
- (GCallback)toolbar_cmd_ppv_close, NULL },
+ (GCallback)toolbar_cmd_ppv_close },
};
static guint n_entries = G_N_ELEMENTS (entries);
@@ -238,7 +238,8 @@ ppview_toolbar_set_window (PPViewToolbar *t, EphyWindow *window)
t->priv->original_mask = ephy_window_get_chrome (window);
t->priv->action_group = gtk_action_group_new ("PPViewActions");
- gtk_action_group_add_actions (t->priv->action_group, entries, n_entries);
+ gtk_action_group_add_actions (t->priv->action_group, entries,
+ n_entries, t);
gtk_ui_manager_insert_action_group (t->priv->ui_merge,
t->priv->action_group, 0);
t->priv->ui_id = gtk_ui_manager_add_ui_from_string
@@ -250,18 +251,11 @@ ppview_toolbar_set_window (PPViewToolbar *t, EphyWindow *window)
static void
ppview_toolbar_init (PPViewToolbar *t)
{
- int i;
-
t->priv = g_new0 (PPViewToolbarPrivate, 1);
t->priv->window = NULL;
t->priv->ui_merge = NULL;
t->priv->current_page = 1;
-
- for (i = 0; i < n_entries; i++)
- {
- entries[i].user_data = t;
- }
}
static void
diff --git a/src/toolbar.c b/src/toolbar.c
index dd88179dd..ad74702e9 100755
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -24,7 +24,6 @@
#endif
#include "toolbar.h"
-#include "egg-menu-merge.h"
#include "ephy-file-helpers.h"
#include "ephy-shell.h"
#include "ephy-location-entry.h"
@@ -43,11 +42,12 @@
#include "ephy-debug.h"
#include "ephy-new-bookmark.h"
#include "ephy-stock-icons.h"
-#include "eggtoolbar.h"
#include "ephy-toolbars-model.h"
#include <string.h>
#include <bonobo/bonobo-i18n.h>
+#include <gtk/gtkuimanager.h>
+#include <gtk/gtktoolbar.h>
static void toolbar_class_init (ToolbarClass *klass);
static void toolbar_init (Toolbar *t);
@@ -564,7 +564,7 @@ toolbar_activate_location (Toolbar *t)
location = get_location_entry (t);
g_return_if_fail (location != NULL);
- location_tb = gtk_widget_get_ancestor (location, EGG_TYPE_TOOLBAR);
+ location_tb = gtk_widget_get_ancestor (location, GTK_TYPE_TOOLBAR);
g_return_if_fail (location_tb != NULL);
if (!GTK_WIDGET_VISIBLE (location_tb))
diff --git a/src/window-commands.c b/src/window-commands.c
index a07eb7602..e922c3dbc 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -30,9 +30,6 @@
#include "pdm-dialog.h"
#include "ephy-bookmarks-editor.h"
#include "ephy-new-bookmark.h"
-#include "egg-toggle-action.h"
-#include "egg-editable-toolbar.h"
-#include "egg-toolbar-editor.h"
#include "ephy-file-helpers.h"
#include "toolbar.h"
#include "ephy-state.h"
@@ -40,6 +37,8 @@
#include "ephy-zoom.h"
#include "prefs-dialog.h"
#include "ephy-toolbars-model.h"
+#include "egg-editable-toolbar.h"
+#include "egg-toolbar-editor.h"
#include <string.h>
#include <libgnomevfs/gnome-vfs-uri.h>
@@ -50,6 +49,7 @@
#include <libgnomeui/gnome-icon-theme.h>
#include <libgnome/gnome-program.h>
#include <gtk/gtkeditable.h>
+#include <gtk/gtktoggleaction.h>
enum
{
@@ -516,7 +516,7 @@ window_cmd_view_bookmarks_bar (GtkAction *action,
gboolean current_state;
mask = ephy_window_get_chrome (window);
- active = GTK_TOGGLE_ACTION (action)->active;
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
current_state = (mask & EMBED_CHROME_BOOKMARKSBARON) > 0;
if (active != current_state)
@@ -535,7 +535,7 @@ window_cmd_view_toolbar (GtkAction *action,
gboolean current_state;
mask = ephy_window_get_chrome (window);
- active = GTK_TOGGLE_ACTION (action)->active;
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
current_state = (mask & EMBED_CHROME_TOOLBARON) > 0;
if (active != current_state)
@@ -554,7 +554,7 @@ window_cmd_view_statusbar (GtkAction *action,
gboolean current_state;
mask = ephy_window_get_chrome (window);
- active = GTK_TOGGLE_ACTION (action)->active;
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
current_state = (mask & EMBED_CHROME_STATUSBARON) > 0;
if (active != current_state)
@@ -568,7 +568,7 @@ void
window_cmd_view_fullscreen (GtkAction *action,
EphyWindow *window)
{
- if (GTK_TOGGLE_ACTION (action)->active)
+ if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
{
gtk_window_fullscreen (GTK_WINDOW (window));
}