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

/*
* Copyright (c) 2019 Murilo Venturoso
*
* 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 3 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
*
* Authored by: Murilo Venturoso <muriloventuroso@gmail.com>
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <granite.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>

#define PDFTRICKS_APPLICATION_ACTION_PREFIX "win."
#define PDFTRICKS_APPLICATION_ACTION_COMPRESS_PDF "action_compress_pdf"
#define PDFTRICKS_APPLICATION_ACTION_SPLIT_PDF "action_split_pdf"
#define PDFTRICKS_APPLICATION_ACTION_MERGE_PDF "action_merge_pdf"
#define PDFTRICKS_APPLICATION_ACTION_CONVERT_PDF "action_convert_pdf"
#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 PDFTRICKS_TYPE_WELCOME (pdftricks_welcome_get_type ())
#define PDFTRICKS_WELCOME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFTRICKS_TYPE_WELCOME, pdftricksWelcome))
#define PDFTRICKS_WELCOME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFTRICKS_TYPE_WELCOME, pdftricksWelcomeClass))
#define PDFTRICKS_IS_WELCOME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFTRICKS_TYPE_WELCOME))
#define PDFTRICKS_IS_WELCOME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFTRICKS_TYPE_WELCOME))
#define PDFTRICKS_WELCOME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFTRICKS_TYPE_WELCOME, pdftricksWelcomeClass))

typedef struct _pdftricksWelcome pdftricksWelcome;
typedef struct _pdftricksWelcomeClass pdftricksWelcomeClass;
typedef struct _pdftricksWelcomePrivate pdftricksWelcomePrivate;
enum  {
	PDFTRICKS_WELCOME_0_PROPERTY,
	PDFTRICKS_WELCOME_NUM_PROPERTIES
};
static GParamSpec* pdftricks_welcome_properties[PDFTRICKS_WELCOME_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _pdftricksWelcome {
	GtkGrid parent_instance;
	pdftricksWelcomePrivate * priv;
};

struct _pdftricksWelcomeClass {
	GtkGridClass parent_class;
};

static gpointer pdftricks_welcome_parent_class = NULL;

VALA_EXTERN GType pdftricks_welcome_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdftricksWelcome, g_object_unref)
VALA_EXTERN pdftricksWelcome* pdftricks_welcome_new (void);
VALA_EXTERN pdftricksWelcome* pdftricks_welcome_construct (GType object_type);
static GObject * pdftricks_welcome_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties);
static GType pdftricks_welcome_get_type_once (void);

pdftricksWelcome*
pdftricks_welcome_construct (GType object_type)
{
	pdftricksWelcome * self = NULL;
	self = (pdftricksWelcome*) g_object_new (object_type, NULL);
	return self;
}

pdftricksWelcome*
pdftricks_welcome_new (void)
{
	return pdftricks_welcome_construct (PDFTRICKS_TYPE_WELCOME);
}

static GObject *
pdftricks_welcome_constructor (GType type,
                               guint n_construct_properties,
                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	pdftricksWelcome * self;
	GraniteWidgetsWelcome* welcome = NULL;
	GraniteWidgetsWelcome* _tmp0_;
	GraniteWidgetsWelcome* _tmp1_;
	GraniteWidgetsWelcome* _tmp2_;
	GraniteWidgetsWelcome* _tmp3_;
	GraniteWidgetsWelcome* _tmp4_;
	GraniteWidgetsWelcome* _tmp5_;
	GraniteWidgetsWelcome* _tmp6_;
	GraniteWidgetsWelcomeButton* _tmp7_;
	GraniteWidgetsWelcomeButton* _tmp8_;
	GraniteWidgetsWelcome* _tmp9_;
	GraniteWidgetsWelcomeButton* _tmp10_;
	GraniteWidgetsWelcomeButton* _tmp11_;
	GraniteWidgetsWelcome* _tmp12_;
	GraniteWidgetsWelcomeButton* _tmp13_;
	GraniteWidgetsWelcomeButton* _tmp14_;
	GraniteWidgetsWelcome* _tmp15_;
	GraniteWidgetsWelcomeButton* _tmp16_;
	GraniteWidgetsWelcomeButton* _tmp17_;
	parent_class = G_OBJECT_CLASS (pdftricks_welcome_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PDFTRICKS_TYPE_WELCOME, pdftricksWelcome);
	_tmp0_ = granite_widgets_welcome_new ("PDF Tricks", _ ("Tricks for PDF files"));
	g_object_ref_sink (_tmp0_);
	welcome = _tmp0_;
	_tmp1_ = welcome;
	granite_widgets_welcome_append (_tmp1_, "compress-pdf", _ ("Compress PDF"), _ ("Compress a PDF file to get the same quality with reduced filesize."));
	_tmp2_ = welcome;
	granite_widgets_welcome_append (_tmp2_, "split-pdf", _ ("Split PDF"), _ ("Split a PDF file by page ranges, or extract all PDF pages to multiple " \
"PDF files."));
	_tmp3_ = welcome;
	granite_widgets_welcome_append (_tmp3_, "merge-pdf", _ ("Merge PDF"), _ ("Select multiple PDF files or images, and merge them in seconds."));
	_tmp4_ = welcome;
	granite_widgets_welcome_append (_tmp4_, "pdf-convert", _ ("Convert PDF"), _ ("Convert PDF files to JPG, PNG and TXT formats."));
	_tmp5_ = welcome;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp5_);
	_tmp6_ = welcome;
	_tmp7_ = granite_widgets_welcome_get_button_from_index (_tmp6_, 0);
	_tmp8_ = _tmp7_;
	gtk_actionable_set_action_name ((GtkActionable*) _tmp8_, PDFTRICKS_APPLICATION_ACTION_PREFIX PDFTRICKS_APPLICATION_ACTION_COMPRESS_PDF);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = welcome;
	_tmp10_ = granite_widgets_welcome_get_button_from_index (_tmp9_, 1);
	_tmp11_ = _tmp10_;
	gtk_actionable_set_action_name ((GtkActionable*) _tmp11_, PDFTRICKS_APPLICATION_ACTION_PREFIX PDFTRICKS_APPLICATION_ACTION_SPLIT_PDF);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = welcome;
	_tmp13_ = granite_widgets_welcome_get_button_from_index (_tmp12_, 2);
	_tmp14_ = _tmp13_;
	gtk_actionable_set_action_name ((GtkActionable*) _tmp14_, PDFTRICKS_APPLICATION_ACTION_PREFIX PDFTRICKS_APPLICATION_ACTION_MERGE_PDF);
	_g_object_unref0 (_tmp14_);
	_tmp15_ = welcome;
	_tmp16_ = granite_widgets_welcome_get_button_from_index (_tmp15_, 3);
	_tmp17_ = _tmp16_;
	gtk_actionable_set_action_name ((GtkActionable*) _tmp17_, PDFTRICKS_APPLICATION_ACTION_PREFIX PDFTRICKS_APPLICATION_ACTION_CONVERT_PDF);
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (welcome);
	return obj;
}

static void
pdftricks_welcome_class_init (pdftricksWelcomeClass * klass,
                              gpointer klass_data)
{
	pdftricks_welcome_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = pdftricks_welcome_constructor;
}

static void
pdftricks_welcome_instance_init (pdftricksWelcome * self,
                                 gpointer klass)
{
}

static GType
pdftricks_welcome_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (pdftricksWelcomeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdftricks_welcome_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdftricksWelcome), 0, (GInstanceInitFunc) pdftricks_welcome_instance_init, NULL };
	GType pdftricks_welcome_type_id;
	pdftricks_welcome_type_id = g_type_register_static (gtk_grid_get_type (), "pdftricksWelcome", &g_define_type_info, 0);
	return pdftricks_welcome_type_id;
}

GType
pdftricks_welcome_get_type (void)
{
	static volatile gsize pdftricks_welcome_type_id__once = 0;
	if (g_once_init_enter (&pdftricks_welcome_type_id__once)) {
		GType pdftricks_welcome_type_id;
		pdftricks_welcome_type_id = pdftricks_welcome_get_type_once ();
		g_once_init_leave (&pdftricks_welcome_type_id__once, pdftricks_welcome_type_id);
	}
	return pdftricks_welcome_type_id__once;
}

