2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
#include "evas_private.h"
|
2009-05-01 00:11:07 -07:00
|
|
|
#include "evas_cs.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2010-12-13 21:41:32 -08:00
|
|
|
#ifdef LKDEBUG
|
|
|
|
EAPI Eina_Bool lockdebug = EINA_FALSE;
|
|
|
|
EAPI int lockmax = 0;
|
|
|
|
#endif
|
|
|
|
|
2009-10-07 23:25:09 -07:00
|
|
|
static int _evas_init_count = 0;
|
2009-09-21 09:08:51 -07:00
|
|
|
int _evas_log_dom_global = -1;
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2004-07-07 12:24:49 -07:00
|
|
|
evas_init(void)
|
|
|
|
{
|
2009-10-07 23:25:09 -07:00
|
|
|
if (++_evas_init_count != 1)
|
|
|
|
return _evas_init_count;
|
|
|
|
|
2010-12-13 21:41:32 -08:00
|
|
|
#ifdef LKDEBUG
|
|
|
|
if (getenv("EVAS_LOCK_DEBUG"))
|
|
|
|
{
|
|
|
|
lockdebug = EINA_TRUE;
|
|
|
|
lockmax = atoi(getenv("EVAS_LOCK_DEBUG"));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-01-29 16:09:29 -08:00
|
|
|
#ifdef HAVE_EVIL
|
|
|
|
if (!evil_init())
|
2009-10-08 14:17:21 -07:00
|
|
|
return --_evas_init_count;
|
2010-01-29 16:09:29 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
if (!eina_init())
|
|
|
|
goto shutdown_evil;
|
2009-10-07 23:25:09 -07:00
|
|
|
|
2010-10-07 16:46:42 -07:00
|
|
|
_evas_log_dom_global = eina_log_domain_register
|
|
|
|
("evas_main", EVAS_DEFAULT_LOG_COLOR);
|
2009-10-07 23:25:09 -07:00
|
|
|
if (_evas_log_dom_global < 0)
|
2008-09-16 07:52:57 -07:00
|
|
|
{
|
2010-10-07 16:46:42 -07:00
|
|
|
EINA_LOG_ERR("Can not create a module log domain.");
|
|
|
|
goto shutdown_eina;
|
2009-10-07 23:25:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
evas_module_init();
|
2009-09-03 22:41:20 -07:00
|
|
|
#ifdef BUILD_ASYNC_EVENTS
|
2009-10-07 23:25:09 -07:00
|
|
|
if (!evas_async_events_init())
|
|
|
|
goto shutdown_module;
|
2009-09-03 22:41:20 -07:00
|
|
|
#endif
|
2009-05-01 00:11:07 -07:00
|
|
|
#ifdef EVAS_CSERVE
|
2009-10-07 23:25:09 -07:00
|
|
|
if (getenv("EVAS_CSERVE")) evas_cserve_init();
|
2009-09-03 22:13:19 -07:00
|
|
|
#endif
|
2009-12-18 03:03:31 -08:00
|
|
|
#ifdef BUILD_ASYNC_PRELOAD
|
|
|
|
_evas_preload_thread_init();
|
|
|
|
#endif
|
2010-05-21 00:10:45 -07:00
|
|
|
#ifdef EVAS_FRAME_QUEUING
|
|
|
|
evas_common_frameq_init();
|
|
|
|
#endif
|
2009-10-07 23:25:09 -07:00
|
|
|
|
|
|
|
return _evas_init_count;
|
2009-09-03 22:41:20 -07:00
|
|
|
|
|
|
|
#ifdef BUILD_ASYNC_EVENTS
|
|
|
|
shutdown_module:
|
|
|
|
evas_module_shutdown();
|
2009-09-21 09:08:51 -07:00
|
|
|
eina_log_domain_unregister(_evas_log_dom_global);
|
2009-10-07 23:25:09 -07:00
|
|
|
#endif
|
|
|
|
shutdown_eina:
|
2009-09-03 22:41:20 -07:00
|
|
|
eina_shutdown();
|
2010-01-29 16:09:29 -08:00
|
|
|
shutdown_evil:
|
|
|
|
#ifdef HAVE_EVIL
|
|
|
|
evil_shutdown();
|
|
|
|
#endif
|
2009-09-03 22:41:20 -07:00
|
|
|
|
2009-10-08 14:17:21 -07:00
|
|
|
return --_evas_init_count;
|
2004-07-07 12:24:49 -07:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2004-01-12 18:24:03 -08:00
|
|
|
evas_shutdown(void)
|
|
|
|
{
|
2009-10-07 23:25:09 -07:00
|
|
|
if (--_evas_init_count != 0)
|
|
|
|
return _evas_init_count;
|
|
|
|
|
2010-05-21 00:10:45 -07:00
|
|
|
#ifdef EVAS_FRAME_QUEUING
|
|
|
|
if (evas_common_frameq_enabled())
|
|
|
|
{
|
|
|
|
evas_common_frameq_finish();
|
|
|
|
evas_common_frameq_destroy();
|
|
|
|
}
|
|
|
|
#endif
|
2009-12-18 03:03:31 -08:00
|
|
|
#ifdef BUILD_ASYNC_EVENTS
|
|
|
|
_evas_preload_thread_shutdown();
|
|
|
|
#endif
|
2009-05-01 00:11:07 -07:00
|
|
|
#ifdef EVAS_CSERVE
|
2009-10-07 23:25:09 -07:00
|
|
|
if (getenv("EVAS_CSERVE")) evas_cserve_shutdown();
|
2009-09-03 22:13:19 -07:00
|
|
|
#endif
|
2009-09-03 22:41:20 -07:00
|
|
|
#ifdef BUILD_ASYNC_EVENTS
|
2009-10-07 23:25:09 -07:00
|
|
|
evas_async_events_shutdown();
|
2009-09-03 22:41:20 -07:00
|
|
|
#endif
|
2009-10-07 23:25:09 -07:00
|
|
|
evas_font_dir_cache_free();
|
|
|
|
evas_common_shutdown();
|
|
|
|
evas_module_shutdown();
|
|
|
|
eina_log_domain_unregister(_evas_log_dom_global);
|
|
|
|
eina_shutdown();
|
2010-01-29 16:09:29 -08:00
|
|
|
#ifdef HAVE_EVIL
|
|
|
|
evil_shutdown();
|
|
|
|
#endif
|
2009-10-07 23:25:09 -07:00
|
|
|
|
|
|
|
return _evas_init_count;
|
2004-01-12 18:24:03 -08:00
|
|
|
}
|
|
|
|
|
2004-07-31 19:20:40 -07:00
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas *
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_new(void)
|
|
|
|
{
|
|
|
|
Evas *e;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e = calloc(1, sizeof(Evas));
|
|
|
|
if (!e) return NULL;
|
|
|
|
|
|
|
|
e->magic = MAGIC_EVAS;
|
|
|
|
e->output.render_method = RENDER_METHOD_INVALID;
|
2004-05-05 04:00:19 -07:00
|
|
|
e->viewport.w = 1;
|
|
|
|
e->viewport.h = 1;
|
2006-02-27 20:07:49 -08:00
|
|
|
e->hinting = EVAS_FONT_HINTING_BYTECODE;
|
2008-12-09 09:56:31 -08:00
|
|
|
e->name_hash = eina_hash_string_superfast_new(NULL);
|
2011-10-12 19:22:29 -07:00
|
|
|
eina_clist_init(&e->calc_list);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2010-08-19 05:02:28 -07:00
|
|
|
#define EVAS_ARRAY_SET(E, Array) \
|
2011-08-26 05:26:45 -07:00
|
|
|
eina_array_step_set(&E->Array, sizeof (E->Array), 4096);
|
2010-08-19 05:02:28 -07:00
|
|
|
|
|
|
|
EVAS_ARRAY_SET(e, delete_objects);
|
|
|
|
EVAS_ARRAY_SET(e, active_objects);
|
|
|
|
EVAS_ARRAY_SET(e, restack_objects);
|
|
|
|
EVAS_ARRAY_SET(e, render_objects);
|
|
|
|
EVAS_ARRAY_SET(e, pending_objects);
|
|
|
|
EVAS_ARRAY_SET(e, obscuring_objects);
|
|
|
|
EVAS_ARRAY_SET(e, temporary_objects);
|
|
|
|
EVAS_ARRAY_SET(e, calculate_objects);
|
|
|
|
EVAS_ARRAY_SET(e, clip_changes);
|
|
|
|
|
|
|
|
#undef EVAS_ARRAY_SET
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
return e;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_free(Evas *e)
|
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] Evas touch event patch.
Nice to meet you.
I'm Eunmi Lee, developing mobile web browser and working on WebKit EFL port.
I need new type of event for touch, so I've made patch to add
EVAS_CALLBACK_TOUCH event to the evas.
I will explain history of this patch.
Currently, many web applications and sites use TouchEvent and they can
do everything(scrolling, zooming and so on) like native application
using TouchEvent.
So, I'm also want to provide TouchEvent for web in the WebKit EFL port,
but I got a problem during making TouchEvent because EFL's touch
event's structure (Mouse, Multi Event) is different from Web
TouchEvent's one.
Let me explain about Web TouchEvent firstly.
Web TouchEvent is consist of type and touch points list simply.
There are 3 kinds of type.
TouchStart: Happens every time a finger is placed on the screen.
TouchEnd: Happens every time a finger is removed from the screen.
TouchMove: Happens as a finger already placed on the screen is moved
across the screen.
for example, we can make (1 finger starts to touch), (2 fingers are
moving), (1 finger is released duirng 3 fingers are moving) and so on.
You can see the detailed information in the following url:
http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone
However, EFL's touch event is consist of six kinds of type :
MOUSE_DOWN, MOUSE_UP, MOUSE_MOVE, MULTI_DOWN, MULTI_UP, MULTI_MOVE.
So, I have to make a converter to make web touch event from EFL's
touch event.
You can reference attatched image file : evas_touch_event.png.
To tell the truth, converting code is not a big one.
But, I want to reduce this additional job and make code simple.
In the WebKit QT port, they don't have to make converting code for
TouchEvent,
because they have QTouchEvent, it has type and touchPoints list and
they can be mapped to Web TouchEvent one by one.
I think iPhone and Android also have such kind of event.
That's all why I want to add new touch event type to the evas.
about my patch:
- EVAS_CALLBACK_TOUCH event is added
- touch_points Eina_List is added to the Evas structure to maintain
current touch lists.
- process MOUSE/MULTI UP, DOWN, MOVE to make TOUCH event.
It is my first time to modify eves codes and actually I don't know too
much about evas.
So, I will be grateful if you send any feedback and comments.
SVN revision: 63796
2011-10-04 00:30:22 -07:00
|
|
|
Evas_Coord_Touch_Point *touch_point;
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2003-06-21 19:33:25 -07:00
|
|
|
int i;
|
2005-06-19 05:45:29 -07:00
|
|
|
int del;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2010-05-21 00:10:45 -07:00
|
|
|
#ifdef EVAS_FRAME_QUEUING
|
|
|
|
evas_common_frameq_flush();
|
|
|
|
#endif
|
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
if (e->walking_list == 0) evas_render_idle_flush(e);
|
2010-01-31 20:26:55 -08:00
|
|
|
|
2010-03-21 22:33:46 -07:00
|
|
|
if (e->walking_list > 0) return;
|
2010-09-25 19:27:01 -07:00
|
|
|
|
|
|
|
if (e->callbacks)
|
2010-01-31 20:26:55 -08:00
|
|
|
{
|
2010-09-25 19:27:01 -07:00
|
|
|
if (e->callbacks->deletions_waiting) return;
|
|
|
|
|
|
|
|
e->callbacks->deletions_waiting = 0;
|
|
|
|
evas_event_callback_list_post_free(&e->callbacks->callbacks);
|
|
|
|
if (!e->callbacks->callbacks)
|
|
|
|
{
|
|
|
|
free(e->callbacks);
|
|
|
|
e->callbacks = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
_evas_post_event_callback_free(e);
|
2010-01-31 20:26:55 -08:00
|
|
|
}
|
|
|
|
|
2005-06-19 05:45:29 -07:00
|
|
|
del = 1;
|
2007-04-29 21:22:42 -07:00
|
|
|
e->walking_list++;
|
2008-06-04 09:42:39 -07:00
|
|
|
e->cleanup = 1;
|
2005-06-19 05:45:29 -07:00
|
|
|
while (del)
|
2003-01-09 21:38:47 -08:00
|
|
|
{
|
2003-07-29 19:58:10 -07:00
|
|
|
del = 0;
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
2003-07-29 19:58:10 -07:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Object *o;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2003-07-29 19:58:10 -07:00
|
|
|
evas_layer_pre_free(lay);
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_FOREACH(lay->objects, o)
|
2008-10-17 04:23:18 -07:00
|
|
|
{
|
2007-04-29 21:22:42 -07:00
|
|
|
if ((o->callbacks) && (o->callbacks->walking_list))
|
|
|
|
{
|
|
|
|
/* Defer free */
|
|
|
|
e->delete_me = 1;
|
|
|
|
e->walking_list--;
|
|
|
|
return;
|
|
|
|
}
|
2003-07-29 19:58:10 -07:00
|
|
|
if (!o->delete_me)
|
2005-06-19 05:45:29 -07:00
|
|
|
del = 1;
|
2003-07-29 19:58:10 -07:00
|
|
|
}
|
|
|
|
}
|
2003-01-09 21:38:47 -08:00
|
|
|
}
|
2009-06-15 07:25:21 -07:00
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
2009-06-20 00:17:40 -07:00
|
|
|
evas_layer_free_objects(lay);
|
2009-06-15 07:25:21 -07:00
|
|
|
evas_layer_clean(e);
|
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
e->walking_list--;
|
2008-10-17 04:23:18 -07:00
|
|
|
|
2005-05-21 19:49:50 -07:00
|
|
|
evas_font_path_clear(e);
|
2008-10-21 09:31:05 -07:00
|
|
|
e->pointer.object.in = eina_list_free(e->pointer.object.in);
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2008-12-09 09:56:31 -08:00
|
|
|
if (e->name_hash) eina_hash_free(e->name_hash);
|
|
|
|
e->name_hash = NULL;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2009-04-14 02:48:31 -07:00
|
|
|
EINA_LIST_FREE(e->damages, r)
|
2009-06-23 06:57:27 -07:00
|
|
|
eina_rectangle_free(r);
|
2009-04-14 02:48:31 -07:00
|
|
|
EINA_LIST_FREE(e->obscures, r)
|
2009-06-23 06:57:27 -07:00
|
|
|
eina_rectangle_free(r);
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2008-10-31 03:46:46 -07:00
|
|
|
evas_fonts_zero_free(e);
|
2010-03-28 19:40:49 -07:00
|
|
|
|
2010-03-28 22:03:25 -07:00
|
|
|
evas_event_callback_all_del(e);
|
2010-03-28 19:40:49 -07:00
|
|
|
evas_event_callback_cleanup(e);
|
2008-10-31 03:46:46 -07:00
|
|
|
|
|
|
|
if (e->engine.func)
|
2005-06-19 06:06:36 -07:00
|
|
|
{
|
|
|
|
e->engine.func->context_free(e->engine.data.output, e->engine.data.context);
|
|
|
|
e->engine.func->output_free(e->engine.data.output);
|
2009-10-01 01:01:03 -07:00
|
|
|
e->engine.func->info_free(e, e->engine.info);
|
2005-06-19 06:06:36 -07:00
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2003-06-21 19:33:25 -07:00
|
|
|
for (i = 0; i < e->modifiers.mod.count; i++)
|
|
|
|
free(e->modifiers.mod.list[i]);
|
|
|
|
if (e->modifiers.mod.list) free(e->modifiers.mod.list);
|
|
|
|
|
|
|
|
for (i = 0; i < e->locks.lock.count; i++)
|
|
|
|
free(e->locks.lock.list[i]);
|
|
|
|
if (e->locks.lock.list) free(e->locks.lock.list);
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2006-09-18 02:40:29 -07:00
|
|
|
if (e->engine.module) evas_module_unref(e->engine.module);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_flush(&e->delete_objects);
|
|
|
|
eina_array_flush(&e->active_objects);
|
|
|
|
eina_array_flush(&e->restack_objects);
|
|
|
|
eina_array_flush(&e->render_objects);
|
|
|
|
eina_array_flush(&e->pending_objects);
|
|
|
|
eina_array_flush(&e->obscuring_objects);
|
|
|
|
eina_array_flush(&e->temporary_objects);
|
2009-03-23 03:02:26 -07:00
|
|
|
eina_array_flush(&e->calculate_objects);
|
2009-04-15 06:40:37 -07:00
|
|
|
eina_array_flush(&e->clip_changes);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
From: EunMi Lee <eunmi15.lee@samsung.com>
Subject: [E-devel] [Patch] Evas touch event patch.
Nice to meet you.
I'm Eunmi Lee, developing mobile web browser and working on WebKit EFL port.
I need new type of event for touch, so I've made patch to add
EVAS_CALLBACK_TOUCH event to the evas.
I will explain history of this patch.
Currently, many web applications and sites use TouchEvent and they can
do everything(scrolling, zooming and so on) like native application
using TouchEvent.
So, I'm also want to provide TouchEvent for web in the WebKit EFL port,
but I got a problem during making TouchEvent because EFL's touch
event's structure (Mouse, Multi Event) is different from Web
TouchEvent's one.
Let me explain about Web TouchEvent firstly.
Web TouchEvent is consist of type and touch points list simply.
There are 3 kinds of type.
TouchStart: Happens every time a finger is placed on the screen.
TouchEnd: Happens every time a finger is removed from the screen.
TouchMove: Happens as a finger already placed on the screen is moved
across the screen.
for example, we can make (1 finger starts to touch), (2 fingers are
moving), (1 finger is released duirng 3 fingers are moving) and so on.
You can see the detailed information in the following url:
http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone
However, EFL's touch event is consist of six kinds of type :
MOUSE_DOWN, MOUSE_UP, MOUSE_MOVE, MULTI_DOWN, MULTI_UP, MULTI_MOVE.
So, I have to make a converter to make web touch event from EFL's
touch event.
You can reference attatched image file : evas_touch_event.png.
To tell the truth, converting code is not a big one.
But, I want to reduce this additional job and make code simple.
In the WebKit QT port, they don't have to make converting code for
TouchEvent,
because they have QTouchEvent, it has type and touchPoints list and
they can be mapped to Web TouchEvent one by one.
I think iPhone and Android also have such kind of event.
That's all why I want to add new touch event type to the evas.
about my patch:
- EVAS_CALLBACK_TOUCH event is added
- touch_points Eina_List is added to the Evas structure to maintain
current touch lists.
- process MOUSE/MULTI UP, DOWN, MOVE to make TOUCH event.
It is my first time to modify eves codes and actually I don't know too
much about evas.
So, I will be grateful if you send any feedback and comments.
SVN revision: 63796
2011-10-04 00:30:22 -07:00
|
|
|
EINA_LIST_FREE(e->touch_points, touch_point)
|
|
|
|
free(touch_point);
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->magic = 0;
|
|
|
|
free(e);
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_output_method_set(Evas *e, int render_method)
|
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Evas_Module *em;
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* if our engine to set it to is invalid - abort */
|
|
|
|
if (render_method == RENDER_METHOD_INVALID) return;
|
2004-02-16 11:22:48 -08:00
|
|
|
/* if the engine is already set up - abort */
|
2002-11-08 00:02:15 -08:00
|
|
|
if (e->output.render_method != RENDER_METHOD_INVALID) return;
|
2009-06-16 06:01:36 -07:00
|
|
|
/* Request the right engine. */
|
|
|
|
em = evas_module_engine_get(render_method);
|
|
|
|
if (!em) return ;
|
|
|
|
if (em->id_engine != render_method) return;
|
|
|
|
if (!evas_module_load(em)) return;
|
|
|
|
|
|
|
|
/* set the correct render */
|
|
|
|
e->output.render_method = render_method;
|
|
|
|
e->engine.func = (em->functions);
|
|
|
|
evas_module_use(em);
|
|
|
|
if (e->engine.module) evas_module_unref(e->engine.module);
|
|
|
|
e->engine.module = em;
|
|
|
|
evas_module_ref(em);
|
|
|
|
/* get the engine info struct */
|
|
|
|
if (e->engine.func->info) e->engine.info = e->engine.func->info(e);
|
|
|
|
return;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_output_method_get(const Evas *e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return RENDER_METHOD_INVALID;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
return e->output.render_method;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Engine_Info *
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_engine_info_get(const Evas *e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
Evas_Engine_Info *info;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-25 21:25:02 -08:00
|
|
|
if (!e->engine.info) return NULL;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
info = e->engine.info;
|
2008-02-08 12:44:09 -08:00
|
|
|
((Evas *)e)->engine.info_magic = info->magic;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
2010-09-22 02:19:31 -07:00
|
|
|
EAPI Eina_Bool
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_engine_info_set(Evas *e, Evas_Engine_Info *info)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
2010-09-22 02:19:31 -07:00
|
|
|
return EINA_FALSE;
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK_END();
|
2010-09-22 02:19:31 -07:00
|
|
|
if (!info) return EINA_FALSE;
|
|
|
|
if (info != e->engine.info) return EINA_FALSE;
|
|
|
|
if (info->magic != e->engine.info_magic) return EINA_FALSE;
|
|
|
|
return (Eina_Bool)e->engine.func->setup(e, info);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_output_size_set(Evas *e, int w, int h)
|
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if ((w == e->output.w) && (h == e->output.h)) return;
|
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
2010-05-21 00:10:45 -07:00
|
|
|
|
|
|
|
#ifdef EVAS_FRAME_QUEUING
|
|
|
|
evas_common_frameq_flush();
|
|
|
|
#endif
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->output.w = w;
|
|
|
|
e->output.h = h;
|
|
|
|
e->output.changed = 1;
|
|
|
|
e->output_validity++;
|
|
|
|
e->changed = 1;
|
2008-06-04 09:42:39 -07:00
|
|
|
evas_render_invalidate(e);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_output_size_get(const Evas *e, int *w, int *h)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
2005-05-21 19:49:50 -07:00
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if (w) *w = e->output.w;
|
|
|
|
if (h) *h = e->output.h;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2003-10-17 20:34:00 -07:00
|
|
|
evas_output_viewport_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if ((x == e->viewport.x) && (y == e->viewport.y) &&
|
|
|
|
(w == e->viewport.w) && (h == e->viewport.h)) return;
|
|
|
|
if (w <= 0) return;
|
|
|
|
if (h <= 0) return;
|
2006-11-15 19:20:24 -08:00
|
|
|
if ((x != 0) || (y != 0))
|
|
|
|
{
|
2009-10-22 08:22:22 -07:00
|
|
|
ERR("Compat error. viewport x,y != 0,0 not supported");
|
2006-11-15 19:20:24 -08:00
|
|
|
x = 0;
|
|
|
|
y = 0;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
e->viewport.x = x;
|
|
|
|
e->viewport.y = y;
|
|
|
|
e->viewport.w = w;
|
|
|
|
e->viewport.h = h;
|
|
|
|
e->viewport.changed = 1;
|
|
|
|
e->output_validity++;
|
|
|
|
e->changed = 1;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_output_viewport_get(const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if (x) *x = e->viewport.x;
|
|
|
|
if (y) *y = e->viewport.y;
|
|
|
|
if (w) *w = e->viewport.w;
|
|
|
|
if (h) *h = e->viewport.h;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Coord
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_coord_screen_x_to_world(const Evas *e, int x)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
2004-04-27 18:52:16 -07:00
|
|
|
if (e->output.w == e->viewport.w) return e->viewport.x + x;
|
|
|
|
return (long long)e->viewport.x + (((long long)x * (long long)e->viewport.w) / (long long)e->output.w);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Coord
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_coord_screen_y_to_world(const Evas *e, int y)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
2004-04-27 18:52:16 -07:00
|
|
|
if (e->output.h == e->viewport.h) return e->viewport.y + y;
|
|
|
|
return (long long)e->viewport.y + (((long long)y * (long long)e->viewport.h) / (long long)e->output.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_coord_world_x_to_screen(const Evas *e, Evas_Coord x)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
2004-04-27 18:52:16 -07:00
|
|
|
if (e->output.w == e->viewport.w) return x - e->viewport.x;
|
|
|
|
return (int)((((long long)x - (long long)e->viewport.x) * (long long)e->output.w) / (long long)e->viewport.w);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_coord_world_y_to_screen(const Evas *e, Evas_Coord y)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
2002-11-08 00:02:15 -08:00
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
2004-04-27 18:52:16 -07:00
|
|
|
if (e->output.h == e->viewport.h) return y - e->viewport.y;
|
|
|
|
return (int)((((long long)y - (long long)e->viewport.y) * (long long)e->output.h) / (long long)e->viewport.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_render_method_lookup(const char *name)
|
|
|
|
{
|
2006-01-14 04:13:38 -08:00
|
|
|
Evas_Module *em;
|
2009-06-16 06:01:36 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!name) return RENDER_METHOD_INVALID;
|
2006-01-14 04:13:38 -08:00
|
|
|
/* search on the engines list for the name */
|
|
|
|
em = evas_module_find_type(EVAS_MODULE_TYPE_ENGINE, name);
|
2006-01-14 07:39:57 -08:00
|
|
|
if (!em) return RENDER_METHOD_INVALID;
|
2009-06-16 06:01:36 -07:00
|
|
|
|
|
|
|
return em->id_engine;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
EAPI Eina_List *
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_render_method_list(void)
|
|
|
|
{
|
2011-09-19 07:20:18 -07:00
|
|
|
return evas_module_engine_list();
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-10-21 09:31:05 -07:00
|
|
|
evas_render_method_list_free(Eina_List *list)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-06-16 06:01:36 -07:00
|
|
|
eina_list_free(list);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2011-06-01 07:32:08 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_image_extension_can_load_get(const char *file)
|
|
|
|
{
|
|
|
|
const char *tmp;
|
|
|
|
Eina_Bool result;
|
|
|
|
|
|
|
|
tmp = eina_stringshare_add(file);
|
|
|
|
result = evas_common_extension_can_load_get(tmp);
|
|
|
|
eina_stringshare_del(tmp);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_image_extension_can_load_fast_get(const char *file)
|
|
|
|
{
|
|
|
|
return evas_common_extension_can_load_get(file);
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_pointer_output_xy_get(const Evas *e, int *x, int *y)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (x) *x = e->pointer.x;
|
|
|
|
if (y) *y = e->pointer.y;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_pointer_canvas_xy_get(const Evas *e, Evas_Coord *x, Evas_Coord *y)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (x) *x = e->pointer.x;
|
|
|
|
if (y) *y = e->pointer.y;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI int
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_pointer_button_down_mask_get(const Evas *e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return (int)e->pointer.button;
|
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_pointer_inside_get(const Evas *e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-21 19:49:50 -07:00
|
|
|
return (int)e->pointer.inside;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-11-06 01:47:28 -08:00
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2005-11-06 01:47:28 -08:00
|
|
|
evas_data_attach_set(Evas *e, void *data)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
e->attach_data = data;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void *
|
2008-02-08 12:44:09 -08:00
|
|
|
evas_data_attach_get(const Evas *e)
|
2005-11-06 01:47:28 -08:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return e->attach_data;
|
|
|
|
}
|
2007-04-29 21:22:42 -07:00
|
|
|
|
2010-01-31 20:26:55 -08:00
|
|
|
EAPI void
|
|
|
|
evas_focus_in(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (e->focus) return;
|
|
|
|
e->focus = 1;
|
|
|
|
evas_event_callback_call(e, EVAS_CALLBACK_CANVAS_FOCUS_IN, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_focus_out(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (!e->focus) return;
|
|
|
|
e->focus = 0;
|
|
|
|
evas_event_callback_call(e, EVAS_CALLBACK_CANVAS_FOCUS_OUT, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_focus_state_get(const Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
return e->focus;
|
|
|
|
}
|
|
|
|
|
2010-09-02 17:06:56 -07:00
|
|
|
EAPI void
|
|
|
|
evas_nochange_push(Evas *e)
|
|
|
|
{
|
|
|
|
e->nochange++;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_nochange_pop(Evas *e)
|
|
|
|
{
|
|
|
|
e->nochange--;
|
|
|
|
}
|
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
void
|
|
|
|
_evas_walk(Evas *e)
|
|
|
|
{
|
|
|
|
e->walking_list++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_evas_unwalk(Evas *e)
|
|
|
|
{
|
|
|
|
e->walking_list--;
|
|
|
|
if ((e->walking_list == 0) && (e->delete_me)) evas_free(e);
|
|
|
|
}
|
2009-12-22 10:06:15 -08:00
|
|
|
|
|
|
|
EAPI const char *
|
2010-09-22 06:25:17 -07:00
|
|
|
evas_load_error_str(Evas_Load_Error error)
|
2009-12-22 10:06:15 -08:00
|
|
|
{
|
|
|
|
switch (error)
|
|
|
|
{
|
|
|
|
case EVAS_LOAD_ERROR_NONE:
|
|
|
|
return "No error on load";
|
|
|
|
case EVAS_LOAD_ERROR_GENERIC:
|
2010-09-07 20:51:24 -07:00
|
|
|
return "A non-specific error occurred";
|
2009-12-22 10:06:15 -08:00
|
|
|
case EVAS_LOAD_ERROR_DOES_NOT_EXIST:
|
|
|
|
return "File (or file path) does not exist";
|
|
|
|
case EVAS_LOAD_ERROR_PERMISSION_DENIED:
|
|
|
|
return "Permission deinied to an existing file (or path)";
|
|
|
|
case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED:
|
|
|
|
return "Allocation of resources failure prevented load";
|
|
|
|
case EVAS_LOAD_ERROR_CORRUPT_FILE:
|
|
|
|
return "File corrupt (but was detected as a known format)";
|
|
|
|
case EVAS_LOAD_ERROR_UNKNOWN_FORMAT:
|
|
|
|
return "File is not a known format";
|
|
|
|
default:
|
|
|
|
return "Unknown error";
|
|
|
|
}
|
|
|
|
}
|
2010-08-16 09:13:41 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_color_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b)
|
|
|
|
{
|
|
|
|
evas_common_convert_color_hsv_to_rgb(h, s, v, r, g, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_color_rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v)
|
|
|
|
{
|
|
|
|
evas_common_convert_color_rgb_to_hsv(r, g, b, h, s, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_color_argb_premul(int a, int *r, int *g, int *b)
|
|
|
|
{
|
|
|
|
evas_common_convert_color_argb_premul(a, r, g, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_color_argb_unpremul(int a, int *r, int *g, int *b)
|
|
|
|
{
|
|
|
|
evas_common_convert_color_argb_unpremul(a, r, g, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_data_argb_premul(unsigned int *data, unsigned int len)
|
|
|
|
{
|
|
|
|
if (!data || (len < 1)) return;
|
|
|
|
evas_common_convert_argb_premul(data, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_data_argb_unpremul(unsigned int *data, unsigned int len)
|
|
|
|
{
|
|
|
|
if (!data || (len < 1)) return;
|
|
|
|
evas_common_convert_argb_unpremul(data, len);
|
|
|
|
}
|