return VC_ELM_ERROR_OPERATION_FAILED;
}
memcpy(*command, command_name, len);
+
+ VC_ELM_LOG_INFO("[SUCCESS] get action command, action(%s), command(%s)", action, *command);
return VC_ELM_ERROR_NONE;
}
handler->data = (void *)object;
g_handlers_list = eina_list_append(g_handlers_list, handler);
*vc_elm = (vc_elm_h)handler;
+
+ VC_ELM_LOG_INFO("[SUCCESS] create object(%s)", _get_ui_object_name(object));
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_NONE;
}
handler->data = (void *)item;
g_handlers_list = eina_list_append(g_handlers_list, handler);
*vc_elm = (vc_elm_h)handler;
+
+ VC_ELM_LOG_INFO("[SUCCESS] create item object)");
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_NONE;
}
g_handlers_list = eina_list_remove_list(g_handlers_list, list);
free(handler);
handler = NULL;
+
+ VC_ELM_LOG_INFO("[SUCCESS] destroy");
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_NONE;
}
Elm_Object_Item *it = (Elm_Object_Item *)handler->data;
return _vc_elm_set_item_object_command(it, command);
}
+
+ VC_ELM_LOG_INFO("[SUCCESS] set command(%s)", command);
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_INVALID_PARAMETER;
}
Elm_Object_Item *it = (Elm_Object_Item *)handler->data;
return _vc_elm_unset_item_object_command(it);
}
+
+ VC_ELM_LOG_INFO("[SUCCESS] unset command");
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_INVALID_PARAMETER;
}
Elm_Object_Item *it = (Elm_Object_Item *)handler->data;
return _vc_elm_set_item_object_hint(it, hint);
}
+
+ VC_ELM_LOG_INFO("[SUCCESS] set hint(%s)", hint);
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_INVALID_PARAMETER;
}
Elm_Object_Item *it = (Elm_Object_Item *)handler->data;
return _vc_elm_unset_item_object_hint(it);
}
+
+ VC_ELM_LOG_INFO("[SUCCESS] unset hint");
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_INVALID_PARAMETER;
}
Evas_Object *parent = elm_object_item_widget_get(it);
return _vc_elm_set_sub_item_hint_direction(parent, direction);
}
+
+ VC_ELM_LOG_INFO("[SUCCESS] set hint direction(%d)", direction);
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_INVALID_PARAMETER;
}
Evas_Object *parent = elm_object_item_widget_get(it);
return _vc_elm_get_sub_item_hint_direction(parent, direction);
}
+
+ VC_ELM_LOG_INFO("[SUCCESS] get hint direction(%d)", *direction);
return VC_ELM_ERROR_INVALID_PARAMETER;
}
Elm_Object_Item *it = (Elm_Object_Item *)handler->data;
return _vc_elm_set_item_object_custom_hint(it, NULL, pos_x, pos_y);
}
+
+ VC_ELM_LOG_INFO("[SUCCESS] set hint offset, x(%d), y(%d)", pos_x, pos_y);
_vc_elm_core_set_view_changed();
return VC_ELM_ERROR_INVALID_PARAMETER;
}
return EINA_FALSE;
}
- VC_ELM_LOG_DBG("command(%s)", temp);
+ VC_ELM_LOG_DBG("found evas_object(%p), command(%s)", found->obj, temp);
const char* action = NULL;
if (strlen(cmd) > strlen(temp)) {
action = &cmd[strlen(temp) + 1];
VC_ELM_LOG_DBG("action(%s)", &cmd[strlen(temp) + 1]);
}
found->cmd = temp;
- VC_ELM_LOG_DBG("unwrapping %s %s for %s", param1, param2, _get_ui_object_name(found->obj));
+ VC_ELM_LOG_DBG("unwrapping %s %s for %s(%s)", param1, param2, _get_ui_object_name(found->obj), evas_object_type_get(found->obj));
found->unwrap_callback(found, action, param2);
return EINA_TRUE;
*/
/*static Eina_Bool _delayed_window_load(void *data);*/
+void _vc_elm_core_init_cmd_hash()
+{
+ if (!item_hint_map)
+ item_hint_map = eina_hash_pointer_new(__hash_entry_free_cb);
+ if (!item_command_map)
+ item_command_map = eina_hash_pointer_new(__hash_entry_free_cb);
+ if (!item_custom_map)
+ item_custom_map = eina_hash_pointer_new(__hash_entry_free_cb);
+ if (!command_item_map)
+ command_item_map = eina_hash_string_superfast_new(__hash_entry_free_cb);
+
+ VC_ELM_LOG_DBG("############## COMMAND HASH INIT ##############");
+}
+
+
+
+void _vc_elm_core_deinit_cmd_hash()
+{
+ if (item_hint_map && 0 != eina_hash_population(item_hint_map)) {
+ VC_ELM_LOG_DBG("item_hint_map HASH FREE");
+ eina_hash_free_cb_set(item_hint_map, __hash_entry_dummy_cb);
+ eina_hash_free(item_hint_map);
+ item_hint_map = NULL;
+ }
+ if (item_command_map && 0 != eina_hash_population(item_command_map)) {
+ VC_ELM_LOG_DBG("item_command_map HASH FREE");
+ eina_hash_free_cb_set(item_command_map, __hash_entry_dummy_cb);
+ eina_hash_free(item_command_map);
+ item_command_map = NULL;
+ }
+ if (item_custom_map && 0 != eina_hash_population(item_custom_map)) {
+ VC_ELM_LOG_DBG("item_custom_map HASH FREE");
+ eina_hash_free_cb_set(item_custom_map, __hash_entry_dummy_cb);
+ eina_hash_free(item_custom_map);
+ item_custom_map = NULL;
+ }
+ if (command_item_map && 0 != eina_hash_population(command_item_map)) {
+ VC_ELM_LOG_DBG("eina_hash_free HASH FREE");
+ eina_hash_free_cb_set(command_item_map, __hash_entry_dummy_cb);
+ eina_hash_free(command_item_map);
+ command_item_map = NULL;
+ }
+ VC_ELM_LOG_DBG("############## COMMAND HASH DEINIT ##############");
+}
+
void _vc_elm_core_init()
{
int ret;
// bindtextdomain("voice-control-elm", "/usr/share/locale/");
g_widget_info_hash = eina_hash_string_djb2_new(__widget_info_free_cb);
- item_hint_map = eina_hash_pointer_new(__hash_entry_free_cb);
- item_command_map = eina_hash_pointer_new(__hash_entry_free_cb);
- item_custom_map = eina_hash_pointer_new(__hash_entry_free_cb);
- command_item_map = eina_hash_string_superfast_new(__hash_entry_free_cb);
registered_item_map = eina_hash_string_superfast_new(__hash_entry_free_cb);
g_config_action_map = eina_hash_string_superfast_new(__hash_entry_stringshare_free_cb);
g_config_widget_map = eina_hash_string_superfast_new(__hash_entry_eina_list_free_cb);
+ _vc_elm_core_init_cmd_hash();
if (NULL == g_allowed_text_part_list) {
g_allowed_text_part_list = eina_list_append(g_allowed_text_part_list, strdup("elm.text"));
if (item_hint != NULL)
evas_object_data_set(obj, VC_ELM_HINT_DATA_KEY, item_hint);
evas_object_data_set(obj, VC_ELM_CMD_DATA_KEY, item_command);
+ VC_ELM_LOG_DBG("set CMD_DATA_KEY : object_item(%p), item_command(%s)", (void*)item, item_command);
}
item_custom_date = eina_hash_find(item_custom_map, &item);
{
Eina_Bool visible = evas_object_visible_get(widget);
- VC_ELM_LOG_DBG("IS visible %s %d", _get_ui_object_name(widget), visible);
+ VC_ELM_LOG_DBG("IS visible (%p)(%s)(%s), visible(%d)", widget, _get_ui_object_name(widget), evas_object_type_get(widget), visible);
if (visible) {
Eina_List *list = NULL;
const Eina_List *constant_list = NULL;
cb(widget, data);
if (NULL != (info = eina_hash_find(g_widget_info_hash, obj_name)) && obj_name != NULL && NULL != info->get_subobjects_func) {
+ VC_ELM_LOG_DBG("call subobjects_func, constant_list(%d)", eina_list_count(list));
constant_list = info->get_subobjects_func(widget, info->user_data);
} else if (obj_name != NULL && (!strcmp("Elm_Button", obj_name) || !strcmp("Elm_Index", obj_name))) {
/* We dont want to have a tooltip for elm_icon on button */
constant_list = elm_widget_can_focus_child_list_get(widget);
}
+ VC_ELM_LOG_DBG("list (%d) constant_list(%d)", eina_list_count(list), eina_list_count(constant_list));
if (list)
constant_list = list;
EINA_LIST_FOREACH(constant_list, l, obj) {
const char *current_name = _get_ui_object_name(obj);
- VC_ELM_LOG_DBG("calling %p %s", (void*)obj, current_name);
+ VC_ELM_LOG_DBG("calling evas_object(%p)[%s], focused(%d)", (void*)obj, current_name, elm_object_focus_get(obj));
- if ((current_name != NULL) && ((0 == strcmp(current_name, "Elm_Inwin")) || (0 == strcmp(current_name, "Elm_Popup")) || ((0 == strcmp(current_name, "Elm_Ctxpopup") && (evas_object_visible_get(obj)))))) {
- /*overlaying widget found, remove other widgets found,
- traverse it's subtree and return*/
+ if ((current_name != NULL) && ((0 == strcmp(current_name, "Elm_Inwin"))
+ || (((0 == strcmp(current_name, "Elm_Popup")) || (0 == strcmp(current_name, "Elm_Ctxpopup")))
+ && (evas_object_visible_get(obj)) && (EINA_TRUE == elm_object_focus_get(obj))))) {
+ /*overlaying widget found, remove other widgets found, traverse it's subtree and return*/
VC_ELM_LOG_INFO("overlaying widget: found");
if (data && (*data)) {
__elm_widget_foreach_in_tree(obj, cb, data);
- VC_ELM_LOG_INFO("overlaying widget: subtree finished");
+ VC_ELM_LOG_INFO("overlaying widget: subtree finished, list(%d)", (data && (*data)) ? eina_list_count(*data) : 0);
return;
} else {
/*continue traversing other subtrees*/
Evas_Coord w_p;
Evas_Coord h_p;
+ VC_ELM_LOG_DBG("show_tooltips");
+
+ _vc_elm_core_deinit_cmd_hash();
+ _vc_elm_core_init_cmd_hash();
+
__idle_enter(NULL);
VC_ELM_LOG_DBG("show_tooltips");
obj_name = eina_stringshare_add(obj_name);
- VC_ELM_LOG_DBG("obj(%p), command %s", (void*)obj, evas_object_data_get(obj, VC_ELM_CMD_DATA_KEY));
+ VC_ELM_LOG_DBG("evas_obj(%p), command %s", (void*)obj, evas_object_data_get(obj, VC_ELM_CMD_DATA_KEY));
if (obj_name)
VC_ELM_LOG_DBG("Adding command for %s", obj_name);
if ((!obj_name && evas_object_data_get(obj, "special_item")) || (obj_name && (!strcmp(obj_name, "Elm_Layout") && evas_object_data_get(obj, "special_item"))))
unwr->wrap = wrapper;
unwr->action = (action) ? strdup(action) : NULL;
unwr->param = (param) ? strdup(param) : NULL;
- VC_ELM_LOG_DBG("__unwrap_universal_item_command with params: %p %p %s %s", (void *)wrapper->obj, (void *)item, action, param);
+ VC_ELM_LOG_DBG("__unwrap_universal_item_command with params: %p %p %s %s, wrapper(%s)", (void *)wrapper->obj, (void *)item, action, param, wrapper->cmd);
if (NULL != item) {
parent = elm_object_parent_widget_get(_vc_elm_core_get_evas_object(item));
+ VC_ELM_LOG_DBG("Parent evas_object(%s)(%s)", _get_ui_object_name(parent), evas_object_type_get(parent));
while (NULL != parent) {
if (0 == strcmp(_get_ui_object_name(parent), "Elm_Genlist")) {
evas_object_geometry_get(_vc_elm_core_get_evas_object(item), &x, &y, &w, &h);
cdata = (struct Custom_Data *)eina_hash_find(item_custom_map, &obj_item);
free(cdata);
+ VC_ELM_LOG_DBG("object_item(%p) has been deleted, command(%s)", obj_item, command);
+
eina_hash_del(item_hint_map, &obj_item, NULL);
eina_hash_del(item_command_map, &obj_item, NULL);
eina_hash_del(item_custom_map, &obj_item, NULL);
evas_object_data_set(obj, VC_ELM_CMD_DATA_KEY, command);
if (NULL == eina_list_data_find(ui_objects_list, obj))
ui_objects_list = eina_list_append(ui_objects_list, obj);
- VC_ELM_LOG_DBG("added new item %d %p", eina_list_count(ui_objects_list), (void*)obj);
+ VC_ELM_LOG_DBG("added new object, num(%d), evas_object(%p)", eina_list_count(ui_objects_list), (void*)obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, __object_del_callback, command);
return EINA_TRUE;
}
char *temp = NULL;
temp = evas_object_data_get(obj, VC_ELM_CMD_DATA_KEY);
if (NULL != temp) {
- VC_ELM_LOG_DBG("obj(%p) already has command(%s)", (void*)obj, temp);
+ VC_ELM_LOG_DBG("evas_obj(%p) already has command(%s)", (void*)obj, temp);
return EINA_FALSE;
}
const char *command = eina_stringshare_add(_command);
if (NULL == command)
return EINA_FALSE;
- VC_ELM_LOG_DBG("Add item object(%p) command(%s)", (void*)obj, _command);
+ VC_ELM_LOG_DBG("Add object_item(%p) command(%s)", (void*)obj, _command);
eina_hash_add(item_command_map, &obj, command);
eina_hash_add(command_item_map, command, obj);
elm_object_item_del_cb_set(obj, __item__object_del_callback);
char *temp = NULL;
temp = eina_hash_find(item_command_map, &obj);
if (NULL != temp && NULL != _command && !strncmp(temp, _command, strlen(temp))) {
- VC_ELM_LOG_DBG("obj item(%p) already has command(%s)", (void*)obj, temp);
+ VC_ELM_LOG_DBG("object_item(%p) already has command(%s)", (void*)obj, temp);
return EINA_FALSE;
}