/* 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-meta-text-view.h"

#include "gmpc-meta-text-view-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 */
/* self casting macros */
#define SELF(x) GMPC_META_TEXT_VIEW(x)
#define SELF_CONST(x) GMPC_META_TEXT_VIEW_CONST(x)
#define IS_SELF(x) GMPC_IS_META_TEXT_VIEW(x)
#define TYPE_SELF GMPC_TYPE_META_TEXT_VIEW
#define SELF_CLASS(x) GMPC_META_TEXT_VIEW_CLASS(x)

#define SELF_GET_CLASS(x) GMPC_META_TEXT_VIEW_GET_CLASS(x)

/* self typedefs */
typedef GmpcMetaTextView Self;
typedef GmpcMetaTextViewClass SelfClass;

/* here are local prototypes */
static void gmpc_meta_text_view_class_init (GmpcMetaTextViewClass * c) G_GNUC_UNUSED;
#line 48 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static gboolean gmpc_meta_text_view_key_press_event (GmpcMetaTextView * self, GdkEventKey * key, gpointer user_data) G_GNUC_UNUSED;
#line 42 "gmpc-meta-text-view.c"
#line 61 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void gmpc_meta_text_view_init (GmpcMetaTextView * self) G_GNUC_UNUSED;
#line 45 "gmpc-meta-text-view.c"
#line 88 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void gmpc_meta_text_view_menu_populate_callback (GmpcMetaTextView * self, GtkMenu * menu, gpointer data) G_GNUC_UNUSED;
#line 48 "gmpc-meta-text-view.c"
#line 121 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void gmpc_meta_text_view_select_metadata_editor (GmpcMetaTextView * self) G_GNUC_UNUSED;
#line 51 "gmpc-meta-text-view.c"
#line 179 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void gmpc_meta_text_view_cancel_button_clicked (GmpcMetaTextView * self, GtkWidget * button) G_GNUC_UNUSED;
#line 54 "gmpc-meta-text-view.c"
#line 193 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void gmpc_meta_text_view_edit_button_clicked (GmpcMetaTextView * self, GtkWidget * button) G_GNUC_UNUSED;
#line 57 "gmpc-meta-text-view.c"
#line 229 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void gmpc_meta_text_view_set_text (GmpcMetaTextView * self, const gchar * text, gsize length, int ro) G_GNUC_UNUSED;
#line 60 "gmpc-meta-text-view.c"
static void ___real_gmpc_meta_text_view_set_text_from_path (GmpcMetaTextView * self, const gchar * path);
#line 313 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void gmpc_meta_text_view_set_text_from_metadata (GmpcMetaTextView * self, MetaData * met) G_GNUC_UNUSED;
#line 64 "gmpc-meta-text-view.c"
static void ___real_gmpc_meta_text_view_set_text_fetching (GmpcMetaTextView * self);
static void ___real_gmpc_meta_text_view_set_text_na (GmpcMetaTextView * self);
#line 373 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void gmpc_meta_text_view_meta_callback (GmpcMetaWatcher * mw, mpd_Song * song, MetaDataType type, MetaDataResult ret, MetaData * met, gpointer data) G_GNUC_UNUSED;
#line 69 "gmpc-meta-text-view.c"
#line 396 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void ___10_gmpc_meta_text_view_finalize (GObject * obj) G_GNUC_UNUSED;
#line 72 "gmpc-meta-text-view.c"
#line 403 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void ___11_gmpc_meta_text_view_dispose (GObject * obj) G_GNUC_UNUSED;
#line 75 "gmpc-meta-text-view.c"

/*
 * Signal connection wrapper macro shortcuts
 */
