#include <eina_list.h>
#include <glib.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
#include <setting-debug.h>
#include <setting-common-general-func.h>
#include <setting-plugin.h>
+
+
+static Setting_GenGroupItem_Data *g_list_item; /*TEST*/
+
+
+
/*
* UI draw handler table : _g_draw_list
* - contains Object_Drawer typed object.
*/
Eina_List *_g_drawer_list = NULL;
-typedef void (*drawer_fp)(void *data, xmlNode *xmlObj);
-static void group_func(void *data, xmlNode *xmlObj);
-static void link_func(void *data, xmlNode *xmlObj);
-static void slider_func(void *data, xmlNode *xmlObj);
-static void label_func(void *data, xmlNode *xmlObj);
-static void navigationbar_func(void *data, xmlNode *xmlObj);
-static void checkbox_func(void *data, xmlNode *xmlObj);
-static void editbox_func(void *data, xmlNode *xmlObj);
-static void expanditem_func(void *data, xmlNode *xmlObj);
-static void expandlist_func(void *data, xmlNode *xmlObj);
-static void settings_func(void *data, xmlNode *xmlObj);
-static void setting_func(void *data, xmlNode *xmlObj);
-
-// draw handler
-typedef struct
-{
- const char* type; // ui type
- drawer_fp draw;
-} Object_Drawer;
+/**
+ * @return Evas_Object * obj
+ */
+static void* navigationbar_func(void *data, xmlNode *xmlObj);
+
+
+/*
+ * @return void
+ */
+static void* group_func(void *data, xmlNode *xmlObj);
+
+/*
+ * @return Setting_GenGroupItem_Data* ptr
+ */
+static void* link_func(void *data, xmlNode *xmlObj);
+
+/*
+ * @return Setting_GenGroupItem_Data* ptr
+ */
+static void* slider_func(void *data, xmlNode *xmlObj);
+
+/*
+ * @return Setting_GenGroupItem_Data* ptr
+ */
+static void* label_func(void *data, xmlNode *xmlObj);
+
+/*
+ * @return Setting_GenGroupItem_Data* ptr
+ */
+static void* checkbox_func(void *data, xmlNode *xmlObj);
+
+/*
+ * @return Setting_GenGroupItem_Data* ptr
+ */
+static void* editbox_func(void *data, xmlNode *xmlObj);
+
+/*
+ * @return Setting_GenGroupItem_Data* ptr
+ */
+static void* expandlist_func(void *data, xmlNode *xmlObj);
+
+/**
+ * @return nothing
+ */
+static void* expanditem_func(void *data, xmlNode *xmlObj);
+
+/**
+ * do nothing
+ */
+static void* settings_func(void *data, xmlNode *xmlObj);
+
+/**
+ * do nothing
+ */
+static void* setting_func(void *data, xmlNode *xmlObj);
+
+static int __node_walker(PluginNode* context, xmlNode* cur);
+
+static int __node_finder(PluginNode* context, xmlNode* cur, char* id_str, char* value);
+
static void __drawer_add(const char *type, drawer_fp draw)
{
return list_item ? list_item->draw : NULL;
}
void setting_drawer_list_init()
-{SETTING_TRACE_BEGIN;
+{
+ SETTING_TRACE_BEGIN;
/* <navigationbar> */__drawer_add("navigationbar", navigationbar_func);
/* <bool> */__drawer_add("bool", checkbox_func);
/* <string> */__drawer_add("string", editbox_func);
#define DBUS_SIGNAL_INTERFACE "org.tizen.setting.signal"
#define DBUS_SIGNAL "test"
+static char* substring(const char* str, size_t begin, size_t len)
+{
+ if (str == 0 || strlen(str) == 0 || strlen(str) < begin || strlen(str) < (begin+len))
+ return 0;
+
+ return strndup(str + begin, len);
+}
//------------------------------------------------------
// for client - bus
DBusError error;
dbus_error_init(&error);
+ setting_main_appdata *ad = user_data;
+
if (dbus_message_is_signal(message, DBUS_SIGNAL_INTERFACE, DBUS_SIGNAL))
{
if (dbus_message_get_args(message, &error,
if (sender_pid != 0 && my_pid != sender_pid)
{
SETTING_TRACE("received key : %s , value : %s", key, value);
+ //-------------------------------------------------------------
+ // received key : checkbox1|N/A , value : INT|1
+ //-------------------------------------------------------------
+ //char* key = "checkbox1|N/A";
+ char* ptr = strchr(key, '|');
+
+ xmlDocPtr doc = NULL;
+ if (ptr && key)
+ {
+ //parsing for : checkbox1|N/A -> checkbox1
+ char* key_name = substring(key, 0, strlen(key)-strlen(ptr));
+ char* val_name = strchr(value, '|');
+ val_name++;
+
+ // ad->plugin_path
+ // access xml file
+ doc = xmlParseFile(ad->plugin_path);
+ // generate xml tree
+ xmlNode *root = xmlDocGetRootElement(doc);
+ // find a node
+ __node_finder((PluginNode*)ad->plugin_node, root, key_name ,val_name);
+ }
+ // update the node
+ GError *error = NULL;
+
+ /*
+ if(doc != NULL)
+ {
+ xmlSaveFormatFile(ad->plugin_path, doc, 1);
+ // TODO: make sure this is right
+ xmlFreeDoc(doc);
+ doc = NULL;
+ SETTING_TRACE("__cfg_file_write successful");
+ }
+ */
+
+ // update UI
}
return DBUS_HANDLER_RESULT_HANDLED;
}
-int setting_dbus_handler_init(void)
+int setting_dbus_handler_init(void* user_data)
{
SETTING_TRACE_BEGIN;
DBusError error;
return -1;
}
- if (dbus_connection_add_filter(bus, __signal_filter, NULL, NULL) == FALSE)
+ if (dbus_connection_add_filter(bus, __signal_filter, user_data, NULL) == FALSE)
{
return -1;
}
Elm_Genlist_Item_Class itc_layout;
-// draw handler
-typedef struct
-{
- xmlDocPtr doc;
- xmlNode *root;
-
- const char *cfg_file;
- Evas_Object *win_get;
- Evas_Object *ly_main;
- Evas_Object *scroller;
- Evas_Object *navi_bar;
-} Draw_Data;
-
-
// write -> update
static int __cfg_file_write(Draw_Data *pd)
{
{
SETTING_TRACE_BEGIN;
ret_if(!data);
- Draw_Data *pd = data;
+
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
if (pd->ly_main) {
evas_object_del(pd->ly_main);
pd->ly_main = NULL;
}
- pd->scroller = NULL;
- pd->navi_bar = NULL;
- pd->cfg_file = NULL;
+ setting_plugin_destroy(node);
+
+// pd->scroller = NULL;
+// pd->navi_bar = NULL;
+// pd->cfg_file = NULL;
- pd->root = NULL;
+// pd->root = NULL;
}
-static void group_func(void *data, xmlNode *xmlObj)
+static void* group_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
- Draw_Data *pd = data;
+
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
// original code is non-recursive
#if 0
SETTING_TRACE (" >>> GROUP NAME : %s \n", title);
(void)setting_create_Gendial_field_titleItem(pd->scroller, &(itc_group_item), title, NULL);
#endif
+
+ return NULL;
};
-static void __link_list_cb(void *data, Evas_Object *obj, void *event_info)
+static void* __link_list_cb(void *data, Evas_Object *obj, void *event_info)
{
ret_if(data == NULL);
retm_if(event_info == NULL, "Invalid argument: event info is NULL");
snprintf(file, sizeof(file), "%s/%s", PLUGIN_CFG_DIR, link_file);
SETTING_TRACE("file:%s", file);
- setting_plugin_load(file);
+ PluginNode* plugin_node = setting_plugin_create();
+ setting_plugin_load(plugin_node, (const char *)file);
+
+ //setting_plugin_load(NULL, file);
+
+ return NULL;
}
-static void label_func(void *data, xmlNode *xmlObj)
+static void* label_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
- Draw_Data *pd = data;
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
+
const char *title = (char*)xmlGetProp(xmlObj, "title");
- setting_create_Gendial_field_def(pd->scroller, &(itc_1text),
- NULL,
- xmlObj, SWALLOW_Type_INVALID, NULL, NULL,
- 0, title, NULL, NULL);
+ Setting_GenGroupItem_Data *obj =
+ setting_create_Gendial_field_def(pd->scroller, &(itc_1text),
+ NULL,
+ xmlObj, SWALLOW_Type_INVALID, NULL, NULL,
+ 0, title, NULL, NULL);
+
+ return obj;
}
-static void link_func(void *data, xmlNode *xmlObj)
+static void* link_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
- Draw_Data *pd = data;
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
+
const char *key_str = (char*)xmlGetProp(xmlObj, "id");
+ Setting_GenGroupItem_Data * obj =
+ setting_create_Gendial_field_def(pd->scroller, &(itc_1text),
+ __link_list_cb,
+ xmlObj, SWALLOW_Type_INVALID, NULL, NULL,
+ 0, key_str, NULL, NULL);
- setting_create_Gendial_field_def(pd->scroller, &(itc_1text),
- __link_list_cb,
- xmlObj, SWALLOW_Type_INVALID, NULL, NULL,
- 0, key_str, NULL, NULL);
+ return (void*)obj;
};
}
-static void slider_func(void *data, xmlNode *xmlObj)
+static void* slider_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
- Draw_Data *pd = data;
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
// type casting
const char *title = (char*)xmlGetProp(xmlObj, "title");
list_item->stop_change_cb = __slider_stop_cb;
list_item->belongs_to = (int)pd;
}
-};
+ g_list_item = list_item;
+
+ return (void*)list_item;
+};
-static void navigationbar_func(void *data, xmlNode *xmlObj)
+/*
+ elm_object_item_data_set(item_to_update->item, item_to_update);
+ elm_genlist_item_update(item_to_update->item);
+*/
+static void* navigationbar_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
- Draw_Data *pd = data;
+
+ //Draw_Data *pd = node->pd;
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
//----------------------------------------------------------------
// [DATA] title, btn[0], btn[1]
_(title),
_(btn[1]), _(btn[0]),
___click_softkey_back_cb,
- ___click_softkey_back_cb, pd, &pd->scroller,
+ ___click_softkey_back_cb, data, &pd->scroller,
&(pd->navi_bar));
+
+ //return (void*)(pd->ly_main);
+ return NULL;
};
}
-static void checkbox_func(void *data, xmlNode *xmlObj)
+static void* checkbox_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
- Draw_Data *pd = data;
+
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
// [DATA] title, value
const char *title = (char*)xmlGetProp(xmlObj, "title");
list_item->belongs_to = (int) pd;
SETTING_TRACE("pd:%p,list_item->belongs_to:%d", pd, list_item->belongs_to);
}
-};
+
+ return list_item;
+}
static void __entry_unfocus_cb(void *data, Evas_Object *obj, void *event_info)
}
-static void editbox_func(void *data, xmlNode *xmlObj)
+static void* editbox_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
- Draw_Data *pd = data;
+
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
const char *title = (char*)xmlGetProp(xmlObj, "title");
const char *key_str= (char*)xmlGetProp(xmlObj, "value");
list_item->stop_change_cb = __entry_unfocus_cb;
list_item->belongs_to = (int)pd;
}
+
+ return list_item;
};
{
ret_if(NULL == data || NULL == event_info);
SETTING_TRACE_BEGIN;
- Draw_Data *pd = data;
+
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
+
Elm_Object_Item *parentItem = event_info; /* parent item */
Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem); /* parent data */
Evas_Object *scroller = elm_object_item_widget_get(parentItem);
}
-static void settings_func(void *data, xmlNode *xmlObj)
+static void* settings_func(void *data, xmlNode *xmlObj)
{
-
+ return NULL;
}
// <setting>
-static void setting_func(void *data, xmlNode *xmlObj)
+static void* setting_func(void *data, xmlNode *xmlObj)
{
-#if 0
+#if 0/*{{{*/
// DO NOTHING
//----------------------------------------------------------------
// [DATA] title, btn[0], btn[1]
___click_softkey_back_cb,
___click_softkey_back_cb, pd, &pd->scroller,
&(pd->navi_bar));
-#endif
+#endif/*}}}*/
+
+ return NULL;
}
-static void expanditem_func(void *data, xmlNode *xmlObj)
+static void* expanditem_func(void *data, xmlNode *xmlObj)
{
// DO NOTHING - expandlist draws this area
-};
-
+ return NULL;
+}
-static void expandlist_func(void *data, xmlNode *xmlObj)
+static void* expandlist_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
- Draw_Data *pd = data;
+
+ PluginNode* node = (PluginNode*)data;
+ Draw_Data *pd = node->pd;
+
const char *key_str = (char*)xmlGetProp(xmlObj, "title");
const char *value = (char*)xmlGetProp(xmlObj, "value"); // string -> value
- setting_enable_expandable_genlist(pd->scroller, pd, __expanditem_func_exp_cb, __expanditem_func_smart_cb);
+ setting_enable_expandable_genlist(pd->scroller, data, __expanditem_func_exp_cb, __expanditem_func_smart_cb);
Setting_GenGroupItem_Data *list_item =
setting_create_Gendial_exp_parent_field(pd->scroller,
&(itc_2text_3_parent),
list_item->userdata = xmlObj;
list_item->belongs_to = (int)pd;
}
-};
+
+ return list_item;
+}
/////////////
-static int __node_walker(Draw_Data *pd, xmlNode* cur)
+static int __node_walker(PluginNode* context, xmlNode* cur)
{
//SETTING_TRACE_BEGIN;
+ Draw_Data *pd = context->pd;
+
retv_if(!pd, -1);
xmlNode *cur_node = NULL;
for (cur_node = cur; cur_node;cur_node = cur_node->next) {
drawer_fp fp = __drawer_find(cur_node->name);
if (fp)
- fp(pd, cur_node); // draw it
+ {
+ // type check
+ void* vret = fp(context, cur_node); // draw it
+
+ if (vret)
+ {
+ Setting_GenGroupItem_Data* genlist_node = (Setting_GenGroupItem_Data* )vret;
+ //SETTING_TRACE("add node to Eina List name : %s, id : ", cur_node->name, xmlGetProp(cur_node, "id"));
+ // add it to the hash table create before.
+ // id, object
+ // add list
+ char* key_name = xmlGetProp(cur_node, "id");
+ eina_hash_add(context->ui_list, strdup(key_name),(void*)genlist_node);
+ //context->ui_list= eina_list_append(context->ui_list, genlist_node);
+ }
+ }
+ }
+ __node_walker(context, cur_node->children); /* RECURSIVE */
+ }
+ return 0;
+}
+
+/**
+ * @param id_str [in] "id"
+ * @param value [in] value to be udpated
+ */
+// refer to __expanditem_func_sel_cb
+static int __node_finder(PluginNode* context, xmlNode* cur, char* id_str, char* value)
+{
+ //SETTING_TRACE_BEGIN;
+ xmlNode *cur_node = NULL;
+ for (cur_node = cur; cur_node;cur_node = cur_node->next) {
+ if (cur_node->type == XML_ELEMENT_NODE) {
+
+ //SETTING_TRACE("node type : Element, name=%s id=%s", cur_node->name,xmlGetProp(cur_node, "id"));
+ char* id_name = (char*)xmlGetProp(cur_node, "id");
+ if ( id_name && 0 == strcmp(id_str, id_name))
+ {
+ SETTING_TRACE("FOUND >>>> %s", id_name);
+ // cur_node - update xml code
+ xmlAttrPtr newattr = xmlSetProp(cur_node, "value", value);
+
+ //-----------------------------------------------------------
+ // UI UPDATE
+ // case : slider
+ if ( 0 == strcmp (cur_node->name, "integer"))
+ {
+ SETTING_TRACE(">>>>> UPDATE SLIDER CONTROL %x --- %s ",context->ui_list, id_name);
+ Setting_GenGroupItem_Data* item_to_update = (Setting_GenGroupItem_Data*)eina_hash_find(context->ui_list, id_name);
+ if (item_to_update)
+ {
+ item_to_update->chk_status = atoi(value);
+ SETTING_TRACE(">>> o-------------0 SLIDER VALUE = %d ", item_to_update->chk_status);
+
+ elm_object_item_data_set(item_to_update->item, item_to_update);
+ elm_genlist_item_update(item_to_update->item);
+ } else {
+ SETTING_TRACE("item_to_update is NULL");
+ }
+ }
+ // case : toggle
+ if ( 0 == strcmp (cur_node->name, "bool"))
+ {
+ SETTING_TRACE(">>>>> UPDATE TOGGLE CONTROL %x --- %s ",context->ui_list, id_name);
+ Setting_GenGroupItem_Data* item_to_update = (Setting_GenGroupItem_Data*)eina_hash_find(context->ui_list, id_name);
+ if (item_to_update)
+ {
+ item_to_update->chk_status = atoi(value);
+ SETTING_TRACE(">>> o-------------0 TOGGLE VALUE = %d ", item_to_update->chk_status);
+
+ elm_object_item_data_set(item_to_update->item, item_to_update);
+ elm_genlist_item_update(item_to_update->item);
+ } else {
+ SETTING_TRACE("item_to_update is NULL");
+ }
+ }
+ // case : edit control
+ if ( 0 == strcmp (cur_node->name, "string"))
+ {
+ SETTING_TRACE(">>>>> UPDATE EDIT CONTROL CONTROL %x --- %s ",context->ui_list, id_name);
+ Setting_GenGroupItem_Data* item_to_update = (Setting_GenGroupItem_Data*)eina_hash_find(context->ui_list, id_name);
+ if (item_to_update)
+ {
+ char* old_string = item_to_update->sub_desc;
+ item_to_update->sub_desc = strdup(value);
+ SETTING_TRACE(">>> o-------------0 STRING VALUE = %s ", value);
+
+ // free old string
+
+ elm_object_item_data_set(item_to_update->item, item_to_update);
+ elm_genlist_item_update(item_to_update->item);
+ } else {
+ SETTING_TRACE("item_to_update is NULL");
+ }
+ }
+ // case : expand list
+ // parent
+ // child1
+ // child2
+ // child3
+ // child4
+ //-----------------------------------------------------------
+ if ( 0 == strcmp (cur_node->name, "expandlist"))
+ {
+ SETTING_TRACE(">>>>> UPDATE EXPAND LIST CONTROL %x --- %s ",context->ui_list, id_name);
+ Setting_GenGroupItem_Data* item_to_update = (Setting_GenGroupItem_Data*)eina_hash_find(context->ui_list, id_name);
+ if (item_to_update)
+ {
+ char* old_string = item_to_update->sub_desc;
+ item_to_update->sub_desc = strdup(value);
+ SETTING_TRACE(">>> o-------------0 EXPAND LIST VALUE = %s ", value);
+
+ // free old string
+ elm_object_item_data_set(item_to_update->item, item_to_update);
+ elm_genlist_item_update(item_to_update->item);
+ } else {
+ SETTING_TRACE("item_to_update is NULL");
+ }
+ }
+ }
}
- __node_walker(pd, cur_node->children); /* RECURSIVE */
+ __node_finder(context, cur_node->children, id_str, value); /* RECURSIVE */
}
return 0;
}
+static unsigned int _plugin_string_key_length(const char*key)
+{
+ if (!key)
+ return 0;
+
+ return (int)strlen(key) + 1;
+}
+
+static int _plugin_string_key_cmp(const char* key1, int key1_length,
+ const char* key2, int key2_length)
+{
+ return strcmp(key1, key2);
+}
+
+static void _plugin_entry_free_cb(void* data)
+{
+// free(data);
+// data = NULL;
+}
+
+//static PluginNode* g_context;
+
+PluginNode* setting_plugin_create()
+{
+ PluginNode *node = calloc(1, sizeof(PluginNode));
+
+ Draw_Data *pd = calloc(1, sizeof(Draw_Data));
+ setting_retvm_if(!pd, -1, "Create Draw_Data obj failed");
+ //eina_init();
+
+ node->pd = pd;
+ node->ui_list = eina_hash_new(EINA_KEY_LENGTH(_plugin_string_key_length),
+ EINA_KEY_CMP(_plugin_string_key_cmp),
+ EINA_KEY_HASH(eina_hash_superfast),
+ _plugin_entry_free_cb,
+ 5); // 2^5
+
+ return node;
+}
+
+void setting_plugin_destroy(PluginNode* node)
+{
+ SETTING_TRACE_BEGIN;
+ if (node) {
+ SETTING_TRACE("node is NOT NULL")
+ if (node->pd) {
+ SETTING_TRACE("node->pd is NOT NULL")
+ if(node->pd->doc != NULL) {
+ xmlSaveFormatFile(node->plugin_path, node->pd->doc, 1);
+ // TODO: make sure this is right
+ xmlFreeDoc(node->pd->doc);
+ node->pd->doc = NULL;
+ SETTING_TRACE("__cfg_file_write successful");
+ }
+
+ SETTING_TRACE("before freeing node->pd");
+ free(node->pd);
+ node->pd = NULL;
+ SETTING_TRACE("after freeing node->pd");
+ }
+
+ SETTING_TRACE("before freeing ui_list");
+ if (node->ui_list) {
+ eina_hash_free(node->ui_list);
+ node->ui_list = NULL;
+ }
+ SETTING_TRACE("after freeing ui_list");
+
+ SETTING_TRACE("before freeing node");
+ free(node);
+ node = NULL;
+ SETTING_TRACE("after freeing node");
+ }
+}
+
+
+static Eina_Bool _plugin_foreach_cb(const Eina_Hash *hash, const void*key, void* data, void* fdata)
+{
+ Setting_GenGroupItem_Data* node = (Setting_GenGroupItem_Data*) data;
+ SETTING_TRACE("%s --- %s ", (char*)key, node->keyStr);
+
+ return EINA_TRUE;
+}
+
-bool setting_plugin_load(const char *cfg_file)
+void setting_plugin_debug(PluginNode* context)
+{
+ SETTING_TRACE("HASH TABLE -------------------------------------");
+ eina_hash_foreach(context->ui_list,_plugin_foreach_cb, NULL);
+ SETTING_TRACE("HASH TABLE -------------------------------------");
+
+}
+
+void setting_plugin_update(PluginNode* context)
+{
+ Eina_List *li = context->ui_list;
+
+ while (li) {
+ Setting_GenGroupItem_Data* node = (Setting_GenGroupItem_Data*) eina_list_data_get(li);
+ if (node) {
+ // SETTING_TRACE(" ---> keyStr : %s , swallow type : %d ", node->keyStr, node->swallow_type);
+ Setting_GenGroupItem_Data* item_to_update = NULL;
+ item_to_update = node;
+ elm_object_item_data_set(item_to_update->item, item_to_update);
+ elm_genlist_item_update(item_to_update->item);
+ }
+ li = eina_list_next(li);
+ }
+}
+
+
+bool setting_plugin_load(PluginNode* context, const char *cfg_file)
{
SETTING_TRACE("cfg_file:%s", cfg_file)
if (isEmptyStr(cfg_file) || 0 != access(cfg_file, R_OK|W_OK|F_OK ))
SETTING_TRACE_ERROR(" error occured : access \n");
return FALSE;
}
+ context->pd->cfg_file = cfg_file;
+ context->pd->win_get = (Evas_Object *) ug_get_window();
- Draw_Data *pd = calloc(1, sizeof(Draw_Data));
- setting_retvm_if(!pd, -1, "Create Draw_Data obj failed");
-
- pd->cfg_file = cfg_file;
- pd->win_get = (Evas_Object *) ug_get_window();
GError *error = NULL;
- pd->doc = xmlParseFile(cfg_file);
- pd->root = xmlDocGetRootElement(pd->doc);
+ context->pd->doc = xmlParseFile(cfg_file);
+ context->pd->root = xmlDocGetRootElement(context->pd->doc);
+
// TODO: error handler here
- __node_walker(pd, pd->root);
+ __node_walker(context, context->pd->root);
- return TRUE;
+ // debug message
+ setting_plugin_debug(context);
+ return true;
}