2016-06-13 22:59:57 -07:00
|
|
|
#define EVAS_CANVAS_BETA
|
2016-11-17 11:30:58 -08:00
|
|
|
#define EFL_INPUT_EVENT_PROTECTED
|
2018-05-03 16:43:48 -07:00
|
|
|
|
2013-11-20 22:33:21 -08:00
|
|
|
#include "evas_common_private.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_private.h"
|
2012-10-11 23:36:06 -07:00
|
|
|
//#include "evas_cs.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2016-05-05 07:45:04 -07:00
|
|
|
#include "evas_image_private.h"
|
|
|
|
#include "evas_polygon_private.h"
|
|
|
|
#include "evas_vg_private.h"
|
|
|
|
|
2018-05-03 16:43:48 -07:00
|
|
|
#include "eo_internal.h"
|
|
|
|
|
2016-10-05 03:51:42 -07:00
|
|
|
#include <Ecore.h>
|
|
|
|
|
2016-11-17 11:30:58 -08:00
|
|
|
#define EFL_INTERNAL_UNSTABLE
|
|
|
|
#include "interfaces/efl_common_internal.h"
|
|
|
|
|
2014-06-26 14:29:46 -07:00
|
|
|
#define MY_CLASS EVAS_CANVAS_CLASS
|
2012-10-08 18:58:41 -07: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;
|
2013-09-02 15:38:52 -07:00
|
|
|
|
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
|
2016-11-21 21:33:48 -08:00
|
|
|
|
2017-09-22 03:06:10 -07:00
|
|
|
#ifdef _WIN32
|
2010-01-29 16:09:29 -08:00
|
|
|
if (!evil_init())
|
2009-10-08 14:17:21 -07:00
|
|
|
return --_evas_init_count;
|
2010-01-29 16:09:29 -08:00
|
|
|
#endif
|
|
|
|
|
2018-07-26 05:43:50 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_GOTO(eina_init(), shutdown_evil);
|
2009-10-07 23:25:09 -07:00
|
|
|
|
2018-07-26 05:43:50 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_GOTO(eet_init(), shutdown_eet);
|
|
|
|
#ifdef BUILD_LOADER_EET
|
|
|
|
/* additional init refcount; cannot fail */
|
|
|
|
eet_init();
|
|
|
|
#endif
|
2016-07-04 04:07:30 -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
|
|
|
}
|
|
|
|
|
2018-07-26 05:43:50 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_GOTO(efl_object_init(), shutdown_eo);
|
2013-03-27 05:42:55 -07:00
|
|
|
|
2018-07-26 05:43:50 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_GOTO(ecore_init(), shutdown_ecore);
|
2017-02-07 14:17:17 -08:00
|
|
|
|
2009-10-07 23:25:09 -07:00
|
|
|
evas_module_init();
|
2018-07-26 05:43:50 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_GOTO(evas_async_events_init(), shutdown_module);
|
2009-12-18 03:03:31 -08:00
|
|
|
_evas_preload_thread_init();
|
2015-06-03 03:59:11 -07:00
|
|
|
evas_filter_init();
|
2017-10-26 17:11:02 -07:00
|
|
|
evas_cache_vg_init();
|
2009-10-07 23:25:09 -07:00
|
|
|
|
2018-07-26 05:43:50 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_GOTO(evas_thread_init(), shutdown_filter);
|
2012-12-18 08:21:03 -08:00
|
|
|
|
2017-08-30 10:01:17 -07:00
|
|
|
evas_common_init();
|
|
|
|
|
2013-03-27 05:42:55 -07:00
|
|
|
eina_log_timing(_evas_log_dom_global,
|
|
|
|
EINA_LOG_STATE_STOP,
|
|
|
|
EINA_LOG_STATE_INIT);
|
|
|
|
|
2017-05-29 02:01:37 -07:00
|
|
|
_efl_gfx_map_init();
|
2018-05-10 02:55:43 -07:00
|
|
|
evas_focus_init();
|
2017-05-29 02:01:37 -07:00
|
|
|
|
2009-10-07 23:25:09 -07:00
|
|
|
return _evas_init_count;
|
2009-09-03 22:41:20 -07:00
|
|
|
|
2016-11-21 21:33:48 -08:00
|
|
|
shutdown_filter:
|
|
|
|
evas_filter_shutdown();
|
|
|
|
_evas_preload_thread_shutdown();
|
2018-07-26 05:43:50 -07:00
|
|
|
shutdown_module:
|
2009-09-03 22:41:20 -07:00
|
|
|
evas_module_shutdown();
|
2018-07-26 05:43:50 -07:00
|
|
|
shutdown_ecore:
|
|
|
|
efl_object_shutdown();
|
|
|
|
shutdown_eo:
|
|
|
|
eina_log_domain_unregister(_evas_log_dom_global);
|
|
|
|
shutdown_eet:
|
2016-11-21 21:33:48 -08:00
|
|
|
#ifdef BUILD_LOADER_EET
|
|
|
|
eet_shutdown();
|
|
|
|
#endif
|
2016-07-04 04:07:30 -07:00
|
|
|
eet_shutdown();
|
2018-07-26 05:43:50 -07:00
|
|
|
shutdown_eina:
|
2009-09-03 22:41:20 -07:00
|
|
|
eina_shutdown();
|
2018-07-26 05:43:50 -07:00
|
|
|
shutdown_evil:
|
2017-09-22 03:06:10 -07:00
|
|
|
#ifdef _WIN32
|
2010-01-29 16:09:29 -08:00
|
|
|
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)
|
|
|
|
{
|
2012-05-30 03:08:41 -07:00
|
|
|
if (_evas_init_count <= 0)
|
|
|
|
{
|
|
|
|
EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
|
|
|
|
return 0;
|
|
|
|
}
|
2009-10-07 23:25:09 -07:00
|
|
|
if (--_evas_init_count != 0)
|
|
|
|
return _evas_init_count;
|
|
|
|
|
2013-03-27 05:42:55 -07:00
|
|
|
eina_log_timing(_evas_log_dom_global,
|
2016-12-02 15:27:48 -08:00
|
|
|
EINA_LOG_STATE_START,
|
|
|
|
EINA_LOG_STATE_SHUTDOWN);
|
2013-03-27 05:42:55 -07:00
|
|
|
|
2018-05-10 02:55:43 -07:00
|
|
|
evas_focus_shutdown();
|
|
|
|
|
2017-10-26 17:11:02 -07:00
|
|
|
evas_cache_vg_shutdown();
|
2013-08-01 02:39:38 -07:00
|
|
|
|
evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().
Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`
#include <Evas.h>
#include <Ecore.h>
Eina_Bool
_timer_cb (void *data)
{
ecore_main_loop_quit();
return 0;
}
int
main(int argc, char *argv[])
{
evas_init();
Evas *evas = evas_new();
Evas_Object *obj = evas_object_box_add(evas);
Evas_Object *rect = evas_object_rectangle_add(evas);
evas_object_color_set(rect, 255, 255, 255, 255);
evas_object_resize(rect, 300, 400);
evas_object_show(rect);
evas_object_box_append(obj, rect);
evas_object_show(obj);
ecore_timer_add(2.0, _timer_cb, NULL);
ecore_main_loop_begin();
evas_shutdown();
return 0;
}
Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike
Reviewed By: zmike
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 04:50:30 -07:00
|
|
|
evas_font_path_global_clear();
|
|
|
|
|
|
|
|
evas_thread_shutdown();
|
|
|
|
_evas_preload_thread_shutdown();
|
|
|
|
evas_async_events_shutdown();
|
|
|
|
|
|
|
|
ecore_shutdown();
|
2018-06-28 12:53:10 -07:00
|
|
|
evas_common_shutdown();
|
2018-06-28 09:41:12 -07:00
|
|
|
|
|
|
|
evas_filter_shutdown();
|
|
|
|
evas_module_shutdown();
|
evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().
Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`
#include <Evas.h>
#include <Ecore.h>
Eina_Bool
_timer_cb (void *data)
{
ecore_main_loop_quit();
return 0;
}
int
main(int argc, char *argv[])
{
evas_init();
Evas *evas = evas_new();
Evas_Object *obj = evas_object_box_add(evas);
Evas_Object *rect = evas_object_rectangle_add(evas);
evas_object_color_set(rect, 255, 255, 255, 255);
evas_object_resize(rect, 300, 400);
evas_object_show(rect);
evas_object_box_append(obj, rect);
evas_object_show(obj);
ecore_timer_add(2.0, _timer_cb, NULL);
ecore_main_loop_begin();
evas_shutdown();
return 0;
}
Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike
Reviewed By: zmike
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 04:50:30 -07:00
|
|
|
|
2017-04-25 23:11:51 -07:00
|
|
|
_efl_gfx_map_shutdown();
|
|
|
|
|
2013-01-16 23:21:06 -08:00
|
|
|
eina_cow_del(evas_object_proxy_cow);
|
2013-01-21 19:56:00 -08:00
|
|
|
eina_cow_del(evas_object_map_cow);
|
2013-04-01 02:39:29 -07:00
|
|
|
eina_cow_del(evas_object_state_cow);
|
|
|
|
evas_object_state_cow = NULL;
|
2013-01-25 04:15:38 -08:00
|
|
|
evas_object_map_cow = NULL;
|
2013-01-16 23:21:06 -08:00
|
|
|
evas_object_proxy_cow = NULL;
|
|
|
|
|
2013-01-25 04:15:38 -08:00
|
|
|
eina_cow_del(evas_object_image_pixels_cow);
|
|
|
|
eina_cow_del(evas_object_image_load_opts_cow);
|
2013-01-27 16:28:53 -08:00
|
|
|
eina_cow_del(evas_object_image_state_cow);
|
2013-01-25 04:15:38 -08:00
|
|
|
evas_object_image_pixels_cow = NULL;
|
|
|
|
evas_object_image_load_opts_cow = NULL;
|
2013-01-27 16:28:53 -08:00
|
|
|
evas_object_image_state_cow = NULL;
|
2013-01-25 04:15:38 -08:00
|
|
|
|
2015-06-03 03:59:11 -07:00
|
|
|
eina_cow_del(evas_object_mask_cow);
|
|
|
|
evas_object_mask_cow = NULL;
|
|
|
|
|
2013-11-20 17:47:27 -08:00
|
|
|
#ifdef BUILD_LOADER_EET
|
|
|
|
eet_shutdown();
|
|
|
|
#endif
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_object_shutdown();
|
2013-03-27 05:42:55 -07:00
|
|
|
|
2009-10-07 23:25:09 -07:00
|
|
|
eina_log_domain_unregister(_evas_log_dom_global);
|
2013-03-27 05:42:55 -07:00
|
|
|
|
2016-07-04 04:07:30 -07:00
|
|
|
eet_shutdown();
|
|
|
|
|
2009-10-07 23:25:09 -07:00
|
|
|
eina_shutdown();
|
2017-09-22 03:06:10 -07:00
|
|
|
#ifdef _WIN32
|
2010-01-29 16:09:29 -08:00
|
|
|
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)
|
|
|
|
{
|
2018-03-19 15:36:18 -07:00
|
|
|
Evas_Object *eo_obj = efl_add(EVAS_CANVAS_CLASS, efl_main_loop_get());
|
2012-10-08 18:58:41 -07:00
|
|
|
return eo_obj;
|
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2016-11-07 10:44:46 -08:00
|
|
|
static void
|
|
|
|
_evas_key_mask_free(void *data)
|
|
|
|
{
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_evas_canvas_efl_object_constructor(Eo *eo_obj, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
e->evas = eo_obj;
|
2002-11-08 00:02:15 -08:00
|
|
|
e->output.render_method = RENDER_METHOD_INVALID;
|
2004-05-05 04:00:19 -07:00
|
|
|
e->viewport.w = 1;
|
|
|
|
e->viewport.h = 1;
|
2011-12-26 15:11:07 -08:00
|
|
|
e->framespace.x = 0;
|
|
|
|
e->framespace.y = 0;
|
|
|
|
e->framespace.w = 0;
|
|
|
|
e->framespace.h = 0;
|
2006-02-27 20:07:49 -08:00
|
|
|
e->hinting = EVAS_FONT_HINTING_BYTECODE;
|
2017-02-15 23:26:42 -08:00
|
|
|
e->current_event = EVAS_CALLBACK_LAST;
|
2017-08-31 13:13:01 -07:00
|
|
|
e->name_hash = eina_hash_string_superfast_new((Eina_Free_Cb)eina_list_free);
|
2011-10-12 19:22:29 -07:00
|
|
|
eina_clist_init(&e->calc_list);
|
2011-11-16 20:31:43 -08:00
|
|
|
eina_clist_init(&e->calc_done);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2018-05-09 19:58:15 -07:00
|
|
|
efl_wref_add(efl_add(EFL_CANVAS_GESTURE_MANAGER_CLASS, eo_obj), &e->gesture_manager);
|
2017-09-19 01:17:39 -07:00
|
|
|
|
2011-12-26 15:11:07 -08:00
|
|
|
#define EVAS_ARRAY_SET(E, Array) \
|
2013-11-28 22:32:27 -08:00
|
|
|
eina_array_step_set(&E->Array, sizeof (E->Array), \
|
2015-05-09 11:02:13 -07:00
|
|
|
((1024 * sizeof (void*)) - sizeof (E->Array)) / sizeof (void*));
|
2010-08-19 05:02:28 -07:00
|
|
|
|
|
|
|
EVAS_ARRAY_SET(e, delete_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);
|
2015-05-09 11:02:13 -07:00
|
|
|
EVAS_ARRAY_SET(e, snapshot_objects);
|
2010-08-19 05:02:28 -07:00
|
|
|
EVAS_ARRAY_SET(e, clip_changes);
|
2013-01-17 14:14:05 -08:00
|
|
|
EVAS_ARRAY_SET(e, scie_unref_queue);
|
2013-01-11 11:54:12 -08:00
|
|
|
EVAS_ARRAY_SET(e, image_unref_queue);
|
2013-01-11 11:55:40 -08:00
|
|
|
EVAS_ARRAY_SET(e, glyph_unref_queue);
|
2013-01-15 09:35:11 -08:00
|
|
|
EVAS_ARRAY_SET(e, texts_unref_queue);
|
2010-08-19 05:02:28 -07:00
|
|
|
|
2016-11-25 21:25:41 -08:00
|
|
|
e->active_objects.version = EINA_ARRAY_VERSION;
|
|
|
|
eina_inarray_step_set(&e->active_objects,
|
|
|
|
sizeof(Eina_Inarray),
|
|
|
|
sizeof(Evas_Active_Entry),
|
|
|
|
256);
|
|
|
|
|
2010-08-19 05:02:28 -07:00
|
|
|
#undef EVAS_ARRAY_SET
|
2015-02-10 03:44:38 -08:00
|
|
|
eina_lock_new(&(e->lock_objects));
|
2015-09-27 10:56:28 -07:00
|
|
|
eina_spinlock_new(&(e->render.lock));
|
2016-12-22 03:46:49 -08:00
|
|
|
eina_spinlock_new(&(e->post_render.lock));
|
2015-05-19 03:41:27 -07:00
|
|
|
|
2016-05-10 05:26:07 -07:00
|
|
|
_evas_canvas_event_init(eo_obj, e);
|
|
|
|
|
2016-10-19 06:02:18 -07:00
|
|
|
e->focused_objects = eina_hash_pointer_new(NULL);
|
2016-11-07 10:44:46 -08:00
|
|
|
e->locks.masks = eina_hash_pointer_new(_evas_key_mask_free);
|
|
|
|
e->modifiers.masks = eina_hash_pointer_new(_evas_key_mask_free);
|
|
|
|
e->locks.e = e->modifiers.e = e;
|
2016-10-19 06:02:18 -07:00
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
return eo_obj;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_free(Evas *eo_e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2018-07-05 12:12:45 -07:00
|
|
|
if (efl_parent_get(eo_e))
|
|
|
|
efl_del(eo_e);
|
|
|
|
else
|
|
|
|
efl_unref(eo_e);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2018-05-12 22:20:04 -07:00
|
|
|
typedef struct _Forced_Death Forced_Death;
|
|
|
|
struct _Forced_Death
|
|
|
|
{
|
|
|
|
Eina_Bool invalidated;
|
|
|
|
Eina_Bool noref;
|
|
|
|
Eina_Bool destroyed;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
_object_invalidate(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Forced_Death *force = data;
|
|
|
|
force->invalidated = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_object_del(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Forced_Death *force = data;
|
|
|
|
force->destroyed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_object_noref(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Forced_Death *force = data;
|
|
|
|
force->noref = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(_object_forced_death,
|
|
|
|
{ EFL_EVENT_DEL, _object_del },
|
|
|
|
{ EFL_EVENT_INVALIDATE, _object_invalidate },
|
|
|
|
{ EFL_EVENT_NOREF, _object_noref } );
|
|
|
|
|
|
|
|
|
2018-04-05 11:27:44 -07:00
|
|
|
EOLIAN static void
|
2018-05-09 20:01:17 -07:00
|
|
|
_evas_canvas_efl_object_invalidate(Eo *eo_e, Evas_Public_Data *e)
|
2018-04-05 11:27:44 -07:00
|
|
|
{
|
2018-05-09 20:01:17 -07:00
|
|
|
Evas_Object_Protected_Data *o;
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2018-05-09 20:01:17 -07:00
|
|
|
Eo *obj;
|
|
|
|
Eina_Array stash = { 0 };
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
evas_sync(eo_e);
|
2015-02-10 03:44:38 -08:00
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
evas_canvas_async_block(e);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_render_idle_flush(eo_e);
|
|
|
|
|
2018-04-06 14:54:50 -07:00
|
|
|
efl_replace(&e->default_seat, NULL);
|
|
|
|
efl_replace(&e->default_mouse, NULL);
|
|
|
|
efl_replace(&e->default_keyboard, NULL);
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_free(eo_e);
|
2016-05-10 05:26:07 -07:00
|
|
|
_evas_canvas_event_shutdown(eo_e, e);
|
2010-09-25 19:27:01 -07:00
|
|
|
|
2008-06-04 09:42:39 -07:00
|
|
|
e->cleanup = 1;
|
2018-05-09 20:01:17 -07:00
|
|
|
|
|
|
|
eina_array_step_set(&stash, sizeof (Eina_Array), 16);
|
|
|
|
|
|
|
|
// The first pass should destroy all object that are properly referenced
|
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
2003-01-09 21:38:47 -08:00
|
|
|
{
|
2018-05-09 20:01:17 -07:00
|
|
|
evas_layer_pre_free(lay);
|
2017-07-19 22:04:10 -07:00
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
EINA_INLIST_FOREACH(lay->objects, o)
|
2013-07-10 21:45:22 -07:00
|
|
|
{
|
2018-05-09 20:01:17 -07:00
|
|
|
if (!o->delete_me)
|
|
|
|
eina_array_push(&stash, o->object);
|
2017-07-19 22:04:10 -07:00
|
|
|
}
|
2018-05-09 20:01:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
while ((obj = eina_array_pop(&stash)))
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *pd = efl_data_scope_get(obj, EFL_CANVAS_OBJECT_CLASS);
|
2017-07-19 22:04:10 -07:00
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
// Properly destroy depending on the object being legacy or not
|
|
|
|
if (pd->legacy.ctor) evas_object_del(obj);
|
|
|
|
else efl_del(obj);
|
|
|
|
}
|
2017-07-19 22:04:10 -07:00
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
// We are now potentially only facing zombies
|
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
|
|
|
{
|
|
|
|
evas_layer_pre_free(lay);
|
|
|
|
EINA_INLIST_FOREACH(lay->objects, o)
|
2017-07-19 22:04:10 -07:00
|
|
|
{
|
2018-05-09 20:01:17 -07:00
|
|
|
if (!o->delete_me)
|
|
|
|
eina_array_push(&stash, o->object);
|
2013-07-10 21:45:22 -07:00
|
|
|
}
|
2003-01-09 21:38:47 -08:00
|
|
|
}
|
2018-05-09 20:01:17 -07:00
|
|
|
|
|
|
|
// Killing zombies now
|
|
|
|
while ((obj = eina_array_pop(&stash)))
|
|
|
|
{
|
2018-05-12 22:20:04 -07:00
|
|
|
Forced_Death force = {
|
|
|
|
efl_invalidated_get(obj),
|
2018-05-29 09:24:36 -07:00
|
|
|
efl_parent_get(obj) ? (efl_ref_count(obj) <= 1) : (efl_ref_count(obj) <= 0),
|
2018-05-12 22:20:04 -07:00
|
|
|
EINA_FALSE
|
|
|
|
};
|
|
|
|
|
|
|
|
efl_event_callback_array_add(obj, _object_forced_death(), &force);
|
|
|
|
|
|
|
|
ERR("Killing Zombie Object [%s:%i:%i]. Refs: %i:%i",
|
|
|
|
efl_debug_name_get(obj), force.invalidated, force.noref,
|
|
|
|
efl_ref_count(obj), ___efl_ref2_count(obj));
|
2018-05-09 20:01:17 -07:00
|
|
|
___efl_ref2_reset(obj);
|
|
|
|
// This code explicitely bypass all refcounting to destroy them
|
2018-05-12 22:20:04 -07:00
|
|
|
if (!force.invalidated) efl_del(obj);
|
|
|
|
while (!force.destroyed) efl_unref(obj);
|
|
|
|
|
|
|
|
if (!force.invalidated)
|
|
|
|
{
|
|
|
|
ERR("Zombie Object [%s] %s@%p could not be invalidated. "
|
|
|
|
"It seems like the call to efl_invalidated() wasn't "
|
|
|
|
"propagated to all the parent classes.",
|
|
|
|
efl_debug_name_get(obj), efl_class_name_get(obj), obj);
|
|
|
|
}
|
|
|
|
if (!force.destroyed)
|
|
|
|
{
|
|
|
|
ERR("Zombie Object [%s] %s@%p could not be destroyed. "
|
|
|
|
"It seems like the call to efl_destructor() wasn't "
|
|
|
|
"propagated to all the parent classes.",
|
|
|
|
efl_debug_name_get(obj), efl_class_name_get(obj), obj);
|
|
|
|
}
|
2018-05-09 20:01:17 -07:00
|
|
|
|
|
|
|
// Forcefully remove the object from layers
|
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
|
|
|
EINA_INLIST_FOREACH(lay->objects, o)
|
|
|
|
if (o && (o->object == obj))
|
|
|
|
{
|
|
|
|
ERR("Zombie Object [%s] %s@%p could not be removed "
|
2018-05-12 22:20:04 -07:00
|
|
|
"from the canvas list of objects. Maybe this object "
|
2018-05-09 20:01:17 -07:00
|
|
|
"was deleted but the call to efl_invalidated() "
|
|
|
|
"was not propagated to all the parent classes? "
|
|
|
|
"Forcibly removing it. This may leak! Refs: %i:%i",
|
|
|
|
efl_debug_name_get(obj), efl_class_name_get(obj), obj,
|
|
|
|
efl_ref_count(obj), ___efl_ref2_count(obj));
|
|
|
|
lay->objects = (Evas_Object_Protected_Data *)
|
|
|
|
eina_inlist_remove(EINA_INLIST_GET(lay->objects), EINA_INLIST_GET(o));
|
|
|
|
goto next_zombie;
|
|
|
|
}
|
|
|
|
|
|
|
|
next_zombie:
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
eina_array_flush(&stash);
|
|
|
|
|
|
|
|
// Destroying layers and their associated objects completely
|
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);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_layer_clean(eo_e);
|
2009-06-15 07:25:21 -07:00
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
efl_invalidate(efl_super(eo_e, MY_CLASS));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
Eina_Rectangle *r;
|
|
|
|
Evas_Coord_Touch_Point *touch_point;
|
|
|
|
Evas_Post_Render_Job *job;
|
|
|
|
Evas_Layer *lay;
|
|
|
|
Efl_Canvas_Output *evo;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (e->layers)
|
|
|
|
{
|
|
|
|
// This should never happen as during invalidate we explicitely
|
|
|
|
// destroy all layers. If they survive, we have a zombie appocallypse.
|
|
|
|
Evas_Object_Protected_Data *o;
|
|
|
|
|
|
|
|
CRI("The layers of %p are not empty !", eo_e);
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
|
|
|
EINA_INLIST_FOREACH(lay->objects, o)
|
|
|
|
{
|
|
|
|
CRI("Zombie object [%s] %s@%p still present.",
|
|
|
|
efl_debug_name_get(o->object), efl_class_name_get(o->object), o->object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_font_path_clear(eo_e);
|
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)
|
2013-07-10 21:45:22 -07:00
|
|
|
eina_rectangle_free(r);
|
2009-04-14 02:48:31 -07:00
|
|
|
EINA_LIST_FREE(e->obscures, r)
|
2013-07-10 21:45:22 -07:00
|
|
|
eina_rectangle_free(r);
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2017-11-06 18:22:09 -08:00
|
|
|
evas_fonts_zero_free();
|
2013-07-10 21:45:22 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_all_del(eo_e);
|
|
|
|
evas_event_callback_cleanup(eo_e);
|
2008-10-31 03:46:46 -07:00
|
|
|
|
2017-08-25 10:52:22 -07:00
|
|
|
EINA_LIST_FREE(e->touch_points, touch_point)
|
|
|
|
free(touch_point);
|
|
|
|
|
|
|
|
_evas_device_cleanup(eo_e);
|
|
|
|
e->focused_by = eina_list_free(e->focused_by);
|
|
|
|
|
|
|
|
while (e->seats)
|
|
|
|
{
|
|
|
|
Evas_Pointer_Seat *pseat = EINA_INLIST_CONTAINER_GET(e->seats, Evas_Pointer_Seat);
|
|
|
|
|
|
|
|
eina_list_free(pseat->object.in);
|
|
|
|
while (pseat->pointers)
|
|
|
|
{
|
|
|
|
Evas_Pointer_Data *pdata = EINA_INLIST_CONTAINER_GET(pseat->pointers, Evas_Pointer_Data);
|
|
|
|
pseat->pointers = eina_inlist_remove(pseat->pointers, pseat->pointers);
|
|
|
|
free(pdata);
|
|
|
|
}
|
|
|
|
e->seats = eina_inlist_remove(e->seats, e->seats);
|
|
|
|
free(pseat);
|
|
|
|
}
|
|
|
|
|
2017-08-25 10:52:10 -07:00
|
|
|
/* Ector surface may require an existing output to finish its job */
|
2018-02-05 05:19:44 -08:00
|
|
|
if (e->engine.func)
|
|
|
|
e->engine.func->ector_destroy(_evas_engine_context(e), e->ector);
|
2017-08-25 10:49:53 -07:00
|
|
|
/* cleanup engine backend */
|
2017-04-13 15:25:29 -07:00
|
|
|
EINA_LIST_FREE(e->outputs, evo) efl_canvas_output_del(evo);
|
2018-02-05 05:19:44 -08:00
|
|
|
if (e->engine.func)
|
|
|
|
e->engine.func->engine_free(e->backend);
|
2013-07-10 21:45:22 -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);
|
2016-11-25 21:25:41 -08:00
|
|
|
eina_inarray_flush(&e->active_objects);
|
2008-10-16 05:27:07 -07:00
|
|
|
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);
|
2015-05-09 11:02:13 -07:00
|
|
|
eina_array_flush(&e->snapshot_objects);
|
2009-04-15 06:40:37 -07:00
|
|
|
eina_array_flush(&e->clip_changes);
|
2013-01-17 14:14:05 -08:00
|
|
|
eina_array_flush(&e->scie_unref_queue);
|
2013-01-11 11:54:12 -08:00
|
|
|
eina_array_flush(&e->image_unref_queue);
|
2013-01-11 11:55:40 -08:00
|
|
|
eina_array_flush(&e->glyph_unref_queue);
|
2013-01-15 09:35:11 -08:00
|
|
|
eina_array_flush(&e->texts_unref_queue);
|
2016-10-19 06:02:18 -07:00
|
|
|
eina_hash_free(e->focused_objects);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2017-02-07 05:55:36 -08:00
|
|
|
SLKL(e->post_render.lock);
|
2016-12-22 03:46:49 -08:00
|
|
|
EINA_INLIST_FREE(e->post_render.jobs, job)
|
|
|
|
{
|
|
|
|
e->post_render.jobs = (Evas_Post_Render_Job *)
|
|
|
|
eina_inlist_remove(EINA_INLIST_GET(e->post_render.jobs), EINA_INLIST_GET(job));
|
|
|
|
free(job);
|
|
|
|
}
|
2017-02-07 05:55:36 -08:00
|
|
|
SLKU(e->post_render.lock);
|
2016-12-22 03:46:49 -08:00
|
|
|
|
2015-02-10 03:44:38 -08:00
|
|
|
eina_lock_free(&(e->lock_objects));
|
2015-09-27 10:56:28 -07:00
|
|
|
eina_spinlock_free(&(e->render.lock));
|
2016-12-22 03:46:49 -08:00
|
|
|
eina_spinlock_free(&(e->post_render.lock));
|
2016-11-07 10:44:46 -08:00
|
|
|
eina_hash_free(e->locks.masks);
|
|
|
|
eina_hash_free(e->modifiers.masks);
|
2015-02-10 03:44:38 -08:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->magic = 0;
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_destructor(efl_super(eo_e, MY_CLASS));
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2017-04-24 15:09:25 -07:00
|
|
|
// It is now expected that the first output in the list is the default one
|
|
|
|
// manipulated by this set of legacy API
|
|
|
|
|
2017-04-07 14:05:16 -07:00
|
|
|
EAPI Evas_Engine_Info *
|
|
|
|
evas_engine_info_get(const Evas *obj)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2018-02-06 00:58:44 -08:00
|
|
|
if (!obj) return NULL;
|
|
|
|
|
2017-08-25 10:54:59 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
|
2017-04-24 15:09:25 -07:00
|
|
|
Efl_Canvas_Output *output;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2017-04-24 15:09:25 -07:00
|
|
|
output = eina_list_data_get(e->outputs);
|
|
|
|
if (!output)
|
|
|
|
{
|
|
|
|
output = efl_canvas_output_add((Evas*) obj);
|
|
|
|
}
|
|
|
|
if (!output) return NULL;
|
2017-08-25 10:54:59 -07:00
|
|
|
e->output.legacy = EINA_TRUE;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2017-04-24 15:09:25 -07:00
|
|
|
return efl_canvas_output_engine_info_get(output);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2017-04-07 14:05:16 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_engine_info_set(Evas *obj, Evas_Engine_Info *info)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2018-02-06 00:58:44 -08:00
|
|
|
if (!obj) return EINA_FALSE;
|
|
|
|
|
2017-04-07 14:05:16 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
|
2017-04-24 15:09:25 -07:00
|
|
|
Efl_Canvas_Output *output;
|
2017-04-07 14:05:16 -07:00
|
|
|
|
2017-04-24 15:09:25 -07:00
|
|
|
output = eina_list_data_get(e->outputs);
|
|
|
|
if (!output) return EINA_FALSE;
|
2014-03-11 23:53:00 -07:00
|
|
|
if (!info) return EINA_FALSE;
|
2017-08-25 10:54:59 -07:00
|
|
|
efl_canvas_output_view_set(output, 0, 0,
|
|
|
|
e->output.w, e->output.h);
|
2017-04-24 15:09:25 -07:00
|
|
|
return efl_canvas_output_engine_info_set(output, info);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static Evas_Coord
|
2015-06-25 04:17:58 -07:00
|
|
|
_evas_canvas_coord_screen_x_to_world(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int x)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2014-03-11 23:53:00 -07:00
|
|
|
if (e->output.w == e->viewport.w) return e->viewport.x + x;
|
|
|
|
else return (long long)e->viewport.x + (((long long)x * (long long)e->viewport.w) / (long long)e->output.w);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static Evas_Coord
|
2015-06-25 04:17:58 -07:00
|
|
|
_evas_canvas_coord_screen_y_to_world(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int y)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2014-03-11 23:53:00 -07:00
|
|
|
if (e->output.h == e->viewport.h) return e->viewport.y + y;
|
|
|
|
else 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
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static int
|
2015-06-25 04:17:58 -07:00
|
|
|
_evas_canvas_coord_world_x_to_screen(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2014-03-11 23:53:00 -07:00
|
|
|
if (e->output.w == e->viewport.w) return x - e->viewport.x;
|
|
|
|
else return (int)((((long long)x - (long long)e->viewport.x) * (long long)e->output.w) / (long long)e->viewport.w);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static int
|
2015-06-25 04:17:58 -07:00
|
|
|
_evas_canvas_coord_world_y_to_screen(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord y)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2014-03-11 23:53:00 -07:00
|
|
|
if (e->output.h == e->viewport.h) return y - e->viewport.y;
|
|
|
|
else 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
|
|
|
}
|
|
|
|
|
2016-10-19 10:57:18 -07:00
|
|
|
EOLIAN static Efl_Input_Device *
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_default_device_get(const Eo *eo_e EINA_UNUSED,
|
2016-10-19 10:57:18 -07:00
|
|
|
Evas_Public_Data *e,
|
2017-06-11 22:56:36 -07:00
|
|
|
Efl_Input_Device_Type klass)
|
2016-10-19 10:57:18 -07:00
|
|
|
{
|
2017-06-11 22:56:36 -07:00
|
|
|
if (klass == EFL_INPUT_DEVICE_TYPE_SEAT)
|
2016-10-19 10:57:18 -07:00
|
|
|
return e->default_seat;
|
2017-06-11 22:56:36 -07:00
|
|
|
if (klass == EFL_INPUT_DEVICE_TYPE_MOUSE)
|
2016-10-19 10:57:18 -07:00
|
|
|
return e->default_mouse;
|
2017-06-11 22:56:36 -07:00
|
|
|
if (klass == EFL_INPUT_DEVICE_TYPE_KEYBOARD)
|
2016-10-19 10:57:18 -07:00
|
|
|
return e->default_keyboard;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2012-03-26 03:56:55 -07:00
|
|
|
const char *s;
|
2016-11-21 21:33:48 -08:00
|
|
|
|
2012-03-26 03:56:55 -07:00
|
|
|
EINA_LIST_FREE(list, s) eina_stringshare_del(s);
|
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);
|
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_pointer_output_xy_by_device_get(const Eo *eo_e EINA_UNUSED,
|
2016-10-21 05:25:41 -07:00
|
|
|
Evas_Public_Data *e,
|
|
|
|
Efl_Input_Device *dev,
|
|
|
|
int *x, int *y)
|
|
|
|
{
|
|
|
|
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
|
|
|
|
|
|
|
|
if (!pdata)
|
|
|
|
{
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-06-02 15:23:45 -07:00
|
|
|
if (x) *x = pdata->seat->x;
|
|
|
|
if (y) *y = pdata->seat->y;
|
2016-10-21 05:25:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_pointer_canvas_xy_by_device_get(const Eo *eo_e EINA_UNUSED,
|
2016-10-21 05:25:41 -07:00
|
|
|
Evas_Public_Data *e,
|
|
|
|
Efl_Input_Device *dev,
|
|
|
|
int *x, int *y)
|
|
|
|
{
|
|
|
|
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
|
|
|
|
|
|
|
|
if (!pdata)
|
|
|
|
{
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-06-02 15:23:45 -07:00
|
|
|
if (x) *x = pdata->seat->x;
|
|
|
|
if (y) *y = pdata->seat->y;
|
2016-10-21 05:25:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static unsigned int
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_pointer_button_down_mask_by_device_get(const Eo *eo_e EINA_UNUSED,
|
2016-10-21 05:25:41 -07:00
|
|
|
Evas_Public_Data *e,
|
|
|
|
Efl_Input_Device *dev)
|
|
|
|
{
|
|
|
|
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
|
|
|
|
if (!pdata) return 0;
|
|
|
|
return pdata->button;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_efl_canvas_pointer_pointer_inside_get(const Eo *eo_e EINA_UNUSED,
|
2017-12-05 21:34:51 -08:00
|
|
|
Evas_Public_Data *e,
|
|
|
|
Efl_Input_Device *dev)
|
2016-10-21 05:25:41 -07:00
|
|
|
{
|
|
|
|
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
|
|
|
|
if (!pdata) return EINA_FALSE;
|
2017-06-02 15:23:45 -07:00
|
|
|
return pdata->seat->inside;
|
2016-10-21 05:25:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_pointer_output_xy_get(const Eo *eo_e, Evas_Public_Data *e, int *x, int *y)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-10-21 05:25:41 -07:00
|
|
|
return _evas_canvas_pointer_output_xy_by_device_get(eo_e, e, NULL, x, y);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_pointer_canvas_xy_get(const Eo *eo_e, Evas_Public_Data *e, Evas_Coord *x, Evas_Coord *y)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-10-21 05:25:41 -07:00
|
|
|
return _evas_canvas_pointer_canvas_xy_by_device_get(eo_e, e, NULL, x, y);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2016-06-06 16:33:54 -07:00
|
|
|
EOLIAN static unsigned int
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_pointer_button_down_mask_get(const Eo *eo_e, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-10-21 05:25:41 -07:00
|
|
|
return _evas_canvas_pointer_button_down_mask_by_device_get(eo_e, e, NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-11-06 01:47:28 -08:00
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_data_attach_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, void *data)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2005-11-06 01:47:28 -08:00
|
|
|
e->attach_data = data;
|
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static void*
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_data_attach_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2005-11-06 01:47:28 -08:00
|
|
|
{
|
2014-03-11 23:53:00 -07:00
|
|
|
return e->attach_data;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2016-11-17 11:30:58 -08:00
|
|
|
static void
|
2016-11-03 07:07:40 -07:00
|
|
|
_evas_canvas_focus_inout_dispatch(Eo *eo_e, Efl_Input_Device *seat,
|
|
|
|
Eina_Bool in)
|
2016-11-17 11:30:58 -08:00
|
|
|
{
|
|
|
|
Efl_Input_Focus_Data *ev_data;
|
|
|
|
Efl_Input_Focus *evt;
|
|
|
|
|
|
|
|
evt = efl_input_instance_get(EFL_INPUT_FOCUS_CLASS, eo_e, (void **) &ev_data);
|
|
|
|
if (!evt) return;
|
|
|
|
|
2016-11-03 07:07:40 -07:00
|
|
|
ev_data->device = efl_ref(seat);
|
2016-11-17 11:30:58 -08:00
|
|
|
ev_data->timestamp = time(NULL);
|
|
|
|
efl_event_callback_call(eo_e,
|
|
|
|
in ? EFL_EVENT_FOCUS_IN : EFL_EVENT_FOCUS_OUT,
|
|
|
|
evt);
|
2018-05-04 13:00:53 -07:00
|
|
|
efl_unref(evt);
|
2016-11-17 11:30:58 -08:00
|
|
|
}
|
|
|
|
|
2016-11-03 07:07:40 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_seat_focus_in(Eo *eo_e, Evas_Public_Data *e,
|
|
|
|
Efl_Input_Device *seat)
|
|
|
|
{
|
|
|
|
if (!seat) seat = e->default_seat;
|
2017-06-11 22:56:36 -07:00
|
|
|
if (!seat || efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return;
|
2016-11-03 07:07:40 -07:00
|
|
|
_evas_canvas_focus_inout_dispatch(eo_e, seat, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_seat_focus_out(Eo *eo_e, Evas_Public_Data *e,
|
|
|
|
Efl_Input_Device *seat)
|
|
|
|
{
|
|
|
|
if (!seat) seat = e->default_seat;
|
2017-06-11 22:56:36 -07:00
|
|
|
if (!seat || efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return;
|
2016-11-03 07:07:40 -07:00
|
|
|
_evas_canvas_focus_inout_dispatch(eo_e, seat, EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_focus_in(Eo *eo_e, Evas_Public_Data *e)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-11-03 07:07:40 -07:00
|
|
|
_evas_canvas_seat_focus_in(eo_e, e, NULL);
|
2010-01-31 20:26:55 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_focus_out(Eo *eo_e, Evas_Public_Data *e)
|
2010-01-31 20:26:55 -08:00
|
|
|
{
|
2016-11-03 07:07:40 -07:00
|
|
|
_evas_canvas_seat_focus_out(eo_e, e, NULL);
|
2010-01-31 20:26:55 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_seat_focus_state_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
|
2016-11-01 11:30:26 -07:00
|
|
|
Efl_Input_Device *seat)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-11-01 11:30:26 -07:00
|
|
|
if (!seat) seat = e->default_seat;
|
|
|
|
return eina_list_data_find(e->focused_by, seat) ? EINA_TRUE : EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_focus_state_get(const Eo *eo_e, Evas_Public_Data *e)
|
2016-11-01 11:30:26 -07:00
|
|
|
{
|
|
|
|
return _evas_canvas_seat_focus_state_get(eo_e, e, NULL);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2014-08-01 21:15:59 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_changed_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2014-08-01 21:15:59 -07:00
|
|
|
{
|
|
|
|
return e->changed;
|
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_nochange_push(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2010-09-02 17:06:56 -07:00
|
|
|
{
|
|
|
|
e->nochange++;
|
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN static void
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_nochange_pop(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2010-09-02 17:06:56 -07:00
|
|
|
{
|
|
|
|
e->nochange--;
|
|
|
|
}
|
|
|
|
|
2007-04-29 21:22:42 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_walk(Evas_Public_Data *e)
|
2007-04-29 21:22:42 -07:00
|
|
|
{
|
2018-05-10 14:28:04 -07:00
|
|
|
efl_ref(e->evas);
|
2007-04-29 21:22:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_unwalk(Evas_Public_Data *e)
|
2007-04-29 21:22:42 -07:00
|
|
|
{
|
2018-05-10 14:28:04 -07:00
|
|
|
efl_unref(e->evas);
|
2007-04-29 21:22:42 -07:00
|
|
|
}
|
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);
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2016-06-20 23:45:31 -07:00
|
|
|
EOLIAN static Eo *
|
2018-01-04 11:41:49 -08:00
|
|
|
_evas_canvas_efl_object_provider_find(const Eo *eo_e,
|
|
|
|
Evas_Public_Data *e EINA_UNUSED,
|
|
|
|
const Efl_Class *klass)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-06-20 23:45:31 -07:00
|
|
|
if (klass == EVAS_CANVAS_CLASS)
|
2018-01-06 01:58:13 -08:00
|
|
|
return (Eo *)eo_e;
|
2016-10-05 03:51:42 -07:00
|
|
|
else if (klass == EFL_LOOP_CLASS)
|
2018-02-26 21:10:12 -08:00
|
|
|
return efl_main_loop_get();
|
2018-02-21 11:20:09 -08:00
|
|
|
else if (klass == EFL_CANVAS_GESTURE_MANAGER_CLASS)
|
2017-09-21 21:46:39 -07:00
|
|
|
return e->gesture_manager;
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_provider_find(efl_super(eo_e, MY_CLASS), klass);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2016-12-12 20:38:16 -08:00
|
|
|
EOLIAN static Efl_Loop *
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_efl_loop_consumer_loop_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e EINA_UNUSED)
|
2016-12-12 20:38:16 -08:00
|
|
|
{
|
2018-02-26 21:10:12 -08:00
|
|
|
return efl_main_loop_get();
|
2016-12-12 20:38:16 -08:00
|
|
|
}
|
|
|
|
|
2015-08-24 23:32:35 -07:00
|
|
|
Ector_Surface *
|
2017-08-25 10:52:10 -07:00
|
|
|
evas_ector_get(Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
if (!e->ector)
|
|
|
|
e->ector = e->engine.func->ector_create(_evas_engine_context(e));
|
|
|
|
return e->ector;
|
2015-08-24 23:32:35 -07:00
|
|
|
}
|
|
|
|
|
2017-06-13 03:15:12 -07:00
|
|
|
EAPI Evas_BiDi_Direction
|
|
|
|
evas_language_direction_get(void)
|
|
|
|
{
|
|
|
|
return evas_common_language_direction_get();
|
|
|
|
}
|
|
|
|
|
2016-04-08 03:17:51 -07:00
|
|
|
EAPI void
|
|
|
|
evas_language_reinit(void)
|
|
|
|
{
|
|
|
|
evas_common_language_reinit();
|
|
|
|
}
|
|
|
|
|
2016-05-05 07:45:04 -07:00
|
|
|
static void
|
|
|
|
_image_data_unset(Evas_Object_Protected_Data *obj, Eina_List **list)
|
|
|
|
{
|
|
|
|
if (obj->is_smart)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj2;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj->object), obj2)
|
|
|
|
_image_data_unset(obj2, list);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#define CHECK(TYPE, STRUCT, FREE) \
|
2016-08-15 06:44:41 -07:00
|
|
|
if (efl_isa(obj->object, TYPE))\
|
2016-05-05 07:45:04 -07:00
|
|
|
{\
|
2016-08-15 06:44:41 -07:00
|
|
|
STRUCT *data = efl_data_scope_get(obj->object, TYPE);\
|
2016-05-05 07:45:04 -07:00
|
|
|
FREE; \
|
|
|
|
data->engine_data = NULL;\
|
|
|
|
}
|
2016-06-09 01:30:05 -07:00
|
|
|
CHECK(EFL_CANVAS_IMAGE_INTERNAL_CLASS, Evas_Image_Data,
|
2017-08-25 10:51:10 -07:00
|
|
|
ENFN->image_free(ENC, data->engine_data))
|
2016-05-05 07:45:04 -07:00
|
|
|
else CHECK(EFL_CANVAS_POLYGON_CLASS, Efl_Canvas_Polygon_Data,
|
|
|
|
data->engine_data =
|
2017-04-24 15:09:25 -07:00
|
|
|
obj->layer->evas->engine.func->polygon_points_clear(ENC,
|
2016-05-05 07:45:04 -07:00
|
|
|
data->engine_data))
|
|
|
|
else CHECK(EVAS_CANVAS3D_TEXTURE_CLASS, Evas_Canvas3D_Texture_Data,
|
|
|
|
if (obj->layer->evas->engine.func->texture_free)
|
2017-04-24 15:09:25 -07:00
|
|
|
obj->layer->evas->engine.func->texture_free(ENC, data->engine_data))
|
2016-05-05 07:45:04 -07:00
|
|
|
else return;
|
|
|
|
#undef CHECK
|
|
|
|
evas_object_ref(obj->object);
|
|
|
|
*list = eina_list_append(*list, obj->object);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_List *
|
|
|
|
_evas_canvas_image_data_unset(Evas *eo_e)
|
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, MY_CLASS);
|
2016-05-05 07:45:04 -07:00
|
|
|
Evas_Layer *lay;
|
|
|
|
Eina_List *list = NULL;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *o;
|
|
|
|
EINA_INLIST_FOREACH(lay->objects, o)
|
|
|
|
{
|
|
|
|
if (!o->delete_me)
|
|
|
|
_image_data_unset(o, &list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_image_image_data_regenerate(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *data)
|
|
|
|
{
|
|
|
|
unsigned int orient = data->cur->orient;
|
|
|
|
|
|
|
|
_evas_image_load(eo_obj, obj, data);
|
|
|
|
EINA_COW_IMAGE_STATE_WRITE_BEGIN(data, state_write)
|
|
|
|
{
|
|
|
|
state_write->has_alpha = !state_write->has_alpha;
|
|
|
|
state_write->orient = -1;
|
|
|
|
}
|
|
|
|
EINA_COW_IMAGE_STATE_WRITE_END(data, state_write);
|
|
|
|
evas_object_image_alpha_set(eo_obj, !data->cur->has_alpha);
|
|
|
|
_evas_image_orientation_set(eo_obj, data, orient);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_image_data_regenerate(Evas_Object *eo_obj)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2016-05-05 07:45:04 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
#define CHECK(TYPE, STRUCT, REGEN) \
|
2016-08-15 06:44:41 -07:00
|
|
|
if (efl_isa(eo_obj, TYPE))\
|
2016-05-05 07:45:04 -07:00
|
|
|
{\
|
2016-08-15 06:44:41 -07:00
|
|
|
STRUCT *data = efl_data_scope_get(eo_obj, TYPE);\
|
2016-05-05 07:45:04 -07:00
|
|
|
REGEN; \
|
|
|
|
}
|
2016-06-09 01:30:05 -07:00
|
|
|
CHECK(EFL_CANVAS_IMAGE_INTERNAL_CLASS, Evas_Image_Data, _image_image_data_regenerate(eo_obj, obj, data))
|
2016-05-05 07:45:04 -07:00
|
|
|
else CHECK(EFL_CANVAS_IMAGE_CLASS, Evas_Image_Data, _image_image_data_regenerate(eo_obj, obj, data))
|
|
|
|
else CHECK(EFL_CANVAS_SCENE3D_CLASS, Evas_Image_Data, _image_image_data_regenerate(eo_obj, obj, data))
|
2018-09-07 04:58:19 -07:00
|
|
|
//else CHECK(EFL_CANVAS_VG_OBJECT_CLASS, Efl_Canvas_Vg_Data,)
|
2016-05-05 07:45:04 -07:00
|
|
|
//else CHECK(EFL_CANVAS_POLYGON_CLASS, Efl_Canvas_Polygon_Data,)
|
|
|
|
//else CHECK(EVAS_CANVAS3D_TEXTURE_CLASS, Evas_Canvas3D_Texture_Data,
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
_evas_canvas_image_data_regenerate(Eina_List *list)
|
|
|
|
{
|
|
|
|
Evas_Object *eo_obj;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(list, eo_obj)
|
|
|
|
{
|
|
|
|
_image_data_regenerate(eo_obj);
|
|
|
|
evas_object_unref(eo_obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:51 -08:00
|
|
|
|
|
|
|
EOLIAN void
|
|
|
|
_evas_canvas_image_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
evas_render_rendering_wait(e);
|
|
|
|
if (_evas_engine_context(e))
|
|
|
|
e->engine.func->image_cache_flush(_evas_engine_context(e));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN void
|
|
|
|
_evas_canvas_image_cache_reload(Eo *eo_e, Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
Evas_Layer *layer;
|
|
|
|
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
evas_image_cache_flush(eo_e);
|
|
|
|
EINA_INLIST_FOREACH(e->layers, layer)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
|
|
|
layer->walking_objects++;
|
|
|
|
EINA_INLIST_FOREACH(layer->objects, obj)
|
|
|
|
{
|
|
|
|
if (efl_isa(obj->object, MY_CLASS))
|
|
|
|
{
|
|
|
|
_evas_image_unload(obj->object, obj, 1);
|
|
|
|
evas_object_inform_call_image_unloaded(obj->object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
layer->walking_objects--;
|
|
|
|
_evas_layer_flush_removes(layer);
|
|
|
|
}
|
|
|
|
evas_image_cache_flush(eo_e);
|
|
|
|
EINA_INLIST_FOREACH(e->layers, layer)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
|
|
|
layer->walking_objects++;
|
|
|
|
EINA_INLIST_FOREACH(layer->objects, obj)
|
|
|
|
{
|
|
|
|
if (efl_isa(obj->object, MY_CLASS))
|
|
|
|
{
|
|
|
|
Evas_Image_Data *o = efl_data_scope_get(obj->object, MY_CLASS);
|
|
|
|
_evas_image_load(obj->object, obj, o);
|
|
|
|
o->changed = EINA_TRUE;
|
|
|
|
evas_object_change(obj->object, obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
layer->walking_objects--;
|
|
|
|
_evas_layer_flush_removes(layer);
|
|
|
|
}
|
|
|
|
evas_image_cache_flush(eo_e);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_image_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size)
|
|
|
|
{
|
|
|
|
if (size < 0) size = 0;
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
evas_render_rendering_wait(e);
|
|
|
|
if (_evas_engine_context(e))
|
|
|
|
e->engine.func->image_cache_set(_evas_engine_context(e), size);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static int
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_image_cache_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2018-02-14 18:14:51 -08:00
|
|
|
{
|
|
|
|
if (_evas_engine_context(e))
|
|
|
|
return e->engine.func->image_cache_get(_evas_engine_context(e));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2018-03-26 06:21:21 -07:00
|
|
|
_evas_canvas_efl_canvas_scene_image_max_size_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Size2D *max)
|
2018-02-14 18:14:51 -08:00
|
|
|
{
|
|
|
|
int w = 0, h = 0;
|
|
|
|
|
|
|
|
if (max) *max = EINA_SIZE2D(0xffff, 0xffff);
|
|
|
|
if (!e->engine.func->image_max_size_get) return EINA_FALSE;
|
|
|
|
if (!max) return EINA_TRUE;
|
|
|
|
e->engine.func->image_max_size_get(_evas_engine_context(e), &w, &h);
|
|
|
|
*max = EINA_SIZE2D(w, h);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2016-06-13 03:20:11 -07:00
|
|
|
/* Legacy deprecated functions */
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_output_framespace_set(Evas *eo_e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2016-06-13 03:20:11 -07:00
|
|
|
|
|
|
|
if ((x == e->framespace.x) && (y == e->framespace.y) &&
|
|
|
|
(w == e->framespace.w) && (h == e->framespace.h)) return;
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
e->framespace.x = x;
|
|
|
|
e->framespace.y = y;
|
|
|
|
e->framespace.w = w;
|
|
|
|
e->framespace.h = h;
|
|
|
|
e->framespace.changed = 1;
|
|
|
|
e->output_validity++;
|
|
|
|
e->changed = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_output_framespace_get(const Evas *eo_e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2016-06-13 03:20:11 -07:00
|
|
|
|
|
|
|
if (x) *x = e->framespace.x;
|
|
|
|
if (y) *y = e->framespace.y;
|
|
|
|
if (w) *w = e->framespace.w;
|
|
|
|
if (h) *h = e->framespace.h;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_output_method_set(Evas *eo_e, int render_method)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2016-06-13 03:20:11 -07:00
|
|
|
|
|
|
|
Evas_Module *em;
|
|
|
|
|
|
|
|
/* if our engine to set it to is invalid - abort */
|
|
|
|
if (render_method == RENDER_METHOD_INVALID) return;
|
|
|
|
/* if the engine is already set up - abort */
|
|
|
|
if (e->output.render_method != RENDER_METHOD_INVALID) return;
|
|
|
|
/* 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;
|
|
|
|
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
/* 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);
|
2017-08-25 10:49:53 -07:00
|
|
|
|
|
|
|
/* Initialize the engine first */
|
|
|
|
e->backend = e->engine.func->engine_new();
|
|
|
|
|
2016-06-13 03:20:11 -07:00
|
|
|
/* get the engine info struct */
|
2017-08-25 10:48:13 -07:00
|
|
|
if (e->engine.func->info_size)
|
2017-04-24 15:09:25 -07:00
|
|
|
{
|
|
|
|
Efl_Canvas_Output *output;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(e->outputs, l, output)
|
2017-08-25 10:48:17 -07:00
|
|
|
efl_canvas_output_info_get(e, output);
|
2017-08-25 10:48:13 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CRI("Engine not up to date no info size provided.");
|
2017-04-24 15:09:25 -07:00
|
|
|
}
|
2016-10-19 10:57:18 -07:00
|
|
|
|
2017-05-26 13:34:10 -07:00
|
|
|
// Wayland/drm already handles seats.
|
2016-12-07 22:29:43 -08:00
|
|
|
if (em->definition && (eina_streq(em->definition->name, "wayland_shm") ||
|
2017-05-26 13:34:10 -07:00
|
|
|
eina_streq(em->definition->name, "wayland_egl") ||
|
|
|
|
eina_streq(em->definition->name, "drm") ||
|
|
|
|
eina_streq(em->definition->name, "gl_drm")))
|
2017-06-16 12:03:09 -07:00
|
|
|
{
|
|
|
|
Evas_Pointer_Seat *pseat = calloc(1, sizeof(Evas_Pointer_Seat));
|
|
|
|
e->seats = eina_inlist_append(e->seats, EINA_INLIST_GET(pseat));
|
|
|
|
return;
|
|
|
|
}
|
2016-10-19 10:57:18 -07:00
|
|
|
|
2018-08-27 00:17:13 -07:00
|
|
|
e->default_seat = evas_device_add_full(eo_e, "default", "The default seat",
|
|
|
|
NULL, NULL, EVAS_DEVICE_CLASS_SEAT,
|
|
|
|
EVAS_DEVICE_SUBCLASS_NONE);
|
2017-05-17 13:02:53 -07:00
|
|
|
evas_device_seat_id_set(e->default_seat, 1);
|
2018-08-27 00:17:13 -07:00
|
|
|
e->default_mouse = evas_device_add_full(eo_e, "Mouse",
|
|
|
|
"The default mouse",
|
|
|
|
e->default_seat, NULL,
|
|
|
|
EVAS_DEVICE_CLASS_MOUSE,
|
|
|
|
EVAS_DEVICE_SUBCLASS_NONE);
|
|
|
|
e->default_keyboard = evas_device_add_full(eo_e, "Keyboard",
|
|
|
|
"The default keyboard",
|
|
|
|
e->default_seat, NULL,
|
|
|
|
EVAS_DEVICE_CLASS_KEYBOARD,
|
|
|
|
EVAS_DEVICE_SUBCLASS_NONE);
|
2016-06-13 03:20:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
evas_output_method_get(const Evas *eo_e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return RENDER_METHOD_INVALID;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2016-06-13 03:20:11 -07:00
|
|
|
|
|
|
|
return e->output.render_method;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_output_size_set(Evas *eo_e, int w, int h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2016-06-13 03:20:11 -07:00
|
|
|
|
|
|
|
if ((w == e->output.w) && (h == e->output.h)) return;
|
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
|
|
|
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
e->output.w = w;
|
|
|
|
e->output.h = h;
|
|
|
|
e->output_validity++;
|
|
|
|
e->changed = 1;
|
2017-08-25 10:54:59 -07:00
|
|
|
|
|
|
|
if (e->output.legacy)
|
|
|
|
{
|
|
|
|
Efl_Canvas_Output *output;
|
|
|
|
|
|
|
|
output = eina_list_data_get(e->outputs);
|
|
|
|
efl_canvas_output_view_set(output, 0, 0, w, h);
|
|
|
|
}
|
|
|
|
|
2016-06-13 03:20:11 -07:00
|
|
|
evas_render_invalidate(eo_e);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_output_size_get(const Evas *eo_e, int *w, int *h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2016-06-13 03:20:11 -07:00
|
|
|
|
|
|
|
if (w) *w = e->output.w;
|
|
|
|
if (h) *h = e->output.h;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_output_viewport_set(Evas *eo_e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2016-06-13 03:20:11 -07: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;
|
|
|
|
if ((x != 0) || (y != 0))
|
|
|
|
{
|
|
|
|
ERR("Compat error. viewport x,y != 0,0 not supported");
|
|
|
|
x = 0;
|
|
|
|
y = 0;
|
|
|
|
}
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
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;
|
|
|
|
evas_event_callback_call(e->evas, EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_output_viewport_get(const Evas *eo_e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
2016-06-13 03:20:11 -07: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;
|
|
|
|
}
|
|
|
|
|
2016-10-21 05:25:41 -07:00
|
|
|
Evas_Pointer_Data *
|
|
|
|
_evas_pointer_data_by_device_get(Evas_Public_Data *edata, Efl_Input_Device *pointer)
|
|
|
|
{
|
|
|
|
Evas_Pointer_Data *pdata;
|
2017-06-16 12:03:09 -07:00
|
|
|
Evas_Pointer_Seat *pseat;
|
|
|
|
Eo *seat;
|
2016-10-21 05:25:41 -07:00
|
|
|
|
2017-06-16 12:03:09 -07:00
|
|
|
if (!pointer)
|
|
|
|
pointer = edata->default_mouse;
|
|
|
|
if (!pointer) return NULL;
|
|
|
|
seat = efl_input_device_seat_get(pointer);
|
|
|
|
if (!seat) return NULL;
|
2016-10-21 05:25:41 -07:00
|
|
|
|
2017-06-16 12:03:09 -07:00
|
|
|
EINA_INLIST_FOREACH(edata->seats, pseat)
|
|
|
|
EINA_INLIST_FOREACH(pseat->pointers, pdata)
|
|
|
|
{
|
|
|
|
if (pointer == seat)
|
|
|
|
{
|
|
|
|
if (pseat->seat == seat) return pdata;
|
|
|
|
}
|
|
|
|
else if (pdata->pointer == pointer) return pdata;
|
|
|
|
}
|
2016-10-21 05:25:41 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2017-06-16 12:03:09 -07:00
|
|
|
Evas_Pointer_Data *
|
2016-10-21 05:25:41 -07:00
|
|
|
_evas_pointer_data_add(Evas_Public_Data *edata, Efl_Input_Device *pointer)
|
|
|
|
{
|
|
|
|
Evas_Pointer_Data *pdata;
|
2017-06-02 15:23:45 -07:00
|
|
|
Evas_Pointer_Seat *pseat = NULL;
|
|
|
|
Eo *seat;
|
2016-10-21 05:25:41 -07:00
|
|
|
|
2017-06-02 15:23:45 -07:00
|
|
|
seat = efl_input_device_seat_get(pointer);
|
2017-06-16 12:03:09 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
|
2017-06-16 12:03:09 -07:00
|
|
|
EINA_INLIST_FOREACH(edata->seats, pseat)
|
|
|
|
if (pseat->seat == seat) break;
|
2017-06-02 15:23:45 -07:00
|
|
|
if (!pseat)
|
|
|
|
{
|
|
|
|
pseat = calloc(1, sizeof(Evas_Pointer_Seat));
|
2017-06-16 12:03:09 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pseat, NULL);
|
2017-06-02 15:23:45 -07:00
|
|
|
pseat->seat = seat;
|
2017-06-16 12:03:09 -07:00
|
|
|
edata->seats = eina_inlist_append(edata->seats, EINA_INLIST_GET(pseat));
|
2017-06-02 15:23:45 -07:00
|
|
|
}
|
2016-10-21 05:25:41 -07:00
|
|
|
pdata = calloc(1, sizeof(Evas_Pointer_Data));
|
2017-06-02 15:23:45 -07:00
|
|
|
if (!pdata)
|
|
|
|
{
|
2017-06-16 12:03:09 -07:00
|
|
|
if (!pseat->pointers)
|
|
|
|
{
|
|
|
|
edata->seats = eina_inlist_remove(edata->seats, EINA_INLIST_GET(pseat));
|
|
|
|
free(pseat);
|
|
|
|
}
|
2017-06-02 15:23:45 -07:00
|
|
|
ERR("alloc fail");
|
2017-06-16 12:03:09 -07:00
|
|
|
return NULL;
|
2017-06-02 15:23:45 -07:00
|
|
|
}
|
2016-10-21 05:25:41 -07:00
|
|
|
|
|
|
|
pdata->pointer = pointer;
|
2017-06-02 15:23:45 -07:00
|
|
|
pdata->seat = pseat;
|
2017-06-16 12:03:09 -07:00
|
|
|
pseat->pointers = eina_inlist_append(pseat->pointers, EINA_INLIST_GET(pdata));
|
2017-06-16 12:03:09 -07:00
|
|
|
return pdata;
|
2016-10-21 05:25:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer)
|
|
|
|
{
|
|
|
|
Evas_Pointer_Data *pdata;
|
2017-06-16 12:03:09 -07:00
|
|
|
Evas_Pointer_Seat *pseat;
|
2018-05-18 10:46:36 -07:00
|
|
|
Evas_Pointer_Seat *hit = NULL;
|
2016-10-21 05:25:41 -07:00
|
|
|
|
2017-06-16 12:03:09 -07:00
|
|
|
EINA_INLIST_FOREACH(edata->seats, pseat)
|
2016-10-21 05:25:41 -07:00
|
|
|
{
|
2017-06-16 12:03:09 -07:00
|
|
|
EINA_INLIST_FOREACH(pseat->pointers, pdata)
|
|
|
|
if (pdata->pointer == pointer)
|
|
|
|
{
|
|
|
|
pseat->pointers = eina_inlist_remove(pseat->pointers, EINA_INLIST_GET(pdata));
|
|
|
|
free(pdata);
|
2018-05-18 10:46:36 -07:00
|
|
|
hit = pseat;
|
2017-06-16 12:03:09 -07:00
|
|
|
break;
|
|
|
|
}
|
2016-10-21 05:25:41 -07:00
|
|
|
}
|
2018-05-18 10:46:36 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(hit);
|
|
|
|
if (hit->pointers) return;
|
|
|
|
eina_list_free(hit->object.in);
|
|
|
|
edata->seats = eina_inlist_remove(edata->seats, EINA_INLIST_GET(hit));
|
|
|
|
free(hit);
|
2016-10-21 05:25:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
Eina_List *
|
|
|
|
_evas_pointer_list_in_rect_get(Evas_Public_Data *edata, Evas_Object *obj,
|
|
|
|
Evas_Object_Protected_Data *obj_data,
|
|
|
|
int w, int h)
|
|
|
|
{
|
2017-06-16 12:03:09 -07:00
|
|
|
Eina_List *list = NULL;
|
|
|
|
Evas_Pointer_Seat *pseat;
|
2016-10-21 05:25:41 -07:00
|
|
|
|
2017-06-16 12:03:09 -07:00
|
|
|
EINA_INLIST_FOREACH(edata->seats, pseat)
|
2016-10-21 05:25:41 -07:00
|
|
|
{
|
2017-06-16 12:03:09 -07:00
|
|
|
Evas_Pointer_Data *pdata;
|
|
|
|
if (!evas_object_is_in_output_rect(obj, obj_data, pseat->x, pseat->y, w, h)) continue;
|
|
|
|
pdata = EINA_INLIST_CONTAINER_GET(pseat->pointers, Evas_Pointer_Data);
|
|
|
|
if (pdata)
|
2016-10-21 05:25:41 -07:00
|
|
|
list = eina_list_append(list, pdata);
|
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
static Eina_Inlist *
|
|
|
|
get_layer_objects(Evas_Layer *l)
|
|
|
|
{
|
|
|
|
if ((!l) || (!l->objects)) return NULL;
|
|
|
|
return (EINA_INLIST_GET(l->objects));
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
typedef struct _Efl_Canvas_Iterator
|
|
|
|
{
|
|
|
|
Eina_Iterator iterator;
|
|
|
|
Eina_List *list;
|
|
|
|
Eina_Iterator *real_iterator;
|
|
|
|
Eo *object;
|
|
|
|
} Efl_Canvas_Iterator;
|
|
|
|
|
|
|
|
/* this iterator is the same as efl_ui_box */
|
|
|
|
static Eina_Bool
|
|
|
|
_efl_canvas_iterator_next(Efl_Canvas_Iterator *it, void **data)
|
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
Efl_Gfx_Entity *sub;
|
2018-02-14 18:14:52 -08:00
|
|
|
|
|
|
|
if (!it->object) return EINA_FALSE;
|
|
|
|
if (!eina_iterator_next(it->real_iterator, (void **) &sub))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
if (data) *data = sub;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eo *
|
|
|
|
_efl_canvas_iterator_get_container(Efl_Canvas_Iterator *it)
|
|
|
|
{
|
|
|
|
return it->object;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_efl_canvas_iterator_free(Efl_Canvas_Iterator *it)
|
|
|
|
{
|
|
|
|
eina_iterator_free(it->real_iterator);
|
|
|
|
efl_wref_del(it->object, &it->object);
|
|
|
|
eina_list_free(it->list);
|
|
|
|
free(it);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Iterator *
|
|
|
|
efl_canvas_iterator_create(Eo *obj, Eina_Iterator *real_iterator, Eina_List *list)
|
|
|
|
{
|
|
|
|
Efl_Canvas_Iterator *it;
|
|
|
|
|
|
|
|
it = calloc(1, sizeof(*it));
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
|
|
|
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
|
|
|
|
|
|
|
it->list = list;
|
|
|
|
it->real_iterator = real_iterator;
|
|
|
|
it->iterator.version = EINA_ITERATOR_VERSION;
|
|
|
|
it->iterator.next = FUNC_ITERATOR_NEXT(_efl_canvas_iterator_next);
|
|
|
|
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_efl_canvas_iterator_get_container);
|
|
|
|
it->iterator.free = FUNC_ITERATOR_FREE(_efl_canvas_iterator_free);
|
|
|
|
efl_wref_add(obj, &it->object);
|
|
|
|
|
|
|
|
return &it->iterator;
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EOLIAN static Evas_Object*
|
2018-03-26 06:21:21 -07:00
|
|
|
_evas_canvas_efl_canvas_scene_object_top_at_xy_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
Evas_Layer *lay;
|
|
|
|
int xx, yy;
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
xx = pos.x;
|
|
|
|
yy = pos.y;
|
2018-02-14 18:14:52 -08:00
|
|
|
//// xx = evas_coord_world_x_to_screen(eo_e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(eo_e, y);
|
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
|
|
|
{
|
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
|
|
|
eo_obj = obj->object;
|
|
|
|
if (obj->delete_me) continue;
|
|
|
|
if ((!include_pass_events_objects) &&
|
|
|
|
(evas_event_passes_through(eo_obj, obj))) continue;
|
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
|
|
|
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
|
|
|
|
(!obj->clip.clipees) &&
|
|
|
|
RECTS_INTERSECT(xx, yy, 1, 1,
|
|
|
|
obj->cur->geometry.x, obj->cur->geometry.y,
|
|
|
|
obj->cur->geometry.w, obj->cur->geometry.h))
|
|
|
|
return eo_obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EAPI Evas_Object*
|
|
|
|
evas_object_top_at_xy_get(Eo *eo_e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
|
|
|
{
|
|
|
|
Eina_Position2D pos = {x, y};
|
2018-03-26 06:21:21 -07:00
|
|
|
return efl_canvas_scene_object_top_at_xy_get(eo_e, pos, include_pass_events_objects, include_hidden_objects);
|
2018-02-14 18:14:52 -08:00
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EAPI Evas_Object *
|
|
|
|
evas_object_top_at_pointer_get(const Evas *eo_e)
|
|
|
|
{
|
|
|
|
Evas_Public_Data *e = efl_isa(eo_e, EVAS_CANVAS_CLASS) ?
|
|
|
|
efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS) : NULL;
|
|
|
|
if (!e) return NULL;
|
|
|
|
|
|
|
|
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, NULL);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
|
2018-03-26 06:21:21 -07:00
|
|
|
return efl_canvas_scene_object_top_at_xy_get((Eo *)eo_e, EINA_POSITION2D(pdata->seat->x, pdata->seat->y), EINA_TRUE, EINA_TRUE);
|
2018-02-14 18:14:52 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN Evas_Object*
|
2018-03-26 06:21:21 -07:00
|
|
|
_evas_canvas_efl_canvas_scene_object_top_in_rectangle_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Rect rect, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
Evas_Layer *lay;
|
|
|
|
int xx, yy, ww, hh;
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
xx = rect.x;
|
|
|
|
yy = rect.y;
|
|
|
|
ww = rect.w;
|
|
|
|
hh = rect.h;
|
2018-02-14 18:14:52 -08:00
|
|
|
//// xx = evas_coord_world_x_to_screen(eo_e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(eo_e, y);
|
|
|
|
//// ww = evas_coord_world_x_to_screen(eo_e, w);
|
|
|
|
//// hh = evas_coord_world_y_to_screen(eo_e, h);
|
|
|
|
if (ww < 1) ww = 1;
|
|
|
|
if (hh < 1) hh = 1;
|
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
|
|
|
{
|
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
|
|
|
eo_obj = obj->object;
|
|
|
|
if (obj->delete_me) continue;
|
|
|
|
if ((!include_pass_events_objects) &&
|
|
|
|
(evas_event_passes_through(eo_obj, obj))) continue;
|
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
|
|
|
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
|
|
|
|
(!obj->clip.clipees) &&
|
|
|
|
RECTS_INTERSECT(xx, yy, ww, hh,
|
|
|
|
obj->cur->geometry.x, obj->cur->geometry.y,
|
|
|
|
obj->cur->geometry.w, obj->cur->geometry.h)) return eo_obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EAPI Evas_Object *
|
|
|
|
evas_object_top_in_rectangle_get(const Eo *obj, int x, int y, int w, int h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
|
|
|
{
|
2018-03-26 06:21:21 -07:00
|
|
|
return efl_canvas_scene_object_top_in_rectangle_get(obj, EINA_RECT(x, y, w, h), include_pass_events_objects, include_hidden_objects);
|
2018-02-14 18:14:52 -08:00
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
static Eina_List *
|
|
|
|
_efl_canvas_evas_canvas_objects_at_xy_get_helper(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int x, int y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
Eina_List *in = NULL;
|
|
|
|
Evas_Layer *lay;
|
|
|
|
int xx, yy;
|
|
|
|
|
|
|
|
xx = x;
|
|
|
|
yy = y;
|
|
|
|
//// xx = evas_coord_world_x_to_screen(eo_e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(eo_e, y);
|
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
|
|
|
{
|
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
|
|
|
eo_obj = obj->object;
|
|
|
|
// FIXME - Daniel: we don't know yet how to handle the next line
|
|
|
|
if (obj->delete_me) continue;
|
|
|
|
if ((!include_pass_events_objects) &&
|
|
|
|
(evas_event_passes_through(eo_obj, obj))) continue;
|
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
|
|
|
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
|
|
|
|
(!obj->clip.clipees))
|
|
|
|
{
|
|
|
|
// evas_object_is_in_output_rect is based on the clip which
|
|
|
|
// may be larger than the geometry (bounding box)
|
|
|
|
if (!RECTS_INTERSECT(xx, yy, 1, 1,
|
|
|
|
obj->cur->geometry.x,
|
|
|
|
obj->cur->geometry.y,
|
|
|
|
obj->cur->geometry.w,
|
|
|
|
obj->cur->geometry.h))
|
|
|
|
continue;
|
|
|
|
in = eina_list_prepend(in, eo_obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EOLIAN static Eina_Iterator *
|
2018-03-26 06:21:21 -07:00
|
|
|
_evas_canvas_efl_canvas_scene_objects_at_xy_get(Eo *eo_e, Evas_Public_Data *e, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
Eina_List *l = _efl_canvas_evas_canvas_objects_at_xy_get_helper(eo_e, e, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
|
|
|
|
if (l) return efl_canvas_iterator_create(eo_e, eina_list_iterator_new(l), l);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
/**
|
|
|
|
* Retrieves the objects in the given rectangle region
|
|
|
|
* @param eo_e The given evas object.
|
|
|
|
* @param x The horizontal coordinate.
|
|
|
|
* @param y The vertical coordinate.
|
|
|
|
* @param w The width size.
|
|
|
|
* @param h The height size.
|
|
|
|
* @param include_pass_events_objects Boolean Flag to include or not pass events objects
|
|
|
|
* @param include_hidden_objects Boolean Flag to include or not hidden objects
|
|
|
|
* @return The list of evas object in the rectangle region.
|
|
|
|
*
|
|
|
|
*/
|
2018-02-14 18:14:52 -08:00
|
|
|
static Eina_List*
|
|
|
|
_efl_canvas_objects_in_rectangle_get_helper(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
Eina_List *in = NULL;
|
|
|
|
Evas_Layer *lay;
|
|
|
|
int xx, yy, ww, hh;
|
|
|
|
|
|
|
|
xx = x;
|
|
|
|
yy = y;
|
|
|
|
ww = w;
|
|
|
|
hh = h;
|
|
|
|
//// xx = evas_coord_world_x_to_screen(eo_e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(eo_e, y);
|
|
|
|
//// ww = evas_coord_world_x_to_screen(eo_e, w);
|
|
|
|
//// hh = evas_coord_world_y_to_screen(eo_e, h);
|
|
|
|
if (ww < 1) ww = 1;
|
|
|
|
if (hh < 1) hh = 1;
|
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
|
|
|
{
|
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
|
|
|
eo_obj = obj->object;
|
|
|
|
// FIXME - Daniel: we don't know yet how to handle the next line
|
|
|
|
if (obj->delete_me) continue;
|
|
|
|
if ((!include_pass_events_objects) &&
|
|
|
|
(evas_event_passes_through(eo_obj, obj))) continue;
|
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
|
|
|
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
|
|
|
|
(!obj->clip.clipees))
|
|
|
|
{
|
|
|
|
if (!RECTS_INTERSECT(xx, yy, ww, hh,
|
|
|
|
obj->cur->geometry.x,
|
|
|
|
obj->cur->geometry.y,
|
|
|
|
obj->cur->geometry.w,
|
|
|
|
obj->cur->geometry.h))
|
|
|
|
continue;
|
|
|
|
in = eina_list_prepend(in, eo_obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
|
|
|
|
EOLIAN static Eina_Iterator*
|
2018-03-26 06:21:21 -07:00
|
|
|
_evas_canvas_efl_canvas_scene_objects_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Rect rect, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
Eina_List *l = _efl_canvas_objects_in_rectangle_get_helper(eo_e, e, rect.x, rect.y, rect.w, rect.h, include_pass_events_objects, include_hidden_objects);
|
|
|
|
if (!l) return NULL;
|
|
|
|
return efl_canvas_iterator_create(eo_e, eina_list_iterator_new(l), l);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_List *
|
|
|
|
evas_objects_in_rectangle_get(const Evas_Canvas *eo_e, int x, int y, int w, int h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
|
|
|
{
|
2018-04-24 17:13:00 -07:00
|
|
|
EVAS_LEGACY_API(eo_e, e, NULL);
|
|
|
|
return _efl_canvas_objects_in_rectangle_get_helper(eo_e, e, x, y, w, h, include_pass_events_objects, include_hidden_objects);
|
2018-02-14 18:14:52 -08:00
|
|
|
}
|
|
|
|
|
2017-11-06 18:22:09 -08:00
|
|
|
/* font related api */
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_font_path_clear(Eo *eo_e EINA_UNUSED, Evas_Public_Data *evas)
|
|
|
|
{
|
|
|
|
evas_canvas_async_block(evas);
|
|
|
|
while (evas->font_path)
|
|
|
|
{
|
|
|
|
eina_stringshare_del(evas->font_path->data);
|
|
|
|
evas->font_path = eina_list_remove(evas->font_path, evas->font_path->data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_font_path_append(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, const char *path)
|
|
|
|
{
|
|
|
|
if (!path) return;
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
e->font_path = eina_list_append(e->font_path, eina_stringshare_add(path));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_font_path_prepend(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, const char *path)
|
|
|
|
{
|
|
|
|
if (!path) return;
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
e->font_path = eina_list_prepend(e->font_path, eina_stringshare_add(path));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const Eina_List*
|
|
|
|
_evas_canvas_font_path_list(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
return e->font_path;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_font_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
|
|
|
{
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
evas_render_rendering_wait(e);
|
|
|
|
if (_evas_engine_context(e))
|
|
|
|
e->engine.func->font_cache_flush(_evas_engine_context(e));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_evas_canvas_font_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size)
|
|
|
|
{
|
|
|
|
if (size < 0) size = 0;
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
evas_render_rendering_wait(e);
|
|
|
|
if (_evas_engine_context(e))
|
|
|
|
e->engine.func->font_cache_set(_evas_engine_context(e), size);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static int
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_font_cache_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2017-11-06 18:22:09 -08:00
|
|
|
{
|
|
|
|
if (_evas_engine_context(e))
|
|
|
|
return e->engine.func->font_cache_get(_evas_engine_context(e));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_List*
|
|
|
|
_evas_canvas_font_available_list(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *pd)
|
|
|
|
{
|
|
|
|
return evas_font_dir_available_list(pd->font_path);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
evas_font_object_rehint(Evas_Object *eo_obj)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
|
|
|
if (obj->is_smart)
|
|
|
|
{
|
|
|
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj)
|
|
|
|
evas_font_object_rehint(obj->object);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!strcmp(obj->type, "text"))
|
|
|
|
_evas_object_text_rehint(eo_obj);
|
|
|
|
if (!strcmp(obj->type, "textblock"))
|
|
|
|
_evas_object_textblock_rehint(eo_obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_font_hinting_set(Eo *eo_e, Evas_Font_Hinting_Flags hinting)
|
|
|
|
{
|
|
|
|
Evas_Layer *lay;
|
|
|
|
|
|
|
|
EVAS_LEGACY_API(eo_e, e);
|
|
|
|
evas_canvas_async_block(e);
|
|
|
|
if (e->hinting == hinting) return;
|
|
|
|
e->hinting = hinting;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(lay->objects, obj)
|
|
|
|
evas_font_object_rehint(obj->object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Font_Hinting_Flags
|
|
|
|
evas_font_hinting_get(const Evas *eo_e)
|
|
|
|
{
|
|
|
|
EVAS_LEGACY_API(eo_e, e, EVAS_FONT_HINTING_NONE);
|
|
|
|
return e->hinting;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_font_hinting_can_hint(const Evas *eo_e, Evas_Font_Hinting_Flags hinting)
|
|
|
|
{
|
|
|
|
EVAS_LEGACY_API(eo_e, e, EINA_FALSE);
|
|
|
|
if (e->engine.func->font_hinting_can_hint && _evas_engine_context(e))
|
|
|
|
return e->engine.func->font_hinting_can_hint(_evas_engine_context(e),
|
|
|
|
hinting);
|
|
|
|
else return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_font_available_list_free(Evas *eo_e, Eina_List *available)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
evas_font_dir_available_list_free(available);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EOLIAN static void
|
2018-03-26 06:21:21 -07:00
|
|
|
_evas_canvas_efl_canvas_scene_smart_objects_calculate(Eo *eo_e, Evas_Public_Data *o EINA_UNUSED)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
evas_call_smarts_calculate(eo_e);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_smart_objects_calculate(Eo *eo_e)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
2018-08-09 08:19:46 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(eo_e);
|
2018-02-14 18:14:52 -08:00
|
|
|
evas_call_smarts_calculate(eo_e);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN Eina_Bool
|
2018-03-26 06:21:21 -07:00
|
|
|
_evas_canvas_efl_canvas_scene_smart_objects_calculating_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
return !!e->in_smart_calc;
|
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_smart_objects_calculating_get(const Eo *obj)
|
|
|
|
{
|
2018-03-26 06:21:21 -07:00
|
|
|
return efl_canvas_scene_smart_objects_calculating_get(obj);
|
2018-02-14 18:14:52 -08:00
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EOLIAN int
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_canvas_smart_objects_calculate_count_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
2018-02-14 18:14:52 -08:00
|
|
|
{
|
|
|
|
return e->smart_calc_count;
|
|
|
|
}
|
2017-10-31 00:23:07 -07:00
|
|
|
/* Legacy EAPI */
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_pointer_inside_get(const Evas *obj)
|
|
|
|
{
|
2017-10-31 00:30:43 -07:00
|
|
|
return efl_canvas_pointer_inside_get(obj, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_pointer_inside_by_device_get(const Evas *obj, Eo *dev)
|
|
|
|
{
|
|
|
|
return efl_canvas_pointer_inside_get(obj, dev);
|
2017-10-31 00:23:07 -07:00
|
|
|
}
|
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
EAPI Eina_List*
|
|
|
|
evas_objects_at_xy_get(Eo *eo_e, int x, int y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
|
|
|
{
|
|
|
|
return _efl_canvas_evas_canvas_objects_at_xy_get_helper(eo_e, efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS), x, y, include_pass_events_objects, include_hidden_objects);
|
|
|
|
}
|
2017-05-18 01:46:36 -07:00
|
|
|
/* Internal EO APIs */
|
|
|
|
|
|
|
|
EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE =
|
|
|
|
EFL_EVENT_DESCRIPTION("render,flush,pre");
|
|
|
|
EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_POST =
|
|
|
|
EFL_EVENT_DESCRIPTION("render,flush,post");
|
|
|
|
EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_AXIS_UPDATE =
|
|
|
|
EFL_EVENT_DESCRIPTION("axis,update");
|
|
|
|
EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_VIEWPORT_RESIZE =
|
|
|
|
EFL_EVENT_DESCRIPTION("viewport,resize");
|
|
|
|
|
2018-02-14 18:14:51 -08:00
|
|
|
#include "evas_stack.x"
|
2014-06-26 14:29:46 -07:00
|
|
|
#include "canvas/evas_canvas.eo.c"
|