#define self_connect__set_text_from_path(object,func,data)	gmpc_meta_text_view_connect__set_text_from_path((object),(func),(data))
#define self_connect_after__set_text_from_path(object,func,data)	gmpc_meta_text_view_connect_after__set_text_from_path((object),(func),(data))
#define self_connect_data__set_text_from_path(object,func,data,destroy_data,flags)	gmpc_meta_text_view_connect_data__set_text_from_path((object),(func),(data),(destroy_data),(flags))
#define self_connect__set_text_fetching(object,func,data)	gmpc_meta_text_view_connect__set_text_fetching((object),(func),(data))
#define self_connect_after__set_text_fetching(object,func,data)	gmpc_meta_text_view_connect_after__set_text_fetching((object),(func),(data))
#define self_connect_data__set_text_fetching(object,func,data,destroy_data,flags)	gmpc_meta_text_view_connect_data__set_text_fetching((object),(func),(data),(destroy_data),(flags))
#define self_connect__set_text_na(object,func,data)	gmpc_meta_text_view_connect__set_text_na((object),(func),(data))
#define self_connect_after__set_text_na(object,func,data)	gmpc_meta_text_view_connect_after__set_text_na((object),(func),(data))
#define self_connect_data__set_text_na(object,func,data,destroy_data,flags)	gmpc_meta_text_view_connect_data__set_text_na((object),(func),(data),(destroy_data),(flags))

typedef void  (*___Sig1) (GmpcMetaTextView *, gchar *, 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 ((GmpcMetaTextView *)data1,
		(gchar *) g_value_get_string (param_values + 1),
		data2);
}


enum {
	SET_TEXT_FROM_PATH_SIGNAL,
	SET_TEXT_FETCHING_SIGNAL,
	SET_TEXT_NA_SIGNAL,
	LAST_SIGNAL
};

static guint object_signals[LAST_SIGNAL] = {0};

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

/* Short form macros */
#define self_key_press_event gmpc_meta_text_view_key_press_event
#define self_new gmpc_meta_text_view_new
#define self_menu_populate_callback gmpc_meta_text_view_menu_populate_callback
#define self_select_metadata_editor gmpc_meta_text_view_select_metadata_editor
#define self_query_refetch gmpc_meta_text_view_query_refetch
#define self_query_text_from_song gmpc_meta_text_view_query_text_from_song
#define self_cancel_button_clicked gmpc_meta_text_view_cancel_button_clicked
#define self_edit_button_clicked gmpc_meta_text_view_edit_button_clicked
#define self_set_text gmpc_meta_text_view_set_text
#define self_set_text_from_path gmpc_meta_text_view_set_text_from_path
#define self_set_text_from_metadata gmpc_meta_text_view_set_text_from_metadata
#define self_set_text_fetching gmpc_meta_text_view_set_text_fetching
#define self_set_text_na gmpc_meta_text_view_set_text_na
#define self_meta_callback gmpc_meta_text_view_meta_callback
#define self_clear_entry gmpc_meta_text_view_clear_entry
#define self_select_file gmpc_meta_text_view_select_file
GType
gmpc_meta_text_view_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (GmpcMetaTextViewClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) gmpc_meta_text_view_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (GmpcMetaTextView),
			0 /* n_preallocs */,
			(GInstanceInitFunc) gmpc_meta_text_view_init,
			NULL
		};

		type = g_type_register_static (GTK_TYPE_TEXT_VIEW, "GmpcMetaTextView", &info, (GTypeFlags)0);
	}

	return type;
}

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

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


static void
___dispose (GObject *obj_self)
{
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::dispose"
	GmpcMetaTextView *self G_GNUC_UNUSED = GMPC_META_TEXT_VIEW (obj_self);
#line 36 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	if(self->_priv->buffer) { g_object_unref ((gpointer) self->_priv->buffer); self->_priv->buffer = NULL; }
#line 201 "gmpc-meta-text-view.c"
#line 403 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	___11_gmpc_meta_text_view_dispose(obj_self);
#line 204 "gmpc-meta-text-view.c"
}
#undef __GOB_FUNCTION__


