/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <config.h>
#endif
+#include <libzakutils/libzakutils.h>
+
#include <libzakgtkdecoder/libzakgtkdecoder.h>
#include "formelementdecoder.h"
static void zak_form_gtk_form_element_decoder_init (ZakFormGtkFormElementDecoder *zak_form_gtk_form_element_decoder);
static void zak_form_gtk_form_element_decoder_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
static void zak_form_gtk_form_element_decoder_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
static void zak_form_gtk_form_element_decoder_dispose (GObject *gobject);
static void zak_form_gtk_form_element_decoder_finalize (GObject *gobject);
-static gchar *zak_form_gtk_form_element_decoder_get_value (ZakFormGtkFormElementDecoder *element);
-static gboolean zak_form_gtk_form_element_decoder_set_value (ZakFormGtkFormElementDecoder *element, const gchar *value);
+static GValue *zak_form_gtk_form_element_decoder_get_value (ZakFormGtkFormElementDecoder *element);
+static gboolean zak_form_gtk_form_element_decoder_set_value (ZakFormGtkFormElementDecoder *element, GValue *value);
#define ZAK_FORM_GTK_FORM_ELEMENT_DECODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT_DECODER, ZakFormGtkFormElementDecoderPrivate))
/* PRIVATE */
static void
zak_form_gtk_form_element_decoder_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
ZakFormGtkFormElementDecoder *zak_form_gtk_form_element_decoder = (ZakFormGtkFormElementDecoder *)object;
ZakFormGtkFormElementDecoderPrivate *priv = ZAK_FORM_GTK_FORM_ELEMENT_DECODER_GET_PRIVATE (zak_form_gtk_form_element_decoder);
static void
zak_form_gtk_form_element_decoder_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
ZakFormGtkFormElementDecoder *zak_form_gtk_form_element_decoder = (ZakFormGtkFormElementDecoder *)object;
ZakFormGtkFormElementDecoderPrivate *priv = ZAK_FORM_GTK_FORM_ELEMENT_DECODER_GET_PRIVATE (zak_form_gtk_form_element_decoder);
parent_class->finalize (gobject);
}
-static gchar
+static GValue
*zak_form_gtk_form_element_decoder_get_value (ZakFormGtkFormElementDecoder *element)
{
- gchar *ret;
+ GValue *ret;
GtkWidget *w;
w = zak_form_gtk_form_element_get_widget (ZAK_FORM_GTK_FORM_ELEMENT (element));
- ret = (gchar *)zak_gtk_decoder_get_key (ZAK_GTK_DECODER (w));
+ ret = zak_utils_gvalue_new_string ((gchar *)zak_gtk_decoder_get_key (ZAK_GTK_DECODER (w)));
return ret;
}
static gboolean
-zak_form_gtk_form_element_decoder_set_value (ZakFormGtkFormElementDecoder *element, const gchar *value)
+zak_form_gtk_form_element_decoder_set_value (ZakFormGtkFormElementDecoder *element, GValue *value)
{
GtkWidget *w;
w = zak_form_gtk_form_element_get_widget (ZAK_FORM_GTK_FORM_ELEMENT (element));
- zak_gtk_decoder_set_key (ZAK_GTK_DECODER (w), value);
+ zak_gtk_decoder_set_key (ZAK_GTK_DECODER (w), g_value_get_string (value));
return TRUE;
}
/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __LIBZAKFORMGTK_H__
-#define __LIBZAKFORMGTK_H__
+#ifndef __LIBZAKFORMGTKDECODER_H__
+#define __LIBZAKFORMGTKDECODER_H__
-#include <libzakformgtk/form.h>
+#include <libzakformgtkdecoder/formelementdecoder.h>
-#include <libzakformgtk/formelement.h>
-#include <libzakformgtk/formelementcheck.h>
-#include <libzakformgtk/formelemententry.h>
-#include <libzakformgtk/formelementlabel.h>
-#include <libzakformgtk/formelementradio.h>
-#include <libzakformgtk/formelementspin.h>
-#include <libzakformgtk/formelementtextview.h>
-
-#endif /* __LIBZAKFORMGTK_H__ */
+#endif /* __LIBZAKFORMGTKDECODER_H__ */