From 1f9ac72b8e056a8f5df2e2807cb4e3c8317f9fc8 Mon Sep 17 00:00:00 2001 From: Bogdan Devichev Date: Mon, 23 Feb 2015 17:59:05 +0100 Subject: [PATCH] evas: refactoring evas examples descriptions. Summary: Descriptions of evas examples are standardized. Added missing descriptions to examples. Deleted copy of description in evas-init-shutdown.c. Reviewers: Hermet, raster, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2031 Signed-off-by: Cedric BAIL --- src/examples/evas/evas-3d-aabb.c | 9 ++++++--- src/examples/evas/evas-3d-colorpick.c | 7 +++++-- src/examples/evas/evas-3d-cube-rotate.c | 24 +++++++++++----------- src/examples/evas/evas-3d-cube.c | 10 ++++++++++ src/examples/evas/evas-3d-cube2.c | 9 +++++++++ src/examples/evas/evas-3d-eet.c | 26 ++++++++++++------------ src/examples/evas/evas-3d-frustum.c | 7 +++++-- src/examples/evas/evas-3d-md2.c | 8 ++++++++ src/examples/evas/evas-3d-mmap-set.c | 20 +++++++++---------- src/examples/evas/evas-3d-moon-space.c | 35 +++++++++++++++++---------------- src/examples/evas/evas-3d-obj.c | 26 ++++++++++++------------ src/examples/evas/evas-3d-pick.c | 12 +++++++++++ src/examples/evas/evas-3d-ply.c | 22 ++++++++++----------- src/examples/evas/evas-3d-proxy.c | 10 ++++++++++ src/examples/evas/evas-3d-shadows.c | 6 ++++-- src/examples/evas/evas-buffer-simple.c | 5 ++--- src/examples/evas/evas-gl.c | 11 ++++++++++- src/examples/evas/evas-init-shutdown.c | 11 ----------- src/examples/evas/evas-multi-touch.c | 11 +++++++++++ 19 files changed, 170 insertions(+), 99 deletions(-) diff --git a/src/examples/evas/evas-3d-aabb.c b/src/examples/evas/evas-3d-aabb.c index 90603be..d4f2351 100644 --- a/src/examples/evas/evas-3d-aabb.c +++ b/src/examples/evas/evas-3d-aabb.c @@ -1,9 +1,12 @@ -/* +/** * This example shows how to get and draw axis-aligned bounding box. - + * * @see _mesh_aabb(Evas_3D_Mesh **mesh_b, const Evas_3D_Node *node); * Rotate axises (keys 1-4) for model and bounding box view from another angle. - * Compile with "gcc -o evas-3d-aabb evas-3d-aabb.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo`" + * + * @verbatim + * gcc -o evas-3d-aabb evas-3d-aabb.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` + * @endverbatim */ #ifdef HAVE_CONFIG_H diff --git a/src/examples/evas/evas-3d-colorpick.c b/src/examples/evas/evas-3d-colorpick.c index b909a0c..2db7786 100644 --- a/src/examples/evas/evas-3d-colorpick.c +++ b/src/examples/evas/evas-3d-colorpick.c @@ -1,4 +1,4 @@ -/* +/** * This example shows how to use color pick algorithm for finding node at scene. * Enable color pick mode of meshes and scene objects. * Click (left for color pick, right for geometry pick) on 3D object and see @@ -7,7 +7,10 @@ * Use key LEFT/RIGHT for scale each node * Use shortcut parameters of commanline: r - rows of objects, c - columns of objects, m - path for model name, * f - path for first texture, s - path for second texture. - * Compile with "gcc -o evas-3d-colorpick evas-3d-colorpick.c `pkg-config --libs --cflags evas ecore ecore-evas eo eina efl`" + * + * @verbatim + * gcc -o evas-3d-colorpick evas-3d-colorpick.c `pkg-config --libs --cflags evas ecore ecore-evas eo eina efl` + * @endverbatim */ //TODO new resources diff --git a/src/examples/evas/evas-3d-cube-rotate.c b/src/examples/evas/evas-3d-cube-rotate.c index 1cb0d96..4a45aedf 100644 --- a/src/examples/evas/evas-3d-cube-rotate.c +++ b/src/examples/evas/evas-3d-cube-rotate.c @@ -1,14 +1,16 @@ -/* -* This example shows how the work of events with callback of the mouse could be useful in node rotation. -* -* After clicking the mouse on cube callbacks began to emit autmatically, -* depending on mouse's position change the cube rotates with a certain -* speed while mouse is still on the cube, also rotation slows down when -* leaving the boundaries of the cube, all this goes on while the mouse -* is pressed. Note, that rotation is taking place around one axis only. -* -* Compile with "gcc -o evas-3d-cube-rotate evas-3d-cube-rotate.c -g `pkg-config --libs --cflags evas ecore ecore-evas eo` -lm" -*/ +/** + * This example shows how the work of events with callback of the mouse could be useful in node rotation. + * + * After clicking the mouse on cube callbacks began to emit autmatically, + * depending on mouse's position change the cube rotates with a certain + * speed while mouse is still on the cube, also rotation slows down when + * leaving the boundaries of the cube, all this goes on while the mouse + * is pressed. Note, that rotation is taking place around one axis only. + * + * @verbatim + * gcc -o evas-3d-cube-rotate evas-3d-cube-rotate.c -g `pkg-config --libs --cflags evas ecore ecore-evas eo` -lm + * @endverbatim + */ #define EFL_EO_API_SUPPORT #define EFL_BETA_API_SUPPORT diff --git a/src/examples/evas/evas-3d-cube.c b/src/examples/evas/evas-3d-cube.c index b580777..bfe57e8 100644 --- a/src/examples/evas/evas-3d-cube.c +++ b/src/examples/evas/evas-3d-cube.c @@ -1,3 +1,13 @@ +/** + * Simple Evas-3D example illustrating how to create simple mesh without any loading. + * + * This example is the best to start introduction to usage of Evas-3D. + * + * @verbatim + * gcc -o evas-3d-cube evas-3d-cube.c `pkg-config --libs --cflags evas ecore ecore-evas eo` + * @endverbatim + */ + #define EFL_EO_API_SUPPORT #define EFL_BETA_API_SUPPORT diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c index c0112d6..ead599a 100644 --- a/src/examples/evas/evas-3d-cube2.c +++ b/src/examples/evas/evas-3d-cube2.c @@ -1,3 +1,12 @@ +/** + * Simple Evas-3D example illustrating usage of normal mapping and animation created + * by interpolation between frames. + * + * @verbatim + * gcc -o evas-3d-cube2 evas-3d-cube2.c `pkg-config --libs --cflags evas ecore ecore-evas eo` + * @endverbatim + */ + #ifdef HAVE_CONFIG_H #include "config.h" #else diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c index f67f36e..18dc2e4 100644 --- a/src/examples/evas/evas-3d-eet.c +++ b/src/examples/evas/evas-3d-eet.c @@ -1,17 +1,17 @@ /** -* Simple Evas example illustrating .eet import/export -* -* Take mesh from md2. -* Set material to it. -* Show it in left side. -* Save the first frame of this mesh to eet. (static only) -* Take result to another mesh from eet. -* Show it in right side. -* -* @verbatim -* gcc -o evas-3d-eet evas-3d-eet.c `pkg-config --libs --cflags efl eina evas ecore ecore-evas ecore-file eo` -* @endverbatim -*/ + * Simple Evas example illustrating .eet import/export + * + * Take mesh from md2. + * Set material to it. + * Show it in left side. + * Save the first frame of this mesh to eet. (static only) + * Take result to another mesh from eet. + * Show it in right side. + * + * @verbatim + * gcc -o evas-3d-eet evas-3d-eet.c `pkg-config --libs --cflags efl eina evas ecore ecore-evas ecore-file eo` + * @endverbatim + */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c index 15ed883..e98c112 100644 --- a/src/examples/evas/evas-3d-frustum.c +++ b/src/examples/evas/evas-3d-frustum.c @@ -1,4 +1,4 @@ -/* +/** * This example shows how to work frustum culling. * Use 'w'/'s' key to move far frustum plane from/to the camera. * Use 't'/'g' key to move near frustum plane from/to the camera. @@ -8,7 +8,10 @@ * Use 'z', 'x', 'c', 'Z', 'X' and 'C' keys to change scaling constants of mesh. * See in terminal output value distance to far plane of frustum and value of visibility of node * @see evas_3d_camera_node_visible_get. - * Compile with "gcc -o evas-3d-frustum evas-3d-frustum.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm" + * + * @verbatim + * gcc -o evas-3d-frustum evas-3d-frustum.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` -lm + * @endverbatim */ #ifdef HAVE_CONFIG_H diff --git a/src/examples/evas/evas-3d-md2.c b/src/examples/evas/evas-3d-md2.c index f5344bb..d48926c 100644 --- a/src/examples/evas/evas-3d-md2.c +++ b/src/examples/evas/evas-3d-md2.c @@ -1,3 +1,11 @@ +/** + * Simple Evas-3D example illustrating import from .md2 format. + * + * @verbatim + * gcc -o evas-3d-md2 evas-3d-md2.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo` + * @endverbatim + */ + #ifdef HAVE_CONFIG_H #include "config.h" #else diff --git a/src/examples/evas/evas-3d-mmap-set.c b/src/examples/evas/evas-3d-mmap-set.c index 084852b..749dcf8 100644 --- a/src/examples/evas/evas-3d-mmap-set.c +++ b/src/examples/evas/evas-3d-mmap-set.c @@ -1,14 +1,14 @@ /** -* Simple Evas example illustrating import from mmap. -* -* Open files to Eina_Files. -* Read meshes from Eina_Files. -* Show the results. -* -* @verbatim -* gcc -o evas-3d-mmap-set evas-3d-mmap-set.c `pkg-config --libs --cflags evas ecore ecore-evas eina eo` -lm -* @endverbatim -*/ + * Simple Evas example illustrating import from mmap. + * + * Open files to Eina_Files. + * Read meshes from Eina_Files. + * Show the results. + * + * @verbatim + * gcc -o evas-3d-mmap-set evas-3d-mmap-set.c `pkg-config --libs --cflags evas ecore ecore-evas eina eo` -lm + * @endverbatim + */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/examples/evas/evas-3d-moon-space.c b/src/examples/evas/evas-3d-moon-space.c index 928245c..9469dbf 100644 --- a/src/examples/evas/evas-3d-moon-space.c +++ b/src/examples/evas/evas-3d-moon-space.c @@ -1,20 +1,21 @@ -/* -* This example illustrates the work of different callbacks of events from mouse -* and keyboard. -* -* Next tests are available: -* 1. All animations of scene will stop on mouse click on the background. -* 2. Clicking of any object on scene causes stop of its movement, but if click on -* the moon while it is in front of a planet will stop them both. -* 3. Camera position can be changed by pressing 'down' or 'up' key. Position of -* the camera changes in the respective direction. -* 4. The 'n' key pressing returns camera to its default position. -* 5. One of four types of vertex assembly of planet could be chosen by clicking on -* a number from 1 to 4 on keyboard. - -* Compile with: -* gcc -o evas-3d-moon-space evas-3d-moon-space.c -g `pkg-config --libs --cflags evas ecore ecore-evas eo` -lm -*/ +/** + * This example illustrates the work of different callbacks of events from mouse + * and keyboard. + * + * Next tests are available: + * 1. All animations of scene will stop on mouse click on the background. + * 2. Clicking of any object on scene causes stop of its movement, but if click on + * the moon while it is in front of a planet will stop them both. + * 3. Camera position can be changed by pressing 'down' or 'up' key. Position of + * the camera changes in the respective direction. + * 4. The 'n' key pressing returns camera to its default position. + * 5. One of four types of vertex assembly of planet could be chosen by clicking on + * a number from 1 to 4 on keyboard. + * + * @verbatim + * gcc -o evas-3d-moon-space evas-3d-moon-space.c -g `pkg-config --libs --cflags evas ecore ecore-evas eo` -lm + * @endverbatim + */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c index ea86377..cf24ab1 100644 --- a/src/examples/evas/evas-3d-obj.c +++ b/src/examples/evas/evas-3d-obj.c @@ -1,17 +1,17 @@ /** -* Simple Evas example illustrating import/export of .obj format. -* Example demonstrate possibility to load and save mesh without tex_coords or/and normals. -* -* Read mesh from "sweet_home(parameters).obj". -* After that cheange some properties of material. -* After that save material to "saved_files/saved_home(parameters).mtl" -* and geometry to "saved_files/saved_home(parameters).obj". -* If material was not set it will be not saved. -* -* @verbatim -* gcc -o evas-3d-obj evas-3d-obj.c `pkg-config --libs --cflags efl evas ecore ecore-evas ecore-file eo` -* @endverbatim -*/ + * Simple Evas example illustrating import/export of .obj format. + * Example demonstrate possibility to load and save mesh without tex_coords or/and normals. + * + * Read mesh from "sweet_home(parameters).obj". + * After that cheange some properties of material. + * After that save material to "saved_files/saved_home(parameters).mtl" + * and geometry to "saved_files/saved_home(parameters).obj". + * If material was not set it will be not saved. + * + * @verbatim + * gcc -o evas-3d-obj evas-3d-obj.c `pkg-config --libs --cflags efl evas ecore ecore-evas ecore-file eo` + * @endverbatim + */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/examples/evas/evas-3d-pick.c b/src/examples/evas/evas-3d-pick.c index dded35e..1e53f56 100644 --- a/src/examples/evas/evas-3d-pick.c +++ b/src/examples/evas/evas-3d-pick.c @@ -1,3 +1,15 @@ +/** + * This example shows how to attach mechanism of pick. + * + * Here shown which transformation should be applied to event_info of + * _on_mouse_down to make them usable in evas_3d_scene_pick() + * and parameters which can be got from this function. + * + * @verbatim + * gcc -o evas-3d-pick evas-3d-pick.c `pkg-config --libs --cflags evas ecore ecore-evas eo` -lm + * @endverbatim + */ + #ifdef HAVE_CONFIG_H #include "config.h" #else diff --git a/src/examples/evas/evas-3d-ply.c b/src/examples/evas/evas-3d-ply.c index c35cd60..7377c13 100644 --- a/src/examples/evas/evas-3d-ply.c +++ b/src/examples/evas/evas-3d-ply.c @@ -1,15 +1,15 @@ /** -* Simple Evas example illustrating import/export of .ply format. -* -* Read meshes from "tested_man_all_with_mods.ply", "tested_man_only_geometry.ply" and "tested_man_without_UVs.ply". -* After that cheange some properties of material. -* After that save material to "saved_man.mtl" -* and geometry to "saved_man_all_with_mods.ply", "saved_man_only_geometry.ply" and "saved_man_without_UVs.ply". -* -* @verbatim -* gcc -o evas-3d-ply evas-3d-ply.c `pkg-config --libs --cflags efl evas ecore ecore-evas ecore-file eo` -* @endverbatim -*/ + * Simple Evas example illustrating import/export of .ply format. + * + * Read meshes from "tested_man_all_with_mods.ply", "tested_man_only_geometry.ply" and "tested_man_without_UVs.ply". + * After that cheange some properties of material. + * After that save material to "saved_man.mtl" + * and geometry to "saved_man_all_with_mods.ply", "saved_man_only_geometry.ply" and "saved_man_without_UVs.ply". + * + * @verbatim + * gcc -o evas-3d-ply evas-3d-ply.c `pkg-config --libs --cflags efl evas ecore ecore-evas ecore-file eo` + * @endverbatim + */ //TODO new resources #ifdef HAVE_CONFIG_H diff --git a/src/examples/evas/evas-3d-proxy.c b/src/examples/evas/evas-3d-proxy.c index a37358d..c6375e7 100644 --- a/src/examples/evas/evas-3d-proxy.c +++ b/src/examples/evas/evas-3d-proxy.c @@ -1,3 +1,13 @@ +/** + * Evas-3D example illustrating usage of evas_3d_texture_source_set() + * + * Data which will be used as texture can be generated directly in application. + * + * @verbatim + * gcc -o evas-3d-proxy evas-3d-proxy.c `pkg-config --libs --cflags evas ecore ecore-evas eo` + * @endverbatim + */ + #define EFL_EO_API_SUPPORT #define EFL_BETA_API_SUPPORT diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c index 3170eb7..6ad0479 100644 --- a/src/examples/evas/evas-3d-shadows.c +++ b/src/examples/evas/evas-3d-shadows.c @@ -1,11 +1,13 @@ -/* +/** * This example illustrating use of shadows in the scene and callbacks(clicked, collision). * Model and cube are clickable. Model detects collision with sphere. * Cube detects collision with sphere, model and cone. * @see evas_3d_scene_shadows_enable_set(Eina_Bool _shadows_enabled) * @see evas_3d_object_callback_register * - * Compile with gcc -o gcc -o evas-3d-shadows evas-3d-shadows.c evas-3d-primitives.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo eina` -lm + * @verbatim + * gcc -o gcc -o evas-3d-shadows evas-3d-shadows.c evas-3d-primitives.c `pkg-config --libs --cflags efl evas ecore ecore-evas eo eina` -lm + * @endverbatim */ #ifdef HAVE_CONFIG_H diff --git a/src/examples/evas/evas-buffer-simple.c b/src/examples/evas/evas-buffer-simple.c index 6676ef1..ea25e93 100644 --- a/src/examples/evas/evas-buffer-simple.c +++ b/src/examples/evas/evas-buffer-simple.c @@ -4,13 +4,11 @@ * You must have Evas compiled with the buffer engine, and have the * evas-software-buffer pkg-config files installed. * - * Compile with: - * * @verbatim * gcc -o evas-buffer-simple evas-buffer-simple.c `pkg-config --libs --cflags evas evas-software-buffer` * @endverbatim - * */ + #include #include #include @@ -28,6 +26,7 @@ * automatic render of updates (draw_scene()) when system goes back to * main loop. */ + static Evas *create_canvas(int width, int height); static void destroy_canvas(Evas *canvas); static void draw_scene(Evas *canvas); diff --git a/src/examples/evas/evas-gl.c b/src/examples/evas/evas-gl.c index 51e82f3..8a3099b 100644 --- a/src/examples/evas/evas-gl.c +++ b/src/examples/evas/evas-gl.c @@ -1,4 +1,13 @@ -//Add Evas_GL.h for Evas GL APIs access. +/** + * Evas example illustrating work with GL APIs. + * + * Evas_GL.h should be added for Evas GL APIs access. + * + * @verbatim + * gcc -o evas-gl evas-gl.c `pkg-config --libs --cflags evas ecore ecore-evas` -lm + * @endverbatim + */ + #include #include #include diff --git a/src/examples/evas/evas-init-shutdown.c b/src/examples/evas/evas-init-shutdown.c index eb20089..3d1adfd 100644 --- a/src/examples/evas/evas-init-shutdown.c +++ b/src/examples/evas/evas-init-shutdown.c @@ -17,17 +17,6 @@ #include #include -/* - * Simple example illustrating usage of evas_init() and - * evas_shutdown(). Usually one would instantiate a canvas to have - * something useful out of Evas. For an example of this kind, see the - * evas-buffer-simple.c, which requires the buffer engine module - * compiled in Evas. - * - * Here, we are just listing the engine Evas was compiled with support - * to. - */ - int main(void) { diff --git a/src/examples/evas/evas-multi-touch.c b/src/examples/evas/evas-multi-touch.c index 6cd5b4d..f1d344c 100644 --- a/src/examples/evas/evas-multi-touch.c +++ b/src/examples/evas/evas-multi-touch.c @@ -1,3 +1,14 @@ +/** + * Simple Evas example illustrating usage of multi touch. + * + * You'll need at least one engine built for it (excluding the buffer + * one) and the png image loader also built. + * + * @verbatim + * gcc -o evas-multi-touch evas-multi-touch.c `pkg-config --libs --cflags evas ecore ecore-evas eina` -lm + * @endverbatim + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif -- 2.7.4