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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.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 DC_TYPE_QR_CODE_VIEW (dc_qr_code_view_get_type ())
#define DC_QR_CODE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_QR_CODE_VIEW, DcQrCodeView))
#define DC_QR_CODE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_QR_CODE_VIEW, DcQrCodeViewClass))
#define DC_IS_QR_CODE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_QR_CODE_VIEW))
#define DC_IS_QR_CODE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_QR_CODE_VIEW))
#define DC_QR_CODE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_QR_CODE_VIEW, DcQrCodeViewClass))

typedef struct _DcQrCodeView DcQrCodeView;
typedef struct _DcQrCodeViewClass DcQrCodeViewClass;
typedef struct _DcQrCodeViewPrivate DcQrCodeViewPrivate;
enum  {
	DC_QR_CODE_VIEW_0_PROPERTY,
	DC_QR_CODE_VIEW_CODE_TEXT_PROPERTY,
	DC_QR_CODE_VIEW_NUM_PROPERTIES
};
static GParamSpec* dc_qr_code_view_properties[DC_QR_CODE_VIEW_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)))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _DcQrCodeView {
	GtkBox parent_instance;
	DcQrCodeViewPrivate * priv;
};

struct _DcQrCodeViewClass {
	GtkBoxClass parent_class;
};

struct _DcQrCodeViewPrivate {
	gchar* _code_text;
	GtkLabel* status_label;
	GtkPicture* qr_picture;
	GtkTextView* code_text_view;
	GtkScrolledWindow* code_text_scroll;
	GtkButton* copy_button;
};

static gint DcQrCodeView_private_offset;
static gpointer dc_qr_code_view_parent_class = NULL;

VALA_EXTERN GType dc_qr_code_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcQrCodeView, g_object_unref)
VALA_EXTERN DcQrCodeView* dc_qr_code_view_new (const gchar* initial_status);
VALA_EXTERN DcQrCodeView* dc_qr_code_view_construct (GType object_type,
                                         const gchar* initial_status);
VALA_EXTERN GtkButton* dc_qr_code_view_make_copy_button (DcQrCodeView* self,
                                             const gchar* label);
VALA_EXTERN const gchar* dc_qr_code_view_get_code_text (DcQrCodeView* self);
static void dc_qr_code_view_copy_to_clipboard (DcQrCodeView* self);
static void _dc_qr_code_view_copy_to_clipboard_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self);
VALA_EXTERN void dc_qr_code_view_show_code (DcQrCodeView* self,
                                const gchar* text,
                                const gchar* svg,
                                const gchar* ready_status,
                                const gchar* render_error_status);
static void dc_qr_code_view_set_code_text (DcQrCodeView* self,
                                    const gchar* value);
VALA_EXTERN void dc_qr_code_view_set_copy_sensitive (DcQrCodeView* self,
                                         gboolean sensitive);
VALA_EXTERN void dc_qr_code_view_set_status (DcQrCodeView* self,
                                 const gchar* message);
VALA_EXTERN void dc_qr_code_view_set_qr_opacity (DcQrCodeView* self,
                                     gdouble opacity);
static void dc_qr_code_view_finalize (GObject * obj);
static GType dc_qr_code_view_get_type_once (void);
static void _vala_dc_qr_code_view_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_dc_qr_code_view_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dc_qr_code_view_get_instance_private (DcQrCodeView* self)
{
	return G_STRUCT_MEMBER_P (self, DcQrCodeView_private_offset);
}

