summaryrefslogtreecommitdiff
path: root/src/examples/eolian_cxx
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-04-21 14:58:40 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-04-21 15:25:24 -0300
commitbd5c1f72407c23f87f72556f5a3fe1b2cdcc079d (patch)
tree4a05ae2d1619c8af1ba222054cf8ec23a3b2fa12 /src/examples/eolian_cxx
parent8325b78aed0ad42f9399108d337db37d2bd188bc (diff)
eolian-cxx: Remove deprecated examples
Removed deprecated and non-compilable examples for C++ using Evas. Users should look into C++ Elementary's examples instead.
Diffstat (limited to 'src/examples/eolian_cxx')
-rw-r--r--src/examples/eolian_cxx/Makefile.am10
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_complex_types_01.cc126
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_eo_events_01.cc109
3 files changed, 1 insertions, 244 deletions
diff --git a/src/examples/eolian_cxx/Makefile.am b/src/examples/eolian_cxx/Makefile.am
index ebc13c2..26e3e4b 100644
--- a/src/examples/eolian_cxx/Makefile.am
+++ b/src/examples/eolian_cxx/Makefile.am
@@ -97,17 +97,13 @@ SRCS = \
97 eolian_cxx_simple_01.cc \ 97 eolian_cxx_simple_01.cc \
98 eolian_cxx_inherit_01.cc \ 98 eolian_cxx_inherit_01.cc \
99 eolian_cxx_callbacks_01.cc \ 99 eolian_cxx_callbacks_01.cc \
100 eolian_cxx_eo_events_01.cc \
101 eolian_cxx_complex_types_01.cc \
102 $(IMPL) 100 $(IMPL)
103 101
104EXTRA_PROGRAMS = \ 102EXTRA_PROGRAMS = \
105 eolian_cxx_simple_01 \ 103 eolian_cxx_simple_01 \
106 eolian_cxx_simple_01_cxx_impl \ 104 eolian_cxx_simple_01_cxx_impl \
107 eolian_cxx_inherit_01 \ 105 eolian_cxx_inherit_01 \
108 eolian_cxx_callbacks_01 \ 106 eolian_cxx_callbacks_01
109 eolian_cxx_eo_events_01 \
110 eolian_cxx_complex_types_01
111 107
112DATA_FILES = Makefile.examples $(ECXX_EXAMPLE_EOS) 108DATA_FILES = Makefile.examples $(ECXX_EXAMPLE_EOS)
113EXTRA_DIST = $(DATA_FILES) 109EXTRA_DIST = $(DATA_FILES)
@@ -136,10 +132,6 @@ eolian_cxx_inherit_01.$(OBJEXT): $(GENERATED)
136 132
137eolian_cxx_callbacks_01_SOURCES = eolian_cxx_callbacks_01.cc 133eolian_cxx_callbacks_01_SOURCES = eolian_cxx_callbacks_01.cc
138 134
139eolian_cxx_eo_events_01_SOURCES = eolian_cxx_eo_events_01.cc
140
141eolian_cxx_complex_types_01_SOURCES = eolian_cxx_complex_types_01.cc
142
143%.eo.hh: %.eo 135%.eo.hh: %.eo
144 $(AM_V_EOLCXX)$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I${abs_srcdir} -o $@ $< 136 $(AM_V_EOLCXX)$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I${abs_srcdir} -o $@ $<
145 137
diff --git a/src/examples/eolian_cxx/eolian_cxx_complex_types_01.cc b/src/examples/eolian_cxx/eolian_cxx_complex_types_01.cc
deleted file mode 100644
index 04ed7fe..0000000
--- a/src/examples/eolian_cxx/eolian_cxx_complex_types_01.cc
+++ /dev/null
@@ -1,126 +0,0 @@
1#include <iostream>
2#include <thread>
3#include <cassert>
4#include <sstream>
5
6#ifdef HAVE_CONFIG_H
7# include <config.h>
8#endif
9
10#include <Eo.h>
11#include <Ecore.h>
12#include <Evas.h>
13#include <Ecore_Evas.h>
14
15#include <Eina.hh>
16#include <Eo.hh>
17#include <Ecore.hh>
18#include <Evas.hh>
19
20#warning TEST CASE DISABLED: EVAS TYPES NO MORE IN EO API
21
22#if 0
23#include <canvas/evas_canvas.eo.hh>
24#include <canvas/evas_text.eo.hh>
25#include <canvas/evas_rectangle.eo.hh>
26#include <canvas/evas_zoomable_interface.eo.hh>
27#include <canvas/evas_grid.eo.hh>
28
29namespace efl { namespace evas { // XXX only while we don't have namespaces in EFL
30using ::evas::canvas;
31using ::evas::object;
32using ::evas::text;
33using ::evas::grid;
34using ::evas::rectangle;
35using ::evas::common_interface;
36using ::evas::zoomable_interface;
37} }
38
39namespace {
40
41// EFL Ecore-Evas doesn't have C++ bindings yet.
42Ecore_Evas *ee;
43void
44_ecore_evas_init()
45{
46 if (!ee)
47 {
48 ::ecore_evas_init();
49 ::evas_init();
50 ee = ::ecore_evas_new(NULL, 0, 0, 500, 380, NULL);
51 ::ecore_evas_show(ee);
52 }
53}
54void
55_ecore_evas_shutdown()
56{
57 if (ee)
58 {
59 ::ecore_evas_free(ee);
60 ::ecore_evas_shutdown();
61 ee = NULL;
62 }
63}
64
65}
66
67void
68example_complex_types()
69{
70 _ecore_evas_init();
71 efl::evas::canvas canvas(::eo_ref(::ecore_evas_get(ee)));
72
73 efl::evas::rectangle bg(efl::eo::parent = canvas);
74 bg.color_set(255, 255, 255, 255);
75 bg.position_set(0, 0);
76 bg.size_set(500, 250);
77 bg.visible_set(true);
78
79 efl::evas::grid grid(efl::eo::parent = canvas);
80 grid.position_set(0, 0);
81 grid.object_smart::color_set(0, 0, 0, 255);
82 grid.size_set(5, 5);
83 grid.visible_set(true);
84
85 efl::evas::text text1(efl::eo::parent = canvas);
86 text1.style_set(EVAS_TEXT_STYLE_OUTLINE);
87 text1.color_set(255, 0, 0, 255);
88 text1.font_set("DejaVu", 32);
89 text1.text_set("EFL++ Examples");
90 text1.visible_set(true);
91 int t1w, t1h;
92 text1.size_get(&t1w, &t1h);
93 grid.pack(text1, 1, 1, t1w, t1h);
94
95 efl::evas::text text2(efl::eo::parent = canvas);
96 text2.style_set(EVAS_TEXT_STYLE_PLAIN);
97 text2.color_set(0, 120, 0, 255);
98 text2.position_set(t1w+50, t1h+50);
99 text2.font_set("Courier", 16);
100 std::stringstream ss;
101 ss << "version " << EFL_VERSION_MAJOR << "." << EFL_VERSION_MINOR;
102 text2.text_set(ss.str().c_str());
103 text2.visible_set(true);
104 int t2w, t2h;
105 text2.size_get(&t2w, &t2h);
106
107 canvas.render();
108 ::ecore_main_loop_begin();
109 _ecore_evas_shutdown();
110}
111
112int main()
113{
114 efl::eina::eina_init eina_;
115 efl::eo::eo_init eo_;
116 efl::ecore::ecore_init ecore_;
117
118 std::cerr << "[+] Running ELF++ example: Complex Types" << std::endl;
119 example_complex_types();
120
121 return 0;
122}
123#else
124int main() { abort(); }
125#endif
126
diff --git a/src/examples/eolian_cxx/eolian_cxx_eo_events_01.cc b/src/examples/eolian_cxx/eolian_cxx_eo_events_01.cc
deleted file mode 100644
index 2ecdb03..0000000
--- a/src/examples/eolian_cxx/eolian_cxx_eo_events_01.cc
+++ /dev/null
@@ -1,109 +0,0 @@
1#include <iostream>
2#include <thread>
3#include <cassert>
4#include <sstream>
5
6#ifdef HAVE_CONFIG_H
7# include <config.h>
8#endif
9
10#include <Eo.h>
11#include <Ecore.h>
12#include <Evas.h>
13#include <Ecore_Evas.h>
14
15#include <Eina.hh>
16#include <Eo.hh>
17#include <Ecore.hh>
18#include <Evas.hh>
19
20#warning TEST CASE DISABLED: EVAS TYPES NO MORE IN EO API
21
22#if 0
23#include <canvas/evas_canvas.eo.hh>
24#include <canvas/evas_image.eo.hh>
25#include <canvas/evas_text.eo.hh>
26#include <canvas/evas_grid.eo.hh>
27
28namespace efl { namespace evas {
29using ::evas::canvas;
30using ::evas::object;
31using ::evas::text;
32using ::evas::grid;
33using ::evas::rectangle;
34using ::evas::common_interface;
35using ::evas::zoomable_interface;
36} }
37
38namespace {
39
40// XXX Ecore-Evas is not binded yet.
41Ecore_Evas *ee;
42void
43_ecore_evas_init()
44{
45 if (!ee)
46 {
47 ::ecore_evas_init();
48 ::evas_init();
49 ee = ::ecore_evas_new(NULL, 0, 0, 500, 380, NULL);
50 ::ecore_evas_show(ee);
51 }
52}
53void
54_ecore_evas_shutdown()
55{
56 if (ee)
57 {
58 ::ecore_evas_free(ee);
59 ::ecore_evas_shutdown();
60 ee = NULL;
61 }
62}
63
64}
65
66void
67example_complex_types()
68{
69 _ecore_evas_init();
70
71 {
72 efl::evas::canvas canvas(::eo_ref(::ecore_evas_get(ee)));
73
74 efl::evas::rectangle bg(efl::eo::parent = canvas);
75 bg.color_set(255, 255, 255, 255);
76 bg.position_set(0, 0);
77 bg.size_set(500, 250);
78 bg.visible_set(true);
79
80 efl::eo::signal_connection conn =
81 bg.callback_mouse_down_add
82 ([] (efl::evas::object obj EINA_UNUSED, Eo_Event_Description const& desc EINA_UNUSED, void* info EINA_UNUSED)
83 {
84 std::cout << "evas::box::mouse_down" << std::endl;
85 return EO_CALLBACK_CONTINUE;
86 });
87
88 canvas.render();
89 }
90
91 ::ecore_main_loop_begin();
92 _ecore_evas_shutdown();
93}
94
95int main()
96{
97 efl::eina::eina_init eina_;
98 efl::eo::eo_init eo_;
99 efl::ecore::ecore_init ecore_;
100
101 std::cerr << "[+] Running ELF++ example: Eo Events" << std::endl;
102 example_complex_types();
103
104 return 0;
105}
106#else
107int main() { abort(); }
108#endif
109