1. add template files for favorites dir for file selector


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 17 years ago
parent 4376d882e1
commit 14c920bdc1
  1. 1
      data/other/Makefile.am
  2. BIN
      data/other/efm_favorites.tar.gz
  3. 1
      src/bin/e_includes.h
  4. 64
      src/bin/e_int_config_background_import.c
  5. 11
      src/bin/e_main.c
  6. 15
      src/bin/e_test.c
  7. 272
      src/bin/e_widget_framelist.c
  8. 8
      src/bin/e_widget_framelist.h
  9. 291
      src/bin/e_widget_fsel.c
  10. 13
      src/bin/e_widget_fsel.h

@ -2,6 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in
filesdir = $(datadir)/enlightenment/data/other
files_DATA = \
applications.tar.gz \
efm_favorites.tar.gz \
icon_example.tar.gz
EXTRA_DIST = $(files_DATA)

Binary file not shown.

@ -142,3 +142,4 @@
#include "e_widget_scrollframe.h"
#include "e_sha1.h"
#include "e_widget_framelist.h"
#include "e_widget_fsel.h"

@ -79,7 +79,7 @@
static Ecore_Event_Handler *_edj_exe_exit_handler = NULL;
static void _efm_hilite_cb (Evas_Object *obj, char *file, void *data);
static void _efm_cb_selchange(void *data, Evas_Object *obj);
static void _bg_edj_gen (Evas *evas, char *filename, int method);
static int _edj_exe_exit_cb (void *data, int type, void *event);
@ -100,6 +100,7 @@ struct _Bg_Import_Window
Evas_Object *box_obj;
Evas_Object *event_obj;
Evas_Object *content_obj;
Evas_Object *fsel_obj;
Evas_Object *ok_obj;
Evas_Object *close_obj;
@ -160,7 +161,7 @@ e_int_config_background_import(E_Config_Dialog *parent)
e_widget_on_focus_hook_set(o, _import_cb_wid_on_focus, import);
import->box_obj = o;
edje_object_part_swallow(import->bg_obj, "buttons_swallow", o);
o = evas_object_rectangle_add(evas);
import->event_obj = o;
mask = 0;
@ -179,8 +180,11 @@ e_int_config_background_import(E_Config_Dialog *parent)
o = e_widget_list_add(evas, 0, 0);
import->content_obj = o;
ofm = e_widget_fileman_add(evas, (&(cfdata->file)));
e_widget_fileman_hilite_callback_add(ofm, _efm_hilite_cb, import);
ofm = e_widget_fsel_add(evas, "~/", "/", NULL, NULL,
_efm_cb_selchange, import,
_efm_cb_selchange, import
);
import->fsel_obj = ofm;
e_widget_list_object_append(o, ofm, 1, 1, 0.5);
of = e_widget_frametable_add(evas, _("Options"), 0);
@ -192,7 +196,7 @@ e_int_config_background_import(E_Config_Dialog *parent)
ord = e_widget_radio_add(evas, _("Tile Image"), E_BG_TILE, rg);
e_widget_frametable_object_append(of, ord, 0, 2, 1, 1, 1, 0, 1, 0);
e_widget_list_object_append(o, of, 1, 1, 0.5);
e_widget_list_object_append(o, of, 0, 0, 0.5);
e_widget_min_size_get(o, &w, &h);
edje_extern_object_min_size_set(o, w, h);
@ -200,7 +204,6 @@ e_int_config_background_import(E_Config_Dialog *parent)
evas_object_show(o);
import->ok_obj = e_widget_button_add(evas, _("OK"), NULL, _import_cb_ok, win, cfdata);
e_widget_disabled_set(import->ok_obj, 1);
e_widget_list_object_append(import->box_obj, import->ok_obj, 1, 0, 0.5);
import->close_obj = e_widget_button_add(evas, _("Cancel"), NULL, _import_cb_close, win, NULL);
@ -214,8 +217,8 @@ e_int_config_background_import(E_Config_Dialog *parent)
edje_object_part_swallow(import->bg_obj, "buttons_swallow", o);
edje_object_size_min_calc(import->bg_obj, &w, &h);
evas_object_resize(import->bg_obj, w, h);
e_win_resize(win, w, h);
evas_object_resize(import->bg_obj, w + 64, h + 128);
e_win_resize(win, w + 64, h + 128);
e_win_size_min_set(win, w, h);
e_win_size_max_set(win, 99999, 99999);
e_win_show(win);
@ -228,23 +231,15 @@ e_int_config_background_import(E_Config_Dialog *parent)
}
static void
_efm_hilite_cb(Evas_Object *obj, char *file, void *data)
_efm_cb_selchange(void *data, Evas_Object *obj)
{
E_Fm_File *f;
Bg_Import_Window *import;
f = e_fm_file_new(file);
if (!f) return;
const char *path;
import = data;
if (!import) return;
if (e_fm_file_is_image(f))
e_widget_disabled_set(import->ok_obj, 0);
else
e_widget_disabled_set(import->ok_obj, 1);
free(f);
path = e_widget_fsel_selection_path_get(import->fsel_obj);
E_FREE(import->cfdata->file);
if (path) import->cfdata->file = strdup(path);
}
static void
@ -378,33 +373,20 @@ _import_cb_ok(void *data, void *data2)
E_Fm_File *f;
Evas *evas;
E_Win *win;
E_Config_Dialog_Data *cfdata;
Bg_Import_Window *import;
const char *path;
win = data;
import = win->data;
cfdata = data2;
if (!cfdata->file[0])
path = e_widget_fsel_selection_path_get(import->fsel_obj);
E_FREE(import->cfdata->file);
if (path) import->cfdata->file = strdup(path);
if (import->cfdata->file)
{
if (import) e_widget_disabled_set(import->ok_obj, 1);
return;
evas = e_win_evas_get(win);
_bg_edj_gen(evas, import->cfdata->file, import->cfdata->method);
}
f = e_fm_file_new(cfdata->file);
if (!f) return;
if (!e_fm_file_is_image(f))
{
if (import) e_widget_disabled_set(import->ok_obj, 1);
return;
}
free(f);
evas = e_win_evas_get(win);
_bg_edj_gen(evas, cfdata->file, cfdata->method);
if (import) e_widget_disabled_set(import->ok_obj, 1);
}
static void

