summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-05-29 17:15:27 +0300
committerYakov Goldberg <yakov.g@samsung.com>2014-05-29 17:45:46 +0300
commit7a3e3182ff5edcab801715f2d4df959de1558a92 (patch)
tree5e37baf1513764cb86f42d4bd0c3f7828a132c0d
parentb2f5dc1a68e01929a987ff5cb6a2140f0ca02fcc (diff)
add comments and cleanup
-rw-r--r--src/bin/egui_gui/rmview.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/bin/egui_gui/rmview.c b/src/bin/egui_gui/rmview.c
index cfe6318..a97b984 100644
--- a/src/bin/egui_gui/rmview.c
+++ b/src/bin/egui_gui/rmview.c
@@ -19,7 +19,8 @@
19#define EVAS_CALLBACK_STR "EVAS_CALLBACK" 19#define EVAS_CALLBACK_STR "EVAS_CALLBACK"
20#define EVAS_SMART_CALLBACK_STR "EVAS_SMART_CALLBACK" 20#define EVAS_SMART_CALLBACK_STR "EVAS_SMART_CALLBACK"
21 21
22/* currently selected toolbar */ 22static GUI *g;
23/* currently selected toolbar item */
23static Rmview_Resource_Type _rmview_toolbar_selected_type = RMVIEW_NOT_SELECTED; 24static Rmview_Resource_Type _rmview_toolbar_selected_type = RMVIEW_NOT_SELECTED;
24 25
25static void 26static void
@@ -64,8 +65,7 @@ _field_data_free(void *_data)
64 free(data); 65 free(data);
65} 66}
66 67
67static GUI *g; 68/* Helper func to create label */
68
69static Eo* 69static Eo*
70_rmview_label_add(Eo *parent, const char* str) 70_rmview_label_add(Eo *parent, const char* str)
71{ 71{
@@ -81,6 +81,7 @@ _rmview_label_add(Eo *parent, const char* str)
81 return label; 81 return label;
82} 82}
83 83
84/* Helper func to create entry */
84static Eo* 85static Eo*
85_rmview_entry_add(Eo *parent, const char* str) 86_rmview_entry_add(Eo *parent, const char* str)
86{ 87{
@@ -99,6 +100,7 @@ _rmview_entry_add(Eo *parent, const char* str)
99 return en; 100 return en;
100} 101}
101 102
103/* Helper func to create fileselector entry */
102static Eo* 104static Eo*
103_rmview_fs_entry_add(Eo *parent, const char* str) 105_rmview_fs_entry_add(Eo *parent, const char* str)
104{ 106{
@@ -113,6 +115,7 @@ _rmview_fs_entry_add(Eo *parent, const char* str)
113 return en; 115 return en;
114} 116}
115 117
118/* Helper func to create button */
116static Eo* 119static Eo*
117_rmview_button_add(Eo *parent, const char* str) 120_rmview_button_add(Eo *parent, const char* str)
118{ 121{
@@ -125,6 +128,7 @@ _rmview_button_add(Eo *parent, const char* str)
125 return bt; 128 return bt;
126} 129}
127 130
131/* Helper func to create checkbox */
128static Eo * 132static Eo *
129_rmview_check_add(Eo *parent, Eina_Bool state) 133_rmview_check_add(Eo *parent, Eina_Bool state)
130{ 134{
@@ -214,6 +218,7 @@ _res_changed(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc E
214 return EO_CALLBACK_CONTINUE; 218 return EO_CALLBACK_CONTINUE;
215} 219}
216 220
221/* callback on sve_button 'clicked' event */
217static Eina_Bool 222static Eina_Bool
218_bt_save_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 223_bt_save_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
219{ 224{
@@ -276,10 +281,10 @@ _bt_save_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *de
276 if (status) 281 if (status)
277 eo_do(obj, elm_obj_widget_disabled_set(EINA_TRUE)); 282 eo_do(obj, elm_obj_widget_disabled_set(EINA_TRUE));
278 283
279
280 return EO_CALLBACK_CONTINUE; 284 return EO_CALLBACK_CONTINUE;
281} 285}
282 286
287/* callback on del_button 'clicked' event */
283static Eina_Bool 288static Eina_Bool
284_bt_del_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 289_bt_del_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
285{ 290{
@@ -392,6 +397,7 @@ _rmview_build(Rmview_Resource_Type type)
392 397
393 switch (res_type) 398 switch (res_type)
394 { 399 {
400 /* Add fields specific to CALLBACKs */
395 case RESOURCE_EO_CALLBACK: 401 case RESOURCE_EO_CALLBACK:
396 case RESOURCE_EVAS_CALLBACK: 402 case RESOURCE_EVAS_CALLBACK:
397 case RESOURCE_EVAS_SMART_CALLBACK: 403 case RESOURCE_EVAS_SMART_CALLBACK:
@@ -414,17 +420,9 @@ _rmview_build(Rmview_Resource_Type type)
414 eo_do(g->rm_table, elm_obj_table_pack(en, table_col++, table_line, 1, 1)); 420 eo_do(g->rm_table, elm_obj_table_pack(en, table_col++, table_line, 1, 1));
415 break; 421 break;
416 } 422 }
423 /* Add field (fileselector entry) specific to IMAGE */
417 case RESOURCE_IMAGE: 424 case RESOURCE_IMAGE:
418 { 425 {
419 /*
420 en = _rmview_entry_add(g->rm_table, value);
421 it_data->en2 = en;
422 eo_do(g->rm_table, elm_obj_table_pack(en, table_col++, table_line, 1, 1));
423 data = RMVIEW_FIELD_DATA_BUILD(1, it_data);
424 eo_do(en, eo_key_data_set(_STR_RMVIEW, data, _field_data_free));
425 eo_do(en, eo_event_callback_add(ELM_ENTRY_EVENT_CHANGED_USER, _res_changed, NULL));
426 */
427
428 en = _rmview_fs_entry_add(g->rm_table, "..."); 426 en = _rmview_fs_entry_add(g->rm_table, "...");
429 eo_do(en, elm_interface_fileselector_path_set(value)); 427 eo_do(en, elm_interface_fileselector_path_set(value));
430 428
@@ -435,6 +433,7 @@ _rmview_build(Rmview_Resource_Type type)
435 eo_do(en, eo_event_callback_add(ELM_FILESELECTOR_ENTRY_EVENT_CHANGED, _res_changed, NULL)); 433 eo_do(en, eo_event_callback_add(ELM_FILESELECTOR_ENTRY_EVENT_CHANGED, _res_changed, NULL));
436 break; 434 break;
437 } 435 }
436 /* Add field (checkbox) specific to SEQUENCE */
438 case RESOURCE_SEQUENCE: 437 case RESOURCE_SEQUENCE:
439 { 438 {
440 Dep_Id seq_id = gui_context_dep_data_get_id_by_name(ctx, res_name); 439 Dep_Id seq_id = gui_context_dep_data_get_id_by_name(ctx, res_name);
@@ -449,6 +448,7 @@ _rmview_build(Rmview_Resource_Type type)
449 eo_do(ck, eo_event_callback_add(ELM_CHECK_EVENT_CHANGED, _res_changed, NULL)); 448 eo_do(ck, eo_event_callback_add(ELM_CHECK_EVENT_CHANGED, _res_changed, NULL));
450 break; 449 break;
451 } 450 }
451 /* Add field (entry) specific to STRING */
452 case RESOURCE_STRING: 452 case RESOURCE_STRING:
453 { 453 {
454 en = _rmview_entry_add(g->rm_table, value); 454 en = _rmview_entry_add(g->rm_table, value);
@@ -541,6 +541,7 @@ _rm_win_request_delete(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Eve
541 return EO_CALLBACK_CONTINUE; 541 return EO_CALLBACK_CONTINUE;
542} 542}
543 543
544/* Callback called, when toolbar item is clicked */
544static void 545static void
545_rmview_toolbar_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 546_rmview_toolbar_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
546{ 547{
@@ -553,7 +554,7 @@ _rmview_toolbar_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_in
553 _rmview_build(type); 554 _rmview_build(type);
554} 555}
555 556
556/* "Add Resource" button "clicked" callback." */ 557/* "Add Resource" button's "clicked" callback." */
557Eina_Bool 558Eina_Bool
558_rm_add_button_clicked(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 559_rm_add_button_clicked(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
559{ 560{
@@ -665,6 +666,7 @@ _rm_add_button_clicked(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Eve
665 return EO_CALLBACK_CONTINUE; 666 return EO_CALLBACK_CONTINUE;
666} 667}
667 668
669/* CALLBACK TYPE hoversel's 'selected' callback. */
668static Eina_Bool 670static Eina_Bool
669_rm_cb_type_hoversel_selected(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) 671_rm_cb_type_hoversel_selected(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info)
670{ 672{