Beispiel #1
0
void utils_edit_image_file_change(void *data, Evas_Object *obj, void *event_info)
{
    if(eyelight_edit_name_get(_current_obj) != EYELIGHT_NAME_IMAGE)
        return ;

    Evas_Object *inwin, *fs;

    setlocale(LC_ALL, "");

    inwin = elm_win_inwin_add(win);
    evas_object_show(inwin);

    fs = elm_fileselector_add(win);
    elm_fileselector_expandable_set(fs, EINA_FALSE);
    /* start the fileselector in the home dir */
    elm_fileselector_path_set(fs, getenv("HOME"));
    /* allow fs to expand in x & y */
    evas_object_size_hint_weight_set(fs, 1.0, 1.0);
    elm_win_resize_object_add(win, fs);
    evas_object_show(fs);
    /* the 'done' cb is called when the user press ok/cancel */
    evas_object_smart_callback_add(fs, "done", _utils_edit_image_file_change_cb, inwin);

    elm_win_inwin_content_set(inwin, fs);
}
Beispiel #2
0
void utils_edit_area_image_add(void *data, Evas_Object *obj, void *event_info)
{
    if(eyelight_edit_name_get(_current_obj) != EYELIGHT_NAME_CUSTOM_AREA
            && eyelight_edit_name_get(_current_obj) != EYELIGHT_NAME_THEME_AREA)
        return ;

    Evas_Object *inwin, *fs, *fr;

    setlocale(LC_ALL, "");

    inwin = elm_win_inwin_add(win);
    evas_object_show(inwin);

    fr = elm_frame_add(inwin);
    elm_win_inwin_content_set(inwin, fr);
    elm_object_text_set(fr, D_("Select an image"));

    fs = elm_fileselector_add(win);
    elm_fileselector_expandable_set(fs, EINA_FALSE);
    elm_fileselector_path_set(fs, getenv("HOME"));
    evas_object_size_hint_weight_set(fs, 1.0, 1.0);
    elm_object_content_set(fr, fs);
    evas_object_show(fs);
    evas_object_smart_callback_add(fs, "done", _utils_edit_area_image_add_cb, inwin);
}
static void
_expandable_toggle(void            *data,
                   Evas_Object *obj,
                   void *event_info)
{
   Evas_Object *fs_bt = data;
   Eina_Bool old_val = elm_fileselector_expandable_get(fs_bt);
   elm_fileselector_expandable_set(fs_bt, !old_val);

   printf("Expandable folders mode set to: %s\n", old_val ? "false" : "true");
}
Beispiel #4
0
static
void winchoosefile(char *prompt, char *buf, int len, int filter, Eina_Bool is_save)
{
    Evas *evas = NULL;
    if ( frame != NULL ){ //simulate a modal dialog by disabling all events to the main window
        ecore_evas_get( frame );
        disable_idlers();
        evas_event_freeze(evas);
    }
    /*TODO: implement file name filtering */
    Evas_Object *win, *fs, *bg, *vbox, *hbox, *bt;

    win = elm_win_add(NULL, "fileselector", ELM_WIN_BASIC);
    elm_win_title_set(win, prompt);

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

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

    fs = elm_fileselector_add(win);
    elm_fileselector_is_save_set(fs, is_save);
    elm_fileselector_expandable_set(fs, EINA_FALSE);
    evas_object_size_hint_weight_set(fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(vbox, fs);
    evas_object_show(fs);
    evas_object_smart_callback_add(fs, "done", my_fileselector_done, win);

    if (strlen(buf))
        elm_fileselector_selected_set( fs, buf );

    if (fileselect)
        elm_fileselector_path_set( fs, filepath );
    else if (getenv("HOME"))
        elm_fileselector_path_set( fs, getenv("HOME") );

    evas_object_resize(win, 400, 350);
    evas_object_show(win);
    
    evas_object_data_set(fs, "buffer", buf);

    elm_run();
    
    if ( evas != NULL ){ //enable events to the main window
        enable_idlers();
        evas_event_thaw(evas);
    }
}
Beispiel #5
0
void
ui_file_open_save_dialog_open(Evas_Object *parent, Evas_Smart_Cb func,
      Eina_Bool save)
{
   Evas_Object *fs;
   inwin = elm_win_inwin_add(parent);
   evas_object_show(inwin);

   fs = elm_fileselector_add(inwin);
   elm_fileselector_is_save_set(fs, save);
   elm_fileselector_expandable_set(fs, EINA_FALSE);
   elm_fileselector_path_set(fs, getenv("HOME"));
   elm_win_inwin_content_set(inwin, fs);
   evas_object_show(fs);

   evas_object_smart_callback_add(fs, "done", _cleaning_cb, func);
}
PREFIX value ml_elm_fileselector_expandable_set(value v_obj, value v_flag)
{
        elm_fileselector_expandable_set((Evas_Object*) v_obj,
                Eina_Bool_val(v_flag));
        return Val_unit;
}