/* Generated by GOB (v2.0.20)   (do not edit directly) */

/* End world hunger, donate to the World Food Programme, http://www.wfp.org */

#define GOB_VERSION_MAJOR 2
#define GOB_VERSION_MINOR 0
#define GOB_VERSION_PATCHLEVEL 20

#define selfp (self->_priv)

#include <string.h> /* memset() */

#include "gmpc-metaimage.h"

#include "gmpc-metaimage-private.h"

#ifdef G_LIKELY
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
#else /* ! G_LIKELY */
#define ___GOB_LIKELY(expr) (expr)
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */

#line 36 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"

static unsigned int num_drag_targets = 4; /* skip hyperlinks for now */
static GtkTargetEntry data_image_drag_target[] = 
{
    { (gchar *)"image/jpeg", 0, 0 },
    { (gchar *)"image/png",  0, 1 },
    { (gchar *)"image/gif",  0, 2 },
	{ (gchar *)"text/uri-list", 0, 3},
    { (gchar *)"_NETSCAPE_URL", 0,4},
    { (gchar *)"x-url/http", 0,5}
};

#line 39 "gmpc-metaimage.c"
/* self casting macros */
#define SELF(x) GMPC_METAIMAGE(x)
#define SELF_CONST(x) GMPC_METAIMAGE_CONST(x)
#define IS_SELF(x) GMPC_IS_METAIMAGE(x)
#define TYPE_SELF GMPC_TYPE_METAIMAGE
#define SELF_CLASS(x) GMPC_METAIMAGE_CLASS(x)

#define SELF_GET_CLASS(x) GMPC_METAIMAGE_GET_CLASS(x)

/* self typedefs */
typedef GmpcMetaImage Self;
typedef GmpcMetaImageClass SelfClass;

/* here are local prototypes */
static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void gmpc_metaimage_class_init (GmpcMetaImageClass * c) G_GNUC_UNUSED;
#line 169 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void gmpc_metaimage_init (GmpcMetaImage * self) G_GNUC_UNUSED;
#line 59 "gmpc-metaimage.c"
#line 190 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static gboolean gmpc_metaimage_tooltip_query (GmpcMetaImage * self, gint x, gint y, gboolean keyboard_mode, GtkTooltip * tip, GtkWidget * win) G_GNUC_UNUSED;
#line 62 "gmpc-metaimage.c"
#line 207 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void ___f_gmpc_metaimage_dispose (GObject * obj) G_GNUC_UNUSED;
#line 65 "gmpc-metaimage.c"
#line 235 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void gmpc_metaimage_drag_data_recieved (GmpcMetaImage * self, GdkDragContext * context, gint x, gint y, GtkSelectionData * data, guint info, guint dnd_time, GtkWidget * widget) G_GNUC_UNUSED;
#line 68 "gmpc-metaimage.c"
#line 288 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static gboolean gmpc_metaimage_expose_event (GmpcMetaImage * self, GdkEventExpose * event, gpointer data) G_GNUC_UNUSED;
#line 71 "gmpc-metaimage.c"
#line 379 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void gmpc_metaimage_connection_changed (GmpcMetaImage * self, MpdObj * mi, int connect, GmpcConnection * gmpconn) G_GNUC_UNUSED;
#line 74 "gmpc-metaimage.c"
#line 444 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static gboolean gmpc_metaimage_update_cover_from_song_delayed_real (GmpcMetaImage * self) G_GNUC_UNUSED;
#line 77 "gmpc-metaimage.c"
#line 485 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void gmpc_metaimage_meta_callback (GmpcMetaWatcher * gmv, mpd_Song * song, MetaDataType type, MetaDataResult ret, MetaData * met, gpointer data) G_GNUC_UNUSED;
#line 80 "gmpc-metaimage.c"
#line 729 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static gboolean gmpc_metaimage_menu_populate_callback (GmpcMetaImage * self, GdkEventButton * event, gpointer data) G_GNUC_UNUSED;
#line 83 "gmpc-metaimage.c"
#line 766 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void gmpc_metaimage_clear_entry (GmpcMetaImage * self) G_GNUC_UNUSED;
#line 86 "gmpc-metaimage.c"
#line 779 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void gmpc_metaimage_select_metadata_editor (GmpcMetaImage * self) G_GNUC_UNUSED;
#line 89 "gmpc-metaimage.c"

/*
 * Signal connection wrapper macro shortcuts
 */
#define self_connect__menu_populate_client(object,func,data)	gmpc_metaimage_connect__menu_populate_client((object),(func),(data))
#define self_connect_after__menu_populate_client(object,func,data)	gmpc_metaimage_connect_after__menu_populate_client((object),(func),(data))
#define self_connect_data__menu_populate_client(object,func,data,destroy_data,flags)	gmpc_metaimage_connect_data__menu_populate_client((object),(func),(data),(destroy_data),(flags))

typedef void  (*___Sig1) (GmpcMetaImage *, gpointer , gpointer);

static void
___marshal_Sig1 (GClosure *closure,
	GValue *return_value G_GNUC_UNUSED,
	guint n_param_values,
	const GValue *param_values,
	gpointer invocation_hint G_GNUC_UNUSED,
	gpointer marshal_data)
{
	register ___Sig1 callback;
	register GCClosure *cc = (GCClosure*) closure;
	register gpointer data1, data2;

	g_return_if_fail (n_param_values == 2);

	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = g_value_peek_pointer (param_values + 0);
	} else {
		data1 = g_value_peek_pointer (param_values + 0);
		data2 = closure->data;
	}

	callback = (___Sig1) (marshal_data != NULL ? marshal_data : cc->callback);

	callback ((GmpcMetaImage *)data1,
		(gpointer ) g_value_get_pointer (param_values + 1),
		data2);
}


enum {
	MENU_POPULATE_CLIENT_SIGNAL,
	LAST_SIGNAL
};

enum {
	PROP_0,
	PROP_IMAGE_TYPE,
	PROP_SIZE,
	PROP_HIDE_ON_NA,
	PROP_SCALE_UP,
	PROP_SQUARED
};

static guint object_signals[LAST_SIGNAL] = {0};

/* pointer to the class of our parent */
static GtkEventBoxClass *parent_class = NULL;

