From 444b8401f41aa8203d256d6159f85a814f3e8386 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Tue, 17 Nov 2015 15:27:39 +0200 Subject: [PATCH] Modify widgets names for a better readability --- src/bin/clouseau_client.c | 24 +++++------ src/bin/gui | 26 ++++++----- src/bin/gui.c | 90 +++++++++++++++++++-------------------- src/bin/gui.h | 14 +++--- 4 files changed, 74 insertions(+), 80 deletions(-) diff --git a/src/bin/clouseau_client.c b/src/bin/clouseau_client.c index ea9009b..0fc026a 100644 --- a/src/bin/clouseau_client.c +++ b/src/bin/clouseau_client.c @@ -34,7 +34,7 @@ static uint32_t _elm_list_opcode = EINA_DEBUG_OPCODE_INVALID; static uint32_t _obj_info_opcode = EINA_DEBUG_OPCODE_INVALID; static uint32_t _obj_highlight_opcode = EINA_DEBUG_OPCODE_INVALID; -static Gui_Elm_Win1_Widgets *_main_widgets = NULL; +static Gui_Main_Win_Widgets *_main_widgets = NULL; static Gui_Profiles_Win_Widgets *_profiles_wdgs = NULL; typedef struct @@ -274,7 +274,7 @@ _debug_obj_info_cb(Eina_Debug_Client *src EINA_UNUSED, { if(_obj_info) { - elm_genlist_clear(_main_widgets->elm_genlist2); + elm_genlist_clear(_main_widgets->object_infos_list); eolian_debug_object_information_free(_obj_info); _obj_info = NULL; } @@ -291,7 +291,7 @@ _debug_obj_info_cb(Eina_Debug_Client *src EINA_UNUSED, node->data = kl; Elm_Object_Item *glg = elm_genlist_item_append( - _main_widgets->elm_genlist2, _obj_info_itc, + _main_widgets->object_infos_list, _obj_info_itc, (void *)node, NULL, type, NULL, NULL); @@ -332,7 +332,7 @@ _objs_sel_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i uint64_t ptr = (uint64_t)info_node->info->ptr; printf("Sending Eolian get request for Eo object[%p]\n", info_node->info->ptr); - elm_genlist_clear(_main_widgets->elm_genlist2); + elm_genlist_clear(_main_widgets->object_infos_list); eina_debug_session_send(_current_client, _obj_info_opcode, &ptr, sizeof(uint64_t)); eina_debug_session_send(_current_client, _obj_highlight_opcode, &ptr, sizeof(uint64_t)); } @@ -401,8 +401,8 @@ _hoversel_selected_app(void *data, { _objs_nodes_free(_objs_list_tree); _objs_list_tree = NULL; - elm_genlist_clear(_main_widgets->elm_genlist1); - elm_genlist_clear(_main_widgets->elm_genlist2); + elm_genlist_clear(_main_widgets->objects_list); + elm_genlist_clear(_main_widgets->object_infos_list); } if (_current_client) eina_debug_client_free(_current_client); @@ -426,7 +426,7 @@ _clients_info_added_cb(Eina_Debug_Client *src EINA_UNUSED, void *buffer, int siz { char option[100]; snprintf(option, 90, "%s [%d]", buf, pid); - elm_hoversel_item_add(_main_widgets->elm_hoversel1, + elm_hoversel_item_add(_main_widgets->apps_selector, option, "home", ELM_ICON_STANDARD, _hoversel_selected_app, (void *)(long)cid); } @@ -446,7 +446,7 @@ _clients_info_deleted_cb(Eina_Debug_Client *src EINA_UNUSED, void *buffer, int s int cid; EXTRACT(buf, &cid, sizeof(uint32_t)); - const Eina_List *items = elm_hoversel_items_get(_main_widgets->elm_hoversel1); + const Eina_List *items = elm_hoversel_items_get(_main_widgets->apps_selector); const Eina_List *l; Elm_Object_Item *hoversel_it; @@ -498,7 +498,7 @@ _elm_objects_list_cb(Eina_Debug_Client *src EINA_UNUSED, void *buffer, int size) EINA_LIST_FOREACH(_objs_list_tree, l, info_node) { Elm_Object_Item *glg = elm_genlist_item_append( - _main_widgets->elm_genlist1, _objs_itc, + _main_widgets->objects_list, _objs_itc, (void *)info_node, NULL, info_node->children ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE, _objs_sel_cb, NULL); @@ -639,7 +639,7 @@ static const Eina_Debug_Opcode ops[] = }; void -gui_elm_win1_create_done(Gui_Elm_Win1_Widgets *wdgs) +gui_main_win_create_done(Gui_Main_Win_Widgets *wdgs) { _main_widgets = wdgs; @@ -653,7 +653,7 @@ gui_elm_win1_create_done(Gui_Elm_Win1_Widgets *wdgs) _objs_itc->func.state_get = NULL; _objs_itc->func.del = NULL; } - eo_do(_main_widgets->elm_genlist1, + eo_do(_main_widgets->objects_list, eo_event_callback_add(ELM_GENLIST_EVENT_EXPAND_REQUEST, _objs_expand_request_cb, NULL), eo_event_callback_add(ELM_GENLIST_EVENT_CONTRACT_REQUEST, _objs_contract_request_cb, NULL), eo_event_callback_add(ELM_GENLIST_EVENT_EXPANDED, _objs_expanded_cb, NULL), @@ -670,7 +670,7 @@ gui_elm_win1_create_done(Gui_Elm_Win1_Widgets *wdgs) _obj_info_itc->func.state_get = NULL; _obj_info_itc->func.del = _obj_info_item_del; } - eo_do(_main_widgets->elm_genlist2, + eo_do(_main_widgets->object_infos_list, eo_event_callback_add(ELM_GENLIST_EVENT_EXPAND_REQUEST, _obj_info_expand_request_cb, NULL), eo_event_callback_add(ELM_GENLIST_EVENT_CONTRACT_REQUEST, _obj_info_contract_request_cb, NULL), eo_event_callback_add(ELM_GENLIST_EVENT_EXPANDED, _obj_info_expanded_cb, NULL), diff --git a/src/bin/gui b/src/bin/gui index fedcab6..596e8bf 100644 --- a/src/bin/gui +++ b/src/bin/gui @@ -14,7 +14,7 @@ }, "Widgets": { - "elm_win1": + "main_win": { "Desc": { @@ -37,7 +37,7 @@ { "Desc": { - "parent":"elm_win1", + "parent":"main_win", "class":"Elm.Bg" }, "Properties": @@ -51,9 +51,8 @@ { "Desc": { - "parent":"elm_win1", - "class":"Elm.Box", - "public":true + "parent":"main_win", + "class":"Elm.Box" }, "Properties": { @@ -64,9 +63,9 @@ "Elm.Box.padding":[0, 0], "Elm.Box.align":[0, 0] }, - "Contains":["elm_hoversel1", "elm_panes1"] + "Contains":["apps_selector", "elm_panes1"] }, - "elm_hoversel1": + "apps_selector": { "Desc": { @@ -91,8 +90,7 @@ "Desc": { "parent":"elm_box1", - "class":"Elm.Panes", - "public":true + "class":"Elm.Panes" }, "Properties": { @@ -105,11 +103,11 @@ }, "Contains": { - "elm_genlist1":["left"], - "elm_genlist2":["right"] + "objects_list":["left"], + "object_infos_list":["right"] } }, - "elm_genlist2": + "object_infos_list": { "Desc": { @@ -123,7 +121,7 @@ "Efl.Gfx.Base.visible":[true] } }, - "elm_genlist1": + "objects_list": { "Desc": { @@ -234,7 +232,7 @@ }, "Callbacks": { - "clicked":["Create", "elm_win1", null], + "clicked":["Create", "main_win", null], "clicked":["Invoke", "profile_close", null] } }, diff --git a/src/bin/gui.c b/src/bin/gui.c index b0c9c23..77e777d 100644 --- a/src/bin/gui.c +++ b/src/bin/gui.c @@ -15,7 +15,7 @@ static Gui_Widgets g_pub_widgets; -extern void gui_elm_win1_create_done(Gui_Elm_Win1_Widgets *wdgs); +extern void gui_main_win_create_done(Gui_Main_Win_Widgets *wdgs); extern Eina_Bool _profile_win_close_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info); @@ -27,72 +27,70 @@ _pubs_free_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc return EINA_TRUE; } -Gui_Elm_Win1_Widgets * -gui_elm_win1_create(Eo *__main_parent) +Gui_Main_Win_Widgets * +gui_main_win_create(Eo *__main_parent) { - Gui_Elm_Win1_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets)); + Gui_Main_Win_Widgets *pub_widgets = calloc(1, sizeof(*pub_widgets)); - Eo *elm_win1; + Eo *main_win; Eo *elm_bg1; Eo *elm_box1; - Eo *elm_hoversel1; + Eo *apps_selector; Eo *elm_panes1; - Eo *elm_genlist2; - Eo *elm_genlist1; + Eo *object_infos_list; + Eo *objects_list; - elm_win1 = eo_add(ELM_WIN_CLASS, __main_parent, elm_obj_win_type_set(ELM_WIN_BASIC)); - pub_widgets->elm_win1 = elm_win1; - eo_do(elm_win1, elm_obj_widget_part_text_set(NULL, "Window")); - eo_do(elm_win1, elm_obj_win_autodel_set(EINA_TRUE)); - eo_do(elm_win1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); - eo_do(elm_win1, efl_gfx_size_set(478, 484)); - elm_bg1 = eo_add(ELM_BG_CLASS, elm_win1); + main_win = eo_add(ELM_WIN_CLASS, __main_parent, elm_obj_win_type_set(ELM_WIN_BASIC)); + pub_widgets->main_win = main_win; + eo_do(main_win, elm_obj_widget_part_text_set(NULL, "Window")); + eo_do(main_win, elm_obj_win_autodel_set(EINA_TRUE)); + eo_do(main_win, evas_obj_size_hint_weight_set(1.000000, 1.000000)); + eo_do(main_win, efl_gfx_size_set(478, 484)); + elm_bg1 = eo_add(ELM_BG_CLASS, main_win); eo_do(elm_bg1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); eo_do(elm_bg1, efl_gfx_visible_set(EINA_TRUE)); eo_do(elm_bg1, efl_gfx_position_set(0, 0)); - elm_box1 = eo_add(ELM_BOX_CLASS, elm_win1); - pub_widgets->elm_box1 = elm_box1; + elm_box1 = eo_add(ELM_BOX_CLASS, main_win); eo_do(elm_box1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); eo_do(elm_box1, efl_gfx_visible_set(EINA_TRUE)); eo_do(elm_box1, efl_gfx_size_set(643, 598)); eo_do(elm_box1, efl_gfx_position_set(-7, -2)); eo_do(elm_box1, elm_obj_box_padding_set(0, 0)); eo_do(elm_box1, elm_obj_box_align_set(0.000000, 0.000000)); - eo_do(elm_win1, elm_obj_win_resize_object_add(elm_bg1)); - eo_do(elm_win1, elm_obj_win_resize_object_add(elm_box1)); - elm_hoversel1 = eo_add(ELM_HOVERSEL_CLASS, elm_box1); - pub_widgets->elm_hoversel1 = elm_hoversel1; - eo_do(elm_hoversel1, evas_obj_size_hint_weight_set(1.000000, 0.000000)); - eo_do(elm_hoversel1, evas_obj_size_hint_align_set(0.500000, 0.000000)); - eo_do(elm_hoversel1, efl_gfx_visible_set(EINA_TRUE)); - eo_do(elm_hoversel1, efl_gfx_size_set(1174, 643)); - eo_do(elm_hoversel1, efl_gfx_position_set(-8, -2)); - eo_do(elm_hoversel1, elm_obj_hoversel_horizontal_set(EINA_FALSE)); - eo_do(elm_hoversel1, elm_obj_hoversel_auto_update_set(EINA_TRUE)); - eo_do(elm_hoversel1, elm_obj_widget_part_text_set(NULL, "Select App")); + eo_do(main_win, elm_obj_win_resize_object_add(elm_bg1)); + eo_do(main_win, elm_obj_win_resize_object_add(elm_box1)); + apps_selector = eo_add(ELM_HOVERSEL_CLASS, elm_box1); + pub_widgets->apps_selector = apps_selector; + eo_do(apps_selector, evas_obj_size_hint_weight_set(1.000000, 0.000000)); + eo_do(apps_selector, evas_obj_size_hint_align_set(0.500000, 0.000000)); + eo_do(apps_selector, efl_gfx_visible_set(EINA_TRUE)); + eo_do(apps_selector, efl_gfx_size_set(1174, 643)); + eo_do(apps_selector, efl_gfx_position_set(-8, -2)); + eo_do(apps_selector, elm_obj_hoversel_horizontal_set(EINA_FALSE)); + eo_do(apps_selector, elm_obj_hoversel_auto_update_set(EINA_TRUE)); + eo_do(apps_selector, elm_obj_widget_part_text_set(NULL, "Select App")); elm_panes1 = eo_add(ELM_PANES_CLASS, elm_box1); - pub_widgets->elm_panes1 = elm_panes1; eo_do(elm_panes1, elm_obj_panes_content_right_size_set(0.600000)); eo_do(elm_panes1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); eo_do(elm_panes1, efl_gfx_size_set(75, 75)); eo_do(elm_panes1, efl_gfx_visible_set(EINA_TRUE)); eo_do(elm_panes1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); eo_do(elm_panes1, evas_obj_size_hint_align_set(-1.000000, -1.000000)); - eo_do(elm_box1, elm_obj_box_pack_end(elm_hoversel1)); + eo_do(elm_box1, elm_obj_box_pack_end(apps_selector)); eo_do(elm_box1, elm_obj_box_pack_end(elm_panes1)); - elm_genlist2 = eo_add(ELM_GENLIST_CLASS, elm_panes1); - pub_widgets->elm_genlist2 = elm_genlist2; - eo_do(elm_genlist2, evas_obj_size_hint_weight_set(1.000000, 1.000000)); - eo_do(elm_genlist2, efl_gfx_visible_set(EINA_TRUE)); - elm_genlist1 = eo_add(ELM_GENLIST_CLASS, elm_panes1); - pub_widgets->elm_genlist1 = elm_genlist1; - eo_do(elm_genlist1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); - eo_do(elm_genlist1, efl_gfx_visible_set(EINA_TRUE)); - eo_do(elm_panes1, elm_obj_container_content_set("left", elm_genlist1)); - eo_do(elm_panes1, elm_obj_container_content_set("right", elm_genlist2)); - eo_do(elm_win1, efl_gfx_visible_set(EINA_TRUE)); - eo_do(elm_win1, eo_event_callback_add(EO_BASE_EVENT_DEL, _pubs_free_cb, pub_widgets)); + object_infos_list = eo_add(ELM_GENLIST_CLASS, elm_panes1); + pub_widgets->object_infos_list = object_infos_list; + eo_do(object_infos_list, evas_obj_size_hint_weight_set(1.000000, 1.000000)); + eo_do(object_infos_list, efl_gfx_visible_set(EINA_TRUE)); + objects_list = eo_add(ELM_GENLIST_CLASS, elm_panes1); + pub_widgets->objects_list = objects_list; + eo_do(objects_list, evas_obj_size_hint_weight_set(1.000000, 1.000000)); + eo_do(objects_list, efl_gfx_visible_set(EINA_TRUE)); + eo_do(elm_panes1, elm_obj_container_content_set("left", objects_list)); + eo_do(elm_panes1, elm_obj_container_content_set("right", object_infos_list)); + eo_do(main_win, efl_gfx_visible_set(EINA_TRUE)); + eo_do(main_win, eo_event_callback_add(EO_BASE_EVENT_DEL, _pubs_free_cb, pub_widgets)); return pub_widgets; } @@ -100,8 +98,8 @@ gui_elm_win1_create(Eo *__main_parent) static Eina_Bool profile_ok_button_clicked(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) { - Gui_Elm_Win1_Widgets *wdgs = gui_elm_win1_create(NULL); - gui_elm_win1_create_done(wdgs); + Gui_Main_Win_Widgets *wdgs = gui_main_win_create(NULL); + gui_main_win_create_done(wdgs); _profile_win_close_cb(data, obj, desc, event_info); return EINA_TRUE; } @@ -188,4 +186,4 @@ Gui_Widgets *gui_gui_get() initialized = EINA_TRUE; } return &g_pub_widgets; -} +} \ No newline at end of file diff --git a/src/bin/gui.h b/src/bin/gui.h index 04d38ea..4661809 100644 --- a/src/bin/gui.h +++ b/src/bin/gui.h @@ -5,13 +5,11 @@ typedef struct { - Eo *elm_win1; - Eo *elm_box1; - Eo *elm_hoversel1; - Eo *elm_panes1; - Eo *elm_genlist2; - Eo *elm_genlist1; -} Gui_Elm_Win1_Widgets; + Eo *main_win; + Eo *apps_selector; + Eo *object_infos_list; + Eo *objects_list; +} Gui_Main_Win_Widgets; typedef struct @@ -27,7 +25,7 @@ typedef struct { Gui_Profiles_Win_Widgets *profiles_win; } Gui_Widgets; -Gui_Elm_Win1_Widgets *gui_elm_win1_create(Eo *parent); +Gui_Main_Win_Widgets *gui_main_win_create(Eo *parent); Gui_Profiles_Win_Widgets *gui_profiles_win_create(Eo *parent);