本文整理汇总了C++中elm_win_resize_object_add函数的典型用法代码示例。如果您正苦于以下问题:C++ elm_win_resize_object_add函数的具体用法?C++ elm_win_resize_object_add怎么用?C++ elm_win_resize_object_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elm_win_resize_object_add函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: elm_main
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win = NULL, *image = NULL, *btn = NULL, *bx = NULL;
char buf[PATH_MAX];
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("test", "Hello Elementary");
elm_win_autodel_set(win, EINA_TRUE);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
snprintf(buf, sizeof(buf), "bodhilogo-simple.png");
image = elm_image_add(win);
/*if (!elm_image_file_set(image, buf, NULL))
{
printf("error: could not load image \"%s\"\n", buf);
return -1;
} */
elm_image_file_set(image, NULL, NULL);
evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, image);
evas_object_show(image);
evas_object_resize(win, 300, 200);
evas_object_show(win);
elm_run();
return EXIT_SUCCESS;
}
示例2: _init_prefs
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);
}
示例3: shelm_clock_dialog
void
shelm_clock_dialog(const char *window_title, const char *window_text, int window_width, int window_height, const char *window_background, Eina_Bool show_seconds, Eina_Bool show_am_pm, const char *time, Eina_Bool is_editable)
{
Evas_Object *window, *background, *frame, *box, *clock, *buttonbar, *button_cancel, *button_ok;
char buf[PATH_MAX];
if (window_title)
window = create_window("shellementary-clockdialog", window_title, cancel_callback);
else
window = create_window("shellementary-clockdialog", _("Set the time"), cancel_callback);
background = create_background(window, window_background, EINA_TRUE);
elm_win_resize_object_add(window, background);
evas_object_show(background);
frame = create_frame(window, EINA_TRUE);
elm_win_resize_object_add(window, frame);
evas_object_show(frame);
box = create_box(window, EINA_FALSE);
elm_object_content_set(frame, box);
evas_object_show(box);
if (window_text)
{
Evas_Object *label;
label = create_label(window, window_text);
elm_box_pack_end(box, label);
evas_object_show(label);
}
clock = create_clock(window, show_seconds, show_am_pm, time, is_editable);
elm_box_pack_end(box, clock);
evas_object_show(clock);
buttonbar = create_box(window, EINA_TRUE);
elm_box_pack_end(box, buttonbar);
evas_object_show(buttonbar);
snprintf(buf, sizeof(buf), "%s/icon-cancel.png", PACKAGE_DATA_DIR);
button_cancel = create_button(window, buf, _("Cancel"));
evas_object_smart_callback_add(button_cancel, "clicked", cancel_callback, NULL);
elm_box_pack_start(buttonbar, button_cancel);
evas_object_show(button_cancel);
snprintf(buf, sizeof(buf), "%s/icon-ok.png", PACKAGE_DATA_DIR);
button_ok = create_button(window, buf, _("OK"));
evas_object_smart_callback_add(button_ok, "clicked", clock_callback, clock);
elm_box_pack_end(buttonbar, button_ok);
evas_object_show(button_ok);
if (!window_width)
evas_object_geometry_get(window, NULL, NULL, &window_width, NULL);
if (!window_height)
evas_object_geometry_get(window, NULL, NULL, NULL, &window_height);
evas_object_resize(window, window_width, window_height);
evas_object_show(window);
}
示例4: _init_photo
static void
_init_photo(Evas_Object *win)
{
Evas_Object *bg, *bx, *photo;
const char * const filename = "./data/th-whiterabbit01.jpg";
bg = elm_bg_add(win);
elm_bg_color_set(bg, 255, 255, 255);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
bx = elm_box_add(win);
elm_box_horizontal_set(bx, EINA_TRUE);
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);
elm_box_homogeneous_set(bx, EINA_TRUE);
elm_win_resize_object_add(win, bx);
photo = elm_photo_add(win);
g_assert(elm_photo_file_set(photo, filename));
elm_photo_size_set(photo, 100);
elm_photo_aspect_fixed_set(photo, EINA_FALSE);
evas_object_smart_callback_add(photo, "clicked", _on_photo_clicked, NULL);
evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_photo_fill_inside_set(photo, EINA_TRUE);
evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, photo);
evas_object_show(photo);
evas_object_show(bx);
}
示例5: elm_win_add
Evas_Object *slideshow_create()
{
_win = elm_win_add(win, "Slide show", ELM_WIN_BASIC);
elm_win_autodel_set(_win, 1);
elm_win_fullscreen_set(_win, 1);
eyelight_smart = eyelight_object_add(evas_object_evas_get(_win));
eyelight_object_presentation_file_set(eyelight_smart, eyelight_object_presentation_file_get(pres));
evas_object_show(eyelight_smart);
elm_win_resize_object_add(_win, eyelight_smart);
container= evas_object_rectangle_add(evas_object_evas_get(_win));
evas_object_color_set(container,0,0,0,0);
evas_object_event_callback_add(container,EVAS_CALLBACK_KEY_DOWN, _slide_cb, NULL);
evas_object_event_callback_add(container,EVAS_CALLBACK_MOUSE_MOVE, _mouse_event_cb, NULL);
evas_object_event_callback_add(container,EVAS_CALLBACK_MOUSE_IN, _mouse_event_cb, NULL);
evas_object_repeat_events_set(container,1);
evas_object_show(container);
elm_win_resize_object_add(_win, container);
evas_object_raise(container);
evas_object_show(_win);
return _win;
}
示例6: elm_main
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *bg, *cal;
win = elm_win_add(NULL, "calendar", ELM_WIN_BASIC);
elm_win_title_set(win, "Calendar Creation Example");
elm_win_autodel_set(win, EINA_TRUE);
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
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);
cal = elm_calendar_add(win);
elm_win_resize_object_add(win, cal);
evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(cal);
evas_object_show(win);
elm_run();
elm_shutdown();
return 0;
}
示例7: _init_video
static void
_init_video(Evas_Object *win)
{
Evas_Object *bg, *video, *emotion;
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);
video = elm_video_add(win);
evas_object_size_hint_weight_set(video, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, video);
evas_object_show(video);
elm_video_file_set(video, VIDEO_FILE);
elm_video_play(video);
emotion = elm_video_emotion_get(video);
evas_object_smart_callback_add(emotion,
"playback_started",
_playback_started,
win);
evas_object_resize(win, 800, 800);
evas_object_show(win);
}
示例8: elm_main
EAPI_MAIN int
elm_main(int argc,
char **argv)
{
Evas_Object *win, *bg;
Elm_Object_Item *it;
const char *data_dir;
elm_app_info_set(elm_main, "elementary", "images");
data_dir = "./data";
snprintf(img1, sizeof(img1), "%s/01.jpg", data_dir);
snprintf(img2, sizeof(img2), "%s/02.jpg", data_dir);
snprintf(img3, sizeof(img3), "%s/03.jpg", data_dir);
snprintf(img4, sizeof(img4), "%s/04.jpg", data_dir);
snprintf(img5, sizeof(img5), "%s/05.jpg", data_dir);
snprintf(img6, sizeof(img6), "%s/06.jpg", data_dir);
snprintf(img7, sizeof(img7), "%s/07.jpg", data_dir);
snprintf(img8, sizeof(img8), "%s/08.jpg", data_dir);
snprintf(img9, sizeof(img9), "%s/09.jpg", data_dir);
win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
evas_object_resize(win, 600, 400);
evas_object_show(win);
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);
slideshow = elm_slideshow_add(win);
elm_slideshow_loop_set(slideshow, EINA_TRUE);
elm_slideshow_cache_before_set(slideshow, 8);
elm_slideshow_cache_after_set(slideshow, 8);
evas_object_size_hint_weight_set(slideshow,
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, slideshow);
evas_object_show(slideshow);
itc.func.get = _get;
itc.func.del = NULL;
elm_slideshow_item_sorted_insert(slideshow, &itc, img1, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img2, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img3, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img4, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img5, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img6, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img7, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img8, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img9, _cmp_func);
/*show last item, otherwise tests fail*/
it = elm_slideshow_item_nth_get(slideshow, 8);
elm_slideshow_item_show(it);
elm_run();
elm_shutdown();
return 0;
}
示例9: elm_main
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;
}
示例10: elm_main
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *bg;
Evas_Object *thumb;
char buf[PATH_MAX];
#ifdef ELM_ETHUMB
Ethumb_Client *client;
#endif
elm_need_ethumb();
elm_app_info_set(elm_main, "elementary", "images/plant_01.jpg");
win = elm_win_add(NULL, "thumb", ELM_WIN_BASIC);
elm_win_title_set(win, "Thumbnailer");
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
elm_win_autodel_set(win, EINA_TRUE);
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);
#ifdef ELM_ETHUMB
client = elm_thumb_ethumb_client_get();
if (!client)
{
printf("error: could not get Ethumb client.\n");
return 1;
}
ethumb_client_size_set(client, 160, 160);
#endif
thumb = elm_thumb_add(win);
evas_object_smart_callback_add(thumb, "generate,start", _generation_started_cb, NULL);
evas_object_smart_callback_add(thumb, "generate,stop", _generation_finished_cb, NULL);
evas_object_smart_callback_add(thumb, "generate,error", _generation_error_cb, NULL);
elm_thumb_editable_set(thumb, EINA_FALSE);
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
elm_thumb_file_set(thumb, buf, NULL);
elm_thumb_reload(thumb);
evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, thumb);
evas_object_show(thumb);
evas_object_size_hint_min_set(bg, 160, 160);
evas_object_size_hint_max_set(bg, 640, 640);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run(); /* and run the program now, starting to handle all
* events, etc. */
elm_shutdown(); /* clean up and shut down */
/* exit code */
return 0;
}
示例11: elm_main
EAPI_MAIN int
elm_main(int argc, char **argv) {
Evas_Object *map = NULL;
Evas_Object *bg = NULL;
Evas_Object *icon = NULL;
Elm_Map_Overlay *item = NULL;
win = elm_win_add(NULL, "Main Window", ELM_WIN_BASIC);
elm_win_title_set(win, "Hello, My World Map!");
elm_win_autodel_set(win, EINA_TRUE);
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
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);
map = elm_map_add(win);
evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, map);
evas_object_show(map);
icon = elm_icon_add(win);
elm_object_text_set(icon, "Icon1");
elm_icon_standard_set(icon, "home");
item = elm_map_overlay_add(map,21.009865, 52.224855);
elm_map_overlay_icon_set(item, icon);
evas_object_smart_callback_add(win, "focus,in", _register_cb, map);
register_request_listener(EVENT_SET_FOCUS, set_focus, map);
register_request_listener(EVENT_UNSET_FOCUS, unset_focus, map);
register_request_listener(EVENT_SET_FOCUSABLE, set_focusable, map);
register_request_listener(EVENT_UNSET_FOCUSABLE, unset_focusable, map);
register_request_listener(EVENT_ADD_CHILDREN, add_children,map);
register_request_listener(EVENT_RM_CHILDREN, rm_children,item);
register_request_listener(EVENT_HIDE, hide, map);
register_request_listener(EVENT_SHOW, show, map);
register_request_listener(ACTION_ZOOM_IN, register_action_zoom_in, map);
register_request_listener(ACTION_ZOOM_OUT, register_action_zoom_out, map);
register_request_listener(ACTION_SCROLL_LEFT, register_action_scroll_left, map);
register_request_listener(ACTION_SCROLL_RIGHT, register_action_scroll_right, map);
register_request_listener(ACTION_SCROLL_UP, register_action_scroll_up, map);
register_request_listener(ACTION_SCROLL_DOWN, register_action_scroll_down, map);
register_request_listener(ACTION_CLICK, register_action_click, map);
register_request_listener(ACTION_PRESS, register_action_press, map);
elm_map_zoom_set(map, 2);
evas_object_resize(win, 800, 800);
evas_object_show(win);
elm_run();
request_shutdown();
elm_shutdown();
return 0;
}
示例12: elm_main
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *bg, *bx, *tb, *bt, *menu;
Elm_Object_Item *tb_it;
win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
elm_win_title_set(win, "Toolbar Example");
evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);
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);
bx = elm_box_add(win);
elm_win_resize_object_add(win, bx);
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);
evas_object_show(bx);
bt = elm_button_add(win);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(bt, "Button");
evas_object_show(bt);
tb = elm_toolbar_add(win);
evas_object_size_hint_weight_set(tb, 0.0, 0.0);
evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
evas_object_show(tb);
elm_toolbar_item_append(tb, "document-print", "Print", NULL, NULL);
elm_toolbar_item_append(tb, "folder-new", "Folder", NULL, NULL);
elm_toolbar_item_append(tb, "clock", "Clock", NULL, NULL);
elm_toolbar_item_append(tb, "refresh", "Update", NULL, NULL);
elm_toolbar_menu_parent_set(tb, win);
tb_it = elm_toolbar_item_append(tb, "mail-send", "Send Mail", NULL, NULL);
elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
menu = elm_toolbar_item_menu_get(tb_it);
elm_menu_item_add(menu, NULL, "emptytrash", "Empty Trash", NULL, NULL);
elm_menu_item_add(menu, NULL, "trashcan_full", "Full Trash", NULL, NULL);
elm_toolbar_item_priority_set(tb_it, 10);
elm_box_pack_end(bx, tb);
elm_box_pack_end(bx, bt);
evas_object_resize(win, 230, 200);
evas_object_show(win);
elm_run();
elm_shutdown();
return 0;
}
示例13: elm_main
EAPI_MAIN int
elm_main(int argc,
char **argv)
{
Evas_Object *win, *grid, *idx;
Elm_Object_Item *gg_it;
unsigned int i;
Elm_Gengrid_Item_Class gic;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
elm_app_info_set(elm_main, "elementary", "images");
win = elm_win_util_standard_add("index", "Index Example");
elm_win_autodel_set(win, EINA_TRUE);
grid = elm_gengrid_add(win);
elm_gengrid_item_size_set(grid, 150, 150);
gic.item_style = "default";
gic.func.text_get = _grid_label_get;
gic.func.content_get = _grid_content_get;
gic.func.state_get = NULL;
gic.func.del = NULL;
evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, grid);
evas_object_show(grid);
idx = elm_index_add(win);
evas_object_size_hint_weight_set(idx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, idx);
evas_object_show(idx);
for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
{
char buf[32];
gg_it = elm_gengrid_item_append(grid, &gic, (void *)i, NULL, NULL);
/* indexing by first letters */
snprintf(buf, sizeof(buf), "%c", items[i][0]);
elm_index_item_sorted_insert(idx, buf, NULL, gg_it, _index_icmp, NULL);
}
evas_object_smart_callback_add(idx, "delay,changed", _index_changed, NULL);
elm_index_autohide_disabled_set(idx, EINA_FALSE);
elm_index_level_go(idx, 0);
evas_object_resize(win, 320, 300);
evas_object_show(win);
elm_run();
elm_shutdown();
return 0;
}
示例14: elm_main
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *bg, *map, *box, *bt;
win = elm_win_add(NULL, "map", ELM_WIN_BASIC);
elm_win_title_set(win, "Map Creation Example");
evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);
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);
map = elm_map_add(win);
elm_win_resize_object_add(win, map);
evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(map);
box = elm_box_add(win);
evas_object_show(box);
bt = elm_button_add(win);
elm_object_text_set(bt, "+");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_zoom_in, map);
bt = elm_button_add(win);
elm_object_text_set(bt, "-");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_zoom_out, map);
bt = elm_button_add(win);
elm_object_text_set(bt, "X");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_zoom_fit, map);
bt = elm_button_add(win);
elm_object_text_set(bt, "#");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_zoom_fill, map);
elm_map_zoom_set(map, 12);
elm_map_region_show(map, -43.2, -22.9);
evas_object_resize(win, 512, 512);
evas_object_show(win);
ecore_timer_add(0.5, _nasty_hack, win);
elm_run();
elm_shutdown();
return 0;
}
示例15: elm_main
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);
}