/* Short form macros */
#define self_get_image_type gmpc_metaimage_get_image_type
#define self_set_image_type gmpc_metaimage_set_image_type
#define self_get_size gmpc_metaimage_get_size
#define self_set_size gmpc_metaimage_set_size
#define self_get_hide_on_na gmpc_metaimage_get_hide_on_na
#define self_set_hide_on_na gmpc_metaimage_set_hide_on_na
#define self_get_scale_up gmpc_metaimage_get_scale_up
#define self_set_scale_up gmpc_metaimage_set_scale_up
#define self_set_no_cover_icon gmpc_metaimage_set_no_cover_icon
#define self_set_loading_cover_icon gmpc_metaimage_set_loading_cover_icon
#define self_set_squared gmpc_metaimage_set_squared
#define self_set_connection gmpc_metaimage_set_connection
#define self_tooltip_query gmpc_metaimage_tooltip_query
#define self_drag_data_recieved gmpc_metaimage_drag_data_recieved
#define self_expose_event gmpc_metaimage_expose_event
#define self_new_size gmpc_metaimage_new_size
#define self_new gmpc_metaimage_new
#define self_update_cover gmpc_metaimage_update_cover
#define self_connection_changed gmpc_metaimage_connection_changed
#define self_update_cover_from_song gmpc_metaimage_update_cover_from_song
#define self_update_cover_from_song_delayed_real gmpc_metaimage_update_cover_from_song_delayed_real
#define self_update_cover_from_song_delayed gmpc_metaimage_update_cover_from_song_delayed
#define self_meta_callback gmpc_metaimage_meta_callback
#define self_set_cover_na gmpc_metaimage_set_cover_na
#define self_set_cover_fetching gmpc_metaimage_set_cover_fetching
#define self_set_cover_from_path gmpc_metaimage_set_cover_from_path
#define self_set_is_visible gmpc_metaimage_set_is_visible
#define self_query_refetch gmpc_metaimage_query_refetch
#define self_menu_populate_client gmpc_metaimage_menu_populate_client
#define self_menu_populate_callback gmpc_metaimage_menu_populate_callback
#define self_clear_entry gmpc_metaimage_clear_entry
#define self_select_metadata_editor gmpc_metaimage_select_metadata_editor
#define self_select_file gmpc_metaimage_select_file
#define self_reload_image gmpc_metaimage_reload_image
GType
gmpc_metaimage_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (GmpcMetaImageClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) gmpc_metaimage_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (GmpcMetaImage),
			0 /* n_preallocs */,
			(GInstanceInitFunc) gmpc_metaimage_init,
			NULL
		};

		type = g_type_register_static (GTK_TYPE_EVENT_BOX, "GmpcMetaImage", &info, (GTypeFlags)0);
	}

	return type;
}

/* a macro for creating a new object of our type */
#define GET_NEW ((GmpcMetaImage *)g_object_new(gmpc_metaimage_get_type(), NULL))

/* a function for creating a new object of our type */
#include <stdarg.h>
static GmpcMetaImage * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
static GmpcMetaImage *
GET_NEW_VARG (const char *first, ...)
{
	GmpcMetaImage *ret;
	va_list ap;
	va_start (ap, first);
	ret = (GmpcMetaImage *)g_object_new_valist (gmpc_metaimage_get_type (), first, ap);
	va_end (ap);
	return ret;
}


static void
___dispose (GObject *obj_self)
{
#define __GOB_FUNCTION__ "Gmpc:MetaImage::dispose"
#line 207 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	___f_gmpc_metaimage_dispose(obj_self);
#line 233 "gmpc-metaimage.c"
}
#undef __GOB_FUNCTION__


static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "Gmpc:MetaImage::finalize"
	GmpcMetaImage *self G_GNUC_UNUSED = GMPC_METAIMAGE (obj_self);
	gpointer priv G_GNUC_UNUSED = self->_priv;
#line 79 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	if(self->_priv->song) { mpd_freeSong ((gpointer) self->_priv->song); self->_priv->song = NULL; }
#line 246 "gmpc-metaimage.c"
#line 88 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	if(self->no_cover_icon) { g_free ((gpointer) self->no_cover_icon); self->no_cover_icon = NULL; }
#line 249 "gmpc-metaimage.c"
#line 89 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	if(self->loading_cover_icon) { g_free ((gpointer) self->loading_cover_icon); self->loading_cover_icon = NULL; }
#line 252 "gmpc-metaimage.c"
	if(G_OBJECT_CLASS(parent_class)->finalize) \
		(* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
}
#undef __GOB_FUNCTION__

