type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
rel1.to: "base";
rel2 {
to_y: "base";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
visible: 0;
rel1 {
to_y: "base";
}
part { name: "elm.dragable.slider";
type: RECT;
- mouse_events: 1;
+ mouse_events: 0;
scale: 1;
dragable {
x: 1 1 0;
confine: "bg";
}
description { state: "default" 0.0;
- min: 24 24;
- max: 24 24;
+ min: 0 24;
+ max: 0 24;
fixed: 1 1;
rel1 {
relative: 0.5 0.5;
color: 0 0 0 0;
}
}
+ part { name: "button_events";
+ type: RECT;
+ dragable {
+ events: "elm.dragable.slider";
+ }
+ mouse_events: 1;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 32 32;
+ max: 32 32;
+ rel1.to: "elm.dragable.slider";
+ rel2.to: "elm.dragable.slider";
+ color: 0 0 0 0;
+ }
+ }
part { name: "button0";
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
max: 17 999;
min: 17 24;
rel1.to: "elm.dragable.slider";
part { name: "button3";
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
visible: 0;
min: 8 32;
align: 1.0 0.5;
rel2 {
to: "button4";
relative: 0.0 1.0;
- offset: 0 -1;
+ offset: -1 -1;
}
image {
normal: "sl_bt2_0_0.png";
max: 15 999;
min: 15 32;
rel1 {
- to_x: "elm.dragable.slider";
+ to_x: "button0";
to_y: "elm.indicator";
- offset: 0 -7;
+ offset: 0 0;
}
- rel2.to: "elm.dragable.slider";
+ rel2.to: "button0";
image {
normal: "sl_bt2_0_1.png";
border: 0 0 6 12;
part { name: "button5";
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
visible: 0;
min: 8 32;
- align: 1.0 0.5;
+ align: 0.0 0.5;
rel1 {
to: "button4";
relative: 1.0 0.0;
fixed: 1 1;
align: 0.5 1.0;
rel1 {
- to: "elm.dragable.slider";
- relative: 0.0 0.0;
+ to: "button0";
+ relative: 0.0 -0.25;
offset: 0 0;
}
rel2 {
- to_x: "elm.dragable.slider";
- relative: 1.0 0.0;
+ to_x: "button0";
+ relative: 1.0 -0.25;
offset: -1 0;
}
color: 224 224 224 255;
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
rel1.to: "base";
rel2 {
to_x: "base";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
visible: 0;
rel1 {
to_x: "base";
}
part { name: "elm.dragable.slider";
type: RECT;
- mouse_events: 1;
+ mouse_events: 0;
scale: 1;
dragable {
x: 0 0 0;
confine: "bg";
}
description { state: "default" 0.0;
- min: 24 24;
- max: 24 24;
+ min: 24 0;
+ max: 24 0;
fixed: 1 1;
rel1 {
relative: 0.5 0.5;
color: 0 0 0 0;
}
}
+ part { name: "button_events";
+ type: RECT;
+ dragable {
+ events: "elm.dragable.slider";
+ }
+ mouse_events: 1;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ min: 32 32;
+ max: 32 32;
+ rel1.to: "elm.dragable.slider";
+ rel2.to: "elm.dragable.slider";
+ color: 0 0 0 0;
+ }
+ }
part { name: "button0";
mouse_events: 0;
description { state: "default" 0.0;
+ fixed: 1 1;
max: 17 999;
min: 17 24;
- rel1.to: "elm.dragable.slider";
- rel2.to: "elm.dragable.slider";
+ rel1.to: "button_events";
+ rel2.to: "button_events";
image {
normal: "sl_bt_0.png";
border: 5 5 5 10;
rel2 {
to: "button4";
relative: 0.0 1.0;
- offset: 0 -1;
+ offset: -1 -1;
}
image {
normal: "sl_bt2_0_0.png";
min: 15 32;
fixed: 1 1;
rel1 {
- to_x: "elm.dragable.slider";
+ to_x: "button0";
to_y: "elm.indicator";
offset: 0 -7;
}
- rel2.to: "elm.dragable.slider";
+ rel2.to: "button0";
image {
normal: "sl_bt2_0_1.png";
border: 0 0 6 12;
description { state: "default" 0.0;
visible: 0;
min: 8 32;
- align: 1.0 0.5;
+ align: 0.0 0.5;
rel1 {
to: "button4";
relative: 1.0 0.0;
fixed: 1 1;
align: 0.5 1.0;
rel1 {
- to: "elm.dragable.slider";
- relative: 0.0 0.0;
+ to: "button0";
+ relative: 0.0 -0.25;
offset: 0 0;
}
rel2 {
- to: "elm.dragable.slider";
- relative: 1.0 0.0;
+ to: "button0";
+ relative: 1.0 -0.25;
offset: -1 0;
}
color: 224 224 224 255;
elm_slider_label_set(sl, "Label");
elm_slider_icon_set(sl, ic);
elm_slider_unit_format_set(sl, "%1.1f units");
- elm_slider_span_size_set(sl, 400);
+ elm_slider_span_size_set(sl, 120);
evas_object_size_hint_align_set(sl, -1.0, -1.0);
evas_object_size_hint_weight_set(sl, 1.0, 1.0);
elm_box_pack_end(bx, sl);
sl = elm_slider_add(win);
elm_slider_label_set(sl, "Label 2");
- elm_slider_span_size_set(sl, 200);
+ elm_slider_span_size_set(sl, 80);
evas_object_size_hint_align_set(sl, -1.0, -1.0);
evas_object_size_hint_weight_set(sl, 1.0, 1.0);
elm_slider_indicator_format_set(sl, "%3.0f");
sl = elm_slider_add(win);
elm_slider_label_set(sl, "Label 3");
elm_slider_unit_format_set(sl, "units");
- elm_slider_span_size_set(sl, 200);
+ elm_slider_span_size_set(sl, 40);
evas_object_size_hint_align_set(sl, -1.0, -1.0);
evas_object_size_hint_weight_set(sl, 1.0, 1.0);
elm_slider_indicator_format_set(sl, "%3.0f");
elm_slider_icon_set(sl, ic);
elm_slider_label_set(sl, "Label 4");
elm_slider_unit_format_set(sl, "units");
- elm_slider_span_size_set(sl, 200);
+ elm_slider_span_size_set(sl, 60);
evas_object_size_hint_align_set(sl, 0.5, -1.0);
evas_object_size_hint_weight_set(sl, 0.0, 1.0);
elm_slider_indicator_format_set(sl, "%1.1f");
#include "elm_priv.h"
typedef struct _Widget_Data Widget_Data;
+typedef struct _Item Item;
+typedef struct _Item_Block Item_Block;
struct _Widget_Data
{
Evas_Object *scr;
+ Evas_Object *pan_smart;
Evas_Object *content;
+ Eina_Inlist *items;
+ Eina_Inlist *blocks;
Evas_Bool min_w : 1;
Evas_Bool min_h : 1;
};
+struct _Item_Block
+{
+ Eina_Inlist __header;
+ int count;
+ Evas_Object *obj;
+ Eina_List *items;
+ Evas_Coord x, y, w, h;
+ Evas_Bool realized : 1;
+};
+
+struct _Item
+{
+ Eina_Inlist __header;
+ Item_Block *block;
+ Eina_Inlist *subblocks; // not done yet
+ Eina_List *subitems; // not done yet
+
+ Evas_Coord x, y, w, h;
+ Evas_Bool realized : 1;
+ Evas_Bool selected : 1;
+ Evas_Bool expanded : 1; // not done yet
+ Evas_Bool disabled : 1;
+
+ const Elm_Genlist_Item_Class *itc;
+ const void *data;
+ Elm_Genlist_Item *parent; // not done yet
+ Elm_Genlist_Item_Flags flags;
+ struct {
+ void (*func) (void *data, Evas_Object *obj, void *event_info);
+ const void *data;
+ } func;
+};
+
static void _del_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
static void _show_region_hook(void *data, Evas_Object *obj);
_sizing_eval(data);
}
+typedef struct _Pan Pan;
+
+struct _Pan {
+ int x;
+};
+
+static Evas_Smart_Class _pan_sc = {NULL};
+
+static void
+_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
+{
+}
+
+static void
+_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
+{
+}
+
+static void
+_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
+{
+}
+
+static void
+_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
+{
+}
+
+static void
+_pan_add(Evas_Object *obj)
+{
+ Pan *sd;
+
+ sd = calloc(1, sizeof(Pan));
+ if (!sd) return;
+ // FIXME: setup sd
+ evas_object_smart_data_set(obj, sd);
+ _pan_sc.add(obj);
+}
+
+static void
+_pan_del(Evas_Object *obj)
+{
+ Pan *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ // FIXME: del smart stuff
+ free(sd);
+}
+
+static void
+_pan_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+ Evas_Coord ow, oh;
+ evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
+ if ((ow == w) && (oh == h)) return;
+ evas_object_smart_changed(obj);
+}
+
+static void
+_pan_calculate(Evas_Object *obj)
+{
+ // FIXME: calcualte new geom
+}
+
EAPI Evas_Object *
elm_genlist_add(Evas_Object *parent)
{
Evas *e;
Widget_Data *wd;
Evas_Coord vw, vh, minw, minh;
+ static Evas_Smart *smart = NULL;
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
wd->scr = elm_smart_scroller_add(e);
elm_widget_resize_object_set(obj, wd->scr);
+ if (!smart)
+ {
+ static Evas_Smart_Class sc = { "Elm_Genlist_Pan", EVAS_SMART_CLASS_VERSION, };
+
+ evas_object_smart_clipped_smart_set(&_pan_sc);
+ sc.add = _pan_add;
+ sc.del = _pan_del;
+ sc.move = _pan_sc.move;
+ sc.resize = _pan_resize;
+ sc.show = _pan_sc.show;
+ sc.hide = _pan_sc.hide;
+ sc.color_set = _pan_sc.color_set;
+ sc.clip_set = _pan_sc.clip_set;
+ sc.clip_unset = _pan_sc.clip_unset;
+ sc.calculate = _pan_calculate;
+ sc.member_add = _pan_sc.member_add;
+ sc.member_del = _pan_sc.member_del;
+ smart = evas_smart_class_new(&sc);
+ }
+
+ wd->pan_smart = evas_object_smart_add(e, smart);
+ // FIXME: init the pan
+
+ elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart,
+ _pan_set, _pan_get,
+ _pan_max_get, _pan_child_size_get);
+
edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
return obj;
}
+static Item *
+_item_new(Evas_Object *obj, const Elm_Genlist_Item_Class *itc,
+ const void *data, Elm_Genlist_Item *parent,
+ Elm_Genlist_Item_Flags flags,
+ void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data)
+{
+ Item *it;
+
+ it = calloc(1, sizeof(Item));
+ if (!it) return NULL;
+ it->itc = itc;
+ it->data = data;
+ it->parent = parent;
+ it->flags = flags;
+ it->func.func = func;
+ it->func.data = func_data;
+ return it;
+}
+
EAPI Elm_Genlist_Item *
-elm_genlist_item_add(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags)
+elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc,
+ const void *data, Elm_Genlist_Item *parent,
+ Elm_Genlist_Item_Flags flags,
+ void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data)
{
Widget_Data *wd = elm_widget_data_get(obj);
+ Item *it = _item_new(obj, itc, data, parent, flags, func, func_data);
+ if (!it) return NULL;
+ wd->items = eina_inlist_append(wd->items, (Eina_Inlist *)it);
+ return (Elm_Genlist_Item *)it;
+}
+
+EAPI Elm_Genlist_Item *
+elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc,
+ const void *data, Elm_Genlist_Item *parent,
+ Elm_Genlist_Item_Flags flags,
+ void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data)
+{
+}
+
+EAPI Elm_Genlist_Item *
+elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc,
+ const void *data, Elm_Genlist_Item *before,
+ Elm_Genlist_Item_Flags flags,
+ void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data)
+{
+}
+
+EAPI Elm_Genlist_Item *
+elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc,
+ const void *data, Elm_Genlist_Item *after,
+ Elm_Genlist_Item_Flags flags,
+ void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data)
+{
+}
+
+EAPI void
+elm_genlist_multi_select_set(Evas_Object *obj, Evas_Bool multi)
+{
+}
+
+EAPI const Eina_List *
+elm_genlist_items_get(Evas_Object *obj)
+{
+}
+
+EAPI const Elm_Genlist_Item *
+elm_genlist_selected_item_get(Evas_Object *obj)
+{
+}
+
+EAPI const Eina_List *
+elm_genlist_selected_items_get(Evas_Object *obj)
+{
+}
+
+EAPI const Eina_List *
+elm_genlist_item_items_get(Elm_Genlist_Item *item)
+{
+}
+
+EAPI void
+elm_genlist_item_selected_set(Elm_Genlist_Item *item, Evas_Bool selected)
+{
+}
+
+EAPI void
+elm_genlist_item_expanded_set(Elm_Genlist_Item *item, Evas_Bool expanded)
+{
+ // not done yet
+}
+
+EAPI void
+elm_genlist_item_disabld_set(Elm_Genlist_Item *item, Evas_Bool disabld)
+{
+}
+
+EAPI void
+elm_genlist_item_show(Elm_Genlist_Item *item)
+{
+}
+
+EAPI void
+elm_genlist_item_del(Elm_Genlist_Item *item)
+{
+}
+
+EAPI const void *
+elm_genlist_item_data_get(Elm_Genlist_Item *item)
+{
}