Hello,
I made a new patch to get information of current touched point instead of Touch 
Event.

I added touch_points (Eina_List) to the Evas structure and it maintains touched 
points on the evas.
New touched point is added to the touch_points when we get Mouse_Down and 
Multi_Down,
touched point is updated when we get Mouse_Move and Mult_Move,
and touched point is removed when we get Mouse_Up and Multi_Up.

The each touch point has coordinate, id and state information as follows:
id - identifier. 0 for Mouse Event and device id for Multi Event.
coordinate - (x, y) coordinate of point.
state - state of point. type is Evas_Touch_Point_State enum. 
(EVAS_TOUCH_POINT_DOWN, EVAS_TOUCH_POINT_UP, EVAS_TOUCH_POINT_MOVE, 
EVAS_TOUCH_POINT_STILL, EVAS_TOUCH_POINT_CANCEL)

There are 4 new APIs to get touch point's information as follows:
unsigned int evas_touch_point_list_count(Evas *e);
void evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, 
Evas_Coord *y);
int evas_touch_point_list_nth_id_get(Evas *e, unsigned int n);
Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *e, unsigned 
int n);

I added APIs to get each information instead of exposing whole structure to 
make it easy to expand in the future as you mentioned in the below e-mail :)

Best Regards,
Eunmi Lee
------- Original Message -------
Sender : Carsten Haitzler<ras...@rasterman.com>
Date : 2011-10-17 16:59 (GMT+09:00)
Title : Re: [E-devel] [Patch] Evas touch event patch.

On Mon, 17 Oct 2011 07:31:20 +0000 (GMT) EunMi Lee 
said:

> I think providing api is good solution to solve event_flags problem.
> I already sent patch to solve that problem, but you can ignore that because
> providing api is better than that patch :) Additionally, the state of each
> finger is also needed as I added to the code as Evas_Touch_Point_State. So,
> how about provide only one API as follows? Eina_List
> *evas_event_touch_points_get(Evas *e); returing Eina_List is list of
> Evas_Coord_Touch_Point that has all information of all fingers: coordinate,
> id and state. If you like, I can make new patch for that :)

sure. well that was kind of the point - evas tracks state of each press point
(and some device id for each) and you can query each event and find out what
the current state is - it was just an example api. you could expose a whole
struct you can query but that makes it a bit harder to expand in the future.
that's all. the list works too - it just means its the struct method. this can
work as well. :)

> ------- Original Message -------
> Sender : Carsten Haitzler
> Date : 2011-10-17 13:37 (GMT+09:00)
> Title : Re: [E-devel] [Patch] Evas touch event patch.
> 
> On Thu, 06 Oct 2011 10:20:57 +0200 Tom Hacohen
> said:
> 
> > On 06/10/11 10:15, EunMi Lee wrote:
> > > Dear Tom,
> > >
> > >> What do you think about removing this from upstream and moving it to your
> > >> code?
> > > =>  My answer is I really need touch event in the evas.
> > >      Yes, it just unifies mouse/multi event and it was in my code before.
> > >      However, I think it is better to move that code to the evas, because
> > > it is useful to process event on the touch device(which supports multi
> > > fingers), and other application developers can use that if it is supported
> > > by evas. Other plaform (gtk, iphone, android) already have their own touch
> > > event and they don't have to unify mouse events. So, I want that evas
> > > supports touch event like other platform, and I made a patch for that.
> > >
> > 
> > Ok, I get your point. If that's the case, then we need to fix it as you 
> > suggested in your previous email, sounds like the best way to do it.
> 
> actually... the more i think about this... the more that maybe we shouldn't
> have the touch events at all. they do duplicate events. they do make it very
> hard to use the current flags infra. the whole point of them is so you dont
> have to do your own tracking of multiple presses. maybe we should just have
> evas track all current pressed points (mouse + multi) and when you get a
> mouse or multi move, a mouse or multi down or a mouse or multi up, you can
> query the current "tracking state". just add a few calls to query like:
> 
> // return number of pressed points (mouse+fingers)
> EAPI int
> evas_event_pressed_count_get(Evas *e);
> 
> // return the device id of pressed point 0, 1, 2etc. up to n - 1 where n is
> the // pressed count
> EAPI int
> evas_event_pressed_device_get(Evas *e, int press_num);
> 
> // get the x,y location for a specific press point
> EAPI void
> evas_event_pressed_canvas_coord_get(Evas *e, int press_num, Evas_Coord *x,
> Evas_Coord *y);
> 
> // etc.
> 
> so... this becomes very easy. you hook up the SAMe callback to both mouse and
> multi down, the same cb to mouse and multi up, and same cb to mouse and multi
> move. in all cb's you just get the current pressed state of all press points
> as you desire - evas is tracking for you. this achieve what eunmi wants -
> simpler tracking code, but just uses the current events directly to do so -
> we just have 2 kinds of down/move/up events (mouse and multi) where mouse is
> the core pointer or first touch and multi is all the extras (that as
> anon-touch app you don't need to look at).
> 
> how about this? it simple removes the callbacks.events and provides the
> ability to track via querying in api calls not in event structs. :)
> 
> -- 
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> The Rasterman (Carsten Haitzler)    ras...@rasterman.com

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

Attachment: evas_touch_api.patch
Description: Binary data

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to