/* 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-mpddata-model-tagedit.h"

#include "gmpc-mpddata-model-tagedit-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 22 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"

#include <gmpc/gmpc-mpddata-model.h>

#line 30 "gmpc-mpddata-model-tagedit.c"

#line 26 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"

#include <config.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "tagedit.h"

#line 39 "gmpc-mpddata-model-tagedit.c"
/* self casting macros */
#define SELF(x) GMPC_MPDDATA_MODEL_TAGEDIT(x)
#define SELF_CONST(x) GMPC_MPDDATA_MODEL_TAGEDIT_CONST(x)
#define IS_SELF(x) GMPC_IS_MPDDATA_MODEL_TAGEDIT(x)
#define TYPE_SELF GMPC_TYPE_MPDDATA_MODEL_TAGEDIT
#define SELF_CLASS(x) GMPC_MPDDATA_MODEL_TAGEDIT_CLASS(x)

#define SELF_GET_CLASS(x) GMPC_MPDDATA_MODEL_TAGEDIT_GET_CLASS(x)

/* self typedefs */
typedef GmpcMpdDataModelTagedit Self;
typedef GmpcMpdDataModelTageditClass SelfClass;

/* here are local prototypes */
static void gmpc_mpddata_model_tagedit_init (GmpcMpdDataModelTagedit * o) G_GNUC_UNUSED;
static void gmpc_mpddata_model_tagedit_class_init (GmpcMpdDataModelTageditClass * c) G_GNUC_UNUSED;
#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
static void gmpc_mpddata_model_tagedit_get_value (GtkTreeModel * model, GtkTreeIter * iter, gint column, GValue * value) G_GNUC_UNUSED;
#line 58 "gmpc-mpddata-model-tagedit.c"

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

/* Short form macros */
#define self_new gmpc_mpddata_model_tagedit_new
#define self_get_value gmpc_mpddata_model_tagedit_get_value
#define self_revert_song gmpc_mpddata_model_tagedit_revert_song


static void
___Gtk_Tree_Model_init (GtkTreeModelIface *iface)
{
#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	iface->get_value = self_get_value;
#line 74 "gmpc-mpddata-model-tagedit.c"
}

GType
gmpc_mpddata_model_tagedit_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (GmpcMpdDataModelTageditClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) gmpc_mpddata_model_tagedit_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (GmpcMpdDataModelTagedit),
			0 /* n_preallocs */,
			(GInstanceInitFunc) gmpc_mpddata_model_tagedit_init,
			NULL
		};

		static const GInterfaceInfo Gtk_Tree_Model_info = {
			(GInterfaceInitFunc) ___Gtk_Tree_Model_init,
			NULL,
			NULL
		};

		type = g_type_register_static (GMPC_TYPE_MPDDATA_MODEL, "GmpcMpdDataModelTagedit", &info, (GTypeFlags)0);
		g_type_add_interface_static (type,
			GTK_TYPE_TREE_MODEL,
			&Gtk_Tree_Model_info);
	}

	return type;
}

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

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

static void 
gmpc_mpddata_model_tagedit_init (GmpcMpdDataModelTagedit * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "Gmpc:MpdData:Model:Tagedit::init"
}
#undef __GOB_FUNCTION__
static void 
gmpc_mpddata_model_tagedit_class_init (GmpcMpdDataModelTageditClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "Gmpc:MpdData:Model:Tagedit::class_init"

	parent_class = g_type_class_ref (GMPC_TYPE_MPDDATA_MODEL);

}
#undef __GOB_FUNCTION__



#line 41 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
GtkTreeModel * 
gmpc_mpddata_model_tagedit_new (void)
{
#line 150 "gmpc-mpddata-model-tagedit.c"
#define __GOB_FUNCTION__ "Gmpc:MpdData:Model:Tagedit::new"
{
#line 43 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	
        Self *self = GET_NEW;
        return self;
    }}
#line 158 "gmpc-mpddata-model-tagedit.c"
#undef __GOB_FUNCTION__

#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
static void 
gmpc_mpddata_model_tagedit_get_value (GtkTreeModel * model, GtkTreeIter * iter, gint column, GValue * value)
{
#line 165 "gmpc-mpddata-model-tagedit.c"
#define __GOB_FUNCTION__ "Gmpc:MpdData:Model:Tagedit::get_value"
#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (model != NULL);
#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (GTK_IS_TREE_MODEL (model));
#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (iter != NULL);
#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (column >= 0);
#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (column < MPDDATA_MODEL_N_COLUMNS);
#line 52 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (value != NULL);
#line 179 "gmpc-mpddata-model-tagedit.c"
{
#line 54 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	
        Self *self = GMPC_MPDDATA_MODEL_TAGEDIT(model);
        MpdData_real *data = iter->user_data;	
        if(column == MPDDATA_MODEL_COL_ICON_ID)
        {
            si *i = data->userdata;
            g_value_init(value, GMPC_MPDDATA_MODEL(self)->types[column]);

            if(i->changed)
            {
                g_value_set_string(value, GTK_STOCK_CANCEL);
            }
            else 
            {
                g_value_set_string(value, GTK_STOCK_OK);
            }
            
            return;
        }
        /**
         * Call the parent function again
         */
        gmpc_mpddata_model_get_value(model, iter, column, value);
        //PARENT(self)->get_value(model, iter, column, value);
        //PARENT_HANDLER(model, iter,column,value);
    }}
#line 208 "gmpc-mpddata-model-tagedit.c"
#undef __GOB_FUNCTION__

#line 80 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
void 
gmpc_mpddata_model_tagedit_revert_song (GtkTreeModel * model, GtkTreeIter * iter)
{
#line 215 "gmpc-mpddata-model-tagedit.c"
#define __GOB_FUNCTION__ "Gmpc:MpdData:Model:Tagedit::revert_song"
#line 80 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (model != NULL);
#line 80 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (GTK_IS_TREE_MODEL (model));
#line 80 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	g_return_if_fail (iter != NULL);
#line 223 "gmpc-mpddata-model-tagedit.c"
{
#line 83 "/usr/src/extras/gmpc-plugins/gmpc-plugins-11.8.16-2.i686/src/gmpc-plugins-11.8.16/gmpc-tagedit/src/gmpc-mpddata-model-tagedit.gob"
	
        MpdData_real *data = iter->user_data;	
        if(data->userdata)
        {
            GtkTreePath *path;
            si *i = data->userdata;
            mpd_freeSong(data->song);
            data->song = mpd_songDup(i->revert);
            i->changed = 0;
            path = gtk_tree_model_get_path(model, iter);
            gtk_tree_model_row_changed(model, path, iter);
            gtk_tree_path_free(path);
        }
    }}
#line 240 "gmpc-mpddata-model-tagedit.c"
#undef __GOB_FUNCTION__