DcQrCodeView*
dc_qr_code_view_construct (GType object_type,
                           const gchar* initial_status)
{
	DcQrCodeView * self = NULL;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkPicture* _tmp4_;
	GtkPicture* _tmp5_;
	GtkPicture* _tmp6_;
	GtkPicture* _tmp7_;
	GtkPicture* _tmp8_;
	GtkPicture* _tmp9_;
	GtkPicture* _tmp10_;
	GtkTextView* _tmp11_;
	GtkTextView* _tmp12_;
	GtkTextView* _tmp13_;
	GtkTextView* _tmp14_;
	GtkTextView* _tmp15_;
	GtkScrolledWindow* _tmp16_;
	GtkScrolledWindow* _tmp17_;
	GtkScrolledWindow* _tmp18_;
	GtkScrolledWindow* _tmp19_;
	GtkTextView* _tmp20_;
	GtkScrolledWindow* _tmp21_;
	GtkScrolledWindow* _tmp22_;
	g_return_val_if_fail (initial_status != NULL, NULL);
	self = (DcQrCodeView*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 12, NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (initial_status);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->status_label);
	self->priv->status_label = _tmp0_;
	_tmp1_ = self->priv->status_label;
	gtk_label_set_wrap (_tmp1_, TRUE);
	_tmp2_ = self->priv->status_label;
	gtk_label_set_xalign (_tmp2_, (gfloat) 0);
	_tmp3_ = self->priv->status_label;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp3_);
	_tmp4_ = (GtkPicture*) gtk_picture_new ();
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->qr_picture);
	self->priv->qr_picture = _tmp4_;
	_tmp5_ = self->priv->qr_picture;
	gtk_picture_set_content_fit (_tmp5_, GTK_CONTENT_FIT_CONTAIN);
	_tmp6_ = self->priv->qr_picture;
	gtk_picture_set_can_shrink (_tmp6_, TRUE);
	_tmp7_ = self->priv->qr_picture;
	gtk_widget_set_halign ((GtkWidget*) _tmp7_, GTK_ALIGN_CENTER);
	_tmp8_ = self->priv->qr_picture;
	gtk_widget_set_size_request ((GtkWidget*) _tmp8_, 280, 280);
	_tmp9_ = self->priv->qr_picture;
	gtk_widget_set_visible ((GtkWidget*) _tmp9_, FALSE);
	_tmp10_ = self->priv->qr_picture;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp10_);
	_tmp11_ = (GtkTextView*) gtk_text_view_new ();
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->code_text_view);
	self->priv->code_text_view = _tmp11_;
	_tmp12_ = self->priv->code_text_view;
	gtk_text_view_set_editable (_tmp12_, FALSE);
	_tmp13_ = self->priv->code_text_view;
	gtk_text_view_set_cursor_visible (_tmp13_, FALSE);
	_tmp14_ = self->priv->code_text_view;
	gtk_text_view_set_monospace (_tmp14_, TRUE);
	_tmp15_ = self->priv->code_text_view;
	gtk_text_view_set_wrap_mode (_tmp15_, GTK_WRAP_CHAR);
	_tmp16_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->code_text_scroll);
	self->priv->code_text_scroll = _tmp16_;
	_tmp17_ = self->priv->code_text_scroll;
	g_object_set (_tmp17_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	_tmp18_ = self->priv->code_text_scroll;
	gtk_scrolled_window_set_min_content_height (_tmp18_, 96);
	_tmp19_ = self->priv->code_text_scroll;
	_tmp20_ = self->priv->code_text_view;
	gtk_scrolled_window_set_child (_tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = self->priv->code_text_scroll;
	gtk_widget_set_visible ((GtkWidget*) _tmp21_, FALSE);
	_tmp22_ = self->priv->code_text_scroll;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp22_);
	return self;
}

DcQrCodeView*
dc_qr_code_view_new (const gchar* initial_status)
{
	return dc_qr_code_view_construct (DC_TYPE_QR_CODE_VIEW, initial_status);
}

static void
_dc_qr_code_view_copy_to_clipboard_gtk_button_clicked (GtkButton* _sender,
                                                       gpointer self)
{
	dc_qr_code_view_copy_to_clipboard ((DcQrCodeView*) self);
}

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

