summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-11-09 22:11:09 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-11-14 14:42:30 +0100
commitff09fd6dbcf04b3ba9f34b006c2b18af5b68db73 (patch)
treefc487891a6cd6833d1f59e44477f8281e497dbc0
parente53de2b36c911885fab3e59adcae849a7d6dfcb6 (diff)
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.
-rw-r--r--src/bin/clouseau_client.c76
1 files changed, 74 insertions, 2 deletions
diff --git a/src/bin/clouseau_client.c b/src/bin/clouseau_client.c
index 8eb5f10..b4d79eb 100644
--- a/src/bin/clouseau_client.c
+++ b/src/bin/clouseau_client.c
@@ -2265,11 +2265,83 @@ _obj_info_can_list_be_compacted(Efl_Dbg_Info *root_eo)
2265 return EINA_TRUE; 2265 return EINA_TRUE;
2266} 2266}
2267 2267
2268static Clouseau_Tree_Item*
2269_rec_find(Clouseau_Tree_Item *item, unsigned long long ptr)
2270{
2271 Eina_List *n;
2272 Clouseau_Tree_Item *it;
2273
2274 if (item->ptr == ptr) return item;
2275
2276 EINA_LIST_FOREACH(item->children, n, it)
2277 {
2278 Clouseau_Tree_Item *ret = _rec_find(it, ptr);
2279
2280 if (ret) return ret;
2281 }
2282
2283 return NULL;
2284}
2285
2286static void
2287_send_highlight_ptr(App_Data_St *app, unsigned long long ptr)
2288{
2289 Clouseau_Tree_Item *item;
2290 Eina_List *n;
2291
2292 if (!ptr) return;
2293
2294 EINA_LIST_FOREACH(app->td->tree, n, item)
2295 {
2296 Clouseau_Tree_Item *ret = _rec_find(item, ptr);
2297
2298 if (ret)
2299 {
2300 _send_highlight(app, ret);
2301 return;
2302 }
2303
2304 }
2305
2306 printf("Error, ptr %p cannot be found\n", (void*)ptr);
2307}
2308
2268static void 2309static void
2269_obj_info_gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED, 2310_obj_info_gl_selected(void *data EINA_UNUSED, Evas_Object *pobj EINA_UNUSED,
2270 void *event_info EINA_UNUSED) 2311 void *event_info)
2271{ 2312{
2272 /* Currently do nothing */ 2313 Efl_Dbg_Info *info = elm_object_item_data_get(event_info);
2314
2315 /* if the user clicks on a property which is a pointer, try to highlight it*/
2316 if (eina_value_type_get(&info->value) == EINA_VALUE_TYPE_UINT64)
2317 {
2318 uint64_t ptr;
2319
2320 eina_value_get(&info->value, &ptr);
2321 _send_highlight_ptr(gui->sel_app, ptr);
2322 }
2323
2324 /* if the user is clicking on a list of pointers its usefull to highlight them */
2325 if (eina_value_type_get(&info->value) == EINA_VALUE_TYPE_LIST)
2326 {
2327 Eina_Value_List list;
2328 Eina_List *n;
2329 uint64_t ptr;
2330 Efl_Dbg_Info *eo;
2331
2332 eina_value_pget(&info->value, &list);
2333
2334 EINA_LIST_FOREACH(list.list, n, eo)
2335 {
2336 if (eina_value_type_get(&(eo->value)) == EINA_VALUE_TYPE_UINT64)
2337 {
2338 uint64_t ptr;
2339
2340 eina_value_get(&eo->value, &ptr);
2341 _send_highlight_ptr(gui->sel_app, ptr);
2342 }
2343 }
2344 }
2273 return; 2345 return;
2274} 2346}
2275 2347