/* DeleteFinishBox.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from DeleteFinishBox.vala, do not modify */

/*
 * DeleteFinishBox.vala
 *
 * Copyright 2012-2018 Tony George <teejeetech@gmail.com>
 *
 * This program 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.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 *
 *
 */

#include <gtk/gtk.h>
#include <glib-object.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_DELETE_FINISH_BOX (delete_finish_box_get_type ())
#define DELETE_FINISH_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DELETE_FINISH_BOX, DeleteFinishBox))
#define DELETE_FINISH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DELETE_FINISH_BOX, DeleteFinishBoxClass))
#define IS_DELETE_FINISH_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DELETE_FINISH_BOX))
#define IS_DELETE_FINISH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DELETE_FINISH_BOX))
#define DELETE_FINISH_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DELETE_FINISH_BOX, DeleteFinishBoxClass))

typedef struct _DeleteFinishBox DeleteFinishBox;
typedef struct _DeleteFinishBoxClass DeleteFinishBoxClass;
typedef struct _DeleteFinishBoxPrivate DeleteFinishBoxPrivate;
enum  {
	DELETE_FINISH_BOX_0_PROPERTY,
	DELETE_FINISH_BOX_NUM_PROPERTIES
};
static GParamSpec* delete_finish_box_properties[DELETE_FINISH_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DeleteFinishBox {
	GtkBox parent_instance;
	DeleteFinishBoxPrivate * priv;
};

struct _DeleteFinishBoxClass {
	GtkBoxClass parent_class;
};

struct _DeleteFinishBoxPrivate {
	GtkLabel* lbl_header;
	GtkLabel* lbl_message;
	GtkWindow* parent_window;
};

static gint DeleteFinishBox_private_offset;
static gpointer delete_finish_box_parent_class = NULL;

VALA_EXTERN GType delete_finish_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DeleteFinishBox, g_object_unref)
VALA_EXTERN DeleteFinishBox* delete_finish_box_new (GtkWindow* _parent_window);
VALA_EXTERN DeleteFinishBox* delete_finish_box_construct (GType object_type,
                                              GtkWindow* _parent_window);
VALA_EXTERN void tee_jee_logging_log_debug (const gchar* message);
VALA_EXTERN GtkLabel* tee_jee_gtk_helper_add_label_header (GtkBox* box,
                                               const gchar* text,
                                               gboolean large_heading);
VALA_EXTERN GtkLabel* tee_jee_gtk_helper_add_label_scrolled (GtkBox* box,
                                                 const gchar* text,
                                                 gboolean show_border,
                                                 gboolean wrap,
                                                 gint ellipsize_chars);
VALA_EXTERN void delete_finish_box_update_message (DeleteFinishBox* self,
                                       gboolean success);
VALA_EXTERN gchar* tee_jee_gtk_helper_format_text (const gchar* text,
                                       gboolean bold,
                                       gboolean italic,
                                       gboolean large);
static void delete_finish_box_finalize (GObject * obj);
static GType delete_finish_box_get_type_once (void);

static inline gpointer
delete_finish_box_get_instance_private (DeleteFinishBox* self)
{
	return G_STRUCT_MEMBER_P (self, DeleteFinishBox_private_offset);
}

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

DeleteFinishBox*
delete_finish_box_construct (GType object_type,
                             GtkWindow* _parent_window)
{
	DeleteFinishBox * self = NULL;
	GtkWindow* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	g_return_val_if_fail (_parent_window != NULL, NULL);
	tee_jee_logging_log_debug ("DeleteFinishBox: DeleteFinishBox()");
	self = (DeleteFinishBox*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 6, NULL);
	_tmp0_ = _g_object_ref0 (_parent_window);
	_g_object_unref0 (self->priv->parent_window);
	self->priv->parent_window = _tmp0_;
	g_object_set ((GtkWidget*) self, "margin", 12, NULL);
	_tmp1_ = tee_jee_gtk_helper_add_label_header ((GtkBox*) self, _ ("Completed"), TRUE);
	_g_object_unref0 (self->priv->lbl_header);
	self->priv->lbl_header = _tmp1_;
	_tmp2_ = tee_jee_gtk_helper_add_label_scrolled ((GtkBox*) self, "", FALSE, TRUE, 0);
	_g_object_unref0 (self->priv->lbl_message);
	self->priv->lbl_message = _tmp2_;
	tee_jee_logging_log_debug ("DeleteFinishBox: DeleteFinishBox(): exit");
	return self;
}

