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

/*-
 * Copyright (c) 2016 elementary LLC (https://elementary.io)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library 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
 *
 * Authored by: Felipe Escoto <felescoto95@hotmail.com>
 */

#include <glib-object.h>
#include <glib.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define PC_DAEMON_TYPE_RESTRICTION (pc_daemon_restriction_get_type ())
#define PC_DAEMON_RESTRICTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PC_DAEMON_TYPE_RESTRICTION, PCDaemonRestriction))
#define PC_DAEMON_RESTRICTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PC_DAEMON_TYPE_RESTRICTION, PCDaemonRestrictionClass))
#define PC_DAEMON_IS_RESTRICTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PC_DAEMON_TYPE_RESTRICTION))
#define PC_DAEMON_IS_RESTRICTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PC_DAEMON_TYPE_RESTRICTION))
#define PC_DAEMON_RESTRICTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PC_DAEMON_TYPE_RESTRICTION, PCDaemonRestrictionClass))

typedef struct _PCDaemonRestriction PCDaemonRestriction;
typedef struct _PCDaemonRestrictionClass PCDaemonRestrictionClass;
typedef struct _PCDaemonRestrictionPrivate PCDaemonRestrictionPrivate;

#define PC_DAEMON_TYPE_USER_CONFIG (pc_daemon_user_config_get_type ())
#define PC_DAEMON_USER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PC_DAEMON_TYPE_USER_CONFIG, PCDaemonUserConfig))
#define PC_DAEMON_USER_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PC_DAEMON_TYPE_USER_CONFIG, PCDaemonUserConfigClass))
#define PC_DAEMON_IS_USER_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PC_DAEMON_TYPE_USER_CONFIG))
#define PC_DAEMON_IS_USER_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PC_DAEMON_TYPE_USER_CONFIG))
#define PC_DAEMON_USER_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PC_DAEMON_TYPE_USER_CONFIG, PCDaemonUserConfigClass))

typedef struct _PCDaemonUserConfig PCDaemonUserConfig;
typedef struct _PCDaemonUserConfigClass PCDaemonUserConfigClass;
enum  {
	PC_DAEMON_RESTRICTION_0_PROPERTY,
	PC_DAEMON_RESTRICTION_NUM_PROPERTIES
};
static GParamSpec* pc_daemon_restriction_properties[PC_DAEMON_RESTRICTION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _PCDaemonRestriction {
	GObject parent_instance;
	PCDaemonRestrictionPrivate * priv;
	PCDaemonUserConfig* config;
};

struct _PCDaemonRestrictionClass {
	GObjectClass parent_class;
	void (*start) (PCDaemonRestriction* self);
	void (*stop) (PCDaemonRestriction* self);
};

static gpointer pc_daemon_restriction_parent_class = NULL;

VALA_EXTERN GType pc_daemon_restriction_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PCDaemonRestriction, g_object_unref)
VALA_EXTERN GType pc_daemon_user_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PCDaemonUserConfig, g_object_unref)
VALA_EXTERN void pc_daemon_restriction_start (PCDaemonRestriction* self);
VALA_EXTERN void pc_daemon_restriction_stop (PCDaemonRestriction* self);
VALA_EXTERN gboolean pc_daemon_restriction_get_supported (void);
static void pc_daemon_restriction_real_start (PCDaemonRestriction* self);
static void pc_daemon_restriction_real_stop (PCDaemonRestriction* self);
VALA_EXTERN PCDaemonRestriction* pc_daemon_restriction_construct (GType object_type,
                                                      PCDaemonUserConfig* config);
static void pc_daemon_restriction_finalize (GObject * obj);
static GType pc_daemon_restriction_get_type_once (void);

gboolean
pc_daemon_restriction_get_supported (void)
{
	gboolean result;
	result = TRUE;
	return result;
}

static void
pc_daemon_restriction_real_start (PCDaemonRestriction* self)
{
	g_critical ("Type `%s' does not implement abstract method `pc_daemon_restriction_start'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
pc_daemon_restriction_start (PCDaemonRestriction* self)
{
	PCDaemonRestrictionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PC_DAEMON_RESTRICTION_GET_CLASS (self);
	if (_klass_->start) {
		_klass_->start (self);
	}
}

static void
pc_daemon_restriction_real_stop (PCDaemonRestriction* self)
{
	g_critical ("Type `%s' does not implement abstract method `pc_daemon_restriction_stop'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
pc_daemon_restriction_stop (PCDaemonRestriction* self)
{
	PCDaemonRestrictionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PC_DAEMON_RESTRICTION_GET_CLASS (self);
	if (_klass_->stop) {
		_klass_->stop (self);
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

PCDaemonRestriction*
pc_daemon_restriction_construct (GType object_type,
                                 PCDaemonUserConfig* config)
{
	PCDaemonRestriction * self = NULL;
	PCDaemonUserConfig* _tmp0_;
	g_return_val_if_fail (config != NULL, NULL);
	self = (PCDaemonRestriction*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (config);
	_g_object_unref0 (self->config);
	self->config = _tmp0_;
	return self;
}

static void
pc_daemon_restriction_class_init (PCDaemonRestrictionClass * klass,
                                  gpointer klass_data)
{
	pc_daemon_restriction_parent_class = g_type_class_peek_parent (klass);
	((PCDaemonRestrictionClass *) klass)->start = (void (*) (PCDaemonRestriction*)) pc_daemon_restriction_real_start;
	((PCDaemonRestrictionClass *) klass)->stop = (void (*) (PCDaemonRestriction*)) pc_daemon_restriction_real_stop;
	G_OBJECT_CLASS (klass)->finalize = pc_daemon_restriction_finalize;
}

static void
pc_daemon_restriction_instance_init (PCDaemonRestriction * self,
                                     gpointer klass)
{
}

static void
pc_daemon_restriction_finalize (GObject * obj)
{
	PCDaemonRestriction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PC_DAEMON_TYPE_RESTRICTION, PCDaemonRestriction);
	_g_object_unref0 (self->config);
	G_OBJECT_CLASS (pc_daemon_restriction_parent_class)->finalize (obj);
}

static GType
pc_daemon_restriction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PCDaemonRestrictionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pc_daemon_restriction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PCDaemonRestriction), 0, (GInstanceInitFunc) pc_daemon_restriction_instance_init, NULL };
	GType pc_daemon_restriction_type_id;
	pc_daemon_restriction_type_id = g_type_register_static (G_TYPE_OBJECT, "PCDaemonRestriction", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return pc_daemon_restriction_type_id;
}

GType
pc_daemon_restriction_get_type (void)
{
	static volatile gsize pc_daemon_restriction_type_id__once = 0;
	if (g_once_init_enter (&pc_daemon_restriction_type_id__once)) {
		GType pc_daemon_restriction_type_id;
		pc_daemon_restriction_type_id = pc_daemon_restriction_get_type_once ();
		g_once_init_leave (&pc_daemon_restriction_type_id__once, pc_daemon_restriction_type_id);
	}
	return pc_daemon_restriction_type_id__once;
}

