summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-26 19:44:36 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-26 22:00:02 +0900
commita742edb486a4492396bb1db993bed83051b17c08 (patch)
tree2f0ff721667be6430af613e5201139ddf2c3e7bb
parent7cc23b17540ae59fe0c7e8cc32d10906d32f756b (diff)
examples: Fix C++ bg example
This is not nice yet... part API needs to be improved in C++.
-rw-r--r--src/examples/elementary/bg_cxx_example_02.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/examples/elementary/bg_cxx_example_02.cc b/src/examples/elementary/bg_cxx_example_02.cc
index df16a0f11d..1cc3f7251b 100644
--- a/src/examples/elementary/bg_cxx_example_02.cc
+++ b/src/examples/elementary/bg_cxx_example_02.cc
@@ -1,3 +1,10 @@
1/* To compile:
2 * g++ `pkg-config --cflags --libs elementary-cxx eo-cxx efl-cxx eina-cxx ecore-cxx evas-cxx edje-cxx` ./bg_cxx_example_02.cc -o bg_cxx_example_02
3 *
4 * To run:
5 * ./bg_cxx_example_02
6 */
7
1#include <Elementary.hh> 8#include <Elementary.hh>
2 9
3#include <sstream> 10#include <sstream>
@@ -10,25 +17,19 @@ elm_main (int argc EINA_UNUSED, char **args EINA_UNUSED)
10 using efl::eo::instantiate; 17 using efl::eo::instantiate;
11 18
12 efl::ui::Win win(instantiate); 19 efl::ui::Win win(instantiate);
13 //win.title_set("Bg Image"); 20 win.text_set("Bg Image");
14 win.autohide_set(true); 21 win.autohide_set(true);
15 22
16 //elm_app_compile_data_dir_set("/usr/share/elementary"); 23 // FIXME: Part API needs some fixing to be nice in C++ :)
17 //elm_app_info_set(reinterpret_cast<void*>(elm_main), "elementary", "images/plant_01.jpg"); 24 //efl::eo::downcast<efl::ui::win::Part>(win.part("background"))
25 // .file_set("performance/background.png", nullptr);
18 26
19 elm::Bg bg(instantiate, win); 27 efl::ui::Bg bg(instantiate, win);
20 //bg.load_size_set(320,320); 28 bg.scale_type_set(EFL_UI_IMAGE_SCALE_TYPE_FILL);
21 //bg.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 29 bg.file_set("performance/background.png", nullptr);
22 bg.option_set(ELM_BG_OPTION_SCALE); 30 win.content_set(bg);
23 //std::stringstream ss;
24 //ss << elm_app_data_dir_get() << "/images/plant_01.jpg";
25 bg.file_set("/home/luciana/Pictures/surprised_cat.jpeg", nullptr);
26 //win.resize_object_add(bg);
27 bg.eo_cxx::efl::Gfx::size_set({640,400});
28 bg.visible_set(true);
29 31
30 win.eo_cxx::efl::Gfx::size_set({640, 400}); 32 win.eo_cxx::efl::Gfx::size_set({640, 400});
31 win.visible_set(true);
32 33
33 elm_run(); 34 elm_run();
34 return 0; 35 return 0;