jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=511049e20da614bd14be2f57f8aa87315b97d69d

commit 511049e20da614bd14be2f57f8aa87315b97d69d
Author: Jean-Philippe Andre <[email protected]>
Date:   Thu Feb 13 17:26:33 2014 +0900

    Evas filters: Improve doc automatization
    
    Include example filter codes from src/examples in Doxygen.
    Use these examples for the generation as well.
---
 doc/previews/Makefile.am                           |  7 ++-
 doc/previews/filter_blend.sh                       |  6 +--
 doc/previews/filter_blur.sh                        |  5 --
 doc/previews/filter_bump.sh                        |  5 --
 doc/previews/filter_curve.sh                       |  6 ---
 doc/previews/filter_example_1.sh                   |  7 ---
 doc/previews/filter_grow.sh                        |  6 ---
 doc/previews/filter_mask.sh                        |  7 ---
 doc/previews/filter_transform.sh                   |  6 ---
 src/examples/evas/filters/filter_blend.txt         |  1 +
 src/examples/evas/filters/filter_blur.txt          |  2 +
 .../examples/evas/filters/filter_bump.txt          |  5 --
 .../examples/evas/filters/filter_curve.txt         |  7 +--
 .../examples/evas/filters/filter_example_1.txt     |  7 +--
 src/examples/evas/filters/filter_grow.txt          |  4 ++
 .../examples/evas/filters/filter_mask.txt          |  7 +--
 src/examples/evas/filters/filter_transform.txt     |  4 ++
 src/lib/evas/filters/evas_filter_parser.c          | 55 +++++-----------------
 18 files changed, 32 insertions(+), 115 deletions(-)

diff --git a/doc/previews/Makefile.am b/doc/previews/Makefile.am
index fbfdd29..dd25cc1 100644
--- a/doc/previews/Makefile.am
+++ b/doc/previews/Makefile.am
@@ -35,7 +35,12 @@ previews-data:
        $(MKDIR_P) $(HTMLDIR)
        @for a in $(PREVIEWS) ; do \
                echo "  GEN      filter_$${a}.png" ; \
-               source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \
+               FONT="Sans" ; \
+               SIZE=24 ; \
+               FILTER=`cat 
${top_srcdir}/src/examples/evas/filters/filter_$${a}.txt` ; \
+               if [ -e ${top_srcdir}/doc/previews/filter_$${a}.sh ] ; then \
+                       source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \
+               fi ; \
                $(top_srcdir)/doc/previews/preview_text_filter "$${TEXT}" 
"$${FILTER}" "$(DATADIR)/filter_$${a}.png" "$${FONT}" "$${SIZE}" ; \
                cp "$(DATADIR)/filter_$${a}.png" "$(HTMLDIR)/" ; \
        done
diff --git a/doc/previews/filter_blend.sh b/doc/previews/filter_blend.sh
index eee0446..0d13cea 100644
--- a/doc/previews/filter_blend.sh
+++ b/doc/previews/filter_blend.sh
@@ -1,5 +1 @@
-TEXT="Blend"
-FONT="Sans:style=bold"
-SIZE=32
-FILTER="blend (color = #3399FF);"
-
+TEXT="Blend Example"
diff --git a/doc/previews/filter_blur.sh b/doc/previews/filter_blur.sh
index a844419..59de6f4 100644
--- a/doc/previews/filter_blur.sh
+++ b/doc/previews/filter_blur.sh
@@ -1,8 +1,3 @@
 TEXT="Blur"
 FONT="Sans:style=bold"
 SIZE=32
-FILTER="
-blur (10, color = black, oy = 5, ox = 5);
-blend ();
-"
-
diff --git a/doc/previews/filter_bump.sh b/doc/previews/filter_bump.sh
index 7fa8787..76862f1 100644
--- a/doc/previews/filter_bump.sh
+++ b/doc/previews/filter_bump.sh
@@ -1,8 +1,3 @@
 TEXT="Bump"
 FONT="Sans:style=bold"
 SIZE=64
-FILTER="
-buffer : a (alpha);
-blur (5, dst = a);
-bump (map = a, compensate = yes, color = cyan, specular = 10.0);
-"
diff --git a/doc/previews/filter_curve.sh b/doc/previews/filter_curve.sh
index 96e3f11..852e165 100644
--- a/doc/previews/filter_curve.sh
+++ b/doc/previews/filter_curve.sh
@@ -1,9 +1,3 @@
 TEXT="Curve"
 FONT="Sans:style=bold"
 SIZE=64
-FILTER="
-buffer : a (alpha);
-blur (4, dst = a);
-curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
-blend(src = a, color = black);
-"
diff --git a/doc/previews/filter_example_1.sh b/doc/previews/filter_example_1.sh
index 0098a6b..dfe587c 100644
--- a/doc/previews/filter_example_1.sh
+++ b/doc/previews/filter_example_1.sh
@@ -1,10 +1,3 @@
 TEXT="Evas Filters"
 FONT="Sans"
 SIZE=50
