static void add_layout_to_conformant (void *data, Evas_Object *lay_in, const char *title) { Evas_Object *scroller = NULL; Evas_Object *win = NULL; Evas_Object *conform = NULL; struct appdata *ad = NULL; ad = (struct appdata *) data; win = ad->win_main; // Enabling illume notification property for window elm_win_conformant_set (win, EINA_TRUE); // Creating conformant widget conform = elm_conformant_add (win); evas_object_size_hint_weight_set (conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show (conform); scroller = elm_scroller_add (ad->naviframe); elm_scroller_bounce_set (scroller, EINA_FALSE, EINA_TRUE); evas_object_show (scroller); elm_object_content_set (scroller, lay_in); elm_object_content_set (conform, scroller); elm_naviframe_item_push (ad->naviframe, title, NULL, NULL, conform, NULL); }
EAPI int elm_main(int argc, char **argv) { Evas_Object *bg, *conform, *btn; win = elm_win_add(NULL, "elm_illume", ELM_WIN_BASIC); elm_win_title_set(win, "Illume Conformant Window"); elm_win_conformant_set(win, 1); evas_object_smart_callback_add(win, "delete,request", _cb_win_del, NULL); 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); conform = elm_conformant_add(win); elm_win_resize_object_add(win, conform); evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(conform); btn = elm_button_add(win); elm_button_label_set(btn, "Click to Close"); evas_object_smart_callback_add(btn, "clicked", _cb_btn_close_clicked, NULL); evas_object_show(btn); elm_conformant_content_set(conform, btn); evas_object_resize(win, 200, 200); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
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 GLViewImpl::setIMEKeyboardState(bool open) { if (open) { if (!s_keypadWin) { auto frameSize = Director::getInstance()->getOpenGLView()->getFrameSize(); auto app = Application::getInstance(); s_keypadWin = elm_win_add(app->_win, "cocos2d-x textfield", ELM_WIN_BASIC); elm_win_autodel_set(s_keypadWin, EINA_TRUE); elm_win_conformant_set(s_keypadWin, EINA_TRUE); elm_win_alpha_set(s_keypadWin, EINA_TRUE); eext_object_event_callback_add(s_keypadWin, EEXT_CALLBACK_BACK, keyPadBackCallback, NULL); evas_object_show(s_keypadWin); int rots[2]; rots[0] = (int)elm_win_rotation_get(app->_win); rots[1] = rots[0] + 180 % 360; elm_win_wm_rotation_available_rotations_set(s_keypadWin, rots, 2); auto rectangle = elm_bg_add(s_keypadWin); evas_object_resize(rectangle, frameSize.width, frameSize.height + 50); evas_object_color_set(rectangle, 0xff, 0xff, 0xff, 0); evas_object_move(rectangle, 0, -50); evas_object_show(rectangle); evas_object_repeat_events_set(rectangle, EINA_TRUE); evas_object_event_callback_add(rectangle, EVAS_CALLBACK_MOUSE_UP, blankAreaClickedCallback, NULL); evas_object_event_callback_add(rectangle, EVAS_CALLBACK_MULTI_UP, blankAreaClickedCallback, NULL); s_keypadEntry = elm_entry_add(rectangle); elm_entry_single_line_set(s_keypadEntry, EINA_TRUE); evas_object_resize(s_keypadEntry, frameSize.width, 50); evas_object_move(s_keypadEntry, 0, -50); elm_entry_input_panel_return_key_type_set(s_keypadEntry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); elm_entry_prediction_allow_set(s_keypadEntry, EINA_FALSE); evas_object_event_callback_add(s_keypadEntry, EVAS_CALLBACK_KEY_UP, entryKeyCallback, NULL); evas_object_show(s_keypadEntry); elm_object_focus_set(s_keypadEntry, EINA_TRUE); evas_object_smart_callback_add(s_keypadEntry, "activated", entryActivatedCallback, NULL); elm_entry_input_panel_show(s_keypadEntry); s_imf = (Ecore_IMF_Context*)elm_entry_imf_context_get(s_keypadEntry); ecore_imf_context_event_callback_add(s_imf, ECORE_IMF_CALLBACK_COMMIT, imfEventCommitCallback, s_keypadEntry); } } else if (s_keypadWin) { closeKeypad(); } }
void create_base_gui(appdata_s *ad) { /* * Widget Tree * Window * - conform * - layout main * - naviframe */ /* 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); 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); // Eext Circle Surface Creation ad->circle_surface = eext_circle_surface_conformant_add(ad->conform); /* Indicator */ /* elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); */ /* Base Layout */ ad->layout = elm_layout_add(ad->conform); evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_layout_theme_set(ad->layout, "layout", "application", "default"); evas_object_show(ad->layout); elm_object_content_set(ad->conform, ad->layout); /* Naviframe */ ad->nf = elm_naviframe_add(ad->layout); create_main_view(ad); elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf); eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL); eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL); /* Show window after base gui is set up */ evas_object_show(ad->win); }
Evas_Object *widget_create_conformant(Evas_Object * parent, char *style, Evas_Object * content) { Evas_Object *ret = NULL; int nErr = SUCCESS; //CLK_FUN_BEG(); elm_win_conformant_set(parent, 1); ret = elm_conformant_add(parent); CLK_RETVM_IF(!ret, NULL, "ret error!"); elm_object_style_set(ret, style); elm_object_content_set(ret, content); End: //CLK_FUN_END(); return ret; }
static Evas_Object* __common_utils_create_conformant(Evas_Object* parent) { assertm_if(NULL == parent, "NULL!!"); Evas_Object* conform = NULL; elm_win_conformant_set(parent, TRUE); conform = elm_conformant_add(parent); assertm_if(NULL == conform, "NULL!!"); elm_object_style_set(conform, "internal_layout"); evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(conform, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(conform); return conform; }
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); }
/** * @brief __create_main_win 创建住窗口 * @param app_data 传递的程序结构体 * @return 返回创建的对象 */ static Evas_Object *__create_main_win(void *app_data) { Evas_Object *window = elm_win_add(NULL, BROWSER_PACKAGE_NAME, ELM_WIN_BASIC); if (window) { int w; int h; elm_win_title_set(window, BROWSER_PACKAGE_NAME); elm_win_borderless_set(window, EINA_TRUE); elm_win_conformant_set(window, EINA_TRUE); evas_object_smart_callback_add(window, "delete,request", __main_win_del_cb, app_data); ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); evas_object_resize(window, w, h); elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW); evas_object_show(window); } return window; }
static void create_base_gui(appdata_s *ad) { // 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); 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); // Base Layout ad->layout = elm_layout_add(ad->conform); evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_layout_theme_set(ad->layout, "layout", "application", "default"); evas_object_show(ad->layout); elm_object_content_set(ad->conform, ad->layout); // Naviframe ad->nf = elm_naviframe_add(ad->layout); create_list_view(ad); elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf); eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL); eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL); // Show window after base gui is set up evas_object_show(ad->win); }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *conform, *btn, *bx, *en; win = elm_win_add(NULL, "conformant", ELM_WIN_BASIC); elm_win_title_set(win, "Conformant Example"); elm_win_autodel_set(win, EINA_TRUE); elm_win_conformant_set(win, EINA_TRUE); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); conform = elm_conformant_add(win); elm_win_resize_object_add(win, conform); evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(conform); bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL); btn = elm_button_add(win); elm_object_text_set(btn, "Test Conformant"); evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0); elm_box_pack_end(bx, btn); evas_object_show(btn); en = elm_entry_add(win); elm_entry_scrollable_set(en, EINA_TRUE); elm_object_text_set(en, "This is a multi-line entry at the bottom<br>" "This can contain more than 1 line of text and be " "scrolled around to allow for entering of lots of " "content. It is also to test to see that autoscroll " "moves to the right part of a larger multi-line " "text entry that is inside of a scroller than can be " "scrolled around, thus changing the expected position " "as well as cursor changes updating auto-scroll when " "it is enabled."); evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(en); elm_box_pack_end(bx, en); btn = elm_button_add(win); elm_object_text_set(btn, "Test Conformant"); evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0); elm_box_pack_end(bx, btn); evas_object_show(btn); elm_object_content_set(conform, bx); evas_object_show(bx); evas_object_resize(win, 240, 480); evas_object_show(win); elm_run(); elm_shutdown(); return 0; }
void EditBoxImplTizen::openKeyboard() { if (s_keypadWin) { return; } if (_delegate != NULL) { _delegate->editBoxEditingDidBegin(_editBox); } #if CC_ENABLE_SCRIPT_BINDING EditBox* pEditBox = this->getEditBox(); if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) { CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); } #endif Evas_Object* parent = Application::getInstance()->_win; GLView* glView = Director::getInstance()->getOpenGLView(); Size frameSize = glView->getFrameSize(); s_keypadWin = elm_win_add(parent, "cocos2d-x", ELM_WIN_BASIC); elm_win_autodel_set(s_keypadWin, EINA_TRUE); elm_win_conformant_set(s_keypadWin, EINA_TRUE); elm_win_alpha_set(s_keypadWin, EINA_TRUE); evas_object_show(s_keypadWin); eext_object_event_callback_add(s_keypadWin, EEXT_CALLBACK_BACK, entry_back_cb, this); int rots[2]; rots[0] = (int)(elm_win_rotation_get(parent)); rots[1] = rots[0] + 180 % 360; elm_win_wm_rotation_available_rotations_set(s_keypadWin, rots, 2); Evas_Object* bgFull = elm_bg_add(s_keypadWin); evas_object_color_set(bgFull, 0, 0, 0, 0xa0); evas_object_resize(bgFull, frameSize.width, frameSize.height); evas_object_show(bgFull); int height = frameSize.height / 10; Evas_Object* rectangle = elm_bg_add(bgFull); evas_object_resize(rectangle, frameSize.width, height); evas_object_move(rectangle, 0, height); evas_object_color_set(rectangle, 0xff, 0xff, 0xff, 0xff); evas_object_show(rectangle); Evas_Object* title = elm_entry_add(rectangle); evas_object_resize(title, frameSize.width, height); auto text = _placeHolder.c_str(); auto richText = (char*)malloc(strlen(text) + 50); sprintf(richText,"<color=#ffffff>%s</>", text); elm_entry_entry_set(title, richText); elm_entry_editable_set(title, EINA_FALSE); //elm_entry_drag_disabled_set(title, EINA_TRUE); //elm_entry_drop_disabled_set(title, EINA_TRUE); evas_object_show(title); free(richText); Evas_Object* entry = elm_entry_add(bgFull); elm_object_focus_set(entry, EINA_TRUE); evas_object_resize(entry, frameSize.width, height); evas_object_move(entry, 0, height); elm_entry_single_line_set(entry, EINA_TRUE); elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); elm_entry_entry_set(entry, _text.c_str()); evas_object_show(entry); elm_object_focus_set(entry, EINA_TRUE); eext_entry_selection_back_event_allow_set(entry, EINA_TRUE); Elm_Entry_Filter_Limit_Size limit_size = { 0, }; limit_size.max_char_count = _maxLength; elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_size); elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); elm_entry_prediction_allow_set(entry, EINA_FALSE); evas_object_smart_callback_add(entry, "activated", entry_activated_cb, this); switch(_editBoxInputFlag) { case EditBox::InputFlag::PASSWORD: elm_entry_password_set(entry, EINA_TRUE); elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_EMAIL); break; case EditBox::InputFlag::SENSITIVE: elm_entry_input_hint_set(entry, ELM_INPUT_HINT_SENSITIVE_DATA); break; case EditBox::InputFlag::INITIAL_CAPS_WORD: elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_WORD); break; case EditBox::InputFlag::INITIAL_CAPS_SENTENCE: elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_SENTENCE); break; case EditBox::InputFlag::INITIAL_CAPS_ALL_CHARACTERS: elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_ALLCHARACTER); break; } switch(_editBoxInputMode) { case EditBox::InputMode::ANY: break; case EditBox::InputMode::EMAIL_ADDRESS: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_EMAIL); break; case EditBox::InputMode::NUMERIC: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBER); break; case EditBox::InputMode::PHONE_NUMBER: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_PHONENUMBER); break; case EditBox::InputMode::URL: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_URL); break; case EditBox::InputMode::DECIMAL: elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_HEX); //fixme? break; case EditBox::InputMode::SINGLE_LINE: break; } }
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; }
Eina_Bool Add_To_Most_Visited_Sites_View::_create_main_layout(void) { BROWSER_LOGD("[%s]", __func__); elm_win_conformant_set(m_win, EINA_TRUE); m_conformant = elm_conformant_add(m_navi_bar); if (!m_conformant) { BROWSER_LOGE("elm_conformant_add failed"); return EINA_FALSE; } elm_object_style_set(m_conformant, "internal_layout"); evas_object_size_hint_weight_set(m_conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(m_conformant, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(m_conformant); m_content_box = elm_box_add(m_conformant); if (!m_content_box) { BROWSER_LOGE("elm_box_add failed"); return EINA_FALSE; } evas_object_size_hint_align_set(m_content_box, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(m_content_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(m_content_box); elm_object_content_set(m_conformant, m_content_box); m_url_edit_field = br_elm_editfield_add(m_conformant, EINA_TRUE); if (!m_url_edit_field) { BROWSER_LOGE("elm_editfield_add failed"); return EINA_FALSE; } evas_object_size_hint_align_set(m_url_edit_field, EVAS_HINT_FILL, EVAS_HINT_FILL); br_elm_editfield_entry_single_line_set(m_url_edit_field, EINA_TRUE); br_elm_editfield_label_set(m_url_edit_field, BR_STRING_URL); evas_object_show(m_url_edit_field); Evas_Object *entry = br_elm_editfield_entry_get(m_url_edit_field); elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_URL); if (m_most_visited_sites->m_selected_item->url && strlen(m_most_visited_sites->m_selected_item->url)) /* If modify selected speed dial item. */ elm_entry_entry_set(entry, m_most_visited_sites->m_selected_item->url); else /* If add empty speed dial item. */ elm_entry_entry_set(entry, BROWSER_HTTP_SCHEME); /* To show ime. * __set_focus_editfield_idler_cb is defined in browser_common_view class. */ ecore_idler_add(__set_focus_editfield_idler_cb, m_url_edit_field); elm_box_pack_end(m_content_box, m_url_edit_field); m_history_genlist = _create_history_genlist(); if (!m_history_genlist) { BROWSER_LOGE("_create_history_genlist failed"); return EINA_FALSE; } elm_box_pack_end(m_content_box, m_history_genlist); evas_object_show(m_history_genlist); Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_ADD_TO_MOST_VISITED_SITES, NULL, NULL, m_conformant, "browser_titlebar"); elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL); m_cancel_button = elm_button_add(m_conformant); if (!m_cancel_button) { BROWSER_LOGE("elm_button_add failed"); return EINA_FALSE; } elm_object_style_set(m_cancel_button, "browser/title_button"); elm_object_text_set(m_cancel_button, BR_STRING_CANCEL); evas_object_show(m_cancel_button); evas_object_smart_callback_add(m_cancel_button, "clicked", __cancel_button_clicked_cb, this); elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN, m_cancel_button); m_save_button = elm_button_add(m_conformant); if (!m_save_button) { BROWSER_LOGE("elm_button_add failed"); return EINA_FALSE; } elm_object_style_set(m_save_button, "browser/title_button"); elm_object_text_set(m_save_button, BR_STRING_SAVE); evas_object_show(m_save_button); evas_object_smart_callback_add(m_save_button, "clicked", __save_button_clicked_cb, this); elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN, m_save_button); return EINA_TRUE; }
pswd_popup_t *common_pswd_popup_create(Evas_Object *win_main, const char *pkg_name, pswd_popup_create_req_data_t *popup_info) { __COMMON_FUNC_ENTER__; if (!win_main || !popup_info || !pkg_name) return NULL; /* Lets disable the scan updates so that the UI is not refreshed un necessarily */ wlan_manager_disable_scan_result_update(); pswd_popup_t *pswd_popup_data = (pswd_popup_t *)g_malloc0(sizeof(pswd_popup_t)); popup_btn_info_t popup_btn_data; common_utils_entry_info_t entry_info; Evas_Object *conformant = NULL; conformant = elm_conformant_add(win_main); assertm_if(NULL == conformant, "conformant is NULL!!"); elm_win_conformant_set(win_main, EINA_TRUE); elm_win_resize_object_add(win_main, conformant); evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(conformant); Evas_Object *content = elm_layout_add(conformant); elm_object_content_set(conformant, content); memset(&popup_btn_data, 0, sizeof(popup_btn_data)); popup_btn_data.title_txt = popup_info->title; popup_btn_data.btn1_cb = popup_info->ok_cb; popup_btn_data.btn1_data = popup_info->cb_data; popup_btn_data.btn2_cb = popup_info->cancel_cb; popup_btn_data.btn2_data = popup_info->cb_data; popup_btn_data.btn1_txt = sc(pkg_name, I18N_TYPE_Ok); popup_btn_data.btn2_txt = sc(pkg_name, I18N_TYPE_Cancel); Evas_Object *passpopup = common_utils_show_info_popup(content, &popup_btn_data); elm_object_content_set(content, passpopup); Evas_Object *box = elm_box_add(passpopup); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(box); common_utils_set_entry_info(&entry_info, sc(pkg_name, I18N_TYPE_Enter_password), "", sc(pkg_name, I18N_TYPE_Enter_password), ELM_INPUT_PANEL_LAYOUT_URL); Evas_Object *ly_editfield = common_utils_add_edit_box(box, &entry_info); common_utils_entry_password_set(ly_editfield, TRUE); evas_object_show(ly_editfield); elm_box_pack_end(box, ly_editfield); Evas_Object *check = elm_check_add(box); elm_object_text_set(check, sc(pkg_name, I18N_TYPE_Show_password)); elm_object_focus_allow_set(check, EINA_FALSE); evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add(check, "changed", _check_changed_cb, ly_editfield); evas_object_show(check); elm_box_pack_end(box, check); if (popup_info->show_wps_btn) { Evas_Object *btn = elm_button_add(box); elm_object_text_set(btn, sc(pkg_name, I18N_TYPE_WPS_Button_Connection)); evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_smart_callback_add(btn, "clicked", popup_info->wps_btn_cb, popup_info->cb_data); elm_box_pack_end(box, btn); evas_object_show(btn); } elm_object_content_set(passpopup, box); evas_object_show(passpopup); pswd_popup_data->win = win_main; pswd_popup_data->str_pkg_name = pkg_name; pswd_popup_data->popup_conformant = conformant; pswd_popup_data->popup_entry_lyt = ly_editfield; Evas_Object *popup_entry = common_utils_entry_layout_get_entry(ly_editfield); elm_object_focus_set(popup_entry, EINA_TRUE); __COMMON_FUNC_EXIT__; return pswd_popup_data; }