/* timer-setup-dialog.c generated by valac 0.56.3, the Vala compiler
 * generated from timer-setup-dialog.vala, do not modify */

/*
 * Copyright (C) 2013  Paolo Borelli <pborelli@gnome.org>
 * Copyright (C) 2020  Bilal Elmoussaoui <bilal.elmoussaoui@gnome.org>
 *
 * 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 <glib/gi18n-lib.h>

#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 CLOCKS_TIMER_TYPE_SETUP_DIALOG (clocks_timer_setup_dialog_get_type ())
#define CLOCKS_TIMER_SETUP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TIMER_TYPE_SETUP_DIALOG, ClocksTimerSetupDialog))
#define CLOCKS_TIMER_SETUP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TIMER_TYPE_SETUP_DIALOG, ClocksTimerSetupDialogClass))
#define CLOCKS_TIMER_IS_SETUP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TIMER_TYPE_SETUP_DIALOG))
#define CLOCKS_TIMER_IS_SETUP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TIMER_TYPE_SETUP_DIALOG))
#define CLOCKS_TIMER_SETUP_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TIMER_TYPE_SETUP_DIALOG, ClocksTimerSetupDialogClass))

typedef struct _ClocksTimerSetupDialog ClocksTimerSetupDialog;
typedef struct _ClocksTimerSetupDialogClass ClocksTimerSetupDialogClass;
typedef struct _ClocksTimerSetupDialogPrivate ClocksTimerSetupDialogPrivate;

#define CLOCKS_TIMER_TYPE_SETUP (clocks_timer_setup_get_type ())
#define CLOCKS_TIMER_SETUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TIMER_TYPE_SETUP, ClocksTimerSetup))
#define CLOCKS_TIMER_SETUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TIMER_TYPE_SETUP, ClocksTimerSetupClass))
#define CLOCKS_TIMER_IS_SETUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TIMER_TYPE_SETUP))
#define CLOCKS_TIMER_IS_SETUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TIMER_TYPE_SETUP))
#define CLOCKS_TIMER_SETUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TIMER_TYPE_SETUP, ClocksTimerSetupClass))

typedef struct _ClocksTimerSetup ClocksTimerSetup;
typedef struct _ClocksTimerSetupClass ClocksTimerSetupClass;
enum  {
	CLOCKS_TIMER_SETUP_DIALOG_0_PROPERTY,
	CLOCKS_TIMER_SETUP_DIALOG_NUM_PROPERTIES
};
static GParamSpec* clocks_timer_setup_dialog_properties[CLOCKS_TIMER_SETUP_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ClocksTimerSetupDialog {
	GtkDialog parent_instance;
	ClocksTimerSetupDialogPrivate * priv;
	ClocksTimerSetup* timer_setup;
};

struct _ClocksTimerSetupDialogClass {
	GtkDialogClass parent_class;
};

static gpointer clocks_timer_setup_dialog_parent_class = NULL;

VALA_EXTERN GType clocks_timer_setup_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksTimerSetupDialog, g_object_unref)
VALA_EXTERN GType clocks_timer_setup_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksTimerSetup, g_object_unref)
VALA_EXTERN ClocksTimerSetupDialog* clocks_timer_setup_dialog_new (GtkWindow* parent);
VALA_EXTERN ClocksTimerSetupDialog* clocks_timer_setup_dialog_construct (GType object_type,
                                                             GtkWindow* parent);
VALA_EXTERN ClocksTimerSetup* clocks_timer_setup_new (void);
VALA_EXTERN ClocksTimerSetup* clocks_timer_setup_construct (GType object_type);
static void __lambda32_ (ClocksTimerSetupDialog* self,
                  gint duration);
static void ___lambda32__clocks_timer_setup_duration_changed (ClocksTimerSetup* _sender,
                                                       gint seconds,
                                                       gpointer self);
static void clocks_timer_setup_dialog_finalize (GObject * obj);
static GType clocks_timer_setup_dialog_get_type_once (void);

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

static void
__lambda32_ (ClocksTimerSetupDialog* self,
             gint duration)
{
	gtk_dialog_set_response_sensitive ((GtkDialog*) self, (gint) GTK_RESPONSE_ACCEPT, duration != 0);
}

static void
___lambda32__clocks_timer_setup_duration_changed (ClocksTimerSetup* _sender,
                                                  gint seconds,
                                                  gpointer self)
{
	__lambda32_ ((ClocksTimerSetupDialog*) self, seconds);
}

ClocksTimerSetupDialog*
clocks_timer_setup_dialog_construct (GType object_type,
                                     GtkWindow* parent)
{
	ClocksTimerSetupDialog * self = NULL;
	GtkWidget* create_button = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	ClocksTimerSetup* _tmp2_;
	GtkBox* _tmp3_;
	ClocksTimerSetup* _tmp4_;
	ClocksTimerSetup* _tmp5_;
	g_return_val_if_fail (parent != NULL, NULL);
	self = (ClocksTimerSetupDialog*) g_object_new (object_type, "modal", TRUE, "transient-for", parent, "title", _ ("New Timer"), "use-header-bar", 1, NULL);
	gtk_window_set_default_size ((GtkWindow*) self, 640, 360);
	gtk_dialog_add_button ((GtkDialog*) self, _ ("Cancel"), (gint) GTK_RESPONSE_CANCEL);
	_tmp0_ = gtk_dialog_add_button ((GtkDialog*) self, _ ("Add"), (gint) GTK_RESPONSE_ACCEPT);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	create_button = _tmp1_;
	gtk_dialog_set_response_sensitive ((GtkDialog*) self, (gint) GTK_RESPONSE_ACCEPT, FALSE);
	gtk_widget_add_css_class (create_button, "suggested-action");
	_tmp2_ = clocks_timer_setup_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->timer_setup);
	self->timer_setup = _tmp2_;
	_tmp3_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp4_ = self->timer_setup;
	gtk_box_append (_tmp3_, (GtkWidget*) _tmp4_);
	_tmp5_ = self->timer_setup;
	g_signal_connect_object (_tmp5_, "duration-changed", (GCallback) ___lambda32__clocks_timer_setup_duration_changed, self, 0);
	_g_object_unref0 (create_button);
	return self;
}

ClocksTimerSetupDialog*
clocks_timer_setup_dialog_new (GtkWindow* parent)
{
	return clocks_timer_setup_dialog_construct (CLOCKS_TIMER_TYPE_SETUP_DIALOG, parent);
}

static void
clocks_timer_setup_dialog_class_init (ClocksTimerSetupDialogClass * klass,
                                      gpointer klass_data)
{
	clocks_timer_setup_dialog_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = clocks_timer_setup_dialog_finalize;
}

static void
clocks_timer_setup_dialog_instance_init (ClocksTimerSetupDialog * self,
                                         gpointer klass)
{
}

static void
clocks_timer_setup_dialog_finalize (GObject * obj)
{
	ClocksTimerSetupDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TIMER_TYPE_SETUP_DIALOG, ClocksTimerSetupDialog);
	_g_object_unref0 (self->timer_setup);
	G_OBJECT_CLASS (clocks_timer_setup_dialog_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_timer_setup_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksTimerSetupDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_timer_setup_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksTimerSetupDialog), 0, (GInstanceInitFunc) clocks_timer_setup_dialog_instance_init, NULL };
	GType clocks_timer_setup_dialog_type_id;
	clocks_timer_setup_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "ClocksTimerSetupDialog", &g_define_type_info, 0);
	return clocks_timer_setup_dialog_type_id;
}

GType
clocks_timer_setup_dialog_get_type (void)
{
	static volatile gsize clocks_timer_setup_dialog_type_id__once = 0;
	if (g_once_init_enter (&clocks_timer_setup_dialog_type_id__once)) {
		GType clocks_timer_setup_dialog_type_id;
		clocks_timer_setup_dialog_type_id = clocks_timer_setup_dialog_get_type_once ();
		g_once_init_leave (&clocks_timer_setup_dialog_type_id__once, clocks_timer_setup_dialog_type_id);
	}
	return clocks_timer_setup_dialog_type_id__once;
}

