+ 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 pluginpath:%s, ---- %x --- %s ", context->plugin_path, context->ui_list, id_name);
+ Setting_GenGroupItem_Data* item_to_update = NULL;
+ 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"))
+ {
+ #if 1
+ SETTING_TRACE(">>>>> UPDATE EXPAND LIST CONTROL %x --- %s ",context->ui_list, id_name);
+ Setting_GenGroupItem_Data* item_to_update = NULL;
+ 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
+ // string update
+ elm_object_item_data_set(item_to_update->item, item_to_update);
+ elm_genlist_item_update(item_to_update->item);
+
+ // TODO: need to update child elements
+ // item_to_update->childs ---> expanded list
+
+ // debug log
+ // there should have 4 sub items.
+ //-----------------------------------------------------
+ // has it already freed by someone?
+ //-----------------------------------------------------
+ if (item_to_update->childs)
+ {
+ int howmany2 =0;
+ Eina_List *li = item_to_update->childs;
+ while(li)
+ {
+ Setting_GenGroupItem_Data* node = eina_list_data_get(li);
+ howmany2 += 1;
+ li = eina_list_next(li);
+ }
+ SETTING_TRACE(" expandlist -- how many items are there? : %d ", howmany2);
+ }
+
+ if (item_to_update->childs)
+ {
+ Eina_List *li = item_to_update->childs;
+ int radio_index = 0;
+ while(li)
+ {
+ Setting_GenGroupItem_Data* node = eina_list_data_get(li);
+
+ if (node->item && node->keyStr)
+ {
+ // do something more
+ // SETTING_TRACE(">>> RADIO LIST STRING VALUE = %s ", node->keyStr);
+ // set position of radio button
+ if (strcmp(node->keyStr, value) == 0) // << CRAAH !!!!
+ {
+ elm_radio_value_set(node->rgd, radio_index);
+ }
+ } else {
+ SETTING_TRACE(">>> node has unproper values - Setting_GenGroupItem_Data");
+ }
+ elm_object_item_data_set(item_to_update->item, item_to_update);
+ elm_genlist_item_update(item_to_update->item);
+
+ // go next
+ li = eina_list_next(li);
+ radio_index++;
+ }
+
+ }
+ } else {
+ SETTING_TRACE("item_to_update is NULL");
+ }
+
+
+ #endif
+ }
+ *is_end = true;
+ }
+ }
+ __node_finder(context, cur_node->children, id_str, value, is_end); /* 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)
+{
+ Setting_GenGroupItem_Data* node = (Setting_GenGroupItem_Data*) data;
+ if (node->childs)
+ {
+ eina_list_free(node->childs);
+ node->childs = NULL;
+ }
+}
+
+PluginNode* setting_plugin_create()
+{
+ PluginNode *node = calloc(1, sizeof(PluginNode));
+ setting_retvm_if(!node, -1, "Create PluginNode obj failed");
+ Draw_Data *pd = calloc(1, sizeof(Draw_Data));
+
+
+ if (!pd) {
+ FREE(node);
+ }
+
+ 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);
+ xmlFreeDoc(node->pd->doc);
+ node->pd->doc = NULL;
+ SETTING_TRACE("__cfg_file_write successful");
+ }
+
+ free(node->pd);
+ node->pd = NULL;
+ }
+
+ if (node->ui_list) {
+ eina_hash_free(node->ui_list);
+ node->ui_list = NULL;
+ }
+ free(node);
+ node = NULL;
+// PLUGIN_FINI;
+ }
+}
+
+
+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;
+}
+
+
+void setting_plugin_debug(PluginNode* context)
+{
+// SETTING_TRACE("HASH TABLE -------------------------------------");
+ if (context->ui_list) {
+ 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);
+ }
+}
+
+
+/**
+ * set modifiable
+ */
+bool setting_plugin_load(PluginNode* context, const char *cfg_file)