summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorBogdan Devichev <b.devichev@samsung.com>2015-02-23 14:46:15 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-02-23 15:46:54 +0100
commitccfbb521cd6c6e8a3ad5156f6f971dcffbe192f5 (patch)
treee46b50608e93038cba951839e9f91161c602bae6 /src/examples
parent4f7718539d550e963ebe726daf8b578d67a9193b (diff)
evas: some fixes to evas examples.
Summary: Fixed : errors (connected with eo and new resources path) in evas-object-manipulation-eo.c Fixed : warning: format not a string literal and no format arguments [-Wformat-security] FIxed : unused variables in evas-images3.c are deleted Reviewers: raster, Hermet, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2025 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/evas/evas-events.c5
-rw-r--r--src/examples/evas/evas-images.c5
-rw-r--r--src/examples/evas/evas-images2.c5
-rw-r--r--src/examples/evas/evas-images3.c8
-rw-r--r--src/examples/evas/evas-images4.c5
-rw-r--r--src/examples/evas/evas-object-manipulation-eo.c10
-rw-r--r--src/examples/evas/evas-smart-object.c5
7 files changed, 17 insertions, 26 deletions
diff --git a/src/examples/evas/evas-events.c b/src/examples/evas/evas-events.c
index 7b61498..34ffd3e 100644
--- a/src/examples/evas/evas-events.c
+++ b/src/examples/evas/evas-events.c
@@ -10,7 +10,6 @@
10 * gcc -o evas-events evas-events.c `pkg-config --libs --cflags evas ecore ecore-evas` 10 * gcc -o evas-events evas-events.c `pkg-config --libs --cflags evas ecore ecore-evas`
11 * @endverbatim 11 * @endverbatim
12 */ 12 */
13//TODO: Fix warning.
14 13
15#ifdef HAVE_CONFIG_H 14#ifdef HAVE_CONFIG_H
16#include "config.h" 15#include "config.h"
@@ -148,7 +147,7 @@ _on_keydown(void *data EINA_UNUSED,
148 147
149 if (strcmp(ev->key, "h") == 0) /* print help */ 148 if (strcmp(ev->key, "h") == 0) /* print help */
150 { 149 {
151 fprintf(stdout, commands); 150 puts(commands);
152 return; 151 return;
153 } 152 }
154 153
@@ -396,7 +395,7 @@ main(void)
396 395
397 d.resize_timer = ecore_timer_add(2, _resize_cb, NULL); 396 d.resize_timer = ecore_timer_add(2, _resize_cb, NULL);
398 397
399 fprintf(stdout, commands); 398 puts(commands);
400 ecore_main_loop_begin(); 399 ecore_main_loop_begin();
401 400
402 ecore_evas_free(d.ee); 401 ecore_evas_free(d.ee);
diff --git a/src/examples/evas/evas-images.c b/src/examples/evas/evas-images.c
index 851b0d6..da78ba4 100644
--- a/src/examples/evas/evas-images.c
+++ b/src/examples/evas/evas-images.c
@@ -9,7 +9,6 @@
9 * gcc -o evas-images evas-images.c `pkg-config --libs --cflags evas ecore ecore-evas` 9 * gcc -o evas-images evas-images.c `pkg-config --libs --cflags evas ecore ecore-evas`
10 * @endverbatim 10 * @endverbatim
11 */ 11 */
12//TODO: Fix warnings.
13 12
14#ifdef HAVE_CONFIG_H 13#ifdef HAVE_CONFIG_H
15#include "config.h" 14#include "config.h"
@@ -99,7 +98,7 @@ _on_keydown(void *data EINA_UNUSED,
99 98
100 if (strcmp(ev->key, "h") == 0) /* print help */ 99 if (strcmp(ev->key, "h") == 0) /* print help */
101 { 100 {
102 fprintf(stdout, commands); 101 puts(commands);
103 return; 102 return;
104 } 103 }
105 104
@@ -336,7 +335,7 @@ main(void)
336 evas_object_show(d.img2); 335 evas_object_show(d.img2);
337 } 336 }
338 337
339 fprintf(stdout, commands); 338 puts(commands);
340 ecore_main_loop_begin(); 339 ecore_main_loop_begin();
341 340
342 ecore_evas_free(d.ee); 341 ecore_evas_free(d.ee);
diff --git a/src/examples/evas/evas-images2.c b/src/examples/evas/evas-images2.c
index 45d7a4f..48f3d59 100644
--- a/src/examples/evas/evas-images2.c
+++ b/src/examples/evas/evas-images2.c
@@ -9,7 +9,6 @@
9 * gcc -o evas-images2 evas-images2.c `pkg-config --libs --cflags evas ecore ecore-evas` 9 * gcc -o evas-images2 evas-images2.c `pkg-config --libs --cflags evas ecore ecore-evas`
10 * @endverbatim 10 * @endverbatim
11 */ 11 */
12//TODO: Fix warnings
13 12
14#ifdef HAVE_CONFIG_H 13#ifdef HAVE_CONFIG_H
15#include "config.h" 14#include "config.h"
@@ -164,7 +163,7 @@ _on_keydown(void *data EINA_UNUSED,
164 163
165 if (strcmp(ev->key, "h") == 0) /* print help */ 164 if (strcmp(ev->key, "h") == 0) /* print help */
166 { 165 {
167 fprintf(stdout, commands); 166 puts(commands);
168 return; 167 return;
169 } 168 }
170 169
@@ -294,7 +293,7 @@ main(void)
294 evas_object_resize(d.proxy_img, WIDTH / 2, HEIGHT / 2); 293 evas_object_resize(d.proxy_img, WIDTH / 2, HEIGHT / 2);
295 evas_object_show(d.proxy_img); 294 evas_object_show(d.proxy_img);
296 295
297 fprintf(stdout, commands); 296 puts(commands);
298 ecore_main_loop_begin(); 297 ecore_main_loop_begin();
299 298
300 ecore_evas_free(d.ee); 299 ecore_evas_free(d.ee);
diff --git a/src/examples/evas/evas-images3.c b/src/examples/evas/evas-images3.c
index 7bd68f8..fcbaa87 100644
--- a/src/examples/evas/evas-images3.c
+++ b/src/examples/evas/evas-images3.c
@@ -9,7 +9,6 @@
9 * gcc -o evas-images3 evas-images3.c `pkg-config --libs --cflags evas ecore ecore-evas` 9 * gcc -o evas-images3 evas-images3.c `pkg-config --libs --cflags evas ecore ecore-evas`
10 * @endverbatim 10 * @endverbatim
11 */ 11 */
12//TODO: Fix warnings.
13 12
14#ifdef HAVE_CONFIG_H 13#ifdef HAVE_CONFIG_H
15#include "config.h" 14#include "config.h"
@@ -77,7 +76,7 @@ _on_keydown(void *data EINA_UNUSED,
77 76
78 if (strcmp(ev->key, "h") == 0) /* print help */ 77 if (strcmp(ev->key, "h") == 0) /* print help */
79 { 78 {
80 fprintf(stdout, commands); 79 puts(commands);
81 return; 80 return;
82 } 81 }
83 82
@@ -138,9 +137,6 @@ _on_keydown(void *data EINA_UNUSED,
138int 137int
139main(void) 138main(void)
140{ 139{
141 // unsigned int i;
142 // unsigned int pixels[(WIDTH / 4) * (HEIGHT / 4)];
143
144 if (!ecore_evas_init()) 140 if (!ecore_evas_init())
145 return EXIT_FAILURE; 141 return EXIT_FAILURE;
146 142
@@ -179,7 +175,7 @@ main(void)
179 evas_object_move(d.logo1, WIDTH / 2, 0); 175 evas_object_move(d.logo1, WIDTH / 2, 0);
180 evas_object_show(d.logo1); 176 evas_object_show(d.logo1);
181 177
182 fprintf(stdout, commands); 178 puts(commands);
183 ecore_main_loop_begin(); 179 ecore_main_loop_begin();
184 180
185 ecore_evas_free(d.ee); 181 ecore_evas_free(d.ee);
diff --git a/src/examples/evas/evas-images4.c b/src/examples/evas/evas-images4.c
index 0bb51fa..26b116f 100644
--- a/src/examples/evas/evas-images4.c
+++ b/src/examples/evas/evas-images4.c
@@ -9,7 +9,6 @@
9 * gcc -o evas-images4 evas-images4.c `pkg-config --libs --cflags evas ecore ecore-evas` 9 * gcc -o evas-images4 evas-images4.c `pkg-config --libs --cflags evas ecore ecore-evas`
10 * @endverbatim 10 * @endverbatim
11 */ 11 */
12//TODO: Fix warnings.
13 12
14#ifdef HAVE_CONFIG_H 13#ifdef HAVE_CONFIG_H
15#include "config.h" 14#include "config.h"
@@ -80,7 +79,7 @@ _on_keydown(void *data EINA_UNUSED,
80 79
81 if (strcmp(ev->key, "h") == 0) /* print help */ 80 if (strcmp(ev->key, "h") == 0) /* print help */
82 { 81 {
83 fprintf(stdout, commands); 82 puts(commands);
84 return; 83 return;
85 } 84 }
86 85
@@ -167,7 +166,7 @@ main(void)
167 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); 166 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
168 } 167 }
169 168
170 fprintf(stdout, commands); 169 puts(commands);
171 ecore_main_loop_begin(); 170 ecore_main_loop_begin();
172 171
173 ecore_evas_free(d.ee); 172 ecore_evas_free(d.ee);
diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c
index 2b0bfbe..e54e282 100644
--- a/src/examples/evas/evas-object-manipulation-eo.c
+++ b/src/examples/evas/evas-object-manipulation-eo.c
@@ -12,12 +12,13 @@
12 * gcc -o evas-object-manipulation-eo evas-object-manipulation-eo.c `pkg-config --libs --cflags ecore evas ecore-evas eo` 12 * gcc -o evas-object-manipulation-eo evas-object-manipulation-eo.c `pkg-config --libs --cflags ecore evas ecore-evas eo`
13 * @endverbatim 13 * @endverbatim
14 */ 14 */
15//TODO: Fix error and warning.
16 15
17#ifdef HAVE_CONFIG_H 16#ifdef HAVE_CONFIG_H
18#include "config.h" 17#include "config.h"
19#else 18#else
20#define PACKAGE_EXAMPLES_DIR "." 19#define PACKAGE_EXAMPLES_DIR "."
20#define EFL_EO_API_SUPPORT
21#define EFL_BETA_API_SUPPORT
21#endif 22#endif
22 23
23#include <Efl.h> 24#include <Efl.h>
@@ -25,12 +26,13 @@
25#include <Ecore_Evas.h> 26#include <Ecore_Evas.h>
26#include <stdio.h> 27#include <stdio.h>
27#include <errno.h> 28#include <errno.h>
29#include "evas-common.h"
28 30
29#define WIDTH (320) 31#define WIDTH (320)
30#define HEIGHT (240) 32#define HEIGHT (240)
31 33
32static const char *img_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png"; 34static const char *img_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/enlightenment.png";
33static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; 35static const char *border_img_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/red.png";
34 36
35static const char *commands = \ 37static const char *commands = \
36 "commands are:\n" 38 "commands are:\n"
@@ -191,7 +193,6 @@ main(void)
191 * 'canvas' keeps reference to 'image'. 193 * 'canvas' keeps reference to 'image'.
192 * So it's possible to decrement refcount, and 'image' object 194 * So it's possible to decrement refcount, and 'image' object
193 * will be deleted automatically by parent.*/ 195 * will be deleted automatically by parent.*/
194 eo_unref(d.img);
195 196
196 eo_do(d.img, evas_obj_image_filled_set(EINA_TRUE), 197 eo_do(d.img, evas_obj_image_filled_set(EINA_TRUE),
197 efl_file_set(img_path, NULL), 198 efl_file_set(img_path, NULL),
@@ -235,7 +236,6 @@ main(void)
235 * rectangle) - it won't change clippees' colors, then (multiplying 236 * rectangle) - it won't change clippees' colors, then (multiplying
236 * by 255) */ 237 * by 255) */
237 d.clipper = eo_add(EVAS_RECTANGLE_CLASS, d.canvas); 238 d.clipper = eo_add(EVAS_RECTANGLE_CLASS, d.canvas);
238 eo_unref(d.clipper);
239 239
240 eo_do(d.clipper, 240 eo_do(d.clipper,
241 evas_obj_position_set( WIDTH / 4, HEIGHT / 4), 241 evas_obj_position_set( WIDTH / 4, HEIGHT / 4),
diff --git a/src/examples/evas/evas-smart-object.c b/src/examples/evas/evas-smart-object.c
index 5cece8e..d4aca26 100644
--- a/src/examples/evas/evas-smart-object.c
+++ b/src/examples/evas/evas-smart-object.c
@@ -8,7 +8,6 @@
8 * gcc -o evas-smart-object evas-smart-object.c `pkg-config --libs --cflags evas ecore ecore-evas` 8 * gcc -o evas-smart-object evas-smart-object.c `pkg-config --libs --cflags evas ecore ecore-evas`
9 * @endverbatim 9 * @endverbatim
10 */ 10 */
11//TODO: Fix warnings.
12 11
13#ifdef HAVE_CONFIG_H 12#ifdef HAVE_CONFIG_H
14#include "config.h" 13#include "config.h"
@@ -452,7 +451,7 @@ _on_keydown(void *data EINA_UNUSED,
452 451
453 if (strcmp(ev->key, "h") == 0) /* print help */ 452 if (strcmp(ev->key, "h") == 0) /* print help */
454 { 453 {
455 fprintf(stdout, commands); 454 puts(commands);
456 return; 455 return;
457 } 456 }
458 457
@@ -717,7 +716,7 @@ main(void)
717 evas_object_event_callback_add( 716 evas_object_event_callback_add(
718 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); 717 d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
719 718
720 fprintf(stdout, commands); 719 puts(commands);
721 ecore_main_loop_begin(); 720 ecore_main_loop_begin();
722 721
723 ecore_evas_free(d.ee); 722 ecore_evas_free(d.ee);