evas: no need to call eo_data_scope_get in many case after this change.

Reduce CPU usage by 5% in some case (especially when the CPU is not the
limiting factor like with the GL backend).
This commit is contained in:
Cedric Bail 2013-07-09 09:46:15 +09:00
parent 87b49cf103
commit 48b40640b5
12 changed files with 455 additions and 196 deletions

View File

@ -135,20 +135,40 @@ static Evas_Coord evas_object_image_figure_x_fill(Evas_Object *eo_obj, Evas_Obje
static Evas_Coord evas_object_image_figure_y_fill(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret); static Evas_Coord evas_object_image_figure_y_fill(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret);
static void evas_object_image_init(Evas_Object *eo_obj); static void evas_object_image_init(Evas_Object *eo_obj);
static void evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); static void evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
static void evas_object_image_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *type_private_data,
static void evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *output, void *context, void *surface,
static void evas_object_image_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); int x, int y, Eina_Bool do_async);
static void evas_object_image_free(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj);
static void evas_object_image_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_image_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static unsigned int evas_object_image_id_get(Evas_Object *eo_obj); static unsigned int evas_object_image_id_get(Evas_Object *eo_obj);
static unsigned int evas_object_image_visual_id_get(Evas_Object *eo_obj); static unsigned int evas_object_image_visual_id_get(Evas_Object *eo_obj);
static void *evas_object_image_engine_data_get(Evas_Object *eo_obj); static void *evas_object_image_engine_data_get(Evas_Object *eo_obj);
static int evas_object_image_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static int evas_object_image_is_opaque(Evas_Object *eo_obj,
static int evas_object_image_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static int evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord x, Evas_Coord y); void *type_private_data);
static int evas_object_image_has_opaque_rect(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static int evas_object_image_was_opaque(Evas_Object *eo_obj,
static int evas_object_image_get_opaque_rect(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); Evas_Object_Protected_Data *obj,
void *type_private_data);
static int evas_object_image_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_image_has_opaque_rect(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static int evas_object_image_get_opaque_rect(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data,
Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
static int evas_object_image_can_map(Evas_Object *eo_obj); static int evas_object_image_can_map(Evas_Object *eo_obj);
static void *evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_Colorspace to_cspace); static void *evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_Colorspace to_cspace);
@ -3599,6 +3619,7 @@ evas_object_image_init(Evas_Object *eo_obj)
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
/* set up methods (compulsory) */ /* set up methods (compulsory) */
obj->func = &object_func; obj->func = &object_func;
obj->private_data = eo_data_ref(eo_obj, MY_CLASS);
obj->type = o_type; obj->type = o_type;
} }
@ -3727,9 +3748,10 @@ evas_draw_image_map_async_check(Evas_Object_Protected_Data *obj,
} }
static void static void
evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async) evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *type_private_data,
void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
{ {
Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Image *o = type_private_data;
int imagew, imageh, uvw, uvh; int imagew, imageh, uvw, uvh;
void *pixels; void *pixels;
@ -4158,9 +4180,11 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
} }
static void static void
evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_image_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Image *o = type_private_data;
int is_v = 0, was_v = 0; int is_v = 0, was_v = 0;
/* dont pre-render the obj twice! */ /* dont pre-render the obj twice! */
@ -4186,7 +4210,8 @@ evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
if (obj->cur->cache.clip.dirty) if (obj->cur->cache.clip.dirty)
evas_object_clip_recalc(obj->cur->clipper); evas_object_clip_recalc(obj->cur->clipper);
obj->cur->clipper->func->render_pre(obj->cur->clipper->object, obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
obj->cur->clipper); obj->cur->clipper,
obj->cur->clipper->private_data);
} }
/* Proxy: Do it early */ /* Proxy: Do it early */
if (o->cur->source) if (o->cur->source)
@ -4444,9 +4469,11 @@ evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
} }
static void static void
evas_object_image_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_image_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data)
{ {
Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Image *o = type_private_data;
Eina_Rectangle *r; Eina_Rectangle *r;
/* this moves the current data to the previous state parts of the object */ /* this moves the current data to the previous state parts of the object */
@ -4493,13 +4520,15 @@ static void *evas_object_image_engine_data_get(Evas_Object *eo_obj)
} }
static int static int
evas_object_image_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_image_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
/* this returns 1 if the internal object data implies that the object is */ /* this returns 1 if the internal object data implies that the object is */
/* currently fully opaque over the entire rectangle it occupies */ /* currently fully opaque over the entire rectangle it occupies */
/* disable caching due tyo maps screwing with this /* disable caching due tyo maps screwing with this
o->cur.opaque_valid = 0;*/ o->cur.opaque_valid = 0;*/
Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Image *o = type_private_data;
if (o->cur->opaque_valid) if (o->cur->opaque_valid)
{ {
@ -4597,9 +4626,11 @@ evas_object_image_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
} }
static int static int
evas_object_image_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_image_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Image *o = type_private_data;
/* this returns 1 if the internal object data implies that the object was */ /* this returns 1 if the internal object data implies that the object was */
/* previously fully opaque over the entire rectangle it occupies */ /* previously fully opaque over the entire rectangle it occupies */
@ -4700,9 +4731,12 @@ evas_object_image_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
} }
static int static int
evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord px, Evas_Coord py) evas_object_image_is_inside(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data,
Evas_Coord px, Evas_Coord py)
{ {
Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Image *o = type_private_data;
int imagew, imageh, uvw, uvh; int imagew, imageh, uvw, uvh;
void *pixels; void *pixels;
Evas_Func *eng = obj->layer->evas->engine.func; Evas_Func *eng = obj->layer->evas->engine.func;
@ -5053,9 +5087,11 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
} }
static int static int
evas_object_image_has_opaque_rect(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_image_has_opaque_rect(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Image *o = type_private_data;
if ((obj->map->cur.map) && (obj->map->cur.usemap)) return 0; if ((obj->map->cur.map) && (obj->map->cur.usemap)) return 0;
if (((o->cur->border.l | o->cur->border.r | o->cur->border.t | o->cur->border.b) != 0) && if (((o->cur->border.l | o->cur->border.r | o->cur->border.t | o->cur->border.b) != 0) &&
@ -5071,9 +5107,12 @@ evas_object_image_has_opaque_rect(Evas_Object *eo_obj, Evas_Object_Protected_Dat
} }
static int static int
evas_object_image_get_opaque_rect(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) evas_object_image_get_opaque_rect(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data,
Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{ {
Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Image *o = type_private_data;
if (o->cur->border.scale == 1.0) if (o->cur->border.scale == 1.0)
{ {

View File

@ -31,19 +31,39 @@ struct _Evas_Object_Line
/* private methods for line objects */ /* private methods for line objects */
static void evas_object_line_init(Evas_Object *eo_obj); static void evas_object_line_init(Evas_Object *eo_obj);
static void evas_object_line_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); static void evas_object_line_render(Evas_Object *eo_obj,
static void evas_object_line_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static void evas_object_line_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *type_private_data,
void *output, void *context, void *surface,
int x, int y, Eina_Bool do_async);
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);
static unsigned int evas_object_line_id_get(Evas_Object *eo_obj); static unsigned int evas_object_line_id_get(Evas_Object *eo_obj);
static unsigned int evas_object_line_visual_id_get(Evas_Object *eo_obj); static unsigned int evas_object_line_visual_id_get(Evas_Object *eo_obj);
static void *evas_object_line_engine_data_get(Evas_Object *eo_obj); static void *evas_object_line_engine_data_get(Evas_Object *eo_obj);
static int evas_object_line_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static int evas_object_line_is_opaque(Evas_Object *eo_obj,
static int evas_object_line_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static int evas_object_line_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord x, Evas_Coord y); void *type_private_data);
static int evas_object_line_was_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord x, Evas_Coord y); static int evas_object_line_was_opaque(Evas_Object *eo_obj,
static void evas_object_line_coords_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *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);
static const Evas_Object_Func object_func = static const Evas_Object_Func object_func =
{ {
@ -217,6 +237,7 @@ evas_object_line_init(Evas_Object *eo_obj)
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
/* set up methods (compulsory) */ /* set up methods (compulsory) */
obj->func = &object_func; obj->func = &object_func;
obj->private_data = eo_data_ref(eo_obj, MY_CLASS);
obj->type = o_type; obj->type = o_type;
} }
@ -239,15 +260,12 @@ _constructor(Eo *eo_obj, void *class_data, va_list *list EINA_UNUSED)
} }
static void static void
_destructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) evas_object_line_render(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data,
void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
{ {
eo_do_super(eo_obj, MY_CLASS, eo_destructor()); Evas_Object_Line *o = type_private_data;
}
static void
evas_object_line_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
{
Evas_Object_Line *o = eo_data_scope_get(eo_obj, MY_CLASS);
/* render object to surface with context, and offxet by x,y */ /* render object to surface with context, and offxet by x,y */
@ -274,9 +292,11 @@ evas_object_line_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, vo
} }
static void static void
evas_object_line_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_line_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Line *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Line *o = type_private_data;
int is_v, was_v; int is_v, was_v;
Eina_Bool changed_color = EINA_FALSE; Eina_Bool changed_color = EINA_FALSE;
@ -293,7 +313,9 @@ evas_object_line_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
{ {
if (obj->cur->cache.clip.dirty) if (obj->cur->cache.clip.dirty)
evas_object_clip_recalc(obj->cur->clipper); evas_object_clip_recalc(obj->cur->clipper);
obj->cur->clipper->func->render_pre(obj->cur->clipper->object, obj->cur->clipper); obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
obj->cur->clipper,
obj->cur->clipper->private_data);
} }
/* now figure what changed and add draw rects */ /* now figure what changed and add draw rects */
/* if it just became visible or invisible */ /* if it just became visible or invisible */
@ -358,9 +380,11 @@ evas_object_line_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
} }
static void static void
evas_object_line_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_line_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data)
{ {
Evas_Object_Line *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Line *o = type_private_data;
/* this moves the current data to the previous state parts of the object */ /* 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 */ /* in whatever way is safest for the object. also if we don't need object */
@ -393,7 +417,9 @@ static void *evas_object_line_engine_data_get(Evas_Object *eo_obj)
} }
static int static int
evas_object_line_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_line_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object is */ /* this returns 1 if the internal object data implies that the object is */
/* currently fully opaque over the entire line it occupies */ /* currently fully opaque over the entire line it occupies */
@ -401,7 +427,9 @@ evas_object_line_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protecte
} }
static int static int
evas_object_line_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_line_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object was */ /* this returns 1 if the internal object data implies that the object was */
/* previously fully opaque over the entire line it occupies */ /* previously fully opaque over the entire line it occupies */
@ -409,7 +437,10 @@ evas_object_line_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protect
} }
static int static int
evas_object_line_is_inside(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED) 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)
{ {
/* this returns 1 if the canvas co-ordinates are inside the object based */ /* this returns 1 if the canvas co-ordinates are inside the object based */
/* on object private data. not much use for rects, but for polys, images */ /* on object private data. not much use for rects, but for polys, images */
@ -418,7 +449,10 @@ evas_object_line_is_inside(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protecte
} }
static int static int
evas_object_line_was_inside(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED) 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)
{ {
/* this returns 1 if the canvas co-ordinates were inside the object based */ /* this returns 1 if the canvas co-ordinates were inside the object based */
/* on object private data. not much use for rects, but for polys, images */ /* on object private data. not much use for rects, but for polys, images */
@ -427,9 +461,11 @@ evas_object_line_was_inside(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protect
} }
static void static void
evas_object_line_coords_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_line_coords_recalc(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Line *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Line *o = type_private_data;
o->cur.cache.x1 = obj->cur->geometry.x + o->cur.x1; 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.y1 = obj->cur->geometry.y + o->cur.y1;
@ -444,7 +480,6 @@ _class_constructor(Eo_Class *klass)
{ {
const Eo_Op_Func_Description func_desc[] = { const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor), EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
EO_OP_FUNC(EVAS_OBJ_LINE_ID(EVAS_OBJ_LINE_SUB_ID_XY_SET), _line_xy_set), EO_OP_FUNC(EVAS_OBJ_LINE_ID(EVAS_OBJ_LINE_SUB_ID_XY_SET), _line_xy_set),
EO_OP_FUNC(EVAS_OBJ_LINE_ID(EVAS_OBJ_LINE_SUB_ID_XY_GET), _line_xy_get), EO_OP_FUNC(EVAS_OBJ_LINE_ID(EVAS_OBJ_LINE_SUB_ID_XY_GET), _line_xy_get),
EO_OP_FUNC_SENTINEL EO_OP_FUNC_SENTINEL

View File

@ -168,7 +168,7 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
evas_object_smart_cleanup(eo_obj); evas_object_smart_cleanup(eo_obj);
if (obj->func->free) if (obj->func->free)
{ {
obj->func->free(eo_obj, obj); obj->func->free(eo_obj, obj, obj->private_data);
} }
if (!was_smart_child) evas_object_release(eo_obj, obj, obj->clean_layer); if (!was_smart_child) evas_object_release(eo_obj, obj, obj->clean_layer);
if (obj->clip.clipees) if (obj->clip.clipees)
@ -194,6 +194,8 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
eina_cow_free(evas_object_map_cow, obj->map); eina_cow_free(evas_object_map_cow, obj->map);
eina_cow_free(evas_object_state_cow, obj->cur); eina_cow_free(evas_object_state_cow, obj->cur);
eina_cow_free(evas_object_state_cow, obj->prev); eina_cow_free(evas_object_state_cow, obj->prev);
eo_data_unref(eo_obj, obj->private_data);
obj->private_data = NULL;
eo_manual_free(eo_obj); eo_manual_free(eo_obj);
} }
@ -517,7 +519,7 @@ evas_object_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
if (obj->prev->cache.clip.a == 255) if (obj->prev->cache.clip.a == 255)
{ {
if (obj->func->was_opaque) if (obj->func->was_opaque)
return obj->func->was_opaque(eo_obj, obj); return obj->func->was_opaque(eo_obj, obj, obj->private_data);
return 1; return 1;
} }
return 0; return 0;
@ -528,7 +530,7 @@ evas_object_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas
{ {
if (obj->is_smart) return 0; if (obj->is_smart) return 0;
if (obj->func->is_inside) if (obj->func->is_inside)
return obj->func->is_inside(eo_obj, obj, x, y); return obj->func->is_inside(eo_obj, obj, obj->private_data, x, y);
return 0; return 0;
} }
@ -537,7 +539,7 @@ evas_object_was_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Eva
{ {
if (obj->is_smart) return 0; if (obj->is_smart) return 0;
if (obj->func->was_inside) if (obj->func->was_inside)
return obj->func->was_inside(eo_obj, obj, x, y); return obj->func->was_inside(eo_obj, obj, obj->private_data, x, y);
return 0; return 0;
} }
/* routines apps will call */ /* routines apps will call */
@ -664,6 +666,7 @@ _destructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
end: end:
evas_object_event_callback_all_del(eo_obj); evas_object_event_callback_all_del(eo_obj);
evas_object_event_callback_cleanup(eo_obj); evas_object_event_callback_cleanup(eo_obj);
eo_do_super(eo_obj, MY_CLASS, eo_destructor()); eo_do_super(eo_obj, MY_CLASS, eo_destructor());
} }
@ -1706,7 +1709,7 @@ _scale_set(Eo *eo_obj, void *_pd, va_list *list)
EINA_COW_STATE_WRITE_END(obj, state_write, cur); EINA_COW_STATE_WRITE_END(obj, state_write, cur);
evas_object_change(eo_obj, obj); evas_object_change(eo_obj, obj);
if (obj->func->scale_update) obj->func->scale_update(eo_obj); if (obj->func->scale_update) obj->func->scale_update(eo_obj, obj, obj->private_data);
} }
EAPI double EAPI double

