From dca78f7ffab2c3559ca46b65a87f6a980fb30c03 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Tue, 26 Jan 2016 10:33:31 +0900 Subject: [PATCH] Evas text: Add legacy bindings for evas filters Summary: For backward compatability (on Tizen), the following APIs are added again: evas_object_text_filter_program_set evas_object_text_filter_source_set The best way to use those is still EDC. Test Plan: N/A Reviewers: woohyun, jpeg Reviewed By: jpeg Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3604 Change-Id: I2d98ed3c70f5d7e88e665b9cae4efce8add5c400 --- src/lib/evas/Evas_Legacy.h | 25 +++++++++++++++++++++++++ src/lib/evas/canvas/evas_object_text.c | 12 ++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 5b82b4e..5a69539 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -3166,6 +3166,31 @@ EAPI void evas_object_text_font_set(Eo *obj, const char *font, Evas_Font_Size si */ EAPI void evas_object_text_font_get(const Eo *obj, const char **font, Evas_Font_Size *size); +/** + * @brief Set an evas filter program on this object. + * + * Valid for Text objects at the moment. + * + * The argument passed to this function is a string containing a valid Lua + * program based on the filters API as described in the "Evas filters + * reference" page. + * + * Set to null to disable filtering. + * + * @param[in] code filter program source code + */ +EAPI void evas_object_text_filter_program_set(Eo *obj, const char *code); + +/** + * @brief Bind an object to use as a mask or texture with Evas Filters. + * + * This will create automatically a new RGBA buffer containing the source + * object's pixels (as it is rendered). + * + * @param[in] buffer name as used in the program + * @param[in] source object to use as a proxy source + */ +EAPI void evas_object_text_filter_source_set(Eo *obj, const char *name, Efl_Gfx_Base *eo_source); /** * @} diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index c066a40..d946159 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -2243,4 +2243,16 @@ _evas_text_efl_gfx_filter_program_set(Eo *obj, Evas_Text_Data *pd EINA_UNUSED, c eo_do_super(obj, MY_CLASS, efl_gfx_filter_program_set(code, name)); } +EAPI void +evas_object_text_filter_program_set(Eo *obj, const char *code) +{ + eo_do(obj, efl_gfx_filter_program_set(code, NULL)); +} + +EAPI void +evas_object_text_filter_source_set(Eo *obj, const char *name, Efl_Gfx_Base *eo_source) +{ + eo_do(obj, efl_gfx_filter_source_set(name, eo_source)); +} + #include "canvas/evas_text.eo.c" -- 2.7.4