From 36b0bca4aa01fb99d540164130f984fd0d3b76de Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 11 Feb 2014 15:56:31 +0900 Subject: [PATCH] Evas filters: Add the reference documentation (script language) In Doxygen format, write the reference documentation for the filters. It will contain a few examples only, should serve more as a reference just like edcref. This is for the script language itself, not for the Eo APIs or the internal APIs (those are already documented). --- src/lib/evas/Evas_Eo.h | 24 +- src/lib/evas/filters/evas_filter.c | 2 +- src/lib/evas/filters/evas_filter_curve.c | 4 +- src/lib/evas/filters/evas_filter_parser.c | 607 +++++++++++++++++++--- 4 files changed, 561 insertions(+), 76 deletions(-) diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index 69878f573c..fcd6e0c472 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -2275,21 +2275,35 @@ enum /** * @def evas_obj_text_filter_program_set + * + * Set an Evas filter program on this Text Object. + * If the program fails to compile (syntax error, invalid buffer name, etc...), + * the standard text effects will be applied instead (SHADOW, etc...). + * + * @param[in] program The program code, as defined by the @ref evasfiltersref + * "Evas filters script language". Pass NULL to remove the former program and + * switch back to the standard text effects. + * * @since 1.9 - * @note EXPERIMENTAL code + * @note EXPERIMENTAL FEATURE. This is an unstable API, please use only for testing purposes. + * @see @ref evasfiltersref "Evas filters reference" */ -#define evas_obj_text_filter_program_set(str) EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET), EO_TYPECHECK(const char *, str) +#define evas_obj_text_filter_program_set(program) EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET), EO_TYPECHECK(const char *, program) /** + * @def evas_obj_text_filter_source_set * - * Bind an object to use as a mask or texture in special filter + * 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] name Object name as used in the program code * @param[in] obj Eo object to use through proxy rendering * * @see evas_obj_text_filter_program_set - * - * @note EXPERIMENTAL FEATURE. + * @since 1.9 + * @note EXPERIMENTAL FEATURE. This is an unstable API, please use only for testing purposes. + * @see @ref evasfiltersref "Evas filters reference" */ #define evas_obj_text_filter_source_set(name, obj) EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_SOURCE_SET), EO_TYPECHECK(const char *, name), EO_TYPECHECK(Eo *, obj) diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index f2016a251c..d2a3dcded6 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -712,7 +712,7 @@ _command_del(Evas_Filter_Context *ctx, Evas_Filter_Command *cmd) ctx->commands = eina_inlist_remove(ctx->commands, EINA_INLIST_GET(cmd)); switch (cmd->mode) { - case EVAS_FILTER_MODE_CURVE: free(cmd->curve.data); + case EVAS_FILTER_MODE_CURVE: free(cmd->curve.data); break; default: break; } free(cmd); diff --git a/src/lib/evas/filters/evas_filter_curve.c b/src/lib/evas/filters/evas_filter_curve.c index 2f5df07ee0..a88dbc8e84 100644 --- a/src/lib/evas/filters/evas_filter_curve.c +++ b/src/lib/evas/filters/evas_filter_curve.c @@ -41,7 +41,7 @@ _filter_curve_cpu_rgba(Evas_Filter_Command *cmd) return EINA_FALSE; } - // One channel + // One channel (R, G or B) if (offset >= 0) { for (k = len; k; k--, dst++, src++) @@ -49,7 +49,7 @@ _filter_curve_cpu_rgba(Evas_Filter_Command *cmd) return EINA_TRUE; } - // RGB + // All RGB channels if (cmd->curve.channel == EVAS_FILTER_CHANNEL_RGB) { #ifndef WORDS_BIGENDIAN diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index 5968eb6c88..4790e33bb6 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -3,6 +3,217 @@ #define EVAS_FILTER_MODE_GROW (EVAS_FILTER_MODE_LAST+1) +/* Note on the documentation: + * To keep it simple, I'm not using any fancy features, only