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

/*
 * Copyright 2019 elementary, Inc. (https://elementary.io)
 * Copyright 2012–2013 Victor Eduardo <victoreduardm@gmail.com>
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <pango/pango.h>
#include <cairo-gobject.h>
#include <gdk/gdk.h>
#include <granite.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 CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE (code_widgets_cell_renderer_badge_get_type ())
#define CODE_WIDGETS_CELL_RENDERER_BADGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE, CodeWidgetsCellRendererBadge))
#define CODE_WIDGETS_CELL_RENDERER_BADGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE, CodeWidgetsCellRendererBadgeClass))
#define CODE_WIDGETS_IS_CELL_RENDERER_BADGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE))
#define CODE_WIDGETS_IS_CELL_RENDERER_BADGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE))
#define CODE_WIDGETS_CELL_RENDERER_BADGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE, CodeWidgetsCellRendererBadgeClass))

typedef struct _CodeWidgetsCellRendererBadge CodeWidgetsCellRendererBadge;
typedef struct _CodeWidgetsCellRendererBadgeClass CodeWidgetsCellRendererBadgeClass;
typedef struct _CodeWidgetsCellRendererBadgePrivate CodeWidgetsCellRendererBadgePrivate;
enum  {
	CODE_WIDGETS_CELL_RENDERER_BADGE_0_PROPERTY,
	CODE_WIDGETS_CELL_RENDERER_BADGE_TEXT_PROPERTY,
	CODE_WIDGETS_CELL_RENDERER_BADGE_NUM_PROPERTIES
};
static GParamSpec* code_widgets_cell_renderer_badge_properties[CODE_WIDGETS_CELL_RENDERER_BADGE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _CodeWidgetsCellRendererBadge {
	GtkCellRenderer parent_instance;
	CodeWidgetsCellRendererBadgePrivate * priv;
};

struct _CodeWidgetsCellRendererBadgeClass {
	GtkCellRendererClass parent_class;
};

struct _CodeWidgetsCellRendererBadgePrivate {
	gchar* _text;
	PangoRectangle text_logical_rect;
	PangoLayout* text_layout;
	GtkBorder margin;
	GtkBorder padding;
	GtkBorder border;
};

static gint CodeWidgetsCellRendererBadge_private_offset;
static gpointer code_widgets_cell_renderer_badge_parent_class = NULL;

VALA_EXTERN GType code_widgets_cell_renderer_badge_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CodeWidgetsCellRendererBadge, g_object_unref)
VALA_EXTERN CodeWidgetsCellRendererBadge* code_widgets_cell_renderer_badge_new (void);
VALA_EXTERN CodeWidgetsCellRendererBadge* code_widgets_cell_renderer_badge_construct (GType object_type);
static GtkSizeRequestMode code_widgets_cell_renderer_badge_real_get_request_mode (GtkCellRenderer* base);
static void code_widgets_cell_renderer_badge_real_get_preferred_width (GtkCellRenderer* base,
                                                                GtkWidget* widget,
                                                                gint* minimum_size,
                                                                gint* natural_size);
static void code_widgets_cell_renderer_badge_update_layout_properties (CodeWidgetsCellRendererBadge* self,
                                                                GtkWidget* widget);
static void code_widgets_cell_renderer_badge_real_get_preferred_height_for_width (GtkCellRenderer* base,
                                                                           GtkWidget* widget,
                                                                           gint width,
                                                                           gint* minimum_height,
                                                                           gint* natural_height);
VALA_EXTERN const gchar* code_widgets_cell_renderer_badge_get_text (CodeWidgetsCellRendererBadge* self);
static void code_widgets_cell_renderer_badge_real_render (GtkCellRenderer* base,
                                                   cairo_t* context,
                                                   GtkWidget* widget,
                                                   GdkRectangle* bg_area,
                                                   GdkRectangle* cell_area,
                                                   GtkCellRendererState flags);
VALA_EXTERN void code_widgets_cell_renderer_badge_set_text (CodeWidgetsCellRendererBadge* self,
                                                const gchar* value);
static void code_widgets_cell_renderer_badge_finalize (GObject * obj);
static GType code_widgets_cell_renderer_badge_get_type_once (void);
static void _vala_code_widgets_cell_renderer_badge_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec);
static void _vala_code_widgets_cell_renderer_badge_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec);

static inline gpointer
code_widgets_cell_renderer_badge_get_instance_private (CodeWidgetsCellRendererBadge* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsCellRendererBadge_private_offset);
}

CodeWidgetsCellRendererBadge*
code_widgets_cell_renderer_badge_construct (GType object_type)
{
	CodeWidgetsCellRendererBadge * self = NULL;
	self = (CodeWidgetsCellRendererBadge*) g_object_new (object_type, NULL);
	return self;
}

CodeWidgetsCellRendererBadge*
code_widgets_cell_renderer_badge_new (void)
{
	return code_widgets_cell_renderer_badge_construct (CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE);
}

static GtkSizeRequestMode
code_widgets_cell_renderer_badge_real_get_request_mode (GtkCellRenderer* base)
{
	CodeWidgetsCellRendererBadge * self;
	GtkSizeRequestMode result;
	self = (CodeWidgetsCellRendererBadge*) base;
	result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
	return result;
}

static void
code_widgets_cell_renderer_badge_real_get_preferred_width (GtkCellRenderer* base,
                                                           GtkWidget* widget,
                                                           gint* minimum_size,
                                                           gint* natural_size)
{
	CodeWidgetsCellRendererBadge * self;
	gint _vala_minimum_size = 0;
	gint _vala_natural_size = 0;
	gint width = 0;
	PangoRectangle _tmp0_;
	GtkBorder _tmp1_;
	GtkBorder _tmp2_;
	GtkBorder _tmp3_;
	GtkBorder _tmp4_;
	GtkBorder _tmp5_;
	GtkBorder _tmp6_;
	guint _tmp7_;
	guint _tmp8_;
	self = (CodeWidgetsCellRendererBadge*) base;
	g_return_if_fail (widget != NULL);
	code_widgets_cell_renderer_badge_update_layout_properties (self, widget);
	_tmp0_ = self->priv->text_logical_rect;
	width = _tmp0_.width;
	_tmp1_ = self->priv->margin;
	_tmp2_ = self->priv->margin;
	width += (gint) (_tmp1_.left + _tmp2_.right);
	_tmp3_ = self->priv->padding;
	_tmp4_ = self->priv->padding;
	width += (gint) (_tmp3_.left + _tmp4_.right);
	_tmp5_ = self->priv->border;
	_tmp6_ = self->priv->border;
	width += (gint) (_tmp5_.left + _tmp6_.right);
	g_object_get ((GtkCellRenderer*) self, "xpad", &_tmp7_, NULL);
	_tmp8_ = _tmp7_;
	_vala_natural_size = width + (2 * ((gint) _tmp8_));
	_vala_minimum_size = _vala_natural_size;
	if (minimum_size) {
		*minimum_size = _vala_minimum_size;
	}
	if (natural_size) {
		*natural_size = _vala_natural_size;
	}
}

static void
code_widgets_cell_renderer_badge_real_get_preferred_height_for_width (GtkCellRenderer* base,
                                                                      GtkWidget* widget,
                                                                      gint width,
                                                                      gint* minimum_height,
                                                                      gint* natural_height)
{
	CodeWidgetsCellRendererBadge * self;
	gint _vala_minimum_height = 0;
	gint _vala_natural_height = 0;
	gint height = 0;
	PangoRectangle _tmp0_;
	GtkBorder _tmp1_;
	GtkBorder _tmp2_;
	GtkBorder _tmp3_;
	GtkBorder _tmp4_;
	GtkBorder _tmp5_;
	GtkBorder _tmp6_;
	guint _tmp7_;
	guint _tmp8_;
	self = (CodeWidgetsCellRendererBadge*) base;
	g_return_if_fail (widget != NULL);
	code_widgets_cell_renderer_badge_update_layout_properties (self, widget);
	_tmp0_ = self->priv->text_logical_rect;
	height = _tmp0_.height;
	_tmp1_ = self->priv->margin;
	_tmp2_ = self->priv->margin;
	height += (gint) (_tmp1_.top + _tmp2_.bottom);
	_tmp3_ = self->priv->padding;
	_tmp4_ = self->priv->padding;
	height += (gint) (_tmp3_.top + _tmp4_.bottom);
	_tmp5_ = self->priv->border;
	_tmp6_ = self->priv->border;
	height += (gint) (_tmp5_.top + _tmp6_.bottom);
	g_object_get ((GtkCellRenderer*) self, "ypad", &_tmp7_, NULL);
	_tmp8_ = _tmp7_;
	_vala_natural_height = height + (2 * ((gint) _tmp8_));
	_vala_minimum_height = _vala_natural_height;
	if (minimum_height) {
		*minimum_height = _vala_minimum_height;
	}
	if (natural_height) {
		*natural_height = _vala_natural_height;
	}
}

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

static void
code_widgets_cell_renderer_badge_update_layout_properties (CodeWidgetsCellRendererBadge* self,
                                                           GtkWidget* widget)
{
	GtkStyleContext* ctx = NULL;
	GtkStyleContext* _tmp0_;
	GtkStyleContext* _tmp1_;
	GtkStateFlags state = 0U;
	GtkBorder _tmp2_ = {0};
	GtkBorder _tmp3_ = {0};
	GtkBorder _tmp4_ = {0};
	const gchar* _tmp5_;
	PangoLayout* _tmp6_;
	PangoRectangle ink_rect = {0};
	PangoLayout* _tmp7_;
	PangoRectangle _tmp8_ = {0};
	PangoRectangle _tmp9_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = gtk_widget_get_style_context (widget);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	ctx = _tmp1_;
	gtk_style_context_save (ctx);
	gtk_style_context_add_class (ctx, GRANITE_STYLE_CLASS_BADGE);
	state = gtk_style_context_get_state (ctx);
	gtk_style_context_get_margin (ctx, state, &_tmp2_);
	self->priv->margin = _tmp2_;
	gtk_style_context_get_padding (ctx, state, &_tmp3_);
	self->priv->padding = _tmp3_;
	gtk_style_context_get_border (ctx, state, &_tmp4_);
	self->priv->border = _tmp4_;
	_tmp5_ = self->priv->_text;
	_tmp6_ = gtk_widget_create_pango_layout (widget, _tmp5_);
	_g_object_unref0 (self->priv->text_layout);
	self->priv->text_layout = _tmp6_;
	gtk_style_context_restore (ctx);
	_tmp7_ = self->priv->text_layout;
	pango_layout_get_pixel_extents (_tmp7_, &_tmp8_, &_tmp9_);
	ink_rect = _tmp8_;
	self->priv->text_logical_rect = _tmp9_;
	_g_object_unref0 (ctx);
}

static void
code_widgets_cell_renderer_badge_real_render (GtkCellRenderer* base,
                                              cairo_t* context,
                                              GtkWidget* widget,
                                              GdkRectangle* bg_area,
                                              GdkRectangle* cell_area,
                                              GtkCellRendererState flags)
{
	CodeWidgetsCellRendererBadge * self;
	GdkRectangle aligned_area = {0};
	GdkRectangle _tmp0_;
	GdkRectangle _tmp1_ = {0};
	gint x = 0;
	GdkRectangle _tmp2_;
	gint y = 0;
	GdkRectangle _tmp3_;
	gint width = 0;
	GdkRectangle _tmp4_;
	gint height = 0;
	GdkRectangle _tmp5_;
	GtkBorder _tmp6_;
	GtkBorder _tmp7_;
	GtkBorder _tmp8_;
	GtkBorder _tmp9_;
	GtkBorder _tmp10_;
	GtkBorder _tmp11_;
	GtkStyleContext* ctx = NULL;
	GtkStyleContext* _tmp12_;
	GtkStyleContext* _tmp13_;
	GtkBorder _tmp14_;
	GtkBorder _tmp15_;
	GtkBorder _tmp16_;
	GtkBorder _tmp17_;
	GtkBorder _tmp18_;
	GtkBorder _tmp19_;
	GtkBorder _tmp20_;
	GtkBorder _tmp21_;
	GtkBorder _tmp22_;
	GtkBorder _tmp23_;
	GtkBorder _tmp24_;
	GtkBorder _tmp25_;
	PangoRectangle _tmp26_;
	PangoRectangle _tmp27_;
	PangoRectangle _tmp28_;
	PangoRectangle _tmp29_;
	PangoLayout* _tmp30_;
	self = (CodeWidgetsCellRendererBadge*) base;
	g_return_if_fail (context != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (bg_area != NULL);
	g_return_if_fail (cell_area != NULL);
	code_widgets_cell_renderer_badge_update_layout_properties (self, widget);
	_tmp0_ = *cell_area;
	gtk_cell_renderer_get_aligned_area ((GtkCellRenderer*) self, widget, flags, &_tmp0_, &_tmp1_);
	aligned_area = _tmp1_;
	_tmp2_ = aligned_area;
	x = _tmp2_.x;
	_tmp3_ = aligned_area;
	y = _tmp3_.y;
	_tmp4_ = aligned_area;
	width = _tmp4_.width;
	_tmp5_ = aligned_area;
	height = _tmp5_.height;
	_tmp6_ = self->priv->margin;
	x += (gint) _tmp6_.right;
	_tmp7_ = self->priv->margin;
	y += (gint) _tmp7_.top;
	_tmp8_ = self->priv->margin;
	_tmp9_ = self->priv->margin;
	width -= (gint) (_tmp8_.left + _tmp9_.right);
	_tmp10_ = self->priv->margin;
	_tmp11_ = self->priv->margin;
	height -= (gint) (_tmp10_.top + _tmp11_.bottom);
	_tmp12_ = gtk_widget_get_style_context (widget);
	_tmp13_ = _g_object_ref0 (_tmp12_);
	ctx = _tmp13_;
	gtk_style_context_add_class (ctx, GRANITE_STYLE_CLASS_BADGE);
	gtk_render_background (ctx, context, (gdouble) x, (gdouble) y, (gdouble) width, (gdouble) height);
	gtk_render_frame (ctx, context, (gdouble) x, (gdouble) y, (gdouble) width, (gdouble) height);
	_tmp14_ = self->priv->border;
	_tmp15_ = self->priv->padding;
	x += (gint) (_tmp14_.right + _tmp15_.right);
	_tmp16_ = self->priv->border;
	_tmp17_ = self->priv->padding;
	y += (gint) (_tmp16_.top + _tmp17_.top);
	_tmp18_ = self->priv->border;
	_tmp19_ = self->priv->border;
	_tmp20_ = self->priv->padding;
	_tmp21_ = self->priv->padding;
	width -= (gint) (((_tmp18_.left + _tmp19_.right) + _tmp20_.left) + _tmp21_.right);
	_tmp22_ = self->priv->border;
	_tmp23_ = self->priv->border;
	_tmp24_ = self->priv->padding;
	_tmp25_ = self->priv->padding;
	height -= (gint) (((_tmp22_.top + _tmp23_.bottom) + _tmp24_.top) + _tmp25_.bottom);
	_tmp26_ = self->priv->text_logical_rect;
	_tmp27_ = self->priv->text_logical_rect;
	x += _tmp26_.x + ((width - _tmp27_.width) / 2);
	_tmp28_ = self->priv->text_logical_rect;
	_tmp29_ = self->priv->text_logical_rect;
	y += _tmp28_.y + ((height - _tmp29_.height) / 2);
	_tmp30_ = self->priv->text_layout;
	gtk_render_layout (ctx, context, (gdouble) x, (gdouble) y, _tmp30_);
	_g_object_unref0 (ctx);
}

const gchar*
code_widgets_cell_renderer_badge_get_text (CodeWidgetsCellRendererBadge* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_text;
	result = _tmp0_;
	return result;
}

void
code_widgets_cell_renderer_badge_set_text (CodeWidgetsCellRendererBadge* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_cell_renderer_badge_get_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_text);
		self->priv->_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_cell_renderer_badge_properties[CODE_WIDGETS_CELL_RENDERER_BADGE_TEXT_PROPERTY]);
	}
}

static void
code_widgets_cell_renderer_badge_class_init (CodeWidgetsCellRendererBadgeClass * klass,
                                             gpointer klass_data)
{
	code_widgets_cell_renderer_badge_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeWidgetsCellRendererBadge_private_offset);
	((GtkCellRendererClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkCellRenderer*)) code_widgets_cell_renderer_badge_real_get_request_mode;
	((GtkCellRendererClass *) klass)->get_preferred_width = (void (*) (GtkCellRenderer*, GtkWidget*, gint*, gint*)) code_widgets_cell_renderer_badge_real_get_preferred_width;
	((GtkCellRendererClass *) klass)->get_preferred_height_for_width = (void (*) (GtkCellRenderer*, GtkWidget*, gint, gint*, gint*)) code_widgets_cell_renderer_badge_real_get_preferred_height_for_width;
	((GtkCellRendererClass *) klass)->render = (void (*) (GtkCellRenderer*, cairo_t*, GtkWidget*, GdkRectangle*, GdkRectangle*, GtkCellRendererState)) code_widgets_cell_renderer_badge_real_render;
	G_OBJECT_CLASS (klass)->get_property = _vala_code_widgets_cell_renderer_badge_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_widgets_cell_renderer_badge_set_property;
	G_OBJECT_CLASS (klass)->finalize = code_widgets_cell_renderer_badge_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_CELL_RENDERER_BADGE_TEXT_PROPERTY, code_widgets_cell_renderer_badge_properties[CODE_WIDGETS_CELL_RENDERER_BADGE_TEXT_PROPERTY] = g_param_spec_string ("text", "text", "text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
code_widgets_cell_renderer_badge_instance_init (CodeWidgetsCellRendererBadge * self,
                                                gpointer klass)
{
	gchar* _tmp0_;
	self->priv = code_widgets_cell_renderer_badge_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_text = _tmp0_;
}

static void
code_widgets_cell_renderer_badge_finalize (GObject * obj)
{
	CodeWidgetsCellRendererBadge * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE, CodeWidgetsCellRendererBadge);
	_g_free0 (self->priv->_text);
	_g_object_unref0 (self->priv->text_layout);
	G_OBJECT_CLASS (code_widgets_cell_renderer_badge_parent_class)->finalize (obj);
}

/**
 * A badge renderer.
 *
 * Informs the user quickly on the content of the corresponding view. For example
 * it might be used to show how much songs are in a playlist or how much updates
 * are available.
 *
 * {{../doc/images/cellrendererbadge.png}}
 *
 * @since 0.2
 */
 G_GNUC_NO_INLINE static GType