View File

@ -32,19 +32,39 @@ struct _Evas_Polygon_Point
/* private methods for polygon objects */ /* private methods for polygon objects */
static void evas_object_polygon_init(Evas_Object *eo_obj); static void evas_object_polygon_init(Evas_Object *eo_obj);
static void evas_object_polygon_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); static void evas_object_polygon_render(Evas_Object *eo_obj,
static void evas_object_polygon_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static void evas_object_polygon_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *type_private_data,
static void evas_object_polygon_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *output, void *context, void *surface,
int x, int y, Eina_Bool do_async);
static void evas_object_polygon_free(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_polygon_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_polygon_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static unsigned int evas_object_polygon_id_get(Evas_Object *eo_obj); static unsigned int evas_object_polygon_id_get(Evas_Object *eo_obj);
static unsigned int evas_object_polygon_visual_id_get(Evas_Object *eo_obj); static unsigned int evas_object_polygon_visual_id_get(Evas_Object *eo_obj);
static void *evas_object_polygon_engine_data_get(Evas_Object *eo_obj); static void *evas_object_polygon_engine_data_get(Evas_Object *eo_obj);
static int evas_object_polygon_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static int evas_object_polygon_is_opaque(Evas_Object *eo_obj,
static int evas_object_polygon_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static int evas_object_polygon_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord x, Evas_Coord y); void *type_private_data);
static int evas_object_polygon_was_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord x, Evas_Coord y); static int evas_object_polygon_was_opaque(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static int evas_object_polygon_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_polygon_was_inside(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data,
Evas_Coord x, Evas_Coord y);
static const Evas_Object_Func object_func = static const Evas_Object_Func object_func =
{ {
@ -273,6 +293,7 @@ evas_object_polygon_init(Evas_Object *eo_obj)
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
/* set up methods (compulsory) */ /* set up methods (compulsory) */
obj->func = &object_func; obj->func = &object_func;
obj->private_data = eo_data_ref(eo_obj, MY_CLASS);
obj->type = o_type; obj->type = o_type;
} }
@ -280,14 +301,17 @@ static void
_destructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) _destructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{ {
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
evas_object_polygon_free(eo_obj, obj);
evas_object_polygon_free(eo_obj, obj, obj->private_data);
eo_do_super(eo_obj, MY_CLASS, eo_destructor()); eo_do_super(eo_obj, MY_CLASS, eo_destructor());
} }
static void static void
evas_object_polygon_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_polygon_free(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Polygon *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Polygon *o = type_private_data;
void *list_data; void *list_data;
/* free obj */ /* free obj */
EINA_LIST_FREE(o->points, list_data) EINA_LIST_FREE(o->points, list_data)
@ -300,9 +324,12 @@ evas_object_polygon_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
} }
static void static void
evas_object_polygon_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async) evas_object_polygon_render(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data,
void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
{ {
Evas_Object_Polygon *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Polygon *o = type_private_data;
Eina_List *l; Eina_List *l;
Evas_Polygon_Point *p; Evas_Polygon_Point *p;
@ -343,9 +370,11 @@ evas_object_polygon_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
} }
static void static void
evas_object_polygon_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_polygon_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Polygon *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Polygon *o = type_private_data;
int is_v, was_v; int is_v, was_v;
/* dont pre-render the obj twice! */ /* dont pre-render the obj twice! */
@ -361,7 +390,9 @@ evas_object_polygon_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *
{ {
if (obj->cur->cache.clip.dirty) if (obj->cur->cache.clip.dirty)
evas_object_clip_recalc(obj->cur->clipper); evas_object_clip_recalc(obj->cur->clipper);
obj->cur->clipper->func->render_pre(obj->cur->clipper->object, obj->cur->clipper); obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
obj->cur->clipper,
obj->cur->clipper->private_data);
} }
/* now figure what changed and add draw rects */ /* now figure what changed and add draw rects */
/* if it just became visible or invisible */ /* if it just became visible or invisible */
@ -433,7 +464,9 @@ evas_object_polygon_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *
} }
static void static void
evas_object_polygon_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_polygon_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this moves the current data to the previous state parts of the object */ /* 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 */ /* in whatever way is safest for the object. also if we don't need object */
@ -465,7 +498,9 @@ static void *evas_object_polygon_engine_data_get(Evas_Object *eo_obj)
} }
static int static int
evas_object_polygon_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_polygon_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object is */ /* this returns 1 if the internal object data implies that the object is */
/* currently fully opaque over the entire line it occupies */ /* currently fully opaque over the entire line it occupies */
@ -473,7 +508,9 @@ evas_object_polygon_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Prote
} }
static int static int
evas_object_polygon_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_polygon_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object was */ /* this returns 1 if the internal object data implies that the object was */
/* previously fully opaque over the entire line it occupies */ /* previously fully opaque over the entire line it occupies */
@ -484,9 +521,12 @@ evas_object_polygon_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Prot
* intersects with. If it's even, we are outside of the polygon, if it's odd, * intersects with. If it's even, we are outside of the polygon, if it's odd,
* we are inside of it. */ * we are inside of it. */
static int static int
evas_object_polygon_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_Coord x, Evas_Coord y) evas_object_polygon_is_inside(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data,
Evas_Coord x, Evas_Coord y)
{ {
Evas_Object_Polygon *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Polygon *o = type_private_data;
int num_edges = 0; /* Number of edges we crossed */ int num_edges = 0; /* Number of edges we crossed */
Eina_List *itr; Eina_List *itr;
Evas_Polygon_Point *p; Evas_Polygon_Point *p;
@ -537,7 +577,10 @@ evas_object_polygon_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *o
} }
static int static int
evas_object_polygon_was_inside(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED) evas_object_polygon_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)
{ {
/* this returns 1 if the canvas co-ordinates were inside the object based */ /* this returns 1 if the canvas co-ordinates were inside the object based */
/* on object private data. not much use for rects, but for polys, images */ /* on object private data. not much use for rects, but for polys, images */

View File

@ -22,16 +22,28 @@ struct _Evas_Object_Rectangle
/* private methods for rectangle objects */ /* private methods for rectangle objects */
static void evas_object_rectangle_init(Evas_Object *eo_obj); static void evas_object_rectangle_init(Evas_Object *eo_obj);
static void evas_object_rectangle_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); static void evas_object_rectangle_render(Evas_Object *eo_obj,
static void evas_object_rectangle_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static void evas_object_rectangle_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *type_private_data,
void *output, void *context, void *surface,
int x, int y, Eina_Bool do_async);
static void evas_object_rectangle_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_rectangle_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static unsigned int evas_object_rectangle_id_get(Evas_Object *eo_obj); static unsigned int evas_object_rectangle_id_get(Evas_Object *eo_obj);
static unsigned int evas_object_rectangle_visual_id_get(Evas_Object *eo_obj); static unsigned int evas_object_rectangle_visual_id_get(Evas_Object *eo_obj);
static void *evas_object_rectangle_engine_data_get(Evas_Object *eo_obj); static void *evas_object_rectangle_engine_data_get(Evas_Object *eo_obj);
static int evas_object_rectangle_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static int evas_object_rectangle_is_opaque(Evas_Object *eo_obj,
static int evas_object_rectangle_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
void *type_private_data);
static int evas_object_rectangle_was_opaque(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
#if 0 /* usless calls for a rect object. much more useful for images etc. */ #if 0 /* usless calls for a rect object. much more useful for images etc. */
static void evas_object_rectangle_store(Evas_Object *eo_obj); static void evas_object_rectangle_store(Evas_Object *eo_obj);
@ -99,17 +111,15 @@ evas_object_rectangle_init(Evas_Object *eo_obj)
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
/* set up methods (compulsory) */ /* set up methods (compulsory) */
obj->func = &object_func; obj->func = &object_func;
obj->private_data = eo_data_ref(eo_obj, MY_CLASS);
obj->type = o_type; obj->type = o_type;
} }
static void static void
_destructor(Eo *eo_obj, void *_obj EINA_UNUSED, va_list *list EINA_UNUSED) evas_object_rectangle_render(Evas_Object *eo_obj EINA_UNUSED,
{ Evas_Object_Protected_Data *obj,
eo_do_super(eo_obj, MY_CLASS, eo_destructor()); void *type_private_data EINA_UNUSED,
} void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
static void
evas_object_rectangle_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
{ {
/* render object to surface with context, and offxet by x,y */ /* render object to surface with context, and offxet by x,y */
obj->layer->evas->engine.func->context_color_set(output, obj->layer->evas->engine.func->context_color_set(output,
@ -137,7 +147,9 @@ evas_object_rectangle_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protec
} }
static void static void
evas_object_rectangle_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_rectangle_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data EINA_UNUSED)
{ {
int is_v, was_v; int is_v, was_v;
@ -154,7 +166,9 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data
{ {
if (obj->cur->cache.clip.dirty) if (obj->cur->cache.clip.dirty)
evas_object_clip_recalc(obj->cur->clipper); evas_object_clip_recalc(obj->cur->clipper);
obj->cur->clipper->func->render_pre(obj->cur->clipper->object, obj->cur->clipper); obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
obj->cur->clipper,
obj->cur->clipper->private_data);
} }
/* now figure what changed and add draw rects */ /* now figure what changed and add draw rects */
/* if it just became visible or invisible */ /* if it just became visible or invisible */
@ -241,7 +255,9 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data
} }
static void static void
evas_object_rectangle_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_rectangle_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this moves the current data to the previous state parts of the object */ /* this moves the current data to the previous state parts of the object */
@ -254,7 +270,9 @@ evas_object_rectangle_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Dat
} }
static int static int
evas_object_rectangle_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) evas_object_rectangle_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object is */ /* this returns 1 if the internal object data implies that the object is */
/* currently fully opaque over the entire rectangle it occupies */ /* currently fully opaque over the entire rectangle it occupies */
@ -267,7 +285,9 @@ evas_object_rectangle_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro
} }
static int static int
evas_object_rectangle_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) evas_object_rectangle_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object was */ /* this returns 1 if the internal object data implies that the object was */
/* previously fully opaque over the entire rectangle it occupies */ /* previously fully opaque over the entire rectangle it occupies */
@ -303,7 +323,6 @@ _class_constructor(Eo_Class *klass)
{ {
const Eo_Op_Func_Description func_desc[] = { const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor), EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
EO_OP_FUNC_SENTINEL EO_OP_FUNC_SENTINEL
}; };