@ -830,6 +830,17 @@ _e_main_dirs_init(void)
homedir);
system(buf);
}
/* FIXME: THIS is to get people started - shoudl be in a wizard */
snprintf(buf, sizeof(buf), "%s/.e/e/fileman/favorites", homedir);
if (!ecore_file_exists(buf))
{
snprintf(buf, sizeof(buf),
"gzip -d -c < %s/data/other/efm_favorites.tar.gz | "
"(cd %s/.e/e/ ; tar -xf -)",
e_prefix_data_get(),
homedir);
system(buf);
}
free(homedir);
return 1;

@ -756,9 +756,16 @@ _e_test_internal(E_Container *con)
}
#elif 0
static void
_e_test_cb_selected(void *data, Evas_Object *obj, void *event_info)
_e_test_cb_changed(void *data, Evas_Object *obj)
{
printf("SELECTED!\n");
printf("CHANGED \"%s\"\n", e_widget_fsel_selection_path_get(obj));
}
static void
_e_test_cb_selected(void *data, Evas_Object *obj)
{
printf("SELECTED \"%s\"\n", e_widget_fsel_selection_path_get(obj));
e_object_del(E_OBJECT(data));
}
static void
@ -771,7 +778,9 @@ _e_test_internal(E_Container *con)
dia = e_dialog_new(con);
e_dialog_title_set(dia, "A Test Dialog");
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL);
o = e_widget_fsel_add(dia->win->evas, "~/", "/", NULL, NULL,
_e_test_cb_selected, dia,
_e_test_cb_changed, dia);
evas_object_show(o);
e_widget_min_size_get(o, &mw, &mh);
e_dialog_content_set(dia, o, mw, mh);

