From: Enlightenment S. <no-...@en...> - 2010-07-25 20:37:23
|
Log: enki: use edje external for the main panel Author: watchwolf Date: 2010-07-25 13:37:15 -0700 (Sun, 25 Jul 2010) New Revision: 50495 Added: trunk/enki/data/themes/default/main_panel.edc Modified: trunk/enki/data/themes/default/Makefile.am trunk/enki/data/themes/default/default.edc trunk/enki/src/bin/list_photo.c trunk/enki/src/bin/main.c trunk/enki/src/bin/main_menu.c trunk/enki/src/bin/map.c trunk/enki/src/bin/objects.h Modified: trunk/enki/data/themes/default/Makefile.am =================================================================== --- trunk/enki/data/themes/default/Makefile.am 2010-07-25 20:28:21 UTC (rev 50494) +++ trunk/enki/data/themes/default/Makefile.am 2010-07-25 20:37:15 UTC (rev 50495) @@ -5,7 +5,7 @@ EDJE_FLAGS = -v -default.edj: default.edc main_menu.edc utils.edc slideshow.edc list_left.edc +default.edj: default.edc main_menu.edc utils.edc slideshow.edc list_left.edc main_panel.edc $(EDJE_CC) $(EDJE_FLAGS) default.edc -id ../images/ icondir = $(pkgdatadir)/themes Modified: trunk/enki/data/themes/default/default.edc =================================================================== --- trunk/enki/data/themes/default/default.edc 2010-07-25 20:28:21 UTC (rev 50494) +++ trunk/enki/data/themes/default/default.edc 2010-07-25 20:37:15 UTC (rev 50495) @@ -69,6 +69,7 @@ collections { #include "main_menu.edc" + #include "main_panel.edc" #include "slideshow.edc" #include "list_left.edc" Modified: trunk/enki/src/bin/list_photo.c =================================================================== --- trunk/enki/src/bin/list_photo.c 2010-07-25 20:28:21 UTC (rev 50494) +++ trunk/enki/src/bin/list_photo.c 2010-07-25 20:37:15 UTC (rev 50495) @@ -26,7 +26,7 @@ static void _album_sync_flickr_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _photo_sync_flickr_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); -List_Photo *list_photo_new(Evas_Object *win) +List_Photo *list_photo_new(Evas_Object *edje) { Evas_Object *bx, *sl, *bx2, *lbl, *bt, *tg; List_Photo *enlil_photo = calloc(1, sizeof(List_Photo)); @@ -34,13 +34,13 @@ enlil_photo->photo_w = DEFAULT_W; enlil_photo->photo_h = DEFAULT_H; - bx = elm_box_add(win); + bx = elm_box_add(edje); evas_object_size_hint_weight_set(bx, 1.0, 1.0); evas_object_size_hint_align_set(bx, -1.0, -1.0); evas_object_show(bx); enlil_photo->bx = bx; - enlil_photo->o_list = photos_list_object_add(win); + enlil_photo->o_list = photos_list_object_add(edje); photos_list_object_sub_items_size_set(enlil_photo->o_list, DEFAULT_W, DEFAULT_H); evas_object_smart_callback_add(enlil_photo->o_list, "open", _open, enlil_photo); evas_object_smart_callback_add(enlil_photo->o_list, "clicked,right", _right_click, enlil_photo); @@ -53,21 +53,21 @@ itc_album.func.icon_get = _album_icon_get; itc_photo.func.icon_get = _photo_icon_get; - bx2 = elm_box_add(win); + bx2 = elm_box_add(edje); elm_box_horizontal_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, -1.0); evas_object_size_hint_align_set(bx2, -1.0, 1.0); elm_box_pack_end(bx, bx2); evas_object_show(bx2); - lbl = elm_label_add(win); + lbl = elm_label_add(edje); enlil_photo->lbl_nb_albums_photos = lbl; evas_object_show(lbl); evas_object_size_hint_weight_set(lbl, 1.0, 0.0); evas_object_size_hint_align_set(lbl, 0.0, 0.5); elm_box_pack_end(bx2, lbl); - tg = elm_toggle_add(win); + tg = elm_toggle_add(edje); enlil_photo->multiselection = tg; evas_object_size_hint_weight_set(tg, -1.0, -1.0); evas_object_size_hint_align_set(tg, 1.0, -1.0); @@ -78,7 +78,7 @@ elm_box_pack_end(bx2, tg); evas_object_show(tg); - bt = elm_button_add(win); + bt = elm_button_add(edje); elm_object_style_set(bt, "anchor"); evas_object_size_hint_weight_set(bt, -1.0, -1.0); evas_object_size_hint_align_set(bt, 1.0, -1.0); @@ -87,7 +87,7 @@ evas_object_show(bt); elm_box_pack_end(bx2, bt); - sl = elm_slider_add(win); + sl = elm_slider_add(edje); elm_slider_label_set(sl, "Zoom"); elm_slider_indicator_format_set(sl, "%3.0f"); elm_slider_min_max_set(sl, 1, 100); Modified: trunk/enki/src/bin/main.c =================================================================== --- trunk/enki/src/bin/main.c 2010-07-25 20:28:21 UTC (rev 50494) +++ trunk/enki/src/bin/main.c 2010-07-25 20:37:15 UTC (rev 50495) @@ -203,7 +203,7 @@ int elm_main(int argc, char **argv) { - Evas_Object *panels, *tabs, *page_1, *bx; + Evas_Object *panels, *tabs, *page_1, *bx, *ly, *edje; Tabpanel_Item *tp_item; unsigned char exit_option = 0; char *root_path = NULL; @@ -301,24 +301,33 @@ list_left_data_set(list_album, enlil_data); elm_panes_content_left_set(page_1, list_album->obj); - elm_panes_content_right_set(page_1, list_album->panels_map); + // + ly = elm_layout_add(win->win); + elm_layout_file_set(ly, THEME, "main_panel"); + evas_object_size_hint_weight_set(ly, -1.0, -1.0); + evas_object_size_hint_align_set(ly, -1.0, -1.0); + evas_object_show(ly); - Evas_Object *main_menu = main_menu_new(win->win); - enlil_data->main_menu = main_menu; - tp_item = tabpanel_item_add(list_album->tb_liste_map, D_("Menu"), main_menu, _menu_select_cb, enlil_data); + edje = elm_layout_edje_get(ly); + main_menu_new(edje); + tp_item = tabpanel_item_add_with_signal(list_album->tb_liste_map, D_("Menu"), edje, "menu,show", _menu_select_cb, enlil_data); - List_Photo *list_photo = list_photo_new(win->win); + + List_Photo *list_photo = list_photo_new(edje); list_photo_data_set(list_photo, enlil_data); - tp_list_photo = tabpanel_item_add(list_album->tb_liste_map, D_("Liste"), list_photo->bx, - _photos_list_select_cb, enlil_data); + edje_object_part_swallow(edje, "photos", list_photo->bx); + tp_list_photo = tabpanel_item_add_with_signal(list_album->tb_liste_map, D_("Liste"), edje, "photos,show",_photos_list_select_cb, enlil_data); - Map *map = map_new(win->win); + Map *map = map_new(edje); enlil_data->map = map; - tabpanel_item_add(list_album->tb_liste_map, D_("Map"), map->bx, _map_select_cb, enlil_data); + edje_object_part_swallow(edje, "map", map->bx); + tabpanel_item_add_with_signal(list_album->tb_liste_map, D_("Map"), edje, "map,show", _map_select_cb, enlil_data); tabpanel_item_select(tp_item); + + elm_panes_content_right_set(page_1, edje); // // Modified: trunk/enki/src/bin/main_menu.c =================================================================== --- trunk/enki/src/bin/main_menu.c 2010-07-25 20:28:21 UTC (rev 50494) +++ trunk/enki/src/bin/main_menu.c 2010-07-25 20:37:15 UTC (rev 50495) @@ -25,18 +25,10 @@ static void _quit_cb(void *data, Evas_Object *obj, void *event_info); -Evas_Object *main_menu_new(Evas_Object *parent) +void main_menu_new(Evas_Object *edje) { - Evas_Object *ly, *bt, *edje; + Evas_Object *bt; - ly = elm_layout_add(parent); - elm_layout_file_set(ly, THEME, "main_menu"); - evas_object_size_hint_weight_set(ly, -1.0, -1.0); - evas_object_size_hint_align_set(ly, -1.0, -1.0); - evas_object_show(ly); - - edje = elm_layout_edje_get(ly); - //Libraries libraries_list = edje_object_part_external_object_get(edje, "object.main_menu.list_libraries"); bt_new_library = edje_object_part_external_object_get(edje, "object.main_menu.bt_new_library"); @@ -80,7 +72,6 @@ FREE(string); } - return ly; } void main_menu_loading_disable_set(Eina_Bool disabled) Modified: trunk/enki/src/bin/map.c =================================================================== --- trunk/enki/src/bin/map.c 2010-07-25 20:28:21 UTC (rev 50494) +++ trunk/enki/src/bin/map.c 2010-07-25 20:37:15 UTC (rev 50495) @@ -26,20 +26,20 @@ static void _tg_photos_changed_cb(void *data, Evas_Object *obj, void *event_info); static void _bt_geocaching_cb(void *data, Evas_Object *obj, void *event_info); -Map *map_new(Evas_Object *win) +Map *map_new(Evas_Object *edje) { Evas_Object *sl, *rect, *tg, *bx; Map *map = calloc(1, sizeof(Map)); // - map->bx = elm_box_add(win); + map->bx = elm_box_add(edje); evas_object_size_hint_weight_set(map->bx, 1.0, 1.0); evas_object_size_hint_align_set(map->bx, -1.0, -1.0); evas_object_show(map->bx); // // - map->map = elm_map_add(win); + map->map = elm_map_add(edje); evas_object_size_hint_weight_set(map->map, 1.0, 1.0); evas_object_size_hint_align_set(map->map, -1.0, -1.0); evas_object_show(map->map); @@ -63,7 +63,7 @@ elm_map_marker_class_style_set(itc_gp, "empty"); // - bx = elm_box_add(win); + bx = elm_box_add(edje); elm_box_horizontal_set(bx, EINA_TRUE); evas_object_size_hint_weight_set(bx, 1.0, 0.0); evas_object_size_hint_align_set(bx, -1.0, -1.0); @@ -72,7 +72,7 @@ // // - tg = elm_toggle_add(win); + tg = elm_toggle_add(edje); map->display_photos = tg; evas_object_size_hint_weight_set(tg, -1.0, -1.0); evas_object_size_hint_align_set(tg, 0.0, -1.0); @@ -85,7 +85,7 @@ // // - tg = elm_toggle_add(win); + tg = elm_toggle_add(edje); map->display_geocaching = tg; evas_object_size_hint_weight_set(tg, -1.0, -1.0); evas_object_size_hint_align_set(tg, 0.0, -1.0); @@ -98,7 +98,7 @@ // // - sl = elm_slider_add(win); + sl = elm_slider_add(edje); evas_object_size_hint_weight_set(sl, 1.0, 0.0); evas_object_size_hint_align_set(sl, 1.0, -1.0); elm_slider_label_set(sl, "Zoom"); @@ -113,7 +113,7 @@ // // - rect = evas_object_rectangle_add(evas_object_evas_get(win)); + rect = evas_object_rectangle_add(evas_object_evas_get(edje)); map->rect = rect; evas_object_color_set(rect, 0, 0, 0, 0); evas_object_repeat_events_set(rect,1); Modified: trunk/enki/src/bin/objects.h =================================================================== --- trunk/enki/src/bin/objects.h 2010-07-25 20:28:21 UTC (rev 50494) +++ trunk/enki/src/bin/objects.h 2010-07-25 20:37:15 UTC (rev 50495) @@ -332,7 +332,7 @@ //main menu -Evas_Object *main_menu_new(Evas_Object *parent); +void main_menu_new(Evas_Object *parent); void main_menu_update_libraries_list(Eina_List *list); void main_menu_loading_disable_set(Eina_Bool disabled); void main_menu_sync_disable_set(Eina_Bool disabled); |