{
} ZakGFlowInstancePrivate;
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ZakGFlowInstance, zak_gflow_instance, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakGFlowInstance, zak_gflow_instance, G_TYPE_OBJECT)
static void
zak_gflow_instance_class_init (ZakGFlowInstanceClass *class)
{
} ZakGFlowModelPrivate;
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ZakGFlowModel, zak_gflow_model, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakGFlowModel, zak_gflow_model, G_TYPE_OBJECT)
#ifdef G_OS_WIN32
static HMODULE backend_dll = NULL;
}
/**
- * zak_gflow_model_load_from_xml:
- * @zakmodel:
+ * zak_gflow_model_new_from_xml:
* @xmldoc:
*
*/
-gboolean
-zak_gflow_model_load_from_xml (ZakGFlowModel *zakmodel, xmlDoc *xmldoc)
+ZakGFlowModel
+*zak_gflow_model_new_from_xml (xmlDoc *xmldoc)
{
+ ZakGFlowModel *model;
ZakGFlowModelPrivate *priv;
- xmlNode *cur;
- xmlNode *cur_clean;
- gboolean ret;
+ g_return_val_if_fail (xmldoc != NULL, NULL);
- g_return_val_if_fail (ZAK_GFLOW_IS_MODEL (zakmodel), FALSE);
- g_return_val_if_fail (xmldoc != NULL, FALSE);
+ model = ZAK_GFLOW_MODEL (g_object_new (zak_gflow_model_get_type (), NULL));
- ret = FALSE;
+ priv = zak_gflow_model_get_instance_private (model);
- cur = xmlDocGetRootElement (xmldoc);
- if (cur != NULL)
- {
- }
-
- return ret;
+ return model;
}
/**
- * zak_gflow_model_load_from_file:
- * @zakmodel:
+ * zak_gflow_model_new_from_file:
* @filename:
*
*/
-gboolean
-zak_gflow_model_load_from_file (ZakGFlowModel *zakmodel, const gchar *filename)
+ZakGFlowModel
+*zak_gflow_model_load_from_file (const gchar *filename)
{
- xmlDoc *xdoc;
-
- gboolean ret;
+ ZakGFlowModel *model;
- g_return_val_if_fail (ZAK_GFLOW_IS_MODEL (zakmodel), FALSE);
- g_return_val_if_fail (filename != NULL, FALSE);
+ xmlDoc *xdoc;
- ret = FALSE;
+ g_return_val_if_fail (filename != NULL, NULL);
xdoc = xmlParseFile (filename);
if (xdoc != NULL)
{
- ret = zak_gflow_model_load_from_xml (zakmodel, xdoc);
+ model = zak_gflow_model_new_from_xml (xdoc);
}
- return ret;
+ return model;
}
/* PRIVATE */
};
-gboolean zak_gflow_model_load_from_xml (ZakGFlowModel *model, xmlDoc *xmldoc);
-gboolean zak_gflow_model_load_from_file (ZakGFlowModel *model, const gchar *filename);
+ZakGFlowModel *zak_gflow_model_new_from_xml (xmlDoc *xmldoc);
+ZakGFlowModel *zak_gflow_model_new_from_file (const gchar *filename);
ZakGFlowInstance *zak_gflow_model_start (ZakGFlowModel *model, const gchar *model_id);