code_widgets_cell_renderer_badge_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsCellRendererBadgeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_cell_renderer_badge_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsCellRendererBadge), 0, (GInstanceInitFunc) code_widgets_cell_renderer_badge_instance_init, NULL };
	GType code_widgets_cell_renderer_badge_type_id;
	code_widgets_cell_renderer_badge_type_id = g_type_register_static (gtk_cell_renderer_get_type (), "CodeWidgetsCellRendererBadge", &g_define_type_info, G_TYPE_FLAG_NONE);
	CodeWidgetsCellRendererBadge_private_offset = g_type_add_instance_private (code_widgets_cell_renderer_badge_type_id, sizeof (CodeWidgetsCellRendererBadgePrivate));
	return code_widgets_cell_renderer_badge_type_id;
}

GType
code_widgets_cell_renderer_badge_get_type (void)
{
	static gsize code_widgets_cell_renderer_badge_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_cell_renderer_badge_type_id__once)) {
		GType code_widgets_cell_renderer_badge_type_id;
		code_widgets_cell_renderer_badge_type_id = code_widgets_cell_renderer_badge_get_type_once ();
		g_once_init_leave (&code_widgets_cell_renderer_badge_type_id__once, code_widgets_cell_renderer_badge_type_id);
	}
	return code_widgets_cell_renderer_badge_type_id__once;
}

static void
_vala_code_widgets_cell_renderer_badge_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec)
{
	CodeWidgetsCellRendererBadge * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE, CodeWidgetsCellRendererBadge);
	switch (property_id) {
		case CODE_WIDGETS_CELL_RENDERER_BADGE_TEXT_PROPERTY:
		g_value_set_string (value, code_widgets_cell_renderer_badge_get_text (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_widgets_cell_renderer_badge_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec)
{
	CodeWidgetsCellRendererBadge * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_TYPE_CELL_RENDERER_BADGE, CodeWidgetsCellRendererBadge);
	switch (property_id) {
		case CODE_WIDGETS_CELL_RENDERER_BADGE_TEXT_PROPERTY:
		code_widgets_cell_renderer_badge_set_text (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