@ -6,265 +6,91 @@
typedef struct _E_Widget_Data E_Widget_Data;
struct _E_Widget_Data
{
Evas_Object *o_table;
Evas_Object *o_table2;
Evas_Object *o_up_button;
Evas_Object *o_favorites_frame;
Evas_Object *o_favorites_fm;
Evas_Object *o_files_frame;
Evas_Object *o_files_fm;
Evas_Object *o_entry;
char *entry_text;
Evas_Object *o_frame, *o_box;
};
static void _e_wid_del_hook(Evas_Object *obj);
/* local subsystem functions */
static void
_e_wid_fsel_button_up(void *data1, void *data2)
{
E_Widget_Data *wd;
wd = data1;
e_fm2_parent_go(wd->o_files_fm);
e_widget_scrollframe_child_pos_set(wd->o_files_frame, 0, 0);
}
static void
_e_wid_fsel_favorites_files_changed(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_List *icons, *l;
E_Fm2_Icon_Info *ici;
const char *realpath;
char *p1, *p2;
wd = data;
icons = e_fm2_all_list_get(wd->o_favorites_fm);
if (!icons) return;
realpath = e_fm2_real_path_get(wd->o_files_fm);
p1 = ecore_file_realpath(realpath);
if (!p1) goto done;
for (l = icons; l; l = l->next)
{
ici = l->data;
if (ici->link)
{
p2 = ecore_file_realpath(ici->link);
if (p2)
{
if (!strcmp(p1, p2))
{
e_fm2_select_set(wd->o_favorites_fm, ici->file, 1);
E_FREE(p2);
goto done;
}
E_FREE(p2);
}
}
}
done:
E_FREE(p1);
evas_list_free(icons);
}
static void
_e_wid_fsel_favorites_selected(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_List *selected;
E_Fm2_Icon_Info *ici;
wd = data;
selected = e_fm2_selected_list_get(wd->o_favorites_fm);
if (!selected) return;
ici = selected->data;
if ((ici->link) && (ici->mount))
e_fm2_path_set(wd->o_files_fm, (char *)ici->link, "/");
else if (ici->link)
e_fm2_path_set(wd->o_files_fm, NULL, (char *)ici->link);
evas_list_free(selected);
e_widget_scrollframe_child_pos_set(wd->o_files_frame, 0, 0);
}
static void
_e_wid_fsel_files_changed(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
wd = data;
if (!e_fm2_has_parent_get(wd->o_files_fm))
e_widget_disabled_set(wd->o_up_button, 1);
else
e_widget_disabled_set(wd->o_up_button, 0);
}
static void
_e_wid_fsel_files_selection_change(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_List *selected;
E_Fm2_Icon_Info *ici;
wd = data;
selected = e_fm2_selected_list_get(wd->o_files_fm);
if (!selected) return;
ici = selected->data;
e_widget_entry_text_set(wd->o_entry, ici->file);
evas_list_free(selected);
}
static void
_e_wid_fsel_files_selected(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_List *selected;
E_Fm2_Icon_Info *ici;
char buf[4096];
wd = data;
selected = e_fm2_selected_list_get(wd->o_files_fm);
if (!selected) return;
ici = selected->data;
snprintf(buf, sizeof(buf), "%s/%s",
e_fm2_real_path_get(wd->o_files_fm), ici->file);
printf("SELECTED!!!! %s\n", buf);
evas_list_free(selected);
}
/* externally accessible functions */
EAPI Evas_Object *
e_widget_fsel_add(Evas *evas, char *dev, char *path, char *selected, char *filter)
e_widget_framelist_add(Evas *evas, char *label, int horiz)
{
Evas_Object *obj, *o;
E_Widget_Data *wd;
Evas_Coord mw = 0, mh = 0;
E_Fm2_Config fmc;
obj = e_widget_add(evas);
e_widget_del_hook_set(obj, _e_wid_del_hook);
wd = calloc(1, sizeof(E_Widget_Data));
e_widget_data_set(obj, wd);
o = e_widget_table_add(evas, 0);
wd->o_table = o;
e_widget_sub_object_add(obj, o);
e_widget_resize_object_set(obj, o);
o = e_widget_table_add(evas, 0);
wd->o_table2 = o;
o = edje_object_add(evas);
wd->o_frame = o;
e_theme_edje_object_set(o, "base/theme/widgets",
"widgets/frame");
edje_object_part_text_set(o, "label", label);
evas_object_show(o);
e_widget_sub_object_add(obj, o);
e_widget_resize_object_set(obj, o);
o = e_widget_button_add(evas, _("Go up a Directory"), NULL,
_e_wid_fsel_button_up, wd, NULL);
wd->o_up_button = o;
e_widget_sub_object_add(obj, o);
e_widget_table_object_append(wd->o_table2, o, 1, 0, 1, 1, 0, 0, 1, 0);
o = e_fm2_add(evas);
wd->o_favorites_fm = o;
o = e_box_add(evas);
wd->o_box = o;
e_box_orientation_set(o, horiz);
e_box_homogenous_set(o, 0);
edje_object_part_swallow(wd->o_frame, "items", o);
e_widget_sub_object_add(obj, o);
memset(&fmc, 0, sizeof(E_Fm2_Config));
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
fmc.view.open_dirs_in_place = 1;
fmc.view.selector = 1;
fmc.view.single_click = 1;
fmc.view.no_subdir_jump = 1;
fmc.icon.list.w = 24;
fmc.icon.list.h = 24;
fmc.icon.fixed.w = 1;
fmc.icon.fixed.h = 1;
fmc.icon.extension.show = 0;
fmc.list.sort.no_case = 1;
fmc.list.sort.dirs.first = 0;
fmc.list.sort.dirs.last = 0;
fmc.selection.single = 1;
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(o, &fmc);
e_fm2_path_set(o, "favorites", "/");
evas_object_smart_callback_add(o, "files_changed",
_e_wid_fsel_favorites_files_changed, wd);
evas_object_smart_callback_add(o, "selected",
_e_wid_fsel_favorites_selected, wd);
evas_object_show(o);
o = e_widget_scrollframe_pan_add(evas, wd->o_favorites_fm,
e_fm2_pan_set,
e_fm2_pan_get,
e_fm2_pan_max_get,
e_fm2_pan_child_size_get);
wd->o_favorites_frame = o;
e_widget_sub_object_add(obj, o);
e_widget_min_size_set(o, 128, 128);
e_widget_table_object_append(wd->o_table2, o, 0, 1, 1, 1, 0, 1, 0, 1);
o = e_fm2_add(evas);
wd->o_files_fm = o;
e_widget_sub_object_add(obj, o);
memset(&fmc, 0, sizeof(E_Fm2_Config));
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
fmc.view.open_dirs_in_place = 1;
fmc.view.selector = 1;
fmc.view.single_click = 0;
fmc.view.no_subdir_jump = 0;
fmc.icon.list.w = 24;
fmc.icon.list.h = 24;
fmc.icon.fixed.w = 1;
fmc.icon.fixed.h = 1;
fmc.icon.extension.show = 0;
fmc.list.sort.no_case = 1;
fmc.list.sort.dirs.first = 1;
fmc.list.sort.dirs.last = 0;
fmc.selection.single = 1;
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(o, &fmc);
e_fm2_path_set(o, dev, path);
evas_object_smart_callback_add(o, "changed",
_e_wid_fsel_files_changed, wd);
evas_object_smart_callback_add(o, "selection_change",
_e_wid_fsel_files_selection_change, wd);
evas_object_smart_callback_add(o, "selected",
_e_wid_fsel_files_selected, wd);
edje_object_size_min_calc(wd->o_frame, &mw, &mh);
e_widget_min_size_set(obj, mw, mh);
o = e_widget_scrollframe_pan_add(evas, wd->o_files_fm,
e_fm2_pan_set,
e_fm2_pan_get,
e_fm2_pan_max_get,
e_fm2_pan_child_size_get);
wd->o_files_frame = o;
e_widget_sub_object_add(obj, o);
e_widget_min_size_set(o, 128, 128);
e_widget_table_object_append(wd->o_table2, o, 1, 1, 1, 1, 1, 1, 1, 1);
return obj;
}
o = e_widget_entry_add(evas, &(wd->entry_text));
wd->o_entry = o;
e_widget_sub_object_add(obj, o);
EAPI void
e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj)
{
E_Widget_Data *wd;
Evas_Coord mw = 0, mh = 0;
e_widget_table_object_append(wd->o_table, wd->o_table2,
0, 0, 1, 1, 1, 1, 1, 1);
e_widget_table_object_append(wd->o_table, wd->o_entry,
0, 1, 1, 1, 1, 0, 1, 0);
wd = e_widget_data_get(obj);
e_widget_min_size_get(wd->o_table, &mw, &mh);
e_box_pack_end(wd->o_box, sobj);
e_widget_min_size_get(sobj, &mw, &mh);
e_box_pack_options_set(sobj,
1, 1, /* fill */
1, 0, /* expand */
0.5, 0.5, /* align */
mw, mh, /* min */
99999, 99999 /* max */
);
e_box_min_size_get(wd->o_box, &mw, &mh);
edje_extern_object_min_size_set(wd->o_box, mw, mh);
edje_object_part_swallow(wd->o_frame, "items", wd->o_box);
edje_object_size_min_calc(wd->o_frame, &mw, &mh);
e_widget_min_size_set(obj, mw, mh);
e_widget_sub_object_add(obj, sobj);
evas_object_show(sobj);
}
EAPI void
e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double valign)
{
E_Widget_Data *wd;
evas_object_show(wd->o_up_button);
evas_object_show(wd->o_favorites_frame);
evas_object_show(wd->o_favorites_fm);
evas_object_show(wd->o_files_frame);
evas_object_show(wd->o_files_fm);
evas_object_show(wd->o_entry);
evas_object_show(wd->o_table2);
evas_object_show(wd->o_table);
return obj;
wd = e_widget_data_get(obj);
e_box_align_set(wd->o_box, halign, valign);
}
static void
_e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
E_FREE(wd->entry_text);
free(wd);
}

