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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*-
 * -*- coding: utf-8 -*-
 *
 * Copyright (C) 2011 ~ 2018 Deepin, Inc.
 *               2011 ~ 2018 Wang Yong
 *
 * Author:     Wang Yong <wangyong@deepin.com>
 * Maintainer: Wang Yong <wangyong@deepin.com>
 *
 * 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
 * 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, see <http://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.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
#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 WIDGETS_TYPE_SPLIT_LINE (widgets_split_line_get_type ())
#define WIDGETS_SPLIT_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_SPLIT_LINE, WidgetsSplitLine))
#define WIDGETS_SPLIT_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_SPLIT_LINE, WidgetsSplitLineClass))
#define WIDGETS_IS_SPLIT_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_SPLIT_LINE))
#define WIDGETS_IS_SPLIT_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_SPLIT_LINE))
#define WIDGETS_SPLIT_LINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_SPLIT_LINE, WidgetsSplitLineClass))

typedef struct _WidgetsSplitLine WidgetsSplitLine;
typedef struct _WidgetsSplitLineClass WidgetsSplitLineClass;
typedef struct _WidgetsSplitLinePrivate WidgetsSplitLinePrivate;
enum  {
	WIDGETS_SPLIT_LINE_0_PROPERTY,
	WIDGETS_SPLIT_LINE_NUM_PROPERTIES
};
static GParamSpec* widgets_split_line_properties[WIDGETS_SPLIT_LINE_NUM_PROPERTIES];

#define WIDGETS_TYPE_CONFIG_WINDOW (widgets_config_window_get_type ())
#define WIDGETS_CONFIG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_CONFIG_WINDOW, WidgetsConfigWindow))
#define WIDGETS_CONFIG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_CONFIG_WINDOW, WidgetsConfigWindowClass))
#define WIDGETS_IS_CONFIG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_CONFIG_WINDOW))
#define WIDGETS_IS_CONFIG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_CONFIG_WINDOW))
#define WIDGETS_CONFIG_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_CONFIG_WINDOW, WidgetsConfigWindowClass))

typedef struct _WidgetsConfigWindow WidgetsConfigWindow;
typedef struct _WidgetsConfigWindowClass WidgetsConfigWindowClass;

struct _WidgetsSplitLine {
	GtkBox parent_instance;
	WidgetsSplitLinePrivate * priv;
	gint split_line_margin_left;
};

struct _WidgetsSplitLineClass {
	GtkBoxClass parent_class;
};

static gpointer widgets_split_line_parent_class = NULL;

VALA_EXTERN GType widgets_split_line_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsSplitLine, g_object_unref)
VALA_EXTERN WidgetsSplitLine* widgets_split_line_new (void);
VALA_EXTERN WidgetsSplitLine* widgets_split_line_construct (GType object_type);
static gboolean __lambda32_ (WidgetsSplitLine* self,
                      GtkWidget* w,
                      cairo_t* cr);
VALA_EXTERN GType widgets_config_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsConfigWindow, g_object_unref)
VALA_EXTERN gboolean widgets_config_window_is_light_theme (WidgetsConfigWindow* self);
VALA_EXTERN void draw_draw_rectangle (cairo_t* cr,
                          gint x,
                          gint y,
                          gint w,
                          gint h,
                          gboolean fill);
static gboolean ___lambda32__gtk_widget_draw (GtkWidget* _sender,
                                       cairo_t* cr,
                                       gpointer self);
static void widgets_split_line_finalize (GObject * obj);
static GType widgets_split_line_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static gboolean
__lambda32_ (WidgetsSplitLine* self,
             GtkWidget* w,
             cairo_t* cr)
{
	GtkAllocation rect = {0};
	GtkAllocation _tmp0_ = {0};
	gboolean is_light_theme = FALSE;
	GtkWidget* _tmp1_;
	GtkAllocation _tmp2_;
	gboolean result;
	g_return_val_if_fail (w != NULL, FALSE);
	g_return_val_if_fail (cr != NULL, FALSE);
	gtk_widget_get_allocation (w, &_tmp0_);
	rect = _tmp0_;
	_tmp1_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	is_light_theme = widgets_config_window_is_light_theme (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, WIDGETS_TYPE_CONFIG_WINDOW, WidgetsConfigWindow));
	if (is_light_theme) {
		cairo_set_source_rgba (cr, (gdouble) 0, (gdouble) 0, (gdouble) 0, 0.1);
	} else {
		cairo_set_source_rgba (cr, (gdouble) 1, (gdouble) 1, (gdouble) 1, 0.1);
	}
	_tmp2_ = rect;
	draw_draw_rectangle (cr, 0, 0, _tmp2_.width, 1, TRUE);
	result = TRUE;
	return result;
}

static gboolean
___lambda32__gtk_widget_draw (GtkWidget* _sender,
                              cairo_t* cr,
                              gpointer self)
{
	gboolean result;
	result = __lambda32_ ((WidgetsSplitLine*) self, _sender, cr);
	return result;
}

WidgetsSplitLine*
widgets_split_line_construct (GType object_type)
{
	WidgetsSplitLine * self = NULL;
	self = (WidgetsSplitLine*) g_object_new (object_type, NULL);
	gtk_widget_set_margin_left ((GtkWidget*) self, self->split_line_margin_left);
	gtk_widget_set_size_request ((GtkWidget*) self, -1, 1);
	g_signal_connect_object ((GtkWidget*) self, "draw", (GCallback) ___lambda32__gtk_widget_draw, self, 0);
	return self;
}

WidgetsSplitLine*
widgets_split_line_new (void)
{
	return widgets_split_line_construct (WIDGETS_TYPE_SPLIT_LINE);
}

static void
widgets_split_line_class_init (WidgetsSplitLineClass * klass,
                               gpointer klass_data)
{
	widgets_split_line_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = widgets_split_line_finalize;
}

static void
widgets_split_line_instance_init (WidgetsSplitLine * self,
                                  gpointer klass)
{
	self->split_line_margin_left = 1;
}

static void
widgets_split_line_finalize (GObject * obj)
{
	WidgetsSplitLine * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_SPLIT_LINE, WidgetsSplitLine);
	G_OBJECT_CLASS (widgets_split_line_parent_class)->finalize (obj);
}

static GType
widgets_split_line_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsSplitLineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_split_line_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsSplitLine), 0, (GInstanceInitFunc) widgets_split_line_instance_init, NULL };
	GType widgets_split_line_type_id;
	widgets_split_line_type_id = g_type_register_static (gtk_box_get_type (), "WidgetsSplitLine", &g_define_type_info, 0);
	return widgets_split_line_type_id;
}

GType
widgets_split_line_get_type (void)
{
	static volatile gsize widgets_split_line_type_id__once = 0;
	if (g_once_init_enter (&widgets_split_line_type_id__once)) {
		GType widgets_split_line_type_id;
		widgets_split_line_type_id = widgets_split_line_get_type_once ();
		g_once_init_leave (&widgets_split_line_type_id__once, widgets_split_line_type_id);
	}
	return widgets_split_line_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;
}

