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

/*
 * Copyright (C) 2008, 2009 Nokia Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.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-core.h"
#include <gio/gio.h>
#include <glib.h>

enum  {
	RYGEL_STATE_MACHINE_COMPLETED_SIGNAL,
	RYGEL_STATE_MACHINE_NUM_SIGNALS
};
static guint rygel_state_machine_signals[RYGEL_STATE_MACHINE_NUM_SIGNALS] = {0};

static GType rygel_state_machine_get_type_once (void);

void
rygel_state_machine_run (RygelStateMachine* self,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	RygelStateMachineIface* _iface_;
	_iface_ = RYGEL_STATE_MACHINE_GET_INTERFACE (self);
	if (_iface_->run) {
		_iface_->run (self, _callback_, _user_data_);
	}
}

void
rygel_state_machine_run_finish (RygelStateMachine* self,
                                GAsyncResult* _res_)
{
	RygelStateMachineIface* _iface_;
	_iface_ = RYGEL_STATE_MACHINE_GET_INTERFACE (self);
	if (_iface_->run_finish) {
		_iface_->run_finish (self, _res_);
	}
}

GCancellable*
rygel_state_machine_get_cancellable (RygelStateMachine* self)
{
	RygelStateMachineIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = RYGEL_STATE_MACHINE_GET_INTERFACE (self);
	if (_iface_->get_cancellable) {
		return _iface_->get_cancellable (self);
	}
	return NULL;
}

void
rygel_state_machine_set_cancellable (RygelStateMachine* self,
                                     GCancellable* value)
{
	RygelStateMachineIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = RYGEL_STATE_MACHINE_GET_INTERFACE (self);
	if (_iface_->set_cancellable) {
		_iface_->set_cancellable (self, value);
	}
}

static void
rygel_state_machine_default_init (RygelStateMachineIface * iface,
                                  gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_object ("cancellable", "cancellable", "cancellable", g_cancellable_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	rygel_state_machine_signals[RYGEL_STATE_MACHINE_COMPLETED_SIGNAL] = g_signal_new ("completed", RYGEL_TYPE_STATE_MACHINE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

/**
 * StateMachine interface.
 */
static GType
rygel_state_machine_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RygelStateMachineIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_state_machine_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType rygel_state_machine_type_id;
	rygel_state_machine_type_id = g_type_register_static (G_TYPE_INTERFACE, "RygelStateMachine", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (rygel_state_machine_type_id, G_TYPE_OBJECT);
	return rygel_state_machine_type_id;
}

GType
rygel_state_machine_get_type (void)
{
	static volatile gsize rygel_state_machine_type_id__once = 0;
	if (g_once_init_enter (&rygel_state_machine_type_id__once)) {
		GType rygel_state_machine_type_id;
		rygel_state_machine_type_id = rygel_state_machine_get_type_once ();
		g_once_init_leave (&rygel_state_machine_type_id__once, rygel_state_machine_type_id);
	}
	return rygel_state_machine_type_id__once;
}

