static void button_ug_destroy_cb(ui_gadget_h ug, void *priv) { _D("%s\n", __func__); struct appdata *ad = (struct appdata *)priv; retm_if(ug == NULL, "Invalid argument: ug is NULL\n"); ug_destroy(ug); ad->ug = NULL; ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION); utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_OFF); _close_volume(ad); }
EAPI int elm_main(int argc, char **argv) { Ecore_X_Window xwin; Ecore_X_Window_State states[2]; Evas_Object *bg; int w, h; win = elm_win_add(NULL, "elm_kbd", ELM_WIN_BASIC); elm_win_title_set(win, "Elm Keyboard"); evas_object_smart_callback_add(win, "delete,request", _cb_win_del, NULL); elm_win_keyboard_win_set(win, EINA_TRUE); xwin = elm_win_xwindow_get(win); states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER; ecore_x_netwm_window_state_set(xwin, states, 2); ecore_x_icccm_hints_set(xwin, 0, 0, 0, 0, 0, 0, 0); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); _load_keys(win, &w, &h); evas_object_resize(win, w, h); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
ui_gadget_h create_button_ug(void *data) { ui_gadget_h ug = NULL; struct ug_cbs cbs = {0}; struct appdata *ad = (struct appdata *)data; retvm_if(ad == NULL, 0, "Invalid argument:appdata is NULL\n"); cbs.layout_cb = button_ug_layout_cb; cbs.destroy_cb = button_ug_destroy_cb; cbs.priv = (void *)data; ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NORMAL); utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_ON); ug = ug_create(NULL, "setting-profile-efl", UG_MODE_FULLVIEW, NULL, &cbs); return ug; }
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); }
static void _do_delete_request(Eo *win) { #ifdef HAVE_ELEMENTARY_X Ecore_X_Window xwin; xwin = elm_win_xwindow_get(win); ecore_x_window_delete_request_send(xwin); #endif (void) win; }
static void _set_edje_size() { Evas_Object *win; Ecore_X_Window root_window; int width, height; win = ui_utils_view_window_get(VIEW_PTR(view)); /* get screensize */ root_window = ecore_x_window_root_get (elm_win_xwindow_get (win)); ecore_x_window_size_get (root_window, &width, &height); if (height <= 480) { edje_object_signal_emit(ui_utils_view_layout_get(VIEW_PTR(view)), "set", "hvga"); } else { edje_object_signal_emit(ui_utils_view_layout_get(VIEW_PTR(view)), "set", "default"); } }
/* Basic popup widget */ int usbotg_unmount_create_and_show_basic_popup(struct appdata *ad) { Evas_Object *btn1; Evas_Object *btn2; char buf[PATH_MAX] = {0, }; /* Initialization */ int ret_val = 0; snprintf(buf, PATH_MAX, "Unmount %s?", dev_name); ad->device_name = malloc(strlen(dev_name)+1); strncpy(ad->device_name, dev_name, strlen(dev_name)); /* Add notify */ /* No need to give main window, it will create internally */ ad->popup = elm_popup_add(ad->win_main); evas_object_size_hint_weight_set(ad->popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_text_set(ad->popup, buf); elm_object_part_text_set(ad->popup, "title,text", _("IDS_COM_BODY_SYSTEM_INFO_ABB")); btn1 = elm_button_add(ad->popup); elm_object_text_set(btn1, "OK"); elm_object_part_content_set(ad->popup, "button1", btn1); evas_object_smart_callback_add(btn1, "clicked", ok_clicked_cb, ad); btn2 = elm_button_add(ad->popup); elm_object_text_set(btn2, "Cancel"); elm_object_part_content_set(ad->popup, "button2", btn2); evas_object_smart_callback_add(btn2, "clicked", bg_clicked_cb, ad); Ecore_X_Window xwin; xwin = elm_win_xwindow_get(ad->popup); ecore_x_netwm_window_type_set(xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION); evas_object_show(ad->popup); return 0; }
int create_and_show_basic_popup_min(struct appdata *ad) { Evas_Object *btn1; Evas_Object *btn2; ad->popup_poweroff = elm_popup_add(ad->win_main); if (ad->popup_poweroff == NULL) { system_print("\n System-popup : Add popup failed \n"); return -1; } evas_object_size_hint_weight_set(ad->popup_poweroff, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_text_set(ad->popup_poweroff, _("IDS_ST_BODY_POWER_OFF")); elm_object_part_text_set(ad->popup_poweroff, "title,text", _("IDS_COM_BODY_SYSTEM_INFO_ABB")); btn1 = elm_button_add(ad->popup_poweroff); elm_object_text_set(btn1, _("IDS_COM_SK_OK")); elm_object_part_content_set(ad->popup_poweroff, "button1", btn1); elm_object_style_set (btn1,"popup_button/default"); evas_object_smart_callback_add(btn1, "clicked", poweroff_response_yes_cb_min, ad); btn2 = elm_button_add(ad->popup_poweroff); elm_object_text_set(btn2, _("IDS_COM_SK_CANCEL")); elm_object_part_content_set(ad->popup_poweroff, "button2", btn2); elm_object_style_set (btn2,"popup_button/default"); evas_object_smart_callback_add(btn2, "clicked", poweroff_response_no_cb_min, ad); Ecore_X_Window xwin; xwin = elm_win_xwindow_get(ad->popup_poweroff); ecore_x_netwm_window_type_set(xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION); utilx_grab_key(ecore_x_display_get(), xwin, KEY_SELECT, SHARED_GRAB); ecore_event_handler_add(ECORE_EVENT_KEY_UP, poweroff_response_no_cb_min, NULL); evas_object_show(ad->popup_poweroff); return 0; }
EAPI int elm_main(int argc, char **argv) { Ecore_X_Window *roots = NULL; int num = 0, i = 0; roots = ecore_x_window_root_list(&num); if ((!roots) || (num <= 0)) return EXIT_FAILURE; for (i = 0; i < num; i++) { Ecore_X_Window *zones; int x = 0, count = 0; count = ecore_x_window_prop_window_list_get(roots[i], ECORE_X_ATOM_E_ILLUME_ZONE_LIST, &zones); if (!zones) continue; for (x = 0; x < count; x++) { Evas_Object *win; Evas_Object *bg, *box, *btn, *icon; Ecore_X_Window xwin; Ecore_X_Window_State states[2]; char buff[PATH_MAX]; int zx, zy, zw, zh; /* create new window */ win = elm_win_add(NULL, "Illume-Softkey", ELM_WIN_DOCK); elm_win_title_set(win, "Illume Softkey"); evas_object_smart_callback_add(win, "delete-request", _cb_win_del, NULL); evas_object_data_set(win, "zone", (const void *)zones[x]); xwin = elm_win_xwindow_get(win); ecore_x_icccm_hints_set(xwin, 0, 0, 0, 0, 0, 0, 0); states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER; ecore_x_netwm_window_state_set(xwin, states, 2); bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); box = elm_box_add(win); elm_box_horizontal_set(box, EINA_TRUE); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, box); evas_object_show(box); icon = elm_icon_add(win); snprintf(buff, sizeof(buff), "%s/images/back.png", PACKAGE_DATA_DIR); elm_icon_file_set(icon, buff, NULL); evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); btn = elm_button_add(win); elm_button_icon_set(btn, icon); evas_object_smart_callback_add(btn, "clicked", _cb_btn_back_clicked, win); evas_object_size_hint_align_set(btn, 1.0, 0.5); elm_box_pack_end(box, btn); evas_object_show(btn); evas_object_show(icon); icon = elm_icon_add(win); snprintf(buff, sizeof(buff), "%s/images/close.png", PACKAGE_DATA_DIR); elm_icon_file_set(icon, buff, NULL); evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); btn = elm_button_add(win); elm_button_icon_set(btn, icon); evas_object_smart_callback_add(btn, "clicked", _cb_btn_close_clicked, win); evas_object_size_hint_align_set(btn, 1.0, 0.5); elm_box_pack_end(box, btn); evas_object_show(btn); evas_object_show(icon); ecore_x_window_geometry_get(zones[x], &zx, &zy, &zw, &zh); ecore_x_e_illume_softkey_geometry_set(zones[x], zx, (zy + zh - 40), zw, 40); evas_object_move(win, zx, (zy + zh - 40)); evas_object_resize(win, zw, 40); evas_object_show(win); } free(zones); } free(roots); elm_run(); elm_shutdown(); return EXIT_SUCCESS; }
static void _conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type) { #ifdef HAVE_ELEMENTARY_X Ecore_X_Window zone = 0; Evas_Object *top; Ecore_X_Window xwin; #endif int sx = -1, sy = -1, sw = -1, sh = -1; ELM_CONFORMANT_DATA_GET(obj, sd); #ifdef HAVE_ELEMENTARY_X top = elm_widget_top_get(obj); xwin = elm_win_xwindow_get(top); if (xwin) zone = ecore_x_e_illume_zone_get(xwin); #endif if (part_type & ELM_CONFORMANT_INDICATOR_PART) { #ifdef HAVE_ELEMENTARY_X if ((!_conformant_part_geometry_get_from_env ("ILLUME_IND", &sx, &sy, &sw, &sh)) && (xwin)) { //No information of the indicator geometry, reset the geometry. if ((!zone) || (!ecore_x_e_illume_indicator_geometry_get (zone, &sx, &sy, &sw, &sh))) sx = sy = sw = sh = 0; } #endif if (((sd->rot == 90) || (sd->rot == 270)) && sd->landscape_indicator) _conformant_part_size_hints_set(obj, sd->landscape_indicator, sx, sy, sw, sh); else if (((sd->rot == 0) || (sd->rot == 180)) && sd->portrait_indicator) _conformant_part_size_hints_set(obj, sd->portrait_indicator, sx, sy, sw, sh); } if (part_type & ELM_CONFORMANT_VIRTUAL_KEYPAD_PART) { #ifdef HAVE_ELEMENTARY_X if ((!_conformant_part_geometry_get_from_env ("ILLUME_KBD", &sx, &sy, &sw, &sh)) && (xwin)) { //No information of the keyboard geometry, reset the geometry. #ifdef __linux__ DBG("[KEYPAD]:pid=%d, xwin=0x%x, zone=0x%x: no env value and check window property.", getpid(), xwin, zone); #endif if (!ecore_x_e_illume_keyboard_geometry_get(xwin, &sx, &sy, &sw, &sh)) { DBG("[KEYPAD]:no window property, check zone property."); if ((!zone) || (!ecore_x_e_illume_keyboard_geometry_get(zone, &sx, &sy, &sw, &sh))) { DBG("[KEYPAD]:no zone property, reset value."); sx = sy = sw = sh = 0; } } } #endif DBG("[KEYPAD]: size(%d,%d, %dx%d).", sx, sy, sw, sh); _conformant_part_size_hints_set (obj, sd->virtualkeypad, sx, sy, sw, sh); } if (part_type & ELM_CONFORMANT_SOFTKEY_PART) { #ifdef HAVE_ELEMENTARY_X if ((!_conformant_part_geometry_get_from_env ("ILLUME_STK", &sx, &sy, &sw, &sh)) && (xwin)) { //No information of the softkey geometry, reset the geometry. if ((!zone) || (!ecore_x_e_illume_softkey_geometry_get (zone, &sx, &sy, &sw, &sh))) sx = sy = sw = sh = 0; } #endif _conformant_part_size_hints_set(obj, sd->softkey, sx, sy, sw, sh); } if (part_type & ELM_CONFORMANT_CLIPBOARD_PART) { #ifdef HAVE_ELEMENTARY_X if ((!_conformant_part_geometry_get_from_env ("ILLUME_CB", &sx, &sy, &sw, &sh)) && (xwin)) { //No information of the clipboard geometry, reset the geometry. if ((!zone) || (!ecore_x_e_illume_clipboard_geometry_get (zone, &sx, &sy, &sw, &sh))) sx = sy = sw = sh = 0; } #endif _conformant_part_size_hints_set(obj, sd->clipboard, sx, sy, sw, sh); } }
static void _conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type) { #ifdef HAVE_ELEMENTARY_X Ecore_X_Window zone = 0; Evas_Object *top; #endif int sx = -1, sy = -1, sw = -1, sh = -1; Ecore_X_Window xwin; ELM_CONFORMANT_DATA_GET(obj, sd); #ifdef HAVE_ELEMENTARY_X top = elm_widget_top_get(obj); xwin = elm_win_xwindow_get(top); if (xwin) zone = ecore_x_e_illume_zone_get(xwin); #endif if (part_type & ELM_CONFORMANT_INDICATOR_PART) { if ((!_conformant_part_geometry_get_from_env ("ILLUME_IND", &sx, &sy, &sw, &sh)) && (xwin)) { #ifdef HAVE_ELEMENTARY_X //No information of the indicator geometry, reset the geometry. if (!ecore_x_e_illume_indicator_geometry_get (zone, &sx, &sy, &sw, &sh)) sx = sy = sw = sh = 0; #else ; #endif } _conformant_part_size_hints_set(obj, sd->indicator, sx, sy, sw, sh); } if (part_type & ELM_CONFORMANT_VIRTUAL_KEYPAD_PART) { if ((!_conformant_part_geometry_get_from_env ("ILLUME_KBD", &sx, &sy, &sw, &sh)) && (xwin)) { #ifdef HAVE_ELEMENTARY_X //No information of the keyboard geometry, reset the geometry. if (!ecore_x_e_illume_keyboard_geometry_get (zone, &sx, &sy, &sw, &sh)) sx = sy = sw = sh = 0; #else ; #endif } _conformant_part_size_hints_set (obj, sd->virtualkeypad, sx, sy, sw, sh); } if (part_type & ELM_CONFORMANT_SOFTKEY_PART) { if ((!_conformant_part_geometry_get_from_env ("ILLUME_STK", &sx, &sy, &sw, &sh)) && (xwin)) { #ifdef HAVE_ELEMENTARY_X //No information of the softkey geometry, reset the geometry. if (!ecore_x_e_illume_softkey_geometry_get (zone, &sx, &sy, &sw, &sh)) sx = sy = sw = sh = 0; #else ; #endif } _conformant_part_size_hints_set(obj, sd->softkey, sx, sy, sw, sh); } if (part_type & ELM_CONFORMANT_CLIPBOARD_PART) { if ((!_conformant_part_geometry_get_from_env ("ILLUME_CB", &sx, &sy, &sw, &sh)) && (xwin)) { #ifdef HAVE_ELEMENTARY_X //No information of the clipboard geometry, reset the geometry. if (!ecore_x_e_illume_clipboard_geometry_get (zone, &sx, &sy, &sw, &sh)) sx = sy = sw = sh = 0; #else ; #endif } _conformant_part_size_hints_set(obj, sd->clipboard, sx, sy, sw, sh); } }