View File

@ -61,9 +61,17 @@ _eo_evas_smart_cb(void *data, Eo *eo_obj, const Eo_Event_Description *desc EINA_
/* private methods for smart objects */ /* private methods for smart objects */
static void evas_object_smart_init(Evas_Object *eo_obj); static void evas_object_smart_init(Evas_Object *eo_obj);
static void evas_object_smart_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); static void evas_object_smart_render(Evas_Object *eo_obj,
static void evas_object_smart_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static void evas_object_smart_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *type_private_data,
void *output, void *context, void *surface,
int x, int y, Eina_Bool do_async);
static void evas_object_smart_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_smart_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static unsigned int evas_object_smart_id_get(Evas_Object *eo_obj); static unsigned int evas_object_smart_id_get(Evas_Object *eo_obj);
static unsigned int evas_object_smart_visual_id_get(Evas_Object *eo_obj); static unsigned int evas_object_smart_visual_id_get(Evas_Object *eo_obj);
@ -1565,16 +1573,19 @@ evas_object_smart_init(Evas_Object *eo_obj)
obj->is_smart = EINA_TRUE; obj->is_smart = EINA_TRUE;
/* set up methods (compulsory) */ /* set up methods (compulsory) */
obj->func = &object_func; obj->func = &object_func;
obj->private_data = eo_data_ref(eo_obj, MY_CLASS);
} }
static void static void
evas_object_smart_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, void *output EINA_UNUSED, void *context EINA_UNUSED, void *surface EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, Eina_Bool do_async EINA_UNUSED) evas_object_smart_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, void *type_private_data EINA_UNUSED, void *output EINA_UNUSED, void *context EINA_UNUSED, void *surface EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, Eina_Bool do_async EINA_UNUSED)
{ {
return; return;
} }
static void static void
evas_object_smart_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_smart_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data EINA_UNUSED)
{ {
if (obj->pre_render_done) return; if (obj->pre_render_done) return;
if (!obj->child_has_map && !obj->cur->cached_surface) if (!obj->child_has_map && !obj->cur->cached_surface)
@ -1584,7 +1595,7 @@ evas_object_smart_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
Evas_Object_Smart *o; Evas_Object_Smart *o;
fprintf(stderr, ""); fprintf(stderr, "");
o = (Evas_Object_Smart *)(obj->object_data); o = type_private_data;
if (/* o->member_count > 1 && */ if (/* o->member_count > 1 && */
o->cur.bounding_box.w == o->prev.bounding_box.w && o->cur.bounding_box.w == o->prev.bounding_box.w &&
obj->cur->bounding_box.h == obj->prev->bounding_box.h && obj->cur->bounding_box.h == obj->prev->bounding_box.h &&
@ -1658,9 +1669,9 @@ evas_object_smart_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
} }
static void static void
evas_object_smart_render_post(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_smart_render_post(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, void *type_private_data)
{ {
Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Smart *o = type_private_data;
evas_object_cur_prev(eo_obj); evas_object_cur_prev(eo_obj);
o->prev = o->cur; o->prev = o->cur;
} }

View File

@ -72,19 +72,33 @@ struct _Evas_Object_Text_Item
/* private methods for text objects */ /* private methods for text objects */
static void evas_object_text_init(Evas_Object *eo_obj); static void evas_object_text_init(Evas_Object *eo_obj);
static void evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); static void evas_object_text_render(Evas_Object *eo_obj,
static void evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static void evas_object_text_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *type_private_data,
static void evas_object_text_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
static void evas_object_text_free(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj);
static void evas_object_text_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_text_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static unsigned int evas_object_text_id_get(Evas_Object *eo_obj); static unsigned int evas_object_text_id_get(Evas_Object *eo_obj);
static unsigned int evas_object_text_visual_id_get(Evas_Object *eo_obj); static unsigned int evas_object_text_visual_id_get(Evas_Object *eo_obj);
static void *evas_object_text_engine_data_get(Evas_Object *eo_obj); static void *evas_object_text_engine_data_get(Evas_Object *eo_obj);
static int evas_object_text_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static int evas_object_text_is_opaque(Evas_Object *eo_obj,
static int evas_object_text_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
void *type_private_data);
static int evas_object_text_was_opaque(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_text_scale_update(Evas_Object *eo_obj); static void evas_object_text_scale_update(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text); static void _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text);
static const Evas_Object_Func object_func = static const Evas_Object_Func object_func =
@ -1878,9 +1892,10 @@ evas_object_text_init(Evas_Object *eo_obj)
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
/* set up methods (compulsory) */ /* set up methods (compulsory) */
obj->func = &object_func; obj->func = &object_func;
obj->private_data = eo_data_ref(eo_obj, MY_CLASS);
obj->type = o_type; obj->type = o_type;
Evas_Object_Text *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Text *o = obj->private_data;
/* alloc obj private data */ /* alloc obj private data */
o->cur.ellipsis = -1.0; o->cur.ellipsis = -1.0;
o->prev = o->cur; o->prev = o->cur;
@ -1936,10 +1951,13 @@ evas_font_draw_async_check(Evas_Object_Protected_Data *obj,
} }
static void static void
evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async) evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data,
void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
{ {
int i, j; int i, j;
Evas_Object_Text *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Text *o = type_private_data;
Evas_Object_Text_Item *it; Evas_Object_Text_Item *it;
const char vals[5][5] = const char vals[5][5] =
{ {
@ -2183,9 +2201,11 @@ evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, vo
} }
static void static void
evas_object_text_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_text_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Text *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Text *o = type_private_data;
int is_v = 0, was_v = 0; int is_v = 0, was_v = 0;
/* dont pre-render the obj twice! */ /* dont pre-render the obj twice! */
if (obj->pre_render_done) return; if (obj->pre_render_done) return;
@ -2200,7 +2220,9 @@ evas_object_text_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
{ {
if (obj->cur->cache.clip.dirty) if (obj->cur->cache.clip.dirty)
evas_object_clip_recalc(obj->cur->clipper); evas_object_clip_recalc(obj->cur->clipper);
obj->cur->clipper->func->render_pre(obj->cur->clipper->object, obj->cur->clipper); obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
obj->cur->clipper,
obj->cur->clipper->private_data);
} }
/* If object size changed and ellipsis is set */ /* If object size changed and ellipsis is set */
if (((o->cur.ellipsis >= 0.0 || if (((o->cur.ellipsis >= 0.0 ||
@ -2281,7 +2303,9 @@ evas_object_text_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
} }
static void static void
evas_object_text_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_text_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this moves the current data to the previous state parts of the object /* 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 in whatever way is safest for the object. also if we don't need object
@ -2317,7 +2341,9 @@ evas_object_text_engine_data_get(Evas_Object *eo_obj)
} }
static int static int
evas_object_text_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_text_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object is /* this returns 1 if the internal object data implies that the object is
currently fully opaque over the entire gradient it occupies */ currently fully opaque over the entire gradient it occupies */
@ -2325,7 +2351,9 @@ evas_object_text_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protecte
} }
static int static int
evas_object_text_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_text_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object was /* this returns 1 if the internal object data implies that the object was
currently fully opaque over the entire gradient it occupies */ currently fully opaque over the entire gradient it occupies */
@ -2333,9 +2361,11 @@ evas_object_text_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protect
} }
static void static void
evas_object_text_scale_update(Evas_Object *eo_obj) evas_object_text_scale_update(Evas_Object *eo_obj,
Evas_Object_Protected_Data *pd EINA_UNUSED,
void *type_private_data)
{ {
Evas_Object_Text *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Text *o = type_private_data;
int size; int size;
const char *font; const char *font;

View File

@ -508,22 +508,38 @@ struct _Evas_Object_Textblock
/* private methods for textblock objects */ /* private methods for textblock objects */
static void evas_object_textblock_init(Evas_Object *eo_obj); static void evas_object_textblock_init(Evas_Object *eo_obj);
static void evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); static void evas_object_textblock_render(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data,
void *output, void *context, void *surface,
int x, int y, Eina_Bool do_async);
static void evas_object_textblock_free(Evas_Object *eo_obj); static void evas_object_textblock_free(Evas_Object *eo_obj);
static void evas_object_textblock_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static void evas_object_textblock_render_pre(Evas_Object *eo_obj,
static void evas_object_textblock_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_textblock_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static Evas_Object_Textblock_Node_Text *_evas_textblock_node_text_new(void); static Evas_Object_Textblock_Node_Text *_evas_textblock_node_text_new(void);
static unsigned int evas_object_textblock_id_get(Evas_Object *eo_obj); static unsigned int evas_object_textblock_id_get(Evas_Object *eo_obj);
static unsigned int evas_object_textblock_visual_id_get(Evas_Object *eo_obj); static unsigned int evas_object_textblock_visual_id_get(Evas_Object *eo_obj);
static void *evas_object_textblock_engine_data_get(Evas_Object *eo_obj); static void *evas_object_textblock_engine_data_get(Evas_Object *eo_obj);
static int evas_object_textblock_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static int evas_object_textblock_is_opaque(Evas_Object *eo_obj,
static int evas_object_textblock_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
void *type_private_data);
static int evas_object_textblock_was_opaque(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_textblock_coords_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static void evas_object_textblock_coords_recalc(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_textblock_scale_update(Evas_Object *eo_obj); static void evas_object_textblock_scale_update(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static const Evas_Object_Func object_func = static const Evas_Object_Func object_func =
{ {
@ -5162,9 +5178,17 @@ evas_object_textblock_add(Evas *e)
static void static void
_constructor(Eo *eo_obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) _constructor(Eo *eo_obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
{ {
eo_do_super(eo_obj, MY_CLASS, eo_constructor());
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
Evas_Object_Textblock *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textblock *o;
eo_do_super(eo_obj, MY_CLASS, eo_constructor());
/* set up methods (compulsory) */
obj->func = &object_func;
obj->private_data = eo_data_ref(eo_obj, MY_CLASS);
obj->type = o_type;
o = obj->private_data;
o->cursor = calloc(1, sizeof(Evas_Textblock_Cursor)); o->cursor = calloc(1, sizeof(Evas_Textblock_Cursor));
_format_command_init(); _format_command_init();
evas_object_textblock_init(eo_obj); evas_object_textblock_init(eo_obj);
@ -10348,7 +10372,7 @@ static void
_workaround_object_coords_recalc(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo_obj, void *event_info EINA_UNUSED) _workaround_object_coords_recalc(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *eo_obj, void *event_info EINA_UNUSED)
{ {
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
evas_object_textblock_coords_recalc(eo_obj, obj); evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data);
} }
/* all nice and private */ /* all nice and private */
@ -10356,8 +10380,9 @@ static void
evas_object_textblock_init(Evas_Object *eo_obj) evas_object_textblock_init(Evas_Object *eo_obj)
{ {
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
Evas_Object_Textblock *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textblock *o;
static Eina_Bool linebreak_init = EINA_FALSE; static Eina_Bool linebreak_init = EINA_FALSE;
if (!linebreak_init) if (!linebreak_init)
{ {
linebreak_init = EINA_TRUE; linebreak_init = EINA_TRUE;
@ -10365,10 +10390,7 @@ evas_object_textblock_init(Evas_Object *eo_obj)
init_wordbreak(); init_wordbreak();
} }
/* set up methods (compulsory) */ o = obj->private_data;
obj->func = &object_func;
obj->type = o_type;
o->cursor->obj = eo_obj; o->cursor->obj = eo_obj;
evas_object_textblock_text_markup_set(eo_obj, ""); evas_object_textblock_text_markup_set(eo_obj, "");
@ -10412,11 +10434,15 @@ evas_object_textblock_free(Evas_Object *eo_obj)
static void static void
evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async) evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data,
void *output, void *context, void *surface,
int x, int y, Eina_Bool do_async)
{ {
Evas_Object_Textblock_Paragraph *par, *start = NULL; Evas_Object_Textblock_Paragraph *par, *start = NULL;
Evas_Object_Textblock_Line *ln; Evas_Object_Textblock_Line *ln;
Evas_Object_Textblock *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textblock *o = type_private_data;
int i, j; int i, j;
int cx, cy, cw, ch, clip; int cx, cy, cw, ch, clip;
const char vals[5][5] = const char vals[5][5] =
@ -10809,9 +10835,11 @@ evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
} }
static void static void
evas_object_textblock_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_textblock_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Textblock *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textblock *o = type_private_data;
int is_v, was_v; int is_v, was_v;
/* dont pre-render the obj twice! */ /* dont pre-render the obj twice! */
@ -10852,7 +10880,8 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data
if (obj->cur->cache.clip.dirty) if (obj->cur->cache.clip.dirty)
evas_object_clip_recalc(obj->cur->clipper); evas_object_clip_recalc(obj->cur->clipper);
obj->cur->clipper->func->render_pre(obj->cur->clipper->object, obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
obj->cur->clipper); obj->cur->clipper,
obj->cur->clipper->private_data);
} }
/* now figure what changed and add draw rects */ /* now figure what changed and add draw rects */
/* if it just became visible or invisible */ /* if it just became visible or invisible */
@ -10910,7 +10939,9 @@ done:
} }
static void static void
evas_object_textblock_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_textblock_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* Evas_Object_Textblock *o; */ /* Evas_Object_Textblock *o; */
@ -10947,7 +10978,9 @@ static void *evas_object_textblock_engine_data_get(Evas_Object *eo_obj)
} }
static int static int
evas_object_textblock_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_textblock_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object is */ /* this returns 1 if the internal object data implies that the object is */
/* currently fulyl opque over the entire gradient it occupies */ /* currently fulyl opque over the entire gradient it occupies */
@ -10955,7 +10988,9 @@ evas_object_textblock_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro
} }
static int static int
evas_object_textblock_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_textblock_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object was */ /* this returns 1 if the internal object data implies that the object was */
/* currently fulyl opque over the entire gradient it occupies */ /* currently fulyl opque over the entire gradient it occupies */
@ -10963,9 +10998,11 @@ evas_object_textblock_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pr
} }
static void static void
evas_object_textblock_coords_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_textblock_coords_recalc(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
Evas_Object_Textblock *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textblock *o = type_private_data;
if ((obj->cur->geometry.w != o->last_w) || if ((obj->cur->geometry.w != o->last_w) ||
(((o->valign != 0.0) || (o->have_ellipsis)) && (((o->valign != 0.0) || (o->have_ellipsis)) &&
(obj->cur->geometry.h != o->last_h))) (obj->cur->geometry.h != o->last_h)))
@ -10976,9 +11013,11 @@ evas_object_textblock_coords_recalc(Evas_Object *eo_obj, Evas_Object_Protected_D
} }
static void static void
evas_object_textblock_scale_update(Evas_Object *eo_obj) evas_object_textblock_scale_update(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data)
{ {
Evas_Object_Textblock *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textblock *o = type_private_data;
_evas_textblock_invalidate_all(o); _evas_textblock_invalidate_all(o);
_evas_textblock_changed(o, eo_obj); _evas_textblock_changed(o, eo_obj);
o->last_w = -1; o->last_w = -1;

View File

@ -114,18 +114,32 @@ struct _Evas_Object_Textgrid_Line
/* private methods for textgrid objects */ /* private methods for textgrid objects */
static void evas_object_textgrid_init(Evas_Object *eo_obj); static void evas_object_textgrid_init(Evas_Object *eo_obj);
static void evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); static void evas_object_textgrid_render(Evas_Object *eo_obj,
static void evas_object_textgrid_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
static void evas_object_textgrid_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); void *type_private_data,
void *output, void *context, void *surface,
int x, int y, Eina_Bool do_async);
static void evas_object_textgrid_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_textgrid_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static unsigned int evas_object_textgrid_id_get(Evas_Object *eo_obj); static unsigned int evas_object_textgrid_id_get(Evas_Object *eo_obj);
static unsigned int evas_object_textgrid_visual_id_get(Evas_Object *eo_obj); static unsigned int evas_object_textgrid_visual_id_get(Evas_Object *eo_obj);
static void *evas_object_textgrid_engine_data_get(Evas_Object *eo_obj); static void *evas_object_textgrid_engine_data_get(Evas_Object *eo_obj);
static int evas_object_textgrid_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); static int evas_object_textgrid_is_opaque(Evas_Object *eo_obj,
static int evas_object_textgrid_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); Evas_Object_Protected_Data *obj,
void *type_private_data);
static int evas_object_textgrid_was_opaque(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data);
static void evas_object_textgrid_scale_update(Evas_Object *eo_obj); static void evas_object_textgrid_scale_update(Evas_Object *eo_obj,
Evas_Object_Protected_Data *pd,
void *type_private_data);
static const Evas_Object_Func object_func = static const Evas_Object_Func object_func =
{ {
@ -344,9 +358,10 @@ evas_object_textgrid_init(Evas_Object *eo_obj)
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
/* set up methods (compulsory) */ /* set up methods (compulsory) */
obj->func = &object_func; obj->func = &object_func;
obj->private_data = eo_data_ref(eo_obj, MY_CLASS);
obj->type = o_type; obj->type = o_type;
Evas_Object_Textgrid *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textgrid *o = obj->private_data;
o->magic = MAGIC_OBJ_TEXTGRID; o->magic = MAGIC_OBJ_TEXTGRID;
o->prev = o->cur; o->prev = o->cur;
eina_array_step_set(&o->cur.palette_standard, sizeof (Eina_Array), 16); eina_array_step_set(&o->cur.palette_standard, sizeof (Eina_Array), 16);
@ -458,6 +473,7 @@ _destructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{ {
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
evas_object_textgrid_free(eo_obj, obj); evas_object_textgrid_free(eo_obj, obj);
eo_data_unref(eo_obj, obj->private_data);
eo_do_super(eo_obj, MY_CLASS, eo_destructor()); eo_do_super(eo_obj, MY_CLASS, eo_destructor());
} }
@ -555,7 +571,10 @@ _drop_glyphs_ref(const void *container EINA_UNUSED, void *data, void *fdata)
} }
static void static void
evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async) evas_object_textgrid_render(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data,
void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
{ {
Evas_Textgrid_Cell *cells; Evas_Textgrid_Cell *cells;
Evas_Object_Textgrid_Color *c; Evas_Object_Textgrid_Color *c;
@ -564,7 +583,7 @@ evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
int rr = 0, rg = 0, rb = 0, ra = 0, rx = 0, rw = 0, run; int rr = 0, rg = 0, rb = 0, ra = 0, rx = 0, rw = 0, run;
/* render object to surface with context, and offset by x,y */ /* render object to surface with context, and offset by x,y */
Evas_Object_Textgrid *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textgrid *o = type_private_data;
ENFN->context_multiplier_unset(output, context); ENFN->context_multiplier_unset(output, context);
ENFN->context_render_op_set(output, context, obj->cur->render_op); ENFN->context_render_op_set(output, context, obj->cur->render_op);
@ -778,9 +797,12 @@ evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
} }
static void static void
evas_object_textgrid_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_textgrid_render_pre(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj,
void *type_private_data)
{ {
int is_v, was_v; int is_v, was_v;
Evas_Object_Textgrid *o = type_private_data;
/* dont pre-render the obj twice! */ /* dont pre-render the obj twice! */
if (obj->pre_render_done) return; if (obj->pre_render_done) return;
@ -790,13 +812,15 @@ evas_object_textgrid_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data
/* elsewhere, decoding video etc. */ /* elsewhere, decoding video etc. */
/* then when this is done the object needs to figure if it changed and */ /* then when this is done the object needs to figure if it changed and */
/* if so what and where and add thr appropriate redraw rectangles */ /* if so what and where and add thr appropriate redraw rectangles */
Evas_Object_Textgrid *o = eo_data_scope_get(eo_obj, MY_CLASS);
/* if someone is clipping this obj - go calculate the clipper */ /* if someone is clipping this obj - go calculate the clipper */
if (obj->cur->clipper) if (obj->cur->clipper)
{ {
if (obj->cur->cache.clip.dirty) if (obj->cur->cache.clip.dirty)
evas_object_clip_recalc(obj->cur->clipper); evas_object_clip_recalc(obj->cur->clipper);
obj->cur->clipper->func->render_pre(obj->cur->clipper->object, obj->cur->clipper); obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
obj->cur->clipper,
obj->cur->clipper->private_data);
} }
/* now figure what changed and add draw rects */ /* now figure what changed and add draw rects */
/* if it just became visible or invisible */ /* if it just became visible or invisible */
@ -903,12 +927,14 @@ evas_object_textgrid_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data
} }
static void static void
evas_object_textgrid_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_textgrid_render_post(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data)
{ {
/* this moves the current data to the previous state parts of the object */ /* 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 */ /* 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 */ /* data anymore we can free it if the object deems this is a good idea */
Evas_Object_Textgrid *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textgrid *o = type_private_data;
/* remove those pesky changes */ /* remove those pesky changes */
evas_object_clip_changes_clean(eo_obj); evas_object_clip_changes_clean(eo_obj);
/* move cur to prev safely for object data */ /* move cur to prev safely for object data */
@ -961,7 +987,9 @@ evas_object_textgrid_engine_data_get(Evas_Object *eo_obj)
} }
static int static int
evas_object_textgrid_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_textgrid_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object is /* this returns 1 if the internal object data implies that the object is
currently fully opaque over the entire gradient it occupies */ currently fully opaque over the entire gradient it occupies */
@ -969,7 +997,9 @@ evas_object_textgrid_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Prot
} }
static int static int
evas_object_textgrid_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) evas_object_textgrid_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
Evas_Object_Protected_Data *obj EINA_UNUSED,
void *type_private_data EINA_UNUSED)
{ {
/* this returns 1 if the internal object data implies that the object was /* this returns 1 if the internal object data implies that the object was
currently fully opaque over the entire gradient it occupies */ currently fully opaque over the entire gradient it occupies */
@ -977,12 +1007,14 @@ evas_object_textgrid_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro
} }
static void static void
evas_object_textgrid_scale_update(Evas_Object *eo_obj) evas_object_textgrid_scale_update(Evas_Object *eo_obj,
Evas_Object_Protected_Data *pd EINA_UNUSED,
void *type_private_data)
{ {
int font_size; int font_size;
const char *font_name; const char *font_name;
Evas_Object_Textgrid *o = eo_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Textgrid *o = type_private_data;
font_name = eina_stringshare_add(o->cur.font_name); font_name = eina_stringshare_add(o->cur.font_name);
font_size = o->cur.font_size; font_size = o->cur.font_size;
if (o->cur.font_name) eina_stringshare_del(o->cur.font_name); if (o->cur.font_name) eina_stringshare_del(o->cur.font_name);

View File

@ -323,7 +323,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
{ {
/* Flag need redraw on proxy too */ /* Flag need redraw on proxy too */
evas_object_clip_recalc(obj); evas_object_clip_recalc(obj);
obj->func->render_pre(eo_obj, obj); obj->func->render_pre(eo_obj, obj, obj->private_data);
if (obj->proxy->redraw) if (obj->proxy->redraw)
_evas_render_prev_cur_clip_cache_add(e, obj); _evas_render_prev_cur_clip_cache_add(e, obj);
if (obj->proxy->proxies) if (obj->proxy->proxies)
@ -335,7 +335,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_proxy) EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_proxy)
{ {
Evas_Object_Protected_Data *proxy = eo_data_scope_get(eo_proxy, EVAS_OBJ_CLASS); Evas_Object_Protected_Data *proxy = eo_data_scope_get(eo_proxy, EVAS_OBJ_CLASS);
proxy->func->render_pre(eo_proxy, proxy); proxy->func->render_pre(eo_proxy, proxy, proxy->private_data);
_evas_render_prev_cur_clip_cache_add(e, proxy); _evas_render_prev_cur_clip_cache_add(e, proxy);
} }
} }
@ -767,7 +767,7 @@ pending_change(void *data, void *gdata EINA_UNUSED)
if (obj->pre_render_done) if (obj->pre_render_done)
{ {
RD(" OBJ [%p] pending change %i -> 0, pre %i\n", obj, obj->changed, obj->pre_render_done); RD(" OBJ [%p] pending change %i -> 0, pre %i\n", obj, obj->changed, obj->pre_render_done);
obj->func->render_post(eo_obj, obj); obj->func->render_post(eo_obj, obj, obj->private_data);
obj->pre_render_done = EINA_FALSE; obj->pre_render_done = EINA_FALSE;
evas_object_change_reset(eo_obj); evas_object_change_reset(eo_obj);
} }
@ -859,7 +859,7 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj)
if (evas_object_is_opaque(eo_current, current) || if (evas_object_is_opaque(eo_current, current) ||
((current->func->has_opaque_rect) && ((current->func->has_opaque_rect) &&
(current->func->has_opaque_rect(eo_current, current)))) (current->func->has_opaque_rect(eo_current, current, current->private_data))))
{ {
/* The object is opaque */ /* The object is opaque */
@ -1234,7 +1234,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
e->engine.func->context_clip_set(e->engine.data.output, e->engine.func->context_clip_set(e->engine.data.output,
ctx, x, y, w, h); ctx, x, y, w, h);
obj->func->render(eo_obj, obj, e->engine.data.output, ctx, obj->func->render(eo_obj, obj, obj->private_data,
e->engine.data.output, ctx,
obj->map->surface, off_x2, off_y2, obj->map->surface, off_x2, off_y2,
EINA_FALSE); EINA_FALSE);
} }
@ -1352,7 +1353,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
proxy_render_data, proxy_render_data,
off_x, off_y); off_x, off_y);
} }
obj->func->render(eo_obj, obj, e->engine.data.output, ctx, obj->func->render(eo_obj, obj, obj->private_data,
e->engine.data.output, ctx,
surface, off_x, off_y, EINA_FALSE); surface, off_x, off_y, EINA_FALSE);
} }
e->engine.func->context_free(e->engine.data.output, ctx); e->engine.func->context_free(e->engine.data.output, ctx);
@ -1384,7 +1386,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
RDI(level); RDI(level);
RD(" draw normal obj\n"); RD(" draw normal obj\n");
obj->func->render(eo_obj, obj, e->engine.data.output, context, surface, obj->func->render(eo_obj, obj, obj->private_data,
e->engine.data.output, context, surface,
off_x, off_y, do_async); off_x, off_y, do_async);
} }
if (obj->changed_map) clean_them = EINA_TRUE; if (obj->changed_map) clean_them = EINA_TRUE;
@ -1439,7 +1442,7 @@ _evas_render_cutout_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, in
{ {
Evas_Coord obx, oby, obw, obh; Evas_Coord obx, oby, obw, obh;
obj->func->get_opaque_rect(obj->object, obj, &obx, &oby, &obw, &obh); obj->func->get_opaque_rect(obj->object, obj, obj->private_data, &obx, &oby, &obw, &obh);
if ((obw > 0) && (obh > 0)) if ((obw > 0) && (obh > 0))
{ {
obx += off_x; obx += off_x;
@ -1573,7 +1576,7 @@ evas_render_updates_internal(Evas *eo_e,
{ {
obj = eina_array_data_get(&e->restack_objects, i); obj = eina_array_data_get(&e->restack_objects, i);
eo_obj = obj->object; eo_obj = obj->object;
obj->func->render_pre(eo_obj, obj); obj->func->render_pre(eo_obj, obj, obj->private_data);
_evas_render_prev_cur_clip_cache_add(e, obj); _evas_render_prev_cur_clip_cache_add(e, obj);
} }
OBJS_ARRAY_CLEAN(&e->restack_objects); OBJS_ARRAY_CLEAN(&e->restack_objects);
@ -1639,7 +1642,7 @@ evas_render_updates_internal(Evas *eo_e,
eo_obj = obj->object; eo_obj = obj->object;
if (UNLIKELY((evas_object_is_opaque(eo_obj, obj) || if (UNLIKELY((evas_object_is_opaque(eo_obj, obj) ||
((obj->func->has_opaque_rect) && ((obj->func->has_opaque_rect) &&
(obj->func->has_opaque_rect(eo_obj, obj)))) && (obj->func->has_opaque_rect(eo_obj, obj, obj->private_data)))) &&
evas_object_is_visible(eo_obj, obj) && evas_object_is_visible(eo_obj, obj) &&
(!obj->clip.clipees) && (!obj->clip.clipees) &&
(obj->cur->visible) && (obj->cur->visible) &&
@ -1839,7 +1842,7 @@ evas_render_updates_internal(Evas *eo_e,
if ((clean_them) || (obj->changed && do_draw)) if ((clean_them) || (obj->changed && do_draw))
{ {
RD(" OBJ [%p] post... func\n", obj); RD(" OBJ [%p] post... func\n", obj);
obj->func->render_post(eo_obj, obj); obj->func->render_post(eo_obj, obj, obj->private_data);
obj->restack = EINA_FALSE; obj->restack = EINA_FALSE;
evas_object_change_reset(eo_obj); evas_object_change_reset(eo_obj);
} }
@ -1865,7 +1868,7 @@ evas_render_updates_internal(Evas *eo_e,
obj->pre_render_done = EINA_FALSE; obj->pre_render_done = EINA_FALSE;
if ((obj->changed) && (do_draw)) if ((obj->changed) && (do_draw))
{ {
obj->func->render_post(eo_obj, obj); obj->func->render_post(eo_obj, obj, obj->private_data);
obj->restack = EINA_FALSE; obj->restack = EINA_FALSE;
evas_object_change_reset(eo_obj); evas_object_change_reset(eo_obj);
} }

View File

@ -69,7 +69,7 @@ evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
if (obj->cur->cache.clip.a == 255) if (obj->cur->cache.clip.a == 255)
{ {
if (obj->func->is_opaque) if (obj->func->is_opaque)
return obj->func->is_opaque(eo_obj, obj); return obj->func->is_opaque(eo_obj, obj, obj->private_data);
return 1; return 1;
} }
if (obj->cur->render_op == EVAS_RENDER_COPY) if (obj->cur->render_op == EVAS_RENDER_COPY)
@ -214,7 +214,7 @@ evas_object_coords_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
//// obj->cur->cache.geometry.h = //// obj->cur->cache.geometry.h =
//// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur->geometry.h) - //// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur->geometry.h) -
//// evas_coord_world_y_to_screen(obj->layer->evas, 0); //// evas_coord_world_y_to_screen(obj->layer->evas, 0);
if (obj->func->coords_recalc) obj->func->coords_recalc(eo_obj, obj); if (obj->func->coords_recalc) obj->func->coords_recalc(eo_obj, obj, obj->private_data);
//// obj->cur->cache.geometry.validity = obj->layer->evas->output_validity; //// obj->cur->cache.geometry.validity = obj->layer->evas->output_validity;
} }

View File

@ -577,6 +577,7 @@ struct _Evas_Object_Protected_Data
} clip; } clip;
const Evas_Object_Func *func; const Evas_Object_Func *func;
void *private_data;
struct { struct {
Evas_Smart *smart; Evas_Smart *smart;
@ -716,10 +717,11 @@ struct _Evas_Device
struct _Evas_Object_Func struct _Evas_Object_Func
{ {
void (*free) (Evas_Object *obj, Evas_Object_Protected_Data *pd); void (*free) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
void (*render) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async); void (*render) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
void (*render_pre) (Evas_Object *obj, Evas_Object_Protected_Data *pd); void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
void (*render_post) (Evas_Object *obj, Evas_Object_Protected_Data *pd); void (*render_pre) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
void (*render_post) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
unsigned int (*type_id_get) (Evas_Object *obj); unsigned int (*type_id_get) (Evas_Object *obj);
unsigned int (*visual_id_get) (Evas_Object *obj); unsigned int (*visual_id_get) (Evas_Object *obj);
@ -731,18 +733,21 @@ struct _Evas_Object_Func
int (*is_visible) (Evas_Object *obj); int (*is_visible) (Evas_Object *obj);
int (*was_visible) (Evas_Object *obj); int (*was_visible) (Evas_Object *obj);
int (*is_opaque) (Evas_Object *obj, Evas_Object_Protected_Data *pd); int (*is_opaque) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
int (*was_opaque) (Evas_Object *obj, Evas_Object_Protected_Data *pd); int (*was_opaque) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
int (*is_inside) (Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord x, Evas_Coord y); int (*is_inside) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
int (*was_inside) (Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord x, Evas_Coord y); Evas_Coord x, Evas_Coord y);
int (*was_inside) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
Evas_Coord x, Evas_Coord y);
void (*coords_recalc) (Evas_Object *obj, Evas_Object_Protected_Data *pd); void (*coords_recalc) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
void (*scale_update) (Evas_Object *obj); void (*scale_update) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
int (*has_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd); int (*has_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
int (*get_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); int (*get_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
int (*can_map) (Evas_Object *obj); int (*can_map) (Evas_Object *obj);
}; };