Compare commits

...

2 Commits

Author SHA1 Message Date
Marcel Hollerbach bbf9c0bf16 clouseau_client: do not compact items which are bigger than 10 items
otherwise things are getting really unreadable
2016-11-14 14:44:12 +01:00
Marcel Hollerbach ff09fd6dbc closeau: highlight objects in the detail view
if there is a pointer in the detailview, and the pointer is clicked,
highlight the object which is pointed to by that pointer.

You can test this patch by downloading
https://devs.enlightenment.org/~bu5hm4n/elm_focus_test
and opening the file in clouseau's offline mode. The elements with
can_focus=1 are having a focus section in the property view, if you
click on those, and the screenshot is open, you will see a highlight.
2016-11-14 14:42:30 +01:00
1 changed files with 79 additions and 2 deletions

View File

@ -2257,19 +2257,96 @@ _obj_info_can_list_be_compacted(Efl_Dbg_Info *root_eo)
eina_value_pget(&(root_eo->value), &list);
// We check that there is no list into this list. If such list exists,
// we can't compact the list.
int number = 0;
EINA_LIST_FOREACH(list.list, l, eo)
{
number ++;
if (eina_value_type_get(&(eo->value)) == EINA_VALUE_TYPE_LIST)
return EINA_FALSE;
//this is very unreadable
if (number > 10)
return EINA_FALSE;
}
return EINA_TRUE;
}
static Clouseau_Tree_Item*
_rec_find(Clouseau_Tree_Item *item, unsigned long long ptr)
{
Eina_List *n;
Clouseau_Tree_Item *it;
if (item->ptr == ptr) return item;
EINA_LIST_FOREACH(item->children, n, it)
{
Clouseau_Tree_Item *ret = _rec_find(it, ptr);
if (ret) return ret;
}
return NULL;
}
static void
_send_highlight_ptr(App_Data_St *app, unsigned long long ptr)
{
Clouseau_Tree_Item *item;
Eina_List *n;
if (!ptr) return;
EINA_LIST_FOREACH(app->td->tree, n, item)
{
Clouseau_Tree_Item *ret = _rec_find(item, ptr);
if (ret)
{
_send_highlight(app, ret);
return;
}
}
printf("Error, ptr %p cannot be found\n", (void*)ptr);
}
static void
_obj_info_gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
void *event_info EINA_UNUSED)
void *event_info)
{
/* Currently do nothing */
Efl_Dbg_Info *info = elm_object_item_data_get(event_info);
/* if the user clicks on a property which is a pointer, try to highlight it*/
if (eina_value_type_get(&info->value) == EINA_VALUE_TYPE_UINT64)
{
uint64_t ptr;
eina_value_get(&info->value, &ptr);
_send_highlight_ptr(gui->sel_app, ptr);
}
/* if the user is clicking on a list of pointers its usefull to highlight them */
if (eina_value_type_get(&info->value) == EINA_VALUE_TYPE_LIST)
{
Eina_Value_List list;
Eina_List *n;
uint64_t ptr;
Efl_Dbg_Info *eo;
eina_value_pget(&info->value, &list);
EINA_LIST_FOREACH(list.list, n, eo)
{
if (eina_value_type_get(&(eo->value)) == EINA_VALUE_TYPE_UINT64)
{
uint64_t ptr;
eina_value_get(&eo->value, &ptr);
_send_highlight_ptr(gui->sel_app, ptr);
}
}
}
return;
}