]> saetta.ns0.it Git - zakform/libzakform/commitdiff
Added function ZakFormForm::add_element.
authorAndrea Zagli <azagli@libero.it>
Sat, 31 Oct 2015 10:03:18 +0000 (11:03 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 31 Oct 2015 10:03:58 +0000 (11:03 +0100)
src/form.c
src/form.h

index 136c851ab65016f1467abfd775eee102dc475f40..4faf75f9fdc321a5ed51816a1591babe0609e189 100644 (file)
@@ -39,7 +39,7 @@ static void zak_form_form_finalize (GObject *gobject);
 
 typedef struct
        {
-               gpointer nothing;
+               GPtrArray *ar_elements;
        } ZakFormFormPrivate;
 
 G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ZakFormForm, zak_form_form, G_TYPE_OBJECT)
@@ -59,6 +59,30 @@ static void
 zak_form_form_init (ZakFormForm *zak_form_form)
 {
        ZakFormFormPrivate *priv = zak_form_form_get_instance_private (zak_form_form);
+
+       priv->ar_elems = NULL;
+}
+
+/**
+ * zak_form_form_add_element:
+ * @zakform:
+ * @element:
+ *
+ * Returns: #TRUE if @element is added; FALSE otherwise.
+ */
+gboolean
+zak_form_form_add_element (ZakFormForm *zakform, ZakFormElement *element)
+{
+       gboolean ret;
+
+       ZakFormFormPrivate *priv;
+
+       priv = zak_form_form_get_instance_private (zakform);
+
+       g_ptr_array_add (priv->ar_elements, g_object_ref (element));
+       ret = TRUE;
+
+       return ret;
 }
 
 /* PRIVATE */
index e7500552cc180287b9a1822b6ac30eb4aca75967..6ab6c160472bb08c0d111726896c9acaced10824 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <glib-object.h>
 
+#include "formelement.h"
+
 
 G_BEGIN_DECLS
 
@@ -35,6 +37,9 @@ struct _ZakFormFormClass
 };
 
 
+gboolean zak_form_form_add_element (ZakFormForm *zakform, ZakFormElement *element);
+
+
 G_END_DECLS