/* rygel-ruih-server.c generated by valac 0.56.19, the Vala compiler
 * generated from rygel-ruih-server.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 "rygel-core.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define TYPE_PLUGIN (plugin_get_type ())
#define PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLUGIN, Plugin))
#define PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLUGIN, PluginClass))
#define IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLUGIN))
#define IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLUGIN))
#define PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLUGIN, PluginClass))

typedef struct _Plugin Plugin;
typedef struct _PluginClass PluginClass;
typedef struct _PluginPrivate PluginPrivate;
enum  {
	PLUGIN_0_PROPERTY,
	PLUGIN_NUM_PROPERTIES
};
static GParamSpec* plugin_properties[PLUGIN_NUM_PROPERTIES];
enum  {
	RYGEL_RUIH_SERVER_0_PROPERTY,
	RYGEL_RUIH_SERVER_NUM_PROPERTIES
};
static GParamSpec* rygel_ruih_server_properties[RYGEL_RUIH_SERVER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _Plugin {
	RygelRuihServerPlugin parent_instance;
	PluginPrivate * priv;
};

struct _PluginClass {
	RygelRuihServerPluginClass parent_class;
};

static gpointer plugin_parent_class = NULL;
static gpointer rygel_ruih_server_parent_class = NULL;

VALA_EXTERN GType plugin_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Plugin* plugin_new (RygelPluginCapabilities capabilities);
VALA_EXTERN Plugin* plugin_construct (GType object_type,
                          RygelPluginCapabilities capabilities);
static GType plugin_get_type_once (void);
static void rygel_ruih_server_real_constructed (GObject* base);
static GType rygel_ruih_server_get_type_once (void);

Plugin*
plugin_construct (GType object_type,
                  RygelPluginCapabilities capabilities)
{
	Plugin * self = NULL;
	self = (Plugin*) rygel_ruih_server_plugin_construct (object_type, "LibRygelRuih", "LibRygelRuih", NULL, capabilities);
	return self;
}

Plugin*
plugin_new (RygelPluginCapabilities capabilities)
{
	return plugin_construct (TYPE_PLUGIN, capabilities);
}

static void
plugin_class_init (PluginClass * klass,
                   gpointer klass_data)
{
	plugin_parent_class = g_type_class_peek_parent (klass);
}

static void
plugin_instance_init (Plugin * self,
                      gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Plugin), 0, (GInstanceInitFunc) plugin_instance_init, NULL };
	GType plugin_type_id;
	plugin_type_id = g_type_register_static (RYGEL_TYPE_RUIH_SERVER_PLUGIN, "Plugin", &g_define_type_info, 0);
	return plugin_type_id;
}

GType
plugin_get_type (void)
{
	static volatile gsize plugin_type_id__once = 0;
	if (g_once_init_enter (&plugin_type_id__once)) {
		GType plugin_type_id;
		plugin_type_id = plugin_get_type_once ();
		g_once_init_leave (&plugin_type_id__once, plugin_type_id);
	}
	return plugin_type_id__once;
}

/**
     * Create a RuihServer to serve the UIs.
     */
RygelRuihServer*
rygel_ruih_server_construct (GType object_type,
                             const gchar* title,
                             RygelPluginCapabilities capabilities)
{
	RygelRuihServer * self = NULL;
	g_return_val_if_fail (title != NULL, NULL);
	self = (RygelRuihServer*) g_object_new (object_type, "title", title, "capabilities", capabilities, NULL);
	return self;
}

RygelRuihServer*
rygel_ruih_server_new (const gchar* title,
                       RygelPluginCapabilities capabilities)
{
	return rygel_ruih_server_construct (RYGEL_TYPE_RUIH_SERVER, title, capabilities);
}

static void
rygel_ruih_server_real_constructed (GObject* base)
{
	RygelRuihServer * self;
	RygelPlugin* _tmp0_;
	RygelPlugin* _tmp1_;
	RygelPlugin* _tmp6_;
	RygelPlugin* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	self = (RygelRuihServer*) base;
	G_OBJECT_CLASS (rygel_ruih_server_parent_class)->constructed ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_MEDIA_DEVICE, RygelMediaDevice));
	_tmp0_ = rygel_media_device_get_plugin ((RygelMediaDevice*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		RygelPluginCapabilities _tmp2_;
		RygelPluginCapabilities _tmp3_;
		Plugin* _tmp4_;
		Plugin* _tmp5_;
		_tmp2_ = rygel_media_device_get_capabilities ((RygelMediaDevice*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = plugin_new (_tmp3_);
		_tmp5_ = _tmp4_;
		rygel_media_device_set_plugin ((RygelMediaDevice*) self, (RygelPlugin*) _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_tmp6_ = rygel_media_device_get_plugin ((RygelMediaDevice*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = rygel_media_device_get_title ((RygelMediaDevice*) self);
	_tmp9_ = _tmp8_;
	rygel_plugin_set_title (_tmp7_, _tmp9_);
}

static void
rygel_ruih_server_class_init (RygelRuihServerClass * klass,
                              gpointer klass_data)
{
	rygel_ruih_server_parent_class = g_type_class_peek_parent (klass);
	((GObjectClass *) klass)->constructed = (void (*) (GObject*)) rygel_ruih_server_real_constructed;
}

static void
rygel_ruih_server_instance_init (RygelRuihServer * self,
                                 gpointer klass)
{
}

/**
 * This class may be used to implement in-process UPnP RUIH servers.
 *
 * Call rygel_media_device_add_interface () on the RygelRuihServer to allow it
 * to serve requests via that network interface.
 *
 */
 G_GNUC_NO_INLINE static GType
rygel_ruih_server_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RygelRuihServerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_ruih_server_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelRuihServer), 0, (GInstanceInitFunc) rygel_ruih_server_instance_init, NULL };
	GType rygel_ruih_server_type_id;
	rygel_ruih_server_type_id = g_type_register_static (RYGEL_TYPE_MEDIA_DEVICE, "RygelRuihServer", &g_define_type_info, 0);
	return rygel_ruih_server_type_id;
}

GType
rygel_ruih_server_get_type (void)
{
	static volatile gsize rygel_ruih_server_type_id__once = 0;
	if (g_once_init_enter (&rygel_ruih_server_type_id__once)) {
		GType rygel_ruih_server_type_id;
		rygel_ruih_server_type_id = rygel_ruih_server_get_type_once ();
		g_once_init_leave (&rygel_ruih_server_type_id__once, rygel_ruih_server_type_id);
	}
	return rygel_ruih_server_type_id__once;
}

