summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2015-08-31 16:19:01 +0300
committerDaniel Hirt <daniel.hirt@samsung.com>2015-08-31 16:19:48 +0300
commit919d9014d264ed559a04dcb93cff898c40c08aa0 (patch)
tree7717a3074ab5a95c6950bcfdae11c3ae07838280
parente137c5770a0debbbe5853cec2a6d9d22674570e8 (diff)
save fixes
-rw-r--r--src/lib/eo_preload.c50
1 files changed, 41 insertions, 9 deletions
diff --git a/src/lib/eo_preload.c b/src/lib/eo_preload.c
index 75a9e91..e04d6ae 100644
--- a/src/lib/eo_preload.c
+++ b/src/lib/eo_preload.c
@@ -15,8 +15,6 @@
15 } while(0) 15 } while(0)
16 16
17 17
18static Eina_List *tracked = NULL;
19
20typedef struct 18typedef struct
21{ 19{
22 EINA_INLIST; 20 EINA_INLIST;
@@ -418,11 +416,12 @@ _textblock_populate_items(Evas_Object *tb, Debug_Decorate *dec)
418 rects = _evas_textblock_items_get(tb); 416 rects = _evas_textblock_items_get(tb);
419 EINA_LIST_FREE(rects, d) 417 EINA_LIST_FREE(rects, d)
420 { 418 {
419 Evas *evas = evas_object_evas_get(tb);
421 Debug_Rect *r = malloc(sizeof(Debug_Rect)); 420 Debug_Rect *r = malloc(sizeof(Debug_Rect));
422 Rect_Color c = colors[color_idx]; 421 Rect_Color c = colors[color_idx];
423 CYCLE_ARR(colors, color_idx); 422 CYCLE_ARR(colors, color_idx);
424 423
425 r->obj = evas_object_rectangle_add(tb); 424 r->obj = evas_object_rectangle_add(evas);
426 r->src_data = d; 425 r->src_data = d;
427 r->dec = dec; 426 r->dec = dec;
428 evas_object_repeat_events_set(r->obj, EINA_TRUE); 427 evas_object_repeat_events_set(r->obj, EINA_TRUE);
@@ -537,24 +536,37 @@ _decorate_update(Evas_Object *obj)
537 return dec; 536 return dec;
538} 537}
539 538
540static void 539Ecore_Idler *g_idler = NULL;
541_decorate_entry(Evas_Object *obj) 540
541static Eina_Bool
542_decorate_entry(void *data)
542{ 543{
544 Evas_Object *obj = data;
545 printf("Idler\n");
543 Debug_Decorate *dec = _decorate_update(obj); 546 Debug_Decorate *dec = _decorate_update(obj);
544 Evas_Object *tb = elm_entry_textblock_get(obj); 547 Evas_Object *tb = elm_entry_textblock_get(obj);
545 _textblock_rects_populate(tb, dec); 548 _textblock_rects_populate(tb, dec);
549 g_idler = NULL;
550
551 return ECORE_CALLBACK_CANCEL;
546} 552}
547 553
548static Eina_Bool 554static Eina_Bool
549_on_entry_changed(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info) 555_on_entry_changed(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
550{ 556{
551 printf("Changed\n"); 557 printf("Changed\n");
552 _decorate_entry(obj); 558 if (g_idler)
559 {
560 ecore_idler_del(g_idler);
561 g_idler = NULL;
562 }
563 g_idler = ecore_idler_add(_decorate_entry, obj);
564
553 return EINA_TRUE; 565 return EINA_TRUE;
554} 566}
555 567
556static void 568static void
557_decors_free(void) 569_decors_free_all(void)
558{ 570{
559 Debug_Decorate *dec; 571 Debug_Decorate *dec;
560 EINA_INLIST_FREE(g_decor, dec) 572 EINA_INLIST_FREE(g_decor, dec)
@@ -567,6 +579,26 @@ _decors_free(void)
567 } 579 }
568} 580}
569 581
582static void
583_decors_free(Evas_Object *obj)
584{
585 Debug_Decorate *dec;
586 EINA_INLIST_FOREACH(g_decor, dec)
587 {
588 if (dec->obj == obj)
589 break;
590 }
591 if (dec)
592 {
593 _clear_rects(dec, EINA_FALSE);
594 g_decor = (Debug_Decorate *) eina_inlist_remove(
595 EINA_INLIST_GET(g_decor),
596 EINA_INLIST_GET(dec));
597 free(dec);
598 printf("Freed decor for obj %p\n", obj);
599 }
600}
601
570static Debug_Decorate * 602static Debug_Decorate *
571_decorate_create(Evas_Object *obj) 603_decorate_create(Evas_Object *obj)
572{ 604{
@@ -584,7 +616,7 @@ _decorate_create(Evas_Object *obj)
584static Eina_Bool 616static Eina_Bool
585_on_obj_del(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info) 617_on_obj_del(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
586{ 618{
587 tracked = eina_list_remove(tracked, obj); 619 _decors_free(obj);
588 return EINA_TRUE; 620 return EINA_TRUE;
589} 621}
590 622
@@ -631,6 +663,6 @@ elm_run()
631 f(); 663 f();
632 664
633 /* Cleanup */ 665 /* Cleanup */
634 _decors_free(); 666 _decors_free_all();
635 667
636} 668}