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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include "deja.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_BASIC_NAVIGATION_PAGE (basic_navigation_page_get_type ())
#define BASIC_NAVIGATION_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPage))
#define BASIC_NAVIGATION_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPageClass))
#define IS_BASIC_NAVIGATION_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BASIC_NAVIGATION_PAGE))
#define IS_BASIC_NAVIGATION_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BASIC_NAVIGATION_PAGE))
#define BASIC_NAVIGATION_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPageClass))

typedef struct _BasicNavigationPage BasicNavigationPage;
typedef struct _BasicNavigationPageClass BasicNavigationPageClass;
typedef struct _BasicNavigationPagePrivate BasicNavigationPagePrivate;
enum  {
	BASIC_NAVIGATION_PAGE_0_PROPERTY,
	BASIC_NAVIGATION_PAGE_CONTENT_PROPERTY,
	BASIC_NAVIGATION_PAGE_NUM_PROPERTIES
};
static GParamSpec* basic_navigation_page_properties[BASIC_NAVIGATION_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BasicNavigationPage {
	AdwNavigationPage parent_instance;
	BasicNavigationPagePrivate * priv;
};

struct _BasicNavigationPageClass {
	AdwNavigationPageClass parent_class;
};

struct _BasicNavigationPagePrivate {
	GtkWidget* _content;
};

static gint BasicNavigationPage_private_offset;
static gpointer basic_navigation_page_parent_class = NULL;

VALA_EXTERN GType basic_navigation_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BasicNavigationPage, g_object_unref)
static void basic_navigation_page_update_content_sensitivity (BasicNavigationPage* self);
VALA_EXTERN GtkWidget* basic_navigation_page_get_content (BasicNavigationPage* self);
VALA_EXTERN BasicNavigationPage* basic_navigation_page_new (void);
VALA_EXTERN BasicNavigationPage* basic_navigation_page_construct (GType object_type);
VALA_EXTERN void basic_navigation_page_set_content (BasicNavigationPage* self,
                                        GtkWidget* value);
static GObject * basic_navigation_page_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void _basic_navigation_page_update_content_sensitivity_g_object_notify (GObject* _sender,
                                                                        GParamSpec* pspec,
                                                                        gpointer self);
static void basic_navigation_page_finalize (GObject * obj);
static GType basic_navigation_page_get_type_once (void);
static void _vala_basic_navigation_page_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_basic_navigation_page_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
basic_navigation_page_get_instance_private (BasicNavigationPage* self)
{
	return G_STRUCT_MEMBER_P (self, BasicNavigationPage_private_offset);
}

static void
basic_navigation_page_update_content_sensitivity (BasicNavigationPage* self)
{
	GtkWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_content;
	if (_tmp0_ != NULL) {
		GtkWidget* _tmp1_;
		DejaDupOperationWatcher* _tmp2_;
		DejaDupOperationWatcher* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp1_ = self->priv->_content;
		_tmp2_ = deja_dup_operation_watcher_get_instance ();
		_tmp3_ = _tmp2_;
		_tmp4_ = deja_dup_operation_watcher_get_active (_tmp3_);
		_tmp5_ = _tmp4_;
		gtk_widget_set_sensitive (_tmp1_, !_tmp5_);
		_g_object_unref0 (_tmp3_);
	}
}

BasicNavigationPage*
basic_navigation_page_construct (GType object_type)
{
	BasicNavigationPage * self = NULL;
	self = (BasicNavigationPage*) g_object_new (object_type, NULL);
	return self;
}

BasicNavigationPage*
basic_navigation_page_new (void)
{
	return basic_navigation_page_construct (TYPE_BASIC_NAVIGATION_PAGE);
}

GtkWidget*
basic_navigation_page_get_content (BasicNavigationPage* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	result = _tmp0_;
	return result;
}

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

void
basic_navigation_page_set_content (BasicNavigationPage* self,
                                   GtkWidget* value)
{
	GtkWidget* old_value;
	g_return_if_fail (self != NULL);
	old_value = basic_navigation_page_get_content (self);
	if (old_value != value) {
		GtkWidget* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_content);
		self->priv->_content = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, basic_navigation_page_properties[BASIC_NAVIGATION_PAGE_CONTENT_PROPERTY]);
	}
}

static void
_basic_navigation_page_update_content_sensitivity_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self)
{
	basic_navigation_page_update_content_sensitivity ((BasicNavigationPage*) self);
}

static GObject *
basic_navigation_page_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	BasicNavigationPage * self;
	DejaDupOperationWatcher* op_watcher = NULL;
	DejaDupOperationWatcher* _tmp0_;
	DejaDupOperationWatcher* _tmp1_;
	parent_class = G_OBJECT_CLASS (basic_navigation_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPage);
	_tmp0_ = deja_dup_operation_watcher_get_instance ();
	op_watcher = _tmp0_;
	_tmp1_ = op_watcher;
	g_signal_connect_object ((GObject*) _tmp1_, "notify::active", (GCallback) _basic_navigation_page_update_content_sensitivity_g_object_notify, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::content", (GCallback) _basic_navigation_page_update_content_sensitivity_g_object_notify, self, 0);
	_g_object_unref0 (op_watcher);
	return obj;
}

static void
basic_navigation_page_class_init (BasicNavigationPageClass * klass,
                                  gpointer klass_data)
{
	basic_navigation_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BasicNavigationPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_basic_navigation_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_basic_navigation_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = basic_navigation_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = basic_navigation_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BASIC_NAVIGATION_PAGE_CONTENT_PROPERTY, basic_navigation_page_properties[BASIC_NAVIGATION_PAGE_CONTENT_PROPERTY] = g_param_spec_object ("content", "content", "content", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/DejaDup/BasicNavigationPage.ui");
}

static void
basic_navigation_page_instance_init (BasicNavigationPage * self,
                                     gpointer klass)
{
	self->priv = basic_navigation_page_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
basic_navigation_page_finalize (GObject * obj)
{
	BasicNavigationPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPage);
	_g_object_unref0 (self->priv->_content);
	G_OBJECT_CLASS (basic_navigation_page_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
basic_navigation_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BasicNavigationPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) basic_navigation_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BasicNavigationPage), 0, (GInstanceInitFunc) basic_navigation_page_instance_init, NULL };
	GType basic_navigation_page_type_id;
	basic_navigation_page_type_id = g_type_register_static (adw_navigation_page_get_type (), "BasicNavigationPage", &g_define_type_info, 0);
	BasicNavigationPage_private_offset = g_type_add_instance_private (basic_navigation_page_type_id, sizeof (BasicNavigationPagePrivate));
	return basic_navigation_page_type_id;
}

GType
basic_navigation_page_get_type (void)
{
	static gsize basic_navigation_page_type_id__once = 0;
	if (g_once_init_enter (&basic_navigation_page_type_id__once)) {
		GType basic_navigation_page_type_id;
		basic_navigation_page_type_id = basic_navigation_page_get_type_once ();
		g_once_init_leave (&basic_navigation_page_type_id__once, basic_navigation_page_type_id);
	}
	return basic_navigation_page_type_id__once;
}

static void
_vala_basic_navigation_page_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	BasicNavigationPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPage);
	switch (property_id) {
		case BASIC_NAVIGATION_PAGE_CONTENT_PROPERTY:
		g_value_set_object (value, basic_navigation_page_get_content (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_basic_navigation_page_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	BasicNavigationPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_BASIC_NAVIGATION_PAGE, BasicNavigationPage);
	switch (property_id) {
		case BASIC_NAVIGATION_PAGE_CONTENT_PROPERTY:
		basic_navigation_page_set_content (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

