/* actions.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from actions.vala, do not modify */

/*
 * Seahorse
 *
 * Copyright (C) 2008 Stefan Walter
 * Copyright (C) 2011 Collabora Ltd.
 *
 * This program 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.
 *
 * This program 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 program; if not, see <http://www.gnu.org/licenses/>.
 */

#include "seahorse-common.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.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  {
	SEAHORSE_ACTION_GROUP_0_PROPERTY,
	SEAHORSE_ACTION_GROUP_PREFIX_PROPERTY,
	SEAHORSE_ACTION_GROUP_CATALOG_PROPERTY,
	SEAHORSE_ACTION_GROUP_NUM_PROPERTIES
};
static GParamSpec* seahorse_action_group_properties[SEAHORSE_ACTION_GROUP_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _SeahorseActionGroupPrivate {
	gchar* _prefix;
	SeahorseCatalog* _catalog;
};

static gint SeahorseActionGroup_private_offset;
static gpointer seahorse_action_group_parent_class = NULL;

static void seahorse_action_group_real_set_actions_for_selected_objects (SeahorseActionGroup* self,
                                                                  GList* objects);
static void seahorse_action_group_finalize (GObject * obj);
static GType seahorse_action_group_get_type_once (void);
static void _vala_seahorse_action_group_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_seahorse_action_group_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
seahorse_action_group_get_instance_private (SeahorseActionGroup* self)
{
	return G_STRUCT_MEMBER_P (self, SeahorseActionGroup_private_offset);
}

static void
seahorse_action_group_real_set_actions_for_selected_objects (SeahorseActionGroup* self,
                                                             GList* objects)
{
}

void
seahorse_action_group_set_actions_for_selected_objects (SeahorseActionGroup* self,
                                                        GList* objects)
{
	SeahorseActionGroupClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = SEAHORSE_ACTION_GROUP_GET_CLASS (self);
	if (_klass_->set_actions_for_selected_objects) {
		_klass_->set_actions_for_selected_objects (self, objects);
	}
}

SeahorseActionGroup*
seahorse_action_group_construct (GType object_type)
{
	SeahorseActionGroup * self = NULL;
	self = (SeahorseActionGroup*) g_object_new (object_type, NULL);
	return self;
}

SeahorseActionGroup*
seahorse_action_group_new (void)
{
	return seahorse_action_group_construct (SEAHORSE_TYPE_ACTION_GROUP);
}

const gchar*
seahorse_action_group_get_prefix (SeahorseActionGroup* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_prefix;
	result = _tmp0_;
	return result;
}

void
seahorse_action_group_set_prefix (SeahorseActionGroup* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = seahorse_action_group_get_prefix (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_prefix);
		self->priv->_prefix = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, seahorse_action_group_properties[SEAHORSE_ACTION_GROUP_PREFIX_PROPERTY]);
	}
}

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

SeahorseCatalog*
seahorse_action_group_get_catalog (SeahorseActionGroup* self)
{
	SeahorseCatalog* result;
	SeahorseCatalog* _tmp0_;
	SeahorseCatalog* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_catalog;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

void
seahorse_action_group_set_catalog (SeahorseActionGroup* self,
                                   SeahorseCatalog* value)
{
	SeahorseCatalog* old_value;
	g_return_if_fail (self != NULL);
	old_value = seahorse_action_group_get_catalog (self);
	if (old_value != value) {
		SeahorseCatalog* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_catalog);
		self->priv->_catalog = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, seahorse_action_group_properties[SEAHORSE_ACTION_GROUP_CATALOG_PROPERTY]);
	}
	_g_object_unref0 (old_value);
}

static void
seahorse_action_group_class_init (SeahorseActionGroupClass * klass,
                                  gpointer klass_data)
{
	seahorse_action_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SeahorseActionGroup_private_offset);
	((SeahorseActionGroupClass *) klass)->set_actions_for_selected_objects = (void (*) (SeahorseActionGroup*, GList*)) seahorse_action_group_real_set_actions_for_selected_objects;
	G_OBJECT_CLASS (klass)->get_property = _vala_seahorse_action_group_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_seahorse_action_group_set_property;
	G_OBJECT_CLASS (klass)->finalize = seahorse_action_group_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_ACTION_GROUP_PREFIX_PROPERTY, seahorse_action_group_properties[SEAHORSE_ACTION_GROUP_PREFIX_PROPERTY] = g_param_spec_string ("prefix", "prefix", "prefix", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_ACTION_GROUP_CATALOG_PROPERTY, seahorse_action_group_properties[SEAHORSE_ACTION_GROUP_CATALOG_PROPERTY] = g_param_spec_object ("catalog", "catalog", "catalog", SEAHORSE_TYPE_CATALOG, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
seahorse_action_group_instance_init (SeahorseActionGroup * self,
                                     gpointer klass)
{
	self->priv = seahorse_action_group_get_instance_private (self);
}

static void
seahorse_action_group_finalize (GObject * obj)
{
	SeahorseActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SEAHORSE_TYPE_ACTION_GROUP, SeahorseActionGroup);
	_g_free0 (self->priv->_prefix);
	_g_object_unref0 (self->priv->_catalog);
	G_OBJECT_CLASS (seahorse_action_group_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
seahorse_action_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SeahorseActionGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seahorse_action_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeahorseActionGroup), 0, (GInstanceInitFunc) seahorse_action_group_instance_init, NULL };
	GType seahorse_action_group_type_id;
	seahorse_action_group_type_id = g_type_register_static (g_simple_action_group_get_type (), "SeahorseActionGroup", &g_define_type_info, 0);
	SeahorseActionGroup_private_offset = g_type_add_instance_private (seahorse_action_group_type_id, sizeof (SeahorseActionGroupPrivate));
	return seahorse_action_group_type_id;
}

GType
seahorse_action_group_get_type (void)
{
	static volatile gsize seahorse_action_group_type_id__once = 0;
	if (g_once_init_enter (&seahorse_action_group_type_id__once)) {
		GType seahorse_action_group_type_id;
		seahorse_action_group_type_id = seahorse_action_group_get_type_once ();
		g_once_init_leave (&seahorse_action_group_type_id__once, seahorse_action_group_type_id);
	}
	return seahorse_action_group_type_id__once;
}

static void
_vala_seahorse_action_group_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	SeahorseActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAHORSE_TYPE_ACTION_GROUP, SeahorseActionGroup);
	switch (property_id) {
		case SEAHORSE_ACTION_GROUP_PREFIX_PROPERTY:
		g_value_set_string (value, seahorse_action_group_get_prefix (self));
		break;
		case SEAHORSE_ACTION_GROUP_CATALOG_PROPERTY:
		g_value_take_object (value, seahorse_action_group_get_catalog (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_seahorse_action_group_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	SeahorseActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAHORSE_TYPE_ACTION_GROUP, SeahorseActionGroup);
	switch (property_id) {
		case SEAHORSE_ACTION_GROUP_PREFIX_PROPERTY:
		seahorse_action_group_set_prefix (self, g_value_get_string (value));
		break;
		case SEAHORSE_ACTION_GROUP_CATALOG_PROPERTY:
		seahorse_action_group_set_catalog (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

