static void _init_prefs(Evas_Object *win) { Evas_Object *bg, *prefs; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_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); prefs = elm_prefs_add(win); evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, prefs); evas_object_show(prefs); elm_prefs_autosave_set(prefs, EINA_TRUE); prefs_data = elm_prefs_data_new("./data/prefs_example_02.cfg", NULL, EET_FILE_MODE_READ_WRITE); elm_prefs_file_set(prefs, "./data/prefs_example_02.epb", NULL); elm_prefs_data_set(prefs, prefs_data); evas_object_resize(win, 320, 320); }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *prefs, *layout; Elm_Prefs_Data *prefs_data; win = elm_win_add(NULL, "Prefs", ELM_WIN_BASIC); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_title_set(win, "Prefs Example 03"); elm_win_autodel_set(win, EINA_TRUE); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); evas_object_size_hint_min_set(bg, WIDTH, HEIGHT); evas_object_size_hint_max_set(bg, WIDTH, HEIGHT); evas_object_show(bg); layout = elm_layout_add(win); elm_layout_file_set(layout, "prefs_example_03.edj", "prefs_edje"); prefs = elm_prefs_add(win); evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_resize(prefs, WIDTH, HEIGHT); evas_object_show(prefs); evas_object_smart_callback_add(prefs, "page,loaded", _page_loaded_cb, layout); evas_object_smart_callback_add(prefs, "item,changed", _item_changed_cb, layout); elm_prefs_autosave_set(prefs, EINA_TRUE); prefs_data = elm_prefs_data_new("./prefs_example_03.cfg", NULL, EET_FILE_MODE_READ_WRITE); elm_prefs_file_set(prefs, "prefs_example_03.epb", NULL); elm_prefs_data_set(prefs, prefs_data); elm_prefs_item_swallow(prefs, "main:swal", layout); _update_animation_time(prefs, layout); _update_animation(prefs, layout); evas_object_resize(win, WIDTH, HEIGHT); evas_object_show(win); elm_run(); elm_prefs_data_unref(prefs_data); elm_shutdown(); return 0; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *prefs, *notify, *label; Elm_Prefs_Data *prefs_data; win = elm_win_util_standard_add("prefs", "Prefs Example 01"); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); prefs = elm_prefs_add(win); evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, prefs); evas_object_show(prefs); evas_object_smart_callback_add(prefs, "page,saved", _page_saved_cb, NULL); evas_object_smart_callback_add(prefs, "page,loaded", _page_loaded_cb, NULL); evas_object_smart_callback_add(prefs, "item,changed", _item_changed_cb, win); elm_prefs_autosave_set(prefs, EINA_TRUE); prefs_data = elm_prefs_data_new("./prefs_example_01.cfg", NULL, EET_FILE_MODE_READ_WRITE); elm_prefs_file_set(prefs, "prefs_example_01.epb", NULL); elm_prefs_data_set(prefs, prefs_data); label = elm_label_add(win); elm_object_text_set(label, "Setting Values Programmatically"); evas_object_size_hint_align_set(label, 0.5, 0.5); notify = elm_notify_add(win); elm_notify_align_set(notify, 0.5, 1); elm_notify_timeout_set(notify, 2); elm_object_content_set(notify, label); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(notify); evas_object_data_set(notify, "prefs_data", prefs_data); evas_object_resize(win, 320, 320); evas_object_show(win); ecore_timer_add(5.0, _elm_prefs_data_change, notify); elm_run(); elm_prefs_data_unref(prefs_data); elm_shutdown(); return 0; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *prefs, *notify, *label; Elm_Prefs_Data *prefs_data; win = elm_win_util_standard_add("prefs", "Prefs Example 02"); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_win_autodel_set(win, EINA_TRUE); prefs = elm_prefs_add(win); evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, prefs); evas_object_show(prefs); elm_prefs_autosave_set(prefs, EINA_TRUE); prefs_data = elm_prefs_data_new("./prefs_example_02.cfg", NULL, EET_FILE_MODE_READ_WRITE); elm_prefs_file_set(prefs, "prefs_example_02.epb", NULL); elm_prefs_data_set(prefs, prefs_data); label = elm_label_add(win); elm_object_text_set(label, "Editable, Visible and Disable! Just Saying..."); evas_object_size_hint_weight_set(label, 0.0, 0.0); evas_object_size_hint_align_set(label, 0.5, 0.5); notify = elm_notify_add(win); elm_notify_align_set(notify, 0.5, 1); elm_notify_timeout_set(notify, 2); elm_object_content_set(notify, label); evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(notify); evas_object_data_set(notify, "prefs", prefs); evas_object_data_set(notify, "prefs_data", prefs_data); evas_object_smart_callback_add(prefs, "action", _action_cb, notify); evas_object_resize(win, 320, 320); evas_object_show(win); ecore_timer_add(5.0, _elm_prefs_items_change, notify); elm_run(); elm_prefs_data_unref(prefs_data); elm_shutdown(); return 0; }