Beispiel #1
0
/* ad-hoc network
  .-box-------------------------------------------------------------------.
  | .-scroller----------------------------------------------------------. |
  | | .-table---------------------------------------------------------. | |
  | | | Crate an Ad-Hoc Network                                       | | |
  | | | ESSID:                  [...................................] | | |
  | | | IP:                     [...................................] | | |
  | | | Channel:                [...................................] | | |
  | | | [] Activate Internet Connection Sharing                       | | |
  | | | [] Use Encryption (WEP only)                                  | | |
  | | | Key:                    [...................................] | | |
  | | `---------------------------------------------------------------' | |
  | `-------------------------------------------------------------------' |
  | .-box---------------------------------------------------------------. |
  | |                                                    [Cancel]  [OK] | |
  | `-------------------------------------------------------------------' |
  `-----------------------------------------------------------------------'
*/
void
wicd_adhoc(void)
{
    Evas_Object *bx, *sc, *tb, *ob, *bx2;

    bx = elm_box_add(wicdelm->win);
    elm_box_homogeneous_set(bx, EINA_FALSE);
    elm_box_horizontal_set(bx, EINA_FALSE);
    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(bx);
    wicdelm->adhoc.page = bx;

    sc = elm_scroller_add(wicdelm->win);
    elm_scroller_content_min_limit(sc, EINA_TRUE, EINA_FALSE);
    elm_scroller_policy_set(sc
        , ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
    evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
    elm_box_pack_end(bx, sc);
    evas_object_show(sc);

    // table
    tb = elm_table_add(wicdelm->win);
    elm_table_homogeneous_set(tb, EINA_FALSE);
    evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
    elm_object_content_set(sc, tb);
    evas_object_show(tb);

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "<b>Create an Ad-Hoc Network</b>");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 0, 2, 1);
    evas_object_show(ob);

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "ESSID:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 1, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 1, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.essid = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "IP:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 2, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 2, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.ip = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "Channel:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 3, 1, 1);
    evas_object_show(ob);
    ob = elm_slider_add(wicdelm->win);
    elm_slider_min_max_set(ob, 1.0, 14.0);
    elm_slider_indicator_format_set(ob, "%02.0f");
    elm_slider_unit_format_set(ob, "%02.0f");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 3, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "delay,changed", _changed_cb, NULL);
    wicdelm->adhoc.channel = ob;

    ob = elm_check_add(wicdelm->win);
    elm_object_text_set(ob, "Share Internet");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 4, 2, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.shareInternet = ob;

    ob = elm_check_add(wicdelm->win);
    elm_object_text_set(ob, "WEP Encryption");
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.5);
    elm_table_pack(tb, ob, 0, 5, 2, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.useEncryption = ob;

    ob = elm_label_add(wicdelm->win);
    elm_object_text_set(ob, "Key:");
    evas_object_size_hint_weight_set(ob, 0.0, 0.0);
    evas_object_size_hint_align_set(ob, 0.0, 0.5);
    elm_table_pack(tb, ob, 0, 6, 1, 1);
    evas_object_show(ob);
    ob = elm_entry_add(wicdelm->win);
    elm_entry_scrollable_set(ob, EINA_TRUE);
    elm_entry_single_line_set(ob, EINA_TRUE);
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_size_hint_weight_set(ob, EVAS_HINT_EXPAND, 0.0);
    elm_table_pack(tb, ob, 1, 6, 1, 1);
    evas_object_show(ob);
    evas_object_smart_callback_add(ob, "changed", _changed_cb, NULL);
    wicdelm->adhoc.key = ob;

    bx2 = elm_box_add(wicdelm->win);
    elm_box_homogeneous_set(bx2, EINA_TRUE);
    elm_box_horizontal_set(bx2, EINA_TRUE);
    evas_object_size_hint_align_set(bx2, 1.0, 1.0);
    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
    elm_box_pack_end(bx, bx2);
    evas_object_show(bx2);

    ob = elm_button_add(wicdelm->win);
    elm_object_text_set(ob, "Cancel");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_smart_callback_add(ob, "clicked", _cancel_cb, NULL);
    elm_box_pack_end(bx2, ob);
    evas_object_show(ob);

    ob = elm_button_add(wicdelm->win);
    elm_object_text_set(ob, "Ok");
    evas_object_size_hint_align_set(ob, EVAS_HINT_FILL, 0.0);
    evas_object_smart_callback_add(ob, "clicked", _ok_cb, NULL);
    elm_box_pack_end(bx2, ob);
    evas_object_show(ob);

    wicdelm->adhoc.item = elm_naviframe_item_simple_push(wicdelm->naviframe, bx);
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *popup, *btn1, *btn2, *btn3, *icon1;
   char buf[256];

   elm_app_info_set(elm_main, "elementary", "images/logo_small.png");
   win = elm_win_add(NULL, "popup", ELM_WIN_BASIC);
   elm_win_title_set(win, "Popup");
   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);

   popup = elm_popup_add(win);

   // Setting popup content-text
   elm_object_text_set(popup, "This is the Content-Text for popup. The wrap"
            "for the content-text is character wrapping");
   // Setting the wrapping type to character wrapping
   elm_popup_content_text_wrap_type_set(popup, ELM_WRAP_CHAR);

   // Seting popup title-text
   elm_object_part_text_set(popup, "title,text", "Title");

   icon1 = elm_icon_add(popup);
   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
   elm_icon_file_set(icon1, buf, NULL);
   //Setting popup title-icon
   elm_object_part_content_set(popup, "title,icon", icon1);

   // Creating the first action button
   btn1 = elm_button_add(popup);
   elm_object_text_set(btn1, "OK");

   // Setting the fist action button
   elm_object_part_content_set(popup, "button1", btn1);
   evas_object_smart_callback_add(btn1, "clicked", _response_cb, popup);

   // Creating the second action button
   btn2 = elm_button_add(popup);
   elm_object_text_set(btn2, "Cancel");

   // Setting the second action button
   elm_object_part_content_set(popup, "button2", btn2);
   evas_object_smart_callback_add(btn2, "clicked", _response_cb, popup);

   btn3 = elm_button_add(popup);
   elm_object_text_set(btn3, "Close");
   // Setting this action button
   elm_object_part_content_set(popup, "button3", btn3);
   // Setting the orientation of popup to Top
   elm_popup_orient_set(popup, ELM_POPUP_ORIENT_TOP);
   // Display the popup object
   evas_object_show(popup);

   evas_object_resize(win, 480, 800);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Beispiel #3
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *bx, *hbx, *li, *bt;

   win = elm_win_add(NULL, "list", ELM_WIN_BASIC);
   elm_win_title_set(win, "List Items 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);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   li = elm_list_add(win);
   evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(bx, li);

   elm_list_item_append(li, "Item 0", NULL, NULL, NULL, NULL);
   elm_list_item_append(li, "Item 1", NULL, NULL, NULL, NULL);
   elm_list_item_append(li, "Item 2", NULL, NULL, NULL, NULL);

   hbx = elm_box_add(win);
   elm_box_horizontal_set(hbx, EINA_TRUE);
   evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0);
   elm_box_pack_end(bx, hbx);
   evas_object_show(hbx);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Prepend item");
   evas_object_smart_callback_add(bt, "clicked", _prepend_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Append item");
   evas_object_smart_callback_add(bt, "clicked", _add_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   hbx = elm_box_add(win);
   elm_box_horizontal_set(hbx, EINA_TRUE);
   evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0);
   elm_box_pack_end(bx, hbx);
   evas_object_show(hbx);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Append with icon");
   evas_object_smart_callback_add(bt, "clicked", _add_ic_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Append with selected function");
   evas_object_smart_callback_add(bt, "clicked", _add_func_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Append with data");
   evas_object_smart_callback_add(bt, "clicked", _add_data_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   hbx = elm_box_add(win);
   elm_box_horizontal_set(hbx, EINA_TRUE);
   evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0);
   elm_box_pack_end(bx, hbx);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(hbx);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Delete item");
   evas_object_smart_callback_add(bt, "clicked", _del_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Unselect item");
   evas_object_smart_callback_add(bt, "clicked", _unselect_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Print items");
   evas_object_smart_callback_add(bt, "clicked", _print_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Clear");
   evas_object_smart_callback_add(bt, "clicked", _clear_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   hbx = elm_box_add(win);
   elm_box_horizontal_set(hbx, EINA_TRUE);
   evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0);
   elm_box_pack_end(bx, hbx);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(hbx);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Select next item");
   evas_object_smart_callback_add(bt, "clicked", _select_next_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Insert after item");
   evas_object_smart_callback_add(bt, "clicked", _insert_after_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Select previous item");
   evas_object_smart_callback_add(bt, "clicked", _select_prev_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Insert before item");
   evas_object_smart_callback_add(bt, "clicked", _insert_before_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   hbx = elm_box_add(win);
   elm_box_horizontal_set(hbx, EINA_TRUE);
   evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, 0);
   elm_box_pack_end(bx, hbx);
   evas_object_show(hbx);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Set as separator");
   evas_object_smart_callback_add(bt, "clicked", _set_separator_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Disable item");
   evas_object_smart_callback_add(bt, "clicked", _disable_cb, li);
   elm_box_pack_end(hbx, bt);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
   evas_object_show(bt);

   elm_list_go(li);
   evas_object_show(li);

   evas_object_resize(win, 320, 600);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Beispiel #4
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *panes, *panes_h, *bt;

   win = elm_win_add(NULL, "panes", ELM_WIN_BASIC);
   elm_win_title_set(win, "Panes 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);
   elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
   evas_object_show(bg);

   panes = elm_panes_add(win);
   elm_win_resize_object_add(win, panes);
   evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(panes, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(panes);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Left");
   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);
   evas_object_show(bt);
   elm_object_part_content_set(panes, "left", bt);

   panes_h = elm_panes_add(win);
   elm_panes_horizontal_set(panes_h, EINA_TRUE);
   evas_object_size_hint_weight_set(panes_h, EVAS_HINT_EXPAND,
                                    EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(panes_h, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(panes_h);
   elm_object_part_content_set(panes, "right", panes_h);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Up");
   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);
   evas_object_show(bt);
   elm_object_part_content_set(panes_h, "left", bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Down");
   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);
   evas_object_show(bt);
   elm_object_part_content_set(panes_h, "right", bt);

   evas_object_smart_callback_add(panes, "clicked", _clicked, panes);
   evas_object_smart_callback_add(panes, "clicked,double", _clicked_double,
                                  panes);
   evas_object_smart_callback_add(panes, "press", _press, panes);
   evas_object_smart_callback_add(panes, "unpress", _unpress, panes);

   evas_object_resize(win, 320, 400);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *obj, *icon, *box, *vbox, *btn, *dummy;
   Eina_List *objs = NULL;
   char buf[PATH_MAX];
   int i;

   elm_app_info_set(elm_main, "elementary", "images/icon_07.png");
   /* add a window */
   win = elm_win_add(NULL, "transit", ELM_WIN_BASIC);
   elm_win_title_set(win, "Transit Example");
   evas_object_smart_callback_add(win, "delete,request", on_done, NULL);
   elm_win_autodel_set(win, EINA_TRUE);

   /* add a scalable white background to this window */
   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);
   evas_object_size_hint_min_set(bg, 640, 640);
   evas_object_size_hint_max_set(bg, 640, 640);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);

   box = elm_box_add(win);
   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);
   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   dummy = elm_bg_add(win);
   evas_object_size_hint_weight_set(dummy, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_box_pack_end(box, dummy);
   evas_object_show(dummy);

   /* add an object that we are going to play with */
   obj = elm_button_add(win);
   elm_object_text_set(obj, "Transformed object!");
   icon = elm_icon_add(win);
   snprintf(buf, sizeof(buf), "%s/images/icon_07.png", elm_app_data_dir_get());
   elm_icon_file_set(icon, buf, NULL);
   elm_object_part_content_set(obj, "icon", icon);
   evas_object_move(obj, 160, 60);
   evas_object_resize(obj, 250, 100);
   evas_object_show(obj);

   objs = eina_list_append(objs, obj);

   /* add another object that we are going to play with */
   obj = elm_button_add(win);
   elm_object_text_set(obj, "Another object!");
   icon = elm_icon_add(win);
   snprintf(buf, sizeof(buf), "%s/images/icon_08.png", elm_app_data_dir_get());
   elm_icon_file_set(icon, buf, NULL);
   elm_object_part_content_set(obj, "icon", icon);
   evas_object_move(obj, 160, 60);
   evas_object_resize(obj, 250, 100);

   objs = eina_list_append(objs, obj);

   btn = elm_button_add(win);
   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_object_text_set(btn, "Transit!");
   elm_box_pack_end(box, btn);
   evas_object_show(btn);

   evas_object_smart_callback_add(btn, "clicked", _transit_start, objs);

   vbox = elm_box_add(win);
   evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
   evas_object_size_hint_align_set(vbox, EVAS_HINT_FILL, 0.0);

   for (i = 0; _transitions[i].label; i++)
     _checkbox_transition_add(vbox, _transitions[i].label, &_transitions[i].checked);

   elm_box_pack_end(box, vbox);
   evas_object_show(vbox);

   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
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;
}
Beispiel #7
0
static Evas_Object *
_create_dialog (
        const gchar *username)
{
    Evas_Object *dialog, *bg, *box, *frame, *content_box;
    Evas_Object *button_frame, *pad_frame, *button_box;
    Evas_Object *cancel_button, *ok_button;

    g_free (main_dialog);
    main_dialog = g_malloc0 (sizeof (MainDialog));

    /* main window */
    dialog = elm_win_add (NULL, "dialog", ELM_WIN_BASIC);
    elm_win_title_set (dialog, "Enter user password");
    elm_win_center (dialog, EINA_TRUE, EINA_TRUE);
    evas_object_smart_callback_add (dialog, "delete,request",
            _on_close_dialog_clicked, dialog);
    main_dialog->dialog = dialog;

    /* window background */
    bg = elm_bg_add (dialog);
    evas_object_size_hint_weight_set (bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show (bg);
    elm_win_resize_object_add (dialog, bg);

    box = elm_box_add (dialog);
    evas_object_size_hint_min_set (box, 200, 200);
    evas_object_size_hint_weight_set (box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show (box);
    elm_win_resize_object_add (dialog, box);

    frame = elm_frame_add (dialog);
    elm_object_style_set (frame, "pad_small");
    evas_object_size_hint_weight_set (frame, EVAS_HINT_EXPAND,
            EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set (frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_show (frame);
    elm_box_pack_start (box, frame);

    content_box = elm_box_add (dialog);
    elm_box_padding_set (content_box, 0, 3);
    evas_object_size_hint_weight_set (content_box, EVAS_HINT_EXPAND,
            EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set (content_box, 0.0, 0.0);
    evas_object_show (content_box);
    elm_object_part_content_set (frame, NULL, content_box);

    main_dialog->username_entry = _add_entry (dialog, content_box, "Username:"******"Password:"******"outdent_bottom");
    evas_object_size_hint_weight_set (button_frame, 0.0, 0.0);
    evas_object_size_hint_align_set (button_frame, EVAS_HINT_FILL,
            EVAS_HINT_FILL);
    evas_object_show (button_frame);
    elm_box_pack_end (box, button_frame);

    pad_frame = elm_frame_add (dialog);
    elm_object_style_set (pad_frame, "pad_medium");
    evas_object_show (pad_frame);
    elm_object_part_content_set (button_frame, NULL, pad_frame);

    button_box = elm_box_add (dialog);
    elm_box_horizontal_set (button_box, 1);
    elm_box_homogeneous_set (button_box, 1);
    evas_object_show (button_box);
    elm_object_part_content_set (pad_frame, NULL, button_box);

    /* Cancel button */
    cancel_button = elm_button_add (dialog);
    elm_object_text_set (cancel_button, "Cancel");
    evas_object_size_hint_weight_set (cancel_button,
            EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set (cancel_button,
            EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_smart_callback_add (cancel_button, "clicked",
            _on_close_dialog_clicked, dialog);
    evas_object_show (cancel_button);
    elm_box_pack_end (button_box, cancel_button);

    /* OK button */
    ok_button = elm_button_add (dialog);
    elm_object_text_set (ok_button, "OK");
    evas_object_size_hint_weight_set (ok_button,
            EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set (ok_button,
            EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_smart_callback_add (ok_button, "clicked", _on_ok_dialog_clicked,
            dialog);
    evas_object_show (ok_button);
    elm_box_pack_end (button_box, ok_button);

    return dialog;
}
Beispiel #8
0
int
ewallset_main()
{
	Evas_Object *win, *bg, *bx, *bx2, *bx3, *bt, *ic, *image , *frame, *rd, *rdg,*sl;
	int tw,th;
	char buf[1024];
	
	e->win = elm_win_add(NULL, "Ewallset", ELM_WIN_BASIC);
	elm_win_autodel_set(e->win, 1);
	evas_object_focus_set(e->win, 1);
	evas_object_smart_callback_add(e->win, "delete,request", usr_click_cancel, NULL);
	
	bg = elm_bg_add(e->win);
	elm_win_resize_object_add(e->win, bg);
	evas_object_size_hint_weight_set(bg, 1.0, 1.0);
	evas_object_show(bg);
	
	bx = elm_box_add(e->win);
	evas_object_size_hint_weight_set(bx, 1.0, 1.0);
	elm_win_resize_object_add(e->win,bx);
	evas_object_show(bx);
	
	image = elm_image_add(bx);
	elm_image_file_set(image, e->image_file, NULL);
	evas_object_size_hint_weight_set(image, 1.0, 1.0);
        evas_object_size_hint_align_set(image, -1.0, -1.0);
	elm_image_object_size_get(image,&e->w,&e->h);
	get_correct_size(410,e->w,e->h,&tw,&th,BY_HEIGHT);
	//printf("Res:%dx%d \n",e->w,e->h);
	//_get_correct_size(w,h,&tw,&th);
	evas_object_size_hint_min_set(image, tw, th);
	elm_box_pack_end(bx, image);
	evas_object_show(image);
	
	snprintf(buf, sizeof(buf), "Ewallset - %s", ecore_file_file_get(e->image_file));
	elm_win_title_set(e->win, buf);

	e->quality = 90;
	sl = elm_slider_add(e->win);
	elm_slider_indicator_show_set(sl, EINA_FALSE);
	elm_object_text_set(sl, "Quality");
	elm_slider_unit_format_set(sl, "%1.0f Percent");
	elm_slider_span_size_set(sl, 250);
	elm_slider_min_max_set(sl, 10, 100);
	elm_slider_value_set(sl, e->quality);
	evas_object_smart_callback_add(sl, "delay,changed", slider_change_cb, NULL);
	evas_object_size_hint_align_set(sl, 0.5, 0.5);
	evas_object_size_hint_weight_set(sl, 0.0, 0.0);
	elm_box_pack_end(bx, sl);
	evas_object_show(sl);

	frame = elm_frame_add(e->win);
	elm_object_text_set(frame,"Where to place this Wallpaper");
	elm_object_style_set(frame,"outdent_bottom");
	elm_box_pack_end(bx, frame);
	evas_object_show(frame);
	
	bx3 = elm_box_add(e->win);
	elm_box_horizontal_set(bx3, 1);
	elm_object_content_set(frame,bx3);
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, 0);
	elm_object_text_set(rd, "All Desktops");
	evas_object_smart_callback_add(rd, "changed", desk_changed,e->rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	e->rdg = rd;
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, 1);
	elm_radio_group_add(rd, e->rdg);
	elm_object_text_set(rd, "This Desktop");
	evas_object_smart_callback_add(rd, "changed", desk_changed,e->rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, 2);
	elm_radio_group_add(rd, e->rdg);
	elm_object_text_set(rd, "This Screen");
	evas_object_smart_callback_add(rd, "changed", desk_changed,e->rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	
	ecore_timer_add(0.1,get_config_timer,NULL);
	
	
	frame = elm_frame_add(e->win);
	elm_object_text_set(frame,"Fill and Stretch Options");
	elm_object_style_set(frame,"outdent_top");
	elm_box_pack_end(bx, frame);
	evas_object_show(frame);
	
	bx3 = elm_box_add(e->win);
	elm_box_horizontal_set(bx3, 1);
    elm_box_homogeneous_set(bx3, EINA_TRUE);
	elm_object_content_set(frame,bx3);
	evas_object_show(bx3);
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, IMPORT_STRETCH);
	elm_object_text_set(rd, "Stretch");
	evas_object_smart_callback_add(rd, "changed", selection_changed,rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	rdg = rd;
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, IMPORT_TILE);
	elm_radio_group_add(rd, rdg);
	elm_object_text_set(rd, "Tile");
	evas_object_smart_callback_add(rd, "changed", selection_changed,rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, IMPORT_CENTER);
	elm_radio_group_add(rd, rdg);
	elm_object_text_set(rd, "Center");
	evas_object_smart_callback_add(rd, "changed", selection_changed,rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, IMPORT_SCALE_ASPECT_IN);
	elm_radio_group_add(rd, rdg);
	elm_object_text_set(rd, "Within");
	evas_object_smart_callback_add(rd, "changed", selection_changed,rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, IMPORT_SCALE_ASPECT_OUT);
	elm_radio_group_add(rd, rdg);
	elm_object_text_set(rd, "Fill");
	evas_object_smart_callback_add(rd, "changed", selection_changed,rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	
	rd = elm_radio_add(e->win);
	elm_radio_state_value_set(rd, IMPORT_SCALE_ASPECT_IN_TILE);
	elm_radio_group_add(rd, rdg);
	elm_object_text_set(rd, "Tile-In");
	evas_object_smart_callback_add(rd, "changed", selection_changed,rdg);
	elm_box_pack_end(bx3, rd);
	evas_object_show(rd);
	
	elm_radio_value_set(rdg, 0);

	bx2 = elm_box_add(e->win);
	elm_box_horizontal_set(bx2, 1);
	elm_box_homogeneous_set(bx2, EINA_TRUE);
	elm_box_pack_end(bx, bx2);
	evas_object_show(bx2);
	
	ic = elm_icon_add(e->win);
	elm_icon_file_set(ic, "/usr/share/ewallset/data/dialog-ok.png", NULL);
	bt = elm_button_add(bx2);
	elm_object_text_set(bt, "Continue");
	//elm_button_icon_set(bt, ic);
	evas_object_smart_callback_add(bt, "clicked", usr_click_ok, NULL);
	elm_box_pack_end(bx2, bt);
	evas_object_show(bt);
   
	ic = elm_icon_add(e->win);
	elm_icon_file_set(ic, "/usr/share/ewallset/data/dialog-cancel.png", NULL);
	bt = elm_button_add(bx2);
	elm_object_text_set(bt, "Cancel");
	//elm_button_icon_set(bt, ic);
	evas_object_smart_callback_add(bt, "clicked", usr_click_cancel, NULL);
	elm_box_pack_end(bx2, bt);
	evas_object_show(bt);
	evas_object_show(e->win);
	//evas_object_del(e->win);
return 0;
}
Beispiel #9
0
static void
on_contact_select(void *data, Evas_Object *obj, void *event_info)
{
   Data_Contact *ctc = data;
   if (!ctc)
     {
        Evas_Object *win, *bx, *bt, *sc, *en;

        win = window;
        inwin2 = elm_win_inwin_add(win);
        elm_object_style_set(inwin2, "minimal_vertical");
        
        bx = elm_box_add(win);
        evas_object_size_hint_weight_set(bx, 1.0, 0.0);
        evas_object_size_hint_align_set(bx, -1.0, -1.0);
        
        sc = elm_scroller_add(win);
        elm_scroller_content_min_limit(sc, 0, 1);
        evas_object_size_hint_weight_set(sc, 1.0, 1.0);
        evas_object_size_hint_align_set(sc, -1.0, 0.5);
        elm_box_pack_end(bx, sc);
        
        en = elm_entry_add(win);
        elm_entry_single_line_set(en, 1);
        elm_entry_entry_set(en, "Enter number...");
        evas_object_size_hint_weight_set(en, 1.0, 0.0);
        evas_object_size_hint_align_set(en, -1.0, 0.0);
        elm_entry_select_all(en);
        elm_scroller_content_set(sc, en);
        evas_object_show(en);
        evas_object_show(sc);
        number_entry = en;
   
        bt = elm_button_add(window);
        elm_button_label_set(bt, "OK");
        evas_object_size_hint_weight_set(bt, 1.0, 0.0);
        evas_object_size_hint_align_set(bt, -1.0, -1.0);
        elm_box_pack_end(bx, bt);
        evas_object_smart_callback_add(bt, "clicked", on_number_ok, NULL);
        evas_object_show(bt);   
        
        elm_win_inwin_content_set(inwin2, bx);
        evas_object_show(bx);

        elm_win_inwin_activate(inwin2);
        elm_object_focus(en);
     }
   else if (eina_list_count(ctc->tel.numbers) > 1)
     {
        Evas_Object *win, *bx, *bx2, *bt, *li, *fr, *ph, *lb;
        Eina_List *l;
        char *name, *file;
        
        win = window;
        inwin2 = elm_win_inwin_add(win);

        bx = elm_box_add(win);
        evas_object_size_hint_weight_set(bx, 1.0, 0.0);
        evas_object_size_hint_align_set(bx, -1.0, -1.0);

        fr = elm_frame_add(win);
        name = data_contact_name_get(ctc);
        if (name)
          {
             elm_label_label_set(write_lb, name);
             elm_frame_label_set(fr, name);
             free(name);
          }
        evas_object_size_hint_weight_set(fr, 1.0, 0.0);
        evas_object_size_hint_align_set(fr, -1.0, -1.0);
        elm_box_pack_end(bx, fr);        
        evas_object_show(fr);

        bx2 = elm_box_add(win);
        elm_box_horizontal_set(bx2, 1);
        elm_frame_content_set(fr, bx2);
        evas_object_show(bx2);
        
        ph = elm_photo_add(win);
        file = data_contact_photo_file_get(ctc);
        if (file)
          {
             elm_photo_file_set(write_ph, file);
             elm_photo_file_set(ph, file);
             free(file);
          }
        evas_object_size_hint_weight_set(ph, 0.0, 0.0);
        evas_object_size_hint_align_set(ph, -1.0, -1.0);
        elm_box_pack_end(bx2, ph);
        evas_object_show(ph);
        
        lb = elm_label_add(win);
        elm_label_label_set(lb, 
                            "This contact has multiple<br>"
                            "numbers. Select one.");
        evas_object_size_hint_weight_set(lb, 1.0, 0.0);
        evas_object_size_hint_align_set(lb, -1.0, -1.0);
        elm_box_pack_end(bx2, lb);
        evas_object_show(lb);
        
        li = elm_list_add(win);
        evas_object_size_hint_weight_set(li, 1.0, 1.0);
        evas_object_size_hint_align_set(li,  -1.0, -1.0);
        elm_box_pack_end(bx, li);

        for (l = (Eina_List *)(ctc->tel.numbers); l; l = l->next)
          {
             Data_Contact_Tel *tel = l->data;
             // FIXME:
             // tel->flags can be 0 or more of:
             //    DATA_CONTACT_TEL_HOME = (1 << 0),
             //    DATA_CONTACT_TEL_MSG = (1 << 1),
             //    DATA_CONTACT_TEL_WORK = (1 << 2),
             //    DATA_CONTACT_TEL_PREF = (1 << 3),
             //    DATA_CONTACT_TEL_VOICE = (1 << 4),
             //    DATA_CONTACT_TEL_FAX = (1 << 5),
             //    DATA_CONTACT_TEL_CELL = (1 << 6),
             //    DATA_CONTACT_TEL_VIDEO = (1 << 7),
             //    DATA_CONTACT_TEL_PAGER = (1 << 8),
             //    DATA_CONTACT_TEL_BBS = (1 << 9),
             //    DATA_CONTACT_TEL_MODEM = (1 << 10),
             //    DATA_CONTACT_TEL_CAR = (1 << 11),
             //    DATA_CONTACT_TEL_ISDN = (1 << 12),
             //    DATA_CONTACT_TEL_PCS = (1 << 13)
             elm_list_item_append(li, tel->number, NULL, NULL, on_number_select, tel);
          }
        elm_list_go(li);
        
        evas_object_show(li);
        
        bt = elm_button_add(window);
        elm_button_label_set(bt, "OK");
        evas_object_size_hint_weight_set(bt, 1.0, 0.0);
        evas_object_size_hint_align_set(bt, -1.0, -1.0);
        elm_box_pack_end(bx, bt);
        evas_object_smart_callback_add(bt, "clicked", on_number_list_ok, NULL);
        evas_object_show(bt);   
        
        elm_win_inwin_content_set(inwin2, bx);
        evas_object_show(bx);

        elm_win_inwin_activate(inwin2);
        
     }
   else
     {
        Data_Contact_Tel *tel;
        char *name, *file;
        
        tel = ctc->tel.numbers->data;
        if (number) free(number);
        number = strdup(tel->number);
        elm_label_label_set(write_lb, number);
        name = data_contact_name_get(ctc);
        if (name)
          {
             elm_label_label_set(write_lb, name);
             free(name);
          }
        file = data_contact_photo_file_get(ctc);
        if (file)
          {
             elm_photo_file_set(write_ph, file);
             free(file);
          }
     }
}
static void
_win_search_trigger_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
   Evas_Event_Key_Down *ev = event_info;
   App_Data *ad = data;
   Evas_Object *box, *box2, *entry, *btn, *ic;

   if (strcmp(ev->keyname, "f") ||
       !evas_key_modifier_is_set(ev->modifiers, "Control"))
     return;
   if (ad->search_box || !ad->current_tab)
     return;

   box = elm_box_add(ad->win);
   elm_box_horizontal_set(box, EINA_TRUE);
   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
   evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_after(ad->main_box, box, ad->url);
   evas_object_show(box);

   evas_object_event_callback_add(box, EVAS_CALLBACK_DEL, _search_box_del_cb,
                                  ad);

   entry = elm_entry_add(ad->win);
   elm_entry_single_line_set(entry, EINA_TRUE);
   elm_entry_scrollable_set(entry, EINA_TRUE);
   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box, entry);
   evas_object_show(entry);

   evas_object_smart_callback_add(entry, "changed", _search_entry_changed_cb,
                                  ad);
   evas_object_smart_callback_add(entry, "activated", _search_entry_activate_cb,
                                  ad);

   box2 = elm_box_add(ad->win);
   elm_box_horizontal_set(box2, EINA_TRUE);
   elm_object_part_content_set(entry, "end", box2);

   btn = elm_button_add(ad->win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ic = elm_icon_add(ad->win);
   elm_icon_standard_set(ic, "arrow_up");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _search_prev_cb, ad);

   btn = elm_button_add(ad->win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ic = elm_icon_add(ad->win);
   elm_icon_standard_set(ic, "arrow_down");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _search_next_cb, ad);

   btn = elm_button_add(ad->win);
   elm_box_pack_end(box, btn);
   evas_object_show(btn);

   ic = elm_icon_add(ad->win);
   elm_icon_standard_set(ic, "close");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _search_close_cb, ad);

   ad->search_box = box;
   ad->search_entry = entry;

   elm_object_focus_set(entry, EINA_TRUE);
}
EAPI_MAIN int
elm_main(int argc, char *argv[])
{
   Evas_Object *win, *bg, *box, *box2, *btn, *ic, *url, *naviframe, *tabs, *web;
   Evas *e;
   Evas_Modifier_Mask ctrl_mask;
   App_Data *ad;

   if (!elm_need_web())
     return -1;

   ad = calloc(1, sizeof(App_Data));
   if (!ad) return -1;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_add(NULL, "example-web", ELM_WIN_BASIC);
   elm_win_autodel_set(win, EINA_TRUE);

   e = evas_object_evas_get(win);
   ctrl_mask = evas_key_modifier_mask_get(e, "Control");
   if (!evas_object_key_grab(win, "f", ctrl_mask, 0, EINA_TRUE))
     fprintf(stderr, "Could not grab trigger for search dialog\n");

   evas_object_smart_callback_add(win, "delete,request", _win_del_request_cb,
                                  ad);
   evas_object_event_callback_add(win, EVAS_CALLBACK_KEY_DOWN,
                                  _win_search_trigger_cb, ad);
   evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _win_free_cb, ad);

   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);
   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   url = elm_entry_add(win);
   elm_entry_single_line_set(url, EINA_TRUE);
   elm_entry_scrollable_set(url, EINA_TRUE);
   evas_object_size_hint_weight_set(url, EVAS_HINT_EXPAND, 0.0);
   evas_object_size_hint_align_set(url, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box, url);
   evas_object_show(url);

   evas_object_smart_callback_add(url, "activated", _url_activated_cb, ad);

   box2 = elm_box_add(win);
   elm_box_horizontal_set(box2, EINA_TRUE);
   elm_object_part_content_set(url, "icon", box2);
   elm_entry_icon_visible_set(url, EINA_FALSE);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ad->nav.back = btn;

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "arrow_left");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _nav_back_cb, ad);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ad->nav.refresh = btn;

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "refresh");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _nav_refresh_cb, ad);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ad->nav.fwd = btn;

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "arrow_right");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _nav_fwd_cb, ad);

   box2 = elm_box_add(win);
   elm_box_horizontal_set(box2, EINA_TRUE);
   evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, 0.0);
   evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box, box2);
   evas_object_show(box2);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "file");
   elm_object_part_content_set(btn, "icon", ic);

   evas_object_smart_callback_add(btn, "clicked", _add_tab_cb, ad);

   tabs = elm_toolbar_add(win);
   elm_toolbar_align_set(tabs, 0.0);
   elm_toolbar_select_mode_set(tabs, ELM_OBJECT_SELECT_MODE_ALWAYS);
   elm_toolbar_homogeneous_set(tabs, EINA_FALSE);
   elm_toolbar_shrink_mode_set(tabs, ELM_TOOLBAR_SHRINK_MENU);
   evas_object_size_hint_weight_set(tabs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(tabs, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box2, tabs);
   evas_object_show(tabs);

   btn = elm_button_add(win);
   elm_box_pack_end(box2, btn);
   evas_object_show(btn);

   evas_object_smart_callback_add(btn, "clicked", _close_tab_cb, ad);

   ic = elm_icon_add(win);
   elm_icon_standard_set(ic, "close");
   elm_object_part_content_set(btn, "icon", ic);

   naviframe = elm_naviframe_add(win);
   evas_object_size_hint_weight_set(naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(box, naviframe);
   evas_object_show(naviframe);

   elm_toolbar_menu_parent_set(tabs, naviframe);

   web = elm_web_add(win);
   elm_web_window_create_hook_set(web, _web_create_window_cb, ad);
   elm_web_history_enabled_set(web, EINA_FALSE);
   evas_object_size_hint_weight_set(web, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(web, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_naviframe_item_simple_push(naviframe, web);

   default_content_set(web);

   ad->win = win;
   ad->main_box = box;
   ad->naviframe = naviframe;
   ad->url = url;
   ad->default_web = web;
   ad->tabs = tabs;
   ad->close_tab = btn;

   evas_object_resize(win, 480, 640);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Evas_Object *IOWODaliRVBHomeView::getPartItem(Evas_Object *obj, std::string part)
{
    Evas_Object *o = NULL;

    if (!io) return o;

    else if (part == "calaos.button.on")
    {
        o = elm_button_add(parent);
        Evas_Object *icon = elm_icon_add(o);
        elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/light_on");
        elm_object_style_set(o, "calaos/action_button/yellow");
        elm_object_content_set(o, icon);
        evas_object_smart_callback_add(o, "clicked", _item_button_On, this);
    }
    else if (part == "calaos.button.off")
    {
        o = elm_button_add(parent);
        Evas_Object *icon = elm_icon_add(o);
        elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/light_off");
        elm_object_style_set(o, "calaos/action_button/default");
        elm_object_content_set(o, icon);
        evas_object_smart_callback_add(o, "clicked", _item_button_Off, this);
    }
    else if (part == "calaos.button.red.more")
    {
        o = elm_button_add(parent);
        Evas_Object *icon = elm_icon_add(o);
        elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/slider_more");
        elm_object_style_set(o, "calaos/action_button/default");
        elm_object_content_set(o, icon);
        evas_object_smart_callback_add(o, "clicked", _item_button_RedMore, this);
    }
    else if (part == "calaos.button.red.less")
    {
        o = elm_button_add(parent);
        Evas_Object *icon = elm_icon_add(o);
        elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/slider_less");
        elm_object_style_set(o, "calaos/action_button/default");
        elm_object_content_set(o, icon);
        evas_object_smart_callback_add(o, "clicked", _item_button_RedLess, this);
    }
    else if (part == "calaos.button.green.more")
    {
        o = elm_button_add(parent);
        Evas_Object *icon = elm_icon_add(o);
        elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/slider_more");
        elm_object_style_set(o, "calaos/action_button/default");
        elm_object_content_set(o, icon);
        evas_object_smart_callback_add(o, "clicked", _item_button_GreenMore, this);
    }
    else if (part == "calaos.button.green.less")
    {
        o = elm_button_add(parent);
        Evas_Object *icon = elm_icon_add(o);
        elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/slider_less");
        elm_object_style_set(o, "calaos/action_button/default");
        elm_object_content_set(o, icon);
        evas_object_smart_callback_add(o, "clicked", _item_button_GreenLess, this);
    }
    else if (part == "calaos.button.blue.more")
    {
        o = elm_button_add(parent);
        Evas_Object *icon = elm_icon_add(o);
        elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/slider_more");
        elm_object_style_set(o, "calaos/action_button/default");
        elm_object_content_set(o, icon);
        evas_object_smart_callback_add(o, "clicked", _item_button_BlueMore, this);
    }
    else if (part == "calaos.button.blue.less")
    {
        o = elm_button_add(parent);
        Evas_Object *icon = elm_icon_add(o);
        elm_image_file_set(icon, ApplicationMain::getTheme(), "calaos/icons/action_button/slider_less");
        elm_object_style_set(o, "calaos/action_button/default");
        elm_object_content_set(o, icon);
        evas_object_smart_callback_add(o, "clicked", _item_button_BlueLess, this);
    }
    else if (part == "calaos.slider.red")
    {
        slider_red = new EdjeObject(ApplicationMain::getTheme(), evas);
        slider_red->setAutoDelete(true);
        slider_red->object_deleted.connect(sigc::mem_fun(*this, &IOWODaliRVBHomeView::sliderRedObjectDeleted));
        slider_red->addCallback("object", "*", sigc::mem_fun(*this, &IOWODaliRVBHomeView::sliderSignalCallbackRed), slider_red);
        slider_red->LoadEdje("calaos/slider/horizontal/red");
        slider_red->Show();

        ColorValue c(io->params["state"]);
        if (c.isValid())
            slider_red->setDragValue("slider", c.getRed() / 255.0, 0.0);

        o = slider_red->getEvasObject();
    }
    else if (part == "calaos.slider.green")
    {
        slider_green = new EdjeObject(ApplicationMain::getTheme(), evas);
        slider_green->setAutoDelete(true);
        slider_green->object_deleted.connect(sigc::mem_fun(*this, &IOWODaliRVBHomeView::sliderRedObjectDeleted));
        slider_green->addCallback("object", "*", sigc::mem_fun(*this, &IOWODaliRVBHomeView::sliderSignalCallbackGreen), slider_green);
        slider_green->LoadEdje("calaos/slider/horizontal/green");
        slider_green->Show();

        ColorValue c(io->params["state"]);
        if (c.isValid())
            slider_green->setDragValue("slider", c.getGreen() / 255.0, 0.0);

        o = slider_green->getEvasObject();
    }
    else if (part == "calaos.slider.blue")
    {
        slider_blue = new EdjeObject(ApplicationMain::getTheme(), evas);
        slider_blue->setAutoDelete(true);
        slider_blue->object_deleted.connect(sigc::mem_fun(*this, &IOWODaliRVBHomeView::sliderRedObjectDeleted));
        slider_blue->addCallback("object", "*", sigc::mem_fun(*this, &IOWODaliRVBHomeView::sliderSignalCallbackBlue), slider_blue);
        slider_blue->LoadEdje("calaos/slider/horizontal/blue");
        slider_blue->Show();

        ColorValue c(io->params["state"]);
        if (c.isValid())
            slider_blue->setDragValue("slider", c.getBlue() / 255.0, 0.0);

        o = slider_blue->getEvasObject();
    }
    else if (part == "color.preview")
    {
        int a = 255;

        ColorValue c(io->params["state"]);

        if (c.getRed() == 0 && c.getGreen() == 0 && c.getBlue() == 0)
            a = 100;

        color_preview = evas_object_rectangle_add(evas);
        evas_object_color_set(color_preview, c.getRed(), c.getGreen(), c.getBlue(), a);
        evas_object_show(color_preview);

        o = color_preview;
    }

    initView();

    return o;
}
Beispiel #13
0
typedef struct
{
   Eina_List *transitions;
   Evas_Object *box;
   Evas_Object_Box_Layout last_layout;
} Transitions_Data;

static void
_add_cb(void *data, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
{
   Evas_Object *btn;
   Eina_List *children;
   Transitions_Data *tdata = data;

   btn = elm_button_add(tdata->box);
   elm_object_text_set(btn, "I do nothing");
   children = (Eina_List *)elm_box_children_get(tdata->box);
   if (children)
     {
        elm_box_pack_after(tdata->box, btn, (Evas_Object *)children->data);
        eina_list_free(children);
     }
   else
     elm_box_pack_end(tdata->box, btn);
   evas_object_show(btn);
}

static void
_clear_cb(void *data, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
{
Beispiel #14
0
static void
frame_recipient_show(struct MessageNewViewData *data)
{
	struct Window *win = data->win;

	window_layout_set(win, MESSAGE_FILE, "recipient_edit");

	window_text_set(win, "title", D_("Define Recipients"));

	data->bt1 = elm_button_add(window_evas_object_get(win));
	elm_button_label_set(data->bt1, D_("Back"));
	evas_object_smart_callback_add(data->bt1, "clicked",
				       frame_recipient_back_clicked, data);
	window_swallow(win, "button_back", data->bt1);
	evas_object_show(data->bt1);

	data->bt2 = elm_button_add(window_evas_object_get(win));
	elm_button_label_set(data->bt2, D_("Send"));
	evas_object_smart_callback_add(data->bt2, "clicked",
				       frame_recipient_continue_clicked, data);
	window_swallow(win, "button_continue", data->bt2);
	evas_object_show(data->bt2);

	data->bt3 = elm_button_add(window_evas_object_get(win));
	elm_button_label_set(data->bt3, D_("Add Contact"));
	evas_object_smart_callback_add(data->bt3, "clicked",
				       frame_recipient_contact_add_clicked,
				       data);
	window_swallow(win, "button_contact_add", data->bt3);
	evas_object_show(data->bt3);

	data->bt4 = elm_button_add(window_evas_object_get(win));
	elm_button_label_set(data->bt4, D_("Add Number"));
	evas_object_smart_callback_add(data->bt4, "clicked",
				       frame_recipient_number_add_clicked,
				       data);
	window_swallow(win, "button_number_add", data->bt4);
	evas_object_show(data->bt4);

	data->bt5 = elm_button_add(window_evas_object_get(win));
	elm_button_label_set(data->bt5, D_("Remove"));
	evas_object_smart_callback_add(data->bt5, "clicked",
				       frame_recipient_delete_clicked, data);
	window_swallow(win, "button_delete", data->bt5);
	evas_object_show(data->bt5);

	data->tree_recipients = etk_tree_new();
	etk_tree_rows_height_set(ETK_TREE(data->tree_recipients), 80);
	etk_tree_mode_set(ETK_TREE(data->tree_recipients), ETK_TREE_MODE_LIST);
	etk_tree_headers_visible_set(ETK_TREE(data->tree_recipients),
				     ETK_FALSE);
	etk_tree_multiple_select_set(ETK_TREE(data->tree_recipients),
				     ETK_FALSE);

	data->col1_recipients =
		etk_tree_col_new(ETK_TREE(data->tree_recipients), "Title", 300,
				 0.0);
	etk_tree_col_model_add(data->col1_recipients,
			       etk_tree_model_edje_new(CONTACTS_FILE, "row"));
	etk_tree_build(ETK_TREE(data->tree_recipients));

	Etk_Scrolled_View *scrolled_view =
		etk_tree_scrolled_view_get(ETK_TREE(data->tree_recipients));
	etk_scrolled_view_dragable_set(ETK_SCROLLED_VIEW(scrolled_view),
				       ETK_TRUE);
	etk_scrolled_view_drag_bouncy_set(ETK_SCROLLED_VIEW(scrolled_view),
					  ETK_FALSE);
	etk_scrolled_view_policy_set(ETK_SCROLLED_VIEW(scrolled_view),
				     ETK_POLICY_HIDE, ETK_POLICY_HIDE);

	data->container_recipients =
		etk_embed_new(evas_object_evas_get
			      (window_evas_object_get(win)));
	etk_container_add(ETK_CONTAINER(data->container_recipients),
			  data->tree_recipients);
	etk_widget_show_all(data->container_recipients);
	data->container_recipients_eo =
		etk_embed_object_get(ETK_EMBED(data->container_recipients));

	window_swallow(win, "list", data->container_recipients_eo);

	g_ptr_array_foreach(data->recipients, frame_recipient_process_recipient,
			    data);
}
Beispiel #15
0
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;
}
Beispiel #16
0
void
create_compose(Data_Message *rep_to, const char *to, const char *text)
{
   Evas_Object *bx, *bx2, *ph, *lb, *bt, *sc, *en;

   if (content) evas_object_del(content);
   
   reply_to = NULL;
   if (number)
     {
        free(number);
        number = NULL;
     }
   
   if (rep_to)
     {
        reply_to = rep_to;
        if (reply_to->from_to)
          number = strdup(reply_to->from_to);
     }
   if (to)
     {
        if (number) free(number);
        number = strdup(to);
     }
   
   bx = elm_box_add(window);
   evas_object_size_hint_weight_set(bx, 1.0, 1.0);
   evas_object_size_hint_align_set(bx, -1.0, -1.0);
   
   content = bx;
   
   bx2 = elm_box_add(window);
   elm_box_horizontal_set(bx2, 1);
   evas_object_size_hint_weight_set(bx2, 1.0, 0.0);
   evas_object_size_hint_align_set(bx2, -1.0, -1.0);
   
   ph = elm_photo_add(window);
   evas_object_smart_callback_add(ph, "clicked", on_to_select, NULL);
   evas_object_size_hint_weight_set(ph, 0.0, 1.0);
   evas_object_size_hint_align_set(ph, -1.0, -1.0);
   elm_box_pack_end(bx2, ph);
   evas_object_show(ph);
   write_ph = ph;
   
   lb = elm_label_add(window);
   elm_label_label_set(lb, "Select...");
   evas_object_size_hint_weight_set(lb, 1.0, 1.0);
   evas_object_size_hint_align_set(lb, -1.0, 0.5);
   elm_box_pack_end(bx2, lb);
   evas_object_show(lb);
   write_lb = lb;
   
   lb = elm_label_add(window);
   elm_label_label_set(lb, "0");
   evas_object_size_hint_weight_set(lb, 0.0, 1.0);
   evas_object_size_hint_align_set(lb, 0.5, 0.5);
   elm_box_pack_end(bx2, lb);
   evas_object_show(lb);
   write_stat = lb;

   if (number)
     {
        Data_Contact *ctc = data_contact_by_tel_find(number);
        if (ctc)
          {
             char *name, *file;
             elm_label_label_set(write_lb, number);
             name = data_contact_name_get(ctc);
             if (name)
               {
                  elm_label_label_set(write_lb, name);
                  free(name);
               }
             file = data_contact_photo_file_get(ctc);
             if (file)
               {
                  elm_photo_file_set(write_ph, file);
                  free(file);
               }
          }
     }
   
   elm_box_pack_end(bx, bx2);
   evas_object_show(bx2);
   
   sc = elm_scroller_add(window);
   evas_object_size_hint_weight_set(sc, 1.0, 1.0);
   evas_object_size_hint_align_set(sc, -1.0, -1.0);
   elm_box_pack_end(bx, sc);
   
   en = elm_entry_add(window);
   if (text) elm_entry_entry_set(en, text);
   else elm_entry_entry_set(en, "");
   evas_object_size_hint_weight_set(en, 1.0, 1.0);
   evas_object_size_hint_align_set(en, -1.0, -1.0);
   elm_scroller_content_set(sc, en);
   evas_object_smart_callback_add(en, "changed", on_edit, NULL);
   evas_object_show(en);
   
   evas_object_show(sc);
   sms_entry = en;
   
   bt = elm_button_add(window);
   elm_button_label_set(bt, "Send");
   evas_object_size_hint_weight_set(bt, 1.0, 0.0);
   evas_object_size_hint_align_set(bt, -1.0, -1.0);
   elm_box_pack_end(bx, bt);
   evas_object_smart_callback_add(bt, "clicked", on_send, NULL);
   evas_object_show(bt);   

   elm_box_pack_end(box, bx);
   evas_object_show(bx);
}
Beispiel #17
0
static void
_init_glview(Evas_Object *win, GLData *gld)
{
   Evas_Object *bg, *bx, *bt, *gl;
   Ecore_Animator *ani;

   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);
   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bx);
   evas_object_show(bx);

   //-//-//-// THIS IS WHERE GL INIT STUFF HAPPENS (ALA EGL)
   //-//
   // create a new glview object
   gl = elm_glview_add(win);
   gld->glapi = elm_glview_gl_api_get(gl);
   evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   // mode is simply for supporting alpha, depth buffering, and stencil
   // buffering.
   elm_glview_mode_set(gl, ELM_GLVIEW_ALPHA | ELM_GLVIEW_DEPTH);
   // resize policy tells glview what to do with the surface when it
   // resizes.  ELM_GLVIEW_RESIZE_POLICY_RECREATE will tell it to
   // destroy the current surface and recreate it to the new size
   elm_glview_resize_policy_set(gl, ELM_GLVIEW_RESIZE_POLICY_RECREATE);
   // render policy tells glview how it would like glview to render
   // gl code. ELM_GLVIEW_RENDER_POLICY_ON_DEMAND will have the gl
   // calls called in the pixel_get callback, which only gets called
   // if the object is visible, hence ON_DEMAND.  ALWAYS mode renders
   // it despite the visibility of the object.
   elm_glview_render_policy_set(gl, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);
   // initialize callback function gets registered here
   elm_glview_init_func_set(gl, _init_gl);
   // delete callback function gets registered here
   elm_glview_del_func_set(gl, _del_gl);
   elm_glview_resize_func_set(gl, _resize_gl);
   elm_glview_render_func_set(gl, _draw_gl);
   //-//
   //-//-//-// END GL INIT BLOB

   elm_box_pack_end(bx, gl);
   evas_object_show(gl);

   elm_object_focus_set(gl, EINA_TRUE);

   // animating - just a demo. as long as you trigger an update on the image
   // object via elm_glview_changed_set() it will be updated.
   //
   // NOTE: if you delete gl, this animator will keep running trying to access
   // gl so you'd better delete this animator with ecore_animator_del().
   ani = ecore_animator_add(_anim, gl);

   evas_object_data_set(gl, "ani", ani);
   evas_object_data_set(gl, "gld", gld);
   evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl);

   // add an 'OK' button to end the program
   bt = elm_button_add(win);
   elm_object_text_set(bt, "OK");
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);
   evas_object_smart_callback_add(bt, "clicked", _on_done, win);

   evas_object_resize(win, 320, 480);
}
Beispiel #18
0
// alarm main window - setup
static void
create_main_win(void)
{
   Evas_Object *win, *bg, *box, *subbox, *toggle, *cloc, *button;
   
   win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
   elm_win_title_set(win, "Set Alarm");
   evas_object_smart_callback_add(win, "delete-request", on_win_del_req, NULL);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, 1.0, 1.0); // expand h/v 1/1 (for win this also fills)
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);
   
   box = elm_box_add(win);
   evas_object_size_hint_weight_set(box, 1.0, 1.0); // expand h/v 1/1 (for win this also fills)
   elm_win_resize_object_add(win, box);
   
   toggle = elm_toggle_add(win);
   elm_toggle_label_set(toggle, "Enabled");
   elm_toggle_states_labels_set(toggle, "ON", "OFF");
   elm_toggle_state_pointer_set(toggle, &(alm.on));   
   evas_object_size_hint_weight_set(toggle, 1.0, 0.0); // expand h/v 1/0
   evas_object_size_hint_align_set(toggle, -1.0, 0.0); // fill h/v 1/0
   elm_box_pack_end(box, toggle);
   evas_object_show(toggle);
   
   cloc = elm_clock_add(win);
   elm_clock_show_am_pm_set(cloc, 1);
   elm_clock_edit_set(cloc, 1);
   elm_clock_time_set(cloc, alm.hours, alm.minutes, 0);
   evas_object_smart_callback_add(cloc, "changed", on_clock_changed, NULL);
   elm_box_pack_end(box, cloc);
   evas_object_show(cloc);
   
   toggle = elm_toggle_add(win);
   elm_toggle_label_set(toggle, "Repeat");
   elm_toggle_states_labels_set(toggle, "ON", "OFF");
   elm_toggle_state_pointer_set(toggle, &(alm.repeat));   
   evas_object_size_hint_weight_set(toggle, 1.0, 0.0); // expand h/v 1/0
   evas_object_size_hint_align_set(toggle, -1.0, 0.0); // fill h/v 1/0
   elm_box_pack_end(box, toggle);
   evas_object_show(toggle);

   cloc = elm_clock_add(win);
   elm_clock_show_am_pm_set(cloc, 1);
   elm_clock_show_seconds_set(cloc, 0);
   elm_box_pack_end(box, cloc);
   evas_object_show(cloc);
   
   button = elm_button_add(win);
   elm_button_label_set(button, "OK");
   evas_object_smart_callback_add(button, "clicked", on_button_activate, NULL);
   evas_object_size_hint_weight_set(button, 1.0, 1.0); // expand h/v 1/0
   evas_object_size_hint_align_set(button, -1.0, 1.0); // fill h/v 1/0, align h/v ?/1.0
   elm_box_pack_end(box, button);
   evas_object_show(button);
   
   evas_object_show(box);
   evas_object_show(win);
}
Beispiel #19
0
static Evas_Object *
_create_nfc_dialog (
        const gchar *username)
{
    Evas_Object *dialog, *bg, *box, *frame, *content_box, *label;
    Evas_Object *button_frame, *pad_frame, *button_box;
    Evas_Object *ok_button;

    main_dialog = g_malloc0 (sizeof (MainDialog));

    /* main window */
    dialog = elm_win_add (NULL, "dialog", ELM_WIN_BASIC);
    elm_win_title_set (dialog, "Show NFC tag");
    elm_win_center (dialog, EINA_TRUE, EINA_TRUE);
    evas_object_smart_callback_add (dialog, "delete,request",
            _on_close_dialog_clicked, dialog);
    main_dialog->dialog = dialog;

    /* window background */
    bg = elm_bg_add (dialog);
    evas_object_size_hint_weight_set (bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show (bg);
    elm_win_resize_object_add (dialog, bg);

    box = elm_box_add (dialog);
    evas_object_size_hint_min_set (box, 200, 200);
    evas_object_size_hint_weight_set (box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show (box);
    elm_win_resize_object_add (dialog, box);

    frame = elm_frame_add (dialog);
    elm_object_style_set (frame, "pad_small");
    evas_object_size_hint_weight_set (frame, EVAS_HINT_EXPAND,
            EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set (frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_show (frame);
    elm_box_pack_start (box, frame);

    content_box = elm_box_add (dialog);
    elm_box_padding_set (content_box, 0, 3);
    evas_object_size_hint_weight_set (content_box, EVAS_HINT_EXPAND,
            EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set (content_box, 0.0, 0.0);
    evas_object_show (content_box);
    elm_object_part_content_set (frame, NULL, content_box);

    /* NFC label */
    label = elm_label_add(dialog);
    elm_object_text_set(label, "Show your NFC tag");
    elm_object_style_set(label, "marker");
    evas_object_color_set(label, 255, 0, 0, 255);
    elm_box_pack_end (content_box, label);
    evas_object_show(label);

    button_frame = elm_frame_add (dialog);
    elm_object_style_set (button_frame, "outdent_bottom");
    evas_object_size_hint_weight_set (button_frame, 0.0, 0.0);
    evas_object_size_hint_align_set (button_frame, EVAS_HINT_FILL,
            EVAS_HINT_FILL);
    evas_object_show (button_frame);
    elm_box_pack_end (box, button_frame);

    pad_frame = elm_frame_add (dialog);
    elm_object_style_set (pad_frame, "pad_medium");
    evas_object_show (pad_frame);
    elm_object_part_content_set (button_frame, NULL, pad_frame);

    button_box = elm_box_add (dialog);
    elm_box_horizontal_set (button_box, 1);
    elm_box_homogeneous_set (button_box, 1);
    evas_object_show (button_box);
    elm_object_part_content_set (pad_frame, NULL, button_box);

    /* OK button */
    ok_button = elm_button_add (dialog);
    elm_object_text_set (ok_button, "OK");
    evas_object_size_hint_weight_set (ok_button,
            EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set (ok_button,
            EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_smart_callback_add (ok_button, "clicked", _on_ok_dialog_clicked,
            dialog);
    evas_object_show (ok_button);
    elm_box_pack_end (button_box, ok_button);

    return dialog;
}
Beispiel #20
0
static void
create_alarm_win(void)
{
   Evas_Object *win, *bg, *frame, *box, *subbox, *toggle, *cloc, *button, *label;

   win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
   elm_win_title_set(win, "Alarm");
   evas_object_smart_callback_add(win, "delete-request", on_win_del_req, NULL);

   bg = elm_bg_add(win);
   evas_object_size_hint_weight_set(bg, 1.0, 1.0); // expand h/v 1/1 (for win this also fills)
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);
   
   box = elm_box_add(win);
   evas_object_size_hint_weight_set(box, 1.0, 1.0); // expand h/v 1/1 (for win this also fills)
   elm_win_resize_object_add(win, box);
   
   frame = elm_frame_add(win);
   evas_object_size_hint_weight_set(frame, 1.0, 0.0); // expand h/v 1/0
   evas_object_size_hint_align_set(frame, -1.0, 0.0); // fill h/v 1/0
   elm_frame_label_set(frame, "State");
   
   subbox = elm_box_add(win);
   elm_frame_content_set(frame, subbox);

   label = elm_label_add(win);
   elm_label_label_set(label,
		       "<br>"
		       "<b>Alarm Message</b><br>"
		       "<br>");
   elm_box_pack_end(subbox, label);
   evas_object_show(label);

   evas_object_show(subbox);
   
   elm_box_pack_end(box, frame);
   evas_object_show(frame);
   
   frame = elm_frame_add(win);
   evas_object_size_hint_weight_set(frame, 1.0, 0.0); // expand h/v 1/0
   evas_object_size_hint_align_set(frame, -1.0, 0.0); // fill h/v 1/0
   elm_frame_label_set(frame, "Current Time");
   
   subbox = elm_box_add(win);
   elm_frame_content_set(frame, subbox);

   cloc = elm_clock_add(win);
   elm_clock_show_am_pm_set(cloc, 1);
   elm_clock_show_seconds_set(cloc, 1);
   elm_box_pack_end(subbox, cloc);
   evas_object_show(cloc);
   
   evas_object_show(subbox);
   
   elm_box_pack_end(box, frame);
   evas_object_show(frame);
   
   button = elm_button_add(win);
   elm_button_label_set(button, "Set new alarm");
   evas_object_smart_callback_add(button, "clicked", on_set_button_activate, NULL);
   evas_object_size_hint_weight_set(button, 1.0, 1.0); // expand h/v 1/0
   evas_object_size_hint_align_set(button, -1.0, 0.0); // fill h/v 1/0, align h/v ?/1.0
   elm_box_pack_end(box, button);
   evas_object_show(button);
   
   button = elm_button_add(win);
   elm_button_label_set(button, "OK");
   evas_object_smart_callback_add(button, "clicked", on_button_activate, NULL);
   evas_object_size_hint_weight_set(button, 1.0, 1.0); // expand h/v 1/0
   evas_object_size_hint_align_set(button, -1.0, 1.0); // fill h/v 1/0, align h/v ?/1.0
   elm_box_pack_end(box, button);
   evas_object_show(button);
   
   evas_object_show(box);
   evas_object_show(win);
}
Beispiel #21
0
   win = elm_win_add(NULL, "scaling", ELM_WIN_BASIC);
   elm_win_title_set(win, "Scaling");
   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);

   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);
   elm_object_text_set(bt, "Scale: 0.5");
   elm_object_scale_set(bt, 0.5);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Scale: 0.75");
   elm_object_scale_set(bt, 0.75);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Scale: 1.0");
   elm_object_scale_set(bt, 1.0);
   elm_box_pack_end(bx, bt);
Beispiel #22
0
void
flickr_sync_update(Enlil_Album *album)
{
   Enlil_Album_Data *album_data = enlil_album_user_data_get(album);
   Evas_Object *fr, *tb2, *lbl, *bt, *sep, *pb, *pager;
   Evas_Object *inwin = album_data->netsync.inwin.win;
   Evas_Object *tb = album_data->netsync.inwin.tb;
   int i = 0;
   Eina_List *l;
   Enlil_Photo *photo;
   int nb_photos;
   char buf[1024];

   if (album_data->netsync.inwin.fr) evas_object_del(
                                                     album_data->netsync.inwin.fr);

   //
   fr = elm_frame_add(inwin);
   album_data->netsync.inwin.fr = fr;
   elm_object_text_set(fr, D_("Synchronise an album with flickr"));
   evas_object_size_hint_weight_set(fr, 1.0, 1.0);
   evas_object_size_hint_align_set(fr, -1.0, -1.0);
   evas_object_show(fr);
   elm_table_padding_set(tb, 1, 1);
   elm_table_pack(tb, fr, 0, 0, 3, 1);

   tb2 = elm_table_add(inwin);
   evas_object_size_hint_weight_set(tb2, 1.0, 0.0);
   evas_object_size_hint_align_set(tb2, -1.0, 1.0);
   elm_table_padding_set(tb2, 15, 5);
   evas_object_show(tb2);
   elm_object_content_set(fr, tb2);
   //

   if (album_data->netsync.album_netsync_notuptodate)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Update the flickr album header."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt1 = bt;
      elm_object_text_set(bt, D_("Update"));
      evas_object_smart_callback_add(bt, "clicked", _netsync_notuptodate_cb,
                                     album);
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.album_notinnetsync)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("The album is not in Flickr."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt2 = bt;
      elm_object_text_set(bt, D_("Add the album in Flickr"));
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_smart_callback_add(bt, "clicked", _album_notinnetsync_cb,
                                     album);
      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.album_local_notuptodate)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Update the local album header."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.bt3 = bt;
      evas_object_size_hint_align_set(bt, 0.5, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);

      evas_object_smart_callback_add(bt, "clicked", _local_notuptodate_cb,
                                     album);
      elm_object_text_set(bt, D_("Update"));
      evas_object_show(bt);
      elm_table_pack(tb2, bt, 1, i, 1, 1);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   if (album_data->netsync.photos_notinlocal)
   {
      lbl = elm_label_add(inwin);
      elm_object_text_set(lbl, D_("Some photos are not in the local album."));
      evas_object_show(lbl);
      elm_table_pack(tb2, lbl, 0, i, 1, 1);

      pager = elm_naviframe_add(inwin);
      album_data->netsync.inwin.notinlocal.pager = pager;
      evas_object_size_hint_align_set(pager, 0.5, 0.5);
      evas_object_size_hint_weight_set(pager, 1.0, 0.0);
      evas_object_show(pager);
      elm_table_pack(tb2, pager, 1, i, 1, 1);
      elm_object_style_set(pager, "fade_invisible");

      bt = elm_button_add(inwin);
      album_data->netsync.inwin.notinlocal.bt = bt;
      album_data->netsync.inwin.bt4 = bt;
      evas_object_size_hint_align_set(bt, -1.0, 0.5);
      evas_object_size_hint_weight_set(bt, 1.0, 0.0);
      elm_object_text_set(bt, D_("Download Them All"));
      evas_object_smart_callback_add(bt, "clicked", _photos_notinlocal_cb,
                                     album);
      evas_object_show(bt);
      elm_naviframe_item_simple_push(pager, bt);

      pb = elm_progressbar_add(inwin);
      album_data->netsync.inwin.notinlocal.pb = pb;
      evas_object_size_hint_align_set(pb, -1.0, 0.5);
      evas_object_size_hint_weight_set(pb, 1.0, 0.0);
      elm_progressbar_pulse_set(pb, EINA_TRUE);
      elm_object_text_set(pb, D_("Downloads in progress ..."));
      evas_object_show(pb);
      elm_naviframe_item_simple_push(pager, pb);
      evas_object_size_hint_max_set(pb, 0, 0);

      if (album_data->netsync.inwin.notinlocal.is_updating)
      {
         elm_progressbar_pulse(pb, EINA_TRUE);
         elm_naviframe_item_simple_promote(pager, pb);
      }
      else
         elm_naviframe_item_simple_promote(pager, bt);

      i++;

      sep = elm_separator_add(inwin);
      evas_object_show(sep);
      elm_table_pack(tb2, sep, 0, i, 2, 1);
      i++;
   }

   nb_photos = 0;
   EINA_LIST_FOREACH(enlil_album_photos_get(album), l, photo)
   {
      Enlil_Photo_Data *photo_data = enlil_photo_user_data_get(photo);
      if (photo_data && photo_data->netsync.state == PHOTO_FLICKR_NOTINFLICKR)
      {
         nb_photos++;
      }
   }
EAPI_MAIN int
elm_main(int argc, char **argv)
{
    Evas_Object *win, *box, *hbox;
    Evas_Object *list, *btn;
    int i;

    win = elm_win_util_standard_add("genlist", "Genlist - simple");
    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
    elm_win_autodel_set(win, EINA_TRUE);

    box = elm_box_add(win);
    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, box);
    evas_object_show(box);

    list = elm_genlist_add(win);

    if (!_itc)
    {
        _itc = elm_genlist_item_class_new();
        _itc->item_style = "default";
        _itc->func.text_get = _item_label_get;
        _itc->func.content_get = _item_content_get;
        _itc->func.state_get = NULL;
        _itc->func.del = NULL;
    }

    Eina_Bool hbounce, vbounce, always, no_sel;
    Elm_Scroller_Policy hp, vp;
    Elm_Object_Select_Mode sel_mode;

    always = no_sel = EINA_FALSE;
    sel_mode = elm_genlist_select_mode_get(list);
    if (sel_mode == ELM_OBJECT_SELECT_MODE_ALWAYS)
        always = EINA_TRUE;
    else if (sel_mode == ELM_OBJECT_SELECT_MODE_NONE)
        no_sel = EINA_TRUE;

    printf("default values:\n");
    printf("always select: %d\n", always);
    elm_scroller_bounce_get(list, &hbounce, &vbounce);
    printf("bounce - horizontal: %d, vertical: %d\n", hbounce, vbounce);
    printf("homogeneous: %d\n", elm_genlist_homogeneous_get(list));
    printf("horizontal mode: %d\n", elm_genlist_mode_get(list));
    printf("longpress timeout: %0.3f\n",
           elm_genlist_longpress_timeout_get(list));
    printf("multi selection: %d\n", elm_genlist_multi_select_get(list));
    printf("no selection mode: %d\n", no_sel);
    elm_scroller_policy_get(list, &hp, &vp);
    printf("scroller policy - horizontal: %d, vertical: %d\n", hp, vp);
    printf("block count: %d\n", elm_genlist_block_count_get(list));
    printf("\n");

    elm_scroller_bounce_set(list, EINA_FALSE, EINA_FALSE);
    elm_genlist_homogeneous_set(list, EINA_FALSE);
    elm_genlist_mode_set(list, ELM_LIST_LIMIT);
    elm_genlist_multi_select_set(list, EINA_TRUE);
    elm_genlist_select_mode_set(list, ELM_OBJECT_SELECT_MODE_DEFAULT);
    elm_scroller_policy_set(list, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_ON);
    elm_genlist_longpress_timeout_set(list, 0.5);
    elm_genlist_block_count_set(list, 16);

    for (i = 0; i < N_ITEMS; i++)
    {
        elm_genlist_item_append(list, _itc,
                                (void *)(long)i, NULL,
                                ELM_GENLIST_ITEM_NONE,
                                _item_sel_cb, NULL);
    }

    evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(box, list);
    evas_object_show(list);

    hbox = elm_box_add(win);
    elm_box_horizontal_set(hbox, EINA_TRUE);
    evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0);
    evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(box, hbox);
    evas_object_show(hbox);

    btn = elm_button_add(win);
    elm_object_text_set(btn, "Show status");
    evas_object_size_hint_weight_set(btn, 0, 0);
    evas_object_size_hint_align_set(btn, 0.5, 0.5);
    evas_object_smart_callback_add(btn, "clicked", _show_status_cb, list);
    elm_box_pack_end(hbox, btn);
    evas_object_show(btn);

    btn = elm_button_add(win);
    elm_object_text_set(btn, "Realize");
    evas_object_size_hint_weight_set(btn, 0, 0);
    evas_object_size_hint_align_set(btn, 0.5, 0.5);
    evas_object_smart_callback_add(btn, "clicked", _realize_cb, list);
    elm_box_pack_end(hbox, btn);
    evas_object_show(btn);

    evas_object_resize(win, 200, 320);
    evas_object_show(win);

    elm_run();
    elm_shutdown();

    return 0;
}
Beispiel #24
0
static void
_action_create_folder_cb(void *data, Enna_File *file)
{
   Evas_Object *win;
   Evas_Object *bg;
   Evas_Object *fr;
   Evas_Object *en;
   Evas_Object *lb;
   Evas_Object *bx;
   Evas_Object *btn_bx;
   Evas_Object *btn_ok;
   Evas_Object *btn_cancel;
   Enna_Localfiles_Priv *priv = data;

   win = elm_win_add(enna->win, NULL, ELM_WIN_DIALOG_BASIC);
   elm_win_title_set(win, _("Create New Folder"));
   elm_win_autodel_set(win, EINA_TRUE);
   evas_object_data_set(win, "file", file);

   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);
   evas_object_size_hint_min_set(bg, 400, 64);

   fr = elm_frame_add(win);
   elm_object_style_set(fr, "pad_medium");
   evas_object_show(fr);
   elm_win_resize_object_add(win, fr);

   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, -1, -1);
   evas_object_show(bx);
   elm_frame_content_set(fr, bx);
   elm_box_padding_set(bx, 4, 4);

   lb = elm_label_add(win);
   elm_object_text_set(lb, _("Enter folder name"));
   evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(lb, 0.5, -1);
   evas_object_show(lb);
   elm_box_pack_end(bx, lb);

   en = elm_entry_add(win);
   elm_entry_single_line_set(en, EINA_TRUE);
   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(en, -1, -1);
   elm_object_text_set(en, "New Folder");
   elm_box_pack_end(bx, en);
   evas_object_show(en);
   evas_object_data_set(win, "entry", en);

   btn_bx = elm_box_add(win);
   elm_box_horizontal_set(btn_bx, EINA_TRUE);
   evas_object_size_hint_weight_set(btn_bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(btn_bx, EVAS_HINT_FILL, 0.5);
   evas_object_show(btn_bx);
   elm_box_padding_set(btn_bx, 8, 2);

   btn_ok = elm_button_add(win);
   elm_object_text_set(btn_ok, _("Create"));
   evas_object_show(btn_ok);
   evas_object_size_hint_weight_set(btn_ok, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(btn_ok, EVAS_HINT_FILL, 0.5);
   evas_object_smart_callback_add(btn_ok, "clicked",
                                  _dialog_create_folder_ok_clicked_cb, priv);
   elm_box_pack_end(btn_bx, btn_ok);

   btn_cancel = elm_button_add(win);
   elm_object_text_set(btn_cancel, _("Cancel"));
   evas_object_show(btn_cancel);
   evas_object_size_hint_weight_set(btn_cancel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(btn_cancel, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_smart_callback_add(btn_cancel, "clicked",
                                  _dialog_cancel_clicked_cb, priv);
   elm_box_pack_end(btn_bx, btn_cancel);

   elm_box_pack_end(bx, btn_bx);

   evas_object_show(win);
   priv->dialog = win;
}
Beispiel #25
0
Button::Button (Evasxx::Object &parent)
{
  o = elm_button_add (parent.obj ());
  
  elmInit ();
}
Beispiel #26
0
static void
_action_delete_cb(void *data, Enna_File *file)
{
   Evas_Object *win;
   Evas_Object *bg;
   Evas_Object *fr;
   Evas_Object *lb;
   Evas_Object *bx;
   Evas_Object *btn_bx;
   Evas_Object *btn_ok;
   Evas_Object *btn_cancel;
   Enna_Localfiles_Priv *priv = data;
   const char *label;

   ENNA_OBJECT_DEL(priv->dialog);

   win = elm_win_add(enna->win, NULL, ELM_WIN_DIALOG_BASIC);
   elm_win_title_set(win, _("Delete files"));
   elm_win_autodel_set(win, EINA_TRUE);
   evas_object_data_set(win, "file", file);

   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);
   evas_object_size_hint_min_set(bg, 400, 64);

   fr = elm_frame_add(win);
   elm_object_style_set(fr, "pad_medium");
   evas_object_show(fr);
   elm_win_resize_object_add(win, fr);

   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, -1, -1);
   evas_object_show(bx);
   elm_frame_content_set(fr, bx);
   elm_box_padding_set(bx, 4, 4);

   lb = elm_label_add(win);
   elm_label_line_wrap_set(lb, ELM_WRAP_MIXED);
   elm_label_wrap_width_set(lb, 400);
   label = eina_stringshare_printf(_("Are you sure to delete <b>%s</b> ?"), file->label);
   elm_object_text_set(lb, label);
   eina_stringshare_del(label);
   evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(lb, 0.5, -1);
   evas_object_show(lb);
   elm_box_pack_end(bx, lb);

   btn_bx = elm_box_add(win);
   elm_box_horizontal_set(btn_bx, EINA_TRUE);
   evas_object_size_hint_weight_set(btn_bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(btn_bx, EVAS_HINT_FILL, 0.5);
   evas_object_show(btn_bx);
   elm_box_padding_set(btn_bx, 8, 2);

   btn_ok = elm_button_add(win);
   elm_object_text_set(btn_ok, _("Delete"));
   evas_object_show(btn_ok);
   evas_object_size_hint_weight_set(btn_ok, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(btn_ok, EVAS_HINT_FILL, 0.5);
   elm_box_pack_end(btn_bx, btn_ok);
   evas_object_smart_callback_add(btn_ok, "clicked",
                                  _dialog_delete_ok_clicked_cb, priv);

   btn_cancel = elm_button_add(win);
   elm_object_text_set(btn_cancel, _("Cancel"));
   evas_object_show(btn_cancel);
   evas_object_size_hint_weight_set(btn_cancel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(btn_cancel, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(btn_bx, btn_cancel);
   evas_object_smart_callback_add(btn_cancel, "clicked",
                                  _dialog_cancel_clicked_cb, priv);

   elm_box_pack_end(bx, btn_bx);

   evas_object_resize(win, 400, 128);

   evas_object_show(win);
   priv->dialog = win;
}
Beispiel #27
0
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *icon, *icon2, *bt, *bt2, *layout;
   Evas_Object *clk;
   Evas_Object *item;
   char buf[PATH_MAX];

   elm_app_info_set(elm_main, "elementary", "examples/layout_example.edj");
   win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
   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_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);

   // Adding layout and filling it with widgets
   layout = elm_layout_add(win);
   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, layout);
   snprintf(buf, sizeof(buf), "%s/examples/layout_example.edj", elm_app_data_dir_get());
   elm_layout_file_set(layout, buf, "example/mylayout");
   evas_object_show(layout);

   // Setting title
   const char *title = elm_layout_data_get(layout, "title");
   if (title)
     {
	elm_win_title_set(win, title);
	elm_object_part_text_set(layout, TITLE, title);
     }

   // Add icon, clock and button to the table
   icon = elm_icon_add(win);
   elm_icon_standard_set(icon, "home");
   evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_layout_table_pack(layout, TABLE, icon, 0, 0, 1, 1);
   evas_object_show(icon);

   icon2 = elm_icon_add(win);
   elm_icon_standard_set(icon2, "close");
   evas_object_size_hint_weight_set(icon2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(icon2, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_layout_table_pack(layout, TABLE, icon2, 1, 0, 1, 1);
   evas_object_show(icon2);

   clk = elm_clock_add(win);
   evas_object_size_hint_weight_set(clk, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(clk, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_layout_table_pack(layout, TABLE, clk, 2, 0, 1, 1);
   evas_object_show(clk);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Click me!");
   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_layout_table_pack(layout, TABLE, bt, 0, 1, 3, 1);
   evas_object_smart_callback_add(bt, "clicked", _tbl_btn_cb, layout);
   evas_object_show(bt);

   item = elm_button_add(win);
   elm_object_text_set(item, "Position 0");
   evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(item, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_layout_box_insert_at(layout, BOX, item, 0);
   evas_object_smart_callback_add(item, "clicked", _box_btn_cb, layout);
   evas_object_show(item);

   item = elm_button_add(win);
   elm_object_text_set(item, "Prepended");
   evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(item, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_layout_box_prepend(layout, BOX, item);
   evas_object_smart_callback_add(item, "clicked", _box_btn_cb, layout);
   evas_object_show(item);

   bt2 = elm_button_add(win);
   elm_object_text_set(bt2, "Delete All");
   elm_object_part_content_set(layout, SWALLOW, bt2);
   evas_object_smart_callback_add(bt2, "clicked", _swallow_btn_cb, layout);

   evas_object_resize(win, 320, 320);
   evas_object_show(win);

   elm_run();
   elm_shutdown();

   return 0;
}
Beispiel #28
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;
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *bt, *bx, *cal;
   Elm_Calendar_Mark *mark;
   struct tm selected_time;
   time_t current_time;
   struct tm sunday = { 0, 0, 12, 7, 0, 0, 0, 0, -1, 0, NULL };
   /* tm {sec, min, hour, mday, mon, year, wday, yday, isdst } */
   /* weekdays since Sunday, range 0 to 6 */
   struct tm christmas;
   christmas.tm_mday = 25;
   /* months since Jan, in the range 0 to 11 */
   christmas.tm_mon = 11;

   win = elm_win_util_standard_add("calendar", "Calendar Marks Example");
   elm_win_autodel_set(win, EINA_TRUE);
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   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);

   cal = elm_calendar_add(win);
   evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(cal, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(bx, cal);
   evas_object_show(cal);

   /* check today - we'll remove it later */
   current_time = time(NULL);
   localtime_r(&current_time, &selected_time);
   mark = elm_calendar_mark_add(cal, "checked", &selected_time,
                                ELM_CALENDAR_UNIQUE);

   /* check tomorrow */
   current_time = time(NULL) + 1 * SECS_DAY;
   localtime_r(&current_time, &selected_time);
   elm_calendar_mark_add(cal, "checked", &selected_time, ELM_CALENDAR_UNIQUE);

   /* mark christmas as holiday */
   elm_calendar_mark_add(cal, "holiday", &christmas, ELM_CALENDAR_ANNUALLY);

   /* mark Sundays as holidays */
   elm_calendar_mark_add(cal, "holiday", &sunday, ELM_CALENDAR_WEEKLY);

   /* ok, let's remove today's check */
   elm_calendar_mark_del(mark);

   elm_calendar_marks_draw(cal);

   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, "Clear marks");
   evas_object_smart_callback_add(bt, "clicked", _btn_clear_cb, cal);
   elm_box_pack_end(bx, bt);
   evas_object_show(bt);

   evas_object_show(win);

   elm_run();

   return 0;
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win, *map, *box, *bt, *entry;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("map", "Map Route Example");
   elm_win_autodel_set(win, EINA_TRUE);

   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);

   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);

   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);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);

   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);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);

   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);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);

   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);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);

   entry = elm_entry_add(win);
   elm_entry_scrollable_set(entry, EINA_TRUE);
   elm_entry_single_line_set(entry, EINA_TRUE);
   elm_object_text_set(entry, "Jockey Club Brasileiro");
   evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0);
   elm_box_pack_end(box, entry);
   evas_object_show(entry);

   bt = elm_button_add(win);
   elm_object_text_set(bt, "Route");
   elm_box_pack_end(box, bt);
   evas_object_show(bt);
   evas_object_smart_callback_add(bt, "clicked", _bt_route, &example_data);
   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);

   example_data.map = map;
   example_data.entry = entry;
   example_data.route = NULL;
   example_data.start_lon = -43.175;
   example_data.start_lat = -22.97;

   elm_map_zoom_set(map, 12);
   elm_map_region_show(map, example_data.start_lon, example_data.start_lat);

   evas_object_resize(win, 512, 512);
   evas_object_show(win);

   ecore_timer_add(0.5, _nasty_hack, win);

   elm_run();

   return 0;
}