summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-10-26 17:05:33 +0200
committerYakov Goldberg <yakov.g@samsung.com>2014-10-27 14:02:35 +0200
commitf13169620cda7b17ce0a61e5f9b929e78f624a21 (patch)
tree9f7d37f12fef509502290d4020ae186079c4481b
parentc23ee857a5a83bb7d3d5ca400882a078381895fc (diff)
Continue split Propview files
-rw-r--r--src/bin/egui_gui/cbview.c2
-rw-r--r--src/bin/egui_gui/contentview.c20
-rw-r--r--src/bin/egui_gui/contentview.h15
-rw-r--r--src/bin/egui_gui/editor.c14
-rw-r--r--src/bin/egui_gui/itemview.c8
-rw-r--r--src/bin/egui_gui/itemview.h2
-rw-r--r--src/bin/egui_gui/prop_layout.c16
-rw-r--r--src/bin/egui_gui/prop_layout.h10
-rw-r--r--src/bin/egui_gui/propview.c11
-rw-r--r--src/bin/egui_gui/propview.h12
-rw-r--r--src/bin/egui_gui/propview_data.h12
11 files changed, 75 insertions, 47 deletions
diff --git a/src/bin/egui_gui/cbview.c b/src/bin/egui_gui/cbview.c
index 8e8fe10..d9b6cf6 100644
--- a/src/bin/egui_gui/cbview.c
+++ b/src/bin/egui_gui/cbview.c
@@ -11,6 +11,8 @@
11 11
12#include "elm_widget_container.h" 12#include "elm_widget_container.h"
13 13
14#define CACHE_CALLBACKS "CALLBACKS"
15
14static Elm_Genlist_Item_Class *_itc_cb = NULL; 16static Elm_Genlist_Item_Class *_itc_cb = NULL;
15 17
16extern Elm_Genlist_Item_Class *_itc_class; 18extern Elm_Genlist_Item_Class *_itc_class;
diff --git a/src/bin/egui_gui/contentview.c b/src/bin/egui_gui/contentview.c
index 97ea326..d57e21d 100644
--- a/src/bin/egui_gui/contentview.c
+++ b/src/bin/egui_gui/contentview.c
@@ -14,7 +14,14 @@ static Elm_Genlist_Item_Class *_itc_ctn = NULL;
14 14
15static Eo *ctn_list = NULL; 15static Eo *ctn_list = NULL;
16 16
17extern PropViewCbs *_view_cbs; 17static ContentViewCbs *_contentview_cbs = NULL;
18
19ContentViewCbs *
20contentview_cbs_get()
21{
22 if (!_contentview_cbs) _contentview_cbs = calloc(1, sizeof(*_contentview_cbs));
23 return _contentview_cbs;
24}
18 25
19static Evas_Object * 26static Evas_Object *
20_content_item_content_get(It_Data *it_data) 27_content_item_content_get(It_Data *it_data)
@@ -52,13 +59,13 @@ _content_item_content_get(It_Data *it_data)
52 if (eo_isa(obj, ELM_HOVERSEL_CLASS)) 59 if (eo_isa(obj, ELM_HOVERSEL_CLASS))
53 { 60 {
54 eo_do(obj, eo_event_callback_add(EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, 61 eo_do(obj, eo_event_callback_add(EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED,
55 _view_cbs->content_change_cb_func, NULL)); 62 _contentview_cbs->content_change_cb_func, NULL));
56 eo_do(obj, evas_obj_size_hint_weight_set(0, EVAS_HINT_EXPAND), 63 eo_do(obj, evas_obj_size_hint_weight_set(0, EVAS_HINT_EXPAND),
57 evas_obj_size_hint_align_set(0, EVAS_HINT_FILL)); 64 evas_obj_size_hint_align_set(0, EVAS_HINT_FILL));
58 } 65 }
59 else 66 else
60 { 67 {
61 eo_do(obj, eo_event_callback_add(ELM_ENTRY_EVENT_ACTIVATED, _view_cbs->content_change_cb_func, NULL)); 68 eo_do(obj, eo_event_callback_add(ELM_ENTRY_EVENT_ACTIVATED, _contentview_cbs->content_change_cb_func, NULL));
62 } 69 }
63 } 70 }
64 else 71 else
@@ -160,7 +167,7 @@ _contentview_del_btn_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Des
160 if (it_data) prev_prop = it_data->prop; 167 if (it_data) prev_prop = it_data->prop;
161 } 168 }
162 169
163 Eina_Bool ret = _view_cbs->content_delete_cb_func((void *)idx, obj, desc, event_info); 170 Eina_Bool ret = _contentview_cbs->content_delete_cb_func((void *)idx, obj, desc, event_info);
164 if (prev_prop) _content_select_item(prev_prop); 171 if (prev_prop) _content_select_item(prev_prop);
165 172
166 return ret; 173 return ret;
@@ -176,7 +183,7 @@ _contentview_up_btn_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Desc
176 const Gui_Widget_Property *prev_prop = it_data->prop; 183 const Gui_Widget_Property *prev_prop = it_data->prop;
177 intptr_t idx = it_data->idx; 184 intptr_t idx = it_data->idx;
178 185
179 Eina_Bool ret = _view_cbs->content_reorder_cb_func((void *)idx, obj, desc, (void *)(intptr_t)UP); 186 Eina_Bool ret = _contentview_cbs->content_reorder_cb_func((void *)idx, obj, desc, (void *)(intptr_t)UP);
180 _content_select_item(prev_prop); 187 _content_select_item(prev_prop);
181 188
182 return ret; 189 return ret;
@@ -192,7 +199,7 @@ _contentview_down_btn_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_De
192 const Gui_Widget_Property *prev_prop = it_data->prop; 199 const Gui_Widget_Property *prev_prop = it_data->prop;
193 intptr_t idx = it_data->idx; 200 intptr_t idx = it_data->idx;
194 201
195 Eina_Bool ret = _view_cbs->content_reorder_cb_func((void *)idx, obj, desc, (void *)(intptr_t)DOWN); 202 Eina_Bool ret = _contentview_cbs->content_reorder_cb_func((void *)idx, obj, desc, (void *)(intptr_t)DOWN);
196 _content_select_item(prev_prop); 203 _content_select_item(prev_prop);
197 204
198 return ret; 205 return ret;
@@ -261,6 +268,7 @@ contentview_shutdown(void)
261 elm_genlist_item_class_free(_itc_ctn); 268 elm_genlist_item_class_free(_itc_ctn);
262 _itc_ctn = NULL; 269 _itc_ctn = NULL;
263 270
271 free(_contentview_cbs);
264 eo_do(ctn_list, elm_obj_genlist_clear()); 272 eo_do(ctn_list, elm_obj_genlist_clear());
265 ctn_list = NULL; 273 ctn_list = NULL;
266} 274}
diff --git a/src/bin/egui_gui/contentview.h b/src/bin/egui_gui/contentview.h
index cbd8662..82cb343 100644
--- a/src/bin/egui_gui/contentview.h
+++ b/src/bin/egui_gui/contentview.h
@@ -2,6 +2,16 @@
2#ifndef _CONTENTVIEW_H 2#ifndef _CONTENTVIEW_H
3#define _CONTENTVIEW_H 3#define _CONTENTVIEW_H
4 4
5#include <Eo.h>
6#include "gui_widget.h"
7
8typedef struct
9{
10 Eina_Bool (*content_delete_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
11 Eina_Bool (*content_reorder_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
12 Eina_Bool (*content_change_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
13} ContentViewCbs;
14
5void 15void
6contentview_init(void); 16contentview_init(void);
7 17
@@ -11,4 +21,7 @@ contentview_build(const Gui_Widget *wdg);
11void 21void
12contentview_shutdown(void); 22contentview_shutdown(void);
13 23
14#endif \ No newline at end of file 24ContentViewCbs *
25contentview_cbs_get();
26
27#endif
diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index 1c5ae13..6983684 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -5,8 +5,13 @@
5#include "gui_widget.h" 5#include "gui_widget.h"
6#include "props_helper.h" 6#include "props_helper.h"
7#include "objtree.h" 7#include "objtree.h"
8
8#include "prop_layout.h" 9#include "prop_layout.h"
10#include "contentview.h"
9#include "itemview.h" 11#include "itemview.h"
12#include "propview.h"
13#include "cbview.h"
14
10#include "gui_parser.h" 15#include "gui_parser.h"
11#include "egui_logic_private.h" 16#include "egui_logic_private.h"
12 17
@@ -2786,9 +2791,11 @@ editor_init(GuiLogicCbs *_guilogic_cbs)
2786 prop_cbs->property_update_cb_func = _prop_update_from_propview; 2791 prop_cbs->property_update_cb_func = _prop_update_from_propview;
2787 prop_cbs->property_delete_cb_func = _prop_del_from_propview; 2792 prop_cbs->property_delete_cb_func = _prop_del_from_propview;
2788 prop_cbs->property_ctx_menu_cb_func = _prop_ctx_menu_cb_func; 2793 prop_cbs->property_ctx_menu_cb_func = _prop_ctx_menu_cb_func;
2789 prop_cbs->content_delete_cb_func = _content_del_from_propview; 2794
2790 prop_cbs->content_reorder_cb_func = _content_reorder_from_propview; 2795 ContentViewCbs *content_cbs = contentview_cbs_get();
2791 prop_cbs->content_change_cb_func = _content_change_from_propview; 2796 content_cbs->content_delete_cb_func = _content_del_from_propview;
2797 content_cbs->content_reorder_cb_func = _content_reorder_from_propview;
2798 content_cbs->content_change_cb_func = _content_change_from_propview;
2792 2799
2793 ObjTreeViewCbs *objtree_cbs = objtree_cbs_get(); 2800 ObjTreeViewCbs *objtree_cbs = objtree_cbs_get();
2794 objtree_cbs->item_selection_cb_func = _widget_selected_from_objtree; 2801 objtree_cbs->item_selection_cb_func = _widget_selected_from_objtree;
@@ -2812,7 +2819,6 @@ editor_init(GuiLogicCbs *_guilogic_cbs)
2812 objtree_list_set(g->main_win->objtree_list); 2819 objtree_list_set(g->main_win->objtree_list);
2813 proplayout_init(); 2820 proplayout_init();
2814 seqview_init(g->main_win->seq_list); 2821 seqview_init(g->main_win->seq_list);
2815 itemview_init(g->main_win->itemview_list);
2816 target_db_init(); 2822 target_db_init();
2817 ecore_idle_enterer_add(_wdg_border_draw_on_idle, NULL); 2823 ecore_idle_enterer_add(_wdg_border_draw_on_idle, NULL);
2818} 2824}
diff --git a/src/bin/egui_gui/itemview.c b/src/bin/egui_gui/itemview.c
index 0a6d1d1..669da6b 100644
--- a/src/bin/egui_gui/itemview.c
+++ b/src/bin/egui_gui/itemview.c
@@ -6,6 +6,7 @@
6#include "props_helper.h" 6#include "props_helper.h"
7#include "propview_data.h" 7#include "propview_data.h"
8#include "itemview.h" 8#include "itemview.h"
9#include "egui_logic_private.h"
9 10
10#include "elm_widget.h" 11#include "elm_widget.h"
11 12
@@ -183,9 +184,11 @@ _item_del_cb(void *data, Eo *obj EINA_UNUSED)
183} 184}
184 185
185void 186void
186itemview_init(Eo *list) 187itemview_init()
187{ 188{
188 lst = list; 189 Egui_Layout_Widgets *g = egui_layout_gui_get();
190
191 lst = g->main_win->itemview_list;
189 192
190 if (!_item_itc) 193 if (!_item_itc)
191 { 194 {
@@ -210,6 +213,7 @@ itemview_shutdown()
210 elm_genlist_item_class_free(_item_itc); 213 elm_genlist_item_class_free(_item_itc);
211 _item_itc = NULL; 214 _item_itc = NULL;
212 } 215 }
216 free(_view_cbs);
213} 217}
214 218
215void 219void
diff --git a/src/bin/egui_gui/itemview.h b/src/bin/egui_gui/itemview.h
index 67eae34..36d6eff 100644
--- a/src/bin/egui_gui/itemview.h
+++ b/src/bin/egui_gui/itemview.h
@@ -21,7 +21,7 @@ enum
21}; 21};
22 22
23void 23void
24itemview_init(Eo *list); 24itemview_init();
25 25
26void 26void
27itemview_shutdown(); 27itemview_shutdown();
diff --git a/src/bin/egui_gui/prop_layout.c b/src/bin/egui_gui/prop_layout.c
index 761e605..687b456 100644
--- a/src/bin/egui_gui/prop_layout.c
+++ b/src/bin/egui_gui/prop_layout.c
@@ -4,7 +4,13 @@
4#include "egui_log.h" 4#include "egui_log.h"
5#include "props_helper.h" 5#include "props_helper.h"
6#include "egui_logic_private.h" 6#include "egui_logic_private.h"
7
8#include "propview.h"
9#include "contentview.h"
10#include "descview.h"
11#include "cbview.h"
7#include "prop_layout.h" 12#include "prop_layout.h"
13#include "itemview.h"
8 14
9#include "elm_widget_container.h" 15#include "elm_widget_container.h"
10 16
@@ -14,7 +20,6 @@ Elm_Genlist_Item_Class *_itc_notfound = NULL;
14extern Gui_Context * 20extern Gui_Context *
15_active_context_get(); 21_active_context_get();
16 22
17PropViewCbs *_view_cbs = NULL;
18static It_Data_Type _proplayout_toolbar_selected_item_type = DESCRIPTION_TYPE; 23static It_Data_Type _proplayout_toolbar_selected_item_type = DESCRIPTION_TYPE;
19static It_Data_Type _new_type = DESCRIPTION_TYPE; 24static It_Data_Type _new_type = DESCRIPTION_TYPE;
20 25
@@ -38,12 +43,6 @@ _it_data_free(void *data)
38 it_data = NULL; 43 it_data = NULL;
39} 44}
40 45
41PropViewCbs *propview_cbs_get()
42{
43 if (!_view_cbs) _view_cbs = calloc(1, sizeof(*_view_cbs));
44 return _view_cbs;
45}
46
47static char * 46static char *
48_class_item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 47_class_item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
49{ 48{
@@ -301,6 +300,7 @@ proplayout_init()
301 descview_init(); 300 descview_init();
302 contentview_init(); 301 contentview_init();
303 propview_init(); 302 propview_init();
303 itemview_init();
304 304
305 /* Put it here, because it Enums defined in propsview.h */ 305 /* Put it here, because it Enums defined in propsview.h */
306 elm_object_item_data_set(g->main_win->propsview_toolbar_desc_it, (void *) (intptr_t) DESCRIPTION_TYPE); 306 elm_object_item_data_set(g->main_win->propsview_toolbar_desc_it, (void *) (intptr_t) DESCRIPTION_TYPE);
@@ -330,4 +330,4 @@ proplayout_shutdown()
330 propview_shutdown(); 330 propview_shutdown();
331 331
332 _mempool_cache_free(); 332 _mempool_cache_free();
333} \ No newline at end of file 333}
diff --git a/src/bin/egui_gui/prop_layout.h b/src/bin/egui_gui/prop_layout.h
index 1886b7a..2034b3c 100644
--- a/src/bin/egui_gui/prop_layout.h
+++ b/src/bin/egui_gui/prop_layout.h
@@ -3,19 +3,9 @@
3#define _PROPLAYOUT_H 3#define _PROPLAYOUT_H
4 4
5#include <Eo.h> 5#include <Eo.h>
6#include <Evas.h>
7
8#include "propview.h"
9#include "itemview.h"
10#include "cbview.h"
11#include "descview.h"
12#include "contentview.h"
13 6
14#include "propview_data.h" 7#include "propview_data.h"
15 8
16PropViewCbs *
17propview_cbs_get();
18
19void 9void
20proplayout_init(); 10proplayout_init();
21 11
diff --git a/src/bin/egui_gui/propview.c b/src/bin/egui_gui/propview.c
index ee593f4..9ed80dc 100644
--- a/src/bin/egui_gui/propview.c
+++ b/src/bin/egui_gui/propview.c
@@ -24,7 +24,13 @@ static Eina_Hash *op_item_table = NULL;
24/* Hash table to keep the list of expanded classes */ 24/* Hash table to keep the list of expanded classes */
25static Eina_Hash *expanded_classes = NULL; 25static Eina_Hash *expanded_classes = NULL;
26 26
27extern PropViewCbs *_view_cbs; 27static PropViewCbs *_view_cbs = NULL;
28
29PropViewCbs *propview_cbs_get()
30{
31 if (!_view_cbs) _view_cbs = calloc(1, sizeof(*_view_cbs));
32 return _view_cbs;
33}
28 34
29static Eina_Bool 35static Eina_Bool
30_default_hover_selected_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 36_default_hover_selected_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
@@ -437,6 +443,7 @@ propview_shutdown()
437 eo_do(prop_list, elm_obj_genlist_clear()); 443 eo_do(prop_list, elm_obj_genlist_clear());
438 prop_list = NULL; 444 prop_list = NULL;
439 445
446 free(_view_cbs);
440 eina_hash_free(op_item_table); 447 eina_hash_free(op_item_table);
441 eina_hash_free(expanded_classes); 448 eina_hash_free(expanded_classes);
442} \ No newline at end of file 449}
diff --git a/src/bin/egui_gui/propview.h b/src/bin/egui_gui/propview.h
index 5c2cae0..4d9a8ac 100644
--- a/src/bin/egui_gui/propview.h
+++ b/src/bin/egui_gui/propview.h
@@ -3,11 +3,19 @@
3#define _PROPVIEW_H 3#define _PROPVIEW_H
4 4
5#include <Eo.h> 5#include <Eo.h>
6#include <Evas.h>
7#include "propview_data.h"
8 6
9#define CONTAINER_REORDER_BUTTON_DIR "container_reorder_button_dir" 7#define CONTAINER_REORDER_BUTTON_DIR "container_reorder_button_dir"
10 8
9typedef struct
10{
11 Eina_Bool (*property_update_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
12 Eina_Bool (*property_delete_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
13 Eina_Bool (*property_ctx_menu_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
14} PropViewCbs;
15
16PropViewCbs *
17propview_cbs_get();
18
11void 19void
12propview_init(); 20propview_init();
13 21
diff --git a/src/bin/egui_gui/propview_data.h b/src/bin/egui_gui/propview_data.h
index 33bac83..23a20ee 100644
--- a/src/bin/egui_gui/propview_data.h
+++ b/src/bin/egui_gui/propview_data.h
@@ -2,6 +2,7 @@
2#ifndef _PROPVIEW_DATA_H 2#ifndef _PROPVIEW_DATA_H
3#define _PROPVIEW_DATA_H 3#define _PROPVIEW_DATA_H
4 4
5#include <Eo.h>
5#include "gui_widget.h" 6#include "gui_widget.h"
6 7
7/* pass Gui_Widget or Item_Container_Item */ 8/* pass Gui_Widget or Item_Container_Item */
@@ -20,19 +21,8 @@
20 _it; \ 21 _it; \
21 }) 22 })
22 23
23#define CACHE_CALLBACKS "CALLBACKS"
24#define _STR_EDITOR "editor" 24#define _STR_EDITOR "editor"
25 25
26typedef struct
27{
28 Eina_Bool (*property_update_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
29 Eina_Bool (*property_delete_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
30 Eina_Bool (*property_ctx_menu_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
31 Eina_Bool (*content_delete_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
32 Eina_Bool (*content_reorder_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
33 Eina_Bool (*content_change_cb_func)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info);
34} PropViewCbs;
35
36typedef enum 26typedef enum
37{ 27{
38 DESCRIPTION_TYPE, // description view 28 DESCRIPTION_TYPE, // description view