summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-09-29 19:20:19 -0300
committerSavio Sena <savio@expertisesolutions.com.br>2014-09-29 19:20:59 -0300
commit691498bfa6a2f0118af3b0ba19139abef3ab5300 (patch)
treeaa514cd89e99e308e0eff6012f61dd8b96345f6d
parent3f1b05bd0b11e05744ba71df5401e442ea8d2848 (diff)
expedite-cxx: Get rid of global pointer.
Use an instance of efl::eina::list instead.
-rw-r--r--src/bin/cxx/image_blend_border.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/bin/cxx/image_blend_border.cc b/src/bin/cxx/image_blend_border.cc
index c7f192c..f4d24f2 100644
--- a/src/bin/cxx/image_blend_border.cc
+++ b/src/bin/cxx/image_blend_border.cc
@@ -15,7 +15,7 @@
15#define EXPEDITE_CXX_TEST_IMPL 15#define EXPEDITE_CXX_TEST_IMPL
16#include "image_blend_border_capi.h" 16#include "image_blend_border_capi.h"
17 17
18static efl::eina::list<evas::image>* images; 18static efl::eina::list<evas::image> images;
19 19
20/* standard var */ 20/* standard var */
21static int done = 0; 21static int done = 0;
@@ -24,11 +24,10 @@ static int done = 0;
24static void _setup() 24static void _setup()
25{ 25{
26 evas::canvas canvas(::eo_ref(G_evas)); 26 evas::canvas canvas(::eo_ref(G_evas));
27 images = new efl::eina::list<evas::image>;
28 for (int i = 0; i < OBNUM; i++) 27 for (int i = 0; i < OBNUM; i++)
29 { 28 {
30 evas::image o(efl::eo::parent = canvas); 29 evas::image o(efl::eo::parent = canvas);
31 images->push_back(o); 30 images.push_back(o);
32 o.file_set(::build_path("bar.png"), ""); 31 o.file_set(::build_path("bar.png"), "");
33 o.border_set(6, 6, 6, 6); 32 o.border_set(6, 6, 6, 6);
34 o.visibility_set(true); 33 o.visibility_set(true);
@@ -39,11 +38,7 @@ static void _setup()
39/* cleanup */ 38/* cleanup */
40static void _cleanup() 39static void _cleanup()
41{ 40{
42 if (images) 41 images.clear();
43 {
44 images->clear();
45 delete images;
46 }
47} 42}
48 43
49/* loop - do things */ 44/* loop - do things */
@@ -51,8 +46,7 @@ static void _loop(double t, int f)
51{ 46{
52 Evas_Coord x, y, w, h, w0, h0; 47 Evas_Coord x, y, w, h, w0, h0;
53 int i = 0; 48 int i = 0;
54 if (!images) return; 49 for (evas::image& img : images)
55 for (evas::image img : *images)
56 { 50 {
57 w0 = 80; 51 w0 = 80;
58 h0 = 80; 52 h0 = 80;