Re: [E-devel] [PATCH] elm_genlist : Introduce homogeneous mode and configurable block size

2010-03-05 Thread The Rasterman
On Wed, 27 Jan 2010 12:34:18 +0800 Brian Wang brian.wang.0...@gmail.com said:

 I finally got time to test the latest genlist code.  Sorry for the
 delay.  Here is the test result:
 * Loading (homogeneous mode): very fast
 * Scrolling (homogeneous mode) with block_count=1,=32: sluggish; I
 tested it on the old code, and it was sluggish too...  Damn the CPU...
  I'm probably having too many Evas_Objects in the elm_win...  In a
 less complex app, the scrolling of a 600-item genlist seems quite
 smooth.

ooh thats not going to help either. the more objects u have the more the render
time overhead as it needs to do more. dont keep too many objects around you
don't need. that's my suggestion.

 I have another newbie question:
 When I drag an item around (not flick), the item will move to the
 position of my finger with some delay when the dragging movement is
 rapid.  Is there a way to improve this or it is merely a hardware
 limitation?

well there is simply delay in input and rendering. input events come from the
ts kernel device to x - then to ecore and it calls evas calls to call the event
callbacks - and then a redraw is queued - and then.. well - the screen needs to
re-render, then the next time the screen refreshes - u see the updates. this
does take time. the slower your machine - the longer that time. i've done some
pretty detailed analysis on this - on pretty comparable bits of hardware, efl
is about the same or a little less latency than things like the iphone - yes -
i've stared at detailed video footage comparisons (300fps) and done the checks
counting frames of latency between finger moving and ui reacting - and... efl
is right up there with its commercial competitors that everyone raves about
having amazingly good input response times and low latency, feels good
etc. etc.

all i can say is.. that's as good as it gets your your hardware given what u
are asking it to render (so time to render frame is latency) and your current
input drivers (there may be significant latency in the ts drivers - it is
technically possible).

-- 
- Codito, ergo sum - I code, therefore I am --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCH] elm_genlist : Introduce homogeneous mode and configurable block size

2010-01-26 Thread Brian Wang
On Sun, Jan 24, 2010 at 9:52 AM, Carsten Haitzler ras...@rasterman.com wrote:
 On Sun, 24 Jan 2010 09:43:57 +0800 Brian Wang brian.wang.0...@gmail.com 
 said:

 On Sat, Jan 23, 2010 at 5:08 PM, Carsten Haitzler ras...@rasterman.com
 wrote:
  On Fri, 22 Jan 2010 10:27:09 +0800 Brian Wang brian.wang.0...@gmail.com
  said:
 
  haahahahaha! un-lame now. and in svn - see svn commit log. also added the
  thing i suggested - the time limit on idle calcs - i also had to move the
  calc into the ilder as opposed to being in the job.

 Awesome!  I'll try the patch when I get my hand on my board tomorrow. :-)

I finally got time to test the latest genlist code.  Sorry for the
delay.  Here is the test result:
* Loading (homogeneous mode): very fast
* Scrolling (homogeneous mode) with block_count=1,=32: sluggish; I
tested it on the old code, and it was sluggish too...  Damn the CPU...
 I'm probably having too many Evas_Objects in the elm_win...  In a
less complex app, the scrolling of a 600-item genlist seems quite
smooth.

