summaryrefslogtreecommitdiff
path: root/src/examples/elementary/toolbar_cxx_example_01.cc
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:09 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:10 -0500
commit6326e18b3fb2a4757f8ffa22be5d55a75da23049 (patch)
tree31d586b52638aa0d0b1c759869a8e3368c9daf5d /src/examples/elementary/toolbar_cxx_example_01.cc
parent7924660d54500285d3844bfa384394c683825cd9 (diff)
efl.file: improve api a bit
Summary: the previous implementation/api had a number of issues: * "file" property contained both "file" and "key" values - also performed file loading operation * "load_error" property which was specific to image objects * no methods for controlling file loading/unloading this patch attempts the following changes: * split "file" property into "file" and "key" properties - also remove "key" from existing "mmap" property * remove "load_error" * directly return error codes from operations * add "load" and "unload" methods for directly controlling load state * add implicit file loading if file/mmap is set during construction * rewrite all efl.file implementations to move file loading into load() method * rewrite all usage of efl.file api based on these changes * add C extension functions to mimic previous behavior ref T7577 Reviewers: segfaultxavi, bu5hm4n, cedric Reviewed By: segfaultxavi Subscribers: vitor.sousa, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7577 Differential Revision: https://phab.enlightenment.org/D8018
Diffstat (limited to 'src/examples/elementary/toolbar_cxx_example_01.cc')
-rw-r--r--src/examples/elementary/toolbar_cxx_example_01.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/examples/elementary/toolbar_cxx_example_01.cc b/src/examples/elementary/toolbar_cxx_example_01.cc
index 5a884b9..f5c47cb 100644
--- a/src/examples/elementary/toolbar_cxx_example_01.cc
+++ b/src/examples/elementary/toolbar_cxx_example_01.cc
@@ -77,7 +77,7 @@ elm_main(int argc, char* argv[])
77 77
78 elm::Widget photo_1(elm_photo_add(win_1._eo_ptr())); 78 elm::Widget photo_1(elm_photo_add(win_1._eo_ptr()));
79 elm_photo_size_set(photo_1._eo_ptr(), 40); 79 elm_photo_size_set(photo_1._eo_ptr(), 40);
80 efl_file_set(photo_1._eo_ptr(), "/opt/e/share/elementary/images/plant_01.jpg", nullptr); 80 efl_file_simple_load(photo_1._eo_ptr(), "/opt/e/share/elementary/images/plant_01.jpg", nullptr);
81 photo_1.hint_weight_set(1, 1); 81 photo_1.hint_weight_set(1, 1);
82 photo_1.hint_align_set(0.5, 0.5); 82 photo_1.hint_align_set(0.5, 0.5);
83 photo_1.visible_set(true); 83 photo_1.visible_set(true);
@@ -92,7 +92,7 @@ elm_main(int argc, char* argv[])
92 elm_table_pack(table_1._eo_ptr(), photo_2._eo_ptr(), 1, 0, 1, 1); 92 elm_table_pack(table_1._eo_ptr(), photo_2._eo_ptr(), 1, 0, 1, 1);
93 elm::Widget photo_3(elm_photo_add(win_1._eo_ptr())); 93 elm::Widget photo_3(elm_photo_add(win_1._eo_ptr()));
94 elm_photo_size_set(photo_3._eo_ptr(), 20); 94 elm_photo_size_set(photo_3._eo_ptr(), 20);
95 efl_file_set(photo_3._eo_ptr(), "/opt/e/share/elementary/images/sky_01.jpg", nullptr); 95 efl_file_simple_load(photo_3._eo_ptr(), "/opt/e/share/elementary/images/sky_01.jpg", nullptr);
96 photo_3.hint_weight_set(1, 1); 96 photo_3.hint_weight_set(1, 1);
97 photo_3.hint_align_set(0.5, 0.5); 97 photo_3.hint_align_set(0.5, 0.5);
98 photo_3.visible_set(true); 98 photo_3.visible_set(true);
@@ -100,7 +100,7 @@ elm_main(int argc, char* argv[])
100 elm_table_pack(table_1._eo_ptr(), photo_3._eo_ptr(), 0, 1, 1, 1); 100 elm_table_pack(table_1._eo_ptr(), photo_3._eo_ptr(), 0, 1, 1, 1);
101 elm::Widget photo_4(elm_photo_add(win_1._eo_ptr())); 101 elm::Widget photo_4(elm_photo_add(win_1._eo_ptr()));
102 elm_photo_size_set(photo_4._eo_ptr(), 60); 102 elm_photo_size_set(photo_4._eo_ptr(), 60);
103 efl_file_set(photo_4._eo_ptr(), "/opt/e/share/elementary/images/sky_02.jpg", nullptr); 103 efl_file_simple_load(photo_4._eo_ptr(), "/opt/e/share/elementary/images/sky_02.jpg", nullptr);
104 photo_4.hint_weight_set(1, 1); 104 photo_4.hint_weight_set(1, 1);
105 photo_4.hint_align_set(0.5, 0.5); 105 photo_4.hint_align_set(0.5, 0.5);
106 photo_4.visible_set(true); 106 photo_4.visible_set(true);
@@ -111,22 +111,22 @@ elm_main(int argc, char* argv[])
111 win_1.content_set(box_1); 111 win_1.content_set(box_1);
112 112
113 auto _item_2_selected_cb = std::bind([&] () { 113 auto _item_2_selected_cb = std::bind([&] () {
114 efl_file_set(photo_1._eo_ptr(), "/opt/e/share/elementary/images/rock_01.jpg", nullptr); 114 efl_file_simple_load(photo_1._eo_ptr(), "/opt/e/share/elementary/images/rock_01.jpg", nullptr);
115 }); 115 });
116 efl::eolian::event_add(efl::ui::Selectable::selected_event, item_2, _item_2_selected_cb); 116 efl::eolian::event_add(efl::ui::Selectable::selected_event, item_2, _item_2_selected_cb);
117 117
118 auto _item_3_selected_cb = std::bind([&] () { 118 auto _item_3_selected_cb = std::bind([&] () {
119 efl_file_set(photo_4._eo_ptr(), "/opt/e/share/elementary/images/wood_01.jpg", nullptr); 119 efl_file_simple_load(photo_4._eo_ptr(), "/opt/e/share/elementary/images/wood_01.jpg", nullptr);
120 }); 120 });
121 121
122 efl::eolian::event_add(efl::ui::Selectable::selected_event, item_3, _item_3_selected_cb); 122 efl::eolian::event_add(efl::ui::Selectable::selected_event, item_3, _item_3_selected_cb);
123 auto _item_4_selected_cb = std::bind([&] () { 123 auto _item_4_selected_cb = std::bind([&] () {
124 efl_file_set(photo_4._eo_ptr(), "/opt/e/share/elementary/images/sky_03.jpg", nullptr); 124 efl_file_simple_load(photo_4._eo_ptr(), "/opt/e/share/elementary/images/sky_03.jpg", nullptr);
125 }); 125 });
126 126
127 efl::eolian::event_add(efl::ui::Selectable::selected_event, item_4, _item_4_selected_cb); 127 efl::eolian::event_add(efl::ui::Selectable::selected_event, item_4, _item_4_selected_cb);
128 auto _item_5_selected_cb = std::bind([&] () { 128 auto _item_5_selected_cb = std::bind([&] () {
129 efl_file_set(photo_4._eo_ptr(), nullptr, nullptr); 129 efl_file_simple_load(photo_4._eo_ptr(), nullptr, nullptr);
130 }); 130 });
131 131
132 efl::eolian::event_add(efl::ui::Selectable::selected_event, item_5, _item_5_selected_cb); 132 efl::eolian::event_add(efl::ui::Selectable::selected_event, item_5, _item_5_selected_cb);