-2013-04-26 ChunEon Park (Hermet)
+2013-04-29 ChunEon Park (Hermet)
- * Evas: Fix the proxy object to not be clipped by source clipper.
+ * Evas: Added evas_object_image_source_clip_set()/get().
2013-04-25 Tom Hacohen
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_BACK
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_SCROLL
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_MOUSE
+ * Add evas_object_image_source_clip_set()/get()
Deprecations:
* ecore_x:
* Ecore-X: Fix selection parser to not overrun buffer read by using longs on 64bit.
* Evas: Fix recursive proxy image rendering to just render black
* Evas textblock: Fixed line size calculation when using multiple fonts.
- * Evas: Fix the proxy object to not be clipped by source clipper.
-
EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET,
EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_SET,
EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_GET,
+ EVAS_OBJ_IMAGE_SUB_ID_SOURCE_CLIP_SET,
+ EVAS_OBJ_IMAGE_SUB_ID_SOURCE_CLIP_GET,
EVAS_OBJ_IMAGE_SUB_ID_LAST
};
*
* @param[in] visible in
*
- * @see evas_object_image_source_visible_get
+ * @see evas_object_image_source_visible_set
*/
#define evas_obj_image_source_visible_set(visible) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_SET), EO_TYPECHECK(Eina_Bool, visible)
*
* @param[out] visible out
*
- * @see evas_obj_image_source_visible_set
+ * @see evas_object_image_source_visible_get
*/
#define evas_obj_image_source_visible_get(visible) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET), EO_TYPECHECK(Eina_Bool *, visible)
*
* @param[in] source in
*
- * @see evas_object_image_source_events_get
+ * @see evas_object_image_source_events_set
*/
#define evas_obj_image_source_events_set(source) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_SET), EO_TYPECHECK(Eina_Bool, source)
*
* @param[out] source out
*
- * @see evas_obj_image_source_event_set
+ * @see evas_object_image_source_event_get
*/
#define evas_obj_image_source_events_get(source) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, source)
/**
+ * @def evas_obj_image_source_clip_set
+ * @since 1.8
+ *
+ * Apply the source object's clip to the proxy
+ *
+ * @param[in] clip in
+ *
+ * @see evas_object_image_source_clip_set
+ */
+#define evas_obj_image_source_clip_set(source_clip) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_CLIP_SET), EO_TYPECHECK(Eina_Bool, source_clip)
+
+/**
+ * @def evas_obj_image_source_clip_get
+ * @since 1.8
+ *
+ * Get the state of the source clip
+ *
+ * @param[out] source clip out
+ *
+ * @see evas_object_image_source_clip_get
+ */
+#define evas_obj_image_source_clip_get(source_clip) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_CLIP_GET), EO_TYPECHECK(Eina_Bool *, source_clip)
+
+/**
* @def evas_obj_image_border_set
* @since 1.8
*
EAPI Eina_Bool evas_object_image_source_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
+ * Clip the proxy object with the source object's clipper.
+ *
+ * @param obj Proxy (image) object.
+ * @param source_clip whether @p obj is clipped by the source clipper.
+ * (@c EINA_TRUE) or not (@c EINA_FALSE)
+ *
+ * @see evas_object_clip_set()
+ * @see evas_object_image_source_set()
+ * @since 1.8
+ */
+EAPI void evas_object_image_source_clip_set(Evas_Object *obj, Eina_Bool source_clip) EINA_ARG_NONNULL(1);
+
+/**
+ * Determine whether an object is clipped by source object's clipper.
+ *
+ * @param obj Proxy (image) object.
+ * @return @c EINA_TRUE if source clip is enabled, @c EINA_FALSE otherwise.
+ *
+ * @see evas_object_clip_set()
+ * @see evas_object_image_source_set()
+ * @see evas_object_image_source_clip_set()
+ * @since 1.8
+ */
+EAPI Eina_Bool evas_object_image_source_clip_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+
+/**
* Check if an image object can be animated (have multiple frames)
*
* @param obj Image object
Eina_Bool video_visible : 1;
Eina_Bool created : 1;
Eina_Bool proxyerror : 1;
+ Eina_Bool proxy_src_clip : 1;
};
/* private methods for image objects */
o->pixels = eina_cow_alloc(evas_object_image_pixels_cow);
o->cur = eina_cow_alloc(evas_object_image_state_cow);
o->prev = eina_cow_alloc(evas_object_image_state_cow);
+ o->proxy_src_clip = EINA_TRUE;
cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output,
o->engine_data);
}
EAPI void
+evas_object_image_source_clip_set(Evas_Object *eo_obj, Eina_Bool source_clip)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
+ return;
+ MAGIC_CHECK_END();
+
+ eo_do(eo_obj, evas_obj_image_source_clip_set(source_clip));
+}
+
+static void
+_image_source_clip_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object_Image *o = _pd;
+ Eina_Bool source_clip = va_arg(*list, int);
+ Evas_Object_Protected_Data *src_obj;
+
+ source_clip = !!source_clip;
+ if (o->proxy_src_clip == source_clip) return;
+ o->proxy_src_clip = source_clip;
+
+ if (!o->cur->source) return;
+
+ src_obj = eo_data_get(o->cur->source, EVAS_OBJ_CLASS);
+ evas_object_change(o->cur->source, src_obj);
+}
+
+EAPI Eina_Bool
+evas_object_image_source_clip_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
+ return EINA_FALSE;
+ MAGIC_CHECK_END();
+
+ Eina_Bool source_clip;
+ eo_do((Eo*)eo_obj, evas_obj_image_source_clip_get(&source_clip));
+
+ return source_clip;
+}
+
+static void
+_image_source_clip_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object_Image *o = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = o->proxy_src_clip;
+}
+
+EAPI void
evas_object_image_source_events_set(Evas_Object *eo_obj, Eina_Bool source_events)
{
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
* Used to force a draw if necessary, else just makes sures it's available.
*/
static void
-_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Eina_Bool do_async)
+_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy, Eina_Bool do_async)
{
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
Evas_Object_Protected_Data *source;
evas_render_mapped(e, eo_source, source, ctx, proxy_write->surface,
-source->cur->geometry.x,
-source->cur->geometry.y,
- 1, 0, 0, e->output.w, e->output.h, EINA_TRUE
+ 1, 0, 0, e->output.w, e->output.h, eo_proxy
#ifdef REND_DBG
, 1
#endif
else
{
o->proxyrendering = EINA_TRUE;
- _proxy_subrender(obj->layer->evas->evas, o->cur->source, EINA_FALSE);
+ _proxy_subrender(obj->layer->evas->evas, o->cur->source, eo_obj,
+ EINA_FALSE);
pixels = source->proxy->surface;
imagew = source->proxy->w;
imageh = source->proxy->h;
else
{
o->proxyrendering = EINA_TRUE;
- _proxy_subrender(obj->layer->evas->evas, o->cur->source, EINA_FALSE);
+ _proxy_subrender(obj->layer->evas->evas, o->cur->source, eo_obj,
+ EINA_FALSE);
pixels = source->proxy->surface;
imagew = source->proxy->w;
imageh = source->proxy->h;
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET), _image_source_visible_get),
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_SET), _image_source_events_set),
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_GET), _image_source_events_get),
+ EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_CLIP_SET), _image_source_clip_set),
+ EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_CLIP_GET), _image_source_clip_get),
EO_OP_FUNC_SENTINEL
};
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET, "Get the source object visibility of a given image object being used as a proxy."),
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_SET, "Set the events to be repeated to the source object."),
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_GET, "Get the state of the source events."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_CLIP_SET, "Apply the source object's clip to the proxy"),
+ EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_CLIP_GET, "Get the state of the source clip"),
EO_OP_DESCRIPTION_SENTINEL
};
evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj, void *context,
void *surface, int off_x, int off_y, int mapped, int ecx,
- int ecy, int ecw, int ech, Eina_Bool proxy_render
+ int ecy, int ecw, int ech, Evas_Object *proxy_obj
#ifdef REND_DBG
, int level
#endif
void *ctx;
Evas_Object_Protected_Data *obj2;
Eina_Bool clean_them = EINA_FALSE;
+ Eina_Bool proxy_src_clip = EINA_FALSE;
- if ((!proxy_render) && (evas_object_is_source_invisible(eo_obj, obj)))
+ if ((!proxy_obj) && (evas_object_is_source_invisible(eo_obj, obj)))
return clean_them;
+ if (proxy_obj)
+ eo_do(proxy_obj, evas_obj_image_source_clip_get(&proxy_src_clip));
+
evas_object_clip_recalc(obj);
RDI(level);
if (mapped)
{
- if (!proxy_render)
+ if (!proxy_obj || proxy_src_clip)
{
if ((!evas_object_is_visible(eo_obj, obj)) || (obj->clip.clipees)
|| (obj->cur->have_clipees))
obj->map->surface,
off_x2, off_y2, 1,
ecx, ecy, ecw, ech,
- proxy_render
+ proxy_obj
#ifdef REND_DBG
, level + 1
#endif
obj2, ctx, surface,
off_x, off_y, 1,
ecx, ecy, ecw, ech,
- proxy_render
+ proxy_obj
#ifdef REND_DBG
, level + 1
#endif
RDI(level);
//FIXME: Consider to clip by the proxy clipper.
- if (obj->cur->clipper && !proxy_render)
+ if (obj->cur->clipper && (!proxy_obj || proxy_src_clip))
{
RD(" clip: %i %i %ix%i [%i %i %ix%i]\n",
obj->cur->cache.clip.x + off_x,
else
{
//FIXME: Consider to clip by the proxy clipper.
- if (obj->cur->clipper && !proxy_render)
+ if (obj->cur->clipper && (!proxy_obj || proxy_src_clip))
{
int x, y, w, h;
surface, off_x,
off_y, 0,
cx, cy, cw, ch,
- EINA_FALSE
+ NULL
#ifdef REND_DBG
, 1
#endif
Evas_Object_Protected_Data *source_pd,
void *context, void *surface, int off_x, int off_y,
int mapped, int ecx, int ecy, int ecw, int ech,
- Eina_Bool proxy_render
+ Evas_Object *proxy_obj
#ifdef REND_DBG
, int level
#endif