E_Win *win;
Evas *evas;
- Evas_Object *bg;
- Evas_Object *clip;
+ Evas_Object *edje_obj;
+ Evas_Object *event_obj;
+ Evas_Object *clip_obj;
Evas_Object *layout;
Evas_Object *object;
Evas_Object *entry_object;
static int _e_fm_files_sort_name_cb (void *d1, void *d2);
static int _e_fm_files_sort_modtime_cb (void *d1, void *d2);
+static int _e_fm_files_sort_layout_name_cb (void *d1, void *d2);
static void _e_fm_selector_send_file (E_Fm_Icon *icon);
e_fm_background_set(Evas_Object *object, Evas_Object *bg)
{
E_Fm_Smart_Data *sd;
+ Evas_Object *swallow;
return;
if ((!object) || !(sd = evas_object_smart_data_get(object)))
return;
- sd->bg = bg;
+ swallow = NULL;
+ swallow = edje_object_part_swallow_get(sd->edje_obj, "background");
+ if(swallow)
+ edje_object_part_unswallow(sd->edje_obj, swallow);
+ edje_object_part_swallow(sd->edje_obj, "background", bg);
}
/* local subsystem functions */
sd->evas = evas_object_evas_get(object);
sd->frozen = 0;
sd->is_selector = 0;
- //sd->bg = edje_object_add(sd->evas);
- sd->bg = evas_object_rectangle_add(sd->evas);
- evas_object_color_set(sd->bg, 0, 0, 0, 0);
- evas_object_smart_member_add(sd->bg, object);
- evas_object_show(sd->bg);
- e_theme_edje_object_set(sd->selection.band.obj,
- "base/theme/fileman/background",
- "fileman/background");
- evas_object_event_callback_add(sd->bg, EVAS_CALLBACK_MOUSE_DOWN,
+ sd->edje_obj = edje_object_add(sd->evas);
+ evas_object_repeat_events_set(sd->edje_obj, 1);
+ e_theme_edje_object_set(sd->edje_obj,
+ "base/theme/fileman",
+ "fileman/smart");
+ evas_object_smart_member_add(sd->edje_obj, object);
+ evas_object_show(sd->edje_obj);
+
+ sd->event_obj = evas_object_rectangle_add(sd->evas);
+ evas_object_smart_member_add(sd->event_obj, object);
+ evas_object_color_set(sd->event_obj, 0, 0, 0, 0);
+ evas_object_stack_below(sd->event_obj, sd->edje_obj);
+ evas_object_show(sd->event_obj);
+ evas_object_event_callback_add(sd->event_obj, EVAS_CALLBACK_MOUSE_DOWN,
_e_fm_mouse_down_cb, sd);
- evas_object_event_callback_add(sd->bg, EVAS_CALLBACK_MOUSE_UP,
+ evas_object_event_callback_add(sd->event_obj, EVAS_CALLBACK_MOUSE_UP,
_e_fm_mouse_up_cb, sd);
- evas_object_event_callback_add(sd->bg, EVAS_CALLBACK_MOUSE_MOVE,
+ evas_object_event_callback_add(sd->event_obj, EVAS_CALLBACK_MOUSE_MOVE,
_e_fm_mouse_move_cb, sd);
-
sd->layout = e_icon_layout_add(sd->evas);
- evas_object_repeat_events_set(sd->layout, 1);
- evas_object_smart_member_add(sd->layout, object);
e_icon_layout_spacing_set(sd->layout, sd->icon_info.x_space, sd->icon_info.y_space);
evas_object_show(sd->layout);
- sd->clip = evas_object_rectangle_add(sd->evas);
- evas_object_smart_member_add(sd->clip, object);
- evas_object_show(sd->clip);
- evas_object_move(sd->clip, -100003, -100003);
- evas_object_resize(sd->clip, 200006, 200006);
- evas_object_color_set(sd->clip, 255, 255, 255, 255);
+ sd->clip_obj = evas_object_rectangle_add(sd->evas);
+ evas_object_smart_member_add(sd->clip_obj, object);
+ evas_object_show(sd->clip_obj);
+ evas_object_move(sd->clip_obj, -100003, -100003);
+ evas_object_resize(sd->clip_obj, 200006, 200006);
+ evas_object_color_set(sd->clip_obj, 255, 255, 255, 255);
- evas_object_clip_set(sd->bg, sd->clip);
- evas_object_clip_set(sd->layout, sd->clip);
+ evas_object_clip_set(sd->edje_obj, sd->clip_obj);
+ edje_object_part_swallow(sd->edje_obj, "icons", sd->layout);
+
sd->selection.band.obj = edje_object_add(sd->evas);
evas_object_smart_member_add(sd->selection.band.obj, object);
e_theme_edje_object_set(sd->selection.band.obj,
"fileman/rubberband");
evas_object_focus_set(sd->object, 1);
- evas_object_event_callback_add(sd->object, EVAS_CALLBACK_KEY_DOWN, _e_fm_key_down_cb, sd);
+ evas_object_event_callback_add(sd->object, EVAS_CALLBACK_KEY_DOWN, _e_fm_key_down_cb, sd);
+
- evas_object_stack_below(sd->bg, sd->layout);
sd->event_handlers = NULL;
}
evas_object_del(sd->selection.band.obj);
- evas_object_del(sd->clip);
- evas_object_del(sd->bg);
+ evas_object_del(sd->clip_obj);
+ evas_object_del(sd->edje_obj);
evas_object_del(sd->layout);
if (sd->entry_object) evas_object_del(sd->entry_object);
if (sd->menu) e_object_del(E_OBJECT(sd->menu));
sd->x = x;
sd->y = y;
- evas_object_move(sd->bg, x, y);
- evas_object_move(sd->clip, x, y);
- evas_object_move(sd->layout, sd->x - sd->child.x, sd->y - sd->child.y);
+ evas_object_move(sd->edje_obj, x, y);
+ evas_object_move(sd->clip_obj, x, y);
+ evas_object_move(sd->event_obj, x, y);
+// evas_object_move(sd->layout, sd->x - sd->child.x, sd->y - sd->child.y);
}
static void
if ((!object) || !(sd = evas_object_smart_data_get(object)))
return;
- evas_object_resize(sd->bg, w, h);
- evas_object_resize(sd->clip, w, h);
- evas_object_resize(sd->layout, w, h);
+ evas_object_resize(sd->edje_obj, w, h);
+ evas_object_resize(sd->clip_obj, w, h);
+ evas_object_resize(sd->event_obj, w, h);
+// evas_object_resize(sd->layout, w, h);
e_icon_layout_width_fix(sd->layout, w);
e_icon_layout_virtual_size_get(sd->layout, &sd->child.w, &sd->child.h);
sd->conf.main->width = w;
if ((!object) || !(sd = evas_object_smart_data_get(object)))
return;
- evas_object_show(sd->bg);
- evas_object_show(sd->layout);
- evas_object_show(sd->clip);
+ evas_object_show(sd->edje_obj);
+// evas_object_show(sd->layout);
+ evas_object_show(sd->clip_obj);
}
static void
if ((!object) || !(sd = evas_object_smart_data_get(object)))
return;
- evas_object_hide(sd->clip);
+ evas_object_hide(sd->clip_obj);
}
static void
if ((!object) || !(sd = evas_object_smart_data_get(object)))
return;
- evas_object_color_set(sd->clip, r, g, b, a);
+ evas_object_color_set(sd->clip_obj, r, g, b, a);
}
static void
if ((!object) || !(sd = evas_object_smart_data_get(object)))
return;
- evas_object_clip_set(sd->clip, clip);
+ evas_object_clip_set(sd->clip_obj, clip);
}
static void
if ((!object) || !(sd = evas_object_smart_data_get(object)))
return;
- evas_object_clip_unset(sd->clip);
+ evas_object_clip_unset(sd->clip_obj);
}
static void
evas_object_smart_callback_call(sd->object, "changed", NULL);
if(!dir_entry) {
- closedir(sd->dir2);
+ closedir(sd->dir2);
+
sd->files = evas_list_sort(sd->files,
evas_list_count(sd->files),
_e_fm_files_sort_name_cb);
-
+ e_icon_layout_sort(sd->layout, _e_fm_files_sort_layout_name_cb);
+
+/*
e_icon_layout_freeze(sd->layout);
e_icon_layout_reset(sd->layout);
e_icon_layout_pack(sd->layout, icon->icon_object);
}
e_icon_layout_thaw(sd->layout);
+*/
sd->timer = NULL;
return 0;
}
{
char *fullname;
- icon->sd->drag.start = 0;
+ if(icon->sd->win)
+ icon->sd->drag.start = 0;
if (!strcmp(icon->file->name, ".")) return;
}
else if (icon->file->type == E_FM_FILE_TYPE_FILE && (ev->flags == EVAS_BUTTON_DOUBLE_CLICK))
{
- icon->sd->drag.start = 0;
+ if(icon->sd->win)
+ icon->sd->drag.start = 0;
if(icon->sd->is_selector)
{
}
else
{
- icon->sd->drag.start = 1;
- icon->sd->drag.y = -1;
- icon->sd->drag.x = -1;
- icon->sd->drag.icon_object = icon;
+ if(icon->sd->win)
+ {
+ icon->sd->drag.start = 1;
+ icon->sd->drag.x = icon->sd->win->x + ev->canvas.x;
+ icon->sd->drag.y = icon->sd->win->y + ev->canvas.y;
+ icon->sd->drag.icon_object = icon;
+ }
if (!icon->state.selected)
{
ev = event_info;
icon = data;
- icon->sd->drag.start = 0;
+ if(icon->sd->win)
+ icon->sd->drag.start = 0;
}
static void
ev = event_info;
sd = data;
- icon = sd->drag.icon_object;
+ if(sd->win)
+ icon = sd->drag.icon_object;
- if (!icon) return 1;
+ if (!icon) return;
- if (sd->drag.start)
+ if (sd->drag.start && sd->win)
{
if ((sd->drag.x == -1) && (sd->drag.y == -1))
{
e_drag_object_set(drag, o);
e_drag_resize(drag, w, h);
+
e_drag_xdnd_start(drag, sd->drag.x, sd->drag.y);
evas_event_feed_mouse_up(sd->evas, 1, EVAS_BUTTON_NONE, ev->timestamp, NULL);
sd->drag.start = 0;
ev = event_info;
sd = data;
+
+ edje_object_signal_emit(sd->object, "typebuf_show", "");
if (!strcmp(ev->keyname, "Up"))
_e_fm_icon_select_up(sd);
}
static int
+_e_fm_files_sort_layout_name_cb(void *d1, void *d2)
+{
+ Evas_Object *e1, *e2;
+ E_Fm_File *f1, *f2;
+
+ e1 = d1;
+ e2 = d2;
+
+ f1 = e_fm_icon_file_get(e1);
+ f2 = e_fm_icon_file_get(e2);
+
+ return (strcmp(f1->name, f2->name));
+}
+
+static int
_e_fm_files_sort_modtime_cb(void *d1, void *d2)
{
E_Fm_Icon *e1, *e2;
static void _e_icon_layout_smart_color_set(Evas_Object *obj, int r, int g, int b, int a);
static void _e_icon_layout_smart_clip_set(Evas_Object *obj, Evas_Object *clip);
static void _e_icon_layout_smart_clip_unset(Evas_Object *obj);
+static void _e_icon_layout_smart_raise(Evas_Object *obj);
+static void _e_icon_layout_smart_lower(Evas_Object *obj);
+static void _e_icon_layout_smart_stack_below(Evas_Object *obj, Evas_Object *below);
+static void _e_icon_layout_smart_stack_above(Evas_Object *obj, Evas_Object *above);
/* local subsystem globals */
static Evas_Smart *_e_smart = NULL;
}
void
+e_icon_layout_sort(Evas_Object *obj, int (*func)(void *d1, void *d2))
+{
+ E_Smart_Data *sd;
+
+ if ((!obj) || !(sd = evas_object_smart_data_get(obj)))
+ return;
+
+ sd->items = evas_list_sort(sd->items, evas_list_count(sd->items), func);
+ _e_icon_layout_smart_reconfigure(sd);
+}
+
+
+void
e_icon_layout_pack(Evas_Object *obj, Evas_Object *child)
{
E_Smart_Data *sd;
_e_smart = evas_smart_new("e_icon_layout",
_e_icon_layout_smart_add,
_e_icon_layout_smart_del,
- NULL, NULL, NULL, NULL, NULL,
+ NULL,
+ _e_icon_layout_smart_raise,
+ _e_icon_layout_smart_lower,
+ _e_icon_layout_smart_stack_above,
+ _e_icon_layout_smart_stack_below,
_e_icon_layout_smart_move,
_e_icon_layout_smart_resize,
_e_icon_layout_smart_show,
free(sd);
}
+static void
+_e_icon_layout_smart_raise(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+ Evas_List *l;
+
+ sd = evas_object_smart_data_get(obj);
+
+ if (!sd) return;
+ for(l = sd->items; l; l = l->next)
+ evas_object_raise(l->data);
+}
+
+static void
+_e_icon_layout_smart_lower(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+ Evas_List *l;
+
+ sd = evas_object_smart_data_get(obj);
+
+ if (!sd) return;
+ for(l = sd->items; l; l = l->next)
+ evas_object_lower(l->data);
+}
+
+static void
+_e_icon_layout_smart_stack_above(Evas_Object *obj, Evas_Object *above)
+{
+ E_Smart_Data *sd;
+ Evas_List *l;
+
+ sd = evas_object_smart_data_get(obj);
+
+ if (!sd) return;
+ for(l = sd->items; l; l = l->next)
+ evas_object_stack_above(l->data, above);
+}
+
+static void
+_e_icon_layout_smart_stack_below(Evas_Object *obj, Evas_Object *below)
+{
+ E_Smart_Data *sd;
+ Evas_List *l;
+
+ sd = evas_object_smart_data_get(obj);
+
+ if (!sd) return;
+ for(l = sd->items; l; l = l->next)
+ evas_object_stack_above(l->data, below);
+}
+
static void
_e_icon_layout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{