*/
Eina_List *_g_drawer_list = NULL;
+#if 0
/**
* @return Evas_Object * obj
*/
static void* navigationbar_func(void *data, xmlNode *xmlObj);
-
+#endif
/*
* @return void
_g_drawer_list = eina_list_append(_g_drawer_list, node);
}
+
+ FREE(node);
}
static drawer_fp __drawer_find(char* type)
{
SETTING_TRACE_BEGIN;
+ SETTING_TRACE("node type:%s", type);
Eina_List *check_list = _g_drawer_list;
Object_Drawer *list_item = NULL;
while (check_list) {
-
- list_item = NULL;
list_item = (Object_Drawer *) eina_list_data_get(check_list);
if (NULL == list_item)
continue;
//SETTING_TRACE("list_item->type:%s", list_item->type);
break;
}
-
+ //if not matched,to check next node.
check_list = eina_list_next(check_list);
+ list_item = NULL;
}
//SETTING_TRACE("list_item:%p", list_item);
return list_item ? list_item->draw : NULL;
#define MAX_LOCAL_BUFSIZE 128
#define DBUS_PATH "/setting/dbus_handler"
#define DBUS_SIGNAL_INTERFACE "org.tizen.setting.signal"
-#define DBUS_SIGNAL "test"
+#define APPID_LENGTH 10
+#define APPID_POS_FROM_PATH 10
+
+static char* s_pkg_name;
+
+#if 0
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 strndup(str + begin, len);
}
+#endif
+
+/**
+ * package ID
+ *
+ * ncbyusjryr.AppSetting --> package ID is ncbyusjryr
+ * "Update_" "ncbyusjryr"
+ */
+static char* get_app_string(char* path)
+{
+ SETTING_TRACE_BEGIN;
+ char* temp = substring(path, APPID_POS_FROM_PATH, APPID_LENGTH/*string size*/);
+ SETTING_TRACE("package ID : >>> %s ",temp );
+ return temp;
+}
//------------------------------------------------------
// for client - bus
setting_main_appdata *ad = user_data;
- if (dbus_message_is_signal(message, DBUS_SIGNAL_INTERFACE, DBUS_SIGNAL))
+ char* pkg_name = get_app_string(ad->plugin_path);
+
+ char str_buf[MAX_COMMON_BUFFER_LEN];
+ snprintf(str_buf, MAX_COMMON_BUFFER_LEN, "Update_%s", pkg_name);
+ s_pkg_name = strdup(str_buf);
+
+ if (pkg_name)
+ {
+ free(pkg_name);
+ pkg_name = NULL;
+ }
+
+ if (s_pkg_name == NULL)
+ {
+ SETTING_TRACE("s_pkg_name is NULL - it's abnormal operation");
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+ SETTING_TRACE("s_pkg_name : %s ", s_pkg_name);
+ if (dbus_message_is_signal(message, DBUS_SIGNAL_INTERFACE, s_pkg_name))
{
if (dbus_message_get_args(message, &error,
DBUS_TYPE_UINT32, &sender_pid,
// received key : checkbox1|N/A , value : INT|1
//-------------------------------------------------------------
//char* key = "checkbox1|N/A";
- char* ptr = strchr(key, '|');
+ char* ptr = NULL;
+
+ if (key) {
+ ptr = strchr(key, '|');
+ }
xmlDocPtr doc = NULL;
if (ptr && key)
static int __send_msg(char* key, char* value)
{
DBusMessage* message;
+
int sender_pid = getpid();
if (bus == NULL)
return -1;
- message = dbus_message_new_signal(DBUS_PATH, DBUS_SIGNAL_INTERFACE, DBUS_SIGNAL);
+ if (s_pkg_name == NULL)
+ {
+ SETTING_TRACE("s_pkg_name is NULL - it's abnormal operation");
+ return -1;
+ }
+
+ message = dbus_message_new_signal(DBUS_PATH, DBUS_SIGNAL_INTERFACE, s_pkg_name);
SETTING_TRACE("Sending message[%s:%s] via dbus", key ,value);
if (dbus_message_append_args(message,
char rule[MAX_LOCAL_BUFSIZE + 1] = {0, };
dbus_error_init(&error);
- dbus_connection_remove_filter(bus, __signal_filter, NULL);
+ //dbus_connection_remove_filter(bus, __signal_filter, NULL);
snprintf(rule, MAX_LOCAL_BUFSIZE, "path='%s',type='signal',interface='%s'", DBUS_PATH, DBUS_SIGNAL_INTERFACE);
dbus_bus_remove_match(bus, rule, &error);
pd->navi_bar = NULL;
pd->cfg_file = NULL;
+
+
+
pd->root = NULL;
}
static void* group_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
static void* __link_list_cb(void *data, Evas_Object *obj, void *event_info)
{
SETTING_TRACE_BEGIN;
- ret_if(data == NULL);
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
+ retv_if(data == NULL, NULL);
+ retvm_if(event_info == NULL, NULL, "Invalid argument: event info is NULL");
Elm_Object_Item *item = (Elm_Object_Item *) event_info;
elm_genlist_item_selected_set(item, 0);
Setting_GenGroupItem_Data *list_item =
(Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
xmlNode* xmlObj = data;
- ret_if(!xmlObj);
+ retv_if(!xmlObj, NULL);
const char *link_file = (char*)xmlGetProp(xmlObj, "value");
if(!link_file)
{
SETTING_TRACE_ERROR("Invalidate liked file");
- return;
+ return NULL;
}
char file[1024] = {0,};
snprintf(file, sizeof(file), "%s/%s", PLUGIN_CFG_DIR, link_file);
static void* __launch_list_cb(void *data, Evas_Object *obj, void *event_info)
{
SETTING_TRACE_BEGIN;
- ret_if(data == NULL);
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
+ retv_if(data == NULL, NULL);
+ retvm_if(event_info == NULL, NULL, "Invalid argument: event info is NULL");
Elm_Object_Item *item = (Elm_Object_Item *) event_info;
elm_genlist_item_selected_set(item, 0);
Setting_GenGroupItem_Data *list_item =
(Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
xmlNode* xmlObj = data;
- ret_if(!xmlObj);
+ retv_if(!xmlObj, NULL);
const char *key_str = (char*)xmlGetProp(xmlObj, "id");
const char *title_str = (char*)xmlGetProp(xmlObj, "title");
const char *appid_str = (char*)xmlGetProp(xmlObj, "appid");
static void* label_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
static void* link_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
static void* launch_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
static void* slider_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
return (void*)list_item;
};
+#if 0
/*
elm_object_item_data_set(item_to_update->item, item_to_update);
elm_genlist_item_update(item_to_update->item);
#endif
return NULL;
};
-
+#endif
static void __check_mouse_up_cb(void *data, Evas_Object *obj,
void *event_info)
static void* checkbox_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
Setting_GenGroupItem_Data *list_item = data;
xmlNode* xmlObj = list_item->userdata;
- ret_if(!xmlObj);
+ if(!xmlObj) {
+ FREE(entry_str_utf8);
+ return;
+ }
+
xmlAttrPtr newattr;
const char *title = (char*)xmlSetProp(xmlObj, "value",entry_str_utf8);
static void* editbox_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
const char *title = (char*)xmlGetProp(xmlObj, "title");
const char *key_str= (char*)xmlGetProp(xmlObj, "value");
- // TODO: minlength
- // TODO: maxlength
- Setting_GenGroupItem_Data *list_item =
- setting_create_Gendial_field_def(pd->scroller, &(itc_1icon),
- __editbox_list_cb,
- pd, SWALLOW_Type_LAYOUT_ENTRY,
- NULL, NULL, 0, title, key_str,
- __editbox_changed_cb);
+ const char *minlength= (char*)xmlGetProp(xmlObj, "minlength");
+ const char *maxlength= (char*)xmlGetProp(xmlObj, "maxlength");
+
+ int max_len = -1;
+ if (maxlength)
+ {
+ max_len = atoi(maxlength);
+ SETTING_TRACE(" >> MAXLENGTH FILTER IS AVAILABLE !!!! maxlength = %d", max_len);
+ }
+
+ Setting_GenGroupItem_Data *list_item = NULL;
+
+ if (max_len == -1)
+ {
+ // without maxlength filter
+ list_item = setting_create_Gendial_field_def(pd->scroller, &(itc_1icon),
+ __editbox_list_cb,
+ pd, SWALLOW_Type_LAYOUT_ENTRY,
+ NULL, NULL, 0, title, key_str,
+ __editbox_changed_cb);
+
+ } else {
+ // add max length filter
+ list_item = setting_create_Gendial_field_entry(
+ pd->scroller,
+ &(itc_1icon),
+ __editbox_list_cb,
+ pd,
+ SWALLOW_Type_LAYOUT_ENTRY,
+ NULL, NULL, 0, title, key_str, __editbox_changed_cb,
+ ELM_INPUT_PANEL_LAYOUT_NORMAL,
+ false,
+ false,
+ max_len,
+ 0,
+ NULL, NULL);
+
+ }
if (list_item) {
list_item->userdata = xmlObj;
list_item->stop_change_cb = __entry_unfocus_cb;
//char *value = (char*)xmlGetProp(xmlObj, "string");
char *value = (char*)xmlGetProp(xmlObj, "value");
SETTING_TRACE(">>> value = %s", value);
- int i=0;
Evas_Object *rgd = NULL;
if (xmlObj->children && !data_parentItem->rgd) {//to protect from entering repeatly
rgd = elm_radio_add(scroller);
elm_radio_value_set(rgd, -1);
- int i;
char *type;
char *subitem_title = NULL;
int subitem_index = 0;
} else {
SETTING_TRACE("invalid type[:%s]", type);
}
-
- i++;
}
cur = cur->next;
}
return NULL;
}
+
+static Evas_Object *setting_create_win_layout2(Evas_Object *win_layout, Evas_Object *win_obj)
+{
+
+ Evas_Object *layout = NULL;
+ //Evas_Object *conform = elm_conformant_add(win_obj);
+ //setting_main_appdata *ad = (setting_main_appdata *) data;
+
+ /* Base Layout */
+ layout = elm_layout_add(win_obj);
+ //evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ setting_retvm_if(layout == NULL, FALSE, "layout == NULL");
+
+ elm_layout_theme_set(layout, "layout", "application", "default");
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ //elm_win_resize_object_add(win_obj, conform);
+ //elm_object_content_set(conform, layout);
+
+ Evas_Object *bg = setting_create_bg(layout, win_obj, "group_list");
+ elm_object_part_content_set(layout, "elm.swallow.bg", bg);
+ evas_object_show(layout);
+ //evas_object_show(conform);
+
+ //ad->conformant = conform;
+ return layout;
+}
+
+
+Evas_Object *setting_create_layout_navi_bar2(Evas_Object *win_layout, Evas_Object *win_obj, char *title_str, char *lbutton_str, char *rbutton_str, char *mbutton_str, setting_call_back_func lbutton_click_cb, setting_call_back_func rbutton_click_cb, setting_call_back_func mbutton_click_cb, void *cb_data, Evas_Object *eo_view, /*any container obj constructed on any evas obj */
+ Evas_Object **navi_bar,
+ Evas_Object **titleobj)
+{
+
+ Evas_Object *layout = setting_create_win_layout2(win_layout, win_obj);
+ *navi_bar = setting_create_navi_bar(layout);
+
+ setting_create_navi_bar_buttons(title_str,
+ lbutton_str, rbutton_str, mbutton_str,
+ lbutton_click_cb, rbutton_click_cb,
+ mbutton_click_cb, cb_data, eo_view /*content */ ,
+ *navi_bar, NULL);
+ return layout;
+}
+
// <setting>
static void* setting_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
-#if 1/*{{{*/
- //Draw_Data *pd = node->pd;
+#if 1
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
- //----------------------------------------------------------------
// [DATA] title, btn[0], btn[1]
const char *title = (char*)xmlGetProp(xmlObj, "title");
char *btn[2] = {/* 0 */"OK", /* 1 */"NO"};
- // find child nodes named 'elements'
- #if 0
- if (xmlObj->children) {
- xmlNode* cur = xmlObj->children;
- int i =0;
- while (cur != NULL)
- {
- if (!xmlStrcmp(cur->name, (const xmlChar*)"button")) {
- btn[i] = xmlGetProp(cur, "title");
- SETTING_TRACE("------>>> node type : Element, name=%s id=%s / btn[%d] = %s ",
- cur->name,xmlGetProp(cur, "id"),
- i,
- btn[i]);
- i++;
- }
- cur = cur->next;
- }
- }
- #endif
- //----------------------------------------------------------------
SETTING_TRACE("before setting_create_layout_navi_bar_genlist");
+
// [UI] with DATA
- pd->ly_main = setting_create_layout_navi_bar_genlist(pd->win_get,
- pd->win_get,
- _(title),
- _(btn[1]), _(btn[0]),
- ___click_softkey_back_cb,
- ___click_softkey_back_cb, data, &pd->scroller,
- &(pd->navi_bar));
+ pd->scroller = elm_genlist_add(pd->win_get);
+ retvm_if(pd->scroller == NULL, NULL,
+ "Cannot set scroller object as contento of layout");
+ elm_object_style_set(pd->scroller, "dialogue");
+ elm_genlist_clear(pd->scroller); /* first to clear list */
+
+
+ SETTING_TRACE("_(title):%s", _(title));
+ pd->ly_main = setting_create_layout_navi_bar2(pd->win_get, pd->win_get,
+ _(title),
+ _("IDS_COM_BODY_BACK"), NULL, NULL,
+ ___click_softkey_back_cb,
+ NULL, NULL,
+ data, pd->scroller,
+ &(pd->navi_bar), NULL);
SETTING_TRACE("after setting_create_layout_navi_bar_genlist");
-#endif/*}}}*/
+#endif
return NULL;
}
static void* expandlist_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
- ret_if(!data || !xmlObj);
+ retv_if(!data || !xmlObj, NULL);
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
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"));
-
+ // SETTING_TRACE("node type : %s id= %s", cur_node->name,xmlGetProp(cur_node, "id"));
drawer_fp fp = __drawer_find(cur_node->name);
if (fp)
{
PluginNode *node = calloc(1, sizeof(PluginNode));
Draw_Data *pd = calloc(1, sizeof(Draw_Data));
+
+ if (node && !pd) {
+ free(node);
+ node = NULL;
+ }
+
setting_retvm_if(!pd, -1, "Create Draw_Data obj failed");
//eina_init();
}
+/**
+ * set modifiable
+ */
bool setting_plugin_load(PluginNode* context, const char *cfg_file)
{
SETTING_TRACE("cfg_file:%s", cfg_file)