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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * 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: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <glib-object.h>
#include <adwaita.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <string.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

enum  {
	WIDGETS_CONTEXT_MENU_MENU_SEPARATOR_0_PROPERTY,
	WIDGETS_CONTEXT_MENU_MENU_SEPARATOR_NUM_PROPERTIES
};
static GParamSpec* widgets_context_menu_menu_separator_properties[WIDGETS_CONTEXT_MENU_MENU_SEPARATOR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer widgets_context_menu_menu_separator_parent_class = NULL;

static GObject * widgets_context_menu_menu_separator_constructor (GType type,
                                                           guint n_construct_properties,
                                                           GObjectConstructParam * construct_properties);
static GType widgets_context_menu_menu_separator_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

WidgetsContextMenuMenuSeparator*
widgets_context_menu_menu_separator_construct (GType object_type)
{
	WidgetsContextMenuMenuSeparator * self = NULL;
	self = (WidgetsContextMenuMenuSeparator*) g_object_new (object_type, NULL);
	return self;
}

WidgetsContextMenuMenuSeparator*
widgets_context_menu_menu_separator_new (void)
{
	return widgets_context_menu_menu_separator_construct (WIDGETS_CONTEXT_MENU_TYPE_MENU_SEPARATOR);
}

static GObject *
widgets_context_menu_menu_separator_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsContextMenuMenuSeparator * self;
	GtkSeparator* _tmp0_ = NULL;
	GtkSeparator* _tmp1_;
	parent_class = G_OBJECT_CLASS (widgets_context_menu_menu_separator_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_CONTEXT_MENU_TYPE_MENU_SEPARATOR, WidgetsContextMenuMenuSeparator);
	_tmp0_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp0_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp0_, 6);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	return obj;
}

static void
widgets_context_menu_menu_separator_class_init (WidgetsContextMenuMenuSeparatorClass * klass,
                                                gpointer klass_data)
{
	widgets_context_menu_menu_separator_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = widgets_context_menu_menu_separator_constructor;
}

static void
widgets_context_menu_menu_separator_instance_init (WidgetsContextMenuMenuSeparator * self,
                                                   gpointer klass)
{
}

static GType
widgets_context_menu_menu_separator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsContextMenuMenuSeparatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_context_menu_menu_separator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsContextMenuMenuSeparator), 0, (GInstanceInitFunc) widgets_context_menu_menu_separator_instance_init, NULL };
	GType widgets_context_menu_menu_separator_type_id;
	widgets_context_menu_menu_separator_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsContextMenuMenuSeparator", &g_define_type_info, 0);
	return widgets_context_menu_menu_separator_type_id;
}

GType
widgets_context_menu_menu_separator_get_type (void)
{
	static volatile gsize widgets_context_menu_menu_separator_type_id__once = 0;
	if (g_once_init_enter (&widgets_context_menu_menu_separator_type_id__once)) {
		GType widgets_context_menu_menu_separator_type_id;
		widgets_context_menu_menu_separator_type_id = widgets_context_menu_menu_separator_get_type_once ();
		g_once_init_leave (&widgets_context_menu_menu_separator_type_id__once, widgets_context_menu_menu_separator_type_id);
	}
	return widgets_context_menu_menu_separator_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