I have another newbie question:
When I drag an item around (not flick), the item will move to the
position of my finger with some delay when the dragging movement is
rapid.  Is there a way to improve this or it is merely a hardware
limitation?



 It seems you also applied the elm_button autorepeat stuff for
 Elementary.h.in but I didn't see the source get patched.  It's

 aaagh! true! i missed that - saw the prototypes and was reading the genlist
 code - just assuming the code was there behind them! oops!

 probably because my autorepeat patch didn't go through (sigh,

 nup - it didnt. saw what looks like it -w as buyg doing changes to genlist.

 again...).  I have the original autorepeat patch attached (now, I just
 simply give the patch a txt extension...).  Please take a look and
 correct it as you see fit. :-)

 in future - just make your patches .txt - seems your browser/mail client can't
 properly set mime type for .diff/.patch files - sf.net's mailing lists have 
 for
 many years stripped octet/stream stuff (virus protection for all our friendly
 windows users)

 brian

 
  This is lame...  Another try.
 
  On Fri, Jan 22, 2010 at 10:24 AM, Brian Wang brian.wang.0...@gmail.com
  wrote:
   Hello all,
  
   The attached (hopefully, it's attached) is my try to implement the
   homogeneous mode for elm_genlist.  I know it's far from perfect (e.g.
   it still walks through the list to gather the width and height) and it
   might contain bugs.   It's ok with valgrind reports on x86 though.
  
   The patch is also contaminated with my elm_button autorepeat stuff in
   Elementary.h.in...
  
   I know it's far from being perfect, so please take a look and modify
   it to its correctness as it seems to be a nice-to-have feature.
  
   Cheers,
  
  
   brian
  
   --
   brian
   --
  
   Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
   http://cool-idea.com.tw/
  
   iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
  
 
 
 
  --
  brian
  --
 
  Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
  http://cool-idea.com.tw/
 
  iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
 
 
 
  --
  - Codito, ergo sum - I code, therefore I am --
  The Rasterman (Carsten Haitzler)    ras...@rasterman.com
 
 



 --
 brian
 --

 Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
 http://cool-idea.com.tw/

 iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe



 --
 - Codito, ergo sum - I code, therefore I am --
 The Rasterman (Carsten Haitzler)    ras...@rasterman.com





-- 
brian
--

Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/

iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCH] elm_genlist : Introduce homogeneous mode and configurable block size

2010-01-23 Thread The Rasterman
On Fri, 22 Jan 2010 10:27:09 +0800 Brian Wang brian.wang.0...@gmail.com said:

haahahahaha! un-lame now. and in svn - see svn commit log. also added the thing
i suggested - the time limit on idle calcs - i also had to move the calc into
the ilder as opposed to being in the job.

 This is lame...  Another try.
 
 On Fri, Jan 22, 2010 at 10:24 AM, Brian Wang brian.wang.0...@gmail.com
 wrote:
  Hello all,
 
  The attached (hopefully, it's attached) is my try to implement the
  homogeneous mode for elm_genlist.  I know it's far from perfect (e.g.
  it still walks through the list to gather the width and height) and it
  might contain bugs.   It's ok with valgrind reports on x86 though.
 
  The patch is also contaminated with my elm_button autorepeat stuff in
  Elementary.h.in...
 
  I know it's far from being perfect, so please take a look and modify
  it to its correctness as it seems to be a nice-to-have feature.
 
  Cheers,
 
 
  brian
 
  --
  brian
  --
 
  Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
  http://cool-idea.com.tw/
 
  iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
 
 
 
 
 -- 
 brian
 --
 
 Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
 http://cool-idea.com.tw/
 
 iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
 


-- 
- Codito, ergo sum - I code, therefore I am --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCH] elm_genlist : Introduce homogeneous mode and configurable block size

2010-01-23 Thread Brian Wang
On Sat, Jan 23, 2010 at 5:08 PM, Carsten Haitzler ras...@rasterman.com wrote:
 On Fri, 22 Jan 2010 10:27:09 +0800 Brian Wang brian.wang.0...@gmail.com 
 said:

 haahahahaha! un-lame now. and in svn - see svn commit log. also added the 
 thing
 i suggested - the time limit on idle calcs - i also had to move the calc into
 the ilder as opposed to being in the job.

Awesome!  I'll try the patch when I get my hand on my board tomorrow. :-)

It seems you also applied the elm_button autorepeat stuff for
Elementary.h.in but I didn't see the source get patched.  It's
probably because my autorepeat patch didn't go through (sigh,
again...).  I have the original autorepeat patch attached (now, I just
simply give the patch a txt extension...).  Please take a look and
correct it as you see fit. :-)


