EAPI int elm_main(int argc, char **argv) { Evas_Object *win=NULL, *bg=NULL, *pattern=NULL, *edje=NULL, *object=NULL, *item=NULL; Ecore_X_Window xwin, rootxwin; char theme[PATH_MAX]; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); win = elm_win_add(NULL, "e_pattern_lock", ELM_WIN_BASIC); elm_win_autodel_set(win, EINA_TRUE); elm_win_maximized_set(win, EINA_TRUE); // change to full screen and above everything for lockscreen effect evas_object_size_hint_min_set(win, 480, 480); evas_object_size_hint_max_set(win, 640, 640); elm_win_fullscreen_set(win, EINA_TRUE); elm_win_sticky_set(win, EINA_TRUE); elm_win_keyboard_mode_set(win, ELM_WIN_KEYBOARD_OFF); elm_win_layer_set(win, INT_MAX); xwin = elm_win_xwindow_get(win); rootxwin = ecore_x_window_root_get(xwin); ecore_x_pointer_grab(xwin); ecore_x_keyboard_grab(rootxwin); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, 1.0, 1.0); elm_win_resize_object_add(win, bg); evas_object_show(bg); snprintf(theme, sizeof(theme), "%s/themes/default.edj", PKGDATADIR); elm_theme_extension_add(NULL, theme); elm_theme_overlay_add(NULL, theme); pattern = elm_layout_add(win); elm_layout_file_set(pattern, theme, "e_lock/table/default"); evas_object_size_hint_weight_set(pattern, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(pattern, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_win_resize_object_add(win, pattern); edje = elm_layout_edje_get(pattern); set_event_cbs(0, 0, "top_left"); set_event_cbs(1, 0, "top"); set_event_cbs(2, 0, "top_right"); set_event_cbs(0, 1, "left"); set_event_cbs(1, 1, "center"); set_event_cbs(2, 1, "right"); set_event_cbs(0, 2, "bottom_left"); set_event_cbs(1, 2, "bottom"); set_event_cbs(2, 2, "bottom_right"); evas_object_show(pattern); evas_object_show(win); elm_run(); elm_shutdown(); return(0); }
int idle_screen_view_init() { Evas_Object *win; int ret; ret = ui_utils_view_init(VIEW_PTR(view), ELM_WIN_BASIC, D_("Idle_Screen"), NULL, NULL, NULL); if (ret) { g_critical("Failed to init idle screen"); return ret; } ui_utils_view_delete_callback_set(VIEW_PTR(view), _delete_cb); ui_utils_view_layout_set(VIEW_PTR(view), IDLE_SCREEN_THEME, "phoneui/idle_screen/idle_screen"); edje_object_signal_emit(ui_utils_view_layout_get(VIEW_PTR(view)), "clock_init", ""); win = ui_utils_view_window_get(VIEW_PTR(view)); _set_edje_size(); elm_win_fullscreen_set(win, 1); elm_win_layer_set(win, 200); elm_win_keyboard_mode_set(win, ELM_WIN_KEYBOARD_OFF); evas_object_show(view.wallpaper); edje_object_signal_callback_add(ui_utils_view_layout_get(VIEW_PTR(view)), "unlockScreen", "slider", idle_screen_view_hide, NULL); phoneui_info_register_and_request_resource_status(_resource_status, NULL); phoneui_info_register_and_request_network_status(_network_status, NULL); phoneui_info_register_and_request_signal_strength(_signal_strength, NULL); phoneui_info_register_backlight_power(_backlight_power, NULL); phoneui_info_register_and_request_pdp_context_status(_pdp_context_status, NULL); phoneui_info_register_and_request_profile_changes(_profile_change, NULL); phoneui_info_register_and_request_capacity_changes(_capacity_change, NULL); phoneui_info_register_and_request_missed_calls(_missed_calls, NULL); phoneui_info_register_and_request_unread_messages(_unread_messages, NULL); phoneui_info_register_and_request_unfinished_tasks(_unfinished_tasks, NULL); return 0; }
/* public functions */ EM_INTERN Eina_Bool em_gui_init(void) { Evas_Object *o, *oo; /* allocate our object */ gui = EM_OBJECT_ALLOC(Em_Gui, EM_GUI_TYPE, _em_gui_cb_free); if (!gui) return EINA_FALSE; /* create window */ gui->w_win = elm_win_add(NULL, "emote", ELM_WIN_BASIC); elm_win_title_set(gui->w_win, "Emote"); elm_win_keyboard_mode_set(gui->w_win, ELM_WIN_KEYBOARD_ALPHA); evas_object_smart_callback_add(gui->w_win, "delete,request", _em_gui_cb_win_del, NULL); /* create background */ o = elm_bg_add(gui->w_win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(gui->w_win, o); evas_object_show(o); o = elm_box_add(gui->w_win); elm_box_homogeneous_set(o, EINA_FALSE); elm_win_resize_object_add(gui->w_win, o); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_box_align_set(o, 0.5, 0.5); evas_object_show(o); /* create main toolbar */ gui->w_tb = elm_toolbar_add(gui->w_win); elm_toolbar_icon_size_set(gui->w_tb, (8 * elm_config_scale_get())); elm_toolbar_align_set(gui->w_tb, 1.0); elm_toolbar_shrink_mode_set(gui->w_tb, ELM_TOOLBAR_SHRINK_SCROLL); elm_toolbar_item_append(gui->w_tb, "preferences-system", _("Settings"), _em_gui_cb_settings, NULL); elm_toolbar_item_append(gui->w_tb, "application-exit", _("Quit"), _em_gui_cb_quit, NULL); evas_object_size_hint_weight_set(gui->w_tb, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(gui->w_tb, EVAS_HINT_FILL, 0.0); evas_object_show(gui->w_tb); elm_box_pack_start(o, gui->w_tb); /* create packing box */ gui->w_box = elm_panes_add(gui->w_win); elm_panes_fixed_set(gui->w_box, EINA_FALSE); elm_panes_horizontal_set(gui->w_box, EINA_FALSE); elm_panes_content_left_size_set(gui->w_box, 0.20); evas_object_size_hint_weight_set(gui->w_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(gui->w_box, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(o, gui->w_box); evas_object_show(gui->w_box); gui->w_chansel_itc = elm_genlist_item_class_new(); gui->w_chansel_itc->item_style = "default"; gui->w_chansel_itc->func.text_get = _em_gui_chansel_cb_label_get; gui->w_chansel_itc->func.content_get = NULL; gui->w_chansel_itc->func.state_get = NULL; gui->w_chansel_itc->func.del = NULL; /* create channel selector w/ frame */ gui->w_chansel = elm_genlist_add(gui->w_win); elm_genlist_mode_set(gui->w_chansel, ELM_LIST_SCROLL); evas_object_size_hint_min_set(gui->w_chansel, 200, MIN_WIN_HEIGHT); evas_object_size_hint_weight_set(gui->w_chansel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(gui->w_chansel); o = elm_frame_add(gui->w_win); elm_object_part_text_set(o, "default", "Channels"); oo = elm_frame_add(gui->w_win); elm_object_style_set(oo, "pad_small"); elm_object_part_content_set(o, "default", oo); elm_object_part_content_set(oo, "default", gui->w_chansel); elm_object_part_content_set(gui->w_box, "left", o); evas_object_show(oo); evas_object_show(o); /* set min size of window and show it */ evas_object_show(gui->w_win); evas_object_resize(gui->w_win, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); gui->servers = eina_hash_string_small_new(_em_gui_server_del); return EINA_TRUE; }
/* public functions */ EM_INTERN Eina_Bool em_gui_init(void) { Evas_Object *o; /* allocate our object */ gui = EM_OBJECT_ALLOC(Em_Gui, EM_GUI_TYPE, _em_gui_cb_free); if (!gui) return EINA_FALSE; // Set finger size to 4 to avoid huge widgets // elm_finger_size_set(4); /* create window */ gui->w_win = elm_win_add(NULL, "emote", ELM_WIN_BASIC); elm_win_title_set(gui->w_win, "Emote"); elm_win_keyboard_mode_set(gui->w_win, ELM_WIN_KEYBOARD_ALPHA); evas_object_smart_callback_add(gui->w_win, "delete-request", _em_gui_cb_win_del, NULL); /* create background */ o = elm_bg_add(gui->w_win); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); // evas_object_size_hint_min_set(o, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); elm_win_resize_object_add(gui->w_win, o); evas_object_show(o); /* create packing box */ gui->w_box = elm_box_add(gui->w_win); elm_win_resize_object_add(gui->w_win, gui->w_box); evas_object_size_hint_weight_set(gui->w_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(gui->w_box); /* create main toolbar */ gui->w_tb = elm_toolbar_add(gui->w_win); elm_toolbar_icon_size_set(gui->w_tb, (16 * elm_scale_get())); elm_toolbar_align_set(gui->w_tb, 0.0); elm_toolbar_mode_shrink_set(gui->w_tb, ELM_TOOLBAR_SHRINK_SCROLL); evas_object_size_hint_weight_set(gui->w_tb, 0.0, 0.0); evas_object_size_hint_align_set(gui->w_tb, EVAS_HINT_FILL, 0.0); elm_toolbar_item_append(gui->w_tb, "preferences-system", _("Settings"), _em_gui_cb_settings, NULL); elm_toolbar_item_append(gui->w_tb, "application-exit", _("Quit"), _em_gui_cb_quit, NULL); evas_object_show(gui->w_tb); elm_box_pack_start(gui->w_box, gui->w_tb); /* create channel selector */ gui->w_chansel = elm_toolbar_add(gui->w_win); elm_toolbar_homogeneous_set(gui->w_chansel, EINA_FALSE); elm_toolbar_align_set(gui->w_chansel, 0.0); elm_toolbar_mode_shrink_set(gui->w_chansel, ELM_TOOLBAR_SHRINK_SCROLL); evas_object_size_hint_weight_set(gui->w_chansel, 0.0, 0.0); evas_object_size_hint_align_set(gui->w_chansel, EVAS_HINT_FILL, 0.0); evas_object_show(gui->w_chansel); elm_box_pack_end(gui->w_box, gui->w_chansel); /* set min size of window and show it */ // evas_object_size_hint_min_set(gui->w_win, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); evas_object_resize(gui->w_win, MIN_WIN_WIDTH, MIN_WIN_HEIGHT); evas_object_show(gui->w_win); gui->servers = eina_hash_string_small_new(_em_gui_server_del); return EINA_TRUE; }