static void 
gmpc_metaimage_class_init (GmpcMetaImageClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "Gmpc:MetaImage::class_init"
	GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;

	g_type_class_add_private(c,sizeof(GmpcMetaImagePrivate));

	parent_class = g_type_class_ref (GTK_TYPE_EVENT_BOX);

	object_signals[MENU_POPULATE_CLIENT_SIGNAL] =
		g_signal_new ("menu_populate_client",
			G_TYPE_FROM_CLASS (g_object_class),
			(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
			G_STRUCT_OFFSET (GmpcMetaImageClass, menu_populate_client),
			NULL, NULL,
			___marshal_Sig1,
			G_TYPE_NONE, 1,
			G_TYPE_POINTER);
	if ___GOB_UNLIKELY(sizeof(GtkMenu * ) != sizeof(gpointer ) || parent_class == NULL /* avoid warning */) {
		g_error("/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob line 723: Type mismatch of \"menu_populate_client\" signal signature");
	}

#line 207 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_object_class->dispose = ___dispose;
#line 283 "gmpc-metaimage.c"
	c->menu_populate_client = NULL;
	g_object_class->finalize = ___finalize;
	g_object_class->get_property = ___object_get_property;
	g_object_class->set_property = ___object_set_property;
    {
	GParamSpec   *param_spec;

	param_spec = g_param_spec_int
		("image_type" /* name */,
		 "Image type" /* nick */,
		 "Type of the image, like artist art" /* blurb */,
		 G_MININT /* minimum */,
		 G_MAXINT /* maximum */,
		 META_ALBUM_ART /* default_value */,
		 (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (g_object_class,
		PROP_IMAGE_TYPE,
		param_spec);
	param_spec = g_param_spec_int
		("size" /* name */,
		 "Size" /* nick */,
		 "Size of the image" /* blurb */,
		 G_MININT /* minimum */,
		 G_MAXINT /* maximum */,
		 64 /* default_value */,
		 (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (g_object_class,
		PROP_SIZE,
		param_spec);
	param_spec = g_param_spec_boolean
		("hide_on_na" /* name */,
		 "HideOnNA" /* nick */,
		 "Hide the image when not available" /* blurb */,
		 FALSE /* default_value */,
		 (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (g_object_class,
		PROP_HIDE_ON_NA,
		param_spec);
	param_spec = g_param_spec_boolean
		("scale_up" /* name */,
		 "Scale image up" /* nick */,
		 "Scale cover art up" /* blurb */,
		 FALSE /* default_value */,
		 (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (g_object_class,
		PROP_SCALE_UP,
		param_spec);
	param_spec = g_param_spec_boolean
		("squared" /* name */,
		 "Squared" /* nick */,
		 "Keep the widget squared" /* blurb */,
		 TRUE /* default_value */,
		 (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (g_object_class,
		PROP_SQUARED,
		param_spec);
    }
}
#undef __GOB_FUNCTION__
#line 169 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void 
gmpc_metaimage_init (GmpcMetaImage * self G_GNUC_UNUSED)
{
#line 347 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::init"
	self->_priv = G_TYPE_INSTANCE_GET_PRIVATE(self,GMPC_TYPE_METAIMAGE,GmpcMetaImagePrivate);
#line 69 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->state = STATE_EMPTY;
#line 352 "gmpc-metaimage.c"
#line 69 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->refresh = FALSE;
#line 355 "gmpc-metaimage.c"
#line 71 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->status_signal = 0;
#line 358 "gmpc-metaimage.c"
#line 72 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->connect_signal = 0;
#line 361 "gmpc-metaimage.c"
#line 73 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->meta_id = 0;
#line 364 "gmpc-metaimage.c"
#line 75 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->metadata_force_reload = 0;
#line 367 "gmpc-metaimage.c"
#line 77 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->image_url = NULL;
#line 370 "gmpc-metaimage.c"
#line 79 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->song = NULL;
#line 373 "gmpc-metaimage.c"
#line 83 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->size = 64;
#line 376 "gmpc-metaimage.c"
#line 84 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->image_type = META_ALBUM_ART;
#line 379 "gmpc-metaimage.c"
#line 85 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->connection = NULL;
#line 382 "gmpc-metaimage.c"
#line 86 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->hide_on_na = FALSE;
#line 385 "gmpc-metaimage.c"
#line 87 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->squared = TRUE;
#line 388 "gmpc-metaimage.c"
#line 88 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->no_cover_icon = g_strdup("gmpc-no-cover");
#line 391 "gmpc-metaimage.c"
#line 89 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->loading_cover_icon = g_strdup("gmpc-loading-cover");
#line 394 "gmpc-metaimage.c"
#line 91 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->expose_id = 0;
#line 397 "gmpc-metaimage.c"
#line 91 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->scale_up = FALSE;
#line 400 "gmpc-metaimage.c"
#line 97 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->is_visible = TRUE;
#line 403 "gmpc-metaimage.c"
#line 166 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->image =  (GtkWidget *)gmpc_meta_image_async_new();
#line 406 "gmpc-metaimage.c"
#line 167 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	self->_priv->tooltip_image =  (GtkWidget *)gmpc_meta_image_async_new();
#line 409 "gmpc-metaimage.c"
 {
#line 170 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"

	    GtkWidget *win = NULL;
	    gtk_container_add(GTK_CONTAINER(self), self->_priv->image);		
	    gtk_container_set_resize_mode(GTK_CONTAINER(self), GTK_RESIZE_IMMEDIATE);
	    gtk_widget_show_all(GTK_WIDGET(self));

	    g_signal_connect_swapped(G_OBJECT(self/*->_priv->image*/), "button-press-event", G_CALLBACK(self_menu_populate_callback), self);
	    self->_priv->meta_id = g_signal_connect(G_OBJECT(gmw), "data-changed", G_CALLBACK(self_meta_callback), self);
	    gtk_widget_add_events(GTK_WIDGET(self->_priv->image), GDK_POINTER_MOTION_MASK);
	    gtk_widget_set_no_show_all(GTK_WIDGET(self),TRUE);

	    win = gtk_window_new(GTK_WINDOW_POPUP); 
	    gtk_window_set_resizable(GTK_WINDOW(win), FALSE);
	    gtk_widget_modify_bg(win, GTK_STATE_NORMAL, &(GTK_WIDGET(self)->style->black));
	    gtk_container_set_border_width(GTK_CONTAINER(win), 6);
	    gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(self->_priv->tooltip_image));

	    gtk_widget_set_tooltip_window(GTK_WIDGET(self), GTK_WINDOW(win));
	    g_signal_connect(G_OBJECT(self), "query-tooltip", G_CALLBACK(self_tooltip_query), win);
    
#line 432 "gmpc-metaimage.c"
 }
}
#undef __GOB_FUNCTION__

static void
___object_set_property (GObject *object,
	guint property_id,
	const GValue *VAL G_GNUC_UNUSED,
	GParamSpec *pspec G_GNUC_UNUSED)
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_property"
{
	GmpcMetaImage *self G_GNUC_UNUSED;

	self = GMPC_METAIMAGE (object);

	switch (property_id) {
	case PROP_IMAGE_TYPE:
		{
#line 99 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
self->image_type = g_value_get_int (VAL);
#line 453 "gmpc-metaimage.c"
		}
		break;
	case PROP_SIZE:
		{
#line 106 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
self->size = g_value_get_int (VAL);
#line 460 "gmpc-metaimage.c"
		}
		break;
	case PROP_HIDE_ON_NA:
		{
#line 113 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
self->hide_on_na = g_value_get_boolean (VAL);
#line 467 "gmpc-metaimage.c"
		}
		break;
	case PROP_SCALE_UP:
		{
#line 120 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
self->scale_up = g_value_get_boolean (VAL);
#line 474 "gmpc-metaimage.c"
		}
		break;
	case PROP_SQUARED:
		{
#line 127 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
self->squared = g_value_get_boolean (VAL);
#line 481 "gmpc-metaimage.c"
		}
		break;
	default:
/* Apparently in g++ this is needed, glib is b0rk */
#ifndef __PRETTY_FUNCTION__
#  undef G_STRLOC
#  define G_STRLOC	__FILE__ ":" G_STRINGIFY (__LINE__)
#endif
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
#undef __GOB_FUNCTION__

static void
___object_get_property (GObject *object,
	guint property_id,
	GValue *VAL G_GNUC_UNUSED,
	GParamSpec *pspec G_GNUC_UNUSED)
#define __GOB_FUNCTION__ "Gmpc:MetaImage::get_property"
{
	GmpcMetaImage *self G_GNUC_UNUSED;

	self = GMPC_METAIMAGE (object);

	switch (property_id) {
	case PROP_IMAGE_TYPE:
		{
#line 99 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
g_value_set_int (VAL, self->image_type);
#line 512 "gmpc-metaimage.c"
		}
		break;
	case PROP_SIZE:
		{
#line 106 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
g_value_set_int (VAL, self->size);
#line 519 "gmpc-metaimage.c"
		}
		break;
	case PROP_HIDE_ON_NA:
		{
#line 113 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
g_value_set_boolean (VAL, self->hide_on_na);
#line 526 "gmpc-metaimage.c"
		}
		break;
	case PROP_SCALE_UP:
		{
#line 120 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
g_value_set_boolean (VAL, self->scale_up);
#line 533 "gmpc-metaimage.c"
		}
		break;
	case PROP_SQUARED:
		{
#line 127 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
g_value_set_boolean (VAL, self->squared);
#line 540 "gmpc-metaimage.c"
		}
		break;
	default:
/* Apparently in g++ this is needed, glib is b0rk */
#ifndef __PRETTY_FUNCTION__
#  undef G_STRLOC
#  define G_STRLOC	__FILE__ ":" G_STRINGIFY (__LINE__)
#endif
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
#undef __GOB_FUNCTION__


#line 99 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
gint 
gmpc_metaimage_get_image_type (GmpcMetaImage * self)
{
#line 560 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::get_image_type"
{
#line 99 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
		gint val; g_object_get (G_OBJECT (self), "image_type", &val, NULL); return val;
}}
#line 566 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 99 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_image_type (GmpcMetaImage * self, gint val)
{
#line 573 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_image_type"
{
#line 99 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
		g_object_set (G_OBJECT (self), "image_type", val, NULL);
}}
#line 579 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 106 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
gint 
gmpc_metaimage_get_size (GmpcMetaImage * self)
{
#line 586 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::get_size"
{
#line 106 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
		gint val; g_object_get (G_OBJECT (self), "size", &val, NULL); return val;
}}
#line 592 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 106 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_size (GmpcMetaImage * self, gint val)
{
#line 599 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_size"
{
#line 106 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
		g_object_set (G_OBJECT (self), "size", val, NULL);
}}
#line 605 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 113 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
gboolean 
gmpc_metaimage_get_hide_on_na (GmpcMetaImage * self)
{
#line 612 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::get_hide_on_na"
{
#line 113 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
		gboolean val; g_object_get (G_OBJECT (self), "hide_on_na", &val, NULL); return val;
}}
#line 618 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 113 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_hide_on_na (GmpcMetaImage * self, gboolean val)
{
#line 625 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_hide_on_na"
{
#line 113 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
		g_object_set (G_OBJECT (self), "hide_on_na", val, NULL);
}}
#line 631 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 120 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
gboolean 
gmpc_metaimage_get_scale_up (GmpcMetaImage * self)
{
#line 638 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::get_scale_up"
{
#line 120 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
		gboolean val; g_object_get (G_OBJECT (self), "scale_up", &val, NULL); return val;
}}
#line 644 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 120 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_scale_up (GmpcMetaImage * self, gboolean val)
{
#line 651 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_scale_up"
{
#line 120 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
		g_object_set (G_OBJECT (self), "scale_up", val, NULL);
}}
#line 657 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 132 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_no_cover_icon (GmpcMetaImage * self, const gchar * name)
{
#line 664 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_no_cover_icon"
#line 132 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 132 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 670 "gmpc-metaimage.c"
{
#line 133 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
        if(self->no_cover_icon) {
            q_free(self->no_cover_icon);
        }
        self->no_cover_icon = g_strdup(name);
    }}
#line 679 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 139 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_loading_cover_icon (GmpcMetaImage * self, const gchar * name)
{
#line 686 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_loading_cover_icon"
#line 139 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 139 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 692 "gmpc-metaimage.c"
{
#line 140 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
        if(self->loading_cover_icon) {
            q_free(self->loading_cover_icon);
        }
        self->loading_cover_icon = g_strdup(name);
    }}
#line 701 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 146 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_squared (GmpcMetaImage * self, const gboolean item)
{
#line 708 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_squared"
#line 146 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 146 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 714 "gmpc-metaimage.c"
{
#line 147 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
        self->squared = item;
    }}
#line 720 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 150 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_connection (GmpcMetaImage * self, MpdObj * conn)
{
#line 727 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_connection"
#line 150 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 150 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 733 "gmpc-metaimage.c"
{
#line 151 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
        self->connection = conn;
        if(conn)
        {
            self->_priv->status_signal = g_signal_connect_swapped(G_OBJECT(gmpcconn), 
                    "status_changed",
                    G_CALLBACK(self_update_cover),
                    G_OBJECT(self));

            self->_priv->connect_signal = g_signal_connect_swapped(G_OBJECT(gmpcconn), 
                    "connection_changed",
                    G_CALLBACK(self_connection_changed),
                    G_OBJECT(self));                            		
        }
    }}
#line 751 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__


#line 190 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static gboolean 
gmpc_metaimage_tooltip_query (GmpcMetaImage * self, gint x, gint y, gboolean keyboard_mode, GtkTooltip * tip, GtkWidget * win)
{
#line 759 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::tooltip_query"
#line 190 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_val_if_fail (self != NULL, (gboolean )0);
#line 190 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_val_if_fail (GMPC_IS_METAIMAGE (self), (gboolean )0);
#line 765 "gmpc-metaimage.c"
{
#line 192 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
        if(self->_priv->state == STATE_IMAGE)
        {
            if(self->_priv->image_url)
            {
                if(GMPC_META_IMAGE_ASYNC(self->_priv->tooltip_image)->uri == NULL || 
				strcmp(GMPC_META_IMAGE_ASYNC(self->_priv->tooltip_image)->uri, self->_priv->image_url) != 0)
			gmpc_meta_image_async_set_from_file(GMPC_META_IMAGE_ASYNC(self->_priv->tooltip_image), self->_priv->image_url, 350, GMPC_MODIFICATION_TYPE_NONE); 
                gtk_widget_show(self->_priv->tooltip_image);
                return TRUE;
            }
        }
        return FALSE;
    }}
#line 782 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 207 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void 
___f_gmpc_metaimage_dispose (GObject * obj G_GNUC_UNUSED)
#line 788 "gmpc-metaimage.c"
#define PARENT_HANDLER(___obj) \
	{ if(G_OBJECT_CLASS(parent_class)->dispose) \
		(* G_OBJECT_CLASS(parent_class)->dispose)(___obj); }
{
#define __GOB_FUNCTION__ "Gmpc:MetaImage::dispose"
{
#line 210 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
			Self *self = GMPC_METAIMAGE(obj); 
            if(self->_priv->meta_id)
			{
				g_signal_handler_disconnect(G_OBJECT(gmw),self->_priv->meta_id);
				self->_priv->meta_id =  0;
			}
            if(self->_priv->metadata_force_reload)
            {
                g_signal_handler_disconnect(G_OBJECT(gmw),self->_priv->metadata_force_reload);
                self->_priv->metadata_force_reload =  0;
            }
			if(self->_priv->image_url) {
				q_free(self->_priv->image_url);
			}
			if(self->_priv->status_signal){
				g_signal_handler_disconnect(G_OBJECT(gmpcconn), self->_priv->status_signal);
				self->_priv->status_signal =0;
			}
			if(self->_priv->connect_signal){
				g_signal_handler_disconnect(G_OBJECT(gmpcconn), self->_priv->connect_signal);
				self->_priv->connect_signal=0;
			}
			PARENT_HANDLER(obj);
		}}
#line 821 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 235 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void 
gmpc_metaimage_drag_data_recieved (GmpcMetaImage * self, GdkDragContext * context, gint x, gint y, GtkSelectionData * data, guint info, guint dnd_time, GtkWidget * widget)
{
#line 829 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::drag_data_recieved"
#line 235 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 235 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 835 "gmpc-metaimage.c"
{
#line 246 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
            int found = FALSE;
            if(self->_priv->song)
            {
                if(info < num_drag_targets)
                {
                    gchar **uri =  gtk_selection_data_get_uris(data);   
                    /* Only one uri is interresting */
                    if(uri && uri[0])
                    {
                        gchar *path = g_filename_from_uri(uri[0], NULL, NULL);

                        /* try to open it */
                        if(path && gdk_pixbuf_get_file_info(path, NULL,NULL))
                        {
                            mpd_Song *song = mpd_songDup(self->_priv->song);
                            /* Create MetaData object */
                            MetaData* met = meta_data_new();
                            met->type = self->image_type;
                            met->plugin_name = "User set";
                            met->content_type = META_DATA_CONTENT_URI;
                            met->content = path; path = NULL;
                            met->size = -1;
                            /* set cache */
                            meta_data_set_cache(song, META_DATA_AVAILABLE, met); 
                            /* Signal */
                            gmpc_meta_watcher_data_changed(gmw, song, self->image_type, META_DATA_AVAILABLE, met);
                            /* free Metadata object */
                            meta_data_free(met);
                            found = TRUE;
                            mpd_freeSong(song);
                        }
                        g_free(path);
                    }
                    g_strfreev(uri);
                }
            }

            gtk_drag_finish(context, found, FALSE, dnd_time);
        }}
#line 878 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 288 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static gboolean 
gmpc_metaimage_expose_event (GmpcMetaImage * self, GdkEventExpose * event, gpointer data)
{
#line 885 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::expose_event"
#line 288 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_val_if_fail (self != NULL, (gboolean )0);
#line 288 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_val_if_fail (GMPC_IS_METAIMAGE (self), (gboolean )0);
#line 891 "gmpc-metaimage.c"
{
#line 291 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
            g_signal_handler_disconnect(G_OBJECT(self), self->_priv->expose_id);
            self->_priv->expose_id = 0;
            self_update_cover_from_song_delayed_real(self);
            return FALSE;
        }}
#line 900 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 298 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
GmpcMetaImage * 
gmpc_metaimage_new_size (int type, int size)
{
#line 907 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::new_size"
{
#line 300 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
            Self *gmi =  GET_NEW;
            gmi->image_type = type;
            gmi->size = size;


            gtk_event_box_set_visible_window(GTK_EVENT_BOX(gmi), FALSE);
            gtk_drag_dest_set(GTK_WIDGET(gmi),
                    GTK_DEST_DEFAULT_ALL,
                    data_image_drag_target, num_drag_targets,
                    GDK_ACTION_COPY|GDK_ACTION_LINK|GDK_ACTION_DEFAULT|GDK_ACTION_MOVE);

            g_signal_connect_swapped (G_OBJECT (gmi),"drag-data-received",
                    GTK_SIGNAL_FUNC (self_drag_data_recieved),gmi);

            gmi->_priv->metadata_force_reload = g_signal_connect_swapped(G_OBJECT(gmw), "force-reload", G_CALLBACK(self_reload_image), gmi);

            return gmi;
        }}
#line 930 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 319 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
GtkWidget * 
gmpc_metaimage_new (int type)
{
#line 937 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::new"
{
#line 321 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
			Self *gmi =  GET_NEW;
			gmi->image_type = type;

            gtk_event_box_set_visible_window(GTK_EVENT_BOX(gmi), FALSE);
            gtk_drag_dest_set(GTK_WIDGET(gmi),
                    GTK_DEST_DEFAULT_ALL,
                data_image_drag_target, num_drag_targets,
                GDK_ACTION_COPY|GDK_ACTION_LINK|GDK_ACTION_DEFAULT|GDK_ACTION_MOVE);
        g_signal_connect_swapped (G_OBJECT (gmi),"drag-data-received",
                GTK_SIGNAL_FUNC (self_drag_data_recieved),gmi);
            gmi->_priv->metadata_force_reload = g_signal_connect_swapped(G_OBJECT(gmw), "force-reload", G_CALLBACK(self_reload_image), gmi);
            return (GtkWidget *)gmi;
		}}
#line 955 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 336 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_update_cover (GmpcMetaImage * self, MpdObj * mi, ChangedStatusType what, GmpcConnection * gc)
{
#line 962 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::update_cover"
#line 336 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 336 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 968 "gmpc-metaimage.c"
{
#line 339 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	

			if(self->connection && what&(MPD_CST_STATE|MPD_CST_SONGID|MPD_CST_SONGPOS|MPD_CST_PLAYLIST) && self->is_visible)
			{
				int state = mpd_player_get_state(self->connection);
				if(state == MPD_PLAYER_STOP || state == MPD_PLAYER_UNKNOWN)
				{
                    self->_priv->refresh = TRUE;
					self_set_cover_na(self);
				}
				else {
					mpd_Song *song = mpd_playlist_get_current_song(self->connection);
					if(song)
					{
                        if( self->_priv->refresh == FALSE && 
                            self->_priv->song && 
                            self->_priv->song->artist && 
                            song->artist && 
                            strcmp(song->artist, self->_priv->song->artist) == 0)
                        {
                            /* If we are artist iamge, don't update, same artist */
                            if(self->image_type == META_ARTIST_ART ) return;
                            /* If we are album, check if album matches too */
                            else if(self->image_type == META_ALBUM_ART && 
                                self->_priv->song->album && song->album &&
                                strcmp(self->_priv->song->album, song->album) == 0){
                                return;
                            }
                        }
						self_update_cover_from_song(self, song);
					}
					else
					{
						self_set_cover_na(self);
					}
                    self->_priv->refresh = FALSE;
				}

			}
		}}
#line 1011 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 379 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void 
gmpc_metaimage_connection_changed (GmpcMetaImage * self, MpdObj * mi, int connect, GmpcConnection * gmpconn)
{
#line 1018 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::connection_changed"
#line 379 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 379 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1024 "gmpc-metaimage.c"
{
#line 382 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
			if(!connect)
			{
				self_set_cover_na(self);
			}
            else
            {
                if(self->connection)
                {
                    int state = mpd_player_get_state(self->connection);
                    if(state != MPD_PLAYER_STOP && state != MPD_PLAYER_UNKNOWN)
                    {
                        mpd_Song *song = mpd_playlist_get_current_song(self->connection);
                        if(song){
                            self_update_cover_from_song(self, song);
                        }
                    }
                }

            }

		}}
#line 1049 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 405 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_update_cover_from_song (GmpcMetaImage * self, const mpd_Song * song)
{
#line 1056 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::update_cover_from_song"
#line 405 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 405 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1062 "gmpc-metaimage.c"
{
#line 408 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
			MetaDataResult ret;
            MetaData *met= NULL;


			if(self->_priv->song)
				mpd_freeSong(self->_priv->song);
            self->_priv->song = NULL;

			if(!song)
			{
				self_set_cover_na(self);
				return;
			}
            self->_priv->song = mpd_songDup(song);

			ret = gmpc_meta_watcher_get_meta_path(gmw,self->_priv->song, self->image_type, &met);
			if(ret == META_DATA_FETCHING)
			{
				self_set_cover_fetching(self);
			}else if (ret == META_DATA_AVAILABLE) {
                    if(met->content_type == META_DATA_CONTENT_URI)
                    {
                        const gchar *path = meta_data_get_uri(met);
                        self_set_cover_from_path(self,path); 
                    }else{
                        self_set_cover_na(self);
                    }
			} else {
				self_set_cover_na(self);
			}
			if(met)
			{
			    meta_data_free(met);	
			}
		}}
#line 1101 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 444 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static gboolean 
gmpc_metaimage_update_cover_from_song_delayed_real (GmpcMetaImage * self)
{
#line 1108 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::update_cover_from_song_delayed_real"
#line 444 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_val_if_fail (self != NULL, (gboolean )0);
#line 444 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_val_if_fail (GMPC_IS_METAIMAGE (self), (gboolean )0);
#line 1114 "gmpc-metaimage.c"
{
#line 447 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
            MetaData *met= NULL;
            int ret = gmpc_meta_watcher_get_meta_path(gmw,self->_priv->song, self->image_type, &met);
            if(ret == META_DATA_FETCHING)
            {
                self_set_cover_fetching(self);
            }else if (ret == META_DATA_AVAILABLE) {
                if(met->content_type == META_DATA_CONTENT_URI)
                {
                    const gchar *path = meta_data_get_uri(met);
                    self_set_cover_from_path(self,path); 
                } else {
                    self_set_cover_na(self);
                }
            }
            else{
                self_set_cover_na(self);
            }
            if(met)
            {
                meta_data_free(met);
            }

            return FALSE;
        }}
#line 1142 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 472 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_update_cover_from_song_delayed (GmpcMetaImage * self, mpd_Song * song)
{
#line 1149 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::update_cover_from_song_delayed"
#line 472 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 472 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1155 "gmpc-metaimage.c"
{
#line 475 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
            if(self->_priv->song)
                mpd_freeSong(self->_priv->song);

            gtk_widget_set_size_request(GTK_WIDGET(self), self->size, self->size);
            self->_priv->song = mpd_songDup(song);
            /* hack to make it load when it gets visible */
            self->_priv->expose_id = g_signal_connect(G_OBJECT(self), "expose-event", G_CALLBACK(self_expose_event) , NULL);
        }}
#line 1167 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 485 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void 
gmpc_metaimage_meta_callback (GmpcMetaWatcher * gmv, mpd_Song * song, MetaDataType type, MetaDataResult ret, MetaData * met, gpointer data)
{
#line 1174 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::meta_callback"
{
#line 488 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
        Self *self = data;
        if(!song || !self || !self->_priv || !self->_priv->song)
            return;

        /**
         * Check for fields
         */
        if(self->image_type != type)
            return;

        if(!gmpc_meta_watcher_match_data(self->image_type, self->_priv->song, song))
        {
            return;
        }

        /**
         * If mpd is stopped before the result is back, set the cover to na, and ignore the result
         */
        if(self->connection && mpd_player_get_state(self->connection) == MPD_PLAYER_STOP)
        {
            self_set_cover_na(self);
        }
        else
        {
            if(ret == META_DATA_AVAILABLE) {
                if(met->content_type == META_DATA_CONTENT_URI){
                    const char *path = meta_data_get_uri(met);
                    self_set_cover_from_path(self,path); 
                }else{
                    self_set_cover_na(self);
                    g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Method not implemented: %i", met->content_type);
                }
            } else if (ret == META_DATA_FETCHING) {
                self_set_cover_fetching(self);
            } else {
                self_set_cover_na(self);
            }
        }
    }}
#line 1218 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 530 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_cover_na (GmpcMetaImage * self)
{
#line 1225 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_cover_na"
#line 530 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 530 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1231 "gmpc-metaimage.c"
{
#line 533 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
            int border = FALSE;
            GError *error = NULL;
            GdkPixbuf *pb2 = NULL; 


	    if(self->_priv->state == STATE_NA) {
                return;
            }
            self->_priv->state = STATE_NA;
	    gmpc_meta_image_async_clear_now(GMPC_META_IMAGE_ASYNC(self->_priv->tooltip_image));

            if(self->_priv->image_url)
            {
                q_free(self->_priv->image_url);
                self->_priv->image_url = NULL;
            }
            if(self->hide_on_na)
            {		
                gtk_widget_hide(GTK_WIDGET(self));
                return;
            }

            if(cfg_get_single_value_as_int_with_default(config, "metaimage", "addcase",TRUE) && self->image_type == META_ALBUM_ART){
                pb2 = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "stylized-no-cover", self->size, 0,&error);
                border = TRUE;
                if(error) {
                    g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Following error loading stylized-no-cover: %s", error->message);
                    g_error_free(error);
                    error = NULL;
                }
            }
            if(!pb2){
                pb2 = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), self->no_cover_icon, self->size, 0,&error);
                if(error) {
                    g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Following error loading stylized-no-cover: %s", error->message);
                    g_error_free(error);
                    error = NULL;
                }
                border = FALSE;
            }

            if(pb2) {
                if(self->squared) {
                    gtk_widget_set_size_request(GTK_WIDGET(self), self->size, self->size);
                } else {
                //    gtk_widget_set_size_request(GTK_WIDGET(self), gdk_pixbuf_get_width(pb2), gdk_pixbuf_get_height(pb2));
                }
                gmpc_meta_image_async_set_pixbuf(GMPC_META_IMAGE_ASYNC(self->_priv->image), pb2);
                g_object_unref(pb2);
            } else {
                /* If failed to load an image, clear it */
                gmpc_meta_image_async_clear_now(GMPC_META_IMAGE_ASYNC(self->_priv->image));
            }
        }}
#line 1289 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 588 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_cover_fetching (GmpcMetaImage * self)
{
#line 1296 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_cover_fetching"
#line 588 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 588 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1302 "gmpc-metaimage.c"
{
#line 591 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
            int border = FALSE;
            GError *error = NULL;
            GdkPixbuf *pb2 = NULL;

            if(self->_priv->state == STATE_FETCHING) {
                return;
            }
            self->_priv->state = STATE_FETCHING;
	    gmpc_meta_image_async_clear_now(GMPC_META_IMAGE_ASYNC(self->_priv->tooltip_image));
            if(self->_priv->image_url)
            {
                q_free(self->_priv->image_url);
                self->_priv->image_url = NULL;
            }
            if(self->hide_on_na)
            {		
                gtk_widget_hide(GTK_WIDGET(self));
            }


            if(cfg_get_single_value_as_int_with_default(config, "metaimage", "addcase",TRUE) && self->image_type == META_ALBUM_ART){
                pb2 = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "stylized-fetching-cover", self->size, 0,&error);
                if(error) {
                    g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Following error loading stylized-no-cover: %s", error->message);
                    g_error_free(error);
                    error = NULL;
                }
                border=TRUE;
            }
            if(!pb2){
                pb2 = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), self->loading_cover_icon, self->size, 0,&error);
                if(error) {
                    g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Following error loading stylized-no-cover: %s", error->message);
                    g_error_free(error);
                    error = NULL;
                }
                border = FALSE;

            }

            if(self->squared) {
                gtk_widget_set_size_request(GTK_WIDGET(self), self->size, self->size);
            } else {
//                gtk_widget_set_size_request(GTK_WIDGET(self), gdk_pixbuf_get_width(pb2), gdk_pixbuf_get_height(pb2));
                gmpc_meta_image_async_clear_now(GMPC_META_IMAGE_ASYNC(self->_priv->image));
            }

            if(pb2) {
                gmpc_meta_image_async_set_pixbuf(GMPC_META_IMAGE_ASYNC(self->_priv->image), pb2);
                g_object_unref(pb2);
            } else {
                /* If failed to load an image, clear it */
                gmpc_meta_image_async_clear_now(GMPC_META_IMAGE_ASYNC(self->_priv->image));
            }
        }}
#line 1361 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 648 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_cover_from_path (GmpcMetaImage * self, const gchar * path)
{
#line 1368 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_cover_from_path"
#line 648 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 648 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1374 "gmpc-metaimage.c"
{
#line 651 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
            self->_priv->state = STATE_IMAGE;
            
            if(self->_priv->image_url)
            {
                if(strcmp(path, self->_priv->image_url) == 0) {
                    return;
                }
                q_free(self->_priv->image_url);
                self->_priv->image_url = NULL;
            }
            self->_priv->image_url = g_strdup(path); 
            gmpc_meta_image_async_set_from_file(GMPC_META_IMAGE_ASYNC(self->_priv->image), self->_priv->image_url, self->size,
                    ((cfg_get_single_value_as_int_with_default(config, "metaimage", "addcase",TRUE) && self->image_type == META_ALBUM_ART))?
                    GMPC_MODIFICATION_TYPE_CASING:GMPC_MODIFICATION_TYPE_BORDER
                    
                    );
            if(self->squared) {
                gtk_widget_set_size_request(GTK_WIDGET(self), self->size, self->size);
            }
           
            return;
		}}
#line 1400 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 675 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_set_is_visible (GmpcMetaImage * self, gboolean is_visible)
{
#line 1407 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::set_is_visible"
#line 675 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 675 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1413 "gmpc-metaimage.c"
{
#line 678 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
			self->is_visible = is_visible;
			if(self->is_visible)
			{
				if(self->connection)
				{
					self_update_cover(self,self->connection, MPD_CST_STATE, NULL);
				}
			} else {
				gtk_widget_hide(GTK_WIDGET(self));
			}
		}}
#line 1428 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 691 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_query_refetch (GmpcMetaImage * self)
{
#line 1435 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::query_refetch"
#line 691 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 691 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1441 "gmpc-metaimage.c"
{
#line 694 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
		if(self->_priv->song)
		{
			MetaDataResult ret;
			MetaData *met = NULL;

			ret = gmpc_meta_watcher_get_meta_path(gmw,self->_priv->song, self->image_type|META_QUERY_NO_CACHE, &met);
			if(ret == META_DATA_FETCHING)
			{
				self_set_cover_fetching(self);
			}else if (ret == META_DATA_AVAILABLE) {
				if(met->content_type == META_DATA_CONTENT_URI)
				{
					const gchar *path = meta_data_get_uri(met);
					self_set_cover_from_path(self,path); 
				}else{
					g_log(LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Not implemented");
					self_set_cover_na(self);
				}
			} else {
				self_set_cover_na(self);
			}
			if(met)
			{
				meta_data_free(met);
			}
		}
	}}
#line 1472 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 723 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_menu_populate_client (GmpcMetaImage * self, GtkMenu * menu)
{
#line 1479 "gmpc-metaimage.c"
	GValue ___param_values[2];
	GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 723 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 723 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1490 "gmpc-metaimage.c"

	___param_values[0].g_type = 0;
	g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
	g_value_set_instance (&___param_values[0], (gpointer) self);

	___param_values[1].g_type = 0;
	g_value_init (&___param_values[1], G_TYPE_POINTER);
	g_value_set_pointer (&___param_values[1], (gpointer ) menu);

	g_signal_emitv (___param_values,
		object_signals[MENU_POPULATE_CLIENT_SIGNAL],
		0 /* detail */,
		&___return_val);

	g_value_unset (&___param_values[0]);
	g_value_unset (&___param_values[1]);
}

#line 729 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static gboolean 
gmpc_metaimage_menu_populate_callback (GmpcMetaImage * self, GdkEventButton * event, gpointer data)
{
#line 1513 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::menu_populate_callback"
#line 729 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_val_if_fail (self != NULL, (gboolean )0);
#line 729 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_val_if_fail (GMPC_IS_METAIMAGE (self), (gboolean )0);
#line 1519 "gmpc-metaimage.c"
{
#line 732 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
		if(self->_priv->song && event->button == 3)
		{
			GtkWidget *menu = gtk_menu_new();
			GtkWidget *item = NULL; 

            self_menu_populate_client(self,GTK_MENU(menu));

			item = gtk_image_menu_item_new_with_label(_("Refetch"));
			gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), gtk_image_new_from_stock(GTK_STOCK_REFRESH, GTK_ICON_SIZE_MENU));
			g_signal_connect_swapped(G_OBJECT(item), "activate", G_CALLBACK(self_query_refetch),self);
			gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);

			item = gtk_image_menu_item_new_with_label(_("Select file"));
			gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU));
			g_signal_connect_swapped(G_OBJECT(item), "activate", G_CALLBACK(self_select_file),self);
			gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);

			item = gtk_image_menu_item_new_from_stock(GTK_STOCK_CLEAR, NULL);
			g_signal_connect_swapped(G_OBJECT(item), "activate", G_CALLBACK(self_clear_entry),self);
			gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);

			item = gtk_image_menu_item_new_with_label(_("Metadata selector"));
			gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), gtk_image_new_from_stock(GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU));
			g_signal_connect_swapped(G_OBJECT(item), "activate", G_CALLBACK(self_select_metadata_editor),self);
			gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);

			gtk_widget_show_all(menu);
			gtk_menu_popup(GTK_MENU(menu), NULL, NULL,NULL, NULL, event->button, event->time);
			return TRUE;
		}
		return FALSE;
	}}