static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::finalize"
	GmpcMetaTextView *self G_GNUC_UNUSED = GMPC_META_TEXT_VIEW (obj_self);
	gpointer priv G_GNUC_UNUSED = self->_priv;
#line 37 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	if(self->_priv->song) { mpd_freeSong ((gpointer) self->_priv->song); self->_priv->song = NULL; }
#line 217 "gmpc-meta-text-view.c"
#line 42 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	if(self->_priv->met) { meta_data_free ((gpointer) self->_priv->met); self->_priv->met = NULL; }
#line 220 "gmpc-meta-text-view.c"
#line 396 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	___10_gmpc_meta_text_view_finalize(obj_self);
#line 223 "gmpc-meta-text-view.c"
}
#undef __GOB_FUNCTION__

static void 
gmpc_meta_text_view_class_init (GmpcMetaTextViewClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::class_init"
	GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;

	g_type_class_add_private(c,sizeof(GmpcMetaTextViewPrivate));

	parent_class = g_type_class_ref (GTK_TYPE_TEXT_VIEW);

	object_signals[SET_TEXT_FROM_PATH_SIGNAL] =
		g_signal_new ("set_text_from_path",
			G_TYPE_FROM_CLASS (g_object_class),
			(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
			G_STRUCT_OFFSET (GmpcMetaTextViewClass, set_text_from_path),
			NULL, NULL,
			___marshal_Sig1,
			G_TYPE_NONE, 1,
			G_TYPE_STRING);
	if ___GOB_UNLIKELY(sizeof(const gchar * ) != sizeof(gchar *) || parent_class == NULL /* avoid warning */) {
		g_error("/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob line 280: Type mismatch of \"set_text_from_path\" signal signature");
	}
	object_signals[SET_TEXT_FETCHING_SIGNAL] =
		g_signal_new ("set_text_fetching",
			G_TYPE_FROM_CLASS (g_object_class),
			(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
			G_STRUCT_OFFSET (GmpcMetaTextViewClass, set_text_fetching),
			NULL, NULL,
			g_cclosure_marshal_VOID__VOID,
			G_TYPE_NONE, 0);
	object_signals[SET_TEXT_NA_SIGNAL] =
		g_signal_new ("set_text_na",
			G_TYPE_FROM_CLASS (g_object_class),
			(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
			G_STRUCT_OFFSET (GmpcMetaTextViewClass, set_text_na),
			NULL, NULL,
			g_cclosure_marshal_VOID__VOID,
			G_TYPE_NONE, 0);

#line 280 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	c->set_text_from_path = ___real_gmpc_meta_text_view_set_text_from_path;
#line 339 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	c->set_text_fetching = ___real_gmpc_meta_text_view_set_text_fetching;
#line 363 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	c->set_text_na = ___real_gmpc_meta_text_view_set_text_na;
#line 396 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_object_class->finalize = ___finalize;
#line 403 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_object_class->dispose = ___dispose;
#line 276 "gmpc-meta-text-view.c"
}
#undef __GOB_FUNCTION__
#line 61 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
gmpc_meta_text_view_init (GmpcMetaTextView * self G_GNUC_UNUSED)
{
#line 283 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::init"
	self->_priv = G_TYPE_INSTANCE_GET_PRIVATE(self,GMPC_TYPE_META_TEXT_VIEW,GmpcMetaTextViewPrivate);
#line 36 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->_priv->buffer = gtk_text_buffer_new(NULL);
#line 288 "gmpc-meta-text-view.c"
#line 37 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->_priv->song = NULL;
#line 291 "gmpc-meta-text-view.c"
#line 38 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->_priv->type = META_ARTIST_TXT;
#line 294 "gmpc-meta-text-view.c"
#line 39 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->_priv->meta_id = 0;
#line 297 "gmpc-meta-text-view.c"
#line 40 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->_priv->edit = NULL;
#line 300 "gmpc-meta-text-view.c"
#line 41 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->_priv->cancel = NULL;
#line 303 "gmpc-meta-text-view.c"
#line 42 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->_priv->met = NULL;
#line 306 "gmpc-meta-text-view.c"
#line 44 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->force_ro = FALSE;
#line 309 "gmpc-meta-text-view.c"
#line 45 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	self->use_monospace = FALSE;
#line 312 "gmpc-meta-text-view.c"
 {
#line 62 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"

		gtk_text_view_set_buffer(GTK_TEXT_VIEW(self), self->_priv->buffer);
		gtk_text_view_set_editable(GTK_TEXT_VIEW(self), FALSE);
		gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(self), GTK_WRAP_WORD);
        g_signal_connect(G_OBJECT(self), "key-press-event", G_CALLBACK(self_key_press_event), NULL);

		g_signal_connect(G_OBJECT(self), "populate-popup", G_CALLBACK(self_menu_populate_callback), NULL);
		self->_priv->meta_id= g_signal_connect(G_OBJECT(gmw), "data-changed", G_CALLBACK(self_meta_callback), self);
	
#line 324 "gmpc-meta-text-view.c"
 }
}
#undef __GOB_FUNCTION__


#line 48 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static gboolean 
gmpc_meta_text_view_key_press_event (GmpcMetaTextView * self, GdkEventKey * key, gpointer user_data)
{
#line 334 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::key_press_event"
#line 48 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_val_if_fail (self != NULL, (gboolean )0);
#line 48 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_val_if_fail (GMPC_IS_META_TEXT_VIEW (self), (gboolean )0);
#line 340 "gmpc-meta-text-view.c"
{
#line 50 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        if(key->keyval == GDK_Escape)
        {
            if(self->_priv->cancel){
                gtk_widget_activate(self->_priv->cancel);
            }
            return FALSE;
        }
        return FALSE;
    }}
#line 353 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__


#line 72 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
GmpcMetaTextView * 
gmpc_meta_text_view_new (int type)
{
#line 361 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::new"
{
#line 74 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
		Self *gmi =  GET_NEW;
		gmi->_priv->type = type;
        gtk_text_buffer_create_tag (gmi->_priv->buffer, "not_editable",
                "editable", FALSE, 
                NULL);

        gtk_text_buffer_create_tag (gmi->_priv->buffer, "monospace",
                "family", "Monospace",
                "family-set", TRUE,
                NULL);
		return gmi;
	}}
#line 378 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 88 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
gmpc_meta_text_view_menu_populate_callback (GmpcMetaTextView * self, GtkMenu * menu, gpointer data)
{
#line 385 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::menu_populate_callback"
#line 88 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 88 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 391 "gmpc-meta-text-view.c"
{
#line 91 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
		if(self->_priv->song)
		{
			GtkWidget *item = gtk_separator_menu_item_new();
			gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);


			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(GTK_WIDGET(menu));
		}
	}}
#line 423 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 121 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
gmpc_meta_text_view_select_metadata_editor (GmpcMetaTextView * self)
{
#line 430 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::select_metadata_editor"
#line 121 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 121 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 436 "gmpc-meta-text-view.c"
{
#line 123 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
		gmpc_meta_data_edit_window_new(self->_priv->song,self->_priv->type);
    }}
#line 442 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 127 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
void 
gmpc_meta_text_view_query_refetch (GmpcMetaTextView * self)
{
#line 449 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::query_refetch"
#line 127 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 127 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 455 "gmpc-meta-text-view.c"
{
#line 130 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
		if(self->_priv->song)
		{
			MetaData *met= NULL;
			MetaDataResult ret;
			ret = gmpc_meta_watcher_get_meta_path(gmw,self->_priv->song, self->_priv->type|META_QUERY_NO_CACHE, &met);
			if(ret == META_DATA_FETCHING) {
				self_set_text_fetching(self);
			}else if (ret == META_DATA_AVAILABLE) {
                self_set_text_from_metadata(self, met);
            } else {
				self_set_text_na(self);
			}
			if(met)
			{
				meta_data_free(met);
			}
		}
	}}
#line 477 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 150 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
void 
gmpc_meta_text_view_query_text_from_song (GmpcMetaTextView * self, mpd_Song * song)
{
#line 484 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::query_text_from_song"
#line 150 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 150 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 490 "gmpc-meta-text-view.c"
{
#line 153 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        MetaData *met = NULL;
        MetaDataResult ret;

        if(self->_priv->song)
        {
            mpd_freeSong(self->_priv->song);
        }
        self->_priv->song = mpd_songDup(song);


        ret = gmpc_meta_watcher_get_meta_path(gmw,self->_priv->song, self->_priv->type, &met);
        if(ret == META_DATA_FETCHING)
        {
            self_set_text_fetching(self);
        }else if (ret == META_DATA_AVAILABLE) {
            self_set_text_from_metadata(self,met); 
        } else {
            self_set_text_na(self);
        }
        if(met)
        {
            meta_data_free(met);
        }
    }}
#line 518 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 179 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
gmpc_meta_text_view_cancel_button_clicked (GmpcMetaTextView * self, GtkWidget * button)
{
#line 525 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::cancel_button_clicked"
#line 179 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 179 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 531 "gmpc-meta-text-view.c"
{
#line 181 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        gtk_text_view_set_editable(GTK_TEXT_VIEW(self), FALSE);
        if(self->_priv->met)
        {
            MetaData *met = self->_priv->met;
            self->_priv->met = NULL;
            /* Create a copy as self_set_from_path modifies self->_priv->path */
            self_set_text_from_metadata(self, met);
            meta_data_free(met);
        }else self_set_text_na(self);
    }}
#line 545 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 193 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
gmpc_meta_text_view_edit_button_clicked (GmpcMetaTextView * self, GtkWidget * button)
{
#line 552 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::edit_button_clicked"
#line 193 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 193 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 558 "gmpc-meta-text-view.c"
{
#line 195 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        if(gtk_text_view_get_editable(GTK_TEXT_VIEW(self)))
        {
            MetaData *met;
            gchar *content = NULL;
            GtkTextIter iter_start, iter_end;

            /* Get start and end of text, and store it */
            gtk_text_buffer_get_start_iter(self->_priv->buffer, &iter_start);
            gtk_text_buffer_get_end_iter(self->_priv->buffer, &iter_end);
            content = gtk_text_buffer_get_text(self->_priv->buffer, &iter_start, &iter_end, FALSE);
            gtk_text_view_set_editable(GTK_TEXT_VIEW(self), FALSE);

            /* Copy path, because signal callback my destroy path first */
            met = meta_data_new();
            met->plugin_name = "User set";
            met->type = self->_priv->type;
            if(content){
                met->content_type = META_DATA_CONTENT_TEXT;
                met->content = g_strstrip(content);met->size = -1;
            }else {
                met->content_type = META_DATA_CONTENT_EMPTY;
            }
            meta_data_set_cache(self->_priv->song, META_DATA_AVAILABLE, met); 
            gmpc_meta_watcher_data_changed(gmw, self->_priv->song, self->_priv->type, META_DATA_AVAILABLE, met);
            meta_data_free(met);

        }else{
            gtk_widget_show(self->_priv->cancel);
            gtk_text_view_set_editable(GTK_TEXT_VIEW(self), TRUE);
            gtk_button_set_label(GTK_BUTTON(button), GTK_STOCK_SAVE);
        }

    }}
#line 595 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 229 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
gmpc_meta_text_view_set_text (GmpcMetaTextView * self, const gchar * text, gsize length, int ro)
{
#line 602 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::set_text"
#line 229 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 229 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 608 "gmpc-meta-text-view.c"
{
#line 232 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        GtkTextIter iter;
        GtkTextIter end_iter;
        gtk_text_buffer_set_text(self->_priv->buffer, text, length);

        gtk_text_buffer_get_start_iter(self->_priv->buffer, &iter);
        gtk_text_buffer_get_end_iter(self->_priv->buffer, &end_iter);
        if(self->use_monospace) {
            gtk_text_buffer_apply_tag_by_name(self->_priv->buffer, "monospace",&iter, &end_iter);
        }
        if(!ro && !self->force_ro)
        {
            GtkTextChildAnchor *anch;
            self->_priv->edit = gtk_button_new_from_stock(GTK_STOCK_EDIT); 
            self->_priv->cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL); 

            gtk_text_view_set_editable(GTK_TEXT_VIEW(self), FALSE);
            gtk_widget_set_no_show_all(self->_priv->cancel, TRUE);
            /* Add 2 empty lines at the end, and make it non-editable */
            gtk_text_buffer_get_end_iter(self->_priv->buffer, &end_iter);
            gtk_text_buffer_insert_with_tags_by_name(self->_priv->buffer, &end_iter, "\n\n", -1,"not_editable", NULL);

            /* Add edit widget */
            anch = gtk_text_buffer_create_child_anchor(self->_priv->buffer, &end_iter);
            gtk_text_buffer_get_iter_at_child_anchor(self->_priv->buffer, &iter,anch);
            /* Make widget non-editable */
            gtk_text_buffer_apply_tag_by_name(self->_priv->buffer, "not_editable",&iter, &end_iter);
            /* attach widget to anchor */
            gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(self), self->_priv->edit, anch);

            /* Add edit widget */
            gtk_text_buffer_get_end_iter(self->_priv->buffer, &end_iter);
            anch = gtk_text_buffer_create_child_anchor(self->_priv->buffer, &end_iter);
            gtk_text_buffer_get_iter_at_child_anchor(self->_priv->buffer, &iter,anch);
            /* Make widget non-editable */
            gtk_text_buffer_apply_tag_by_name(self->_priv->buffer, "not_editable",&iter, &end_iter);
            /* attach widget to anchor */
            gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(self), self->_priv->cancel, anch);

            /* show button */
            gtk_widget_show(self->_priv->edit);
            g_signal_connect_swapped(self->_priv->edit, "clicked",G_CALLBACK(self_edit_button_clicked), self);
            g_signal_connect_swapped(self->_priv->cancel, "clicked",G_CALLBACK(self_cancel_button_clicked), self);
        }
        gtk_text_buffer_get_start_iter(self->_priv->buffer, &iter);
        gtk_text_buffer_place_cursor(self->_priv->buffer, &iter);
    }}
