Thank you for your comments Raster.
Here is a new patch excluding SWIPE_TIMEOUT.
Please apply this first.
I'll make separate patch for SWIPE_TIMEOUT then.
Thank you.
Daniel Juyung Seo.
-----Original Message-----
From: Carsten Haitzler (The Rasterman) [mailto:[email protected]]
Sent: Saturday, December 04, 2010 12:23 PM
To: Daniel Juyung Seo
Cc: [email protected]
Subject: Re: [E-devel] [Patch] elm_genlist and elm_list patch.
On Wed, 1 Dec 2010 03:35:09 +0900 Daniel Juyung Seo <[email protected]>
said:
> Dear all, I have a patch for some issues.
> Anybody can review this patch and apply this to upstream?
>
> [Genlist]
> 1. fixed elm_genlist_item_display_only_set() API bug.
> "elm,state,selected" signal should not be emitted when display_only is
set.
> display_only was not set properly when it->block did not exist.
good. cool.
> 2. Add a macro for SWIPE_TIMEOUT
> Instead of using constant "0.4" for swipe timer in the middle of
> code, I added a macro SWIPE_TIMEOUT.
issue here. could you actually make this an elm config value? so its in
system
config, it's loaded at start and can be configured by elm's config tool?
(well
not now, but in the future). resubmit patch then? don't forget config
version
and to upgrade it and handle the upgrade - examples in the code how to do
that
already :)
> 3. Indentation and space fix.
> I fixed indentations for item cache and some other lines.
> I removed some unnecessary spaces.
ok. so just the above :)
> [List]
> 1. Add macros for SWIPE_TIMEOUT and LONGPRESS_TIMEOUT
> Instead of using constants in the middle of code, I added macros.
>
> Thanks.
> Daniel Juyung Seo.
--
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler) [email protected]
----------------------------------------------------------------------------
--
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Index: elm_genlist.c
===================================================================
--- elm_genlist.c (revision 55254)
+++ elm_genlist.c (working copy)
@@ -776,7 +776,7 @@ static void
_item_hilight(Elm_Genlist_Item *it)
{
const char *selectraise;
- if ((it->wd->no_select) || (it->delete_me) || (it->hilighted)) return;
+ if ((it->wd->no_select) || (it->delete_me) || (it->hilighted) ||
(it->display_only)) return;
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
selectraise = edje_object_data_get(it->base.view, "selectraise");
if ((selectraise) && (!strcmp(selectraise, "on")))
@@ -981,7 +981,7 @@ _mouse_move(void *data, Evas *evas __UNUSED__, Eva
return;
}
if (!it->display_only)
- elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+ elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
x = ev->cur.canvas.x - x;
y = ev->cur.canvas.y - y;
@@ -1229,123 +1229,122 @@ _signal_contract(void *data, Evas_Object *obj __UN
evas_object_smart_callback_call(it->base.widget, "contract,request", it);
}
-
static void
_item_cache_clean(Widget_Data *wd)
{
- while ((wd->item_cache) && (wd->item_cache_count > wd->item_cache_max))
- {
- Item_Cache *itc;
-
- itc = EINA_INLIST_CONTAINER_GET(wd->item_cache->last, Item_Cache);
- wd->item_cache = eina_inlist_remove(wd->item_cache,
- wd->item_cache->last);
- wd->item_cache_count--;
- if (itc->spacer) evas_object_del(itc->spacer);
- if (itc->base_view) evas_object_del(itc->base_view);
- if (itc->item_style) eina_stringshare_del(itc->item_style);
- free(itc);
- }
+ while ((wd->item_cache) && (wd->item_cache_count > wd->item_cache_max))
+ {
+ Item_Cache *itc;
+
+ itc = EINA_INLIST_CONTAINER_GET(wd->item_cache->last, Item_Cache);
+ wd->item_cache = eina_inlist_remove(wd->item_cache,
+ wd->item_cache->last);
+ wd->item_cache_count--;
+ if (itc->spacer) evas_object_del(itc->spacer);
+ if (itc->base_view) evas_object_del(itc->base_view);
+ if (itc->item_style) eina_stringshare_del(itc->item_style);
+ free(itc);
+ }
}
static void
_item_cache_zero(Widget_Data *wd)
{
- int pmax = wd->item_cache_max;
- wd->item_cache_max = 0;
- _item_cache_clean(wd);
- wd->item_cache_max = pmax;
+ int pmax = wd->item_cache_max;
+ wd->item_cache_max = 0;
+ _item_cache_clean(wd);
+ wd->item_cache_max = pmax;
}
static void
_item_cache_add(Elm_Genlist_Item *it)
{
- Item_Cache *itc;
+ Item_Cache *itc;
- if (it->wd->item_cache_max <= 0)
- {
- evas_object_del(it->base.view);
- it->base.view = NULL;
- evas_object_del(it->spacer);
- it->spacer = NULL;
- return;
- }
-
- it->wd->item_cache_count++;
- itc = calloc(1, sizeof(Item_Cache));
- it->wd->item_cache = eina_inlist_prepend(it->wd->item_cache,
EINA_INLIST_GET(itc));
- itc->spacer = it->spacer;
- it->spacer = NULL;
- itc->base_view = it->base.view;
- it->base.view = NULL;
- evas_object_hide(itc->base_view);
- evas_object_move(itc->base_view, -9999, -9999);
- itc->item_style = eina_stringshare_add(it->itc->item_style);
- if (it->flags & ELM_GENLIST_ITEM_SUBITEMS) itc->tree = 1;
- itc->compress = (it->wd->compress);
- itc->odd = (it->order_num_in & 0x1);
- itc->selected = it->selected;
- itc->disabled = it->disabled;
- itc->expanded = it->expanded;
- if (it->long_timer)
- {
- ecore_timer_del(it->long_timer);
- it->long_timer = NULL;
- }
- if (it->swipe_timer)
- {
- ecore_timer_del(it->swipe_timer);
- it->swipe_timer = NULL;
- }
- // FIXME: other callbacks?
- edje_object_signal_callback_del_full(itc->base_view,
"elm,action,expand,toggle",
- "elm", _signal_expand_toggle, it);
- edje_object_signal_callback_del_full(itc->base_view, "elm,action,expand",
"elm",
- _signal_expand, it);
- edje_object_signal_callback_del_full(itc->base_view, "elm,action,contract",
- "elm", _signal_contract, it);
- evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MOUSE_DOWN,
- _mouse_down, it);
- evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MOUSE_UP,
- _mouse_up, it);
- evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MOUSE_MOVE,
- _mouse_move, it);
- _item_cache_clean(it->wd);
+ if (it->wd->item_cache_max <= 0)
+ {
+ evas_object_del(it->base.view);
+ it->base.view = NULL;
+ evas_object_del(it->spacer);
+ it->spacer = NULL;
+ return;
+ }
+
+ it->wd->item_cache_count++;
+ itc = calloc(1, sizeof(Item_Cache));
+ it->wd->item_cache = eina_inlist_prepend(it->wd->item_cache,
EINA_INLIST_GET(itc));
+ itc->spacer = it->spacer;
+ it->spacer = NULL;
+ itc->base_view = it->base.view;
+ it->base.view = NULL;
+ evas_object_hide(itc->base_view);
+ evas_object_move(itc->base_view, -9999, -9999);
+ itc->item_style = eina_stringshare_add(it->itc->item_style);
+ if (it->flags & ELM_GENLIST_ITEM_SUBITEMS) itc->tree = 1;
+ itc->compress = (it->wd->compress);
+ itc->odd = (it->order_num_in & 0x1);
+ itc->selected = it->selected;
+ itc->disabled = it->disabled;
+ itc->expanded = it->expanded;
+ if (it->long_timer)
+ {
+ ecore_timer_del(it->long_timer);
+ it->long_timer = NULL;
+ }
+ if (it->swipe_timer)
+ {
+ ecore_timer_del(it->swipe_timer);
+ it->swipe_timer = NULL;
+ }
+ // FIXME: other callbacks?
+ edje_object_signal_callback_del_full(itc->base_view,
"elm,action,expand,toggle",
+ "elm", _signal_expand_toggle, it);
+ edje_object_signal_callback_del_full(itc->base_view, "elm,action,expand",
"elm",
+ _signal_expand, it);
+ edje_object_signal_callback_del_full(itc->base_view, "elm,action,contract",
+ "elm", _signal_contract, it);
+ evas_object_event_callback_del_full(itc->base_view,
EVAS_CALLBACK_MOUSE_DOWN,
+ _mouse_down, it);
+ evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MOUSE_UP,
+ _mouse_up, it);
+ evas_object_event_callback_del_full(itc->base_view,
EVAS_CALLBACK_MOUSE_MOVE,
+ _mouse_move, it);
+ _item_cache_clean(it->wd);
}
static Item_Cache *
_item_cache_find(Elm_Genlist_Item *it)
{
- Item_Cache *itc;
- Eina_Bool tree = 0, odd;
-
- if (it->flags & ELM_GENLIST_ITEM_SUBITEMS) tree = 1;
- odd = (it->order_num_in & 0x1);
- EINA_INLIST_FOREACH(it->wd->item_cache, itc)
- {
- if ((itc->selected) || (itc->disabled) || (itc->expanded))
- continue;
- if ((itc->tree == tree) &&
- (itc->odd == odd) &&
- (itc->compress == it->wd->compress) &&
- (!strcmp(it->itc->item_style, itc->item_style)))
- {
- it->wd->item_cache = eina_inlist_remove(it->wd->item_cache,
- EINA_INLIST_GET(itc));
- it->wd->item_cache_count--;
- return itc;
- }
- }
- return NULL;
+ Item_Cache *itc;
+ Eina_Bool tree = 0, odd;
+
+ if (it->flags & ELM_GENLIST_ITEM_SUBITEMS) tree = 1;
+ odd = (it->order_num_in & 0x1);
+ EINA_INLIST_FOREACH(it->wd->item_cache, itc)
+ {
+ if ((itc->selected) || (itc->disabled) || (itc->expanded))
+ continue;
+ if ((itc->tree == tree) &&
+ (itc->odd == odd) &&
+ (itc->compress == it->wd->compress) &&
+ (!strcmp(it->itc->item_style, itc->item_style)))
+ {
+ it->wd->item_cache = eina_inlist_remove(it->wd->item_cache,
+ EINA_INLIST_GET(itc));
+ it->wd->item_cache_count--;
+ return itc;
+ }
+ }
+ return NULL;
}
static void
_item_cache_free(Item_Cache *itc)
{
- if (itc->spacer) evas_object_del(itc->spacer);
- if (itc->base_view) evas_object_del(itc->base_view);
- if (itc->item_style) eina_stringshare_del(itc->item_style);
- free(itc);
+ if (itc->spacer) evas_object_del(itc->spacer);
+ if (itc->base_view) evas_object_del(itc->base_view);
+ if (itc->item_style) eina_stringshare_del(itc->item_style);
+ free(itc);
}
static void
@@ -1357,7 +1356,7 @@ _item_realize(Elm_Genlist_Item *it, int in, int ca
char buf[1024];
int depth, tsize = 20;
Item_Cache *itc;
-
+
if ((it->realized) || (it->delete_me)) return;
it->order_num_in = in;
@@ -3281,13 +3280,12 @@ EAPI void
elm_genlist_item_display_only_set(Elm_Genlist_Item *it, Eina_Bool display_only)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
- if (!it->block) return;
if (it->display_only == display_only) return;
if (it->delete_me) return;
it->display_only = display_only;
it->mincalcd = EINA_FALSE;
it->updateme = EINA_TRUE;
- it->block->updateme = EINA_TRUE;
+ if (it->block) it->block->updateme = EINA_TRUE;
if (it->wd->update_job) ecore_job_del(it->wd->update_job);
it->wd->update_job = ecore_job_add(_update_job, it->wd);
}
Index: elm_list.c
===================================================================
--- elm_list.c (revision 55254)
+++ elm_list.c (working copy)
@@ -2,6 +2,7 @@
#include "elm_priv.h"
#define SWIPE_MOVES 12
+#define LONGPRESS_TIMEOUT 1.0
/**
* @defgroup List List
@@ -842,7 +843,7 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Eva
_item_hilight(it);
wd->longpressed = EINA_FALSE;
if (it->long_timer) ecore_timer_del(it->long_timer);
- it->long_timer = ecore_timer_add(1.0, _long_press, it);
+ it->long_timer = ecore_timer_add(LONGPRESS_TIMEOUT, _long_press, it);
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
it->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it);
/* Always call the callbacks last - the user may delete our context! */
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel