/* rygel-ruih-plugin.c generated by valac 0.56.1, the Vala compiler
 * generated from rygel-ruih-plugin.vala, do not modify */

/*
 * Copyright (C) 2013  Cable Television Laboratories, Inc.
 *
 * Author: Neha Shanbhag <N.Shanbhag@cablelabs.com>
 * Contact: http://www.cablelabs.com/
 *
 * 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.1 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 library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "rygel-ruih.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "rygel-core.h"
#include <glib/gi18n-lib.h>
#include "rygel-ruih-plugin.h"

#define RYGEL_RUIH_PLUGIN_NAME "Ruih"

#define RYGEL_RUIH_TYPE_PLUGIN (rygel_ruih_plugin_get_type ())
#define RYGEL_RUIH_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_RUIH_TYPE_PLUGIN, RygelRuihPlugin))
#define RYGEL_RUIH_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_RUIH_TYPE_PLUGIN, RygelRuihPluginClass))
#define RYGEL_RUIH_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_RUIH_TYPE_PLUGIN))
#define RYGEL_RUIH_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_RUIH_TYPE_PLUGIN))
#define RYGEL_RUIH_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_RUIH_TYPE_PLUGIN, RygelRuihPluginClass))

typedef struct _RygelRuihPlugin RygelRuihPlugin;
typedef struct _RygelRuihPluginClass RygelRuihPluginClass;
typedef struct _RygelRuihPluginPrivate RygelRuihPluginPrivate;
enum  {
	RYGEL_RUIH_PLUGIN_0_PROPERTY,
	RYGEL_RUIH_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* rygel_ruih_plugin_properties[RYGEL_RUIH_PLUGIN_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _RygelRuihPlugin {
	RygelRuihServerPlugin parent_instance;
	RygelRuihPluginPrivate * priv;
};

struct _RygelRuihPluginClass {
	RygelRuihServerPluginClass parent_class;
};

static gpointer rygel_ruih_plugin_parent_class = NULL;

VALA_EXTERN GType rygel_ruih_plugin_get_type (void) G_GNUC_CONST ;
VALA_EXTERN RygelRuihPlugin* rygel_ruih_plugin_new (void);
VALA_EXTERN RygelRuihPlugin* rygel_ruih_plugin_construct (GType object_type);
static GType rygel_ruih_plugin_get_type_once (void);

RygelRuihPlugin*
rygel_ruih_plugin_construct (GType object_type)
{
	RygelRuihPlugin * self = NULL;
	gchar* title = NULL;
	const gchar* _tmp7_;
	GError* _inner_error0_ = NULL;
	{
		gchar* _tmp0_ = NULL;
		RygelMetaConfig* _tmp1_;
		RygelMetaConfig* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp1_ = rygel_meta_config_get_default ();
		_tmp2_ = _tmp1_;
		_tmp3_ = rygel_configuration_get_string ((RygelConfiguration*) _tmp2_, RYGEL_RUIH_PLUGIN_NAME, "title", &_inner_error0_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_tmp0_ = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp5_ = _tmp0_;
		_tmp0_ = NULL;
		_g_free0 (title);
		title = _tmp5_;
		_g_free0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		gchar* _tmp6_;
		g_clear_error (&_inner_error0_);
		g_warning ("rygel-ruih-plugin.vala:35: Setting default name for Ruih");
		_tmp6_ = g_strdup ("CableLabs CVP-2 RemoteUIServer");
		_g_free0 (title);
		title = _tmp6_;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (title);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp7_ = title;
	self = (RygelRuihPlugin*) rygel_ruih_server_plugin_construct (object_type, RYGEL_RUIH_PLUGIN_NAME, _ (_tmp7_), NULL, RYGEL_PLUGIN_CAPABILITIES_NONE);
	_g_free0 (title);
	return self;
}

RygelRuihPlugin*
rygel_ruih_plugin_new (void)
{
	return rygel_ruih_plugin_construct (RYGEL_RUIH_TYPE_PLUGIN);
}

static void
rygel_ruih_plugin_class_init (RygelRuihPluginClass * klass,
                              gpointer klass_data)
{
	rygel_ruih_plugin_parent_class = g_type_class_peek_parent (klass);
}

static void
rygel_ruih_plugin_instance_init (RygelRuihPlugin * self,
                                 gpointer klass)
{
}

static GType
rygel_ruih_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RygelRuihPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_ruih_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelRuihPlugin), 0, (GInstanceInitFunc) rygel_ruih_plugin_instance_init, NULL };
	GType rygel_ruih_plugin_type_id;
	rygel_ruih_plugin_type_id = g_type_register_static (RYGEL_TYPE_RUIH_SERVER_PLUGIN, "RygelRuihPlugin", &g_define_type_info, 0);
	return rygel_ruih_plugin_type_id;
}

GType
rygel_ruih_plugin_get_type (void)
{
	static volatile gsize rygel_ruih_plugin_type_id__once = 0;
	if (g_once_init_enter (&rygel_ruih_plugin_type_id__once)) {
		GType rygel_ruih_plugin_type_id;
		rygel_ruih_plugin_type_id = rygel_ruih_plugin_get_type_once ();
		g_once_init_leave (&rygel_ruih_plugin_type_id__once, rygel_ruih_plugin_type_id);
	}
	return rygel_ruih_plugin_type_id__once;
}