#line 658 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 280 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
void 
gmpc_meta_text_view_set_text_from_path (GmpcMetaTextView * self, const gchar * path)
{
#line 665 "gmpc-meta-text-view.c"
	GValue ___param_values[2];
	GValue ___return_val;

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

#line 280 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 280 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 676 "gmpc-meta-text-view.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_STRING);
	g_value_set_static_string (&___param_values[1], (gchar *) path);

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

	g_value_unset (&___param_values[0]);
	g_value_unset (&___param_values[1]);
}
#line 280 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
___real_gmpc_meta_text_view_set_text_from_path (GmpcMetaTextView * self G_GNUC_UNUSED, const gchar * path)
{
#line 698 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::set_text_from_path"
{
#line 283 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
		gchar *content=NULL;
		gsize size = 0;
		if(g_file_get_contents (path,&content,&size,NULL))
		{
			gchar *new_data = NULL;
			gsize new_size = 0;
			if(g_utf8_validate(content, size, NULL))
			{
                self_set_text(self, content, size, FALSE);
			}
			else
			{
				new_data = g_locale_to_utf8(content, size, NULL, &new_size, NULL);
				if(new_data)
				{
                    self_set_text(self, new_data, new_size,FALSE);
					g_free(new_data);
				}
				else
				{
					new_data = g_strdup_printf("%s: '%s' %s", _("Failed to open file:"), path,_("because of encoding issues"));
                    self_set_text(self, new_data, -1,TRUE);
					g_free(new_data);
				}
			}
			g_free(content);
		}
	}}
