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

/*
* Copyright (c) 2018-2026 (https://github.com/phase1geo/Minder)
*
* 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
*
* Authored by: Trevor Williams <phase1geo@gmail.com>
*/

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.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_NODE_BORDER (node_border_get_type ())
#define NODE_BORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BORDER, NodeBorder))
#define IS_NODE_BORDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BORDER))
#define NODE_BORDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_NODE_BORDER, NodeBorderIface))

typedef struct _NodeBorder NodeBorder;
typedef struct _NodeBorderIface NodeBorderIface;
typedef enum  {
	NODE_SIDE_LEFT = 1,
	NODE_SIDE_TOP = 2,
	NODE_SIDE_RIGHT = 4,
	NODE_SIDE_BOTTOM = 8
} NodeSide;

#define TYPE_NODE_SIDE (node_side_get_type ())

struct _NodeBorderIface {
	GTypeInterface parent_iface;
	gchar* (*name) (NodeBorder* self);
	gchar* (*display_name) (NodeBorder* self);
	gchar* (*light_icon_name) (NodeBorder* self);
	gchar* (*dark_icon_name) (NodeBorder* self);
	gboolean (*is_fillable) (NodeBorder* self);
	void (*draw_border) (NodeBorder* self, cairo_t* ctx, gdouble x, gdouble y, gdouble w, gdouble h, NodeSide s, gint padding);
	void (*draw_fill) (NodeBorder* self, cairo_t* ctx, gdouble x, gdouble y, gdouble w, gdouble h, NodeSide s, gint padding);
};

VALA_EXTERN GType node_side_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType node_border_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBorder, g_object_unref)
VALA_EXTERN gchar* node_border_name (NodeBorder* self);
VALA_EXTERN gchar* node_border_display_name (NodeBorder* self);
VALA_EXTERN gchar* node_border_light_icon_name (NodeBorder* self);
VALA_EXTERN gchar* node_border_dark_icon_name (NodeBorder* self);
VALA_EXTERN gboolean node_border_is_fillable (NodeBorder* self);
VALA_EXTERN void node_border_draw_border (NodeBorder* self,
                              cairo_t* ctx,
                              gdouble x,
                              gdouble y,
                              gdouble w,
                              gdouble h,
                              NodeSide s,
                              gint padding);
VALA_EXTERN void node_border_draw_fill (NodeBorder* self,
                            cairo_t* ctx,
                            gdouble x,
                            gdouble y,
                            gdouble w,
                            gdouble h,
                            NodeSide s,
                            gint padding);
static GType node_border_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

gchar*
node_border_name (NodeBorder* self)
{
	NodeBorderIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = NODE_BORDER_GET_INTERFACE (self);
	if (_iface_->name) {
		return _iface_->name (self);
	}
	return NULL;
}

gchar*
node_border_display_name (NodeBorder* self)
{
	NodeBorderIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = NODE_BORDER_GET_INTERFACE (self);
	if (_iface_->display_name) {
		return _iface_->display_name (self);
	}
	return NULL;
}

gchar*
node_border_light_icon_name (NodeBorder* self)
{
	NodeBorderIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = NODE_BORDER_GET_INTERFACE (self);
	if (_iface_->light_icon_name) {
		return _iface_->light_icon_name (self);
	}
	return NULL;
}

gchar*
node_border_dark_icon_name (NodeBorder* self)
{
	NodeBorderIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = NODE_BORDER_GET_INTERFACE (self);
	if (_iface_->dark_icon_name) {
		return _iface_->dark_icon_name (self);
	}
	return NULL;
}

gboolean
node_border_is_fillable (NodeBorder* self)
{
	NodeBorderIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = NODE_BORDER_GET_INTERFACE (self);
	if (_iface_->is_fillable) {
		return _iface_->is_fillable (self);
	}
	return FALSE;
}

void
node_border_draw_border (NodeBorder* self,
                         cairo_t* ctx,
                         gdouble x,
                         gdouble y,
                         gdouble w,
                         gdouble h,
                         NodeSide s,
                         gint padding)
{
	NodeBorderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = NODE_BORDER_GET_INTERFACE (self);
	if (_iface_->draw_border) {
		_iface_->draw_border (self, ctx, x, y, w, h, s, padding);
	}
}

void
node_border_draw_fill (NodeBorder* self,
                       cairo_t* ctx,
                       gdouble x,
                       gdouble y,
                       gdouble w,
                       gdouble h,
                       NodeSide s,
                       gint padding)
{
	NodeBorderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = NODE_BORDER_GET_INTERFACE (self);
	if (_iface_->draw_fill) {
		_iface_->draw_fill (self, ctx, x, y, w, h, s, padding);
	}
}

static void
node_border_default_init (NodeBorderIface * iface,
                          gpointer iface_data)
{
}

static GType
node_border_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (NodeBorderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) node_border_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType node_border_type_id;
	node_border_type_id = g_type_register_static (G_TYPE_INTERFACE, "NodeBorder", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (node_border_type_id, G_TYPE_OBJECT);
	return node_border_type_id;
}

GType
node_border_get_type (void)
{
	static volatile gsize node_border_type_id__once = 0;
	if (g_once_init_enter (&node_border_type_id__once)) {
		GType node_border_type_id;
		node_border_type_id = node_border_get_type_once ();
		g_once_init_leave (&node_border_type_id__once, node_border_type_id);
	}
	return node_border_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;
}

