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

/* Copyright 2016 Software Freedom Conservancy Inc.
 * Copyright 2019 Jens Georg <mail@jensge.org>
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */

#include "shotwell-internal-publishing-gui.h"
#include <glib.h>
#include <gtk/gtk.h>
#include "shotwell-plugin-dev-1.0.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.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  {
	PUBLISHING_UI_STATIC_MESSAGE_PANE_0_PROPERTY,
	PUBLISHING_UI_STATIC_MESSAGE_PANE_SHOW_SPINNER_PROPERTY,
	PUBLISHING_UI_STATIC_MESSAGE_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_ui_static_message_pane_properties[PUBLISHING_UI_STATIC_MESSAGE_PANE_NUM_PROPERTIES];
enum  {
	PUBLISHING_UI_ACCOUNT_FETCH_WAIT_PANE_0_PROPERTY,
	PUBLISHING_UI_ACCOUNT_FETCH_WAIT_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_ui_account_fetch_wait_pane_properties[PUBLISHING_UI_ACCOUNT_FETCH_WAIT_PANE_NUM_PROPERTIES];
enum  {
	PUBLISHING_UI_LOGIN_WAIT_PANE_0_PROPERTY,
	PUBLISHING_UI_LOGIN_WAIT_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_ui_login_wait_pane_properties[PUBLISHING_UI_LOGIN_WAIT_PANE_NUM_PROPERTIES];

struct _PublishingUIStaticMessagePanePrivate {
	gboolean _show_spinner;
	GtkLabel* static_msg_label;
	GtkSpinner* spinner;
};

static gint PublishingUIStaticMessagePane_private_offset;
static gpointer publishing_ui_static_message_pane_parent_class = NULL;
static SpitPublishingDialogPaneIface * publishing_ui_static_message_pane_spit_publishing_dialog_pane_parent_iface = NULL;
static gpointer publishing_ui_account_fetch_wait_pane_parent_class = NULL;
static gpointer publishing_ui_login_wait_pane_parent_class = NULL;

static GtkWidget* publishing_ui_static_message_pane_real_get_widget (SpitPublishingDialogPane* base);
static SpitPublishingDialogPaneGeometryOptions publishing_ui_static_message_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base);
static void publishing_ui_static_message_pane_real_on_pane_installed (SpitPublishingDialogPane* base);
static void publishing_ui_static_message_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base);
static void publishing_ui_static_message_pane_finalize (GObject * obj);
static GType publishing_ui_static_message_pane_get_type_once (void);
static void _vala_publishing_ui_static_message_pane_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec);
static void _vala_publishing_ui_static_message_pane_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec);
static GType publishing_ui_account_fetch_wait_pane_get_type_once (void);
static GType publishing_ui_login_wait_pane_get_type_once (void);

static inline gpointer
publishing_ui_static_message_pane_get_instance_private (PublishingUIStaticMessagePane* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingUIStaticMessagePane_private_offset);
}

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

static GtkWidget*
publishing_ui_static_message_pane_real_get_widget (SpitPublishingDialogPane* base)
{
	PublishingUIStaticMessagePane * self;
	GtkWidget* _tmp0_;
	GtkWidget* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, PublishingUIStaticMessagePane);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	result = _tmp0_;
	return result;
}

static SpitPublishingDialogPaneGeometryOptions
publishing_ui_static_message_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base)
{
	PublishingUIStaticMessagePane * self;
	SpitPublishingDialogPaneGeometryOptions result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, PublishingUIStaticMessagePane);
	result = SPIT_PUBLISHING_DIALOG_PANE_GEOMETRY_OPTIONS_NONE;
	return result;
}

static void
publishing_ui_static_message_pane_real_on_pane_installed (SpitPublishingDialogPane* base)
{
	PublishingUIStaticMessagePane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, PublishingUIStaticMessagePane);
}