#line 731 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 313 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
gmpc_meta_text_view_set_text_from_metadata (GmpcMetaTextView * self, MetaData * met)
{
#line 738 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::set_text_from_metadata"
#line 313 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 313 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 744 "gmpc-meta-text-view.c"
{
#line 316 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        if(met->content_type == META_DATA_CONTENT_URI) {
            const gchar *path = meta_data_get_uri(met);
            self_set_text_from_path(self, path);
        }else if(met->content_type == META_DATA_CONTENT_TEXT) {
            const gchar *text = meta_data_get_text(met);
            self_set_text(self,text, -1, FALSE); 
        }else if (met->content_type == META_DATA_CONTENT_HTML) {
            /* TODO: make utf-8 compatible */
            gchar *text = meta_data_get_text_from_html(met);
            if(text)
            {
                /* Get byte length */
                self_set_text(self,text, -1, FALSE); 
                g_free(text);
            }else{
                self_set_text_na(self);
            }
        }
        if(self->_priv->met) meta_data_free(self->_priv->met);
        self->_priv->met = meta_data_dup(met);
    }}
#line 769 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 339 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
void 
gmpc_meta_text_view_set_text_fetching (GmpcMetaTextView * self)
{
#line 776 "gmpc-meta-text-view.c"
	GValue ___param_values[1];
	GValue ___return_val;

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

#line 339 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 339 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 787 "gmpc-meta-text-view.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);

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

	g_value_unset (&___param_values[0]);
}
#line 339 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
___real_gmpc_meta_text_view_set_text_fetching (GmpcMetaTextView * self G_GNUC_UNUSED)
{
#line 804 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::set_text_fetching"
{
#line 342 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        if(self->_priv->met) meta_data_free(self->_priv->met);
        self->_priv->met = NULL;
		if(self->_priv->type == META_SONG_TXT)
		{
            self_set_text(self, _("Fetching Lyrics"), -1,TRUE);
		}
		else if (self->_priv->type == META_ARTIST_TXT)
		{
            self_set_text(self, _("Fetching Artist Info"), -1,TRUE);
		}
        else if (self->_priv->type == META_SONG_GUITAR_TAB)
        {
            self_set_text(self, _("Fetching Guitar tab"), -1,TRUE);
        }
		else
		{
            self_set_text(self, _("Fetching Album Info"), -1,TRUE);
		}
	}}