GtkButton*
dc_qr_code_view_make_copy_button (DcQrCodeView* self,
                                  const gchar* label)
{
	GtkButton* btn = NULL;
	GtkButton* _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (label != NULL, NULL);
	_tmp0_ = (GtkButton*) gtk_button_new_with_label (label);
	g_object_ref_sink (_tmp0_);
	btn = _tmp0_;
	_tmp2_ = self->priv->_code_text;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		_tmp3_ = self->priv->_code_text;
		_tmp4_ = strlen (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	_tmp6_ = btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp6_, _tmp1_);
	_tmp7_ = btn;
	g_signal_connect_object (_tmp7_, "clicked", (GCallback) _dc_qr_code_view_copy_to_clipboard_gtk_button_clicked, self, 0);
	_tmp8_ = btn;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_g_object_unref0 (self->priv->copy_button);
	self->priv->copy_button = _tmp9_;
	result = btn;
	return result;
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

void
dc_qr_code_view_show_code (DcQrCodeView* self,
                           const gchar* text,
                           const gchar* svg,
                           const gchar* ready_status,
                           const gchar* render_error_status)
{
	GtkLabel* _tmp0_;
	GtkTextView* _tmp1_;
	GtkTextBuffer* _tmp2_;
	GtkTextBuffer* _tmp3_;
	GtkScrolledWindow* _tmp4_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	g_return_if_fail (svg != NULL);
	g_return_if_fail (ready_status != NULL);
	g_return_if_fail (render_error_status != NULL);
	dc_qr_code_view_set_code_text (self, text);
	_tmp0_ = self->priv->status_label;
	gtk_label_set_label (_tmp0_, ready_status);
	_tmp1_ = self->priv->code_text_view;
	_tmp2_ = gtk_text_view_get_buffer (_tmp1_);
	_tmp3_ = _tmp2_;
	g_object_set (_tmp3_, "text", text, NULL);
	_tmp4_ = self->priv->code_text_scroll;
	gtk_widget_set_visible ((GtkWidget*) _tmp4_, TRUE);
	dc_qr_code_view_set_copy_sensitive (self, TRUE);
	{
		GBytes* bytes = NULL;
		guint8* _tmp5_;
		gint _tmp5__length1;
		gint _tmp6_ = 0;
		guint8* _tmp7_;
		gint _tmp7__length1;
		GBytes* _tmp8_;
		GdkTexture* _tmp9_ = NULL;
		GdkTexture* _tmp10_;
		GtkPicture* _tmp11_;
		GtkPicture* _tmp12_;
		_tmp5_ = string_get_data (svg, &_tmp6_);
		_tmp5__length1 = _tmp6_;
		_tmp7_ = _tmp5_;
		_tmp7__length1 = _tmp5__length1;
		_tmp8_ = g_bytes_new (_tmp7_, _tmp7__length1);
		bytes = _tmp8_;
		_tmp10_ = gdk_texture_new_from_bytes (bytes, &_inner_error0_);
		_tmp9_ = _tmp10_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_bytes_unref0 (bytes);
			goto __catch0_g_error;
		}
		_tmp11_ = self->priv->qr_picture;
		gtk_picture_set_paintable (_tmp11_, (GdkPaintable*) _tmp9_);
		_tmp12_ = self->priv->qr_picture;
		gtk_widget_set_visible ((GtkWidget*) _tmp12_, TRUE);
		_g_object_unref0 (_tmp9_);
		_g_bytes_unref0 (bytes);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GtkLabel* _tmp13_;
		GError* _tmp14_;
		const gchar* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp13_ = self->priv->status_label;
		_tmp14_ = e;
		_tmp15_ = _tmp14_->message;
		_tmp16_ = g_strconcat (render_error_status, _tmp15_, NULL);
		_tmp17_ = _tmp16_;
		gtk_label_set_label (_tmp13_, _tmp17_);
		_g_free0 (_tmp17_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

void
dc_qr_code_view_set_status (DcQrCodeView* self,
                            const gchar* message)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = self->priv->status_label;
	gtk_label_set_label (_tmp0_, message);
}

void
dc_qr_code_view_set_copy_sensitive (DcQrCodeView* self,
                                    gboolean sensitive)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->copy_button;
	if (_tmp0_ != NULL) {
		GtkButton* _tmp1_;
		_tmp1_ = self->priv->copy_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, sensitive);
	}
}

void
dc_qr_code_view_set_qr_opacity (DcQrCodeView* self,
                                gdouble opacity)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->qr_picture;
	gtk_widget_set_opacity ((GtkWidget*) _tmp0_, opacity);
}

