/* gitg-commit-submodule-diff-view.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-commit-submodule-diff-view.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2014 - Jesse van den Kieboom
 *
 * gitg 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.
 *
 * gitg 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 gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include "libgitg.h"
#include <glib.h>
#include <gio/gio.h>
#include "config.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 GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW (gitg_commit_submodule_diff_view_get_type ())
#define GITG_COMMIT_SUBMODULE_DIFF_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffView))
#define GITG_COMMIT_SUBMODULE_DIFF_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffViewClass))
#define GITG_COMMIT_IS_SUBMODULE_DIFF_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW))
#define GITG_COMMIT_IS_SUBMODULE_DIFF_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW))
#define GITG_COMMIT_SUBMODULE_DIFF_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffViewClass))

typedef struct _GitgCommitSubmoduleDiffView GitgCommitSubmoduleDiffView;
typedef struct _GitgCommitSubmoduleDiffViewClass GitgCommitSubmoduleDiffViewClass;
typedef struct _GitgCommitSubmoduleDiffViewPrivate GitgCommitSubmoduleDiffViewPrivate;

#define GITG_COMMIT_TYPE_SUBMODULE_INFO (gitg_commit_submodule_info_get_type ())
#define GITG_COMMIT_SUBMODULE_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_COMMIT_TYPE_SUBMODULE_INFO, GitgCommitSubmoduleInfo))
#define GITG_COMMIT_SUBMODULE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_COMMIT_TYPE_SUBMODULE_INFO, GitgCommitSubmoduleInfoClass))
#define GITG_COMMIT_IS_SUBMODULE_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_COMMIT_TYPE_SUBMODULE_INFO))
#define GITG_COMMIT_IS_SUBMODULE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_COMMIT_TYPE_SUBMODULE_INFO))
#define GITG_COMMIT_SUBMODULE_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_COMMIT_TYPE_SUBMODULE_INFO, GitgCommitSubmoduleInfoClass))

typedef struct _GitgCommitSubmoduleInfo GitgCommitSubmoduleInfo;
typedef struct _GitgCommitSubmoduleInfoClass GitgCommitSubmoduleInfoClass;
enum  {
	GITG_COMMIT_SUBMODULE_DIFF_VIEW_0_PROPERTY,
	GITG_COMMIT_SUBMODULE_DIFF_VIEW_INFO_PROPERTY,
	GITG_COMMIT_SUBMODULE_DIFF_VIEW_DIFF_VIEW_STAGED_PROPERTY,
	GITG_COMMIT_SUBMODULE_DIFF_VIEW_DIFF_VIEW_UNSTAGED_PROPERTY,
	GITG_COMMIT_SUBMODULE_DIFF_VIEW_NUM_PROPERTIES
};
static GParamSpec* gitg_commit_submodule_diff_view_properties[GITG_COMMIT_SUBMODULE_DIFF_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GitgCommitSubmoduleDiffView {
	GtkBox parent_instance;
	GitgCommitSubmoduleDiffViewPrivate * priv;
};

struct _GitgCommitSubmoduleDiffViewClass {
	GtkBoxClass parent_class;
};

struct _GitgCommitSubmoduleDiffViewPrivate {
	GitgCommitSubmoduleInfo* d_info;
	GitgDiffView* d_diff_view_staged;
	GitgDiffView* d_diff_view_unstaged;
	GtkBox* d_box_diffs;
};

static gint GitgCommitSubmoduleDiffView_private_offset;
static gpointer gitg_commit_submodule_diff_view_parent_class = NULL;

VALA_EXTERN GType gitg_commit_submodule_diff_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitSubmoduleDiffView, g_object_unref)
VALA_EXTERN GType gitg_commit_submodule_info_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgCommitSubmoduleInfo, g_object_unref)
VALA_EXTERN GitgCommitSubmoduleDiffView* gitg_commit_submodule_diff_view_new (void);
VALA_EXTERN GitgCommitSubmoduleDiffView* gitg_commit_submodule_diff_view_construct (GType object_type);
VALA_EXTERN GitgCommitSubmoduleInfo* gitg_commit_submodule_diff_view_get_info (GitgCommitSubmoduleDiffView* self);
VALA_EXTERN GitgDiffView* gitg_commit_submodule_diff_view_get_diff_view_staged (GitgCommitSubmoduleDiffView* self);
VALA_EXTERN GitgDiffView* gitg_commit_submodule_diff_view_get_diff_view_unstaged (GitgCommitSubmoduleDiffView* self);
static GObject * gitg_commit_submodule_diff_view_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void gitg_commit_submodule_diff_view_finalize (GObject * obj);
static GType gitg_commit_submodule_diff_view_get_type_once (void);
static void _vala_gitg_commit_submodule_diff_view_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);

static inline gpointer
gitg_commit_submodule_diff_view_get_instance_private (GitgCommitSubmoduleDiffView* self)
{
	return G_STRUCT_MEMBER_P (self, GitgCommitSubmoduleDiffView_private_offset);
}

GitgCommitSubmoduleDiffView*
gitg_commit_submodule_diff_view_construct (GType object_type)
{
	GitgCommitSubmoduleDiffView * self = NULL;
	self = (GitgCommitSubmoduleDiffView*) g_object_new (object_type, NULL);
	return self;
}

GitgCommitSubmoduleDiffView*
gitg_commit_submodule_diff_view_new (void)
{
	return gitg_commit_submodule_diff_view_construct (GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW);
}

GitgCommitSubmoduleInfo*
gitg_commit_submodule_diff_view_get_info (GitgCommitSubmoduleDiffView* self)
{
	GitgCommitSubmoduleInfo* result;
	GitgCommitSubmoduleInfo* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_info;
	result = _tmp0_;
	return result;
}

GitgDiffView*
gitg_commit_submodule_diff_view_get_diff_view_staged (GitgCommitSubmoduleDiffView* self)
{
	GitgDiffView* result;
	GitgDiffView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_diff_view_staged;
	result = _tmp0_;
	return result;
}

GitgDiffView*
gitg_commit_submodule_diff_view_get_diff_view_unstaged (GitgCommitSubmoduleDiffView* self)
{
	GitgDiffView* result;
	GitgDiffView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_diff_view_unstaged;
	result = _tmp0_;
	return result;
}

static GObject *
gitg_commit_submodule_diff_view_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GitgCommitSubmoduleDiffView * self;
	GSettings* interface_settings = NULL;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GtkBox* _tmp2_;
	parent_class = G_OBJECT_CLASS (gitg_commit_submodule_diff_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffView);
	_tmp0_ = g_settings_new (APPLICATION_ID ".preferences.interface");
	interface_settings = _tmp0_;
	_tmp1_ = interface_settings;
	_tmp2_ = self->priv->d_box_diffs;
	g_settings_bind (_tmp1_, "orientation", (GObject*) _tmp2_, "orientation", G_SETTINGS_BIND_GET);
	_g_object_unref0 (interface_settings);
	return obj;
}

static void
gitg_commit_submodule_diff_view_class_init (GitgCommitSubmoduleDiffViewClass * klass,
                                            gpointer klass_data)
{
	gitg_commit_submodule_diff_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgCommitSubmoduleDiffView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_commit_submodule_diff_view_get_property;
	G_OBJECT_CLASS (klass)->constructor = gitg_commit_submodule_diff_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = gitg_commit_submodule_diff_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_SUBMODULE_DIFF_VIEW_INFO_PROPERTY, gitg_commit_submodule_diff_view_properties[GITG_COMMIT_SUBMODULE_DIFF_VIEW_INFO_PROPERTY] = g_param_spec_object ("info", "info", "info", GITG_COMMIT_TYPE_SUBMODULE_INFO, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_SUBMODULE_DIFF_VIEW_DIFF_VIEW_STAGED_PROPERTY, gitg_commit_submodule_diff_view_properties[GITG_COMMIT_SUBMODULE_DIFF_VIEW_DIFF_VIEW_STAGED_PROPERTY] = g_param_spec_object ("diff-view-staged", "diff-view-staged", "diff-view-staged", GITG_TYPE_DIFF_VIEW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_COMMIT_SUBMODULE_DIFF_VIEW_DIFF_VIEW_UNSTAGED_PROPERTY, gitg_commit_submodule_diff_view_properties[GITG_COMMIT_SUBMODULE_DIFF_VIEW_DIFF_VIEW_UNSTAGED_PROPERTY] = g_param_spec_object ("diff-view-unstaged", "diff-view-unstaged", "diff-view-unstaged", GITG_TYPE_DIFF_VIEW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/gitg/ui/gitg-commit-submodule-diff-view.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "info", FALSE, GitgCommitSubmoduleDiffView_private_offset + G_STRUCT_OFFSET (GitgCommitSubmoduleDiffViewPrivate, d_info));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "diff_view_staged", FALSE, GitgCommitSubmoduleDiffView_private_offset + G_STRUCT_OFFSET (GitgCommitSubmoduleDiffViewPrivate, d_diff_view_staged));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "diff_view_unstaged", FALSE, GitgCommitSubmoduleDiffView_private_offset + G_STRUCT_OFFSET (GitgCommitSubmoduleDiffViewPrivate, d_diff_view_unstaged));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "box_diffs", FALSE, GitgCommitSubmoduleDiffView_private_offset + G_STRUCT_OFFSET (GitgCommitSubmoduleDiffViewPrivate, d_box_diffs));
}

static void
gitg_commit_submodule_diff_view_instance_init (GitgCommitSubmoduleDiffView * self,
                                               gpointer klass)
{
	self->priv = gitg_commit_submodule_diff_view_get_instance_private (self);
	g_type_ensure (GITG_COMMIT_TYPE_SUBMODULE_INFO);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
gitg_commit_submodule_diff_view_finalize (GObject * obj)
{
	GitgCommitSubmoduleDiffView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffView);
	G_OBJECT_CLASS (gitg_commit_submodule_diff_view_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_commit_submodule_diff_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgCommitSubmoduleDiffViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_commit_submodule_diff_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgCommitSubmoduleDiffView), 0, (GInstanceInitFunc) gitg_commit_submodule_diff_view_instance_init, NULL };
	GType gitg_commit_submodule_diff_view_type_id;
	gitg_commit_submodule_diff_view_type_id = g_type_register_static (gtk_box_get_type (), "GitgCommitSubmoduleDiffView", &g_define_type_info, 0);
	GitgCommitSubmoduleDiffView_private_offset = g_type_add_instance_private (gitg_commit_submodule_diff_view_type_id, sizeof (GitgCommitSubmoduleDiffViewPrivate));
	return gitg_commit_submodule_diff_view_type_id;
}

GType
gitg_commit_submodule_diff_view_get_type (void)
{
	static gsize gitg_commit_submodule_diff_view_type_id__once = 0;
	if (g_once_init_enter (&gitg_commit_submodule_diff_view_type_id__once)) {
		GType gitg_commit_submodule_diff_view_type_id;
		gitg_commit_submodule_diff_view_type_id = gitg_commit_submodule_diff_view_get_type_once ();
		g_once_init_leave (&gitg_commit_submodule_diff_view_type_id__once, gitg_commit_submodule_diff_view_type_id);
	}
	return gitg_commit_submodule_diff_view_type_id__once;
}

static void
_vala_gitg_commit_submodule_diff_view_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	GitgCommitSubmoduleDiffView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_COMMIT_TYPE_SUBMODULE_DIFF_VIEW, GitgCommitSubmoduleDiffView);
	switch (property_id) {
		case GITG_COMMIT_SUBMODULE_DIFF_VIEW_INFO_PROPERTY:
		g_value_set_object (value, gitg_commit_submodule_diff_view_get_info (self));
		break;
		case GITG_COMMIT_SUBMODULE_DIFF_VIEW_DIFF_VIEW_STAGED_PROPERTY:
		g_value_set_object (value, gitg_commit_submodule_diff_view_get_diff_view_staged (self));
		break;
		case GITG_COMMIT_SUBMODULE_DIFF_VIEW_DIFF_VIEW_UNSTAGED_PROPERTY:
		g_value_set_object (value, gitg_commit_submodule_diff_view_get_diff_view_unstaged (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

