? lib/widgets/galago-gtk-entry.c
? lib/widgets/galago-gtk-entry.h
? src/dl.png
? src/ephy-window.c+fix_without_bookmark_urls
? src/ephy.valgrind.txt
? src/epiphany-gdb
? src/epiphany-memprof
? src/epiphany-valgrind
? src/valgrind-run-1
? src/valgrind-run-2
? src/x
Index: lib/widgets/Makefile.am
===================================================================
RCS file: /cvs/gnome/epiphany/lib/widgets/Makefile.am,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile.am
--- lib/widgets/Makefile.am	30 Nov 2003 15:01:47 -0000	1.19
+++ lib/widgets/Makefile.am	26 Jan 2004 21:05:42 -0000
@@ -33,4 +33,6 @@ libephywidgets_la_SOURCES = \
 	ephy-zoom-action.h			\
 	ephy-zoom-action.c			\
 	ephy-zoom-control.c			\
-	ephy-zoom-control.h
+	ephy-zoom-control.h			\
+	galago-gtk-entry.c			\
+	galago-gtk-entry.h
Index: lib/widgets/ephy-location-entry.c
===================================================================
RCS file: /cvs/gnome/epiphany/lib/widgets/ephy-location-entry.c,v
retrieving revision 1.36
diff -u -p -r1.36 ephy-location-entry.c
--- lib/widgets/ephy-location-entry.c	22 Jan 2004 19:23:05 -0000	1.36
+++ lib/widgets/ephy-location-entry.c	26 Jan 2004 21:05:43 -0000
@@ -26,12 +26,16 @@
 #include "ephy-marshal.h"
 #include "ephy-debug.h"
 
+#include "galago-gtk-entry.h"
+
 #include <gtk/gtktoolbar.h>
 #include <gtk/gtkentry.h>
 #include <gtk/gtkwindow.h>
 #include <gtk/gtkcellrenderertext.h>
 #include <gtk/gtkcelllayout.h>
 #include <gtk/gtktreemodelsort.h>
+#include <gtk/gtkeventbox.h>
+#include <gtk/gtkimage.h>
 #include <string.h>
 
 #define EPHY_LOCATION_ENTRY_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_LOCATION_ENTRY, EphyLocationEntryPrivate))
@@ -39,6 +43,7 @@
 struct _EphyLocationEntryPrivate
 {
 	GtkWidget *entry;
+	GtkWidget *icon;
 	char *before_completion;
 	gboolean user_changed;
 	GtkWidget *shown_widget;
@@ -59,8 +64,8 @@ static char *web_prefixes [] =
 };
 static int n_web_prefixes = G_N_ELEMENTS (web_prefixes);
 
-static void ephy_location_entry_class_init (EphyLocationEntryClass *klass);
-static void ephy_location_entry_init (EphyLocationEntry *le);
+static void ephy_location_entry_class_init	(EphyLocationEntryClass *klass);
+static void ephy_location_entry_init		(EphyLocationEntry *le);
 
 static GObjectClass *parent_class = NULL;
 