@ -3,10 +3,12 @@
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_WIDGET_FSEL_H
#define E_WIDGET_FSEL_H
#ifndef E_WIDGET_FRAMELIST_H
#define E_WIDGET_FRAMELIST_H
EAPI Evas_Object *e_widget_fsel_add(Evas *evas, char *dev, char *path, char *selected, char *filter);
EAPI Evas_Object *e_widget_framelist_add(Evas *evas, char *label, int horiz);
EAPI void e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj);
EAPI void e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double valign);
#endif
#endif

@ -6,91 +6,294 @@
typedef struct _E_Widget_Data E_Widget_Data;
struct _E_Widget_Data
{
Evas_Object *o_frame, *o_box;
Evas_Object *obj;
Evas_Object *o_table;
Evas_Object *o_table2;
Evas_Object *o_up_button;
Evas_Object *o_favorites_frame;
Evas_Object *o_favorites_fm;
Evas_Object *o_files_frame;
Evas_Object *o_files_fm;
Evas_Object *o_entry;
char *entry_text;
char *path;
void (*sel_func) (void *data, Evas_Object *obj);
void *sel_data;
void (*chg_func) (void *data, Evas_Object *obj);
void *chg_data;
};
static void _e_wid_del_hook(Evas_Object *obj);
/* local subsystem functions */
static void
_e_wid_fsel_button_up(void *data1, void *data2)
{
E_Widget_Data *wd;
wd = data1;
e_fm2_parent_go(wd->o_files_fm);
e_widget_scrollframe_child_pos_set(wd->o_files_frame, 0, 0);
}
static void
_e_wid_fsel_favorites_files_changed(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_List *icons, *l;
E_Fm2_Icon_Info *ici;
const char *realpath;
char *p1, *p2;
wd = data;
icons = e_fm2_all_list_get(wd->o_favorites_fm);
if (!icons) return;
realpath = e_fm2_real_path_get(wd->o_files_fm);
p1 = ecore_file_realpath(realpath);
if (!p1) goto done;
for (l = icons; l; l = l->next)
{
ici = l->data;
if (ici->link)
{
p2 = ecore_file_realpath(ici->link);
if (p2)
{
if (!strcmp(p1, p2))
{
e_fm2_select_set(wd->o_favorites_fm, (char *)ici->file, 1);
E_FREE(p2);
goto done;
}
E_FREE(p2);
}
}
}
done:
E_FREE(p1);
evas_list_free(icons);
}
static void
_e_wid_fsel_favorites_selected(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_List *selected;
E_Fm2_Icon_Info *ici;
wd = data;
selected = e_fm2_selected_list_get(wd->o_favorites_fm);
if (!selected) return;
ici = selected->data;
if ((ici->link) && (ici->mount))
e_fm2_path_set(wd->o_files_fm, (char *)ici->link, "/");
else if (ici->link)
e_fm2_path_set(wd->o_files_fm, NULL, (char *)ici->link);
evas_list_free(selected);
e_widget_scrollframe_child_pos_set(wd->o_files_frame, 0, 0);
}
static void
_e_wid_fsel_files_changed(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
wd = data;
if (!e_fm2_has_parent_get(wd->o_files_fm))
e_widget_disabled_set(wd->o_up_button, 1);
else
e_widget_disabled_set(wd->o_up_button, 0);
e_widget_scrollframe_child_pos_set(wd->o_files_frame, 0, 0);
E_FREE(wd->path);
if (wd->chg_func) wd->chg_func(wd->chg_data, wd->obj);
}
static void
_e_wid_fsel_files_selection_change(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_List *selected;
E_Fm2_Icon_Info *ici;
char buf[4096];
wd = data;
selected = e_fm2_selected_list_get(wd->o_files_fm);
if (!selected) return;
ici = selected->data;
E_FREE(wd->path);
snprintf(buf, sizeof(buf), "%s/%s",
e_fm2_real_path_get(wd->o_files_fm), ici->file);
wd->path = strdup(buf);
e_widget_entry_text_set(wd->o_entry, ici->file);
evas_list_free(selected);
if (wd->chg_func) wd->chg_func(wd->chg_data, wd->obj);
}
static void
_e_wid_fsel_files_selected(void *data, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
wd = data;
if (wd->path)
{
if (wd->sel_func) wd->sel_func(wd->sel_data, wd->obj);
}
}
/* externally accessible functions */
/* FIXME: callback only exists for double-clicking and selecting. need to add
* one for when the selection changes as well
*/
EAPI Evas_Object *
e_widget_framelist_add(Evas *evas, char *label, int horiz)
e_widget_fsel_add(Evas *evas, char *dev, char *path, char *selected, char *filter,
void (*sel_func) (void *data, Evas_Object *obj), void *sel_data,
void (*chg_func) (void *data, Evas_Object *obj), void *chg_data)
{
Evas_Object *obj, *o;
E_Widget_Data *wd;
Evas_Coord mw = 0, mh = 0;
E_Fm2_Config fmc;
obj = e_widget_add(evas);
e_widget_del_hook_set(obj, _e_wid_del_hook);
wd = calloc(1, sizeof(E_Widget_Data));
e_widget_data_set(obj, wd);
wd->obj = obj;
wd->sel_func = sel_func;
wd->sel_data = sel_data;
wd->chg_func = chg_func;
wd->chg_data = chg_data;
o = edje_object_add(evas);
wd->o_frame = o;
e_theme_edje_object_set(o, "base/theme/widgets",
"widgets/frame");
edje_object_part_text_set(o, "label", label);
evas_object_show(o);
o = e_widget_table_add(evas, 0);
wd->o_table = o;
e_widget_sub_object_add(obj, o);
e_widget_resize_object_set(obj, o);
o = e_box_add(evas);
wd->o_box = o;
e_box_orientation_set(o, horiz);
e_box_homogenous_set(o, 0);
edje_object_part_swallow(wd->o_frame, "items", o);
o = e_widget_table_add(evas, 0);
wd->o_table2 = o;
e_widget_sub_object_add(obj, o);
evas_object_show(o);
edje_object_size_min_calc(wd->o_frame, &mw, &mh);
e_widget_min_size_set(obj, mw, mh);
o = e_widget_button_add(evas, _("Go up a Directory"), NULL,
_e_wid_fsel_button_up, wd, NULL);
wd->o_up_button = o;
e_widget_sub_object_add(obj, o);
e_widget_table_object_append(wd->o_table2, o, 1, 0, 1, 1, 0, 0, 1, 0);
o = e_fm2_add(evas);
wd->o_favorites_fm = o;
e_widget_sub_object_add(obj, o);
memset(&fmc, 0, sizeof(E_Fm2_Config));
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
fmc.view.open_dirs_in_place = 1;
fmc.view.selector = 1;
fmc.view.single_click = 1;
fmc.view.no_subdir_jump = 1;
fmc.icon.list.w = 24;
fmc.icon.list.h = 24;
fmc.icon.fixed.w = 1;
fmc.icon.fixed.h = 1;
fmc.icon.extension.show = 0;
fmc.list.sort.no_case = 1;
fmc.list.sort.dirs.first = 0;
fmc.list.sort.dirs.last = 0;
fmc.selection.single = 1;
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(o, &fmc);
e_fm2_path_set(o, "favorites", "/");
evas_object_smart_callback_add(o, "files_changed",
_e_wid_fsel_favorites_files_changed, wd);
evas_object_smart_callback_add(o, "selected",
_e_wid_fsel_favorites_selected, wd);
return obj;
}
o = e_widget_scrollframe_pan_add(evas, wd->o_favorites_fm,
e_fm2_pan_set,
e_fm2_pan_get,
e_fm2_pan_max_get,
e_fm2_pan_child_size_get);
wd->o_favorites_frame = o;
e_widget_sub_object_add(obj, o);
e_widget_min_size_set(o, 128, 128);
e_widget_table_object_append(wd->o_table2, o, 0, 1, 1, 1, 0, 1, 0, 1);
EAPI void
e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj)
{
E_Widget_Data *wd;
Evas_Coord mw = 0, mh = 0;
o = e_fm2_add(evas);
wd->o_files_fm = o;
e_widget_sub_object_add(obj, o);
memset(&fmc, 0, sizeof(E_Fm2_Config));
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
fmc.view.open_dirs_in_place = 1;
fmc.view.selector = 1;
fmc.view.single_click = 0;
fmc.view.no_subdir_jump = 0;
fmc.icon.list.w = 24;
fmc.icon.list.h = 24;
fmc.icon.fixed.w = 1;
fmc.icon.fixed.h = 1;
fmc.icon.extension.show = 0;
fmc.list.sort.no_case = 1;
fmc.list.sort.dirs.first = 1;
fmc.list.sort.dirs.last = 0;
fmc.selection.single = 1;
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(o, &fmc);
e_fm2_path_set(o, dev, path);
evas_object_smart_callback_add(o, "changed",
_e_wid_fsel_files_changed, wd);
evas_object_smart_callback_add(o, "selection_change",
_e_wid_fsel_files_selection_change, wd);
evas_object_smart_callback_add(o, "selected",
_e_wid_fsel_files_selected, wd);
wd = e_widget_data_get(obj);
o = e_widget_scrollframe_pan_add(evas, wd->o_files_fm,
e_fm2_pan_set,
e_fm2_pan_get,
e_fm2_pan_max_get,
e_fm2_pan_child_size_get);
wd->o_files_frame = o;
e_widget_sub_object_add(obj, o);
e_widget_min_size_set(o, 128, 128);
e_widget_table_object_append(wd->o_table2, o, 1, 1, 1, 1, 1, 1, 1, 1);
o = e_widget_entry_add(evas, &(wd->entry_text));
wd->o_entry = o;
e_widget_sub_object_add(obj, o);
e_widget_table_object_append(wd->o_table, wd->o_table2,
0, 0, 1, 1, 1, 1, 1, 1);
e_widget_table_object_append(wd->o_table, wd->o_entry,
0, 1, 1, 1, 1, 0, 1, 0);
e_box_pack_end(wd->o_box, sobj);
e_widget_min_size_get(sobj, &mw, &mh);
e_box_pack_options_set(sobj,
1, 1, /* fill */
1, 0, /* expand */
0.5, 0.5, /* align */
mw, mh, /* min */
99999, 99999 /* max */
);
e_box_min_size_get(wd->o_box, &mw, &mh);
edje_extern_object_min_size_set(wd->o_box, mw, mh);
edje_object_part_swallow(wd->o_frame, "items", wd->o_box);
edje_object_size_min_calc(wd->o_frame, &mw, &mh);
e_widget_min_size_get(wd->o_table, &mw, &mh);
e_widget_min_size_set(obj, mw, mh);
e_widget_sub_object_add(obj, sobj);
evas_object_show(sobj);
evas_object_show(wd->o_up_button);
evas_object_show(wd->o_favorites_frame);
evas_object_show(wd->o_favorites_fm);
evas_object_show(wd->o_files_frame);
evas_object_show(wd->o_files_fm);
evas_object_show(wd->o_entry);
evas_object_show(wd->o_table2);
evas_object_show(wd->o_table);
return obj;
}
EAPI void
e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double valign)
EAPI const char *
e_widget_fsel_selection_path_get(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
e_box_align_set(wd->o_box, halign, valign);
return wd->path;
}
static void
_e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
E_FREE(wd->entry_text);
free(wd);
}

@ -3,12 +3,13 @@
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_WIDGET_FRAMELIST_H
#define E_WIDGET_FRAMELIST_H
EAPI Evas_Object *e_widget_framelist_add(Evas *evas, char *label, int horiz);
EAPI void e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj);
EAPI void e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double valign);
#ifndef E_WIDGET_FSEL_H
#define E_WIDGET_FSEL_H
EAPI Evas_Object *e_widget_fsel_add(Evas *evas, char *dev, char *path, char *selected, char *filter,
void (*sel_func) (void *data, Evas_Object *obj), void *sel_data,
void (*chg_func) (void *data, Evas_Object *obj), void *chg_data);
EAPI const char *e_widget_fsel_selection_path_get(Evas_Object *obj);
#endif
#endif

Loading…
Cancel
Save