struct _Widget_Data
{
Eina_Inlist_Sorted_State *state;
- Evas_Object *obj, *scr, *pan_smart;
- Eina_Inlist *items, *blocks;
- Eina_List *group_items;
- Pan *pan;
+ Evas_Object *obj; /* the genlist object */
+ Evas_Object *scr; /* a smart scroller object which is used internally in genlist */
+ Evas_Object *pan_smart; /* "elm_genlist_pan" evas smart object. this is an extern pan of smart scroller(scr). */
+ Eina_Inlist *items; /* inlist of all items */
+ Eina_Inlist *blocks; /* inlist of all blocks. a block consists of a certain number of items. maximum number of items in a block is 'max_items_per_block'. */
+ Eina_List *group_items; /* list of groups index items */
+ Pan *pan; /* pan_smart object's smart data */
Evas_Coord pan_x, pan_y, reorder_old_pan_y, w, h, minw, minh, realminw, prev_viewport_w;
Ecore_Job *calc_job, *update_job;
Ecore_Idle_Enterer *queue_idle_enterer;
Ecore_Idler *must_recalc_idler;
Eina_List *queue, *selected;
- Elm_Genlist_Item *show_item, *last_selected_item, *anchor_item, *mode_item, *reorder_it, *reorder_rel, *expanded_item;
- Eina_Inlist *item_cache;
- Evas_Coord anchor_y, reorder_start_y;
+ Elm_Genlist_Item *show_item, *anchor_item, *mode_item, *reorder_rel, *expanded_item;
+ Elm_Genlist_Item *last_selected_item; /* the last selected item. */
+ Elm_Genlist_Item *reorder_it; /* an item which is longpressed and in the moving state. */
+ Eina_Inlist *item_cache; /* an inlist of edje object item cache. */
+ Evas_Coord anchor_y;
+ Evas_Coord reorder_start_y; /* reorder item's initial y coordinate in the pan. */
Elm_List_Mode mode;
Ecore_Timer *multi_timer, *scr_hold_timer;
Ecore_Animator *reorder_move_animator;
Eina_Bool reorder_mode : 1;
Eina_Bool reorder_pan_move : 1;
Eina_Bool auto_scroll_enabled : 1;
+ Eina_Bool pan_resized : 1;
struct
{
Evas_Coord x, y;
} history[SWIPE_MOVES];
int multi_device;
int item_cache_count;
- int item_cache_max;
+ int item_cache_max; /* maximum number of cached items */
int movements;
int walking;
int item_width;
int item_height;
int group_item_width;
int group_item_height;
- int max_items_per_block;
- double longpress_timeout;
+ int max_items_per_block; /* maximum number of items per block */
+ double longpress_timeout; /* longpress timeout. this value comes from _elm_config by default. this can be changed by elm_genlist_longpress_timeout_set() */
};
struct _Item_Block
}
static void
+_translate_hook(Evas_Object *obj)
+{
+ evas_object_smart_callback_call(obj, "language,changed", NULL);
+}
+
+static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
}
static void
+_item_del_hook(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
+{
+ Elm_Genlist_Item *it = event_info;
+ if (!it) return;
+ if (it->wd->last_selected_item == it)
+ it->wd->last_selected_item = NULL;
+}
+
+static void
_item_label_realize(Elm_Genlist_Item *it,
Evas_Object *target,
Eina_List **source)
if ((ow == w) && (oh == h)) return;
if ((sd->wd->height_for_width) && (ow != w))
{
+ /* fix me later */
if (sd->resize_job) ecore_job_del(sd->resize_job);
sd->resize_job = ecore_job_add(_pan_resize_job, sd);
}
+ sd->wd->pan_resized = EINA_TRUE;
+ evas_object_smart_changed(obj);
+ if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
+ sd->wd->calc_job = NULL;
+/* OLD
if (sd->wd->calc_job) ecore_job_del(sd->wd->calc_job);
sd->wd->calc_job = ecore_job_add(_calc_job, sd->wd);
+ */
}
static void
if (!sd) return;
evas_event_freeze(evas_object_evas_get(obj));
+
+ if (sd->wd->pan_resized)
+ {
+ _calc_job(sd->wd);
+ sd->wd->pan_resized = EINA_FALSE;
+ }
+
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
EINA_LIST_FOREACH(sd->wd->group_items, l, git)
elm_widget_can_focus_set(obj, EINA_TRUE);
elm_widget_event_hook_set(obj, _event_hook);
elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
+ elm_widget_translate_hook_set(obj, _translate_hook);
wd->scr = elm_smart_scroller_add(e);
elm_smart_scroller_widget_set(wd->scr, obj);
it->mouse_cursor = NULL;
it->expanded_depth = 0;
elm_widget_item_text_get_hook_set(it, _item_label_hook);
+ elm_widget_item_del_cb_set(it, _item_del_hook);
if (it->parent)
{