static void
publishing_ui_static_message_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base)
{
	PublishingUIStaticMessagePane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, PublishingUIStaticMessagePane);
}

PublishingUIStaticMessagePane*
publishing_ui_static_message_pane_construct (GType object_type,
                                             const gchar* message_string,
                                             gboolean enable_markup,
                                             gboolean show_spinner)
{
	PublishingUIStaticMessagePane * self = NULL;
	GtkSpinner* _tmp0_;
	g_return_val_if_fail (message_string != NULL, NULL);
	self = (PublishingUIStaticMessagePane*) g_object_new (object_type, "show-spinner", FALSE, NULL);
	_tmp0_ = self->priv->spinner;
	g_object_set (_tmp0_, "active", show_spinner, NULL);
	if (enable_markup) {
		GtkLabel* _tmp1_;
		GtkLabel* _tmp2_;
		GtkLabel* _tmp3_;
		_tmp1_ = self->priv->static_msg_label;
		gtk_label_set_markup (_tmp1_, message_string);
		_tmp2_ = self->priv->static_msg_label;
		gtk_label_set_line_wrap (_tmp2_, TRUE);
		_tmp3_ = self->priv->static_msg_label;
		gtk_label_set_use_markup (_tmp3_, TRUE);
	} else {
		GtkLabel* _tmp4_;
		_tmp4_ = self->priv->static_msg_label;
		gtk_label_set_label (_tmp4_, message_string);
	}
	return self;
}

PublishingUIStaticMessagePane*
publishing_ui_static_message_pane_new (const gchar* message_string,
                                       gboolean enable_markup,
                                       gboolean show_spinner)
{
	return publishing_ui_static_message_pane_construct (PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, message_string, enable_markup, show_spinner);
}

gboolean
publishing_ui_static_message_pane_get_show_spinner (PublishingUIStaticMessagePane* self)
{
	gboolean result;
	g_return_val_if_fail (PUBLISHING_UI_IS_STATIC_MESSAGE_PANE (self), FALSE);
	result = self->priv->_show_spinner;
	return result;
}

static void
publishing_ui_static_message_pane_set_show_spinner (PublishingUIStaticMessagePane* self,
                                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (PUBLISHING_UI_IS_STATIC_MESSAGE_PANE (self));
	old_value = publishing_ui_static_message_pane_get_show_spinner (self);
	if (old_value != value) {
		self->priv->_show_spinner = value;
		g_object_notify_by_pspec ((GObject *) self, publishing_ui_static_message_pane_properties[PUBLISHING_UI_STATIC_MESSAGE_PANE_SHOW_SPINNER_PROPERTY]);
	}
}

