summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Reutskiy <v.reutskiy@samsung.com>2016-11-29 16:58:04 +0200
committerVyacheslav Reutskiy <v.reutskiy@samsung.com>2016-11-29 16:58:04 +0200
commitbcd6e56ab5601ef3e9165c48e83172c988bde03d (patch)
treec06eec51953c927f2adb519a2c82c0cf1d0f658f
parentf242b21f664fcf6ca988cae426efb22b7941db5f (diff)
edje: adaptate edje_entry to work with mmap_filedevs/lorddrew/edje_edit_in_memory
-rw-r--r--src/lib/edje/edje_entry.c71
1 files changed, 29 insertions, 42 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 0d85a5b368..31031541fd 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -672,6 +672,25 @@ _sel_clear(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_U
672 } 672 }
673} 673}
674 674
675static Evas_Object *
676_entry_source_load(Edje *ed, Evas_Object *o, Evas_Object *clip, const char *group)
677{
678 Evas_Object *obj_source;
679
680 obj_source = edje_object_add(ed->base->evas);
681 if (eet_mode_get(ed->file->ef) == EET_FILE_MODE_READ)
682 edje_object_file_set(obj_source, ed->path, group);
683 else
684 edje_object_mmap_set(obj_source, ed->file->f, group);
685 evas_object_stack_below(obj_source, o);
686 evas_object_clip_set(obj_source, clip);
687 evas_object_pass_events_set(obj_source, EINA_TRUE);
688 evas_object_show(obj_source);
689
690 return obj_source;
691}
692
693
675static void 694static void
676_sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en) 695_sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en)
677{ 696{
@@ -699,8 +718,6 @@ _sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entr
699 { 718 {
700 if (!l) 719 if (!l)
701 { 720 {
702 Evas_Object *ob;
703
704 sel = calloc(1, sizeof(Sel)); 721 sel = calloc(1, sizeof(Sel));
705 if (!sel) 722 if (!sel)
706 { 723 {
@@ -710,27 +727,15 @@ _sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entr
710 en->sel = eina_list_append(en->sel, sel); 727 en->sel = eina_list_append(en->sel, sel);
711 if (en->rp->part->source) 728 if (en->rp->part->source)
712 { 729 {
713 ob = edje_object_add(ed->base->evas); 730 sel->obj_bg = _entry_source_load(ed, o, clip, en->rp->part->source);
714 edje_object_file_set(ob, ed->path, en->rp->part->source); 731 evas_object_smart_member_add(sel->obj_bg, smart);
715 evas_object_smart_member_add(ob, smart);
716 evas_object_stack_below(ob, o);
717 evas_object_clip_set(ob, clip);
718 evas_object_pass_events_set(ob, EINA_TRUE);
719 evas_object_show(ob);
720 sel->obj_bg = ob;
721 _edje_subobj_register(ed, sel->obj_bg); 732 _edje_subobj_register(ed, sel->obj_bg);
722 } 733 }
723 734
724 if (en->rp->part->source2) 735 if (en->rp->part->source2)
725 { 736 {
726 ob = edje_object_add(ed->base->evas); 737 sel->obj_fg = _entry_source_load(ed, o, clip, en->rp->part->source2);
727 edje_object_file_set(ob, ed->path, en->rp->part->source2); 738 evas_object_smart_member_add(sel->obj_fg, smart);
728 evas_object_smart_member_add(ob, smart);
729 evas_object_stack_above(ob, o);
730 evas_object_clip_set(ob, clip);
731 evas_object_pass_events_set(ob, EINA_TRUE);
732 evas_object_show(ob);
733 sel->obj_fg = ob;
734 _edje_subobj_register(ed, sel->obj_fg); 739 _edje_subobj_register(ed, sel->obj_fg);
735 } 740 }
736 } 741 }
@@ -1214,25 +1219,15 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en)
1214 an->sel = eina_list_append(an->sel, sel); 1219 an->sel = eina_list_append(an->sel, sel);
1215 if (en->rp->part->source5) 1220 if (en->rp->part->source5)
1216 { 1221 {
1217 ob = edje_object_add(ed->base->evas); 1222 sel->obj_bg = _entry_source_load(ed, o, clip, en->rp->part->source5);
1218 edje_object_file_set(ob, ed->path, en->rp->part->source5); 1223 evas_object_smart_member_add(sel->obj_bg, smart);
1219 evas_object_smart_member_add(ob, smart);
1220 evas_object_stack_below(ob, o);
1221 evas_object_clip_set(ob, clip);
1222 evas_object_pass_events_set(ob, EINA_TRUE);
1223 sel->obj_bg = ob;
1224 _edje_subobj_register(ed, sel->obj_bg); 1224 _edje_subobj_register(ed, sel->obj_bg);
1225 } 1225 }
1226 1226
1227 if (en->rp->part->source6) 1227 if (en->rp->part->source6)
1228 { 1228 {
1229 ob = edje_object_add(ed->base->evas); 1229 sel->obj_fg = _entry_source_load(ed, o, clip, en->rp->part->source6);
1230 edje_object_file_set(ob, ed->path, en->rp->part->source6); 1230 evas_object_smart_member_add(sel->obj_fg, smart);
1231 evas_object_smart_member_add(ob, smart);
1232 evas_object_stack_above(ob, o);
1233 evas_object_clip_set(ob, clip);
1234 evas_object_pass_events_set(ob, EINA_TRUE);
1235 sel->obj_fg = ob;
1236 _edje_subobj_register(ed, sel->obj_fg); 1231 _edje_subobj_register(ed, sel->obj_fg);
1237 } 1232 }
1238 1233
@@ -2903,22 +2898,14 @@ _edje_entry_real_part_init(Edje *ed, Edje_Real_Part *rp)
2903 2898
2904 if (rp->part->source3) 2899 if (rp->part->source3)
2905 { 2900 {
2906 en->cursor_bg = edje_object_add(ed->base->evas); 2901 en->cursor_bg = _entry_source_load(ed, rp->object, evas_object_clip_get(rp->object), rp->part->source3);
2907 edje_object_file_set(en->cursor_bg, ed->path, rp->part->source3);
2908 evas_object_smart_member_add(en->cursor_bg, ed->obj); 2902 evas_object_smart_member_add(en->cursor_bg, ed->obj);
2909 evas_object_stack_below(en->cursor_bg, rp->object);
2910 evas_object_clip_set(en->cursor_bg, evas_object_clip_get(rp->object));
2911 evas_object_pass_events_set(en->cursor_bg, EINA_TRUE);
2912 _edje_subobj_register(ed, en->cursor_bg); 2903 _edje_subobj_register(ed, en->cursor_bg);
2913 } 2904 }
2914 if (rp->part->source4) 2905 if (rp->part->source4)
2915 { 2906 {
2916 en->cursor_fg = edje_object_add(ed->base->evas); 2907 en->cursor_fg = _entry_source_load(ed, rp->object, evas_object_clip_get(rp->object), rp->part->source4);
2917 edje_object_file_set(en->cursor_fg, ed->path, rp->part->source4);
2918 evas_object_smart_member_add(en->cursor_fg, ed->obj); 2908 evas_object_smart_member_add(en->cursor_fg, ed->obj);
2919 evas_object_stack_above(en->cursor_fg, rp->object);
2920 evas_object_clip_set(en->cursor_fg, evas_object_clip_get(rp->object));
2921 evas_object_pass_events_set(en->cursor_fg, EINA_TRUE);
2922 _edje_subobj_register(ed, en->cursor_fg); 2909 _edje_subobj_register(ed, en->cursor_fg);
2923 } 2910 }
2924 /* A proxy to the main cursor. */ 2911 /* A proxy to the main cursor. */