brian


 This is lame...  Another try.

 On Fri, Jan 22, 2010 at 10:24 AM, Brian Wang brian.wang.0...@gmail.com
 wrote:
  Hello all,
 
  The attached (hopefully, it's attached) is my try to implement the
  homogeneous mode for elm_genlist.  I know it's far from perfect (e.g.
  it still walks through the list to gather the width and height) and it
  might contain bugs.   It's ok with valgrind reports on x86 though.
 
  The patch is also contaminated with my elm_button autorepeat stuff in
  Elementary.h.in...
 
  I know it's far from being perfect, so please take a look and modify
  it to its correctness as it seems to be a nice-to-have feature.
 
  Cheers,
 
 
  brian
 
  --
  brian
  --
 
  Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
  http://cool-idea.com.tw/
 
  iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
 



 --
 brian
 --

 Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
 http://cool-idea.com.tw/

 iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe



 --
 - Codito, ergo sum - I code, therefore I am --
 The Rasterman (Carsten Haitzler)    ras...@rasterman.com





-- 
brian
--

Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/

iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
Index: src/lib/elm_button.c
===
--- src/lib/elm_button.c(revision 45349)
+++ src/lib/elm_button.c(working copy)
@@ -1,3 +1,7 @@
+/*
+ *
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=5n-3f0^-2{2
+ */
 #include Elementary.h
 #include elm_priv.h
 
@@ -14,6 +18,12 @@
 {
Evas_Object *btn, *icon;
const char *label;
+
+   Eina_Bool autorepeat;
+   Eina_Bool repeating;
+   double ar_threshold;
+   double ar_interval;
+   Ecore_Timer *timer;
 };
 
 static void _del_hook(Evas_Object *obj);
@@ -23,6 +33,8 @@
 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void 
*event_info);
 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
 static void _signal_clicked(void *data, Evas_Object *obj, const char 
*emission, const char *source);
+static void _signal_pressed(void *data, Evas_Object *obj, const char 
*emission, const char *source);
+static void _signal_unpressed(void *data, Evas_Object *obj, const char 
*emission, const char *source);
 static void _on_focus_hook(void *data, Evas_Object *obj);
 
 static void
@@ -124,8 +136,63 @@
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
evas_object_smart_callback_call(data, clicked, NULL);
+   _signal_unpressed(data, obj, emission, source); /* safe guard when the 
theme does not emit the 'unpress' signal */
 }
 
