static void* settings_func(void *data, xmlNode *xmlObj)
{
+ SETTING_TRACE_BEGIN;
+ retv_if(!data || !xmlObj, NULL);
+ PluginNode* node = (PluginNode*)data;
+
+ int count = 0;
+ count = node->nitems;
+
+ if (count == 1) // if there's <settings> only
+ {
+ SETTING_TRACE("there's only <settings>");
+ setting_func(data, xmlObj);
+ }
return NULL;
}
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
- // [DATA] title, btn[0], btn[1]
+ // [DATA] title
const char *title = (char*)xmlGetProp(xmlObj, "title");
- char *btn[2] = {/* 0 */"OK", /* 1 */"NO"};
-
+ if (!title)
+ title = "NONAME";
SETTING_TRACE("before setting_create_layout_navi_bar_genlist");
// [UI] with DATA
return list_item;
}
+static int __node_walk_check(PluginNode* context, xmlNode* cur, int* pcount)
+{
+ //SETTING_TRACE_BEGIN;
+ Draw_Data *pd = context->pd;
+ retv_if(!pd, -1);
+ retv_if(!context->ui_list, -1);
+ 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 : %s id= %s", cur_node->name,xmlGetProp(cur_node, "id"));
+ *pcount += 1;
+ }
+ __node_walk_check(context, cur_node->children, pcount); /* RECURSIVE */
+ }
+ return 0;
+}
static int __node_walker(PluginNode* context, xmlNode* cur)
{
setting_retvm_if(!pd, -1, "Create Draw_Data obj failed");
plugin->ug = NULL;
+ plugin->ly_main = NULL;
plugin->pd = pd;
plugin->navi_bar = navi;
plugin->win_main = win;
return -1;
}
- // TODO: error handler here
+ int count = 0;
+ __node_walk_check(node, node->pd->root, &count);
+ SETTING_TRACE(" node count : %d ", count);
+ node->nitems = count;
__node_walker(node, node->pd->root);
// debug message
SETTING_TRACE(" >>> plugin_load OK");
}
ad->ly_main = plugin_node->ly_main;
+ if(!ad->ly_main)
+ {
+ SETTING_TRACE(" ad->ly_main is NULL !!!! go to error handle");
+ goto errorhandle;
+ }
ad->plugin_node = plugin_node; // the selected plugin name
#endif
setting_view_plugin_main.is_create = 1;
return SETTING_RETURN_SUCCESS;
errorhandle:
+ //setting_plugin_main_destroy(ad);
// resource free
return SETTING_RETURN_FAIL;
}