summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-09-18 18:14:09 +0300
committerYakov Goldberg <yakov.g@samsung.com>2014-10-02 13:03:17 +0300
commitd3d7313576b79924d168b0202cd544a2e0c007bb (patch)
tree417c70b6f3f5610b9c757d8744c96f6f17d3dd35
parent4645fa2a821de5f727385531c77207bd603194e4 (diff)
Content in pros view as genlist
Conflicts: src/bin/egui_gui/egui_layout.json src/bin/egui_gui/propview.c src/lib/generator.c
-rw-r--r--data/config/func_names.json3
-rw-r--r--examples/example.egui5
-rw-r--r--src/bin/egui_gui/editor.c18
-rw-r--r--src/bin/egui_gui/egui_layout.json156
-rw-r--r--src/bin/egui_gui/itemview.c2
-rw-r--r--src/bin/egui_gui/propview.c392
-rw-r--r--src/bin/egui_gui/propview_data.h5
-rw-r--r--src/lib/gui_parser.c4
-rw-r--r--src/lib/json_generator.c3
9 files changed, 341 insertions, 247 deletions
diff --git a/data/config/func_names.json b/data/config/func_names.json
index 34f857f..0ae5290 100644
--- a/data/config/func_names.json
+++ b/data/config/func_names.json
@@ -219,7 +219,8 @@
219 { 219 {
220 "class" : "Elm_Win", 220 "class" : "Elm_Win",
221 "name" : "resize_object_add", 221 "name" : "resize_object_add",
222 "display_name" : "Resize Object" 222 "display_name" : "Resize Object",
223 "container_behavior_data":["OBJ_CONTAINER", "CONTAINER_PACK"]
223 }, 224 },
224 { 225 {
225 "class" : "Elm_Win", 226 "class" : "Elm_Win",
diff --git a/examples/example.egui b/examples/example.egui
index 4a204fd..9f7e400 100644
--- a/examples/example.egui
+++ b/examples/example.egui
@@ -79,10 +79,9 @@
79 "Elm_Win.constructor":[null, "ELM_WIN_BASIC"], 79 "Elm_Win.constructor":[null, "ELM_WIN_BASIC"],
80 "Evas.Object.size":[514, 665], 80 "Evas.Object.size":[514, 665],
81 "Elm_Win.title":["elm_win1"], 81 "Elm_Win.title":["elm_win1"],
82 "Elm_Win.resize_object_add":["elm_bg1"],
83 "Elm_Win.resize_object_add":["elm_box1"],
84 "Elm_Win.autodel":[true] 82 "Elm_Win.autodel":[true]
85 } 83 },
84 "Contains":["elm_bg1", "elm_box1"]
86 }, 85 },
87 "elm_win1_main_menu": 86 "elm_win1_main_menu":
88 { 87 {
diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index 7a075fe..707c408 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -2012,7 +2012,7 @@ _prop_ctx_menu_cb_func(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Descripti
2012 Elm_Object_Item *it = NULL; 2012 Elm_Object_Item *it = NULL;
2013 eo_do(obj, it_data = eo_key_data_get(_STR_EDITOR)); 2013 eo_do(obj, it_data = eo_key_data_get(_STR_EDITOR));
2014 2014
2015 Eo *ctxpopup = elm_ctxpopup_add(g->propsview_sc); 2015 Eo *ctxpopup = elm_ctxpopup_add(g->propsview_table);
2016 evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopup_dismissed, NULL); 2016 evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopup_dismissed, NULL);
2017 it = elm_ctxpopup_item_append(ctxpopup, "Drop Property", NULL, _drop_property_cb, it_data); 2017 it = elm_ctxpopup_item_append(ctxpopup, "Drop Property", NULL, _drop_property_cb, it_data);
2018 /* If property not connected to widget, this is default property so can not be dropped. */ 2018 /* If property not connected to widget, this is default property so can not be dropped. */
@@ -2333,18 +2333,16 @@ _content_del_from_propview(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Descr
2333 2333
2334/* Called when Up/Down buttons are pressed to reorder contents of box*/ 2334/* Called when Up/Down buttons are pressed to reorder contents of box*/
2335static Eina_Bool 2335static Eina_Bool
2336_content_reorder_from_propview(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 2336_content_reorder_from_propview(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
2337{ 2337{
2338 const Gui_Widget *wdg = _editor_wdg_selected_get(); 2338 const Gui_Widget *wdg = _editor_wdg_selected_get();
2339 intptr_t idx = (intptr_t) data; 2339 intptr_t idx = (intptr_t) data;
2340 intptr_t button_dir; 2340 intptr_t button_dir = (intptr_t)event_info;
2341 eo_do(obj, button_dir = (intptr_t) eo_key_data_get(CONTAINER_REORDER_BUTTON_DIR));
2342 2341
2343 if (wdg_obj_container_class_name_get(wdg) && 2342 if (wdg_obj_container_class_name_get(wdg) &&
2344 !strcmp(wdg_obj_container_class_name_get(wdg), DB_DEF_BOX_CLASS)) 2343 (!strcmp(wdg_obj_container_class_name_get(wdg), DB_DEF_BOX_CLASS) ||
2344 !strcmp(wdg_obj_container_class_name_get(wdg), DB_DEF_WIN_CLASS)))
2345 { 2345 {
2346 Gui_Session *session = (Gui_Session *) gui_context_editor_session_get(_active_context_get());
2347
2348 Object_Container *_old_container, *_new_container; 2346 Object_Container *_old_container, *_new_container;
2349 _old_container = (Object_Container *) wdg_obj_container_get((Gui_Widget *) wdg); 2347 _old_container = (Object_Container *) wdg_obj_container_get((Gui_Widget *) wdg);
2350 _new_container = obj_container_copy(_old_container); 2348 _new_container = obj_container_copy(_old_container);
@@ -2362,10 +2360,8 @@ _content_reorder_from_propview(void *data, Eo *obj, const Eo_Event_Description *
2362 elm_object_item_disabled_set(g->toolbar_redo_it, EINA_TRUE); 2360 elm_object_item_disabled_set(g->toolbar_redo_it, EINA_TRUE);
2363 elm_object_item_disabled_set(g->toolbar_undo_it, EINA_FALSE); 2361 elm_object_item_disabled_set(g->toolbar_undo_it, EINA_FALSE);
2364 2362
2365 /* Unset all content from container. */ 2363 /* Reload all the win when content reordered */
2366 manager_widget_content_unset_all(session, wdg, DB_DEF_BOX_CLASS, MODE_EDITOR, NULL); 2364 _wdg_parent_win_reload(wdg);
2367 /* Set content to container. */
2368 manager_widget_content_add(session, wdg, MODE_EDITOR, NULL);
2369 /* Update propview. */ 2365 /* Update propview. */
2370 _editor_wdg_selected_set(wdg); 2366 _editor_wdg_selected_set(wdg);
2371 objtree_item_selected_set(wdg); 2367 objtree_item_selected_set(wdg);
diff --git a/src/bin/egui_gui/egui_layout.json b/src/bin/egui_gui/egui_layout.json
index 6805e5d..9ea1765 100644
--- a/src/bin/egui_gui/egui_layout.json
+++ b/src/bin/egui_gui/egui_layout.json
@@ -25,7 +25,10 @@
25 "_callbacksview_down_btn_clicked":"_callbacksview_down_btn_clicked", 25 "_callbacksview_down_btn_clicked":"_callbacksview_down_btn_clicked",
26 "_callbacksview_del_btn_clicked":"_callbacksview_del_btn_clicked", 26 "_callbacksview_del_btn_clicked":"_callbacksview_del_btn_clicked",
27 "_toolbar_item_sel_cb":"_toolbar_item_sel_cb", 27 "_toolbar_item_sel_cb":"_toolbar_item_sel_cb",
28 "_propsview_toolbar_clicked":"_propsview_toolbar_clicked" 28 "_propsview_toolbar_clicked":"_propsview_toolbar_clicked",
29 "_contentview_up_btn_clicked":"_contentview_up_btn_clicked",
30 "_contentview_down_btn_clicked":"_contentview_down_btn_clicked",
31 "_contentview_del_btn_clicked":"_contentview_del_btn_clicked"
29 } 32 }
30 }, 33 },
31 "Settings": 34 "Settings":
@@ -148,10 +151,10 @@
148 "Elm_Win.title":["Graph View"], 151 "Elm_Win.title":["Graph View"],
149 "Elm_Win.autodel":[true], 152 "Elm_Win.autodel":[true],
150 "Evas.Object.size":[400, 400], 153 "Evas.Object.size":[400, 400],
151 "Elm_Win.resize_object_add":["gvc_img"],
152 "Elm_Win.icon_object":["gvc_logo"], 154 "Elm_Win.icon_object":["gvc_logo"],
153 "Evas.Object.visibility":[true] 155 "Evas.Object.visibility":[true]
154 } 156 },
157 "Contains":["gvc_img"]
155 }, 158 },
156 "gvc_logo": 159 "gvc_logo":
157 { 160 {
@@ -194,13 +197,11 @@
194 "Elm_Win.title":["Select file"], 197 "Elm_Win.title":["Select file"],
195 "Elm_Win.autodel":[true], 198 "Elm_Win.autodel":[true],
196 "Evas.Object.size":[300, 450], 199 "Evas.Object.size":[300, 450],
197 "Elm_Win.resize_object_add":["bg2"],
198 "Elm_Win.resize_object_add":["vbox"],
199 "Elm_Win.resize_object_add":["fs_table"],
200 "Elm_Win.modal":[true], 200 "Elm_Win.modal":[true],
201 "Elm_Win.icon_object":["fs_logo"], 201 "Elm_Win.icon_object":["fs_logo"],
202 "Evas.Object.visibility":[true] 202 "Evas.Object.visibility":[true]
203 } 203 },
204 "Contains":["bg2", "vbox", "fs_table"]
204 }, 205 },
205 "fs_logo": 206 "fs_logo":
206 { 207 {
@@ -387,12 +388,11 @@
387 "Elm_Win.title":["Resource Manager"], 388 "Elm_Win.title":["Resource Manager"],
388 "Elm_Win.autodel":[true], 389 "Elm_Win.autodel":[true],
389 "Evas.Object.size":[640, 480], 390 "Evas.Object.size":[640, 480],
390 "Elm_Win.resize_object_add":["rm_bg"],
391 "Elm_Win.resize_object_add":["rm_vbox"],
392 "Elm_Win.modal":[true], 391 "Elm_Win.modal":[true],
393 "Evas.Object.visibility":[true], 392 "Evas.Object.visibility":[true],
394 "Elm_Win.icon_object":["rm_logo"] 393 "Elm_Win.icon_object":["rm_logo"]
395 }, 394 },
395 "Contains":["rm_bg", "rm_vbox"],
396 "Callbacks": 396 "Callbacks":
397 { 397 {
398 "delete,request":"_rm_win_request_delete" 398 "delete,request":"_rm_win_request_delete"
@@ -649,12 +649,11 @@
649 "Elm_Win.title":["Settings Manager"], 649 "Elm_Win.title":["Settings Manager"],
650 "Elm_Win.autodel":[true], 650 "Elm_Win.autodel":[true],
651 "Evas.Object.size":[640, 480], 651 "Evas.Object.size":[640, 480],
652 "Elm_Win.resize_object_add":["settings_bg"],
653 "Elm_Win.resize_object_add":["settings_vbox"],
654 "Elm_Win.modal":[true], 652 "Elm_Win.modal":[true],
655 "Elm_Win.icon_object":["settings_logo"], 653 "Elm_Win.icon_object":["settings_logo"],
656 "Evas.Object.visibility":[true] 654 "Evas.Object.visibility":[true]
657 }, 655 },
656 "Contains":["settings_bg", "settings_vbox"],
658 "Callbacks": 657 "Callbacks":
659 { 658 {
660 "delete,request":"_settings_win_request_delete" 659 "delete,request":"_settings_win_request_delete"
@@ -849,11 +848,10 @@
849 "Elm_Win.constructor":[null, "ELM_WIN_BASIC"], 848 "Elm_Win.constructor":[null, "ELM_WIN_BASIC"],
850 "Elm_Win.title":["Erigo - No project"], 849 "Elm_Win.title":["Erigo - No project"],
851 "Evas.Object.size":[1000, 650], 850 "Evas.Object.size":[1000, 650],
852 "Elm_Win.resize_object_add":["main_bg"],
853 "Elm_Win.resize_object_add":["main_box"],
854 "Elm_Win.icon_object":["main_logo"], 851 "Elm_Win.icon_object":["main_logo"],
855 "Evas.Object.visibility":[true] 852 "Evas.Object.visibility":[true]
856 } 853 },
854 "Contains":["main_bg", "main_box"]
857 }, 855 },
858 "main_logo": 856 "main_logo":
859 { 857 {
@@ -2463,11 +2461,11 @@
2463 { 2461 {
2464 "propsview_toolbar":[0, 0, 1, 1], 2462 "propsview_toolbar":[0, 0, 1, 1],
2465 "propsview_filter_box":[0, 1, 1, 1], 2463 "propsview_filter_box":[0, 1, 1, 1],
2466 "propsview_sc":[0, 2, 1, 1],
2467 "properties_list":[0, 2, 1, 1],
2468 "description_list":[0, 2, 1, 1], 2464 "description_list":[0, 2, 1, 1],
2465 "properties_list":[0, 2, 1, 1],
2466 "callbacksview_box":[0, 2, 1, 1],
2469 "itemview_box":[0, 2, 1, 1], 2467 "itemview_box":[0, 2, 1, 1],
2470 "callbacksview_box":[0, 2, 1, 1] 2468 "contentview_box":[0, 2, 1, 1]
2471 } 2469 }
2472 }, 2470 },
2473 "propsview_filter_box": 2471 "propsview_filter_box":
@@ -2603,42 +2601,109 @@
2603 } 2601 }
2604 } 2602 }
2605 }, 2603 },
2606 "propsview_sc": 2604 "callbacksview_box":
2607 { 2605 {
2608 "Desc": 2606 "Desc":
2609 { 2607 {
2610 "parent":"propsview_table", 2608 "parent":"propsview_table",
2611 "class":"Elm_Scroller", 2609 "class":"Elm_Box",
2612 "public":true 2610 "public":true
2613 }, 2611 },
2614 "Properties": 2612 "Properties":
2615 { 2613 {
2616 "Evas.Object.visibility":[true], 2614 "Evas.Object.visibility":[false],
2617 "Evas.Object.size_hint_weight":[1, 1], 2615 "Evas.Object.size_hint_weight":[1, 1],
2618 "Evas.Object.size_hint_align":[-1, -1], 2616 "Evas.Object.size_hint_align":[-1, -1]
2619 "Elm_Interface_Scrollable.bounce_allow":[false, true]
2620 }, 2617 },
2621 "Contains": 2618 "Contains":["callbacksview_list", "callbacksview_buttons_box"]
2619 },
2620 "callbacksview_list":
2621 {
2622 "Desc":
2622 { 2623 {
2623 "propsview_box":[null] 2624 "parent":"callbacksview_box",
2625 "class":"Elm_Genlist",
2626 "public":true
2627 },
2628 "Properties":
2629 {
2630 "Evas.Object.visibility":[true],
2631 "Evas.Object.size_hint_weight":[1, 1],
2632 "Evas.Object.size_hint_align":[-1, -1]
2624 } 2633 }
2625 }, 2634 },
2626 "propsview_box": 2635 "callbacksview_buttons_box":
2627 { 2636 {
2628 "Desc": 2637 "Desc":
2629 { 2638 {
2630 "parent":"propsview_sc", 2639 "parent":"callbacksview_box",
2631 "class":"Elm_Box", 2640 "class":"Elm_Box",
2632 "public":true 2641 "public":true
2633 }, 2642 },
2634 "Properties": 2643 "Properties":
2635 { 2644 {
2636 "Evas.Object.visibility":[true], 2645 "Evas.Object.visibility":[true],
2646 "Elm_Box.horizontal":[true],
2637 "Evas.Object.size_hint_weight":[1, 0], 2647 "Evas.Object.size_hint_weight":[1, 0],
2638 "Evas.Object.size_hint_align":[-1, 0] 2648 "Evas.Object.size_hint_align":[-1, 0]
2649 },
2650 "Contains":["callbacksview_up_btn", "callbacksview_down_btn", "callbacksview_del_btn"]
2651 },
2652 "callbacksview_up_btn":
2653 {
2654 "Desc":
2655 {
2656 "parent":"callbacksview_buttons_box",
2657 "class":"Elm_Button",
2658 "public":true
2659 },
2660 "Properties":
2661 {
2662 "Elm_Widget.part_text":[null, "Up"],
2663 "Evas.Object.visibility":[true]
2664 },
2665 "Callbacks":
2666 {
2667 "clicked":"_callbacksview_up_btn_clicked"
2639 } 2668 }
2640 }, 2669 },
2641 "callbacksview_box": 2670 "callbacksview_down_btn":
2671 {
2672 "Desc":
2673 {
2674 "parent":"callbacksview_buttons_box",
2675 "class":"Elm_Button",
2676 "public":true
2677 },
2678 "Properties":
2679 {
2680 "Elm_Widget.part_text":[null, "Down"],
2681 "Evas.Object.visibility":[true]
2682 },
2683 "Callbacks":
2684 {
2685 "clicked":"_callbacksview_down_btn_clicked"
2686 }
2687 },
2688 "callbacksview_del_btn":
2689 {
2690 "Desc":
2691 {
2692 "parent":"callbacksview_buttons_box",
2693 "class":"Elm_Button",
2694 "public":true
2695 },
2696 "Properties":
2697 {
2698 "Elm_Widget.part_text":[null, "X"],
2699 "Evas.Object.visibility":[true]
2700 },
2701 "Callbacks":
2702 {
2703 "clicked":"_callbacksview_del_btn_clicked"
2704 }
2705 },
2706 "contentview_box":
2642 { 2707 {
2643 "Desc": 2708 "Desc":
2644 { 2709 {
@@ -2652,13 +2717,13 @@
2652 "Evas.Object.size_hint_weight":[1, 1], 2717 "Evas.Object.size_hint_weight":[1, 1],
2653 "Evas.Object.size_hint_align":[-1, -1] 2718 "Evas.Object.size_hint_align":[-1, -1]
2654 }, 2719 },
2655 "Contains":["callbacksview_list", "callbacksview_buttons_box"] 2720 "Contains":["contentview_list", "contentview_buttons_box"]
2656 }, 2721 },
2657 "callbacksview_list": 2722 "contentview_list":
2658 { 2723 {
2659 "Desc": 2724 "Desc":
2660 { 2725 {
2661 "parent":"callbacksview_box", 2726 "parent":"contentview_box",
2662 "class":"Elm_Genlist", 2727 "class":"Elm_Genlist",
2663 "public":true 2728 "public":true
2664 }, 2729 },
@@ -2669,11 +2734,11 @@
2669 "Evas.Object.size_hint_align":[-1, -1] 2734 "Evas.Object.size_hint_align":[-1, -1]
2670 } 2735 }
2671 }, 2736 },
2672 "callbacksview_buttons_box": 2737 "contentview_buttons_box":
2673 { 2738 {
2674 "Desc": 2739 "Desc":
2675 { 2740 {
2676 "parent":"callbacksview_box", 2741 "parent":"contentview_box",
2677 "class":"Elm_Box", 2742 "class":"Elm_Box",
2678 "public":true 2743 "public":true
2679 }, 2744 },
@@ -2684,30 +2749,31 @@
2684 "Evas.Object.size_hint_weight":[1, 0], 2749 "Evas.Object.size_hint_weight":[1, 0],
2685 "Evas.Object.size_hint_align":[-1, 0] 2750 "Evas.Object.size_hint_align":[-1, 0]
2686 }, 2751 },
2687 "Contains":["callbacksview_up_btn", "callbacksview_down_btn", "callbacksview_del_btn"] 2752 "Contains":["contentview_up_btn", "contentview_down_btn", "contentview_del_btn"]
2688 }, 2753 },
2689 "callbacksview_up_btn": 2754 "contentview_del_btn":
2690 { 2755 {
2691 "Desc": 2756 "Desc":
2692 { 2757 {
2693 "parent":"callbacksview_buttons_box", 2758 "parent":"contentview_buttons_box",
2694 "class":"Elm_Button" 2759 "class":"Elm_Button",
2760 "public":true
2695 }, 2761 },
2696 "Properties": 2762 "Properties":
2697 { 2763 {
2698 "Elm_Widget.part_text":[null, "Up"], 2764 "Elm_Widget.part_text":[null, "X"],
2699 "Evas.Object.visibility":[true] 2765 "Evas.Object.visibility":[true]
2700 }, 2766 },
2701 "Callbacks": 2767 "Callbacks":
2702 { 2768 {
2703 "clicked":"_callbacksview_up_btn_clicked" 2769 "clicked":"_contentview_del_btn_clicked"
2704 } 2770 }
2705 }, 2771 },
2706 "callbacksview_down_btn": 2772 "contentview_down_btn":
2707 { 2773 {
2708 "Desc": 2774 "Desc":
2709 { 2775 {
2710 "parent":"callbacksview_buttons_box", 2776 "parent":"contentview_buttons_box",
2711 "class":"Elm_Button", 2777 "class":"Elm_Button",
2712 "public":true 2778 "public":true
2713 }, 2779 },
@@ -2718,25 +2784,25 @@
2718 }, 2784 },
2719 "Callbacks": 2785 "Callbacks":
2720 { 2786 {
2721 "clicked":"_callbacksview_down_btn_clicked" 2787 "clicked":"_contentview_down_btn_clicked"
2722 } 2788 }
2723 }, 2789 },
2724 "callbacksview_del_btn": 2790 "contentview_up_btn":
2725 { 2791 {
2726 "Desc": 2792 "Desc":
2727 { 2793 {
2728 "parent":"callbacksview_buttons_box", 2794 "parent":"contentview_buttons_box",
2729 "class":"Elm_Button", 2795 "class":"Elm_Button",
2730 "public":true 2796 "public":true
2731 }, 2797 },
2732 "Properties": 2798 "Properties":
2733 { 2799 {
2734 "Elm_Widget.part_text":[null, "X"], 2800 "Elm_Widget.part_text":[null, "Up"],
2735 "Evas.Object.visibility":[true] 2801 "Evas.Object.visibility":[true]
2736 }, 2802 },
2737 "Callbacks": 2803 "Callbacks":
2738 { 2804 {
2739 "clicked":"_callbacksview_del_btn_clicked" 2805 "clicked":"_contentview_up_btn_clicked"
2740 } 2806 }
2741 }, 2807 },
2742 "itemview_box": 2808 "itemview_box":
diff --git a/src/bin/egui_gui/itemview.c b/src/bin/egui_gui/itemview.c
index 31dc5c3..0a6d1d1 100644
--- a/src/bin/egui_gui/itemview.c
+++ b/src/bin/egui_gui/itemview.c
@@ -97,11 +97,9 @@ _item_list_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *par
97 { 97 {
98 Par_Field_Data *pfd = calloc (1, sizeof(Par_Field_Data)); 98 Par_Field_Data *pfd = calloc (1, sizeof(Par_Field_Data));
99 pfd->it_data = it_data; 99 pfd->it_data = it_data;
100 pfd->it_data->refs++;
101 pfd->par_idx = i; 100 pfd->par_idx = i;
102 101
103 eo_do(o, eo_key_data_set("editor", pfd, free)); 102 eo_do(o, eo_key_data_set("editor", pfd, free));
104 evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, _pfd_del, NULL);
105 103
106 if (eo_isa(o, ELM_HOVERSEL_CLASS)) 104 if (eo_isa(o, ELM_HOVERSEL_CLASS))
107 { 105 {
diff --git a/src/bin/egui_gui/propview.c b/src/bin/egui_gui/propview.c
index db48cbd..85e3386 100644
--- a/src/bin/egui_gui/propview.c
+++ b/src/bin/egui_gui/propview.c
@@ -15,16 +15,17 @@ static Elm_Genlist_Item_Class *_itc_prop = NULL;
15static Elm_Genlist_Item_Class *_itc_notfound = NULL; 15static Elm_Genlist_Item_Class *_itc_notfound = NULL;
16static Elm_Genlist_Item_Class *_itc_cb = NULL; 16static Elm_Genlist_Item_Class *_itc_cb = NULL;
17static Elm_Genlist_Item_Class *_itc_desc = NULL; 17static Elm_Genlist_Item_Class *_itc_desc = NULL;
18static Elm_Genlist_Item_Class *_itc_ctn = NULL;
18 19
20static Eo *propview_table = NULL;
19static Eo *prop_list = NULL; 21static Eo *prop_list = NULL;
20static Eo *cb_list = NULL; 22static Eo *cb_list = NULL;
21static Eo *desc_list = NULL; 23static Eo *desc_list = NULL;
24static Eo *ctn_list = NULL;
22 25
23extern Gui_Context * 26extern Gui_Context *
24_active_context_get(); 27_active_context_get();
25 28
26static Eo *sc_box = NULL;
27
28static PropViewCbs *_view_cbs = NULL; 29static PropViewCbs *_view_cbs = NULL;
29static It_Data_Type _propsview_toolbar_selected_item_type = DESCRIPTION_TYPE; 30static It_Data_Type _propsview_toolbar_selected_item_type = DESCRIPTION_TYPE;
30static It_Data_Type _new_type = DESCRIPTION_TYPE; 31static It_Data_Type _new_type = DESCRIPTION_TYPE;
@@ -36,29 +37,17 @@ _it_data_free(void *data)
36 37
37 if (!it_data) return; 38 if (!it_data) return;
38 39
39 it_data->refs--; 40 /* If property wasn't assigned to any widget, this is property with default values.
40 if (!it_data->refs) 41 * Delete it. */
42 if ((it_data->type == PROPERTY_TYPE) && (it_data->prop) && !prop_wdg_get(it_data->prop))
41 { 43 {
42 /* If property wasn't assigned to any widget, this is property with default values. 44 prop_ref((Gui_Widget_Property *) it_data->prop);
43 * Delete it. */ 45 prop_unref((Gui_Widget_Property *) it_data->prop);
44 if ((it_data->type == PROPERTY_TYPE) && (it_data->prop) && !prop_wdg_get(it_data->prop)) 46 it_data->prop = NULL;
45 {
46 prop_ref((Gui_Widget_Property *) it_data->prop);
47 prop_unref((Gui_Widget_Property *) it_data->prop);
48 it_data->prop = NULL;
49 }
50 free(it_data);
51 it_data = NULL;
52 } 47 }
53}
54 48
55void 49 free(it_data);
56_pfd_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 50 it_data = NULL;
57{
58 Par_Field_Data *pfd = NULL;
59 eo_do(obj, pfd = eo_key_data_get(_STR_EDITOR));
60 if (pfd) _it_data_free(pfd->it_data);
61 eo_do(obj, eo_key_data_del(_STR_EDITOR));
62} 51}
63 52
64#define _PATH_ICON_UP_ARROW PACKAGE_DATA_DIR"/images/icon_up_arrow.png" 53#define _PATH_ICON_UP_ARROW PACKAGE_DATA_DIR"/images/icon_up_arrow.png"
@@ -135,18 +124,16 @@ _content_item_content_get(It_Data *it_data)
135 for (i = 0; i < count; i++) 124 for (i = 0; i < count; i++)
136 { 125 {
137 /* Get value, for which we want to build field. 126 /* Get value, for which we want to build field.
138 * If it is NULL, field will be build, for nth value in Op_Desc*/ 127 * If it is NULL, field will be build, for nth value in Op_Desc */
139 Gui_Value *val = ((it_data->prop) ? prop_value_nth_get(it_data->prop, i) : NULL); 128 Gui_Value *val = ((it_data->prop) ? prop_value_nth_get(it_data->prop, i) : NULL);
140 Eo *obj = props_value_add(box, ctx, wdg, val, it_data->op_desc, i); 129 Eo *obj = props_value_add(box, ctx, wdg, val, it_data->op_desc, i);
141 if (obj) 130 if (obj)
142 { 131 {
143 Par_Field_Data *pfd = calloc (1, sizeof(Par_Field_Data)); 132 Par_Field_Data *pfd = calloc (1, sizeof(Par_Field_Data));
144 pfd->it_data = it_data; 133 pfd->it_data = it_data;
145 pfd->it_data->refs++;
146 pfd->par_idx = i; 134 pfd->par_idx = i;
147 135
148 eo_do(obj, eo_key_data_set(_STR_EDITOR, pfd, free)); 136 eo_do(obj, eo_key_data_set(_STR_EDITOR, pfd, free));
149 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _pfd_del, NULL);
150 137
151 if (eo_isa(obj, ELM_HOVERSEL_CLASS)) 138 if (eo_isa(obj, ELM_HOVERSEL_CLASS))
152 { 139 {
@@ -223,13 +210,6 @@ _property_item_content_get(It_Data *it_data)
223 pfd->par_idx = i; 210 pfd->par_idx = i;
224 211
225 eo_do(obj, eo_key_data_set(_STR_EDITOR, pfd, free)); 212 eo_do(obj, eo_key_data_set(_STR_EDITOR, pfd, free));
226 //evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _pfd_del, NULL);
227
228 /* Forbid changing of value in "resize_object_add", only if property assigned to widget. */
229 if (prop && prop_wdg_get(prop) && value && (!strcmp(prop_name_get(prop), RESIZE_OBJECT_ADD)))
230 {
231 eo_do(obj, elm_obj_widget_disabled_set(EINA_TRUE));
232 }
233 213
234 if (eo_isa(obj, ELM_HOVERSEL_CLASS)) 214 if (eo_isa(obj, ELM_HOVERSEL_CLASS))
235 { 215 {
@@ -272,12 +252,6 @@ _property_item_content_get(It_Data *it_data)
272 } 252 }
273 } 253 }
274 254
275 /* If property "resize_object_add" is set and assigned to widget add delete button. */
276 if (prop && prop_wdg_get(prop) && (!strcmp(db_op_desc_op_name_get(op), RESIZE_OBJECT_ADD)))
277 {
278 Eo *obj = props_button_add(box, "X");
279 eo_do(obj, eo_event_callback_add(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _view_cbs->property_delete_cb_func, prop));
280 }
281 return EINA_TRUE; 255 return EINA_TRUE;
282} 256}
283 257
@@ -385,8 +359,10 @@ _callback_item_content_get(It_Data *it_data)
385 Dep_Id *dep_id = cb_sequence_id_get(cb); 359 Dep_Id *dep_id = cb_sequence_id_get(cb);
386 const char *default_str = NULL; 360 const char *default_str = NULL;
387 if (dep_id) 361 if (dep_id)
388 default_str = dep_name_get(dep_id); 362
389 Eo *seqs_list = props_hoversel_seqs_add(box, elm_widget_top_get(sc_box), wdg_context_get(it_data->wdg), default_str, EINA_FALSE); 363 default_str = dep_name_get(dep_id);
364 Eo *seqs_list = props_hoversel_seqs_add(box, elm_widget_top_get(propview_table), wdg_context_get(it_data->wdg), default_str, EINA_FALSE);
365
390 eo_do(seqs_list, evas_obj_size_hint_align_set(1, 0)); 366 eo_do(seqs_list, evas_obj_size_hint_align_set(1, 0));
391 eo_do(seqs_list, evas_obj_size_hint_weight_set(1, 0)); 367 eo_do(seqs_list, evas_obj_size_hint_weight_set(1, 0));
392 eo_do(seqs_list, eo_event_callback_add(EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, 368 eo_do(seqs_list, eo_event_callback_add(EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED,
@@ -486,13 +462,13 @@ _prop_field_update(const Gui_Widget_Property *prop, Eo *item_box, It_Data *it_da
486 EINA_LIST_FOREACH(par_list, l, val) 462 EINA_LIST_FOREACH(par_list, l, val)
487 { 463 {
488 Eo *o = NULL; 464 Eo *o = NULL;
465 Par_Field_Data *pfd = NULL;
489 466
490 // Only fields that have a Par_Field_Data attached to them interest us. 467 // Only fields that have a Par_Field_Data attached to them interest us.
491 // Iterate over the next elements of the box until such element is found 468 // Iterate over the next elements of the box until such element is found
492 // and reassign it_data to it if needed. 469 // and reassign it_data to it if needed.
493 while (box_list_itr) 470 while (box_list_itr)
494 { 471 {
495 Par_Field_Data *pfd;
496 o = eina_list_data_get(box_list_itr); 472 o = eina_list_data_get(box_list_itr);
497 eo_do(o, pfd = (Par_Field_Data *) eo_key_data_get(_STR_EDITOR)); 473 eo_do(o, pfd = (Par_Field_Data *) eo_key_data_get(_STR_EDITOR));
498 box_list_itr = eina_list_next(box_list_itr); 474 box_list_itr = eina_list_next(box_list_itr);
@@ -503,7 +479,7 @@ _prop_field_update(const Gui_Widget_Property *prop, Eo *item_box, It_Data *it_da
503 } 479 }
504 } 480 }
505 481
506 if (!box_list_itr) break; 482 if (!(box_list_itr || pfd)) break;
507 483
508 Gui_Type t = gui_value_type_get(val); 484 Gui_Type t = gui_value_type_get(val);
509 485
@@ -598,7 +574,7 @@ _item_content_get(It_Data *it_data)
598{ 574{
599 Eo *box = NULL; 575 Eo *box = NULL;
600 576
601 box = eo_add(ELM_BOX_CLASS, sc_box); 577 box = eo_add(ELM_BOX_CLASS, propview_table);
602 eo_do(box, evas_obj_visibility_set(EINA_TRUE), 578 eo_do(box, evas_obj_visibility_set(EINA_TRUE),
603 elm_obj_box_horizontal_set(EINA_TRUE), 579 elm_obj_box_horizontal_set(EINA_TRUE),
604 elm_obj_box_padding_set(5, 0), 580 elm_obj_box_padding_set(5, 0),
@@ -608,11 +584,6 @@ _item_content_get(It_Data *it_data)
608// 18 * elm_config_scale_get()) 584// 18 * elm_config_scale_get())
609 ); 585 );
610 586
611 /* set item data to box, so it will be automatically freed. */
612 if (it_data->type != PROPERTY_TYPE && it_data->type != CALLBACK_TYPE
613 && it_data->type != DESCRIPTION_TYPE)
614 eo_do(box, eo_key_data_set(_STR_EDITOR, it_data, _it_data_free));
615
616 it_data->box = box; 587 it_data->box = box;
617 switch (it_data->type) 588 switch (it_data->type)
618 { 589 {
@@ -748,7 +719,6 @@ _prop_item_del(void *data, Evas_Object *obj EINA_UNUSED)
748 719
749 eina_hash_del(op_item_table, NULL, it_data); 720 eina_hash_del(op_item_table, NULL, it_data);
750 _mempool_cache_data_put(fullname, it_data->box); 721 _mempool_cache_data_put(fullname, it_data->box);
751 it_data->refs = 1;
752 _it_data_free(it_data); 722 _it_data_free(it_data);
753} 723}
754 724
@@ -779,7 +749,6 @@ _props_classname_table_expand(const Gui_Widget *wdg, const char *classname, Elm_
779 Op_Desc *op; 749 Op_Desc *op;
780 750
781 const char *filter = _filter_string_get(); 751 const char *filter = _filter_string_get();
782 Eina_List *props = NULL;
783 752
784 /* iterate over each operation of class. */ 753 /* iterate over each operation of class. */
785 Eina_List *llst = db_class_op_desc_list_get(classname); 754 Eina_List *llst = db_class_op_desc_list_get(classname);
@@ -797,43 +766,26 @@ _props_classname_table_expand(const Gui_Widget *wdg, const char *classname, Elm_
797 if (filter && !_str_nocase_prefix(op_display_name, filter)) 766 if (filter && !_str_nocase_prefix(op_display_name, filter))
798 continue; 767 continue;
799 768
800 const char *op_name = db_op_desc_op_name_get(op); 769 Eina_List *pitems = NULL;
801 const char *op_class_name = db_op_desc_class_name_get(op);
802
803 Eina_List *wdg_prop_lst = wdg_prop_list_get(wdg); 770 Eina_List *wdg_prop_lst = wdg_prop_list_get(wdg);
804 771
805 // Find which class properties are in widget. Can be more than one. 772 // Find which class properties are in widget. Can be more than one.
806 EINA_LIST_FOREACH(wdg_prop_lst, l2, prop) 773 EINA_LIST_FOREACH(wdg_prop_lst, l2, prop)
807 { 774 if (prop_op_desc_get(prop) == op) pitems = eina_list_append(pitems, prop);
808 const char *name = prop_name_get(prop);
809 const char *class_name = db_op_desc_class_name_get(prop_op_desc_get(prop));
810 if (!strcmp(op_name, name) && !strcmp(op_class_name, class_name))
811 props = eina_list_append(props, prop);
812 }
813
814 //_properties_in_widget_get(props, wdg, op_name, op_class_name);
815 775
816 /* Special case, if property is RESIZE_OBJECT_ADD, add a row with empty values. 776 // If none found, its a default one
817 * If widget doesn't contatin current prop, add empty prop. */ 777 if (!eina_list_count(pitems)) pitems = eina_list_append(pitems, NULL);
818 if ((!strcmp(db_op_desc_op_name_get(op), RESIZE_OBJECT_ADD)) ||
819 (!wdg_prop_get(wdg, op_class_name, op_name)))
820 props = eina_list_append(props, NULL);
821 778
822 // add the item to the properties genlist 779 EINA_LIST_FREE(pitems, prop)
823 EINA_LIST_FOREACH(props, l2, prop)
824 { 780 {
825 it_data = IT_DATA_BUILD(PROPERTY_TYPE, wdg); 781 it_data = IT_DATA_BUILD(PROPERTY_TYPE, wdg);
826 it_data->op_desc = op; 782 it_data->op_desc = op;
827 it_data->prop = prop; 783 it_data->prop = prop;
828 elm_genlist_item_append(prop_list, _itc_prop, it_data, parent, 784 elm_genlist_item_append(prop_list, _itc_prop, it_data, parent,
829 ELM_GENLIST_ITEM_NONE, NULL, NULL); 785 ELM_GENLIST_ITEM_NONE, NULL, NULL);
830 /* map current item with its prop name. */ 786 /* map current item with its prop name. */
831 if (strcmp(db_op_desc_op_name_get(op), RESIZE_OBJECT_ADD)) 787 eina_hash_add(op_item_table, db_op_desc_op_name_full_get(op), it_data);
832 eina_hash_add(op_item_table, db_op_desc_op_name_full_get(op), it_data);
833 } 788 }
834
835 eina_list_free(props);
836 props = NULL;
837 } 789 }
838} 790}
839 791
@@ -912,99 +864,133 @@ _properties_build(const Gui_Widget *wdg)
912 } 864 }
913 // Automatically expand the class 865 // Automatically expand the class
914 else 866 else
915 { 867 {
916 Elm_Object_Item *glit = elm_genlist_first_item_get(prop_list); 868 Elm_Object_Item *glit = elm_genlist_first_item_get(prop_list);
917 if (glit) elm_genlist_item_expanded_set(glit, EINA_TRUE); 869 if (glit) elm_genlist_item_expanded_set(glit, EINA_TRUE);
918 } 870 }
919} 871}
920 872
921static void 873static void
922_content_build(const Gui_Widget *wdg) 874_content_build(const Gui_Widget *wdg)
923{ 875{
924 eina_hash_free(op_item_table); 876 Eina_List *ctn_items = NULL;
925 op_item_table = NULL; 877 Eina_List *l;
926
927 Eina_List *items_lst = wdg_obj_container_contents_list_get(wdg);
928 Eina_List *itr1;
929 int i = 0; 878 int i = 0;
930 Object_Container_Item *ci; 879 Object_Container_Item *ci;
931 if (items_lst) 880 It_Data *it_data;
932 {
933 EINA_LIST_FOREACH(items_lst, itr1, ci)
934 {
935 Gui_Widget_Property *prop = obj_container_item_prop_get(ci);
936 Eo *it_box;
937 It_Data *it_data = IT_DATA_BUILD(CONTENT_TYPE, wdg);
938 it_data->idx = i;
939 it_data->prop = prop;
940 it_data->op_desc = (Op_Desc *) prop_op_desc_get(prop);
941 881
942 it_box = _item_content_get(it_data); 882 const char *wdg_name = wdg_obj_container_class_name_get(wdg);
883 Eina_Bool isbox = (wdg_name &&
884 (!strcmp(wdg_name, DB_DEF_BOX_CLASS) ||
885 !strcmp(wdg_name, DB_DEF_WIN_CLASS)));
943 886
944 eo_do(sc_box, elm_obj_box_pack_end(it_box)); 887 GUI *g = get_gui();
888 elm_object_disabled_set(g->contentview_down_btn, !isbox);
889 elm_object_disabled_set(g->contentview_up_btn, !isbox);
945 890
946 if (wdg_obj_container_class_name_get(wdg) && 891 Eina_List *items_lst = wdg_obj_container_contents_list_get(wdg);
947 !strcmp(wdg_obj_container_class_name_get(wdg), DB_DEF_BOX_CLASS)) 892
948 { 893 EINA_LIST_FOREACH(items_lst, l, ci)
949 Eo *up_down_box, *button_up, *button_down, *ic; 894 {
950 up_down_box = eo_add(ELM_BOX_CLASS, it_box); 895 Gui_Widget_Property *prop = obj_container_item_prop_get(ci);
951 eo_do(up_down_box, evas_obj_visibility_set(EINA_TRUE), 896 it_data = IT_DATA_BUILD(CONTENT_TYPE, wdg);
952 elm_obj_box_horizontal_set(EINA_FALSE), 897 it_data->idx = i;
953 elm_obj_box_padding_set(0, 0), 898 it_data->prop = prop;
954 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0), 899 it_data->op_desc = (Op_Desc *) prop_op_desc_get(prop);
955 evas_obj_size_hint_align_set(0, 0) 900 i++;
956 ); 901
957 eo_do(it_box, elm_obj_box_pack_end(up_down_box)); 902 ctn_items = eina_list_append(ctn_items, it_data);
958
959 button_up = props_button_add(up_down_box, "Up");
960 eo_do(button_up, evas_obj_size_hint_align_set(EVAS_HINT_FILL, 1),
961 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0));
962 ic = eo_add(ELM_ICON_CLASS, it_box);
963 eo_do(ic, efl_file_set(_PATH_ICON_UP_ARROW, NULL));
964 eo_do(button_up, elm_obj_container_content_set("icon", ic));
965
966 button_down = props_button_add(up_down_box, "Down");
967 eo_do(button_down, evas_obj_size_hint_align_set(0, 0));
968 ic = eo_add(ELM_ICON_CLASS, it_box);
969 eo_do(ic, efl_file_set(_PATH_ICON_DOWN_ARROW, NULL));
970 eo_do(button_down, elm_obj_container_content_set("icon", ic));
971
972 eo_do(button_up, eo_key_data_set(CONTAINER_REORDER_BUTTON_DIR, (void *) (intptr_t) UP, NULL));
973 eo_do(button_down, eo_key_data_set(CONTAINER_REORDER_BUTTON_DIR, (void *) (intptr_t) DOWN, NULL));
974 eo_do(button_up, eo_event_callback_add(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _view_cbs->content_reorder_cb_func, (void *) (intptr_t) i));
975 eo_do(button_down, eo_event_callback_add(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _view_cbs->content_reorder_cb_func, (void *) (intptr_t) i));
976 }
977 Eo *ic, *button_x = props_button_add(it_box, NULL);
978 ic = eo_add(ELM_ICON_CLASS, it_box);
979 eo_do(ic, efl_file_set(PACKAGE_DATA_DIR"/images/icon_close.png", NULL));
980 eo_do(button_x, elm_obj_container_content_set("icon", ic));
981 eo_do(button_x,
982 evas_obj_size_hint_weight_set(0, EVAS_HINT_EXPAND),
983 evas_obj_size_hint_align_set(0, EVAS_HINT_FILL)
984 );
985 /* i is an index of content inside container list. */
986 eo_do(button_x, eo_event_callback_add(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _view_cbs->content_delete_cb_func, (void *) (intptr_t) i));
987 i++;
988 }
989 } 903 }
990 /* Add empty fields. */ 904
905 /* Add empty fields. */
906 const char *wdg_class_name = wdg_class_name_get(wdg);
907 const char *name;
908 /* Add empty field for each type of container. */
909 EINA_LIST_FOREACH(db_class_inherit_containers_list_get(wdg_class_name), l, name)
991 { 910 {
992 const char *wdg_class_name = wdg_class_name_get(wdg); 911 const Op_Desc *op_desc = db_container_desc_op_desc_get(db_container_desc_get(name), CONTAINER_PACK);
993 Eina_List *itr; 912 it_data = IT_DATA_BUILD(CONTENT_TYPE, wdg);
994 const char *name; 913 it_data->idx = i;
995 /* Add empty field for each type of container. */ 914 it_data->op_desc = op_desc;
996 EINA_LIST_FOREACH(db_class_inherit_containers_list_get(wdg_class_name), itr, name) 915 it_data->prop = NULL;
997 { 916
998 const Op_Desc *op_desc = db_container_desc_op_desc_get(db_container_desc_get(name), CONTAINER_PACK); 917 ctn_items = eina_list_append(ctn_items, it_data);
999 It_Data *it_data = IT_DATA_BUILD(CONTENT_TYPE, wdg); 918 }
1000 it_data->idx = i; 919
1001 it_data->op_desc = op_desc; 920 EINA_LIST_FREE(ctn_items, it_data)
1002 it_data->prop = NULL; 921 elm_genlist_item_append(ctn_list, _itc_ctn, it_data, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
1003 922}
1004 Eo *it_box = _item_content_get(it_data); 923
1005 eo_do(sc_box, elm_obj_box_pack_end(it_box)); 924static void
1006 } 925_content_select_item(const Gui_Widget_Property *prop)
926{
927 Elm_Object_Item *it = elm_genlist_first_item_get(ctn_list);
928 for (; it; it = elm_genlist_item_next_get(it))
929 {
930 It_Data *it_data = elm_object_item_data_get(it);
931 if (it_data->prop == prop)
932 {
933 elm_genlist_item_selected_set(it, EINA_TRUE);
934 break;
935 }
936 }
937}
938
939Eina_Bool
940_contentview_del_btn_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc, void *event_info)
941{
942 const Gui_Widget_Property *prev_prop = NULL;
943
944 Elm_Object_Item *glit = elm_genlist_selected_item_get(ctn_list);
945 if (!glit) return EO_CALLBACK_CONTINUE;
946
947 It_Data *it_data = elm_object_item_data_get(glit);
948 intptr_t idx = (intptr_t) it_data->idx;
949
950 it_data = elm_object_item_data_get(elm_genlist_item_next_get(glit));
951 if (it_data) prev_prop = it_data->prop;
952 if (!prev_prop)
953 {
954 it_data = elm_object_item_data_get(elm_genlist_item_prev_get(glit));
955 if (it_data) prev_prop = it_data->prop;
1007 } 956 }
957
958 Eina_Bool ret = _view_cbs->content_delete_cb_func((void *)idx, obj, desc, event_info);
959 if (prev_prop) _content_select_item(prev_prop);
960
961 return ret;
962}
963
964Eina_Bool
965_contentview_up_btn_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc, void *event_info EINA_UNUSED)
966{
967 Elm_Object_Item *glit = elm_genlist_selected_item_get(ctn_list);
968 if (!glit) return EO_CALLBACK_CONTINUE;
969
970 It_Data *it_data = elm_object_item_data_get(glit);
971 const Gui_Widget_Property *prev_prop = it_data->prop;
972 intptr_t idx = it_data->idx;
973
974 Eina_Bool ret = _view_cbs->content_reorder_cb_func((void *)idx, obj, desc, (void *)(intptr_t)UP);
975 _content_select_item(prev_prop);
976
977 return ret;
978}
979
980Eina_Bool
981_contentview_down_btn_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc, void *event_info EINA_UNUSED)
982{
983 Elm_Object_Item *glit = elm_genlist_selected_item_get(ctn_list);
984 if (!glit) return EO_CALLBACK_CONTINUE;
985
986 It_Data *it_data = elm_object_item_data_get(glit);
987 const Gui_Widget_Property *prev_prop = it_data->prop;
988 intptr_t idx = it_data->idx;
989
990 Eina_Bool ret = _view_cbs->content_reorder_cb_func((void *)idx, obj, desc, (void *)(intptr_t)DOWN);
991 _content_select_item(prev_prop);
992
993 return ret;
1008} 994}
1009 995
1010/* This function now is called for meny only */ 996/* This function now is called for meny only */
@@ -1018,7 +1004,6 @@ static void
1018_desc_item_del(void *data, Evas_Object *obj EINA_UNUSED) 1004_desc_item_del(void *data, Evas_Object *obj EINA_UNUSED)
1019{ 1005{
1020 It_Data *it_data = data; 1006 It_Data *it_data = data;
1021 it_data->refs = 1;
1022 _it_data_free(it_data); 1007 _it_data_free(it_data);
1023} 1008}
1024 1009
@@ -1028,8 +1013,49 @@ _desc_item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *par
1028 return _item_content_get(data); 1013 return _item_content_get(data);
1029} 1014}
1030 1015
1016static void
1017_contents_item_del(void *data, Evas_Object *obj EINA_UNUSED)
1018{
1019 It_Data *it_data = data;
1020
1021 if (it_data->prop)
1022 {
1023 const char *fullname = db_op_desc_op_name_full_get(it_data->op_desc);
1024 _mempool_cache_data_put(fullname, it_data->box);
1025 }
1026
1027 _it_data_free(it_data);
1028}
1029
1030static Evas_Object *
1031_contents_item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
1032{
1033 It_Data *it_data = data;
1034
1035 if (!it_data->prop) return _item_content_get(it_data);
1036
1037 if (it_data->box) return it_data->box;
1038
1039 const char *fullname = db_op_desc_op_name_full_get(it_data->op_desc);
1040
1041 Evas_Object * it_box = _mempool_cache_data_get(fullname);
1042
1043 if (!it_box)
1044 {
1045 it_box = _item_content_get(it_data);
1046 eo_ref(it_box);
1047 }
1048 else
1049 {
1050 it_data->box = it_box;
1051 _prop_field_update(it_data->prop, it_box, it_data);
1052 }
1053
1054 return it_box;
1055}
1056
1031// Used to loop in _description_build function 1057// Used to loop in _description_build function
1032static char *descs[] = { DB_DEF_NAME, DB_DEF_CLASS, DB_DEF_PUBLIC, NULL}; 1058static char *descs[] = { DB_DEF_NAME, DB_DEF_CLASS, DB_DEF_PUBLIC, NULL };
1033 1059
1034static void 1060static void
1035_description_build(const Gui_Widget *wdg) 1061_description_build(const Gui_Widget *wdg)
@@ -1121,7 +1147,6 @@ _callbacks_item_del(void *data, Evas_Object *obj EINA_UNUSED)
1121 eina_list_free(contents); 1147 eina_list_free(contents);
1122 1148
1123 _mempool_cache_data_put(CACHE_CALLBACKS, it_data->box); 1149 _mempool_cache_data_put(CACHE_CALLBACKS, it_data->box);
1124 it_data->refs = 1;
1125 _it_data_free(it_data); 1150 _it_data_free(it_data);
1126} 1151}
1127 1152
@@ -1223,7 +1248,7 @@ _propview_build_post_cb(const Gui_Widget *wdg, It_Data_Type new_type)
1223 } 1248 }
1224 case ITEM_TYPE: 1249 case ITEM_TYPE:
1225 { 1250 {
1226 eo_do(g->propsview_sc, evas_obj_visibility_set(EINA_TRUE)); 1251 eo_do(g->contentview_box, evas_obj_visibility_set(EINA_TRUE));
1227 eo_do(g->itemview_box, evas_obj_visibility_set(EINA_FALSE)); 1252 eo_do(g->itemview_box, evas_obj_visibility_set(EINA_FALSE));
1228 break; 1253 break;
1229 } 1254 }
@@ -1232,7 +1257,7 @@ _propview_build_post_cb(const Gui_Widget *wdg, It_Data_Type new_type)
1232 _propsview_toolbar_selected_item_type = new_type; 1257 _propsview_toolbar_selected_item_type = new_type;
1233 1258
1234 /* Setting view according to new selected toolbar's item. */ 1259 /* Setting view according to new selected toolbar's item. */
1235 eo_do(g->propsview_sc, evas_obj_visibility_set(EINA_FALSE)); 1260 eo_do(g->contentview_box, evas_obj_visibility_set(EINA_FALSE));
1236 eo_do(g->properties_list, evas_obj_visibility_set(EINA_FALSE)); 1261 eo_do(g->properties_list, evas_obj_visibility_set(EINA_FALSE));
1237 eo_do(g->itemview_box, evas_obj_visibility_set(EINA_FALSE)); 1262 eo_do(g->itemview_box, evas_obj_visibility_set(EINA_FALSE));
1238 eo_do(g->callbacksview_box, evas_obj_visibility_set(EINA_FALSE)); 1263 eo_do(g->callbacksview_box, evas_obj_visibility_set(EINA_FALSE));
@@ -1257,12 +1282,12 @@ _propview_build_post_cb(const Gui_Widget *wdg, It_Data_Type new_type)
1257 } 1282 }
1258 case CONTENT_TYPE: 1283 case CONTENT_TYPE:
1259 { 1284 {
1260 eo_do(g->propsview_sc, evas_obj_visibility_set(EINA_TRUE)); 1285 eo_do(g->contentview_box, evas_obj_visibility_set(EINA_TRUE));
1261 break; 1286 break;
1262 } 1287 }
1263 case ITEM_TYPE: 1288 case ITEM_TYPE:
1264 { 1289 {
1265 eo_do(g->propsview_sc, evas_obj_visibility_set(EINA_FALSE)); 1290 eo_do(g->contentview_box, evas_obj_visibility_set(EINA_FALSE));
1266 eo_do(g->itemview_box, evas_obj_visibility_set(EINA_TRUE)); 1291 eo_do(g->itemview_box, evas_obj_visibility_set(EINA_TRUE));
1267 1292
1268 if (wdg_is_container(wdg, DB_DEF_MENU_CLASS)) 1293 if (wdg_is_container(wdg, DB_DEF_MENU_CLASS))
@@ -1295,13 +1320,14 @@ propview_build(const Gui_Widget *wdg)
1295 eo_do(cb_list, elm_obj_genlist_clear()); 1320 eo_do(cb_list, elm_obj_genlist_clear());
1296 eo_do(desc_list, elm_obj_genlist_clear()); 1321 eo_do(desc_list, elm_obj_genlist_clear());
1297 eo_do(prop_list, elm_obj_genlist_clear()); 1322 eo_do(prop_list, elm_obj_genlist_clear());
1298 elm_box_clear(sc_box); 1323 eo_do(ctn_list, elm_obj_genlist_clear());
1299 1324
1300 if (op_item_table) 1325 if (op_item_table)
1301 { 1326 {
1302 eina_hash_free(op_item_table); 1327 eina_hash_free(op_item_table);
1303 op_item_table = NULL; 1328 op_item_table = NULL;
1304 } 1329 }
1330
1305 if (!wdg) return; 1331 if (!wdg) return;
1306 1332
1307 /* type ITEM_TYPE not assigned to any toolbar's item. 1333 /* type ITEM_TYPE not assigned to any toolbar's item.
@@ -1559,16 +1585,6 @@ _callbacksview_del_btn_clicked(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, cons
1559void 1585void
1560propview_init() 1586propview_init()
1561{ 1587{
1562 GUI *g = get_gui();
1563 sc_box = g->propsview_box;
1564 prop_list = g->properties_list;
1565
1566 /* Put it here, because it Enums defined in propsview.h */
1567 elm_object_item_data_set(g->propsview_toolbar_desc_it, (void *) (intptr_t) DESCRIPTION_TYPE);
1568 elm_object_item_data_set(g->propsview_toolbar_prop_it, (void *) (intptr_t) PROPERTY_TYPE);
1569 elm_object_item_data_set(g->propsview_toolbar_cb_it, (void *) (intptr_t) CALLBACK_TYPE);
1570 elm_object_item_data_set(g->propsview_toolbar_cont_it, (void *) (intptr_t) CONTENT_TYPE);
1571
1572 if (!_itc_class) 1588 if (!_itc_class)
1573 { 1589 {
1574 _itc_class = elm_genlist_item_class_new(); 1590 _itc_class = elm_genlist_item_class_new();
@@ -1608,12 +1624,31 @@ propview_init()
1608 _itc_desc->func.del = _desc_item_del; 1624 _itc_desc->func.del = _desc_item_del;
1609 } 1625 }
1610 1626
1627 if (!_itc_ctn)
1628 {
1629 _itc_ctn = elm_genlist_item_class_new();
1630 _itc_ctn->item_style = "full";
1631 _itc_ctn->func.content_get = _contents_item_content_get;
1632 _itc_ctn->func.del = _contents_item_del;
1633 }
1634
1635 GUI *g = get_gui();
1636
1637 propview_table = g->propsview_table;
1638
1639 prop_list = g->properties_list;
1640
1641 /* Put it here, because it Enums defined in propsview.h */
1642 elm_object_item_data_set(g->propsview_toolbar_desc_it, (void *) (intptr_t) DESCRIPTION_TYPE);
1643 elm_object_item_data_set(g->propsview_toolbar_prop_it, (void *) (intptr_t) PROPERTY_TYPE);
1644 elm_object_item_data_set(g->propsview_toolbar_cb_it, (void *) (intptr_t) CALLBACK_TYPE);
1645 elm_object_item_data_set(g->propsview_toolbar_cont_it, (void *) (intptr_t) CONTENT_TYPE);
1646
1611 evas_object_smart_callback_add(prop_list, "expand,request", _expand_request_cb, NULL); 1647 evas_object_smart_callback_add(prop_list, "expand,request", _expand_request_cb, NULL);
1612 evas_object_smart_callback_add(prop_list, "contract,request", _contract_request_cb, NULL); 1648 evas_object_smart_callback_add(prop_list, "contract,request", _contract_request_cb, NULL);
1613 evas_object_smart_callback_add(prop_list, "expanded", _props_expanded_cb, NULL); 1649 evas_object_smart_callback_add(prop_list, "expanded", _props_expanded_cb, NULL);
1614 evas_object_smart_callback_add(prop_list, "contracted", _props_contracted_cb, NULL); 1650 evas_object_smart_callback_add(prop_list, "contracted", _props_contracted_cb, NULL);
1615 1651
1616
1617 eo_do(g->propsview_filter_entry, 1652 eo_do(g->propsview_filter_entry,
1618 eo_event_callback_add(ELM_ENTRY_EVENT_CHANGED_USER, 1653 eo_event_callback_add(ELM_ENTRY_EVENT_CHANGED_USER,
1619 _propview_filter_entry_changed_cb, 1654 _propview_filter_entry_changed_cb,
@@ -1628,6 +1663,8 @@ propview_init()
1628 1663
1629 desc_list = g->description_list; 1664 desc_list = g->description_list;
1630 1665
1666 ctn_list = g->contentview_list;
1667
1631 _mempool_cache_init(); 1668 _mempool_cache_init();
1632 expanded_classes = eina_hash_string_superfast_new(NULL); 1669 expanded_classes = eina_hash_string_superfast_new(NULL);
1633} 1670}
@@ -1645,17 +1682,18 @@ propview_shutdown()
1645 _itc_cb = NULL; 1682 _itc_cb = NULL;
1646 elm_genlist_item_class_free(_itc_desc); 1683 elm_genlist_item_class_free(_itc_desc);
1647 _itc_desc = NULL; 1684 _itc_desc = NULL;
1685 elm_genlist_item_class_free(_itc_ctn);
1686 _itc_ctn = NULL;
1648 1687
1649 eo_do(sc_box, elm_obj_box_clear());
1650 eo_do(prop_list, elm_obj_genlist_clear()); 1688 eo_do(prop_list, elm_obj_genlist_clear());
1651 eo_do(cb_list, elm_obj_genlist_clear()); 1689 eo_do(cb_list, elm_obj_genlist_clear());
1652 eo_do(desc_list, elm_obj_genlist_clear()); 1690 eo_do(desc_list, elm_obj_genlist_clear());
1691 eo_do(ctn_list, elm_obj_genlist_clear());
1692
1693 prop_list = cb_list = desc_list = ctn_list = NULL;
1653 1694
1654 _mempool_cache_free(); 1695 _mempool_cache_free();
1655 1696
1656 if (op_item_table) eina_hash_free(op_item_table); 1697 if (op_item_table) eina_hash_free(op_item_table);
1657 eina_hash_free(expanded_classes); 1698 eina_hash_free(expanded_classes);
1658
1659 sc_box = NULL;
1660 prop_list = NULL;
1661} 1699}
diff --git a/src/bin/egui_gui/propview_data.h b/src/bin/egui_gui/propview_data.h
index 0ebb8ac..3b9915a 100644
--- a/src/bin/egui_gui/propview_data.h
+++ b/src/bin/egui_gui/propview_data.h
@@ -17,7 +17,6 @@
17 { \ 17 { \
18 _it->wdg = (Gui_Widget *)(wi); \ 18 _it->wdg = (Gui_Widget *)(wi); \
19 }\ 19 }\
20 _it->refs = 1; \
21 _it; \ 20 _it; \
22 }) 21 })
23 22
@@ -60,7 +59,6 @@ typedef struct
60 char *desc; 59 char *desc;
61 60
62 }; 61 };
63 unsigned int refs;
64 Eo *box; 62 Eo *box;
65} It_Data; 63} It_Data;
66 64
@@ -80,7 +78,4 @@ typedef struct
80void 78void
81_it_data_free(void *data); 79_it_data_free(void *data);
82 80
83void
84_pfd_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
85
86#endif 81#endif
diff --git a/src/lib/gui_parser.c b/src/lib/gui_parser.c
index 00fc8be..8f40819 100644
--- a/src/lib/gui_parser.c
+++ b/src/lib/gui_parser.c
@@ -483,9 +483,9 @@ _widget_parse(Gui_Context *gui_ctx, Dep_Id *dep_id, Eina_Json_Value *widget_js)
483 tmp = EINA_JSON_OBJECT_VALUE_GET(widget_js, "Contains"); 483 tmp = EINA_JSON_OBJECT_VALUE_GET(widget_js, "Contains");
484 if (tmp) 484 if (tmp)
485 { 485 {
486 if (wdg_is_container(wdg, DB_DEF_BOX_CLASS)) 486 if (wdg_is_container(wdg, DB_DEF_BOX_CLASS) || wdg_is_container(wdg, DB_DEF_WIN_CLASS))
487 { 487 {
488 const Op_Desc *op_desc = db_container_desc_op_desc_get(db_container_desc_get(DB_DEF_BOX_CLASS), CONTAINER_PACK); 488 const Op_Desc *op_desc = db_container_desc_op_desc_get(db_container_desc_get(wdg_class_name_get(wdg)), CONTAINER_PACK);
489 if (!op_desc) 489 if (!op_desc)
490 { 490 {
491 ERR("Cannot find op description: CONTAINER_PACK for class: \"%s\"\n", class_name); 491 ERR("Cannot find op description: CONTAINER_PACK for class: \"%s\"\n", class_name);
diff --git a/src/lib/json_generator.c b/src/lib/json_generator.c
index 024679f..a434163 100644
--- a/src/lib/json_generator.c
+++ b/src/lib/json_generator.c
@@ -326,7 +326,8 @@ _widget_json_generate(Gui_Widget *wdg)
326 if (IS_CONTAINER(wdg)) 326 if (IS_CONTAINER(wdg))
327 { 327 {
328 if (wdg_obj_container_class_name_get(wdg) && 328 if (wdg_obj_container_class_name_get(wdg) &&
329 !strcmp(wdg_obj_container_class_name_get(wdg), DB_DEF_BOX_CLASS)) 329 (!strcmp(wdg_obj_container_class_name_get(wdg), DB_DEF_BOX_CLASS) ||
330 !strcmp(wdg_obj_container_class_name_get(wdg), DB_DEF_WIN_CLASS)))
330 { 331 {
331 const Eina_List *items_lst = wdg_obj_container_contents_list_get(wdg); 332 const Eina_List *items_lst = wdg_obj_container_contents_list_get(wdg);
332 Eina_Json_Value *arr = NULL; 333 Eina_Json_Value *arr = NULL;