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

/* SPDX-FileCopyrightText: 2026 Mahjongg Contributors*/
/* SPDX-License-Identifier: GPL-2.0-or-later*/

#include <gtk/gtk.h>
#include <glib-object.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
#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_PAUSE_OVERLAY (pause_overlay_get_type ())
#define PAUSE_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAUSE_OVERLAY, PauseOverlay))
#define PAUSE_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAUSE_OVERLAY, PauseOverlayClass))
#define IS_PAUSE_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAUSE_OVERLAY))
#define IS_PAUSE_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAUSE_OVERLAY))
#define PAUSE_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAUSE_OVERLAY, PauseOverlayClass))

typedef struct _PauseOverlay PauseOverlay;
typedef struct _PauseOverlayClass PauseOverlayClass;
typedef struct _PauseOverlayPrivate PauseOverlayPrivate;
enum  {
	PAUSE_OVERLAY_0_PROPERTY,
	PAUSE_OVERLAY_NUM_PROPERTIES
};
static GParamSpec* pause_overlay_properties[PAUSE_OVERLAY_NUM_PROPERTIES];

struct _PauseOverlay {
	GtkBox parent_instance;
	PauseOverlayPrivate * priv;
};

struct _PauseOverlayClass {
	GtkBoxClass parent_class;
};

struct _PauseOverlayPrivate {
	GtkButton* resume_button;
	GtkButton* quit_button;
};

static gint PauseOverlay_private_offset;
static gpointer pause_overlay_parent_class = NULL;

VALA_EXTERN GType pause_overlay_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PauseOverlay, g_object_unref)
VALA_EXTERN void pause_overlay_show (PauseOverlay* self,
                         gboolean resuming_game);
VALA_EXTERN void pause_overlay_hide (PauseOverlay* self);
VALA_EXTERN PauseOverlay* pause_overlay_new (void);
VALA_EXTERN PauseOverlay* pause_overlay_construct (GType object_type);
static void pause_overlay_finalize (GObject * obj);
static GType pause_overlay_get_type_once (void);

static inline gpointer
pause_overlay_get_instance_private (PauseOverlay* self)
{
	return G_STRUCT_MEMBER_P (self, PauseOverlay_private_offset);
}

void
pause_overlay_show (PauseOverlay* self,
                    gboolean resuming_game)
{
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->quit_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, !resuming_game);
	gtk_widget_set_visible ((GtkWidget*) self, TRUE);
	_tmp1_ = self->priv->resume_button;
	gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
}

void
pause_overlay_hide (PauseOverlay* self)
{
	g_return_if_fail (self != NULL);
	gtk_widget_set_visible ((GtkWidget*) self, FALSE);
}

PauseOverlay*
pause_overlay_construct (GType object_type)
{
	PauseOverlay * self = NULL;
	self = (PauseOverlay*) g_object_new (object_type, NULL);
	return self;
}

PauseOverlay*
pause_overlay_new (void)
{
	return pause_overlay_construct (TYPE_PAUSE_OVERLAY);
}

static void
pause_overlay_class_init (PauseOverlayClass * klass,
                          gpointer klass_data)
{
	pause_overlay_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PauseOverlay_private_offset);
	G_OBJECT_CLASS (klass)->finalize = pause_overlay_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Mahjongg/ui/pause-overlay.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "resume_button", FALSE, PauseOverlay_private_offset + G_STRUCT_OFFSET (PauseOverlayPrivate, resume_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "quit_button", FALSE, PauseOverlay_private_offset + G_STRUCT_OFFSET (PauseOverlayPrivate, quit_button));
}

static void
pause_overlay_instance_init (PauseOverlay * self,
                             gpointer klass)
{
	self->priv = pause_overlay_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
pause_overlay_finalize (GObject * obj)
{
	PauseOverlay * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PAUSE_OVERLAY, PauseOverlay);
	G_OBJECT_CLASS (pause_overlay_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
pause_overlay_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PauseOverlayClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pause_overlay_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PauseOverlay), 0, (GInstanceInitFunc) pause_overlay_instance_init, NULL };
	GType pause_overlay_type_id;
	pause_overlay_type_id = g_type_register_static (gtk_box_get_type (), "PauseOverlay", &g_define_type_info, 0);
	PauseOverlay_private_offset = g_type_add_instance_private (pause_overlay_type_id, sizeof (PauseOverlayPrivate));
	return pause_overlay_type_id;
}

GType
pause_overlay_get_type (void)
{
	static gsize pause_overlay_type_id__once = 0;
	if (g_once_init_enter (&pause_overlay_type_id__once)) {
		GType pause_overlay_type_id;
		pause_overlay_type_id = pause_overlay_get_type_once ();
		g_once_init_leave (&pause_overlay_type_id__once, pause_overlay_type_id);
	}
	return pause_overlay_type_id__once;
}

