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

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

#include "shotwell-internal-publishing-gui.h"
#include <glib-object.h>
#include "shotwell-plugin-dev-1.0.h"
#include <glib.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_SUCCESS_PANE_0_PROPERTY,
	PUBLISHING_UI_SUCCESS_PANE_NUM_PROPERTIES
};
static GParamSpec* publishing_ui_success_pane_properties[PUBLISHING_UI_SUCCESS_PANE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

static gpointer publishing_ui_success_pane_parent_class = NULL;

static GType publishing_ui_success_pane_get_type_once (void);

PublishingUISuccessPane*
publishing_ui_success_pane_construct (GType object_type,
                                      SpitPublishingPublisherMediaType published_media,
                                      gint num_uploaded)
{
	PublishingUISuccessPane * self = NULL;
	gchar* message_string = NULL;
	const gchar* _tmp3_;
	message_string = NULL;
	if (published_media == SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_VIDEO) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (ngettext ("The selected video was successfully published.", "The selected videos were successfully published.", (gulong) num_uploaded));
		_g_free0 (message_string);
		message_string = _tmp0_;
	} else {
		if (published_media == SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO) {
			gchar* _tmp1_;
			_tmp1_ = g_strdup (ngettext ("The selected photo was successfully published.", "The selected photos were successfully published.", (gulong) num_uploaded));
			_g_free0 (message_string);
			message_string = _tmp1_;
		} else {
			if (published_media == (SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO | SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_VIDEO)) {
				gchar* _tmp2_;
				_tmp2_ = g_strdup (_ ("The selected photos/videos were successfully published."));
				_g_free0 (message_string);
				message_string = _tmp2_;
			} else {
				g_assert_not_reached ();
			}
		}
	}
	_tmp3_ = message_string;
	self = (PublishingUISuccessPane*) publishing_ui_static_message_pane_construct (object_type, _tmp3_, FALSE, FALSE);
	_g_free0 (message_string);
	return self;
}

PublishingUISuccessPane*
publishing_ui_success_pane_new (SpitPublishingPublisherMediaType published_media,
                                gint num_uploaded)
{
	return publishing_ui_success_pane_construct (PUBLISHING_UI_TYPE_SUCCESS_PANE, published_media, num_uploaded);
}

static void
publishing_ui_success_pane_class_init (PublishingUISuccessPaneClass * klass,
                                       gpointer klass_data)
{
	publishing_ui_success_pane_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_ui_success_pane_instance_init (PublishingUISuccessPane * self,
                                          gpointer klass)
{
}

static GType
publishing_ui_success_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingUISuccessPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_ui_success_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingUISuccessPane), 0, (GInstanceInitFunc) publishing_ui_success_pane_instance_init, NULL };
	GType publishing_ui_success_pane_type_id;
	publishing_ui_success_pane_type_id = g_type_register_static (PUBLISHING_UI_TYPE_STATIC_MESSAGE_PANE, "PublishingUISuccessPane", &g_define_type_info, 0);
	return publishing_ui_success_pane_type_id;
}

GType
publishing_ui_success_pane_get_type (void)
{
	static volatile gsize publishing_ui_success_pane_type_id__once = 0;
	if (g_once_init_enter (&publishing_ui_success_pane_type_id__once)) {
		GType publishing_ui_success_pane_type_id;
		publishing_ui_success_pane_type_id = publishing_ui_success_pane_get_type_once ();
		g_once_init_leave (&publishing_ui_success_pane_type_id__once, publishing_ui_success_pane_type_id);
	}
	return publishing_ui_success_pane_type_id__once;
}

