Seungsoo Woo <om101.woo@samsung.com>
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
Jim Kukunas <james.t.kukunas@linux.intel.com>
-EunMi Lee <eunmi15.lee@samsung.com>
* More Evas object event types - see evas_object_event_callback_add():
*/
EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
- EVAS_CALLBACK_TOUCH, /**< Touch Event */
EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
} Evas_Callback_Type; /**< The types of events triggering a callback */
} Evas_Event_Flags; /**< Flags for Events */
/**
- * State of Evas_Coord_Touch_Point
- */
-typedef enum _Evas_Touch_Point_State
-{
- EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
- EVAS_TOUCH_POINT_UP, /**< Touch point is released */
- EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
- EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
- EVAS_TOUCH_POINT_CANCEL /**< Touch point is calcelled */
-} Evas_Touch_Point_State;
-
-/**
- * Types for Evas_Touch_Event
- */
-typedef enum _Evas_Event_Touch_Type
-{
- EVAS_EVENT_TOUCH_BEGIN, /**< Begin touch event with pressed new touch point */
- EVAS_EVENT_TOUCH_END, /**< End touch event with released touch point */
- EVAS_EVENT_TOUCH_MOVE, /**< Any touch point in the touch_points list is moved */
- EVAS_EVENT_TOUCH_CANCEL /**< Touch event is cancelled */
-} Evas_Event_Touch_Type;
-
-/**
* Flags for Font Hinting
* @ingroup Evas_Font_Group
*/
typedef struct _Evas_Coord_Point Evas_Coord_Point; /**< Evas_Coord point */
typedef struct _Evas_Coord_Precision_Point Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
-typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point; /**< Evas_Coord point with touch type and id */
typedef struct _Evas_Position Evas_Position; /**< associates given point in Canvas and Output */
typedef struct _Evas_Precision_Position Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
double xsub, ysub;
};
-struct _Evas_Coord_Touch_Point
-{
- Evas_Coord x, y;
- int id; /**< id in order to distinguish each point */
- Evas_Touch_Point_State state;
-};
-
struct _Evas_Position
{
Evas_Point output;
typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
-typedef struct _Evas_Event_Touch Evas_Event_Touch; /**< Event structure for #EVAS_CALLBACK_TOUCH event callbacks */
typedef enum _Evas_Load_Error
{
Evas_Device *dev;
};
-struct _Evas_Event_Touch /** Touch event */
-{
- Eina_List *points; /**< Evas_Coord_Touch_Point list */
- Evas_Modifier *modifiers;
- unsigned int timestamp;
- Evas_Event_Touch_Type type; /**< Type for Evas_Event_Touch */
-};
-
/**
* How the mouse pointer should be handled by Evas.
*
evas_stack.c \
evas_async_events.c \
evas_stats.c \
-evas_touch_events.c \
evas_map.c \
evas_gl.c
if (!obj->no_propagate)
{
if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
- ((type <= EVAS_CALLBACK_KEY_UP) || (type == EVAS_CALLBACK_TOUCH)))
+ (type <= EVAS_CALLBACK_KEY_UP))
evas_object_event_callback_call(obj->smart.parent, type, event_info);
}
}
e->last_mouse_down_counter++;
_evas_post_event_callback_call(e);
_evas_unwalk(e);
-
- /* process mouse down for touch */
- _evas_event_touch_down(e, e->pointer.x, e->pointer.y, 0, timestamp);
}
static int
}
*/
_evas_unwalk(e);
-
- /* process mouse up for touch */
- _evas_event_touch_up(e, e->pointer.x, e->pointer.y, 0, timestamp);
}
EAPI void
_evas_post_event_callback_call(e);
}
_evas_unwalk(e);
-
- /* process mouse move for touch */
- _evas_event_touch_move(e, e->pointer.x, e->pointer.y, 0, timestamp);
}
EAPI void
if (copy) eina_list_free(copy);
_evas_post_event_callback_call(e);
_evas_unwalk(e);
-
- /* process multi down for touch */
- _evas_event_touch_down(e, x, y, d, timestamp);
}
EAPI void
if ((e->pointer.mouse_grabbed == 0) && !_post_up_handle(e, timestamp, data))
_evas_post_event_callback_call(e);
_evas_unwalk(e);
-
- /* process multi up for touch */
- _evas_event_touch_up(e, x, y, d, timestamp);
}
EAPI void
_evas_post_event_callback_call(e);
}
_evas_unwalk(e);
-
- /* process multi move for touch */
- _evas_event_touch_move(e, x, y, d, timestamp);
}
EAPI void
evas_free(Evas *e)
{
Eina_Rectangle *r;
- Evas_Coord_Touch_Point *touch_point;
Evas_Layer *lay;
int i;
int del;
eina_array_flush(&e->calculate_objects);
eina_array_flush(&e->clip_changes);
- EINA_LIST_FREE(e->touch_points, touch_point)
- free(touch_point);
-
e->magic = 0;
free(e);
}
+++ /dev/null
-#include "evas_common.h"
-#include "evas_private.h"
-
-static void
-_evas_touch_point_append(Evas *e, int id, int x, int y)
-{
- Evas_Coord_Touch_Point *point;
-
- /* create new Evas_Coord_Touch_Point */
- point = (Evas_Coord_Touch_Point *)calloc(1, sizeof(Evas_Coord_Touch_Point));
- point->x = x;
- point->y = y;
- point->id = id;
- point->state = EVAS_TOUCH_POINT_DOWN;
-
- _evas_walk(e);
- e->touch_points = eina_list_append(e->touch_points, point);
- _evas_unwalk(e);
-}
-
-static Evas_Coord_Touch_Point *
-_evas_touch_point_update(Evas *e, int id, int x, int y, Evas_Touch_Point_State state)
-{
- Eina_List *l;
- Evas_Coord_Touch_Point *point = NULL;
-
- _evas_walk(e);
- EINA_LIST_FOREACH(e->touch_points, l, point)
- {
- if (point->id == id)
- {
- point->x = x;
- point->y = y;
- point->state = state;
- break;
- }
- }
- _evas_unwalk(e);
-
- return point;
-}
-
-static void
-_evas_event_feed_touch(Evas *e, unsigned int timestamp, Evas_Event_Touch_Type type)
-{
- Evas_Event_Touch ev;
- Eina_List *l, *copy;
- Evas_Coord_Touch_Point *point;
- Evas_Object *obj;
- const void *data;
-
- _evas_walk(e);
- /* set Evas_Event_Touch's members */
- ev.points = NULL;
- EINA_LIST_FOREACH(e->touch_points, l, point)
- ev.points = eina_list_append(ev.points, point);
- ev.modifiers = &(e->modifiers);
- ev.timestamp = timestamp;
- ev.type = type;
-
- /* make copy of object list */
- copy = NULL;
- EINA_LIST_FOREACH(e->pointer.object.in, l, data)
- copy = eina_list_append(copy, data);
-
- /* call all EVAS_CALLBACK_TOUCH's callbacks */
- EINA_LIST_FOREACH(copy, l, obj)
- {
- if (!obj->delete_me && (e->events_frozen <= 0))
- evas_object_event_callback_call(obj, EVAS_CALLBACK_TOUCH, &ev);
- if (e->delete_me) break;
- }
- if (copy) eina_list_free(copy);
- if (ev.points) eina_list_free(ev.points);
-
- /* if finger is released or pressed, reset all touch point's state */
- if (type != EVAS_EVENT_TOUCH_MOVE)
- {
- EINA_LIST_FOREACH(e->touch_points, l, point)
- point->state = EVAS_TOUCH_POINT_STILL;
- }
- _evas_unwalk(e);
-}
-
-void
-_evas_event_touch_down(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp)
-{
- _evas_touch_point_append(e, id, x, y);
- _evas_event_feed_touch(e, timestamp, EVAS_EVENT_TOUCH_BEGIN);
-}
-
-void
-_evas_event_touch_up(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp)
-{
- Evas_Coord_Touch_Point *point;
-
- /* update touch point in the touch_points list */
- point = _evas_touch_point_update(e, id, x, y, EVAS_TOUCH_POINT_UP);
- if (!point) return;
-
- _evas_walk(e);
- _evas_event_feed_touch(e, timestamp, EVAS_EVENT_TOUCH_END);
- e->touch_points = eina_list_remove(e->touch_points, point);
- _evas_unwalk(e);
-}
-
-void
-_evas_event_touch_move(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp)
-{
- Eina_List *l;
- Evas_Coord_Touch_Point *point;
-
- _evas_walk(e);
- EINA_LIST_FOREACH(e->touch_points, l, point)
- {
- if (point->id == id)
- {
- /* update touch point */
- point->x = x;
- point->y = y;
- point->state = EVAS_TOUCH_POINT_MOVE;
-
- _evas_event_feed_touch(e, timestamp, EVAS_EVENT_TOUCH_MOVE);
- }
- }
- _evas_unwalk(e);
-}
unsigned char invalidate : 1;
unsigned char cleanup : 1;
unsigned char focus : 1;
-
- Eina_List *touch_points;
};
struct _Evas_Layer
Eina_List *evas_module_engine_list(void);
-/* for touch event */
-void _evas_event_touch_down(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp);
-void _evas_event_touch_up(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp);
-void _evas_event_touch_move(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp);
-
/****************************************************************************/
/*****************************************/
/********************/