@@ -284,10 +289,14 @@ ephy_location_entry_construct_contents (
 
 	LOG ("EphyLocationEntry constructing contents %p", le)
 
-	p->entry = gtk_entry_new ();
+	p->entry = galago_gtk_entry_new ();
 	gtk_container_add (GTK_CONTAINER (le), p->entry);
 	gtk_widget_show (p->entry);
 
+	p->icon = gtk_image_new ();
+	gtk_widget_show (p->icon);
+	galago_gtk_entry_set_icon (GALAGO_GTK_ENTRY (p->entry), p->icon);
+
 	g_signal_connect (p->entry, "button_press_event",
 			  G_CALLBACK (entry_button_press_cb), le);
 	g_signal_connect (p->entry, "changed",
@@ -400,6 +409,14 @@ ephy_location_entry_get_location (EphyLo
 	return gtk_entry_get_text (GTK_ENTRY (le->priv->entry));
 }
 
+GtkWidget *
+ephy_location_entry_get_icon (EphyLocationEntry *le)
+{
+	g_return_val_if_fail (EPHY_IS_LOCATION_ENTRY (le), NULL);
+
+	return le->priv->icon;
+}
+
 void
 ephy_location_entry_activate (EphyLocationEntry *le)
 {
Index: lib/widgets/ephy-location-entry.h
===================================================================
RCS file: /cvs/gnome/epiphany/lib/widgets/ephy-location-entry.h,v
retrieving revision 1.12
diff -u -p -r1.12 ephy-location-entry.h
--- lib/widgets/ephy-location-entry.h	19 Nov 2003 19:19:53 -0000	1.12
+++ lib/widgets/ephy-location-entry.h	26 Jan 2004 21:05:43 -0000
@@ -73,6 +73,8 @@ void			ephy_location_entry_set_location	
 
 const char	       *ephy_location_entry_get_location	(EphyLocationEntry *le);
 
+GtkWidget	       *ephy_location_entry_get_icon		(EphyLocationEntry *le);
+
 void			ephy_location_entry_activate		(EphyLocationEntry *le);
 
 #endif
Index: src/ephy-favicon-action.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-favicon-action.c,v
retrieving revision 1.23
diff -u -p -r1.23 ephy-favicon-action.c
--- src/ephy-favicon-action.c	7 Nov 2003 23:00:02 -0000	1.23
+++ src/ephy-favicon-action.c	26 Jan 2004 21:05:43 -0000
@@ -214,7 +214,7 @@ ephy_favicon_action_set_property (GObjec
 			break;
 		case PROP_ICON:
 			g_free (fav->priv->icon);
-			fav->priv->icon = g_strdup (g_value_get_string (value));
+			fav->priv->icon = g_value_dup_string (value);
 			g_object_notify(object, "icon");
 			break;
 	}
@@ -236,7 +236,7 @@ ephy_favicon_action_get_property (GObjec
 			g_value_set_object (value, fav->priv->window);
 			break;
 		case PROP_ICON:
-			g_value_set_object (value, fav->priv->icon);
+			g_value_set_string (value, fav->priv->icon);
 			break;
 	}
 }
Index: src/ephy-location-action.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-location-action.c,v
retrieving revision 1.19
diff -u -p -r1.19 ephy-location-action.c
--- src/ephy-location-action.c	16 Dec 2003 17:29:41 -0000	1.19
+++ src/ephy-location-action.c	26 Jan 2004 21:05:43 -0000
@@ -23,8 +23,14 @@
 #include "ephy-location-entry.h"
 #include "ephy-shell.h"
 #include "ephy-completion-model.h"
+#include "ephy-dnd.h"
+#include "ephy-favicon-cache.h"
+#include "ephy-window.h"
 #include "ephy-debug.h"
 
+#include <gtk/gtktoolitem.h>
+#include <gtk/gtkimage.h>
+#include <gtk/gtkstock.h>
 #include <gtk/gtkentry.h>
 #include <gtk/gtkentrycompletion.h>
 
@@ -34,11 +40,22 @@ struct _EphyLocationActionPrivate
 {
 	GList *actions;
 	char *address;
+	char *icon;
 	gboolean editable;
 	EphyNode *smart_bmks;
 	EphyBookmarks *bookmarks;
+	EphyFaviconCache *cache;
+	EphyWindow *window;
 };
 
+static GtkTargetEntry url_drag_types [] =
+{
+        { EPHY_DND_URI_LIST_TYPE,   0, 0 },
+        { EPHY_DND_TEXT_TYPE,       0, 1 },
+        { EPHY_DND_URL_TYPE,        0, 2 }
+};
+static int n_url_drag_types = G_N_ELEMENTS (url_drag_types);
+
 static void ephy_location_action_init       (EphyLocationAction *action);
 static void ephy_location_action_class_init (EphyLocationActionClass *class);
 static void ephy_location_action_finalize   (GObject *object);
@@ -52,7 +69,9 @@ enum
 {
 	PROP_0,
 	PROP_ADDRESS,
-	PROP_EDITABLE
+	PROP_EDITABLE,
+	PROP_ICON,
+	PROP_WINDOW,
 };
 
 enum
@@ -70,7 +89,7 @@ ephy_location_action_get_type (void)
 {
 	static GType type = 0;
 
-	if (!type)
+	if (type == 0)
 	{
 		static const GTypeInfo type_info =
 		{
@@ -89,10 +108,47 @@ ephy_location_action_get_type (void)
 					       "EphyLocationAction",
 					       &type_info, 0);
 	}
+
 	return type;
 }
 
 static void
+each_url_get_data_binder (EphyDragEachSelectedItemDataGet iteratee,
+			  gpointer iterator_context,
+			  gpointer data)
+{
+	const char *title;
+	char *location;
+	EphyTab *tab;
+	EphyEmbed *embed;
+	EphyWindow *window = EPHY_WINDOW(iterator_context);
+
+	tab = ephy_window_get_active_tab (window);
+	embed = ephy_tab_get_embed (tab);
+	location = ephy_embed_get_location (embed, TRUE);
+	title = ephy_tab_get_title (tab);
+
+	iteratee (location, title, data);
+
+	g_free (location);
+}
+
+static void
+favicon_drag_data_get_cb (GtkWidget *widget,
+                          GdkDragContext *context,
+                          GtkSelectionData *selection_data,
+                          guint info,
+                          guint32 time,
+                          EphyWindow *window)
+{
+        g_assert (widget != NULL);
+        g_return_if_fail (context != NULL);
+
+        ephy_dnd_drag_data_get (widget, context, selection_data,
+                time, window, each_url_get_data_binder);
+}
+
+static void
 action_activated_cb (GtkEntryCompletion *completion,
                      gint index,
 		     EphyLocationAction *action)
@@ -177,6 +233,38 @@ sync_editable (GtkAction *act, GParamSpe
 }
 
 static void
+sync_icon (GtkAction *action, GParamSpec *pspec, GtkWidget *proxy)
+{
+	EphyLocationAction *fav_action = EPHY_LOCATION_ACTION (action);
+	EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (proxy);
+	char *url;
+	GtkWidget *image;
+	GdkPixbuf *pixbuf = NULL;
+
+	url = fav_action->priv->icon;
+
+	image = ephy_location_entry_get_icon (entry);
+	g_return_if_fail (GTK_IS_IMAGE (image));
+
+	if (url)
+	{
+		pixbuf = ephy_favicon_cache_get (fav_action->priv->cache, url);
+	}
+
+	if (pixbuf)
+	{
+		gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
+		g_object_unref (pixbuf);
+	}
+	else
+	{
+		gtk_image_set_from_stock (GTK_IMAGE (image),
+					  GTK_STOCK_JUMP_TO,
+					  GTK_ICON_SIZE_MENU);
+	}
+}
+
+static void
 remove_completion_actions (GtkAction *action, GtkWidget *proxy)
 {
 	GtkWidget *entry;
@@ -231,7 +319,7 @@ connect_proxy (GtkAction *action, GtkWid
 	if (EPHY_IS_LOCATION_ENTRY (proxy))
 	{
 		EphyCompletionModel *model;
-		GtkWidget *entry;
+		GtkWidget *entry, *icon;
 
 		model = ephy_completion_model_new ();
 		ephy_location_entry_set_completion (EPHY_LOCATION_ENTRY (proxy),
@@ -250,12 +338,28 @@ connect_proxy (GtkAction *action, GtkWid
 		g_signal_connect_object (action, "notify::editable",
 					 G_CALLBACK (sync_editable), proxy, 0);
 
+		sync_icon (action, NULL, proxy);
+		g_signal_connect_object (action, "notify::icon",
+					 G_CALLBACK (sync_icon),
+					 proxy, 0);
+
 		entry = GTK_BIN (proxy)->child;
 		g_signal_connect_object (entry, "activate",
 					 G_CALLBACK (location_url_activate_cb),
 					 action, 0);
 		g_signal_connect_object (proxy, "user_changed",
 					 G_CALLBACK (user_changed_cb), action, 0);
+
+		icon = ephy_location_entry_get_icon (EPHY_LOCATION_ENTRY (proxy));
+		gtk_drag_source_set (icon,
+				     GDK_BUTTON1_MASK,
+				     url_drag_types,
+				     n_url_drag_types,
+				     GDK_ACTION_COPY);
+		g_signal_connect (icon,
+				  "drag_data_get",
+				  G_CALLBACK (favicon_drag_data_get_cb),
+				  EPHY_LOCATION_ACTION (action)->priv->window);
 	}
 
 	(* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy);
@@ -270,6 +374,10 @@ disconnect_proxy (GtkAction *action, Gtk
 	{
 		g_signal_handlers_disconnect_by_func
 			(action, G_CALLBACK (sync_address), proxy);
+		g_signal_handlers_disconnect_by_func
+			(action, G_CALLBACK (sync_editable), proxy);
+		g_signal_handlers_disconnect_by_func
+			(action, G_CALLBACK (sync_icon), proxy);
 
 		g_signal_handlers_disconnect_by_func
 			(proxy, G_CALLBACK (location_url_activate_cb), action);
@@ -298,6 +406,14 @@ ephy_location_action_set_property (GObje
 			action->priv->editable = g_value_get_boolean (value);
 			g_object_notify (G_OBJECT (action), "editable");
 			break;
+		case PROP_ICON:
+			g_free (action->priv->icon);
+			action->priv->icon = g_value_dup_string (value);
+			g_object_notify(object, "icon");
+			break;
+		case PROP_WINDOW:
+			action->priv->window = EPHY_WINDOW (g_value_get_object (value));
+			break;
 	}
 }
 
@@ -317,6 +433,12 @@ ephy_location_action_get_property (GObje
 		case PROP_EDITABLE:
 			g_value_set_boolean (value, action->priv->editable);
 			break;
+		case PROP_ICON:
+			g_value_set_string (value, action->priv->icon);
+			break;
+		case PROP_WINDOW:
+			g_value_set_object (value, action->priv->window);
+			break;
 	}
 }
 
@@ -377,6 +499,22 @@ ephy_location_action_class_init (EphyLoc
 							       TRUE,
 							       G_PARAM_READWRITE));
 
+	g_object_class_install_property (object_class,
+                                         PROP_ICON,
+                                         g_param_spec_string  ("icon",
+                                                               "Icon",
+                                                               "The icon",
+                                                               NULL,
+                                                               G_PARAM_READWRITE));
+
+	g_object_class_install_property (object_class,
+                                         PROP_WINDOW,
+                                         g_param_spec_object ("window",
+                                                              "Window",
+                                                              "The window",
+                                                              G_TYPE_OBJECT,
+                                                              G_PARAM_READWRITE |
+							      G_PARAM_CONSTRUCT_ONLY));
 
 	g_type_class_add_private (object_class, sizeof (EphyLocationActionPrivate));
 }
@@ -458,6 +596,7 @@ ephy_location_action_init (EphyLocationA
 	action->priv->bookmarks = ephy_shell_get_bookmarks (ephy_shell);
 	action->priv->smart_bmks = ephy_bookmarks_get_smart_bookmarks
 		(action->priv->bookmarks);
+	action->priv->icon = NULL;
 
 	init_actions_list (action);
 
@@ -473,6 +612,11 @@ ephy_location_action_init (EphyLocationA
 			                 EPHY_NODE_CHILD_CHANGED,
 			                 (EphyNodeCallback)actions_child_changed_cb,
 			                 G_OBJECT (action));
+
+	action->priv->cache = EPHY_FAVICON_CACHE
+		(ephy_embed_shell_get_favicon_cache
+		(EPHY_EMBED_SHELL (ephy_shell)));
+	g_object_ref (action->priv->cache);
 }
 
 static void
@@ -483,6 +627,7 @@ ephy_location_action_finalize (GObject *
 	g_list_free (action->priv->actions);
 
 	g_free (action->priv->address);
+	g_free (action->priv->icon);
 
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
Index: src/toolbar.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/toolbar.c,v
retrieving revision 1.75
diff -u -p -r1.75 toolbar.c
--- src/toolbar.c	9 Jan 2004 22:04:55 -0000	1.75
+++ src/toolbar.c	26 Jan 2004 21:05:44 -0000
@@ -375,6 +375,7 @@ toolbar_setup_actions (Toolbar *t)
 			       "label", _("Address Entry"),
 			       "stock_id", EPHY_STOCK_ENTRY,
 			       "tooltip", _("Enter a web address to open, or a phrase to search for on the web"),
+			       "window", t->priv->window,
 			       NULL);
 	g_signal_connect (action, "go_location",
 			  G_CALLBACK (go_location_cb), t->priv->window);
@@ -654,7 +655,7 @@ toolbar_update_favicon (Toolbar *t)
 	tab = ephy_window_get_active_tab (t->priv->window);
 	url = ephy_tab_get_icon_address (tab);
 	action_group = t->priv->action_group;
-	action = gtk_action_group_get_action (action_group, "Favicon");
+	action = gtk_action_group_get_action (action_group, "Location");
 	g_object_set (action, "icon", url, NULL);
 }
 