static void
dc_qr_code_view_copy_to_clipboard (DcQrCodeView* self)
{
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	gchar* text = NULL;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GdkDisplay* _tmp6_;
	GdkClipboard* _tmp7_;
	const gchar* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_code_text;
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp2_ = g_strdup (_tmp0_);
	text = _tmp2_;
	_tmp3_ = text;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == 0) {
		_g_free0 (text);
		return;
	}
	_tmp6_ = gtk_widget_get_display ((GtkWidget*) self);
	_tmp7_ = gdk_display_get_clipboard (_tmp6_);
	_tmp8_ = text;
	gdk_clipboard_set_text (_tmp7_, _tmp8_);
	_g_free0 (text);
}

const gchar*
dc_qr_code_view_get_code_text (DcQrCodeView* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_code_text;
	result = _tmp0_;
	return result;
}

static void
dc_qr_code_view_set_code_text (DcQrCodeView* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_qr_code_view_get_code_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_code_text);
		self->priv->_code_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_qr_code_view_properties[DC_QR_CODE_VIEW_CODE_TEXT_PROPERTY]);
	}
}

static void
dc_qr_code_view_class_init (DcQrCodeViewClass * klass,
                            gpointer klass_data)
{
	dc_qr_code_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcQrCodeView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_qr_code_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_qr_code_view_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_qr_code_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_QR_CODE_VIEW_CODE_TEXT_PROPERTY, dc_qr_code_view_properties[DC_QR_CODE_VIEW_CODE_TEXT_PROPERTY] = g_param_spec_string ("code-text", "code-text", "code-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dc_qr_code_view_instance_init (DcQrCodeView * self,
                               gpointer klass)
{
	self->priv = dc_qr_code_view_get_instance_private (self);
	self->priv->_code_text = NULL;
	self->priv->copy_button = NULL;
}

static void
dc_qr_code_view_finalize (GObject * obj)
{
	DcQrCodeView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_QR_CODE_VIEW, DcQrCodeView);
	_g_free0 (self->priv->_code_text);
	_g_object_unref0 (self->priv->status_label);
	_g_object_unref0 (self->priv->qr_picture);
	_g_object_unref0 (self->priv->code_text_view);
	_g_object_unref0 (self->priv->code_text_scroll);
	_g_object_unref0 (self->priv->copy_button);
	G_OBJECT_CLASS (dc_qr_code_view_parent_class)->finalize (obj);
}

static GType
dc_qr_code_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcQrCodeViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_qr_code_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcQrCodeView), 0, (GInstanceInitFunc) dc_qr_code_view_instance_init, NULL };
	GType dc_qr_code_view_type_id;
	dc_qr_code_view_type_id = g_type_register_static (gtk_box_get_type (), "DcQrCodeView", &g_define_type_info, 0);
	DcQrCodeView_private_offset = g_type_add_instance_private (dc_qr_code_view_type_id, sizeof (DcQrCodeViewPrivate));
	return dc_qr_code_view_type_id;
}

GType
dc_qr_code_view_get_type (void)
{
	static volatile gsize dc_qr_code_view_type_id__once = 0;
	if (g_once_init_enter (&dc_qr_code_view_type_id__once)) {
		GType dc_qr_code_view_type_id;
		dc_qr_code_view_type_id = dc_qr_code_view_get_type_once ();
		g_once_init_leave (&dc_qr_code_view_type_id__once, dc_qr_code_view_type_id);
	}
	return dc_qr_code_view_type_id__once;
}

static void
_vala_dc_qr_code_view_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	DcQrCodeView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_QR_CODE_VIEW, DcQrCodeView);
	switch (property_id) {
		case DC_QR_CODE_VIEW_CODE_TEXT_PROPERTY:
		g_value_set_string (value, dc_qr_code_view_get_code_text (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_qr_code_view_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	DcQrCodeView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_QR_CODE_VIEW, DcQrCodeView);
	switch (property_id) {
		case DC_QR_CODE_VIEW_CODE_TEXT_PROPERTY:
		dc_qr_code_view_set_code_text (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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;
}

