summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-12-23 09:42:26 +0200
committerYakov Goldberg <yakov.g@samsung.com>2014-12-23 10:13:29 +0200
commit4c96ac8e23ab41db58916382a4a11744343b250c (patch)
tree608d06be4787c38fd18c63e8e96c9719f6fa4713 /src/bin
parent19c5228acad35257376fd7431f39a8c795e08d53 (diff)
Gui_Widget cleaning.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/egui_gui/cbview.c14
-rw-r--r--src/bin/egui_gui/editor.c78
-rw-r--r--src/bin/egui_gui/egui_logic.c6
-rw-r--r--src/bin/egui_gui/itemview.c13
-rw-r--r--src/bin/egui_gui/props_helper.c4
-rw-r--r--src/bin/egui_gui/rmview.c11
6 files changed, 58 insertions, 68 deletions
diff --git a/src/bin/egui_gui/cbview.c b/src/bin/egui_gui/cbview.c
index 246c897..6542546 100644
--- a/src/bin/egui_gui/cbview.c
+++ b/src/bin/egui_gui/cbview.c
@@ -122,7 +122,7 @@ _action_wdg_selected(void *data, Eo *obj EINA_UNUSED, void *event_info)
122 gui_context_memento_add(ctx, memento); 122 gui_context_memento_add(ctx, memento);
123 123
124 const char *wdg_name = elm_object_item_part_text_get(event_info, NULL); 124 const char *wdg_name = elm_object_item_part_text_get(event_info, NULL);
125 Dep_Id *wdg_id = gui_context_dep_id_by_name_get(ctx, wdg_name); 125 Dep_Id *wdg_id = gui_context_dep_id_get_by_name(ctx, wdg_name);
126 126
127 Action_Type act_type = action_type_get(new_action); 127 Action_Type act_type = action_type_get(new_action);
128 128
@@ -152,7 +152,7 @@ _action_parent_selected(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Descript
152 gui_context_memento_add(ctx, memento); 152 gui_context_memento_add(ctx, memento);
153 153
154 const char *parent_name = elm_object_item_part_text_get(event_info, NULL); 154 const char *parent_name = elm_object_item_part_text_get(event_info, NULL);
155 Dep_Id *parent_id = gui_context_dep_id_by_name_get(ctx, parent_name); 155 Dep_Id *parent_id = gui_context_dep_id_get_by_name(ctx, parent_name);
156 action_creation_set(new_action, action_widget_id_get(new_action), parent_id); 156 action_creation_set(new_action, action_widget_id_get(new_action), parent_id);
157 } 157 }
158 158
@@ -179,7 +179,7 @@ _action_user_cb_selected(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Descrip
179 gui_context_memento_add(ctx, memento); 179 gui_context_memento_add(ctx, memento);
180 180
181 const char *cb_name = elm_object_item_part_text_get(event_info, NULL); 181 const char *cb_name = elm_object_item_part_text_get(event_info, NULL);
182 Dep_Id *cb_id = gui_context_dep_id_by_name_get(ctx, cb_name); 182 Dep_Id *cb_id = gui_context_dep_id_get_by_name(ctx, cb_name);
183 action_user_set(new_action, cb_id, NULL); 183 action_user_set(new_action, cb_id, NULL);
184 } 184 }
185 185
@@ -265,7 +265,7 @@ _action_item_selected(void *data, Eo *obj, const Eo_Event_Description *desc EINA
265 const char *new_item_name = elm_object_item_part_text_get(event_info, NULL); 265 const char *new_item_name = elm_object_item_part_text_get(event_info, NULL);
266 /* Set selected string on hover */ 266 /* Set selected string on hover */
267 elm_object_text_set(obj, new_item_name); 267 elm_object_text_set(obj, new_item_name);
268 Dep_Id *new_name_id = gui_context_dep_id_by_name_get(ctx, new_item_name); 268 Dep_Id *new_name_id = gui_context_dep_id_get_by_name(ctx, new_item_name);
269 gui_value_name_id_set(val, GUI_TYPE_OBJECT_ITEM, new_name_id); 269 gui_value_name_id_set(val, GUI_TYPE_OBJECT_ITEM, new_name_id);
270 270
271 Dep_Id *wdg_id = action_widget_id_get(action); 271 Dep_Id *wdg_id = action_widget_id_get(action);
@@ -358,7 +358,7 @@ _action_prop_update(void *data, Eo *obj, void *event_info)
358 else if (type == GUI_TYPE_OBJECT) 358 else if (type == GUI_TYPE_OBJECT)
359 { 359 {
360 Dep_Id *dep_id = DEP_ID_GET(val); 360 Dep_Id *dep_id = DEP_ID_GET(val);
361 Dep_Id *new_name_id = gui_context_dep_id_by_name_get(ctx, new_enum_value); 361 Dep_Id *new_name_id = gui_context_dep_id_get_by_name(ctx, new_enum_value);
362 Gui_Widget *cur_param_wdg = dep_id?wdg_get(dep_id):NULL; 362 Gui_Widget *cur_param_wdg = dep_id?wdg_get(dep_id):NULL;
363 Gui_Widget *new_param_wdg = new_name_id?wdg_get(new_name_id):NULL; 363 Gui_Widget *new_param_wdg = new_name_id?wdg_get(new_name_id):NULL;
364 /* GUI_TYPE_OBJECT ops depend on other widgets, check that widget exists. 364 /* GUI_TYPE_OBJECT ops depend on other widgets, check that widget exists.
@@ -380,7 +380,7 @@ _action_prop_update(void *data, Eo *obj, void *event_info)
380 } 380 }
381 else 381 else
382 { 382 {
383 Dep_Id *new_id = gui_context_dep_id_by_name_get(_active_context_get(), new_enum_value); 383 Dep_Id *new_id = gui_context_dep_id_get_by_name(_active_context_get(), new_enum_value);
384 gui_value_name_id_set(val, type, new_id); 384 gui_value_name_id_set(val, type, new_id);
385 } 385 }
386 } 386 }
@@ -418,7 +418,7 @@ _callbacks_classname_table_expand(const Gui_Widget *wdg, const char *classname,
418 Dep_Id *dep_id; 418 Dep_Id *dep_id;
419 EINA_LIST_FOREACH(wgdcbs, l, dep_id) 419 EINA_LIST_FOREACH(wgdcbs, l, dep_id)
420 { 420 {
421 cb = cb_get(dep_id); 421 cb = cb_get_from_id(dep_id);
422 if (!strcmp(event_name, cb_type_get(cb))) 422 if (!strcmp(event_name, cb_type_get(cb)))
423 { 423 {
424 Dep_Id *act_id = cb_action_id_get(cb); 424 Dep_Id *act_id = cb_action_id_get(cb);
diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index 2989aad..dd10705 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -126,7 +126,7 @@ Eina_Bool
126widget_name_change(Gui_Widget *wdg, const char *str) 126widget_name_change(Gui_Widget *wdg, const char *str)
127{ 127{
128 const Gui_Context *ctx = wdg_context_get(wdg); 128 const Gui_Context *ctx = wdg_context_get(wdg);
129 if (!gui_context_dep_data_update(ctx, wdg_dep_id_get(wdg), str)) 129 if (!dep_rename(wdg_dep_id_get(wdg), str))
130 { 130 {
131 ERR("Name \"%s\" already exists!", str); 131 ERR("Name \"%s\" already exists!", str);
132 return EINA_FALSE; 132 return EINA_FALSE;
@@ -1147,7 +1147,7 @@ _widget_prop_add(Gui_Session *session, const Gui_Widget *wdg, const Gui_Widget_P
1147 { 1147 {
1148 Gui_Value *v = prop_value_nth_get(prop, 0); 1148 Gui_Value *v = prop_value_nth_get(prop, 0);
1149 Dep_Id *res_id = DEP_ID_GET(v); 1149 Dep_Id *res_id = DEP_ID_GET(v);
1150 Gui_Resource *res = (Gui_Resource *)gui_context_resource_get(res_id); 1150 Gui_Resource *res = (Gui_Resource *)resource_get_from_id(res_id);
1151 if (resource_type_get(res) == RESOURCE_EDJE) 1151 if (resource_type_get(res) == RESOURCE_EDJE)
1152 { 1152 {
1153 const char *edc_file = resource_edc_path_get(res); 1153 const char *edc_file = resource_edc_path_get(res);
@@ -1207,7 +1207,7 @@ _widget_prop_add(Gui_Session *session, const Gui_Widget *wdg, const Gui_Widget_P
1207 { 1207 {
1208 Gui_Value *v = prop_value_nth_get(prop, 0); 1208 Gui_Value *v = prop_value_nth_get(prop, 0);
1209 Dep_Id *res_id = DEP_ID_GET(v); 1209 Dep_Id *res_id = DEP_ID_GET(v);
1210 const Gui_Resource *res = gui_context_resource_get(res_id); 1210 const Gui_Resource *res = resource_get_from_id(res_id);
1211 if (resource_type_get(res) == RESOURCE_EDJE) 1211 if (resource_type_get(res) == RESOURCE_EDJE)
1212 { 1212 {
1213 v = prop_value_nth_get(prop, 1); 1213 v = prop_value_nth_get(prop, 1);
@@ -1293,7 +1293,7 @@ _widget_item_add(Gui_Session *session, const Gui_Widget *wdg, const Item_Contain
1293 Dep_Id *dep_id_itr; 1293 Dep_Id *dep_id_itr;
1294 EINA_LIST_FOREACH(item_container_item_subitems_get(wit), itr, dep_id_itr) 1294 EINA_LIST_FOREACH(item_container_item_subitems_get(wit), itr, dep_id_itr)
1295 { 1295 {
1296 Item_Container_Item *witr = item_container_item_get(dep_id_itr); 1296 Item_Container_Item *witr = item_container_item_get_from_id(dep_id_itr);
1297 manager_widget_items_add(session, wdg, witr, MODE_EDITOR, data); 1297 manager_widget_items_add(session, wdg, witr, MODE_EDITOR, data);
1298 } 1298 }
1299 return EINA_TRUE; 1299 return EINA_TRUE;
@@ -2463,7 +2463,7 @@ _wdg_parent_win_reload(const Gui_Widget *wdg)
2463} 2463}
2464 2464
2465static void 2465static void
2466_update_widget_on_undoredo(const Gui_Context *ctx, Dep_Id *wdg_id, Eina_Bool state) 2466_update_widget_on_undoredo(Dep_Id *wdg_id, Eina_Bool state)
2467{ 2467{
2468 const Gui_Widget *parent; /* We need the parent to reload the win */ 2468 const Gui_Widget *parent; /* We need the parent to reload the win */
2469 Gui_Widget *wdg = wdg_get(wdg_id); 2469 Gui_Widget *wdg = wdg_get(wdg_id);
@@ -2472,7 +2472,7 @@ _update_widget_on_undoredo(const Gui_Context *ctx, Dep_Id *wdg_id, Eina_Bool sta
2472 parent = (Gui_Widget *) wdg_parent_get(wdg); 2472 parent = (Gui_Widget *) wdg_parent_get(wdg);
2473 _editor_widget_clear(wdg); 2473 _editor_widget_clear(wdg);
2474 } 2474 }
2475 gui_context_dep_data_active_set(ctx, wdg_id, state); 2475 dep_active_set(wdg_id, state);
2476 2476
2477 wdg = wdg_get(wdg_id); 2477 wdg = wdg_get(wdg_id);
2478 if (wdg) parent = wdg_main_wdg_get(wdg); 2478 if (wdg) parent = wdg_main_wdg_get(wdg);
@@ -2582,8 +2582,7 @@ _editor_undo(const Gui_Context *ctx)
2582 2582
2583 old_it = gui_memento_old_pointer_get(memento); 2583 old_it = gui_memento_old_pointer_get(memento);
2584 2584
2585 Dep_Data *dep_data = gui_context_dep_data_get(item_container_item_dep_id_get(old_it)); 2585 item_container_item_set_on_id(item_container_item_dep_id_get(old_it), old_it);
2586 dep_data_item_set(dep_data, old_it);
2587 break; 2586 break;
2588 } 2587 }
2589 case MEMENTO_CALLBACK: 2588 case MEMENTO_CALLBACK:
@@ -2601,8 +2600,7 @@ _editor_undo(const Gui_Context *ctx)
2601 old_cb = gui_memento_old_pointer_get(memento); 2600 old_cb = gui_memento_old_pointer_get(memento);
2602 Dep_Id *cb_dep_id = cb_dep_id_get(old_cb); 2601 Dep_Id *cb_dep_id = cb_dep_id_get(old_cb);
2603 2602
2604 Dep_Data *dep_data = gui_context_dep_data_get(cb_dep_id); 2603 cb_set_on_id(cb_dep_id, old_cb);
2605 dep_data_cb_set(dep_data, old_cb);
2606 2604
2607 proplayout_view_switch(CALLBACK_TYPE); 2605 proplayout_view_switch(CALLBACK_TYPE);
2608 _editor_wdg_selected_set(wdg); 2606 _editor_wdg_selected_set(wdg);
@@ -2629,7 +2627,7 @@ _editor_undo(const Gui_Context *ctx)
2629 { 2627 {
2630 Dep_Id *wdg_id = gui_memento_wdg_get(memento); 2628 Dep_Id *wdg_id = gui_memento_wdg_get(memento);
2631 Eina_Bool old_state = (intptr_t) gui_memento_old_pointer_get(memento); 2629 Eina_Bool old_state = (intptr_t) gui_memento_old_pointer_get(memento);
2632 _update_widget_on_undoredo(ctx, wdg_id, old_state); 2630 _update_widget_on_undoredo(wdg_id, old_state);
2633 break; 2631 break;
2634 } 2632 }
2635 case MEMENTO_WIDGET_PARENT: 2633 case MEMENTO_WIDGET_PARENT:
@@ -2765,8 +2763,7 @@ _editor_redo(const Gui_Context *ctx)
2765 new_cb = gui_memento_new_pointer_get(memento); 2763 new_cb = gui_memento_new_pointer_get(memento);
2766 Dep_Id *cb_dep_id = cb_dep_id_get(new_cb); 2764 Dep_Id *cb_dep_id = cb_dep_id_get(new_cb);
2767 2765
2768 Dep_Data *dep_data = gui_context_dep_data_get(cb_dep_id); 2766 cb_set_on_id(cb_dep_id, new_cb);
2769 dep_data_cb_set(dep_data, new_cb);
2770 2767
2771 proplayout_view_switch(CALLBACK_TYPE); 2768 proplayout_view_switch(CALLBACK_TYPE);
2772 _editor_wdg_selected_set(wdg); 2769 _editor_wdg_selected_set(wdg);
@@ -2824,15 +2821,14 @@ _editor_redo(const Gui_Context *ctx)
2824 2821
2825 new_it = gui_memento_new_pointer_get(memento); 2822 new_it = gui_memento_new_pointer_get(memento);
2826 2823
2827 Dep_Data *dep_data = gui_context_dep_data_get(item_container_item_dep_id_get(new_it)); 2824 item_container_item_set_on_id(item_container_item_dep_id_get(new_it), new_it);
2828 dep_data_item_set(dep_data, new_it);
2829 break; 2825 break;
2830 } 2826 }
2831 case MEMENTO_WIDGET: 2827 case MEMENTO_WIDGET:
2832 { 2828 {
2833 Dep_Id *wdg_id = gui_memento_wdg_get(memento); 2829 Dep_Id *wdg_id = gui_memento_wdg_get(memento);
2834 Eina_Bool new_state = (intptr_t) gui_memento_new_pointer_get(memento); 2830 Eina_Bool new_state = (intptr_t) gui_memento_new_pointer_get(memento);
2835 _update_widget_on_undoredo(ctx, wdg_id, new_state); 2831 _update_widget_on_undoredo(wdg_id, new_state);
2836 break; 2832 break;
2837 } 2833 }
2838 case MEMENTO_WIDGET_PARENT: 2834 case MEMENTO_WIDGET_PARENT:
@@ -2994,7 +2990,7 @@ _editor_selected_wdg_del_cb()
2994 _editor_wdg_selected_set(NULL); 2990 _editor_wdg_selected_set(NULL);
2995 _editor_widget_clear(wdg); 2991 _editor_widget_clear(wdg);
2996 2992
2997 gui_context_dep_data_active_set(ctx, wdg_dep_id_get(wdg), EINA_FALSE); 2993 dep_active_set(wdg_dep_id_get(wdg), EINA_FALSE);
2998 Gui_Memento *memento; 2994 Gui_Memento *memento;
2999 memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_WIDGET, (void *) (intptr_t) EINA_TRUE, (void *) (intptr_t) EINA_FALSE); 2995 memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_WIDGET, (void *) (intptr_t) EINA_TRUE, (void *) (intptr_t) EINA_FALSE);
3000 gui_context_memento_add((Gui_Context *) ctx, memento); 2996 gui_context_memento_add((Gui_Context *) ctx, memento);
@@ -3023,7 +3019,7 @@ _editor_factory_wdg_create(const char *class_name, const Gui_Widget *focused_wdg
3023 const Gui_Widget *parent_win = NULL; 3019 const Gui_Widget *parent_win = NULL;
3024 const char *parent_name = NULL; 3020 const char *parent_name = NULL;
3025 Gui_Widget *wdg; 3021 Gui_Widget *wdg;
3026 const Gui_Context *ctx = _active_context_get(); 3022 Gui_Context *ctx = _active_context_get();
3027 Gui_Session *session = (Gui_Session *) gui_context_editor_session_get(ctx); 3023 Gui_Session *session = (Gui_Session *) gui_context_editor_session_get(ctx);
3028 3024
3029 if (!ctx) 3025 if (!ctx)
@@ -3034,8 +3030,8 @@ _editor_factory_wdg_create(const char *class_name, const Gui_Widget *focused_wdg
3034 3030
3035 char *new_name = gui_context_free_name_get(ctx, class_name); 3031 char *new_name = gui_context_free_name_get(ctx, class_name);
3036 3032
3037 Dep_Id *dep_id = gui_context_dep_data_set(ctx, new_name, DEP_TYPE_WIDGET); 3033 Dep_Id *dep_id = dep_new(ctx, new_name, DEP_TYPE_WIDGET);
3038 wdg = wdg_new((Gui_Context *) ctx, class_name, dep_id); 3034 wdg = wdg_new(ctx, class_name, dep_id);
3039 free(new_name); 3035 free(new_name);
3040 3036
3041 /* If a widget is selected during creation */ 3037 /* If a widget is selected during creation */
@@ -3054,7 +3050,7 @@ _editor_factory_wdg_create(const char *class_name, const Gui_Widget *focused_wdg
3054 3050
3055 Gui_Memento *memento; 3051 Gui_Memento *memento;
3056 memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_WIDGET, (void *) (intptr_t) EINA_FALSE, (void *) (intptr_t) EINA_TRUE); 3052 memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_WIDGET, (void *) (intptr_t) EINA_FALSE, (void *) (intptr_t) EINA_TRUE);
3057 gui_context_memento_add((Gui_Context *) ctx, memento); 3053 gui_context_memento_add(ctx, memento);
3058 3054
3059 /*Add default visibility property*/ 3055 /*Add default visibility property*/
3060 Gui_Widget_Property *prop; 3056 Gui_Widget_Property *prop;
@@ -3116,7 +3112,7 @@ _editor_factory_wdg_create(const char *class_name, const Gui_Widget *focused_wdg
3116 { 3112 {
3117 char menu_name[20] = {'\0'}; 3113 char menu_name[20] = {'\0'};
3118 sprintf(menu_name, "%s_%s", wdg_name_get(wdg), "main_menu"); 3114 sprintf(menu_name, "%s_%s", wdg_name_get(wdg), "main_menu");
3119 dep_id = gui_context_dep_data_set(ctx, menu_name, DEP_TYPE_WIDGET); 3115 dep_id = dep_new(ctx, menu_name, DEP_TYPE_WIDGET);
3120 3116
3121 Gui_Widget *mmenu = wdg_new((Gui_Context *) ctx, DB_DEF_MENU_CLASS, dep_id); 3117 Gui_Widget *mmenu = wdg_new((Gui_Context *) ctx, DB_DEF_MENU_CLASS, dep_id);
3122 wdg_parent_set(mmenu, wdg_name_get(wdg)); 3118 wdg_parent_set(mmenu, wdg_name_get(wdg));
@@ -3264,7 +3260,7 @@ _prop_update_from_propview(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Descr
3264 else if (type == GUI_TYPE_OBJECT) 3260 else if (type == GUI_TYPE_OBJECT)
3265 { 3261 {
3266 Dep_Id *old_dep_id = DEP_ID_GET(val); 3262 Dep_Id *old_dep_id = DEP_ID_GET(val);
3267 Dep_Id *new_dep_id = gui_context_dep_id_by_name_get(ctx, new_enum_value); 3263 Dep_Id *new_dep_id = gui_context_dep_id_get_by_name(ctx, new_enum_value);
3268 if (!new_dep_id) 3264 if (!new_dep_id)
3269 { 3265 {
3270 ERR("Resource not exist for: \"%s\"", new_enum_value); 3266 ERR("Resource not exist for: \"%s\"", new_enum_value);
@@ -3296,7 +3292,7 @@ _prop_update_from_propview(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Descr
3296 } 3292 }
3297 else 3293 else
3298 { 3294 {
3299 Dep_Id *new_id = gui_context_dep_id_by_name_get(ctx, new_enum_value); 3295 Dep_Id *new_id = gui_context_dep_id_get_by_name(ctx, new_enum_value);
3300 gui_context_dep_observer_add(new_id, _wdg_update, (void *)wdg); 3296 gui_context_dep_observer_add(new_id, _wdg_update, (void *)wdg);
3301 gui_value_name_id_set(val, type, new_id); 3297 gui_value_name_id_set(val, type, new_id);
3302 } 3298 }
@@ -3453,12 +3449,10 @@ _item_public_update_cb(void *data, Eo *obj, const Eo_Event_Description *desc EIN
3453 new_item = item_container_item_copy(item); 3449 new_item = item_container_item_copy(item);
3454 item_container_item_public_set(new_item, state); 3450 item_container_item_public_set(new_item, state);
3455 3451
3456 Dep_Data *dep_data = gui_context_dep_data_get(item_container_item_dep_id_get(item));
3457
3458 Gui_Memento *memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, item, new_item); 3452 Gui_Memento *memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, item, new_item);
3459 gui_context_memento_add((Gui_Context *) ctx, memento); 3453 gui_context_memento_add((Gui_Context *) ctx, memento);
3460 3454
3461 dep_data_item_set(dep_data, new_item); 3455 item_container_item_set_on_id(item_container_item_dep_id_get(item), new_item);
3462 return EO_CALLBACK_CONTINUE; 3456 return EO_CALLBACK_CONTINUE;
3463} 3457}
3464 3458
@@ -3496,12 +3490,12 @@ _field_update_from_itemview(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Desc
3496 item_container_item_prop_set(new_wit, new_prop); 3490 item_container_item_prop_set(new_wit, new_prop);
3497 3491
3498 /* Create memento. */ 3492 /* Create memento. */
3499 Dep_Data *dep_data = gui_context_dep_data_get(item_container_item_dep_id_get(wit));
3500 Gui_Memento *memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, (void *) wit, new_wit); 3493 Gui_Memento *memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, (void *) wit, new_wit);
3501 gui_context_memento_add((Gui_Context *) ctx, memento); 3494 gui_context_memento_add((Gui_Context *) ctx, memento);
3502 3495
3503 /* Change item in Dep_Data*/ 3496 /* Change item in Dep_Data*/
3504 dep_data_item_set(dep_data, new_wit); 3497
3498 item_container_item_set_on_id(item_container_item_dep_id_get(wit), new_wit);
3505 3499
3506 /* Get value which need to be changed.*/ 3500 /* Get value which need to be changed.*/
3507 val = prop_value_nth_get(new_prop, idx); 3501 val = prop_value_nth_get(new_prop, idx);
@@ -3541,7 +3535,7 @@ _field_update_from_itemview(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Desc
3541 } 3535 }
3542 else 3536 else
3543 { 3537 {
3544 Dep_Id *name_id = gui_context_dep_id_by_name_get(_active_ctx, new_value); 3538 Dep_Id *name_id = gui_context_dep_id_get_by_name(_active_ctx, new_value);
3545 gui_value_name_id_set(val, type, name_id); 3539 gui_value_name_id_set(val, type, name_id);
3546 if (type == GUI_TYPE_OBJECT) 3540 if (type == GUI_TYPE_OBJECT)
3547 { 3541 {
@@ -3554,7 +3548,7 @@ _field_update_from_itemview(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Desc
3554 { 3548 {
3555 if (type == GUI_TYPE_OBJECT) 3549 if (type == GUI_TYPE_OBJECT)
3556 { 3550 {
3557 Dep_Id *old_name_id = gui_context_dep_id_by_name_get(_active_ctx, old_value); 3551 Dep_Id *old_name_id = gui_context_dep_id_get_by_name(_active_ctx, old_value);
3558 Gui_Widget *w = wdg_get(old_name_id); 3552 Gui_Widget *w = wdg_get(old_name_id);
3559 wdg_parent_set(w, wdg_name_get(wdg_main_wdg_get(wdg))); 3553 wdg_parent_set(w, wdg_name_get(wdg_main_wdg_get(wdg)));
3560 } 3554 }
@@ -3568,7 +3562,7 @@ static void
3568_itemview_item_selected(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 3562_itemview_item_selected(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
3569{ 3563{
3570 const Gui_Context *ctx = _active_context_get(); 3564 const Gui_Context *ctx = _active_context_get();
3571 Item_Container_Item *wit = item_container_item_get((Dep_Id *)elm_object_item_data_get(event_info)); 3565 Item_Container_Item *wit = item_container_item_get_from_id((Dep_Id *)elm_object_item_data_get(event_info));
3572 Gui_Session *session = (Gui_Session *) gui_context_editor_session_get(ctx); 3566 Gui_Session *session = (Gui_Session *) gui_context_editor_session_get(ctx);
3573 Elm_Object_Item *it = session_item_get(session, wit); 3567 Elm_Object_Item *it = session_item_get(session, wit);
3574 if (eo_isa(it, ELM_MENU_ITEM_CLASS)) 3568 if (eo_isa(it, ELM_MENU_ITEM_CLASS))
@@ -3594,7 +3588,7 @@ _itemview_item_do_(unsigned int type)
3594 Gui_Value *val = NULL; 3588 Gui_Value *val = NULL;
3595 3589
3596 Dep_Id *selected_item_id = itemview_item_selected_get(); 3590 Dep_Id *selected_item_id = itemview_item_selected_get();
3597 wit = item_container_item_get(selected_item_id); 3591 wit = item_container_item_get_from_id(selected_item_id);
3598 3592
3599 Item_Container_Item *it = NULL; 3593 Item_Container_Item *it = NULL;
3600 if ((type == ITEM_ADD) || (type == ITEM_ADD_NESTED) || (type == SEPARATOR_ADD)) 3594 if ((type == ITEM_ADD) || (type == ITEM_ADD_NESTED) || (type == SEPARATOR_ADD))
@@ -3620,12 +3614,11 @@ _itemview_item_do_(unsigned int type)
3620 3614
3621 /* create Id for new parent item. */ 3615 /* create Id for new parent item. */
3622 new_parent_item = item_container_item_copy(parent_it); 3616 new_parent_item = item_container_item_copy(parent_it);
3623 Dep_Data *dep_data = gui_context_dep_data_get(item_container_item_dep_id_get(parent_it));
3624 3617
3625 Gui_Memento *memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, parent_it, new_parent_item); 3618 Gui_Memento *memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, parent_it, new_parent_item);
3626 gui_context_memento_add((Gui_Context *) ctx, memento); 3619 gui_context_memento_add((Gui_Context *) ctx, memento);
3627 3620
3628 dep_data_item_set(dep_data, new_parent_item); 3621 item_container_item_set_on_id(item_container_item_dep_id_get(parent_it), new_parent_item);
3629 3622
3630 Op_Desc *op = (Op_Desc *) db_container_desc_op_desc_get(db_container_desc_get(wdg_class_name_get(wdg)), CONTAINER_PACK); 3623 Op_Desc *op = (Op_Desc *) db_container_desc_op_desc_get(db_container_desc_get(wdg_class_name_get(wdg)), CONTAINER_PACK);
3631 Gui_Widget_Property *prop = prop_create_for_op(op); 3624 Gui_Widget_Property *prop = prop_create_for_op(op);
@@ -3633,7 +3626,7 @@ _itemview_item_do_(unsigned int type)
3633 char str[NAME_MAX] = {'\0'}; 3626 char str[NAME_MAX] = {'\0'};
3634 sprintf(str, "%s_%s%d", wdg_name_get(wdg), "it", i); 3627 sprintf(str, "%s_%s%d", wdg_name_get(wdg), "it", i);
3635 /* Check that newly generated name is not used. */ 3628 /* Check that newly generated name is not used. */
3636 while (gui_context_dep_id_by_name_get(ctx, str)) 3629 while (gui_context_dep_id_get_by_name(ctx, str))
3637 { 3630 {
3638 i++; 3631 i++;
3639 sprintf(str, "%s_%s%d", wdg_name_get(wdg), "it", i); 3632 sprintf(str, "%s_%s%d", wdg_name_get(wdg), "it", i);
@@ -3641,12 +3634,12 @@ _itemview_item_do_(unsigned int type)
3641 3634
3642 if (type == SEPARATOR_ADD) 3635 if (type == SEPARATOR_ADD)
3643 { 3636 {
3644 it = item_container_item_new(ctx, ITEM_SEPARATOR, prop, str); 3637 it = item_container_item_new((Gui_Context *)ctx, ITEM_SEPARATOR, prop, str);
3645 sprintf(str, "%s", "Separator"); 3638 sprintf(str, "%s", "Separator");
3646 } 3639 }
3647 else 3640 else
3648 { 3641 {
3649 it = item_container_item_new(ctx, ITEM_REGULAR, prop, str); 3642 it = item_container_item_new((Gui_Context *)ctx, ITEM_REGULAR, prop, str);
3650 sprintf(str, "%s %d", "New Item", i); 3643 sprintf(str, "%s %d", "New Item", i);
3651 } 3644 }
3652 3645
@@ -3679,12 +3672,11 @@ _itemview_item_do_(unsigned int type)
3679 parent_it = (Item_Container_Item *) item_container_item_parent_item_get(wit); 3672 parent_it = (Item_Container_Item *) item_container_item_parent_item_get(wit);
3680 3673
3681 new_parent_item = item_container_item_copy(parent_it); 3674 new_parent_item = item_container_item_copy(parent_it);
3682 Dep_Data *dep_data = gui_context_dep_data_get(item_container_item_dep_id_get(parent_it));
3683 3675
3684 Gui_Memento *memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, parent_it, new_parent_item); 3676 Gui_Memento *memento = gui_memento_new(wdg_dep_id_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, parent_it, new_parent_item);
3685 gui_context_memento_add((Gui_Context *) ctx, memento); 3677 gui_context_memento_add((Gui_Context *) ctx, memento);
3686 3678
3687 dep_data_item_set(dep_data, new_parent_item); 3679 item_container_item_set_on_id(item_container_item_dep_id_get(parent_it), new_parent_item);
3688 } 3680 }
3689 3681
3690 /* Adding item to widget and parent item 3682 /* Adding item to widget and parent item
@@ -3951,7 +3943,7 @@ _content_change_from_propview(void *data EINA_UNUSED, Eo *obj, const Eo_Event_De
3951 if (kl == ELM_HOVERSEL_CLASS) 3943 if (kl == ELM_HOVERSEL_CLASS)
3952 { 3944 {
3953 const char *new_value = elm_object_item_part_text_get(event_info, NULL); 3945 const char *new_value = elm_object_item_part_text_get(event_info, NULL);
3954 Dep_Id *new_name_id = gui_context_dep_id_by_name_get(ctx, new_value); 3946 Dep_Id *new_name_id = gui_context_dep_id_get_by_name(ctx, new_value);
3955 eo_do(obj, elm_obj_widget_part_text_set(NULL, new_value)); 3947 eo_do(obj, elm_obj_widget_part_text_set(NULL, new_value));
3956 3948
3957 if (type == GUI_TYPE_ENUM) 3949 if (type == GUI_TYPE_ENUM)
@@ -4041,10 +4033,10 @@ _project_close(const Gui_Context *ctx)
4041 if (ctx) 4033 if (ctx)
4042 { 4034 {
4043 /* Get list of simulate sessions in progress. */ 4035 /* Get list of simulate sessions in progress. */
4044 Eina_List *simulate_sessions = gui_context_simulate_session_list_get(ctx); 4036 const Eina_List *simulate_sessions = gui_context_simulate_session_list_get(ctx);
4045 if (simulate_sessions) 4037 if (simulate_sessions)
4046 { 4038 {
4047 Eina_List *s_itr1, *s_itr2; 4039 const Eina_List *s_itr1, *s_itr2;
4048 Gui_Session *session; 4040 Gui_Session *session;
4049 /* Delete iterate sessions which are in progress. 4041 /* Delete iterate sessions which are in progress.
4050 * FOREACH_SAFE - because data is being deleted from this list during iterations. */ 4042 * FOREACH_SAFE - because data is being deleted from this list during iterations. */
diff --git a/src/bin/egui_gui/egui_logic.c b/src/bin/egui_gui/egui_logic.c
index 138295d..f480611 100644
--- a/src/bin/egui_gui/egui_logic.c
+++ b/src/bin/egui_gui/egui_logic.c
@@ -595,10 +595,10 @@ _graphviz_widget_build(Agraph_t *ag, const Gui_Widget *wdg)
595 agedge(ag, wdg_node, w_node, 0, 1); 595 agedge(ag, wdg_node, w_node, 0, 1);
596 } 596 }
597 597
598 Dep_Id *cb_dep_id; 598 Dep_Id *cb_id;
599 EINA_LIST_FOREACH(wdg_cb_list_get(wdg), itr, cb_dep_id) 599 EINA_LIST_FOREACH(wdg_cb_list_get(wdg), itr, cb_id)
600 { 600 {
601 Gui_Widget_Callback *cb = cb_get(cb_dep_id); 601 Gui_Widget_Callback *cb = cb_get_from_id(cb_id);
602 Dep_Id *action_id = cb_action_id_get(cb); 602 Dep_Id *action_id = cb_action_id_get(cb);
603 const Gui_Action *action = action_get(action_id); 603 const Gui_Action *action = action_get(action_id);
604 switch (action_type_get(action)) 604 switch (action_type_get(action))
diff --git a/src/bin/egui_gui/itemview.c b/src/bin/egui_gui/itemview.c
index e9a0b6f..cc79561 100644
--- a/src/bin/egui_gui/itemview.c
+++ b/src/bin/egui_gui/itemview.c
@@ -36,7 +36,7 @@ _item_list_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *par
36{ 36{
37 Eo *box = eo_add(ELM_BOX_CLASS, lst); 37 Eo *box = eo_add(ELM_BOX_CLASS, lst);
38 const Gui_Widget *wdg = _editor_wdg_selected_get(); 38 const Gui_Widget *wdg = _editor_wdg_selected_get();
39 Item_Container_Item *item = item_container_item_get((Dep_Id *)data); 39 Item_Container_Item *item = item_container_item_get_from_id((Dep_Id *)data);
40 40
41 eo_do(box, evas_obj_visibility_set(EINA_TRUE), 41 eo_do(box, evas_obj_visibility_set(EINA_TRUE),
42 elm_obj_box_horizontal_set(EINA_TRUE), 42 elm_obj_box_horizontal_set(EINA_TRUE),
@@ -136,14 +136,13 @@ _expanded_cb(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_inf
136 /* This is item being expanded. */ 136 /* This is item being expanded. */
137 Elm_Object_Item *glit = event_info; 137 Elm_Object_Item *glit = event_info;
138 138
139 Item_Container_Item *parent_item = item_container_item_get((Dep_Id *)elm_object_item_data_get(glit)); 139 Item_Container_Item *parent_item = item_container_item_get_from_id((Dep_Id *)elm_object_item_data_get(glit));
140 140
141 /* Adding child's items into objtree view. */ 141 /* Adding child's items into objtree view. */
142 Dep_Id *dep_id_itr; 142 Dep_Id *dep_id;
143 EINA_LIST_FOREACH(item_container_item_subitems_get(parent_item), itr, dep_id_itr) 143 EINA_LIST_FOREACH(item_container_item_subitems_get(parent_item), itr, dep_id)
144 { 144 {
145 Dep_Data *dep_data = gui_context_dep_data_get(dep_id_itr); 145 Item_Container_Item *wit = item_container_item_get_from_id(dep_id);
146 Item_Container_Item *wit = dep_data_item_get(dep_data);
147 146
148 Elm_Object_Item *nitem; 147 Elm_Object_Item *nitem;
149 Dep_Id *wit_id = item_container_item_dep_id_get(wit); 148 Dep_Id *wit_id = item_container_item_dep_id_get(wit);
@@ -218,7 +217,7 @@ itemview_build(const Gui_Widget *wdg)
218 Dep_Id *dep_id_itr; 217 Dep_Id *dep_id_itr;
219 EINA_LIST_FOREACH(item_container_item_subitems_get(root_it), itr, dep_id_itr) 218 EINA_LIST_FOREACH(item_container_item_subitems_get(root_it), itr, dep_id_itr)
220 { 219 {
221 Item_Container_Item *wit = item_container_item_get(dep_id_itr); 220 Item_Container_Item *wit = item_container_item_get_from_id(dep_id_itr);
222 Elm_Object_Item *glit; 221 Elm_Object_Item *glit;
223 Dep_Id *wit_id = item_container_item_dep_id_get(wit); 222 Dep_Id *wit_id = item_container_item_dep_id_get(wit);
224 glit = elm_genlist_item_append(lst, _item_itc, wit_id, NULL, 223 glit = elm_genlist_item_append(lst, _item_itc, wit_id, NULL,
diff --git a/src/bin/egui_gui/props_helper.c b/src/bin/egui_gui/props_helper.c
index e772432..c1433bc 100644
--- a/src/bin/egui_gui/props_helper.c
+++ b/src/bin/egui_gui/props_helper.c
@@ -349,7 +349,7 @@ props_hoversel_objects_add(Eo *box, Eo *hoversel, Eo *hover_parent, const char *
349 } 349 }
350 case DEP_TYPE_ITEM: 350 case DEP_TYPE_ITEM:
351 { 351 {
352 Item_Container_Item *item = item_container_item_get(wid); 352 Item_Container_Item *item = item_container_item_get_from_id(wid);
353 if (!item) continue; 353 if (!item) continue;
354 eo_do(hoversel, elm_obj_hoversel_item_add(dep_name_get(wid), NULL, ELM_ICON_NONE, NULL, NULL)); 354 eo_do(hoversel, elm_obj_hoversel_item_add(dep_name_get(wid), NULL, ELM_ICON_NONE, NULL, NULL));
355 break; 355 break;
@@ -421,7 +421,7 @@ props_hoversel_resources_add(Eo *box, Eo *hoversel, Eo *hover_parent, const char
421 res_lst = gui_context_resource_list_get(ctx, type); 421 res_lst = gui_context_resource_list_get(ctx, type);
422 EINA_LIST_FOREACH(res_lst, itr, res_id) 422 EINA_LIST_FOREACH(res_lst, itr, res_id)
423 { 423 {
424 const Gui_Resource *res = gui_context_resource_get(res_id); 424 const Gui_Resource *res = resource_get_from_id(res_id);
425 elm_hoversel_item_add(hoversel, resource_name_get(res), NULL, ELM_ICON_NONE, NULL, NULL); 425 elm_hoversel_item_add(hoversel, resource_name_get(res), NULL, ELM_ICON_NONE, NULL, NULL);
426 } 426 }
427 427
diff --git a/src/bin/egui_gui/rmview.c b/src/bin/egui_gui/rmview.c
index dd321e7..bdbaa0e 100644
--- a/src/bin/egui_gui/rmview.c
+++ b/src/bin/egui_gui/rmview.c
@@ -283,7 +283,7 @@ _bt_save_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *de
283 { 283 {
284 Dep_Id *dep_id = resource_dep_id_get(res); 284 Dep_Id *dep_id = resource_dep_id_get(res);
285 285
286 if (!gui_context_dep_data_update(resource_context_get(res), dep_id, str)) 286 if (!dep_rename(dep_id, str))
287 { 287 {
288 ERR("Resource \"%s\" already exists!", str); 288 ERR("Resource \"%s\" already exists!", str);
289 status = EINA_FALSE; 289 status = EINA_FALSE;
@@ -344,15 +344,14 @@ static Eina_Bool
344_bt_del_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 344_bt_del_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
345{ 345{
346 Rmview_Field_Data *f_data; 346 Rmview_Field_Data *f_data;
347 const Gui_Context *ctx = _active_context_get();
348 347
349 eo_do(obj, f_data = eo_key_data_get(_STR_RMVIEW)); 348 eo_do(obj, f_data = eo_key_data_get(_STR_RMVIEW));
350 349
351 Gui_Resource *res = f_data->it_data->res; 350 Gui_Resource *res = f_data->it_data->res;
352 Dep_Id *dep_id = resource_dep_id_get(res); 351 Dep_Id *dep_id = resource_dep_id_get(res);
353 352
354 gui_context_dep_del(ctx, dep_id); 353 dep_del(dep_id);
355 gui_context_resource_del(res); 354 resource_del(res);
356 _rmview_build(_rmview_toolbar_selected_type); 355 _rmview_build(_rmview_toolbar_selected_type);
357 356
358 return EO_CALLBACK_CONTINUE; 357 return EO_CALLBACK_CONTINUE;
@@ -424,7 +423,7 @@ _rmview_build(Rmview_Resource_Type type)
424 if (!lst) continue; 423 if (!lst) continue;
425 EINA_LIST_FOREACH(lst, itr, res_id) 424 EINA_LIST_FOREACH(lst, itr, res_id)
426 { 425 {
427 const Gui_Resource *res = gui_context_resource_get(res_id); 426 const Gui_Resource *res = resource_get_from_id(res_id);
428 table_col = 0; 427 table_col = 0;
429 const char *res_name, *value; 428 const char *res_name, *value;
430 Rmview_Field_Data *data; 429 Rmview_Field_Data *data;
@@ -637,7 +636,7 @@ _rm_add_button_clicked(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Eve
637 if (!strlen(alias_str)) 636 if (!strlen(alias_str))
638 return EO_CALLBACK_CONTINUE; 637 return EO_CALLBACK_CONTINUE;
639 638
640 if (gui_context_dep_id_by_name_get(ctx, alias_str)) 639 if (gui_context_dep_id_get_by_name(ctx, alias_str))
641 { 640 {
642 ERR("Resource \"%s\" already exists", alias_str); 641 ERR("Resource \"%s\" already exists", alias_str);
643 return EO_CALLBACK_CONTINUE; 642 return EO_CALLBACK_CONTINUE;