static void
publishing_ui_static_message_pane_class_init (PublishingUIStaticMessagePaneClass * klass,
                                              gpointer klass_data)
{
	publishing_ui_static_message_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingUIStaticMessagePane_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_publishing_ui_static_message_pane_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_publishing_ui_static_message_pane_set_property;
	G_OBJECT_CLASS (klass)->finalize = publishing_ui_static_message_pane_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PUBLISHING_UI_STATIC_MESSAGE_PANE_SHOW_SPINNER_PROPERTY, publishing_ui_static_message_pane_properties[PUBLISHING_UI_STATIC_MESSAGE_PANE_SHOW_SPINNER_PROPERTY] = g_param_spec_boolean ("show-spinner", "show-spinner", "show-spinner", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/static_message_pane_widget.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "static_msg_label", FALSE, PublishingUIStaticMessagePane_private_offset + G_STRUCT_OFFSET (PublishingUIStaticMessagePanePrivate, static_msg_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spinner", FALSE, PublishingUIStaticMessagePane_private_offset + G_STRUCT_OFFSET (PublishingUIStaticMessagePanePrivate, spinner));
}

static void
publishing_ui_static_message_pane_spit_publishing_dialog_pane_interface_init (SpitPublishingDialogPaneIface * iface,
                                                                              gpointer iface_data)
{
	publishing_ui_static_message_pane_spit_publishing_dialog_pane_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_widget = (GtkWidget* (*) (SpitPublishingDialogPane*)) publishing_ui_static_message_pane_real_get_widget;
	iface->get_preferred_geometry = (SpitPublishingDialogPaneGeometryOptions (*) (SpitPublishingDialogPane*)) publishing_ui_static_message_pane_real_get_preferred_geometry;
	iface->on_pane_installed = (void (*) (SpitPublishingDialogPane*)) publishing_ui_static_message_pane_real_on_pane_installed;
	iface->on_pane_uninstalled = (void (*) (SpitPublishingDialogPane*)) publishing_ui_static_message_pane_real_on_pane_uninstalled;
}

static void
publishing_ui_static_message_pane_instance_init (PublishingUIStaticMessagePane * self,
                                                 gpointer klass)
{
	self->priv = publishing_ui_static_message_pane_get_instance_private (self);
	self->priv->_show_spinner = FALSE;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
publishing_ui_static_message_pane_finalize (GObject * obj)
{
	PublishingUIStaticMessagePane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, PublishingUIStaticMessagePane);
	G_OBJECT_CLASS (publishing_ui_static_message_pane_parent_class)->finalize (obj);
}

static GType
publishing_ui_static_message_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingUIStaticMessagePaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_ui_static_message_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingUIStaticMessagePane), 0, (GInstanceInitFunc) publishing_ui_static_message_pane_instance_init, NULL };
	static const GInterfaceInfo spit_publishing_dialog_pane_info = { (GInterfaceInitFunc) publishing_ui_static_message_pane_spit_publishing_dialog_pane_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType publishing_ui_static_message_pane_type_id;
	publishing_ui_static_message_pane_type_id = g_type_register_static (gtk_box_get_type (), "PublishingUIStaticMessagePane", &g_define_type_info, 0);
	g_type_add_interface_static (publishing_ui_static_message_pane_type_id, SPIT_PUBLISHING_TYPE_DIALOG_PANE, &spit_publishing_dialog_pane_info);
	PublishingUIStaticMessagePane_private_offset = g_type_add_instance_private (publishing_ui_static_message_pane_type_id, sizeof (PublishingUIStaticMessagePanePrivate));
	return publishing_ui_static_message_pane_type_id;
}

GType
publishing_ui_static_message_pane_get_type (void)
{
	static volatile gsize publishing_ui_static_message_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_ui_static_message_pane_type_id__once)) {
		GType publishing_ui_static_message_pane_type_id;
		publishing_ui_static_message_pane_type_id = publishing_ui_static_message_pane_get_type_once ();
		g_once_init_leave (&publishing_ui_static_message_pane_type_id__once, publishing_ui_static_message_pane_type_id);
	}
	return publishing_ui_static_message_pane_type_id__once;
}

