summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-23 15:34:04 +0300
committerYakov Goldberg <yakov.g@samsung.com>2014-10-02 15:13:06 +0300
commit773e5c1c1f1e4b7020c4a50c370fd3610894745c (patch)
treee0398d2ebeb861e1533251897f724c33e0d1fcee
parent5a57f4cb3557b14ca3f192104ca4b45d4265bfcb (diff)
Main Widgets: rename win_list
-rw-r--r--src/bin/egui_gui/editor.c10
-rw-r--r--src/bin/egui_gui/objtree.c2
-rw-r--r--src/lib/gui_widget.c32
-rw-r--r--src/lib/gui_widget.h4
4 files changed, 18 insertions, 30 deletions
diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index 3273efe..275d38b 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -97,13 +97,13 @@ static void
97_canvas_free_coords_get(const Gui_Context *ctx, Evas_Coord x_fix, Evas_Coord y_fix, Evas_Coord *x, Evas_Coord *y) 97_canvas_free_coords_get(const Gui_Context *ctx, Evas_Coord x_fix, Evas_Coord y_fix, Evas_Coord *x, Evas_Coord *y)
98{ 98{
99 Evas_Coord x0 = 340 + x_fix, y0 = 120 + y_fix, w0 = 1060, h0 = 900, retx, rety, ymax = 120; 99 Evas_Coord x0 = 340 + x_fix, y0 = 120 + y_fix, w0 = 1060, h0 = 900, retx, rety, ymax = 120;
100 Eina_List *win_list = gui_context_win_list_get(ctx); 100 Eina_List *main_widgets = gui_context_main_widgets_get(ctx);
101 Eina_List *itr; 101 Eina_List *itr;
102 Dep_Id *wdg_id; 102 Dep_Id *wdg_id;
103 retx = x0; 103 retx = x0;
104 rety = y0; 104 rety = y0;
105 105
106 EINA_LIST_FOREACH(win_list, itr, wdg_id) 106 EINA_LIST_FOREACH(main_widgets, itr, wdg_id)
107 { 107 {
108 Evas_Coord fx, fy, fw, fh; 108 Evas_Coord fx, fy, fw, fh;
109 Gui_Widget *wdg = wdg_get(wdg_id); 109 Gui_Widget *wdg = wdg_get(wdg_id);
@@ -1099,7 +1099,7 @@ _editor_layout_clear(const Gui_Context *ctx)
1099 Dep_Id *wdg_id; 1099 Dep_Id *wdg_id;
1100 1100
1101 /* in editor, we iterate only over windows which don't have parent. */ 1101 /* in editor, we iterate only over windows which don't have parent. */
1102 list = gui_context_win_list_get(ctx); 1102 list = gui_context_main_widgets_get(ctx);
1103 EINA_LIST_FOREACH_SAFE(list, itr, itr2, wdg_id) 1103 EINA_LIST_FOREACH_SAFE(list, itr, itr2, wdg_id)
1104 { 1104 {
1105 Gui_Widget *wdg = wdg_get(wdg_id); 1105 Gui_Widget *wdg = wdg_get(wdg_id);
@@ -1494,7 +1494,7 @@ _editor_ctx_call(const Gui_Context *ctx)
1494 Dep_Id *wdg_id; 1494 Dep_Id *wdg_id;
1495 1495
1496 /* in editor, we iterate only over windows which don't have parent. */ 1496 /* in editor, we iterate only over windows which don't have parent. */
1497 list = gui_context_win_list_get(ctx); 1497 list = gui_context_main_widgets_get(ctx);
1498 EINA_LIST_FOREACH(list, l, wdg_id) 1498 EINA_LIST_FOREACH(list, l, wdg_id)
1499 { 1499 {
1500 Gui_Widget *wdg = wdg_get(wdg_id); 1500 Gui_Widget *wdg = wdg_get(wdg_id);
@@ -2644,7 +2644,7 @@ _project_close(const Gui_Context *ctx)
2644 /* Iterate over windows and delete Win_Info */ 2644 /* Iterate over windows and delete Win_Info */
2645 Eina_List *list, *itr, *itr2; 2645 Eina_List *list, *itr, *itr2;
2646 Dep_Id *wdg_id; 2646 Dep_Id *wdg_id;
2647 list = gui_context_win_list_get(_active_ctx); 2647 list = gui_context_main_widgets_get(_active_ctx);
2648 EINA_LIST_FOREACH_SAFE(list, itr, itr2, wdg_id) 2648 EINA_LIST_FOREACH_SAFE(list, itr, itr2, wdg_id)
2649 { 2649 {
2650 Gui_Widget *wdg = wdg_get(wdg_id); 2650 Gui_Widget *wdg = wdg_get(wdg_id);
diff --git a/src/bin/egui_gui/objtree.c b/src/bin/egui_gui/objtree.c
index 48f076f..aca8a9a 100644
--- a/src/bin/egui_gui/objtree.c
+++ b/src/bin/egui_gui/objtree.c
@@ -76,7 +76,7 @@ _item_expand(Gui_Widget *wdg, Elm_Object_Item *parent)
76 /* if wdg == NULL, this is root item, so add items for windows; 76 /* if wdg == NULL, this is root item, so add items for windows;
77 * or add items for child widgets. */ 77 * or add items for child widgets. */
78 w_list = wdg ? wdg_children_list_get(wdg) : 78 w_list = wdg ? wdg_children_list_get(wdg) :
79 gui_context_win_list_get(active_ctx); 79 gui_context_main_widgets_get(active_ctx);
80 80
81 /* Addind child's items into objtree view. */ 81 /* Addind child's items into objtree view. */
82 EINA_LIST_FOREACH(w_list, l, wid) 82 EINA_LIST_FOREACH(w_list, l, wid)
diff --git a/src/lib/gui_widget.c b/src/lib/gui_widget.c
index dca6c05..b870838 100644
--- a/src/lib/gui_widget.c
+++ b/src/lib/gui_widget.c
@@ -131,7 +131,7 @@ struct _Gui_Context
131 131
132 Eina_List *seq_list; /* List of Dep_Ids */ 132 Eina_List *seq_list; /* List of Dep_Ids */
133 133
134 Eina_List *win_list; /* List of Dep_Ids */ 134 Eina_List *main_widgets; /* List of Dep_Ids */
135 Eina_List *res_arr[RESOURCE_SENTINEL]; /* List of Dep_Ids */ 135 Eina_List *res_arr[RESOURCE_SENTINEL]; /* List of Dep_Ids */
136 136
137 Eina_Stringshare *project_name; 137 Eina_Stringshare *project_name;
@@ -321,7 +321,7 @@ gui_context_new()
321 321
322 ctx->wdg_list = NULL; 322 ctx->wdg_list = NULL;
323 ctx->seq_list = NULL; 323 ctx->seq_list = NULL;
324 ctx->win_list = NULL; 324 ctx->main_widgets = NULL;
325 ctx->names_hash = eina_hash_string_superfast_new(NULL); 325 ctx->names_hash = eina_hash_string_superfast_new(NULL);
326 ctx->data = eina_hash_string_superfast_new(NULL); 326 ctx->data = eina_hash_string_superfast_new(NULL);
327#ifdef __LP64__ 327#ifdef __LP64__
@@ -413,18 +413,12 @@ gui_context_export_path_get(const Gui_Context *ctx)
413 return ctx->export_path; 413 return ctx->export_path;
414} 414}
415 415
416/* Get list of windows of context */ 416/* Get list of main widgets of context */
417Eina_List* 417Eina_List*
418gui_context_win_list_get(const Gui_Context *ctx) 418gui_context_main_widgets_get(const Gui_Context *ctx)
419{ 419{
420 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL); 420 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
421 return ctx->win_list; 421 return ctx->main_widgets;
422}
423
424void
425gui_context_win_list_set(Gui_Context *ctx, Eina_List *new_list)
426{
427 ctx->win_list = new_list;
428} 422}
429 423
430void 424void
@@ -478,7 +472,7 @@ gui_context_del(Gui_Context *ctx)
478 Gui_Resource_Type type_itr; 472 Gui_Resource_Type type_itr;
479 473
480 /* in editor, we iterate only over windows which don't have parent. */ 474 /* in editor, we iterate only over windows which don't have parent. */
481 lst = gui_context_win_list_get(ctx); 475 lst = gui_context_main_widgets_get(ctx);
482 EINA_LIST_FOREACH_SAFE(lst, itr1, itr2, wdg_id) 476 EINA_LIST_FOREACH_SAFE(lst, itr1, itr2, wdg_id)
483 { 477 {
484 Gui_Widget *wdg = wdg_get(wdg_id); 478 Gui_Widget *wdg = wdg_get(wdg_id);
@@ -518,7 +512,7 @@ gui_context_del(Gui_Context *ctx)
518 } 512 }
519 513
520 eina_list_free(ctx->wdg_list); 514 eina_list_free(ctx->wdg_list);
521 eina_list_free(ctx->win_list); 515 eina_list_free(ctx->main_widgets);
522 516
523 eina_hash_free(ctx->names_hash); 517 eina_hash_free(ctx->names_hash);
524 eina_hash_free(ctx->data); 518 eina_hash_free(ctx->data);
@@ -937,11 +931,6 @@ wdg_new(Gui_Context *ctx, const char *class_name, Dep_Id *name_id)
937 dep_data->wdg = wdg; 931 dep_data->wdg = wdg;
938 } 932 }
939 933
940 if (IS_WIN(wdg))
941 {
942 ctx->win_list = eina_list_append(ctx->win_list, name_id);
943 }
944
945 /* If widget is one of following classes, create root item*/ 934 /* If widget is one of following classes, create root item*/
946 if (!strcmp(wdg_class_name_get(wdg), DB_DEF_MENU_CLASS) || 935 if (!strcmp(wdg_class_name_get(wdg), DB_DEF_MENU_CLASS) ||
947 !strcmp(wdg_class_name_get(wdg), DB_DEF_DISKSELECTOR_CLASS) || 936 !strcmp(wdg_class_name_get(wdg), DB_DEF_DISKSELECTOR_CLASS) ||
@@ -990,11 +979,10 @@ wdg_del(Gui_Widget *wdg)
990 { 979 {
991 parent_wdg->children = eina_list_remove(parent_wdg->children, wdg->name_id); 980 parent_wdg->children = eina_list_remove(parent_wdg->children, wdg->name_id);
992 } 981 }
982 else ctx->main_widgets = eina_list_remove(ctx->main_widgets, wdg->name_id);
993 983
994 ctx->wdg_list = eina_list_remove(ctx->wdg_list, wdg->name_id); 984 ctx->wdg_list = eina_list_remove(ctx->wdg_list, wdg->name_id);
995 985
996 if (IS_WIN(wdg))
997 ctx->win_list = eina_list_remove(ctx->win_list, wdg->name_id);
998 986
999 char *str = wdg_data_get(wdg, CONSTRUCTOR); 987 char *str = wdg_data_get(wdg, CONSTRUCTOR);
1000 if (str) free(str); 988 if (str) free(str);
@@ -1385,7 +1373,7 @@ wdg_parent_set(Gui_Widget *wdg, const char *parent_name)
1385 old_parent->children = eina_list_remove(old_parent->children, wdg->name_id); 1373 old_parent->children = eina_list_remove(old_parent->children, wdg->name_id);
1386 } 1374 }
1387 else 1375 else
1388 ctx->win_list = eina_list_remove(ctx->win_list, wdg->name_id); /* Remove the object from the main objects */ 1376 ctx->main_widgets = eina_list_remove(ctx->main_widgets, wdg->name_id); /* Remove the object from the main objects */
1389 1377
1390 wdg->parent_id = new_parent_id; 1378 wdg->parent_id = new_parent_id;
1391 if (new_parent_id) 1379 if (new_parent_id)
@@ -1394,7 +1382,7 @@ wdg_parent_set(Gui_Widget *wdg, const char *parent_name)
1394 new_parent->children = eina_list_append(new_parent->children, wdg->name_id); 1382 new_parent->children = eina_list_append(new_parent->children, wdg->name_id);
1395 } 1383 }
1396 else 1384 else
1397 ctx->win_list = eina_list_append(ctx->win_list, wdg->name_id); /* Set the object as a main object */ 1385 ctx->main_widgets = eina_list_append(ctx->main_widgets, wdg->name_id); /* Set the object as a main object */
1398 1386
1399 return EINA_TRUE; 1387 return EINA_TRUE;
1400} 1388}
diff --git a/src/lib/gui_widget.h b/src/lib/gui_widget.h
index be9ae7a..640512f 100644
--- a/src/lib/gui_widget.h
+++ b/src/lib/gui_widget.h
@@ -117,9 +117,9 @@ gui_context_new();
117Eina_List* 117Eina_List*
118gui_context_wdg_list_get(const Gui_Context *ctx); 118gui_context_wdg_list_get(const Gui_Context *ctx);
119 119
120/* Get list of windows of context */ 120/* Get list of main widgets of context */
121Eina_List* 121Eina_List*
122gui_context_win_list_get(const Gui_Context *ctx); 122gui_context_main_widgets_get(const Gui_Context *ctx);
123 123
124/* Simulate all values for all properties and widgets of context*/ 124/* Simulate all values for all properties and widgets of context*/
125/* FIXME: implement proper closure of windows*/ 125/* FIXME: implement proper closure of windows*/