-FILTER="
-buffer : fat (alpha);
-grow (8, dst = fat);
-blur (12, src = fat, color = darkblue);
-blur (4, color = cyan);
-blend ();
-"
diff --git a/doc/previews/filter_grow.sh b/doc/previews/filter_grow.sh
index b675ab1..7a0b832 100644
--- a/doc/previews/filter_grow.sh
+++ b/doc/previews/filter_grow.sh
@@ -1,9 +1,3 @@
 TEXT="Grow - Contour"
 FONT="Sans:style=bold"
 SIZE=32
-FILTER="
-buffer : fat (alpha);
-grow (4, dst = fat);
-blend (src = fat, color = black);
-blend (color = white);
-"
diff --git a/doc/previews/filter_mask.sh b/doc/previews/filter_mask.sh
index ab22e55..706903e 100644
--- a/doc/previews/filter_mask.sh
+++ b/doc/previews/filter_mask.sh
@@ -1,10 +1,3 @@
 TEXT="Mask"
 FONT="Sans:style=bold"
 SIZE=64
-FILTER="
-buffer: a (alpha);
-blur(5, dst = a);
-curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
-blend(color = black);
-mask(mask = a, color = cyan);
-"
diff --git a/doc/previews/filter_transform.sh b/doc/previews/filter_transform.sh
index 6acd845..7d9f3c4 100644
--- a/doc/previews/filter_transform.sh
+++ b/doc/previews/filter_transform.sh
@@ -1,9 +1,3 @@
 TEXT="Transform - Mirror effect"
 FONT="Sans"
 SIZE=50
