static void create_base_gui(appdata_s *ad) { /* Window */ ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); elm_win_autodel_set(ad->win, EINA_TRUE); if (elm_win_wm_rotation_supported_get(ad->win)) { int rots[] = { 270 }; elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), sizeof(rots) / sizeof(rots[0])); } evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL); eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad); /* Conformant */ ad->conform = elm_conformant_add(ad->win); elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE); evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(ad->win, ad->conform); evas_object_show(ad->conform); app_init(ad->conform); /* Show window after base gui is set up */ evas_object_show(ad->win); }
static void create_indicator(appdata_s *ad) { elm_win_conformant_set(ad->win, EINA_TRUE); elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_TRANSPARENT); ad->conform = elm_conformant_add(ad->win); evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(ad->win, ad->conform); evas_object_show(ad->conform); }
void intf_video_player_play(interface *intf, const char *psz_path) { audio_player_stop(intf->p_mini_player); if (intf->video_player == NULL) intf_video_player_create(intf); Elm_Object_Item* it = intf_push_view(intf, intf->video_player, NULL); /* Hide the title bar of the naviframe */ elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_TRUE); video_player_start(intf->video_player->p_view_sys, psz_path); /* We want fullscreen */ elm_win_indicator_opacity_set(intf->win, ELM_WIN_INDICATOR_TRANSPARENT); }
static void create_base_gui(appdata_s *ad) { char edj_path[PATH_MAX] = {0, }; // Window ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); elm_win_conformant_set(ad->win, EINA_TRUE); elm_win_autodel_set(ad->win, EINA_TRUE); if (elm_win_wm_rotation_supported_get(ad->win)) { int rots[4] = { 0, 90, 180, 270 }; elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4); } evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL); // Conformant ad->conform = elm_conformant_add(ad->win); elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE); evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ad->conform, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_win_resize_object_add(ad->win, ad->conform); evas_object_show(ad->conform); create_main_view(ad); /* // Naviframe ad->nf = elm_naviframe_add(ad->conform); elm_object_content_set(ad->conform, ad->nf); evas_object_size_hint_weight_set(ad->nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ad->nf, EVAS_HINT_FILL, EVAS_HINT_FILL); eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL); */ // Circle Surface // ad->circle_surface = eext_circle_surface_naviframe_add(ad->nf); // Show window after base gui is set up evas_object_show(ad->win); }
static void create_base_gui(appdata_s *ad) { /* Window */ /* Create and initialize elm_win. elm_win is mandatory to manipulate window. */ ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); elm_win_autodel_set(ad->win, EINA_TRUE); if (elm_win_wm_rotation_supported_get(ad->win)) { int rots[4] = { 0, 90, 180, 270 }; elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4); } evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL); eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad); /* Conformant */ /* Create and initialize elm_conformant. elm_conformant is mandatory for base gui to have proper size when indicator or virtual keypad is visible. */ ad->conform = elm_conformant_add(ad->win); elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE); evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(ad->win, ad->conform); evas_object_show(ad->conform); /* Label */ /* Create an actual view of the base gui. Modify this part to change the view. */ ad->label = elm_label_add(ad->conform); elm_object_text_set(ad->label, "<align=center><h1>Hello World!</h1></align><br>" "<br>" "<wrap = word>This is my first Tizen app. By pedrojanula ;).</wrap>"); evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_content_set(ad->conform, ad->label); /* Show window after base gui is set up */ evas_object_show(ad->win); }
static Evas_Object* consumerapp_create_win(const char *name) { Evas_Object *eo; int w , h; eo = elm_win_add(NULL , name , ELM_WIN_BASIC); if(eo) { elm_win_title_set(eo , name); elm_win_borderless_set(eo , EINA_TRUE); evas_object_smart_callback_add(eo , "delete,request" , _win_del , NULL); ecore_x_window_size_get(ecore_x_window_root_first_get() , &w , &h); evas_object_resize(eo , w , h); elm_win_indicator_mode_set(eo , ELM_WIN_INDICATOR_SHOW); elm_win_indicator_opacity_set(eo , ELM_WIN_INDICATOR_OPAQUE); } evas_object_show(eo); return eo; }
interface * intf_create(application *app) { interface *intf = calloc(1, sizeof(*intf)); intf->p_app = app; intf->current_view = -1; #ifdef __arm__ /* no opengl for emulator */ elm_config_accel_preference_set("opengl"); #endif /* Add and set the main Window */ intf->win = elm_win_util_standard_add(PACKAGE, PACKAGE); elm_win_autodel_set(intf->win, EINA_TRUE); /* Change colors */ // 2.3.1 EDJE_COLOR_CLASS_SET_VLC_ORANGE("B011"); // Base class EDJE_COLOR_CLASS_SET_VLC_ORANGE("B0511"); // Naviframe base EDJE_COLOR_CLASS_SET_VLC_ORANGE("B0514"); // Naviframe tab bar EDJE_COLOR_CLASS_SET_VLC_ORANGE("B0514S"); // Naviframe tab bar EDJE_COLOR_CLASS_SET_VLC_ORANGE("B0514P"); // Naviframe tab bar EDJE_COLOR_CLASS_SET_VLC_ORANGE("B0517"); // Naviframe second EDJE_COLOR_CLASS_SET_VLC_COLOR("F043P", VLC_GREY_400_TRANSPARENT); // Naviframe selection // 2.4 EDJE_COLOR_CLASS_SET_VLC_ORANGE("B001"); // Base class EDJE_COLOR_CLASS_SET_VLC_ORANGE("B071"); // Scrollbars EDJE_COLOR_CLASS_SET_VLC_COLOR("B018", VLC_ORANGE_500_TRANSPARENT_100); // End of list effect /* Progress Bar Colors */ EDJE_COLOR_CLASS_SET_VLC_COLOR("W062L1", VLC_GREY_400_TRANSPARENT); // slider background EDJE_COLOR_CLASS_SET_VLC_COLOR("W062L2", VLC_ORANGE_500_TRANSPARENT); // slider foreground EDJE_COLOR_CLASS_SET_VLC_COLOR("W0641P", VLC_ORANGE_500_TRANSPARENT); // slider thumb pressed EDJE_COLOR_CLASS_SET_VLC_COLOR("W0641D", VLC_ORANGE_500_TRANSPARENT); // slider thumb disabled EDJE_COLOR_CLASS_SET_VLC_ORANGE("W0641"); // slider thumb // Extend theme elm_theme_extension_add(NULL, THEME_EDJ); /* Handle rotations */ if (elm_win_wm_rotation_supported_get(intf->win)) { int rots[4] = { 0, 90, 180, 270 }; elm_win_wm_rotation_available_rotations_set(intf->win, (const int *)(&rots), 4); } /* Handle back buttons and delete callbacks */ evas_object_smart_callback_add(intf->win, "delete,request", win_delete_request_cb, NULL); eext_object_event_callback_add(intf->win, EEXT_CALLBACK_BACK, win_back_key_cb, intf); eext_object_event_callback_add(intf->win, EEXT_CALLBACK_MORE, right_panel_button_clicked_cb, intf); /* Add and set a conformant in the main Window */ Evas_Object *conform = elm_conformant_add(intf->win); elm_win_conformant_set(intf->win, EINA_TRUE); evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); /* */ elm_win_indicator_mode_set(intf->win, ELM_WIN_INDICATOR_SHOW); elm_win_indicator_opacity_set(intf->win, ELM_WIN_INDICATOR_OPAQUE); elm_win_resize_object_add(intf->win, conform); evas_object_show(conform); /* Add and set a bg in the conformant */ Evas_Object *bg = elm_bg_add(conform); elm_bg_color_set(bg, 255, 136, 0); /* Add the bg in the conformant */ elm_object_part_content_set(conform, "elm.swallow.indicator_bg", bg); evas_object_show(bg); view_e view_type = preferences_get_index(PREF_CURRENT_VIEW, VIEW_VIDEO); /* Create the main view in the conformant */ create_main_layout(intf, conform, view_type); /* Create the default view in the content naviframe */ intf_show_view(intf, view_type); ps_register_on_emotion_restart_cb(application_get_playback_service(intf->p_app), intf_on_emotion_restart_cb, intf); media_library* p_ml = (media_library*)application_get_media_library(intf->p_app); media_library_register_progress_cb( p_ml, &intf_scan_progress_set_cb, intf ); /* */ evas_object_show(intf->win); return intf; }
static void intf_pop_view(interface *intf) { if (naviframe_count(intf->nf_content) == 1) { playback_service *p_ps = application_get_playback_service(intf->p_app); if (playback_service_is_playing(p_ps)) { /* Lower the window (but keep the mainloop running) */ elm_win_lower(intf->win); playback_service_set_auto_exit(p_ps, true); } else { ui_app_exit(); } return; } /* Get the top of the NaviFrame Stack */ Elm_Object_Item *it = elm_naviframe_top_item_get(intf->nf_content); interface_view *view = (interface_view *)elm_object_item_data_get(it); if (view) { if(view->pf_stop != NULL) { view->pf_stop(view->p_view_sys); } } // NOTE: When pop() is called a naviframe will free the content of the item // unless elm_naviframe_content_preserve_on_pop_set is set but this // function seems broken or underspecified (at least in Tizen 2.3 SDK). // To workaround this issue there's two options: // // * Don't recycle view and instantiate a new one instead // * Remove the view from the item before calling pop() // // The second option has one drawback though, once unset the part // will be flying and needs to be hidden until it's reattached. evas_object_hide(elm_object_part_content_unset(intf->nf_content, "elm.swallow.content")); /* Pop the top view */ elm_naviframe_item_pop(intf->nf_content); elm_win_indicator_opacity_set(intf->win, ELM_WIN_INDICATOR_OPAQUE); Evas_Object *sidebar_toggle_btn = create_button(intf->nf_content, "naviframe/drawers"); evas_object_smart_callback_add(sidebar_toggle_btn, "clicked", left_panel_button_clicked_cb, intf); elm_object_part_content_set(intf->nf_content, "title_left_btn", sidebar_toggle_btn); view = (interface_view *)elm_object_item_data_get(elm_naviframe_top_item_get(intf->nf_content)); if (view) { intf->current_view = view->i_type; sidebar_set_selected_view(intf->sidebar, intf->current_view); if (view->pf_has_menu && view->pf_has_menu(view->p_view_sys) == true) { Evas_Object *popup_toggle_btn = create_button(intf->nf_content, "naviframe/custom_more"); evas_object_smart_callback_add(popup_toggle_btn, "clicked", right_panel_button_clicked_cb, intf); elm_object_part_content_set(intf->nf_content, "title_right_btn", popup_toggle_btn); evas_object_show(popup_toggle_btn); } evas_object_show(view->view); } else { LOGE("Cannot get view metadata"); } }