/* rygel-tracker-boolean-filter.c generated by valac 0.15.2.4-51044, the Vala compiler
 * generated from rygel-tracker-boolean-filter.vala, do not modify */

/*
 * Copyright (C) 2010 MediaNet Inh.
 *
 * Author: Sunil Mohan Adapa <sunil@medhas.org>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define RYGEL_TRACKER_TYPE_QUERY_FILTER (rygel_tracker_query_filter_get_type ())
#define RYGEL_TRACKER_QUERY_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_QUERY_FILTER, RygelTrackerQueryFilter))
#define RYGEL_TRACKER_IS_QUERY_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_QUERY_FILTER))
#define RYGEL_TRACKER_QUERY_FILTER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_TRACKER_TYPE_QUERY_FILTER, RygelTrackerQueryFilterIface))

typedef struct _RygelTrackerQueryFilter RygelTrackerQueryFilter;
typedef struct _RygelTrackerQueryFilterIface RygelTrackerQueryFilterIface;

#define RYGEL_TRACKER_TYPE_BOOLEAN_FILTER (rygel_tracker_boolean_filter_get_type ())
#define RYGEL_TRACKER_BOOLEAN_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_BOOLEAN_FILTER, RygelTrackerBooleanFilter))
#define RYGEL_TRACKER_BOOLEAN_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_BOOLEAN_FILTER, RygelTrackerBooleanFilterClass))
#define RYGEL_TRACKER_IS_BOOLEAN_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_BOOLEAN_FILTER))
#define RYGEL_TRACKER_IS_BOOLEAN_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_BOOLEAN_FILTER))
#define RYGEL_TRACKER_BOOLEAN_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_BOOLEAN_FILTER, RygelTrackerBooleanFilterClass))

typedef struct _RygelTrackerBooleanFilter RygelTrackerBooleanFilter;
typedef struct _RygelTrackerBooleanFilterClass RygelTrackerBooleanFilterClass;
typedef struct _RygelTrackerBooleanFilterPrivate RygelTrackerBooleanFilterPrivate;

struct _RygelTrackerQueryFilterIface {
	GTypeInterface parent_iface;
	gchar* (*to_string) (RygelTrackerQueryFilter* self);
};

struct _RygelTrackerBooleanFilter {
	GObject parent_instance;
	RygelTrackerBooleanFilterPrivate * priv;
	gboolean value;
};

struct _RygelTrackerBooleanFilterClass {
	GObjectClass parent_class;
};


static gpointer rygel_tracker_boolean_filter_parent_class = NULL;
static RygelTrackerQueryFilterIface* rygel_tracker_boolean_filter_rygel_tracker_query_filter_parent_iface = NULL;

GType rygel_tracker_query_filter_get_type (void) G_GNUC_CONST;
GType rygel_tracker_boolean_filter_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_TRACKER_BOOLEAN_FILTER_DUMMY_PROPERTY
};
RygelTrackerBooleanFilter* rygel_tracker_boolean_filter_new (gboolean value);
RygelTrackerBooleanFilter* rygel_tracker_boolean_filter_construct (GType object_type, gboolean value);
static gchar* rygel_tracker_boolean_filter_real_to_string (RygelTrackerQueryFilter* base);
static void rygel_tracker_boolean_filter_finalize (GObject* obj);


RygelTrackerBooleanFilter* rygel_tracker_boolean_filter_construct (GType object_type, gboolean value) {
	RygelTrackerBooleanFilter * self = NULL;
	gboolean _tmp0_;
	self = (RygelTrackerBooleanFilter*) g_object_new (object_type, NULL);
	_tmp0_ = value;
	self->value = _tmp0_;
	return self;
}


RygelTrackerBooleanFilter* rygel_tracker_boolean_filter_new (gboolean value) {
	return rygel_tracker_boolean_filter_construct (RYGEL_TRACKER_TYPE_BOOLEAN_FILTER, value);
}


static gchar* bool_to_string (gboolean self) {
	gchar* result = NULL;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}


static gchar* rygel_tracker_boolean_filter_real_to_string (RygelTrackerQueryFilter* base) {
	RygelTrackerBooleanFilter * self;
	gchar* result = NULL;
	gboolean _tmp0_;
	gchar* _tmp1_ = NULL;
	self = (RygelTrackerBooleanFilter*) base;
	_tmp0_ = self->value;
	_tmp1_ = bool_to_string (_tmp0_);
	result = _tmp1_;
	return result;
}


static void rygel_tracker_boolean_filter_class_init (RygelTrackerBooleanFilterClass * klass) {
	rygel_tracker_boolean_filter_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = rygel_tracker_boolean_filter_finalize;
}


static void rygel_tracker_boolean_filter_rygel_tracker_query_filter_interface_init (RygelTrackerQueryFilterIface * iface) {
	rygel_tracker_boolean_filter_rygel_tracker_query_filter_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_string = (gchar* (*)(RygelTrackerQueryFilter*)) rygel_tracker_boolean_filter_real_to_string;
}


static void rygel_tracker_boolean_filter_instance_init (RygelTrackerBooleanFilter * self) {
}


static void rygel_tracker_boolean_filter_finalize (GObject* obj) {
	RygelTrackerBooleanFilter * self;
	self = RYGEL_TRACKER_BOOLEAN_FILTER (obj);
	G_OBJECT_CLASS (rygel_tracker_boolean_filter_parent_class)->finalize (obj);
}


/**
 * Boolean constants in SPARQL query filter
 */
GType rygel_tracker_boolean_filter_get_type (void) {
	static volatile gsize rygel_tracker_boolean_filter_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_tracker_boolean_filter_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelTrackerBooleanFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_tracker_boolean_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelTrackerBooleanFilter), 0, (GInstanceInitFunc) rygel_tracker_boolean_filter_instance_init, NULL };
		static const GInterfaceInfo rygel_tracker_query_filter_info = { (GInterfaceInitFunc) rygel_tracker_boolean_filter_rygel_tracker_query_filter_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType rygel_tracker_boolean_filter_type_id;
		rygel_tracker_boolean_filter_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelTrackerBooleanFilter", &g_define_type_info, 0);
		g_type_add_interface_static (rygel_tracker_boolean_filter_type_id, RYGEL_TRACKER_TYPE_QUERY_FILTER, &rygel_tracker_query_filter_info);
		g_once_init_leave (&rygel_tracker_boolean_filter_type_id__volatile, rygel_tracker_boolean_filter_type_id);
	}
	return rygel_tracker_boolean_filter_type_id__volatile;
}