#line 828 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 363 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
void 
gmpc_meta_text_view_set_text_na (GmpcMetaTextView * self)
{
#line 835 "gmpc-meta-text-view.c"
	GValue ___param_values[1];
	GValue ___return_val;

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

#line 363 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 363 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 846 "gmpc-meta-text-view.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);

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

	g_value_unset (&___param_values[0]);
}
#line 363 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
___real_gmpc_meta_text_view_set_text_na (GmpcMetaTextView * self G_GNUC_UNUSED)
{
#line 863 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::set_text_na"
{
#line 366 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        if(self->_priv->met) meta_data_free(self->_priv->met);
        self->_priv->met = NULL;

        self_set_text(self, _("Not Available"), -1,FALSE);
	}}
#line 873 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 373 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
gmpc_meta_text_view_meta_callback (GmpcMetaWatcher * mw, mpd_Song * song, MetaDataType type, MetaDataResult ret, MetaData * met, gpointer data)
{
#line 880 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::meta_callback"
{
#line 376 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
		Self *self = data;
		/**
		 * Check for fields
		 */
		if(self->_priv->type != type)
			return;

		if(!gmpc_meta_watcher_match_data(self->_priv->type, self->_priv->song, song))
		{
			return;
		}
		if(ret == META_DATA_AVAILABLE) {
            self_set_text_from_metadata(self,met); 
        } else if (ret == META_DATA_FETCHING) {
			self_set_text_fetching(self);
		} else {
			self_set_text_na(self);
		}
	}}
