/* LoginWelcomePaneWidget.c generated by valac 0.56.19, the Vala compiler
 * generated from LoginWelcomePaneWidget.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 <gtk/gtk.h>
#include "shotwell-plugin-dev-1.0.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.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  {
	PUBLISHING_UI_LOGIN_WELCOME_PANE_0_PROPERTY,
	PUBLISHING_UI_LOGIN_WELCOME_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_ui_login_welcome_pane_properties[PUBLISHING_UI_LOGIN_WELCOME_PANE_NUM_PROPERTIES];
enum  {
	PUBLISHING_UI_LOGIN_WELCOME_PANE_LOGIN_REQUESTED_SIGNAL,
	PUBLISHING_UI_LOGIN_WELCOME_PANE_NUM_SIGNALS
};
static guint publishing_ui_login_welcome_pane_signals[PUBLISHING_UI_LOGIN_WELCOME_PANE_NUM_SIGNALS] = {0};

struct _PublishingUILoginWelcomePanePrivate {
	GtkButton* login_button;
	GtkLabel* not_logged_in_label;
};

static gint PublishingUILoginWelcomePane_private_offset;
static gpointer publishing_ui_login_welcome_pane_parent_class = NULL;
static SpitPublishingDialogPaneIface * publishing_ui_login_welcome_pane_spit_publishing_dialog_pane_parent_iface = NULL;

static GtkWidget* publishing_ui_login_welcome_pane_real_get_widget (SpitPublishingDialogPane* base);
static SpitPublishingDialogPaneGeometryOptions publishing_ui_login_welcome_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base);
static void publishing_ui_login_welcome_pane_real_on_pane_installed (SpitPublishingDialogPane* base);
static void publishing_ui_login_welcome_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base);
static void publishing_ui_login_welcome_pane_on_login_clicked (PublishingUILoginWelcomePane* self);
static void _publishing_ui_login_welcome_pane_on_login_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                            gpointer self);
static void publishing_ui_login_welcome_pane_finalize (GObject * obj);
static GType publishing_ui_login_welcome_pane_get_type_once (void);

static inline gpointer
publishing_ui_login_welcome_pane_get_instance_private (PublishingUILoginWelcomePane* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingUILoginWelcomePane_private_offset);
}

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

static GtkWidget*
publishing_ui_login_welcome_pane_real_get_widget (SpitPublishingDialogPane* base)
{
	PublishingUILoginWelcomePane * self;
	GtkWidget* _tmp0_;
	GtkWidget* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_UI_TYPE_LOGIN_WELCOME_PANE, PublishingUILoginWelcomePane);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	result = _tmp0_;
	return result;
}

static SpitPublishingDialogPaneGeometryOptions
publishing_ui_login_welcome_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base)
{
	PublishingUILoginWelcomePane * self;
	SpitPublishingDialogPaneGeometryOptions result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_UI_TYPE_LOGIN_WELCOME_PANE, PublishingUILoginWelcomePane);
	result = SPIT_PUBLISHING_DIALOG_PANE_GEOMETRY_OPTIONS_NONE;
	return result;
}

static void
publishing_ui_login_welcome_pane_real_on_pane_installed (SpitPublishingDialogPane* base)
{
	PublishingUILoginWelcomePane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_UI_TYPE_LOGIN_WELCOME_PANE, PublishingUILoginWelcomePane);
}

static void
publishing_ui_login_welcome_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base)
{
	PublishingUILoginWelcomePane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_UI_TYPE_LOGIN_WELCOME_PANE, PublishingUILoginWelcomePane);
}

static void
_publishing_ui_login_welcome_pane_on_login_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self)
{
	publishing_ui_login_welcome_pane_on_login_clicked ((PublishingUILoginWelcomePane*) self);
}

PublishingUILoginWelcomePane*
publishing_ui_login_welcome_pane_construct (GType object_type,
                                            const gchar* service_welcome_message)
{
	PublishingUILoginWelcomePane * self = NULL;
	GtkButton* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	g_return_val_if_fail (service_welcome_message != NULL, NULL);
	self = (PublishingUILoginWelcomePane*) g_object_new (object_type, NULL);
	_tmp0_ = self->priv->login_button;
	g_signal_connect_object (_tmp0_, "clicked", (GCallback) _publishing_ui_login_welcome_pane_on_login_clicked_gtk_button_clicked, self, 0);
	_tmp1_ = self->priv->not_logged_in_label;
	gtk_label_set_use_markup (_tmp1_, TRUE);
	_tmp2_ = self->priv->not_logged_in_label;
	gtk_label_set_markup (_tmp2_, service_welcome_message);
	return self;
}

PublishingUILoginWelcomePane*
publishing_ui_login_welcome_pane_new (const gchar* service_welcome_message)
{
	return publishing_ui_login_welcome_pane_construct (PUBLISHING_UI_TYPE_LOGIN_WELCOME_PANE, service_welcome_message);
}

static void
publishing_ui_login_welcome_pane_on_login_clicked (PublishingUILoginWelcomePane* self)
{
	g_return_if_fail (PUBLISHING_UI_IS_LOGIN_WELCOME_PANE (self));
	g_signal_emit (self, publishing_ui_login_welcome_pane_signals[PUBLISHING_UI_LOGIN_WELCOME_PANE_LOGIN_REQUESTED_SIGNAL], 0);
}

static void
publishing_ui_login_welcome_pane_class_init (PublishingUILoginWelcomePaneClass * klass,
                                             gpointer klass_data)
{
	publishing_ui_login_welcome_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingUILoginWelcomePane_private_offset);
	G_OBJECT_CLASS (klass)->finalize = publishing_ui_login_welcome_pane_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/login_welcome_pane_widget.ui");
	publishing_ui_login_welcome_pane_signals[PUBLISHING_UI_LOGIN_WELCOME_PANE_LOGIN_REQUESTED_SIGNAL] = g_signal_new ("login-requested", PUBLISHING_UI_TYPE_LOGIN_WELCOME_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "login_button", FALSE, PublishingUILoginWelcomePane_private_offset + G_STRUCT_OFFSET (PublishingUILoginWelcomePanePrivate, login_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "not_logged_in_label", FALSE, PublishingUILoginWelcomePane_private_offset + G_STRUCT_OFFSET (PublishingUILoginWelcomePanePrivate, not_logged_in_label));
}

static void
publishing_ui_login_welcome_pane_spit_publishing_dialog_pane_interface_init (SpitPublishingDialogPaneIface * iface,
                                                                             gpointer iface_data)
{
	publishing_ui_login_welcome_pane_spit_publishing_dialog_pane_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_widget = (GtkWidget* (*) (SpitPublishingDialogPane*)) publishing_ui_login_welcome_pane_real_get_widget;
	iface->get_preferred_geometry = (SpitPublishingDialogPaneGeometryOptions (*) (SpitPublishingDialogPane*)) publishing_ui_login_welcome_pane_real_get_preferred_geometry;
	iface->on_pane_installed = (void (*) (SpitPublishingDialogPane*)) publishing_ui_login_welcome_pane_real_on_pane_installed;
	iface->on_pane_uninstalled = (void (*) (SpitPublishingDialogPane*)) publishing_ui_login_welcome_pane_real_on_pane_uninstalled;
}

static void
publishing_ui_login_welcome_pane_instance_init (PublishingUILoginWelcomePane * self,
                                                gpointer klass)
{
	self->priv = publishing_ui_login_welcome_pane_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
publishing_ui_login_welcome_pane_finalize (GObject * obj)
{
	PublishingUILoginWelcomePane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_UI_TYPE_LOGIN_WELCOME_PANE, PublishingUILoginWelcomePane);
	G_OBJECT_CLASS (publishing_ui_login_welcome_pane_parent_class)->finalize (obj);
}

static GType
publishing_ui_login_welcome_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingUILoginWelcomePaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_ui_login_welcome_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingUILoginWelcomePane), 0, (GInstanceInitFunc) publishing_ui_login_welcome_pane_instance_init, NULL };
	static const GInterfaceInfo spit_publishing_dialog_pane_info = { (GInterfaceInitFunc) publishing_ui_login_welcome_pane_spit_publishing_dialog_pane_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType publishing_ui_login_welcome_pane_type_id;
	publishing_ui_login_welcome_pane_type_id = g_type_register_static (gtk_box_get_type (), "PublishingUILoginWelcomePane", &g_define_type_info, 0);
	g_type_add_interface_static (publishing_ui_login_welcome_pane_type_id, SPIT_PUBLISHING_TYPE_DIALOG_PANE, &spit_publishing_dialog_pane_info);
	PublishingUILoginWelcomePane_private_offset = g_type_add_instance_private (publishing_ui_login_welcome_pane_type_id, sizeof (PublishingUILoginWelcomePanePrivate));
	return publishing_ui_login_welcome_pane_type_id;
}

GType
publishing_ui_login_welcome_pane_get_type (void)
{
	static volatile gsize publishing_ui_login_welcome_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_ui_login_welcome_pane_type_id__once)) {
		GType publishing_ui_login_welcome_pane_type_id;
		publishing_ui_login_welcome_pane_type_id = publishing_ui_login_welcome_pane_get_type_once ();
		g_once_init_leave (&publishing_ui_login_welcome_pane_type_id__once, publishing_ui_login_welcome_pane_type_id);
	}
	return publishing_ui_login_welcome_pane_type_id__once;
}

