Index: src/ephy-window.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-window.c,v
retrieving revision 1.246
diff -p -u -u -p -r1.246 ephy-window.c
--- src/ephy-window.c	3 Jan 2005 19:22:58 -0000	1.246
+++ src/ephy-window.c	4 Jan 2005 10:37:30 -0000
@@ -66,6 +66,10 @@
 #include <gtk/gtkdialog.h>
 #include <gtk/gtkmessagedialog.h>
 
+#ifdef HAVE_X11_XF86KEYSYM_H
+#include <X11/XF86keysym.h>
+#endif
+
 static void ephy_window_class_init		(EphyWindowClass *klass);
 static void ephy_window_init			(EphyWindow *gs);
 static void ephy_window_finalize		(GObject *object);
@@ -341,6 +345,31 @@ static GtkActionEntry ephy_popups_entrie
 };
 static guint ephy_popups_n_entries = G_N_ELEMENTS (ephy_popups_entries);
 
+#ifdef HAVE_X11_XF86KEYSYM_H
+static const struct
+{
+	const char *name;
+	guint keyval;
+	GCallback callback;
+} multimedia_actions [] = {
+	{ "MultimediaHomePage", 	XF86XK_HomePage,	G_CALLBACK (window_cmd_go_home ) },
+	{ "MultimediaBack",		XF86XK_Back,		G_CALLBACK (window_cmd_go_back ) },
+	{ "MultimediaForward",		XF86XK_Forward,		G_CALLBACK (window_cmd_go_forward ) },
+	{ "MultimediaStop", 		XF86XK_Stop,		G_CALLBACK (window_cmd_view_stop ) },
+	{ "MultimediaRefresh", 		XF86XK_Refresh, 	G_CALLBACK (window_cmd_view_reload ) },
+	{ "MultimediaFavorites", 	XF86XK_Favorites,	G_CALLBACK (window_cmd_go_bookmarks ) },
+	{ "MultimediaHistory", 		XF86XK_History, 	G_CALLBACK (window_cmd_go_history ) },
+	{ "MultimediaOpenURL", 		XF86XK_OpenURL, 	G_CALLBACK (window_cmd_go_location ) },
+	{ "MultimediaAddFavorite", 	XF86XK_AddFavorite, 	G_CALLBACK (window_cmd_file_bookmark_page ) },
+	{ "MultimediaGo", 		XF86XK_Go,	 	G_CALLBACK (window_cmd_go_location ) },
+	{ "MultimediaReload", 		XF86XK_Reload,	 	G_CALLBACK (window_cmd_view_reload ) },
+	{ "MultimediaSendTo", 		XF86XK_Send,	 	G_CALLBACK (window_cmd_file_send_to) },
+	{ "MultimediaZoomIn", 		XF86XK_ZoomIn,	 	G_CALLBACK (window_cmd_view_zoom_in ) },
+	{ "MultimediaZoomOut", 		XF86XK_ZoomOut,	 	G_CALLBACK (window_cmd_view_zoom_out) }
+	/* FIXME: what about ScrollUp, ScrollDown, Menu*, Option, LogOff, Save,.. any others? */
+};
+#endif /* HAVE_X11_XF86KEYSYM_H */
+
 #define CONF_LOCKDOWN_HIDE_MENUBAR "/apps/epiphany/lockdown/hide_menubar"
 #define CONF_DESKTOP_BG_PICTURE "/desktop/gnome/background/picture_filename"
 