DeleteFinishBox*
delete_finish_box_new (GtkWindow* _parent_window)
{
	return delete_finish_box_construct (TYPE_DELETE_FINISH_BOX, _parent_window);
}

void
delete_finish_box_update_message (DeleteFinishBox* self,
                                  gboolean success)
{
	gchar* txt = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GtkLabel* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* msg = NULL;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	GtkLabel* _tmp19_;
	const gchar* _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("");
	txt = _tmp0_;
	_tmp1_ = g_strdup (_ ("Snapshot(s) Deleted"));
	_g_free0 (txt);
	txt = _tmp1_;
	if (!success) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp2_ = txt;
		_tmp3_ = g_strconcat (" ", _ ("With Errors"), NULL);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strconcat (_tmp2_, _tmp4_, NULL);
		_g_free0 (txt);
		txt = _tmp5_;
		_g_free0 (_tmp4_);
	}
	_tmp6_ = self->priv->lbl_header;
	_tmp7_ = txt;
	_tmp8_ = tee_jee_gtk_helper_format_text (_tmp7_, TRUE, FALSE, TRUE);
	_tmp9_ = _tmp8_;
	gtk_label_set_label (_tmp6_, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = g_strdup ("");
	msg = _tmp10_;
	_tmp11_ = msg;
	_tmp12_ = g_strconcat (_tmp11_, "\n", NULL);
	_g_free0 (msg);
	msg = _tmp12_;
	_tmp13_ = msg;
	_tmp14_ = g_strconcat ("<b>", _ ("Close window to exit"), NULL);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strconcat (_tmp15_, "</b>\n\n", NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strconcat (_tmp13_, _tmp17_, NULL);
	_g_free0 (msg);
	msg = _tmp18_;
	_g_free0 (_tmp17_);
	_g_free0 (_tmp15_);
	_tmp19_ = self->priv->lbl_message;
	_tmp20_ = msg;
	gtk_label_set_label (_tmp19_, _tmp20_);
	_g_free0 (msg);
	_g_free0 (txt);
}

static void
delete_finish_box_class_init (DeleteFinishBoxClass * klass,
                              gpointer klass_data)
{
	delete_finish_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DeleteFinishBox_private_offset);
	G_OBJECT_CLASS (klass)->finalize = delete_finish_box_finalize;
}

static void
delete_finish_box_instance_init (DeleteFinishBox * self,
                                 gpointer klass)
{
	self->priv = delete_finish_box_get_instance_private (self);
}

static void
delete_finish_box_finalize (GObject * obj)
{
	DeleteFinishBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DELETE_FINISH_BOX, DeleteFinishBox);
	_g_object_unref0 (self->priv->lbl_header);
	_g_object_unref0 (self->priv->lbl_message);
	_g_object_unref0 (self->priv->parent_window);
	G_OBJECT_CLASS (delete_finish_box_parent_class)->finalize (obj);
}

static GType
delete_finish_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DeleteFinishBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) delete_finish_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DeleteFinishBox), 0, (GInstanceInitFunc) delete_finish_box_instance_init, NULL };
	GType delete_finish_box_type_id;
	delete_finish_box_type_id = g_type_register_static (gtk_box_get_type (), "DeleteFinishBox", &g_define_type_info, 0);
	DeleteFinishBox_private_offset = g_type_add_instance_private (delete_finish_box_type_id, sizeof (DeleteFinishBoxPrivate));
	return delete_finish_box_type_id;
}

GType
delete_finish_box_get_type (void)
{
	static volatile gsize delete_finish_box_type_id__once = 0;
	if (g_once_init_enter (&delete_finish_box_type_id__once)) {
		GType delete_finish_box_type_id;
		delete_finish_box_type_id = delete_finish_box_get_type_once ();
		g_once_init_leave (&delete_finish_box_type_id__once, delete_finish_box_type_id);
	}
	return delete_finish_box_type_id__once;
}

