static void _menu_open_cb(void *data, Evas_Object *obj, void *event_info) { Evas_Coord x, y; char buf[PATH_MAX]; if (!enlil_data->library) return; if (menu) evas_object_del(menu); menu = elm_menu_add(enlil_data->win->win); if (!enlil_library_netsync_account_get(enlil_data->library)) { elm_menu_item_add(menu, NULL, NULL, D_("Set the Flickr account"), _account_set_cb, NULL); } else { snprintf(buf, PATH_MAX, D_("Flickr account : %s"), enlil_library_netsync_account_get(enlil_data->library)); elm_menu_item_add(menu, NULL, NULL, buf, NULL, NULL); elm_menu_item_add(menu, NULL, NULL, D_("Change the Flickr account"), _account_set_cb, NULL); } evas_object_show(menu); evas_pointer_output_xy_get(evas_object_evas_get(obj), &x, &y); elm_menu_move(menu, x, y); }
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; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bx, *tb, *bt, *menu; Elm_Object_Item *tb_it; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("toolbar", "Toolbar Example"); 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); 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(); return 0; }
Tag_Menu * tag_menu_new(Evas_Object *parent, Enlil_Tag *tag) { Evas_Object *menu; Tag_Menu *cm = calloc(1, sizeof(Tag_Menu)); cm->tag = tag; menu = elm_menu_add(parent); evas_object_smart_callback_add(menu, "clicked", _menu_dismiss_cb, cm); cm->menu = menu; elm_menu_item_add(menu, NULL, NULL, D_("Delete the tag"), _tag_del_cb, cm); evas_object_show(menu); return cm; }
EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *obj, *photocam, *menu; Orient_Data *orient_data; char buf[PATH_MAX]; elm_app_info_set(elm_main, "elementary", "images/insanely_huge_test_image.jpg"); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("photocam", "Photocam"); elm_win_autodel_set(win, EINA_TRUE); photocam = elm_photocam_add(win); snprintf(buf, sizeof(buf), "%s/images/insanely_huge_test_image.jpg", elm_app_data_dir_get()); elm_photocam_file_set(photocam, buf); elm_scroller_bounce_set(photocam, EINA_FALSE, EINA_TRUE); evas_object_smart_callback_add(photocam, "loaded,detail", _bring_in, NULL); evas_object_resize(photocam, 500, 400); evas_object_show(photocam); obj = elm_button_add(win); elm_object_text_set(obj, "Fit"); evas_object_show(obj); evas_object_resize(obj, 50, 30); evas_object_move(obj, 10, 410); evas_object_smart_callback_add(obj, "clicked", _fit, photocam); obj = elm_button_add(win); elm_object_text_set(obj, "Unfit"); evas_object_show(obj); evas_object_resize(obj, 70, 30); evas_object_move(obj, 70, 410); evas_object_smart_callback_add(obj, "clicked", _unfit, photocam); orient_data = (Orient_Data *)malloc(sizeof(Orient_Data)); orient_data->ph = photocam; orient_data->orient = 0; menu = elm_menu_add(win); elm_menu_item_add(menu, NULL, NULL, "orient 0", _orient_do, orient_data); orient_data = (Orient_Data *)malloc(sizeof(Orient_Data)); orient_data->ph = photocam; orient_data->orient = 1; elm_menu_item_add(menu, NULL, NULL, "orient 90", _orient_do, orient_data); orient_data = (Orient_Data *)malloc(sizeof(Orient_Data)); orient_data->ph = photocam; orient_data->orient = 2; elm_menu_item_add(menu, NULL, NULL, "orient 180", _orient_do, orient_data); orient_data = (Orient_Data *)malloc(sizeof(Orient_Data)); orient_data->ph = photocam; orient_data->orient = 3; elm_menu_item_add(menu, NULL, NULL, "orient 270", _orient_do, orient_data); orient_data = (Orient_Data *)malloc(sizeof(Orient_Data)); orient_data->ph = photocam; orient_data->orient = 4; elm_menu_item_add(menu, NULL, NULL, "flip horizontal", _orient_do, orient_data); orient_data = (Orient_Data *)malloc(sizeof(Orient_Data)); orient_data->ph = photocam; orient_data->orient = 5; elm_menu_item_add(menu, NULL, NULL, "flip vertical", _orient_do, orient_data); orient_data = (Orient_Data *)malloc(sizeof(Orient_Data)); orient_data->ph = photocam; orient_data->orient = 6; elm_menu_item_add(menu, NULL, NULL, "flip transverse", _orient_do, orient_data); orient_data = (Orient_Data *)malloc(sizeof(Orient_Data)); orient_data->ph = photocam; orient_data->orient = 7; elm_menu_item_add(menu, NULL, NULL, "flip transpose", _orient_do, orient_data); obj = elm_button_add(win); elm_object_text_set(obj, "Orient"); evas_object_show(obj); evas_object_resize(obj, 70, 30); evas_object_move(obj, 470, 410); evas_object_smart_callback_add(obj, "clicked", _orient, menu); obj = elm_slider_add(win); elm_object_text_set(obj, "Zoom"); evas_object_show(obj); evas_object_resize(obj, 300, 30); evas_object_move(obj, 150, 410); evas_object_smart_callback_add(obj, "changed", _zoom, photocam); evas_object_resize(win, 500, 440); evas_object_show(win); elm_run(); return 0; }