/* gitg-ext-ui-element.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-ext-ui-element.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2012 - 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 "libgitg-ext.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

enum  {
	GITG_EXT_UI_ELEMENT_ACTIVATE_SIGNAL,
	GITG_EXT_UI_ELEMENT_NUM_SIGNALS
};
static guint gitg_ext_ui_element_signals[GITG_EXT_UI_ELEMENT_NUM_SIGNALS] = {0};

static gint gitg_ext_ui_element_real_negotiate_order (GitgExtUIElement* self,
                                               GitgExtUIElement* other);
static void gitg_ext_ui_element_real_activate (GitgExtUIElement* self);
static GType gitg_ext_ui_element_get_type_once (void);

/**
 * Negotiate the order with another UIElement.
 *
 * This method is used to determine the order in which elements need to
 * appear in the UI.
 *
 * @return -1 if the element should appear before @other, 1 if the
 *          element should appear after @other and 0 if the order is
 *          unimportant.
 *
 */
static gint
gitg_ext_ui_element_real_negotiate_order (GitgExtUIElement* self,
                                          GitgExtUIElement* other)
{
	gint result;
	g_return_val_if_fail (other != NULL, -1);
	result = 0;
	return result;
}

gint
gitg_ext_ui_element_negotiate_order (GitgExtUIElement* self,
                                     GitgExtUIElement* other)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->negotiate_order) {
		return _iface_->negotiate_order (self, other);
	}
	return -1;
}

GitgExtApplication*
gitg_ext_ui_element_get_application (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_application) {
		return _iface_->get_application (self);
	}
	return NULL;
}

void
gitg_ext_ui_element_set_application (GitgExtUIElement* self,
                                     GitgExtApplication* value)
{
	GitgExtUIElementIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->set_application) {
		_iface_->set_application (self, value);
	}
}

gchar*
gitg_ext_ui_element_get_id (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_id) {
		return _iface_->get_id (self);
	}
	return NULL;
}

gchar*
gitg_ext_ui_element_get_display_name (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_display_name) {
		return _iface_->get_display_name (self);
	}
	return NULL;
}

gchar*
gitg_ext_ui_element_get_description (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_description) {
		return _iface_->get_description (self);
	}
	return NULL;
}

gchar*
gitg_ext_ui_element_get_icon (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_icon) {
		return _iface_->get_icon (self);
	}
	return NULL;
}

static gchar*
gitg_ext_ui_element_real_get_icon (GitgExtUIElement* base)
{
	gchar* result;
	GitgExtUIElement* self;
	self = base;
	result = NULL;
	return result;
}

GtkWidget*
gitg_ext_ui_element_get_widget (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_widget) {
		return _iface_->get_widget (self);
	}
	return NULL;
}

static GtkWidget*
gitg_ext_ui_element_real_get_widget (GitgExtUIElement* base)
{
	GtkWidget* result;
	GitgExtUIElement* self;
	self = base;
	result = NULL;
	return result;
}

guint*
gitg_ext_ui_element_get_shortcut (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_shortcut) {
		return _iface_->get_shortcut (self);
	}
	return NULL;
}

static guint*
gitg_ext_ui_element_real_get_shortcut (GitgExtUIElement* base)
{
	guint* result;
	GitgExtUIElement* self;
	self = base;
	result = NULL;
	return result;
}

gboolean
gitg_ext_ui_element_get_available (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_available) {
		return _iface_->get_available (self);
	}
	return FALSE;
}

static gboolean
gitg_ext_ui_element_real_get_available (GitgExtUIElement* base)
{
	gboolean result;
	GitgExtUIElement* self;
	self = base;
	result = TRUE;
	return result;
}

gboolean
gitg_ext_ui_element_get_enabled (GitgExtUIElement* self)
{
	GitgExtUIElementIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = GITG_EXT_UI_ELEMENT_GET_INTERFACE (self);
	if (_iface_->get_enabled) {
		return _iface_->get_enabled (self);
	}
	return FALSE;
}

static gboolean
gitg_ext_ui_element_real_get_enabled (GitgExtUIElement* base)
{
	gboolean result;
	GitgExtUIElement* self;
	self = base;
	result = TRUE;
	return result;
}

static void
gitg_ext_ui_element_real_activate (GitgExtUIElement* self)
{
}

static void
gitg_ext_ui_element_default_init (GitgExtUIElementIface * iface,
                                  gpointer iface_data)
{
	/**
	 * The main gitg application interface.
	 *
	 * This property is a "construct"
	 * property and will be automatically set when an instance of the ui element
	 * object is created.
	 */
	g_object_interface_install_property (iface, g_param_spec_object ("application", "application", "application", GITG_EXT_TYPE_APPLICATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	/**
	 * A unique id for the ui element.
	 *
	 * Ids in gitg are normally of the form /org/gnome/gitg/...
	 */
	g_object_interface_install_property (iface, g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * The display name of the ui element.
	 *
	 * This should result in a string which can
	 * be displayed in the gitg UI to identify the element.
	 */
	g_object_interface_install_property (iface, g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * The description of the ui element.
	 *
	 * This should result in a string which can
	 * be displayed in the gitg UI to describe the element.
	 */
	g_object_interface_install_property (iface, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	iface->activate = gitg_ext_ui_element_real_activate;
	/**
	 * Activate the UIELement.
	 *
	 * This signal is emitted when the UIElement has been activated.
	 * Implementations can override the default handler to do any necessary
	 * setup when the ui element is activated.
	 */
	gitg_ext_ui_element_signals[GITG_EXT_UI_ELEMENT_ACTIVATE_SIGNAL] = g_signal_new ("activate", GITG_EXT_TYPE_UI_ELEMENT, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GitgExtUIElementIface, activate), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	iface->negotiate_order = gitg_ext_ui_element_real_negotiate_order;
	iface->get_icon = gitg_ext_ui_element_real_get_icon;
	iface->get_widget = gitg_ext_ui_element_real_get_widget;
	iface->get_shortcut = gitg_ext_ui_element_real_get_shortcut;
	iface->get_available = gitg_ext_ui_element_real_get_available;
	iface->get_enabled = gitg_ext_ui_element_real_get_enabled;
}

/**
 * gitg UIElement interface.
 *
 */
 G_GNUC_NO_INLINE static GType
gitg_ext_ui_element_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgExtUIElementIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_ext_ui_element_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gitg_ext_ui_element_type_id;
	gitg_ext_ui_element_type_id = g_type_register_static (G_TYPE_INTERFACE, "GitgExtUIElement", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (gitg_ext_ui_element_type_id, G_TYPE_OBJECT);
	return gitg_ext_ui_element_type_id;
}

GType
gitg_ext_ui_element_get_type (void)
{
	static gsize gitg_ext_ui_element_type_id__once = 0;
	if (g_once_init_enter (&gitg_ext_ui_element_type_id__once)) {
		GType gitg_ext_ui_element_type_id;
		gitg_ext_ui_element_type_id = gitg_ext_ui_element_get_type_once ();
		g_once_init_leave (&gitg_ext_ui_element_type_id__once, gitg_ext_ui_element_type_id);
	}
	return gitg_ext_ui_element_type_id__once;
}

