/* gitg-diff-selectable.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-diff-selectable.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2016 - Jesse van den Kieboom
 *
 * gitg is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * gitg 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib-object.h>
#include <glib.h>
#include "libgitg.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 GITG_TYPE_DIFF_SELECTABLE (gitg_diff_selectable_get_type ())
#define GITG_DIFF_SELECTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_DIFF_SELECTABLE, GitgDiffSelectable))
#define GITG_IS_DIFF_SELECTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_DIFF_SELECTABLE))
#define GITG_DIFF_SELECTABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GITG_TYPE_DIFF_SELECTABLE, GitgDiffSelectableIface))

typedef struct _GitgDiffSelectable GitgDiffSelectable;
typedef struct _GitgDiffSelectableIface GitgDiffSelectableIface;

struct _GitgDiffSelectableIface {
	GTypeInterface parent_iface;
	void (*clear_selection) (GitgDiffSelectable* self);
	gboolean (*get_has_selection) (GitgDiffSelectable* self);
	gboolean (*get_can_select) (GitgDiffSelectable* self);
	void (*set_can_select) (GitgDiffSelectable* self, gboolean value);
	GitgPatchSet* (*get_selection) (GitgDiffSelectable* self);
};

VALA_EXTERN GType gitg_diff_selectable_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void gitg_diff_selectable_clear_selection (GitgDiffSelectable* self);
VALA_EXTERN gboolean gitg_diff_selectable_get_has_selection (GitgDiffSelectable* self);
VALA_EXTERN gboolean gitg_diff_selectable_get_can_select (GitgDiffSelectable* self);
VALA_EXTERN void gitg_diff_selectable_set_can_select (GitgDiffSelectable* self,
                                          gboolean value);
VALA_EXTERN GitgPatchSet* gitg_diff_selectable_get_selection (GitgDiffSelectable* self);
static GType gitg_diff_selectable_get_type_once (void);

void
gitg_diff_selectable_clear_selection (GitgDiffSelectable* self)
{
	GitgDiffSelectableIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GITG_DIFF_SELECTABLE_GET_INTERFACE (self);
	if (_iface_->clear_selection) {
		_iface_->clear_selection (self);
	}
}

gboolean
gitg_diff_selectable_get_has_selection (GitgDiffSelectable* self)
{
	GitgDiffSelectableIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = GITG_DIFF_SELECTABLE_GET_INTERFACE (self);
	if (_iface_->get_has_selection) {
		return _iface_->get_has_selection (self);
	}
	return FALSE;
}

gboolean
gitg_diff_selectable_get_can_select (GitgDiffSelectable* self)
{
	GitgDiffSelectableIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = GITG_DIFF_SELECTABLE_GET_INTERFACE (self);
	if (_iface_->get_can_select) {
		return _iface_->get_can_select (self);
	}
	return FALSE;
}

void
gitg_diff_selectable_set_can_select (GitgDiffSelectable* self,
                                     gboolean value)
{
	GitgDiffSelectableIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GITG_DIFF_SELECTABLE_GET_INTERFACE (self);
	if (_iface_->set_can_select) {
		_iface_->set_can_select (self, value);
	}
}

GitgPatchSet*
gitg_diff_selectable_get_selection (GitgDiffSelectable* self)
{
	GitgDiffSelectableIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GITG_DIFF_SELECTABLE_GET_INTERFACE (self);
	if (_iface_->get_selection) {
		return _iface_->get_selection (self);
	}
	return NULL;
}

static void
gitg_diff_selectable_default_init (GitgDiffSelectableIface * iface,
                                   gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_boolean ("has-selection", "has-selection", "has-selection", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_interface_install_property (iface, g_param_spec_boolean ("can-select", "can-select", "can-select", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_interface_install_property (iface, gitg_param_spec_patch_set ("selection", "selection", "selection", GITG_TYPE_PATCH_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

 G_GNUC_NO_INLINE static GType
gitg_diff_selectable_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgDiffSelectableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_diff_selectable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gitg_diff_selectable_type_id;
	gitg_diff_selectable_type_id = g_type_register_static (G_TYPE_INTERFACE, "GitgDiffSelectable", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (gitg_diff_selectable_type_id, G_TYPE_OBJECT);
	return gitg_diff_selectable_type_id;
}

GType
gitg_diff_selectable_get_type (void)
{
	static gsize gitg_diff_selectable_type_id__once = 0;
	if (g_once_init_enter (&gitg_diff_selectable_type_id__once)) {
		GType gitg_diff_selectable_type_id;
		gitg_diff_selectable_type_id = gitg_diff_selectable_get_type_once ();
		g_once_init_leave (&gitg_diff_selectable_type_id__once, gitg_diff_selectable_type_id);
	}
	return gitg_diff_selectable_type_id__once;
}

