Name: @PACKAGE_NAME@
Description: Class for CGI.
Version: @PACKAGE_VERSION@
-Requires: glib-2.0 >= 2.36 gobject-2.0 gio-2.0 gio-unix-2.0
+Requires: glib-2.0 >= 2.36 gobject-2.0 gio-2.0 gio-unix-2.0 libzakform libzakformini
Libs: -L${libdir} -lzakcgi
Cflags: -I${includedir}
#include <string.h>
+#include <libzakformini/libzakformini.h>
+
#include "session.h"
static void zak_cgi_session_class_init (ZakCgiSessionClass *class);
gchar *sid;
GFile *gfile;
GKeyFile *kfile;
+ ZakFormIniProvider *zakformini;
};
G_DEFINE_TYPE (ZakCgiSession, zak_cgi_session, G_TYPE_OBJECT)
priv->path = NULL;
priv->gfile = NULL;
priv->kfile = NULL;
+ priv->zakformini = NULL;
}
/**
return (gboolean)zak_cgi_session_get_value_full_int (session, group, name);
}
+static void
+zak_cgi_session_get_form_ini_provider (ZakCgiSession *session)
+{
+ ZakCgiSessionPrivate *priv = ZAK_CGI_SESSION_GET_PRIVATE (session);
+
+ if (priv->zakformini == NULL)
+ {
+ priv->zakformini = zak_form_ini_provider_new_from_gkeyfile (priv->kfile, g_file_get_path (priv->gfile));
+ }
+}
+
+/**
+ * zak_cgi_session_set_from_form:
+ * @session:
+ * @form:
+ *
+ */
+void
+zak_cgi_session_set_from_form (ZakCgiSession *session, ZakFormForm *form)
+{
+ ZakCgiSessionPrivate *priv = ZAK_CGI_SESSION_GET_PRIVATE (session);
+
+ zak_cgi_session_get_form_ini_provider (session);
+ zak_form_form_insert (ZAK_FORM_FORM (form), ZAK_FORM_IPROVIDER (priv->zakformini));
+}
+
+/**
+ * zak_cgi_session_fill_form:
+ * @session:
+ * @form:
+ *
+ */
+void
+zak_cgi_session_fill_form (ZakCgiSession *session, ZakFormForm *form)
+{
+ ZakCgiSessionPrivate *priv = ZAK_CGI_SESSION_GET_PRIVATE (session);
+
+ zak_cgi_session_get_form_ini_provider (session);
+ zak_form_form_load (ZAK_FORM_FORM (form), ZAK_FORM_IPROVIDER (priv->zakformini));
+}
+
/**
* zak_cgi_session_close:
* @session:
#include <glib-object.h>
+#include <libzakform/libzakform.h>
+
#include "main.h"
gdouble zak_cgi_session_get_value_full_double (ZakCgiSession *session, const gchar *group, const gchar *name);
gboolean zak_cgi_session_get_value_full_boolean (ZakCgiSession *session, const gchar *group, const gchar *name);
+void zak_cgi_session_set_from_form (ZakCgiSession *session, ZakFormForm *form);
+void zak_cgi_session_fill_form (ZakCgiSession *session, ZakFormForm *form);
+
void zak_cgi_session_close (ZakCgiSession *session);