}
static void
-_gl_filter_finished_cb(void *data EINA_UNUSED,
+_gl_filter_finished_cb(void *data,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- printf("Filter finished\n");
+ printf("Filter finished, filtered items count is %d\n", elm_genlist_filtered_items_count((Evas_Object *)data));
}
void
evas_object_smart_callback_add(gl, "activated", _gl_focus_item_cb, "activated");
evas_object_smart_callback_add(gl, "highlighted", _gl_focus_item_cb, "highlighted");
evas_object_smart_callback_add(gl, "unhighlighted", _gl_focus_item_cb, "unhighlighted");
- evas_object_smart_callback_add(gl, "filter,done", _gl_filter_finished_cb, NULL);
+ evas_object_smart_callback_add(gl, "filter,done", _gl_filter_finished_cb, gl);
evas_object_event_callback_add(gl, EVAS_CALLBACK_KEY_DOWN, _gl_focus_key_down_cb, NULL);
itc = elm_genlist_item_class_new();
return &iter->iterator;
}
+EOLIAN static unsigned int
+_elm_genlist_filtered_items_count(const Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
+{
+ return sd->filtered_count;
+}
+
EOLIAN static void
_elm_genlist_longpress_timeout_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, double timeout)
{
]]
return: free(own(iterator<Elm_Gen_Item *> *), eina_iterator_free); [[Iterator on genlist]]
}
+ filtered_items_count @const {
+ [[Return how many items have passed the filter currently.
+
+ This behaviour is O(1) and may or may not return the
+ filtered count for complete genlist based on the timing
+ of the call. To get complete count, call after "filter,done"
+ callback
+ ]]
+ return: uint;
+ }
items_count @const {
[[Return how many items are currently in a list.