-FILTER="
-buffer : t (alpha);
-transform (oy = 20, dst = t);
-blend (src = t, color = silver);
-blend (color = white);
-"
diff --git a/src/examples/evas/filters/filter_blend.txt 
b/src/examples/evas/filters/filter_blend.txt
new file mode 100644
index 0000000..251c8c3
--- /dev/null
+++ b/src/examples/evas/filters/filter_blend.txt
@@ -0,0 +1 @@
+blend (color = #3399FF);
\ No newline at end of file
diff --git a/src/examples/evas/filters/filter_blur.txt 
b/src/examples/evas/filters/filter_blur.txt
new file mode 100644
index 0000000..54b1953
--- /dev/null
+++ b/src/examples/evas/filters/filter_blur.txt
@@ -0,0 +1,2 @@
+blur (10, color = black, oy = 5, ox = 5);
+blend ();
diff --git a/doc/previews/filter_bump.sh 
b/src/examples/evas/filters/filter_bump.txt
similarity index 65%
copy from doc/previews/filter_bump.sh
copy to src/examples/evas/filters/filter_bump.txt
index 7fa8787..8110254 100644
--- a/doc/previews/filter_bump.sh
+++ b/src/examples/evas/filters/filter_bump.txt
@@ -1,8 +1,3 @@
-TEXT="Bump"
-FONT="Sans:style=bold"
-SIZE=64
-FILTER="
 buffer : a (alpha);
 blur (5, dst = a);
 bump (map = a, compensate = yes, color = cyan, specular = 10.0);
-"
diff --git a/doc/previews/filter_curve.sh 
b/src/examples/evas/filters/filter_curve.txt
similarity index 56%
copy from doc/previews/filter_curve.sh
copy to src/examples/evas/filters/filter_curve.txt
index 96e3f11..e2e84f7 100644
--- a/doc/previews/filter_curve.sh
+++ b/src/examples/evas/filters/filter_curve.txt
@@ -1,9 +1,4 @@
-TEXT="Curve"
-FONT="Sans:style=bold"
-SIZE=64
-FILTER="
 buffer : a (alpha);
 blur (4, dst = a);
 curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
-blend(src = a, color = black);
-"
+blend(src = a, color = black);
\ No newline at end of file
diff --git a/doc/previews/filter_example_1.sh 
b/src/examples/evas/filters/filter_example_1.txt
similarity index 63%
copy from doc/previews/filter_example_1.sh
copy to src/examples/evas/filters/filter_example_1.txt
index 0098a6b..ed87d7e 100644
--- a/doc/previews/filter_example_1.sh
+++ b/src/examples/evas/filters/filter_example_1.txt
@@ -1,10 +1,5 @@
-TEXT="Evas Filters"
-FONT="Sans"
-SIZE=50
-FILTER="
 buffer : fat (alpha);
 grow (8, dst = fat);
 blur (12, src = fat, color = darkblue);
 blur (4, color = cyan);
-blend ();
-"
+blend ();
\ No newline at end of file
diff --git a/src/examples/evas/filters/filter_grow.txt 
b/src/examples/evas/filters/filter_grow.txt
new file mode 100644
index 0000000..2d57f42
--- /dev/null
+++ b/src/examples/evas/filters/filter_grow.txt
@@ -0,0 +1,4 @@
+buffer : fat (alpha);
+grow (4, dst = fat);
+blend (src = fat, color = black);
+blend (color = white);
\ No newline at end of file
diff --git a/doc/previews/filter_mask.sh 
b/src/examples/evas/filters/filter_mask.txt
similarity index 58%
copy from doc/previews/filter_mask.sh
copy to src/examples/evas/filters/filter_mask.txt
index ab22e55..a43c23b 100644
--- a/doc/previews/filter_mask.sh
+++ b/src/examples/evas/filters/filter_mask.txt
@@ -1,10 +1,5 @@
-TEXT="Mask"
-FONT="Sans:style=bold"
-SIZE=64
-FILTER="
 buffer: a (alpha);
 blur(5, dst = a);
 curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
 blend(color = black);
-mask(mask = a, color = cyan);
-"
+mask(mask = a, color = cyan);
\ No newline at end of file
diff --git a/src/examples/evas/filters/filter_transform.txt 
b/src/examples/evas/filters/filter_transform.txt
new file mode 100644
index 0000000..322af27
--- /dev/null
+++ b/src/examples/evas/filters/filter_transform.txt
@@ -0,0 +1,4 @@
+buffer : t (alpha);
+transform (oy = 20, dst = t);
+blend (src = t, color = silver);
+blend (color = white);
\ No newline at end of file
diff --git a/src/lib/evas/filters/evas_filter_parser.c 
b/src/lib/evas/filters/evas_filter_parser.c
index 0a5ac7c..3335dc5 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -67,13 +67,7 @@
 
   Here is a simple example illustrating the syntax:
 
-  @code
-    buffer : fat (alpha);
-    grow (8, dst = fat);
-    blur (12, src = fat, color = darkblue);
-    blur (4, color = cyan);
-    blend ();
-  @endcode
+  @include filter_example_1.txt
 
   This example will display a cyan and dark blue glow surrounding the
   main text (its color depends on the object's theme).
@@ -985,9 +979,7 @@ _blend_padding_update(Evas_Filter_Program *pgm, 
Evas_Filter_Instruction *instr,
 
   If @a src is an alpha buffer and @a dst is an RGBA buffer, then the @a color 
option should be set.
 
-  @code
-    blend (color = #3399FF);
-  @endcode
+  @include filter_blend.txt
 
   <center>
   @image html filter_blend.png
@@ -1095,10 +1087,7 @@ _blur_padding_update(Evas_Filter_Program *pgm, 
Evas_Filter_Instruction *instr,
   If @a src is an alpha buffer and @a dst is an RGBA buffer, then the color 
option should be set.
 
   @a ox and @a oy can be used to move the blurry output by a few pixels, like 
a drop shadow. Example:
-  @code
-    blur (10, color = black, oy = 5, ox = 5);
-    blend ();
-  @endcode
+  @include filter_blur.txt
 
   <center>
   @image html filter_blur.png
@@ -1159,11 +1148,7 @@ _blur_instruction_prepare(Evas_Filter_Instruction *instr)
   @note As of 2014/02/11, the ALPHA to RGBA support is of much better quality 
than ALPHA only, but @b very slow. RGBA sources are not supported yet.
 
   Here is a full example for a size 100 font, of a very simple bevel effect:
-  @code
-    buffer : a (alpha);
-    blur (5, dst = a);
-    bump (map = a, compensate = yes, color = cyan, specular = 10.0);
-  @endcode
+  @include filter_bump.txt
 
   <center>
   @image html filter_bump.png
@@ -1230,12 +1215,7 @@ _bump_instruction_prepare(Evas_Filter_Instruction *instr)
   If ignored, y(x = 0) is 0 and y(x = 255) is 255.
 
   The following example will generate a 4px thick stroke around text letters:
-  @code
-    buffer : a (alpha);
-    blur (4, dst = a);
-    curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
-    blend(src = a, color = black);
-  @endcode
+  @include filter_curve.txt
 
   <center>
   @image html filter_curve.png
@@ -1470,12 +1450,8 @@ _grow_padding_update(Evas_Filter_Program *pgm, 
Evas_Filter_Instruction *instr,
   @param dst     Destination buffer for blending. This must be of same size 
and colorspace as @a src.
 
   Example:
-  @code
-    buffer : fat (alpha);
-    grow (4, dst = fat);
-    blend (src = fat, color = black);
-    blend (color = white);
-  @endcode
+  @include filter_grow.txt
+
   This will first grow the letters in the buffer @c input by 4px, and then draw
   this buffer in black in the background. Blending white on top of that will
   give a simple impression of stroked text.
@@ -1524,13 +1500,8 @@ _grow_instruction_prepare(Evas_Filter_Instruction *instr)
   Note that @a src and @a mask are interchangeable, if they have the same 
dimensions.
 
   Example:
-  @code
-    buffer: a (alpha);
-    blur(5, dst = a);
-    curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
-    blend(color = black);
-    mask(mask = a, color = cyan);
-  @endcode
+  @include filter_mask.txt
+
   This will create a simple cyan inner glow effect on black text.
 
   <center>
@@ -1610,12 +1581,8 @@ _transform_padding_update(Evas_Filter_Program *pgm,
   @param oy       Y offset.
 
   Example:
-  @code
-    buffer : t (alpha);
-    transform (oy = 20, dst = t);
-    blend (src = t, color = silver);
-    blend (color = white);
-  @endcode
+  @include filter_transform.txt
+
   This will create a mirrored text effect, for a font of 50px.
 
   <center>

-- 


Reply via email to