2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_private.h"
|
|
|
|
|
2014-06-02 06:47:59 -07:00
|
|
|
#define MY_CLASS EVAS_LINE_CLASS
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* private magic number for line objects */
|
|
|
|
static const char o_type[] = "line";
|
|
|
|
|
|
|
|
/* private struct for line object internal data */
|
2014-03-05 03:54:39 -08:00
|
|
|
typedef struct _Evas_Line_Data Evas_Line_Data;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2014-03-05 03:54:39 -08:00
|
|
|
struct _Evas_Line_Data
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
struct {
|
|
|
|
struct {
|
2012-06-04 04:21:05 -07:00
|
|
|
Evas_Coord x1, y1, x2, y2;
|
2011-10-31 07:50:00 -07:00
|
|
|
struct {
|
|
|
|
Evas_Coord w, h;
|
|
|
|
} object;
|
2002-11-08 00:02:15 -08:00
|
|
|
} cache;
|
2012-06-04 04:21:05 -07:00
|
|
|
Evas_Coord x1, y1, x2, y2;
|
2002-11-08 00:02:15 -08:00
|
|
|
} cur, prev;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
void *engine_data;
|
2012-06-04 04:21:05 -07:00
|
|
|
Eina_Bool changed : 1;
|
2002-11-08 00:02:15 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* private methods for line objects */
|
2012-10-08 18:58:41 -07:00
|
|
|
static void evas_object_line_init(Evas_Object *eo_obj);
|
2013-07-08 17:46:15 -07:00
|
|
|
static void evas_object_line_render(Evas_Object *eo_obj,
|
2017-05-12 15:03:05 -07:00
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data,
|
|
|
|
void *engine, void *output, void *context, void *surface,
|
|
|
|
int x, int y, Eina_Bool do_async);
|
2013-07-08 17:46:15 -07:00
|
|
|
static void evas_object_line_render_pre(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
|
|
|
static void evas_object_line_render_post(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
2012-10-08 18:58:41 -07:00
|
|
|
|
|
|
|
static void *evas_object_line_engine_data_get(Evas_Object *eo_obj);
|
|
|
|
|
2013-07-08 17:46:15 -07:00
|
|
|
static int evas_object_line_is_opaque(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
|
|
|
static int evas_object_line_was_opaque(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
|
|
|
static int evas_object_line_is_inside(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data,
|
|
|
|
Evas_Coord x, Evas_Coord y);
|
|
|
|
static int evas_object_line_was_inside(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data,
|
|
|
|
Evas_Coord x, Evas_Coord y);
|
|
|
|
static void evas_object_line_coords_recalc(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2007-05-06 04:29:37 -07:00
|
|
|
static const Evas_Object_Func object_func =
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
/* methods (compulsory) */
|
2012-10-08 18:58:41 -07:00
|
|
|
NULL,
|
2012-06-04 04:39:43 -07:00
|
|
|
evas_object_line_render,
|
|
|
|
evas_object_line_render_pre,
|
|
|
|
evas_object_line_render_post,
|
|
|
|
evas_object_line_engine_data_get,
|
2002-11-08 00:02:15 -08:00
|
|
|
/* these are optional. NULL = nothing */
|
2012-06-04 04:39:43 -07:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
evas_object_line_is_opaque,
|
|
|
|
evas_object_line_was_opaque,
|
|
|
|
evas_object_line_is_inside,
|
|
|
|
evas_object_line_was_inside,
|
|
|
|
evas_object_line_coords_recalc,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
evas: remove redundant internal functions.
Summary:
Since efl object is introduced, magic check is no more used.
Plus, remove redundant object functions interfaces
- type_id,
- visual_id,
- store
- unstore
Reviewers: #committers, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: bu5hm4n, raster, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7153
2018-10-10 21:46:36 -07:00
|
|
|
NULL // render_prepare
|
2002-11-08 00:02:15 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* the actual api call to add a rect */
|
|
|
|
/* it has no other api calls as all properties are standard */
|
2003-03-04 18:30:20 -08:00
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_line_add(Evas *e)
|
|
|
|
{
|
2018-08-29 05:11:00 -07:00
|
|
|
e = evas_find(e);
|
2018-08-16 10:01:26 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(e, EVAS_CANVAS_CLASS), NULL);
|
2018-08-29 05:11:00 -07:00
|
|
|
return efl_add(EVAS_LINE_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2014-03-05 03:54:39 -08:00
|
|
|
EOLIAN static void
|
|
|
|
_evas_line_xy_set(Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
|
2014-03-05 03:54:39 -08:00
|
|
|
Evas_Line_Data *o = _pd;
|
2003-10-17 20:34:00 -07:00
|
|
|
Evas_Coord min_x, max_x, min_y, max_y;
|
2016-10-21 05:25:41 -07:00
|
|
|
Eina_List *was = NULL;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2013-11-27 21:03:05 -08:00
|
|
|
|
|
|
|
if ((x1 == (obj->cur->geometry.x + o->cur.x1)) &&
|
|
|
|
(y1 == (obj->cur->geometry.y + o->cur.y1)) &&
|
|
|
|
(x2 == (obj->cur->geometry.x + o->cur.x2)) &&
|
|
|
|
(y2 == (obj->cur->geometry.y + o->cur.y2))) return;
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2013-11-27 21:03:05 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!(obj->layer->evas->is_frozen))
|
2005-07-22 03:28:11 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!evas_event_passes_through(eo_obj, obj) &&
|
2012-10-21 21:57:32 -07:00
|
|
|
!evas_event_freezes_through(eo_obj, obj) &&
|
|
|
|
!evas_object_is_source_invisible(eo_obj, obj))
|
2016-10-21 05:25:41 -07:00
|
|
|
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj,
|
|
|
|
1, 1);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
if (x1 < x2)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-10-31 07:50:00 -07:00
|
|
|
min_x = x1;
|
|
|
|
max_x = x2;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
else
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-10-31 07:50:00 -07:00
|
|
|
min_x = x2;
|
|
|
|
max_x = x1;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
if (y1 < y2)
|
|
|
|
{
|
2011-10-31 07:50:00 -07:00
|
|
|
min_y = y1;
|
|
|
|
max_y = y2;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
else
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-10-31 07:50:00 -07:00
|
|
|
min_y = y2;
|
|
|
|
max_y = y1;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2013-03-12 05:58:19 -07:00
|
|
|
|
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->geometry.x = min_x;
|
|
|
|
state_write->geometry.y = min_y;
|
|
|
|
state_write->geometry.w = max_x - min_x + 2;
|
|
|
|
state_write->geometry.h = max_y - min_y + 2;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
|
|
|
|
|
|
|
//// obj->cur->cache.geometry.validity = 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
o->cur.x1 = x1 - min_x;
|
|
|
|
o->cur.y1 = y1 - min_y;
|
|
|
|
o->cur.x2 = x2 - min_x;
|
|
|
|
o->cur.y2 = y2 - min_y;
|
2012-06-04 04:21:05 -07:00
|
|
|
o->changed = EINA_TRUE;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
evas_object_coords_recalc(eo_obj, obj);
|
|
|
|
evas_object_clip_dirty(eo_obj, obj);
|
2016-10-21 05:25:41 -07:00
|
|
|
if (!(obj->layer->evas->is_frozen) &&
|
|
|
|
!evas_event_passes_through(eo_obj, obj) &&
|
|
|
|
!evas_event_freezes_through(eo_obj, obj) &&
|
|
|
|
!evas_object_is_source_invisible(eo_obj, obj) &&
|
|
|
|
obj->cur->visible)
|
|
|
|
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
|
|
|
eina_list_free(was);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_move(eo_obj, obj);
|
2017-10-19 16:07:39 -07:00
|
|
|
evas_object_inform_call_resize(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2014-03-05 03:54:39 -08:00
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_evas_line_xy_get(const Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2014-03-05 03:54:39 -08:00
|
|
|
const Evas_Line_Data *o = _pd;
|
2012-10-08 18:58:41 -07:00
|
|
|
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2013-03-12 05:58:19 -07:00
|
|
|
if (x1) *x1 = obj->cur->geometry.x + o->cur.x1;
|
|
|
|
if (y1) *y1 = obj->cur->geometry.y + o->cur.y1;
|
|
|
|
if (x2) *x2 = obj->cur->geometry.x + o->cur.x2;
|
|
|
|
if (y2) *y2 = obj->cur->geometry.y + o->cur.y2;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* all nice and private */
|
|
|
|
static void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_line_init(Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* set up methods (compulsory) */
|
|
|
|
obj->func = &object_func;
|
2016-08-15 06:44:41 -07:00
|
|
|
obj->private_data = efl_data_ref(eo_obj, MY_CLASS);
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->type = o_type;
|
|
|
|
}
|
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_evas_line_efl_object_constructor(Eo *eo_obj, Evas_Line_Data *class_data EINA_UNUSED)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2014-03-05 03:54:39 -08:00
|
|
|
Evas_Line_Data *o;
|
2013-09-24 21:32:56 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_line_init(eo_obj);
|
|
|
|
|
2013-09-24 21:32:56 -07:00
|
|
|
o = class_data;
|
2002-11-08 00:02:15 -08:00
|
|
|
/* alloc obj private data */
|
2009-09-23 21:55:01 -07:00
|
|
|
o->cur.x1 = 0;
|
|
|
|
o->cur.y1 = 0;
|
|
|
|
o->cur.x2 = 31;
|
|
|
|
o->cur.y2 = 31;
|
2002-11-08 00:02:15 -08:00
|
|
|
o->prev = o->cur;
|
2015-05-19 03:41:27 -07:00
|
|
|
|
|
|
|
return eo_obj;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-07-08 17:46:15 -07:00
|
|
|
evas_object_line_render(Evas_Object *eo_obj EINA_UNUSED,
|
2017-05-12 15:03:05 -07:00
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data,
|
|
|
|
void *engine, void *output, void *context, void *surface,
|
|
|
|
int x, int y, Eina_Bool do_async)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2014-03-05 03:54:39 -08:00
|
|
|
Evas_Line_Data *o = type_private_data;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
|
|
|
/* render object to surface with context, and offxet by x,y */
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->context_color_set(engine,
|
2012-06-04 04:16:29 -07:00
|
|
|
context,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.r,
|
|
|
|
obj->cur->cache.clip.g,
|
|
|
|
obj->cur->cache.clip.b,
|
|
|
|
obj->cur->cache.clip.a);
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->context_multiplier_unset(engine, context);
|
|
|
|
obj->layer->evas->engine.func->context_anti_alias_set(engine, context,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->anti_alias);
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->context_render_op_set(engine, context,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->render_op);
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->line_draw(engine, output,
|
2012-06-04 04:16:29 -07:00
|
|
|
context,
|
|
|
|
surface,
|
|
|
|
o->cur.cache.x1 + x,
|
|
|
|
o->cur.cache.y1 + y,
|
|
|
|
o->cur.cache.x2 + x,
|
2012-12-18 08:28:55 -08:00
|
|
|
o->cur.cache.y2 + y,
|
|
|
|
do_async);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-07-08 17:46:15 -07:00
|
|
|
evas_object_line_render_pre(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2014-03-05 03:54:39 -08:00
|
|
|
Evas_Line_Data *o = type_private_data;
|
2002-11-08 00:02:15 -08:00
|
|
|
int is_v, was_v;
|
2012-06-04 04:39:43 -07:00
|
|
|
Eina_Bool changed_color = EINA_FALSE;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
|
|
|
/* dont pre-render the obj twice! */
|
|
|
|
if (obj->pre_render_done) return;
|
2012-06-04 04:39:43 -07:00
|
|
|
obj->pre_render_done = EINA_TRUE;
|
2002-11-08 00:02:15 -08:00
|
|
|
/* pre-render phase. this does anything an object needs to do just before */
|
|
|
|
/* rendering. this could mean loading the image data, retrieving it from */
|
|
|
|
/* elsewhere, decoding video etc. */
|
|
|
|
/* then when this is done the object needs to figure if it changed and */
|
2004-02-16 11:22:48 -08:00
|
|
|
/* if so what and where and add the appropriate redraw lines */
|
2002-11-08 00:02:15 -08:00
|
|
|
/* if someone is clipping this obj - go calculate the clipper */
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->clipper)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->cache.clip.dirty)
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj->cur->clipper);
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
|
|
|
|
obj->cur->clipper,
|
|
|
|
obj->cur->clipper->private_data);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
/* now figure what changed and add draw rects */
|
|
|
|
/* if it just became visible or invisible */
|
2012-10-08 18:58:41 -07:00
|
|
|
is_v = evas_object_is_visible(eo_obj, obj);
|
|
|
|
was_v = evas_object_was_visible(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (is_v != was_v)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
|
|
|
goto done;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-25 08:24:27 -07:00
|
|
|
if (obj->changed_map || obj->changed_src_visible)
|
2009-11-06 00:44:49 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj,
|
2012-05-30 03:12:10 -07:00
|
|
|
obj);
|
2009-11-06 00:44:49 -08:00
|
|
|
goto done;
|
|
|
|
}
|
2004-02-16 11:22:48 -08:00
|
|
|
/* it's not visible - we accounted for it appearing or not so just abort */
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!is_v) goto done;
|
|
|
|
/* clipper changed this is in addition to anything else for obj */
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, eo_obj);
|
2012-06-04 04:39:43 -07:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((obj->cur->color.r != obj->prev->color.r) ||
|
|
|
|
(obj->cur->color.g != obj->prev->color.g) ||
|
|
|
|
(obj->cur->color.b != obj->prev->color.b) ||
|
|
|
|
(obj->cur->color.a != obj->prev->color.a))
|
2012-06-04 04:39:43 -07:00
|
|
|
changed_color = EINA_TRUE;
|
|
|
|
|
|
|
|
/* if we restacked (layer or just within a layer) */
|
|
|
|
/* or if it changed anti_alias */
|
|
|
|
/* or if ii changed render op */
|
|
|
|
/* or if it changed color */
|
|
|
|
if ((obj->restack) ||
|
2013-03-12 05:58:19 -07:00
|
|
|
(obj->cur->anti_alias != obj->prev->anti_alias) ||
|
|
|
|
(obj->cur->render_op != obj->prev->render_op) ||
|
2012-06-04 04:39:43 -07:00
|
|
|
(changed_color)
|
|
|
|
)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-06-04 04:39:43 -07:00
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj, obj);
|
2012-06-04 04:16:29 -07:00
|
|
|
goto done;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-06-04 04:39:43 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* if it changed geometry - and obviously not visibility or color */
|
2010-09-07 20:51:24 -07:00
|
|
|
/* calculate differences since we have a constant color fill */
|
2002-11-08 00:02:15 -08:00
|
|
|
/* we really only need to update the differences */
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((obj->cur->geometry.x != obj->prev->geometry.x) ||
|
|
|
|
(obj->cur->geometry.y != obj->prev->geometry.y) ||
|
|
|
|
(obj->cur->geometry.w != obj->prev->geometry.w) ||
|
|
|
|
(obj->cur->geometry.h != obj->prev->geometry.h) ||
|
2005-05-21 19:49:50 -07:00
|
|
|
((o->changed) &&
|
2012-06-04 04:16:29 -07:00
|
|
|
((o->cur.x1 != o->prev.x1) ||
|
|
|
|
(o->cur.y1 != o->prev.y1) ||
|
|
|
|
(o->cur.x2 != o->prev.x2) ||
|
|
|
|
(o->cur.y2 != o->prev.y2)))
|
|
|
|
)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
|
|
|
|
goto done;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
done:
|
|
|
|
evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_line_render_post(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
2013-07-08 17:46:15 -07:00
|
|
|
void *type_private_data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2014-03-05 03:54:39 -08:00
|
|
|
Evas_Line_Data *o = type_private_data;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
|
|
|
/* this moves the current data to the previous state parts of the object */
|
|
|
|
/* in whatever way is safest for the object. also if we don't need object */
|
|
|
|
/* data anymore we can free it if the object deems this is a good idea */
|
|
|
|
/* remove those pesky changes */
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_clip_changes_clean(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* move cur to prev safely for object data */
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_cur_prev(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
o->prev = o->cur;
|
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
static void *evas_object_line_engine_data_get(Evas_Object *eo_obj)
|
2008-08-25 22:45:04 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Line_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
|
2008-08-25 22:45:04 -07:00
|
|
|
return o->engine_data;
|
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
static int
|
2013-07-08 17:46:15 -07:00
|
|
|
evas_object_line_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj EINA_UNUSED,
|
|
|
|
void *type_private_data EINA_UNUSED)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
/* this returns 1 if the internal object data implies that the object is */
|
2004-02-16 11:22:48 -08:00
|
|
|
/* currently fully opaque over the entire line it occupies */
|
2002-11-08 00:02:15 -08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-07-08 17:46:15 -07:00
|
|
|
evas_object_line_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj EINA_UNUSED,
|
|
|
|
void *type_private_data EINA_UNUSED)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
/* this returns 1 if the internal object data implies that the object was */
|
2004-02-16 11:22:48 -08:00
|
|
|
/* previously fully opaque over the entire line it occupies */
|
2002-11-08 00:02:15 -08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-07-08 17:46:15 -07:00
|
|
|
evas_object_line_is_inside(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj EINA_UNUSED,
|
|
|
|
void *type_private_data EINA_UNUSED,
|
|
|
|
Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
/* this returns 1 if the canvas co-ordinates are inside the object based */
|
2004-02-16 11:22:48 -08:00
|
|
|
/* on object private data. not much use for rects, but for polys, images */
|
2002-11-08 00:02:15 -08:00
|
|
|
/* and other complex objects it might be */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-07-08 17:46:15 -07:00
|
|
|
evas_object_line_was_inside(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj EINA_UNUSED,
|
|
|
|
void *type_private_data EINA_UNUSED,
|
|
|
|
Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
/* this returns 1 if the canvas co-ordinates were inside the object based */
|
2004-02-16 11:22:48 -08:00
|
|
|
/* on object private data. not much use for rects, but for polys, images */
|
2002-11-08 00:02:15 -08:00
|
|
|
/* and other complex objects it might be */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-07-08 17:46:15 -07:00
|
|
|
evas_object_line_coords_recalc(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2014-03-05 03:54:39 -08:00
|
|
|
Evas_Line_Data *o = type_private_data;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
o->cur.cache.x1 = obj->cur->geometry.x + o->cur.x1;
|
|
|
|
o->cur.cache.y1 = obj->cur->geometry.y + o->cur.y1;
|
|
|
|
o->cur.cache.x2 = obj->cur->geometry.x + o->cur.x2;
|
|
|
|
o->cur.cache.y2 = obj->cur->geometry.y + o->cur.y2;
|
|
|
|
o->cur.cache.object.w = obj->cur->geometry.w;
|
|
|
|
o->cur.cache.object.h = obj->cur->geometry.h;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2014-03-07 01:50:13 -08:00
|
|
|
#include "canvas/evas_line.eo.c"
|