#line 904 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 396 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
___10_gmpc_meta_text_view_finalize (GObject * obj G_GNUC_UNUSED)
#line 910 "gmpc-meta-text-view.c"
#define PARENT_HANDLER(___obj) \
	{ if(G_OBJECT_CLASS(parent_class)->finalize) \
		(* G_OBJECT_CLASS(parent_class)->finalize)(___obj); }
{
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::finalize"
{
#line 399 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	

		PARENT_HANDLER(obj);
	}}
#line 922 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 403 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
static void 
___11_gmpc_meta_text_view_dispose (GObject * obj G_GNUC_UNUSED)
#line 929 "gmpc-meta-text-view.c"
#define PARENT_HANDLER(___obj) \
	{ if(G_OBJECT_CLASS(parent_class)->dispose) \
		(* G_OBJECT_CLASS(parent_class)->dispose)(___obj); }
{
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::dispose"
{
#line 406 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
		Self *self = GMPC_META_TEXT_VIEW(obj); 
		if(self->_priv->meta_id)
		{
			g_signal_handler_disconnect(G_OBJECT(gmw),self->_priv->meta_id);
			self->_priv->meta_id =  0;
		}

		PARENT_HANDLER(obj);
	}}
#line 947 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 416 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
void 
gmpc_meta_text_view_clear_entry (GmpcMetaTextView * self)
{
#line 955 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::clear_entry"
#line 416 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 416 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 961 "gmpc-meta-text-view.c"
{
#line 419 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        MetaData *met = meta_data_new();
        met->type = self->_priv->type;
        met->plugin_name = "User set";
        met->content_type = META_DATA_CONTENT_EMPTY;
		meta_data_set_cache(self->_priv->song, META_DATA_UNAVAILABLE, met); 
		gmpc_meta_watcher_data_changed(gmw, self->_priv->song, self->_priv->type, META_DATA_UNAVAILABLE, NULL);
        meta_data_free(met);
	}}
