Modify widgets names for a better readability

This commit is contained in:
Daniel Zaoui 2015-11-17 15:27:39 +02:00
parent 74a7e6af2a
commit 444b8401f4
4 changed files with 74 additions and 80 deletions

View File

@ -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_info_opcode = EINA_DEBUG_OPCODE_INVALID;
static uint32_t _obj_highlight_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; static Gui_Profiles_Win_Widgets *_profiles_wdgs = NULL;
typedef struct typedef struct
@ -274,7 +274,7 @@ _debug_obj_info_cb(Eina_Debug_Client *src EINA_UNUSED,
{ {
if(_obj_info) 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); eolian_debug_object_information_free(_obj_info);
_obj_info = NULL; _obj_info = NULL;
} }
@ -291,7 +291,7 @@ _debug_obj_info_cb(Eina_Debug_Client *src EINA_UNUSED,
node->data = kl; node->data = kl;
Elm_Object_Item *glg = elm_genlist_item_append( 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, (void *)node, NULL,
type, type,
NULL, NULL); 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; uint64_t ptr = (uint64_t)info_node->info->ptr;
printf("Sending Eolian get request for Eo object[%p]\n", 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_info_opcode, &ptr, sizeof(uint64_t));
eina_debug_session_send(_current_client, _obj_highlight_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_nodes_free(_objs_list_tree);
_objs_list_tree = NULL; _objs_list_tree = NULL;
elm_genlist_clear(_main_widgets->elm_genlist1); elm_genlist_clear(_main_widgets->objects_list);
elm_genlist_clear(_main_widgets->elm_genlist2); elm_genlist_clear(_main_widgets->object_infos_list);
} }
if (_current_client) eina_debug_client_free(_current_client); 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]; char option[100];
snprintf(option, 90, "%s [%d]", buf, pid); 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, option, "home", ELM_ICON_STANDARD, _hoversel_selected_app,
(void *)(long)cid); (void *)(long)cid);
} }
@ -446,7 +446,7 @@ _clients_info_deleted_cb(Eina_Debug_Client *src EINA_UNUSED, void *buffer, int s
int cid; int cid;
EXTRACT(buf, &cid, sizeof(uint32_t)); 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; const Eina_List *l;
Elm_Object_Item *hoversel_it; 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) EINA_LIST_FOREACH(_objs_list_tree, l, info_node)
{ {
Elm_Object_Item *glg = elm_genlist_item_append( Elm_Object_Item *glg = elm_genlist_item_append(
_main_widgets->elm_genlist1, _objs_itc, _main_widgets->objects_list, _objs_itc,
(void *)info_node, NULL, (void *)info_node, NULL,
info_node->children ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE, info_node->children ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
_objs_sel_cb, NULL); _objs_sel_cb, NULL);
@ -639,7 +639,7 @@ static const Eina_Debug_Opcode ops[] =
}; };
void void
gui_elm_win1_create_done(Gui_Elm_Win1_Widgets *wdgs) gui_main_win_create_done(Gui_Main_Win_Widgets *wdgs)
{ {
_main_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.state_get = NULL;
_objs_itc->func.del = 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_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_CONTRACT_REQUEST, _objs_contract_request_cb, NULL),
eo_event_callback_add(ELM_GENLIST_EVENT_EXPANDED, _objs_expanded_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.state_get = NULL;
_obj_info_itc->func.del = _obj_info_item_del; _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_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_CONTRACT_REQUEST, _obj_info_contract_request_cb, NULL),
eo_event_callback_add(ELM_GENLIST_EVENT_EXPANDED, _obj_info_expanded_cb, NULL), eo_event_callback_add(ELM_GENLIST_EVENT_EXPANDED, _obj_info_expanded_cb, NULL),

View File

@ -14,7 +14,7 @@
}, },
"Widgets": "Widgets":
{ {
"elm_win1": "main_win":
{ {
"Desc": "Desc":
{ {
@ -37,7 +37,7 @@
{ {
"Desc": "Desc":
{ {
"parent":"elm_win1", "parent":"main_win",
"class":"Elm.Bg" "class":"Elm.Bg"
}, },
"Properties": "Properties":
@ -51,9 +51,8 @@
{ {
"Desc": "Desc":
{ {
"parent":"elm_win1", "parent":"main_win",
"class":"Elm.Box", "class":"Elm.Box"
"public":true
}, },
"Properties": "Properties":
{ {
@ -64,9 +63,9 @@
"Elm.Box.padding":[0, 0], "Elm.Box.padding":[0, 0],
"Elm.Box.align":[0, 0] "Elm.Box.align":[0, 0]
}, },
"Contains":["elm_hoversel1", "elm_panes1"] "Contains":["apps_selector", "elm_panes1"]
}, },
"elm_hoversel1": "apps_selector":
{ {
"Desc": "Desc":
{ {
@ -91,8 +90,7 @@
"Desc": "Desc":
{ {
"parent":"elm_box1", "parent":"elm_box1",
"class":"Elm.Panes", "class":"Elm.Panes"
"public":true
}, },
"Properties": "Properties":
{ {
@ -105,11 +103,11 @@
}, },
"Contains": "Contains":
{ {
"elm_genlist1":["left"], "objects_list":["left"],
"elm_genlist2":["right"] "object_infos_list":["right"]
} }
}, },
"elm_genlist2": "object_infos_list":
{ {
"Desc": "Desc":
{ {
@ -123,7 +121,7 @@
"Efl.Gfx.Base.visible":[true] "Efl.Gfx.Base.visible":[true]
} }
}, },
"elm_genlist1": "objects_list":
{ {
"Desc": "Desc":
{ {
@ -234,7 +232,7 @@
}, },
"Callbacks": "Callbacks":
{ {
"clicked":["Create", "elm_win1", null], "clicked":["Create", "main_win", null],
"clicked":["Invoke", "profile_close", null] "clicked":["Invoke", "profile_close", null]
} }
}, },

View File

@ -15,7 +15,7 @@
static Gui_Widgets g_pub_widgets; 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 extern Eina_Bool
_profile_win_close_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info); _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; return EINA_TRUE;
} }
Gui_Elm_Win1_Widgets * Gui_Main_Win_Widgets *
gui_elm_win1_create(Eo *__main_parent) 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_bg1;
Eo *elm_box1; Eo *elm_box1;
Eo *elm_hoversel1; Eo *apps_selector;
Eo *elm_panes1; Eo *elm_panes1;
Eo *elm_genlist2; Eo *object_infos_list;
Eo *elm_genlist1; Eo *objects_list;
elm_win1 = eo_add(ELM_WIN_CLASS, __main_parent, elm_obj_win_type_set(ELM_WIN_BASIC)); main_win = eo_add(ELM_WIN_CLASS, __main_parent, elm_obj_win_type_set(ELM_WIN_BASIC));
pub_widgets->elm_win1 = elm_win1; pub_widgets->main_win = main_win;
eo_do(elm_win1, elm_obj_widget_part_text_set(NULL, "Window")); eo_do(main_win, elm_obj_widget_part_text_set(NULL, "Window"));
eo_do(elm_win1, elm_obj_win_autodel_set(EINA_TRUE)); eo_do(main_win, elm_obj_win_autodel_set(EINA_TRUE));
eo_do(elm_win1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); eo_do(main_win, evas_obj_size_hint_weight_set(1.000000, 1.000000));
eo_do(elm_win1, efl_gfx_size_set(478, 484)); eo_do(main_win, efl_gfx_size_set(478, 484));
elm_bg1 = eo_add(ELM_BG_CLASS, elm_win1); 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, 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_visible_set(EINA_TRUE));
eo_do(elm_bg1, efl_gfx_position_set(0, 0)); eo_do(elm_bg1, efl_gfx_position_set(0, 0));
elm_box1 = eo_add(ELM_BOX_CLASS, elm_win1); elm_box1 = eo_add(ELM_BOX_CLASS, main_win);
pub_widgets->elm_box1 = elm_box1;
eo_do(elm_box1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); 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_visible_set(EINA_TRUE));
eo_do(elm_box1, efl_gfx_size_set(643, 598)); eo_do(elm_box1, efl_gfx_size_set(643, 598));
eo_do(elm_box1, efl_gfx_position_set(-7, -2)); 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_padding_set(0, 0));
eo_do(elm_box1, elm_obj_box_align_set(0.000000, 0.000000)); 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(main_win, elm_obj_win_resize_object_add(elm_bg1));
eo_do(elm_win1, elm_obj_win_resize_object_add(elm_box1)); eo_do(main_win, elm_obj_win_resize_object_add(elm_box1));
elm_hoversel1 = eo_add(ELM_HOVERSEL_CLASS, elm_box1); apps_selector = eo_add(ELM_HOVERSEL_CLASS, elm_box1);
pub_widgets->elm_hoversel1 = elm_hoversel1; pub_widgets->apps_selector = apps_selector;
eo_do(elm_hoversel1, evas_obj_size_hint_weight_set(1.000000, 0.000000)); eo_do(apps_selector, 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(apps_selector, evas_obj_size_hint_align_set(0.500000, 0.000000));
eo_do(elm_hoversel1, efl_gfx_visible_set(EINA_TRUE)); eo_do(apps_selector, efl_gfx_visible_set(EINA_TRUE));
eo_do(elm_hoversel1, efl_gfx_size_set(1174, 643)); eo_do(apps_selector, efl_gfx_size_set(1174, 643));
eo_do(elm_hoversel1, efl_gfx_position_set(-8, -2)); eo_do(apps_selector, efl_gfx_position_set(-8, -2));
eo_do(elm_hoversel1, elm_obj_hoversel_horizontal_set(EINA_FALSE)); eo_do(apps_selector, elm_obj_hoversel_horizontal_set(EINA_FALSE));
eo_do(elm_hoversel1, elm_obj_hoversel_auto_update_set(EINA_TRUE)); eo_do(apps_selector, elm_obj_hoversel_auto_update_set(EINA_TRUE));
eo_do(elm_hoversel1, elm_obj_widget_part_text_set(NULL, "Select App")); eo_do(apps_selector, elm_obj_widget_part_text_set(NULL, "Select App"));
elm_panes1 = eo_add(ELM_PANES_CLASS, elm_box1); 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, 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, 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_size_set(75, 75));
eo_do(elm_panes1, efl_gfx_visible_set(EINA_TRUE)); 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_weight_set(1.000000, 1.000000));
eo_do(elm_panes1, evas_obj_size_hint_align_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)); eo_do(elm_box1, elm_obj_box_pack_end(elm_panes1));
elm_genlist2 = eo_add(ELM_GENLIST_CLASS, elm_panes1); object_infos_list = eo_add(ELM_GENLIST_CLASS, elm_panes1);
pub_widgets->elm_genlist2 = elm_genlist2; pub_widgets->object_infos_list = object_infos_list;
eo_do(elm_genlist2, evas_obj_size_hint_weight_set(1.000000, 1.000000)); eo_do(object_infos_list, evas_obj_size_hint_weight_set(1.000000, 1.000000));
eo_do(elm_genlist2, efl_gfx_visible_set(EINA_TRUE)); eo_do(object_infos_list, efl_gfx_visible_set(EINA_TRUE));
elm_genlist1 = eo_add(ELM_GENLIST_CLASS, elm_panes1); objects_list = eo_add(ELM_GENLIST_CLASS, elm_panes1);
pub_widgets->elm_genlist1 = elm_genlist1; pub_widgets->objects_list = objects_list;
eo_do(elm_genlist1, evas_obj_size_hint_weight_set(1.000000, 1.000000)); eo_do(objects_list, evas_obj_size_hint_weight_set(1.000000, 1.000000));
eo_do(elm_genlist1, efl_gfx_visible_set(EINA_TRUE)); eo_do(objects_list, 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("left", objects_list));
eo_do(elm_panes1, elm_obj_container_content_set("right", elm_genlist2)); eo_do(elm_panes1, elm_obj_container_content_set("right", object_infos_list));
eo_do(elm_win1, efl_gfx_visible_set(EINA_TRUE)); eo_do(main_win, efl_gfx_visible_set(EINA_TRUE));
eo_do(elm_win1, eo_event_callback_add(EO_BASE_EVENT_DEL, _pubs_free_cb, pub_widgets)); eo_do(main_win, eo_event_callback_add(EO_BASE_EVENT_DEL, _pubs_free_cb, pub_widgets));
return pub_widgets; return pub_widgets;
} }
@ -100,8 +98,8 @@ gui_elm_win1_create(Eo *__main_parent)
static Eina_Bool 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) 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_Main_Win_Widgets *wdgs = gui_main_win_create(NULL);
gui_elm_win1_create_done(wdgs); gui_main_win_create_done(wdgs);
_profile_win_close_cb(data, obj, desc, event_info); _profile_win_close_cb(data, obj, desc, event_info);
return EINA_TRUE; return EINA_TRUE;
} }
@ -188,4 +186,4 @@ Gui_Widgets *gui_gui_get()
initialized = EINA_TRUE; initialized = EINA_TRUE;
} }
return &g_pub_widgets; return &g_pub_widgets;
} }

View File

@ -5,13 +5,11 @@
typedef struct typedef struct
{ {
Eo *elm_win1; Eo *main_win;
Eo *elm_box1; Eo *apps_selector;
Eo *elm_hoversel1; Eo *object_infos_list;
Eo *elm_panes1; Eo *objects_list;
Eo *elm_genlist2; } Gui_Main_Win_Widgets;
Eo *elm_genlist1;
} Gui_Elm_Win1_Widgets;
typedef struct typedef struct
@ -27,7 +25,7 @@ typedef struct {
Gui_Profiles_Win_Widgets *profiles_win; Gui_Profiles_Win_Widgets *profiles_win;
} Gui_Widgets; } 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); Gui_Profiles_Win_Widgets *gui_profiles_win_create(Eo *parent);