static void
_vala_publishing_ui_static_message_pane_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec)
{
	PublishingUIStaticMessagePane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, PublishingUIStaticMessagePane);
	switch (property_id) {
		case PUBLISHING_UI_STATIC_MESSAGE_PANE_SHOW_SPINNER_PROPERTY:
		g_value_set_boolean (value, publishing_ui_static_message_pane_get_show_spinner (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_publishing_ui_static_message_pane_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec)
{
	PublishingUIStaticMessagePane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, PublishingUIStaticMessagePane);
	switch (property_id) {
		case PUBLISHING_UI_STATIC_MESSAGE_PANE_SHOW_SPINNER_PROPERTY:
		publishing_ui_static_message_pane_set_show_spinner (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

PublishingUIAccountFetchWaitPane*
publishing_ui_account_fetch_wait_pane_construct (GType object_type)
{
	PublishingUIAccountFetchWaitPane * self = NULL;
	self = (PublishingUIAccountFetchWaitPane*) publishing_ui_static_message_pane_construct (object_type, _ ("Fetching account information…"), FALSE, TRUE);
	return self;
}

PublishingUIAccountFetchWaitPane*
publishing_ui_account_fetch_wait_pane_new (void)
{
	return publishing_ui_account_fetch_wait_pane_construct (PUBLISHING_UI_TYPE_ACCOUNT_FETCH_WAIT_PANE);
}

static void
publishing_ui_account_fetch_wait_pane_class_init (PublishingUIAccountFetchWaitPaneClass * klass,
                                                  gpointer klass_data)
{
	publishing_ui_account_fetch_wait_pane_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_ui_account_fetch_wait_pane_instance_init (PublishingUIAccountFetchWaitPane * self,
                                                     gpointer klass)
{
}

static GType
publishing_ui_account_fetch_wait_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingUIAccountFetchWaitPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_ui_account_fetch_wait_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingUIAccountFetchWaitPane), 0, (GInstanceInitFunc) publishing_ui_account_fetch_wait_pane_instance_init, NULL };
	GType publishing_ui_account_fetch_wait_pane_type_id;
	publishing_ui_account_fetch_wait_pane_type_id = g_type_register_static (PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, "PublishingUIAccountFetchWaitPane", &g_define_type_info, 0);
	return publishing_ui_account_fetch_wait_pane_type_id;
}

GType
publishing_ui_account_fetch_wait_pane_get_type (void)
{
	static volatile gsize publishing_ui_account_fetch_wait_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_ui_account_fetch_wait_pane_type_id__once)) {
		GType publishing_ui_account_fetch_wait_pane_type_id;
		publishing_ui_account_fetch_wait_pane_type_id = publishing_ui_account_fetch_wait_pane_get_type_once ();
		g_once_init_leave (&publishing_ui_account_fetch_wait_pane_type_id__once, publishing_ui_account_fetch_wait_pane_type_id);
	}
	return publishing_ui_account_fetch_wait_pane_type_id__once;
}

PublishingUILoginWaitPane*
publishing_ui_login_wait_pane_construct (GType object_type)
{
	PublishingUILoginWaitPane * self = NULL;
	self = (PublishingUILoginWaitPane*) publishing_ui_static_message_pane_construct (object_type, _ ("Logging in…"), FALSE, TRUE);
	return self;
}

PublishingUILoginWaitPane*
publishing_ui_login_wait_pane_new (void)
{
	return publishing_ui_login_wait_pane_construct (PUBLISHING_UI_TYPE_LOGIN_WAIT_PANE);
}

static void
publishing_ui_login_wait_pane_class_init (PublishingUILoginWaitPaneClass * klass,
                                          gpointer klass_data)
{
	publishing_ui_login_wait_pane_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_ui_login_wait_pane_instance_init (PublishingUILoginWaitPane * self,
                                             gpointer klass)
{
}

static GType
publishing_ui_login_wait_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingUILoginWaitPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_ui_login_wait_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingUILoginWaitPane), 0, (GInstanceInitFunc) publishing_ui_login_wait_pane_instance_init, NULL };
	GType publishing_ui_login_wait_pane_type_id;
	publishing_ui_login_wait_pane_type_id = g_type_register_static (PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, "PublishingUILoginWaitPane", &g_define_type_info, 0);
	return publishing_ui_login_wait_pane_type_id;
}

GType
publishing_ui_login_wait_pane_get_type (void)
{
	static volatile gsize publishing_ui_login_wait_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_ui_login_wait_pane_type_id__once)) {
		GType publishing_ui_login_wait_pane_type_id;
		publishing_ui_login_wait_pane_type_id = publishing_ui_login_wait_pane_get_type_once ();
		g_once_init_leave (&publishing_ui_login_wait_pane_type_id__once, publishing_ui_login_wait_pane_type_id);
	}
	return publishing_ui_login_wait_pane_type_id__once;
}