+static int
+_autorepeat_send(void *data)
+{
+   Widget_Data *wd = elm_widget_data_get(data);
+   if (!wd) return ECORE_CALLBACK_CANCEL;
+
+   evas_object_smart_callback_call(data, repeated, NULL);
+
+   return ECORE_CALLBACK_RENEW;
+}
+
+static int
+_autorepeat_initial_send(void *data)
+{
+   Widget_Data *wd = elm_widget_data_get(data);
+   if (!wd) return ECORE_CALLBACK_CANCEL;
+
+   _autorepeat_send(data);
+   wd-timer = ecore_timer_add(wd-ar_interval, _autorepeat_send, data);
+   wd-repeating = 1;
+
+   return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_signal_pressed(void *data, Evas_Object *obj, const char *emission, const char 
*source)
+{
+   Widget_Data *wd = elm_widget_data_get(data);
+   if (!wd) return;
+
+   if (wd-autorepeat)
+ {
+   if (wd-ar_threshold = 0.0)
+ _autorepeat_initial_send(data); /* call immediately */
+   else
+ wd-timer = ecore_timer_add(wd-ar_threshold, 
_autorepeat_initial_send, data);
+ }
+}
+
+static void
+_signal_unpressed(void *data, Evas_Object *obj, const char *emission, const 
char *source)
+{
+   Widget_Data *wd = elm_widget_data_get(data);
+   if (!wd) return;
+   evas_object_smart_callback_call(data, unpressed, NULL);
+
+   if (wd-timer)
+ {
+   ecore_timer_del(wd-timer);
+   wd-timer = NULL;
+ }
+   wd-repeating = 0;
+}
+
 /**
  * Add a new button to the parent
  * @param parent The parent object
@@ -156,6 +223,10 

Re: [E-devel] [PATCH] elm_genlist : Introduce homogeneous mode and configurable block size

2010-01-23 Thread The Rasterman
On Sun, 24 Jan 2010 09:43:57 +0800 Brian Wang brian.wang.0...@gmail.com said:

 On Sat, Jan 23, 2010 at 5:08 PM, Carsten Haitzler ras...@rasterman.com
 wrote:
  On Fri, 22 Jan 2010 10:27:09 +0800 Brian Wang brian.wang.0...@gmail.com
  said:
 
  haahahahaha! un-lame now. and in svn - see svn commit log. also added the
  thing i suggested - the time limit on idle calcs - i also had to move the
  calc into the ilder as opposed to being in the job.
 
 Awesome!  I'll try the patch when I get my hand on my board tomorrow. :-)
 
 It seems you also applied the elm_button autorepeat stuff for
 Elementary.h.in but I didn't see the source get patched.  It's

aaagh! true! i missed that - saw the prototypes and was reading the genlist
code - just assuming the code was there behind them! oops!

 probably because my autorepeat patch didn't go through (sigh,

nup - it didnt. saw what looks like it -w as buyg doing changes to genlist.

 again...).  I have the original autorepeat patch attached (now, I just
 simply give the patch a txt extension...).  Please take a look and
 correct it as you see fit. :-)

in future - just make your patches .txt - seems your browser/mail client can't
properly set mime type for .diff/.patch files - sf.net's mailing lists have for
many years stripped octet/stream stuff (virus protection for all our friendly
windows users)

 brian
 
 
  This is lame...  Another try.
 
  On Fri, Jan 22, 2010 at 10:24 AM, Brian Wang brian.wang.0...@gmail.com
  wrote:
   Hello all,
  
   The attached (hopefully, it's attached) is my try to implement the
   homogeneous mode for elm_genlist.  I know it's far from perfect (e.g.
   it still walks through the list to gather the width and height) and it
   might contain bugs.   It's ok with valgrind reports on x86 though.
  
   The patch is also contaminated with my elm_button autorepeat stuff in
   Elementary.h.in...
  
   I know it's far from being perfect, so please take a look and modify
   it to its correctness as it seems to be a nice-to-have feature.
  
   Cheers,
  
  
   brian
  
   --
   brian
   --
  
   Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
   http://cool-idea.com.tw/
  
   iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
  
 
 
 
  --
  brian
  --
 
  Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
  http://cool-idea.com.tw/
 
  iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
 
 
 
  --
  - Codito, ergo sum - I code, therefore I am --
  The Rasterman (Carsten Haitzler)    ras...@rasterman.com
 
 
 
 
 
 -- 
 brian
 --
 
 Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
 http://cool-idea.com.tw/
 
 iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
 


-- 
- Codito, ergo sum - I code, therefore I am --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCH] elm_genlist : Introduce homogeneous mode and configurable block size

2010-01-21 Thread Brian Wang
This is lame...  Another try.

On Fri, Jan 22, 2010 at 10:24 AM, Brian Wang brian.wang.0...@gmail.com wrote:
 Hello all,

 The attached (hopefully, it's attached) is my try to implement the
 homogeneous mode for elm_genlist.  I know it's far from perfect (e.g.
 it still walks through the list to gather the width and height) and it
 might contain bugs.   It's ok with valgrind reports on x86 though.

 The patch is also contaminated with my elm_button autorepeat stuff in
 Elementary.h.in...

 I know it's far from being perfect, so please take a look and modify
 it to its correctness as it seems to be a nice-to-have feature.

 Cheers,


 brian

 --
 brian
 --

 Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
 http://cool-idea.com.tw/

 iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe




-- 
brian
--

Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/

iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
Index: lib/Elementary.h.in
===
--- lib/Elementary.h.in (revision 45349)
+++ lib/Elementary.h.in (working copy)
@@ -374,6 +374,9 @@
EAPI const char  *elm_button_label_get(Evas_Object *obj);
EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon);
EAPI Evas_Object *elm_button_icon_get(Evas_Object *obj);
+   EAPI void elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on);
+   EAPI void elm_button_autorepeat_initital_timeout_set(Evas_Object 
*obj, double t);
+   EAPI void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, 
double t);
EINA_DEPRECATED EAPI void elm_button_style_set(Evas_Object *obj, const char 
*style);
/* available styles:
 * default
@@ -383,6 +386,7 @@
 */
/* smart callbacks called:
 * clicked - the user clicked the button
+* repeated - the user pressed the button without releasing it
 */
 
typedef enum _Elm_Scroller_Policy
@@ -882,6 +886,8 @@
EAPI void  elm_genlist_no_select_mode_set(Evas_Object *obj, 
Eina_Bool no_select);
EAPI void  elm_genlist_compress_mode_set(Evas_Object *obj, 
Eina_Bool compress);
EAPI void  elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool 
h_bounce, Eina_Bool v_bounce);
+   EAPI void  elm_genlist_homogeneous_set(Evas_Object *obj, 
Eina_Bool homogeneous);
+   EAPI void  elm_genlist_block_count_set(Evas_Object *obj, int n);
/* available item styles:
 * default
 * default_style - The text part is a textblock
Index: lib/elm_genlist.c
===
--- lib/elm_genlist.c   (revision 45349)
+++ lib/elm_genlist.c   (working copy)
@@ -1,3 +1,7 @@
+/*
+ *
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=5n-3f0^-2{2
+ */
 #include Elementary.h
 #include elm_priv.h
 
