evas: Add & fix legacy APIs for text filters
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 29 Jun 2016 01:58:57 +0000 (10:58 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 29 Jun 2016 02:02:41 +0000 (11:02 +0900)
Those are marked as EINA_DEPRECATED since they are for legacy only,
and EDC is the preferred method.
Note: these are new in EFL 1.18.

I would rather have not added them as legacy APIs. This patch is
here to align to Tizen which added them by mistake. Also, remove
the "name" argument from filter_program_set as it's not required,
and also not there in Tizen's code base.

Sorry for the mess.

src/lib/evas/Evas_Legacy.h
src/lib/evas/canvas/evas_filter_mixin.c
src/lib/evas/canvas/evas_object_text.c

index 7dc867b..982a29b 100644 (file)
@@ -6608,3 +6608,19 @@ EAPI const Evas_Map *evas_object_map_get(const Evas_Object *obj);
 EAPI void evas_object_map_enable_set(Evas_Object *obj, Eina_Bool enabled);
 
 #include "canvas/efl_gfx_map.eo.legacy.h"
+
+/**
+ * @brief Apply an evas filter program on this text object.
+ *
+ * Note: the preferred method for filters is to edit EDC styles, rather than
+ * calling this API directly.
+ */
+EAPI void evas_object_text_filter_program_set(Evas_Object *obj, const char *code) EINA_DEPRECATED;
+
+/**
+ * @brief Set a named source object for an evas filter program.
+ *
+ * Note: the preferred method for filters is to edit EDC styles, rather than
+ * calling this API directly.
+ */
+EAPI void evas_object_text_filter_source_set(Evas_Object *obj, const char *name, Evas_Object *source) EINA_DEPRECATED;
index f2296f6..46ab765 100644 (file)
@@ -361,9 +361,8 @@ _efl_canvas_filter_internal_efl_gfx_filter_filter_program_set(Eo *eo_obj, Evas_F
    Eina_Bool alpha;
 
    if (!pd) return;
-   if ((pd->data->code == code) && (!name || (pd->data->name == name))) return;
-   if (pd->data->code && code && !strcmp(code, pd->data->code) &&
-       pd->data->name && name && !strcmp(name, pd->data->name)) return;
+   if (eina_streq(pd->data->code, code) && eina_streq(pd->data->name, name))
+     return;
 
    evas_object_async_block(obj);
    fcow = FCOW_BEGIN(pd);
index 59ffdc6..55b3dd5 100644 (file)
@@ -2340,12 +2340,14 @@ _evas_text_efl_gfx_filter_filter_program_set(Eo *obj, Evas_Text_Data *pd EINA_UN
    efl_gfx_filter_program_set(eo_super(obj, MY_CLASS), code, name);
 }
 
+/* deprecated */
 EAPI void
-evas_object_text_filter_program_set(Evas_Object *obj, const char *code, const char *name)
+evas_object_text_filter_program_set(Evas_Object *obj, const char *code)
 {
-   efl_gfx_filter_program_set(obj, code, name);
+   efl_gfx_filter_program_set(obj, code, NULL);
 }
 
+/* deprecated */
 EAPI void
 evas_object_text_filter_source_set(Evas_Object *obj, const char *name, Evas_Object *source)
 {