@@ -766,7 +795,7 @@ ephy_window_key_press_event (GtkWidget *
 	{
 		menubar = gtk_ui_manager_get_widget (window->priv->manager, "/menubar");
 		g_return_val_if_fail (menubar != NULL , FALSE);
-	
+
 		if (!GTK_WIDGET_VISIBLE (menubar))
 		{
 			g_signal_connect (menubar, "deactivate",
@@ -1122,6 +1151,35 @@ update_actions_sensitivity (EphyWindow *
 	update_print_actions (window, TRUE);
 }
 
+#ifdef HAVE_X11_XF86KEYSYM_H
+static void
+setup_multimedia_key_actions (EphyWindow *window)
+{
+	GtkActionGroup *action_group = window->priv->action_group;
+	GtkAction *action;
+	const char *agname, *name;
+	char *accel_path;
+	guint i;
+
+	agname = gtk_action_group_get_name (action_group);
+
+	for (i = 0; i < G_N_ELEMENTS (multimedia_actions); i++)
+	{
+		name = multimedia_actions[i].name;
+
+		action = g_object_new (GTK_TYPE_ACTION, "name", name, NULL);
+		g_signal_connect (action, "activate",
+				  multimedia_actions[i].callback, window);
+
+		accel_path = g_strconcat ("<Actions>/", agname, "/", name, NULL);
+		gtk_action_set_accel_path (action, accel_path);
+		gtk_accel_map_add_entry (accel_path, multimedia_actions[i].keyval, 0);
+		gtk_action_group_add_action (action_group, action);
+		g_free (accel_path);
+	}
+}
+#endif /* HAVE_X11_XF86KEYSYM_H */
+
 static void
 setup_ui_manager (EphyWindow *window)
 {
@@ -1189,6 +1247,10 @@ setup_ui_manager (EphyWindow *window)
 	g_signal_connect (manager, "add_widget", G_CALLBACK (add_widget), window);
 	gtk_window_add_accel_group (GTK_WINDOW (window),
 				    gtk_ui_manager_get_accel_group (manager));
+
+#ifdef HAVE_X11_XF86KEYSYM_H
+	setup_multimedia_key_actions (window);
+#endif				    
 }
 
 static void
Index: src/window-commands.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/window-commands.c,v
retrieving revision 1.149
diff -p -u -u -p -r1.149 window-commands.c
--- src/window-commands.c	31 Dec 2004 21:56:33 -0000	1.149
+++ src/window-commands.c	4 Jan 2005 10:37:30 -0000
@@ -1020,3 +1020,25 @@ window_cmd_browse_with_caret (GtkAction 
 	active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
 	eel_gconf_set_boolean (CONF_BROWSE_WITH_CARET, active);
 }
+
+#ifdef HAVE_X11_XF86KEYSYM_H
+void
+window_cmd_go_home (GtkAction *action,
+		    EphyWindow *window)
+{
+	char *location;
+
+	location = eel_gconf_get_string (CONF_GENERAL_HOMEPAGE);
+
+	if (location == NULL || location[0] == '\0')
+	{
+		g_free (location);
+
+		location = g_strdup ("about:blank");
+	}
+
+	ephy_window_load_url (window, location);
+
+	g_free (location);
+}
+#endif /* HAVE_X11_XF86KEYSYM_H */
Index: src/window-commands.h
===================================================================
RCS file: /cvs/gnome/epiphany/src/window-commands.h,v
retrieving revision 1.19
diff -p -u -u -p -r1.19 window-commands.h
--- src/window-commands.h	24 Dec 2004 00:21:15 -0000	1.19
+++ src/window-commands.h	4 Jan 2005 10:37:30 -0000
@@ -165,3 +165,8 @@ void window_cmd_load_location   (GtkActi
 
 void window_cmd_browse_with_caret (GtkAction *action,
 				   EphyWindow *window);
+
+#ifdef HAVE_X11_XF86KEYSYM_H
+void window_cmd_go_home		(GtkAction *action,
+				 EphyWindow *window);
+#endif
Index: data/ui/epiphany-ui.xml
===================================================================
RCS file: /cvs/gnome/epiphany/data/ui/epiphany-ui.xml,v
retrieving revision 1.21
diff -p -u -u -p -r1.21 epiphany-ui.xml
--- data/ui/epiphany-ui.xml	27 Sep 2004 12:17:32 -0000	1.21
+++ data/ui/epiphany-ui.xml	4 Jan 2005 10:37:30 -0000
@@ -183,5 +183,19 @@
 
 <accelerator name="BrowseWithCaretAccel" action="BrowseWithCaret"/>
 <accelerator name="FileSaveAccel" action="FileSave"/>
+<accelerator name="MultimediaHomePageAccel" action="MultimediaHomePage"/>
+<accelerator name="MultimediaBackAccel" action="MultimediaBack"/>
+<accelerator name="MultimediaForwardAccel" action="MultimediaForward"/>
+<accelerator name="MultimediaStopAccel" action="MultimediaStop"/>
+<accelerator name="MultimediaRefreshAccel" action="MultimediaRefresh"/>
+<accelerator name="MultimediaFavoritesAccel" action="MultimediaFavorites"/>
+<accelerator name="MultimediaHistoryAccel" action="MultimediaHistory"/>
+<accelerator name="MultimediaOpenURLAccel" action="MultimediaOpenURL"/>
+<accelerator name="MultimediaAddFavoriteAccel" action="MultimediaAddFavorite"/>
+<accelerator name="MultimediaGoAccel" action="MultimediaGo"/>
+<accelerator name="MultimediaReloadAccel" action="MultimediaReload"/>
+<accelerator name="MultimediaSendToAccel" action="MultimediaSendTo"/>
+<accelerator name="MultimediaZoomInAccel" action="MultimediaZoomIn"/>
+<accelerator name="MultimediaZoomOutAccel" action="MultimediaZoomOut"/>
 
 </ui>
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/epiphany/configure.ac,v
retrieving revision 1.43
diff -p -u -u -p -r1.43 configure.ac
--- configure.ac	1 Jan 2005 20:54:17 -0000	1.43
+++ configure.ac	4 Jan 2005 10:37:58 -0000
@@ -473,6 +473,12 @@ if test "x$filepicker" = "xyes"; then
 	AC_DEFINE([ENABLE_FILEPICKER],[1],[Define to enable the native filepicker])
 fi
 
+dnl ***************
+dnl Multimedia keys
+dnl ***************
+
+AC_CHECK_HEADERS([X11/XF86keysym.h])
+
 dnl *******************************
 dnl Add warning flags
 dnl *******************************