@@ -237,6 +241,7 @@
  * have a specific style that overrides any theme the user or system sets up
  * you can use elm_theme_overlay_add() to add such a file.
  */
+
 typedef struct _Widget_Data Widget_Data;
 typedef struct _Item_Block Item_Block;
 typedef struct _Pan Pan;
@@ -260,6 +265,10 @@
Eina_Bool no_select : 1;
Eina_Bool bring_in : 1;
Eina_Bool compress : 1;
+   Eina_Bool homogeneous : 1;
+   int item_width;
+   int item_height;
+   int max_items_per_block;
 };
 
 struct _Item_Block
@@ -736,71 +745,91 @@
  edje_object_signal_emit(it-base, elm,state,expanded, elm);
  }
 
-   if (it-itc-func.label_get)
+   if (calc  it-wd-homogeneous  it-wd-item_width)
  {
-   const Eina_List *l;
-   const char *key;
+   /* homogenous genlist shortcut */
+   if (!it-mincalcd)
+ {
+it-w = it-minw = it-wd-item_width;
+it-h = it-minh = it-wd-item_height;
+it-mincalcd = EINA_TRUE;
+ }
+ }
+   else
+ {
 
-   it-labels = _stringlist_get(edje_object_data_get(it-base, labels));
-   EINA_LIST_FOREACH(it-labels, l, key)
+   if (it-itc-func.label_get)
  {
-char *s = it-itc-func.label_get(it-data, it-wd-obj, l-data);
+const Eina_List *l;
+const char *key;
 
-if (s)
+it-labels = _stringlist_get(edje_object_data_get(it-base, 
labels));
+EINA_LIST_FOREACH(it-labels, l, key)
   {
- edje_object_part_text_set(it-base, l-data, s);
- free(s);
+ char *s = it-itc-func.label_get(it-data, it-wd-obj, 
l-data);
+
+ if (s)
+   {
+  edje_object_part_text_set(it-base, l-data, s);
+  free(s);
+   }
   }
  }
- }
-   if (it-itc-func.icon_get)
- {
-   const Eina_List *l;
-   const char *key;
+   if (it-itc-func.icon_get)
+ {
+const Eina_List *l;
+const char *key;
 
-