#line 973 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__

#line 428 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
void 
gmpc_meta_text_view_select_file (GmpcMetaTextView * self)
{
#line 980 "gmpc-meta-text-view.c"
#define __GOB_FUNCTION__ "Gmpc:Meta:Text:View::select_file"
#line 428 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (self != NULL);
#line 428 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	g_return_if_fail (GMPC_IS_META_TEXT_VIEW (self));
#line 986 "gmpc-meta-text-view.c"
{
#line 431 "/usr/src/ports/gmpc/gmpc-11.8.16-3.i686/src/gmpc-11.8.16/src/gmpc-meta-text-view.gob"
	
        gchar *p;
		mpd_Song *song = mpd_songDup(self->_priv->song);
		MetaDataType type = self->_priv->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, _("Text Document"));
		gtk_file_filter_add_mime_type(gff, "text/plain");
		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);   

        p = cfg_get_single_value_as_string(config, "MetaData", "text-file-chooser"); 
        if(p) {
            gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(fcd), p);
            g_free(p);
        }
		gtk_widget_show_all(fcd);
		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); 
                    cfg_set_single_value_as_string(config, "MetaData", "text-file-chooser", filename); 
					gmpc_meta_watcher_data_changed(gmw, song, type, META_DATA_AVAILABLE, met);

                    meta_data_free(met);
                }
            default:
				break;
		} 
		gtk_widget_destroy(fcd);
		mpd_freeSong(song);

	}}
#line 1036 "gmpc-meta-text-view.c"
#undef __GOB_FUNCTION__
