/* localsearch-plugin.c generated by valac 0.56.19, the Vala compiler
 * generated from localsearch-plugin.vala, do not modify */

/*
 * Copyright (C) 2008 Zeeshan Ali <zeenix@gmail.com>.
 *
 * Author: Zeeshan Ali <zeenix@gmail.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-localsearch.h"
#include <glib-object.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "rygel-server.h"
#include "rygel-core.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

enum  {
	RYGEL_LOCAL_SEARCH_PLUGIN_0_PROPERTY,
	RYGEL_LOCAL_SEARCH_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* rygel_local_search_plugin_properties[RYGEL_LOCAL_SEARCH_PLUGIN_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer rygel_local_search_plugin_parent_class = NULL;
static RygelLocalSearchRootContainer* rygel_local_search_plugin_root;
static RygelLocalSearchRootContainer* rygel_local_search_plugin_root = NULL;

static void rygel_local_search_plugin_finalize (GObject * obj);
static GType rygel_local_search_plugin_get_type_once (void);

RygelLocalSearchPlugin*
rygel_local_search_plugin_construct (GType object_type,
                                     GError** error)
{
	RygelLocalSearchPlugin * self = NULL;
	RygelLocalSearchRootContainer* _tmp0_;
	RygelLocalSearchRootContainer* _tmp4_;
	GError* _inner_error0_ = NULL;
	_tmp0_ = rygel_local_search_plugin_root;
	if (_tmp0_ == NULL) {
		RygelLocalSearchRootContainer* _tmp1_ = NULL;
		RygelLocalSearchRootContainer* _tmp2_;
		RygelLocalSearchRootContainer* _tmp3_;
		_tmp2_ = rygel_local_search_root_container_new (_ ("@REALNAME@’s media"), &_inner_error0_);
		_tmp1_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (self);
			return NULL;
		}
		_tmp3_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (rygel_local_search_plugin_root);
		rygel_local_search_plugin_root = _tmp3_;
		_g_object_unref0 (_tmp1_);
	}
	_tmp4_ = rygel_local_search_plugin_root;
	self = (RygelLocalSearchPlugin*) rygel_media_server_plugin_construct (object_type, (RygelMediaContainer*) _tmp4_, RYGEL_LOCAL_SEARCH_PLUGIN_NAME, NULL, RYGEL_PLUGIN_CAPABILITIES_NONE);
	return self;
}

RygelLocalSearchPlugin*
rygel_local_search_plugin_new (GError** error)
{
	return rygel_local_search_plugin_construct (RYGEL_LOCAL_SEARCH_TYPE_PLUGIN, error);
}

static void
rygel_local_search_plugin_class_init (RygelLocalSearchPluginClass * klass,
                                      gpointer klass_data)
{
	rygel_local_search_plugin_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = rygel_local_search_plugin_finalize;
}

static void
rygel_local_search_plugin_instance_init (RygelLocalSearchPlugin * self,
                                         gpointer klass)
{
}

static void
rygel_local_search_plugin_finalize (GObject * obj)
{
	RygelLocalSearchPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_LOCAL_SEARCH_TYPE_PLUGIN, RygelLocalSearchPlugin);
	G_OBJECT_CLASS (rygel_local_search_plugin_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
rygel_local_search_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RygelLocalSearchPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_local_search_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLocalSearchPlugin), 0, (GInstanceInitFunc) rygel_local_search_plugin_instance_init, NULL };
	GType rygel_local_search_plugin_type_id;
	rygel_local_search_plugin_type_id = g_type_register_static (RYGEL_TYPE_MEDIA_SERVER_PLUGIN, "RygelLocalSearchPlugin", &g_define_type_info, 0);
	return rygel_local_search_plugin_type_id;
}

GType
rygel_local_search_plugin_get_type (void)
{
	static volatile gsize rygel_local_search_plugin_type_id__once = 0;
	if (g_once_init_enter (&rygel_local_search_plugin_type_id__once)) {
		GType rygel_local_search_plugin_type_id;
		rygel_local_search_plugin_type_id = rygel_local_search_plugin_get_type_once ();
		g_once_init_leave (&rygel_local_search_plugin_type_id__once, rygel_local_search_plugin_type_id);
	}
	return rygel_local_search_plugin_type_id__once;
}