#line 1555 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 766 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void 
gmpc_metaimage_clear_entry (GmpcMetaImage * self)
{
#line 1562 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::clear_entry"
#line 766 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 766 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1568 "gmpc-metaimage.c"
{
#line 769 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
        MetaData *met = meta_data_new();
        met->content_type = META_DATA_CONTENT_EMPTY;
        met->plugin_name = "User set";
        met->type = self->image_type;
		meta_data_set_cache(self->_priv->song, META_DATA_UNAVAILABLE, met); 
		gmpc_meta_watcher_data_changed(gmw, self->_priv->song, self->image_type, META_DATA_UNAVAILABLE, NULL);
        meta_data_free(met);
	}}
#line 1580 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 779 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
static void 
gmpc_metaimage_select_metadata_editor (GmpcMetaImage * self)
{
#line 1587 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::select_metadata_editor"
#line 779 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 779 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1593 "gmpc-metaimage.c"
{
#line 781 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
		gmpc_meta_data_edit_window_new(self->_priv->song,self->image_type);
    }}
#line 1599 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 785 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_select_file (GmpcMetaImage * self)
{
#line 1606 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::select_file"
#line 785 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 785 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1612 "gmpc-metaimage.c"
{
#line 788 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
        gchar *p;
		mpd_Song *song = mpd_songDup(self->_priv->song);
		MetaDataType type = self->image_type;
		GtkFileFilter *gff = gtk_file_filter_new();
		GtkWidget *fcd = gtk_file_chooser_dialog_new(_("Select File"),NULL,
					 GTK_FILE_CHOOSER_ACTION_OPEN,
				      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
				      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
				      NULL);
		gtk_file_filter_set_name(gff, _("Images"));
		gtk_file_filter_add_pixbuf_formats(gff);
		gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fcd), gff);   

		gff = gtk_file_filter_new();
		gtk_file_filter_set_name(gff, _("All"));
		gtk_file_filter_add_pattern(gff, "*");
		gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fcd), gff);   

		gtk_widget_show_all(fcd);
             
        p = cfg_get_single_value_as_string(config, "MetaData", "image-file-chooser"); 
        if(p) {
            gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(fcd), p);
            g_free(p);
        }
        switch(gtk_dialog_run(GTK_DIALOG(fcd)))
		{
			case GTK_RESPONSE_ACCEPT:
				{	
					gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fcd));
                    MetaData *met = meta_data_new();
                    met->type = type;
                    met->plugin_name = "User set";
                    met->content_type = META_DATA_CONTENT_URI;
                    met->content = filename;
                    met->size = -1;
					meta_data_set_cache(song,META_DATA_AVAILABLE, met); 
					gmpc_meta_watcher_data_changed(gmw, song, type, META_DATA_AVAILABLE, met);
                    cfg_set_single_value_as_string(config, "MetaData", "image-file-chooser", filename); 
                    meta_data_free(met);

				}
			default:
				break;
		} 
		gtk_widget_destroy(fcd);
		mpd_freeSong(song);
	}}
#line 1664 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__

#line 838 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
void 
gmpc_metaimage_reload_image (GmpcMetaImage * self)
{
#line 1671 "gmpc-metaimage.c"
#define __GOB_FUNCTION__ "Gmpc:MetaImage::reload_image"
#line 838 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (self != NULL);
#line 838 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	g_return_if_fail (GMPC_IS_METAIMAGE (self));
#line 1677 "gmpc-metaimage.c"
{
#line 841 "/usr/src/extras/gmpc/gmpc-11.8.16-2.i686/src/gmpc-11.8.16/src/gmpc-metaimage.gob"
	
		//gmpc_meta_image_async_clear(GMPC_META_IMAGE_ASYNC(self->_priv->image)); 
        gmpc_meta_image_async_clear_now(GMPC_META_IMAGE_ASYNC(self->_priv->image));
        switch(self->_priv->state)
		{
			case STATE_NA:
                    self->_priv->state = STATE_EMPTY;
					self_set_cover_na(self);
					break;
			case STATE_FETCHING:
                    self->_priv->state = STATE_EMPTY;
					self_set_cover_fetching(self);
					break;
			case STATE_IMAGE:
                    if(self->_priv->image_url)
                    {
                        gchar *temp = self->_priv->image_url;
                        self->_priv->image_url = NULL;

                        self_set_cover_from_path(self, temp);
                        g_free(temp);
                    }
            /* fix bitching */
            case STATE_EMPTY:
            case NUM_STATES:
			default:
					break;
		}
	}}
#line 1709 "gmpc-metaimage.c"
#undef __GOB_FUNCTION__
