summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/ecore/ecore_evas_ews_example.c2
-rw-r--r--src/examples/ecore/efl_exe.c2
-rw-r--r--src/examples/ecore/efl_mono_loop_timer_example.cs15
-rw-r--r--src/examples/ecore/efl_thread.c6
-rw-r--r--src/examples/efl_mono/EoInherit01.cs15
-rw-r--r--src/examples/efl_mono/FunctionPointer01.cs15
-rw-r--r--src/examples/efl_mono/example_numberwrapper.c15
-rw-r--r--src/examples/eina/EinaArray01.cs15
-rw-r--r--src/examples/eina/EinaBinbuf01.cs15
-rw-r--r--src/examples/eina/EinaError01.cs15
-rw-r--r--src/examples/eina/EinaHash01.cs15
-rw-r--r--src/examples/eina_cxx/eina_cxx_list_01.cc15
-rw-r--r--src/examples/eina_cxx/eina_cxx_thread_01.cc15
-rw-r--r--src/examples/elementary/.gitignore5
-rw-r--r--src/examples/elementary/bg_cxx_example_01.cc15
-rw-r--r--src/examples/elementary/bg_cxx_example_02.cc15
-rw-r--r--src/examples/elementary/bg_example_01.js2
-rw-r--r--src/examples/elementary/box_cxx_example_02.cc15
-rw-r--r--src/examples/elementary/button_cxx_example_00.cc15
-rw-r--r--src/examples/elementary/button_cxx_example_01.cc15
-rw-r--r--src/examples/elementary/button_example_01.js6
-rw-r--r--src/examples/elementary/calendar_cxx_example_01.cc15
-rw-r--r--src/examples/elementary/calendar_cxx_example_02.cc15
-rw-r--r--src/examples/elementary/calendar_cxx_example_03.cc15
-rw-r--r--src/examples/elementary/calendar_cxx_example_04.cc15
-rw-r--r--src/examples/elementary/calendar_cxx_example_05.cc15
-rw-r--r--src/examples/elementary/clock_cxx_example.cc15
-rw-r--r--src/examples/elementary/efl_canvas_layout_text.c5
-rw-r--r--src/examples/elementary/efl_canvas_textblock_obstacles_example.c273
-rw-r--r--src/examples/elementary/efl_ui_collection_view_example_1.c2
-rw-r--r--src/examples/elementary/efl_ui_grid_view_example_1.c477
-rw-r--r--src/examples/elementary/efl_ui_list_example_1.c23
-rw-r--r--src/examples/elementary/efl_ui_list_view_example_3.c4
-rw-r--r--src/examples/elementary/efl_ui_relative_container_example_01.c (renamed from src/examples/elementary/efl_ui_relative_layout_example_01.c)18
-rw-r--r--src/examples/elementary/efl_ui_relative_container_example_02.c (renamed from src/examples/elementary/efl_ui_relative_layout_example_02.c)14
-rw-r--r--src/examples/elementary/efl_ui_slider_mono.cs15
-rw-r--r--src/examples/elementary/efl_ui_slideshow_example.c4
-rw-r--r--src/examples/elementary/efl_ui_unit_converter.cs26
-rw-r--r--src/examples/elementary/icon_cxx_example_01.cc15
-rw-r--r--src/examples/elementary/icon_example_01.js2
-rw-r--r--src/examples/elementary/layout_property_bind.c46
-rw-r--r--src/examples/elementary/location_example_01.c151
-rw-r--r--src/examples/elementary/menu_cxx_example_01.cc15
-rw-r--r--src/examples/elementary/meson.build5
-rw-r--r--src/examples/elementary/popup_cxx_example.cc15
-rw-r--r--src/examples/elementary/radio_cxx_example_01.cc15
-rw-r--r--src/examples/elementary/slider_cxx_example.cc15
-rw-r--r--src/examples/elementary/slider_example.js4
-rw-r--r--src/examples/elementary/spinner_cxx_example.cc15
-rw-r--r--src/examples/elementary/table_cxx_example_01.cc23
-rw-r--r--src/examples/elementary/table_cxx_example_02.cc15
-rw-r--r--src/examples/elementary/toolbar_cxx_example_01.cc15
-rw-r--r--src/examples/elementary/twitter_example_01.js12
-rw-r--r--src/examples/elocation/.gitignore1
-rw-r--r--src/examples/elocation/elocation.c167
-rw-r--r--src/examples/eolian_cxx/colourable_cxx.cc15
-rw-r--r--src/examples/eolian_cxx/colourablesquare_cxx.cc15
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc15
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_simple_01.cc15
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc15
-rw-r--r--src/examples/evas/efl-canvas-animation.c179
-rw-r--r--src/examples/evas/efl-canvas-vg-simple.c663
-rw-r--r--src/examples/evas/evas-vg-json.c12
-rw-r--r--src/examples/evas/evas_cxx_rectangle.cc15
-rw-r--r--src/examples/evas/meson.build2
65 files changed, 2265 insertions, 411 deletions
diff --git a/src/examples/ecore/ecore_evas_ews_example.c b/src/examples/ecore/ecore_evas_ews_example.c
index a8af178..b4415cb 100644
--- a/src/examples/ecore/ecore_evas_ews_example.c
+++ b/src/examples/ecore/ecore_evas_ews_example.c
@@ -82,7 +82,7 @@ _stdin_cb(void *data EINA_UNUSED, Ecore_Fd_Handler *handler EINA_UNUSED)
82{ 82{
83 const Eina_List *l; 83 const Eina_List *l;
84 Ecore_Evas *ee; 84 Ecore_Evas *ee;
85 char c = getchar(); 85 int c = getchar();
86 86
87 if (c == EOF) 87 if (c == EOF)
88 { 88 {
diff --git a/src/examples/ecore/efl_exe.c b/src/examples/ecore/efl_exe.c
index 1458d06..eb85eca 100644
--- a/src/examples/ecore/efl_exe.c
+++ b/src/examples/ecore/efl_exe.c
@@ -21,7 +21,7 @@ _read_change(void *data EINA_UNUSED, const Efl_Event *ev)
21 Eina_Error err = efl_io_reader_read(obj, &rw_slice); 21 Eina_Error err = efl_io_reader_read(obj, &rw_slice);
22 if (!err) 22 if (!err)
23 { 23 {
24 buf[rw_slice.len] = 0; 24 buf[rw_slice.len - 1] = 0;
25 printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); 25 printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
26 } 26 }
27 } 27 }
diff --git a/src/examples/ecore/efl_mono_loop_timer_example.cs b/src/examples/ecore/efl_mono_loop_timer_example.cs
index 7e89916..b1f89b9 100644
--- a/src/examples/ecore/efl_mono_loop_timer_example.cs
+++ b/src/examples/ecore/efl_mono_loop_timer_example.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using System; 16using System;
2using System.Runtime.InteropServices; 17using System.Runtime.InteropServices;
3using System.Runtime.CompilerServices; 18using System.Runtime.CompilerServices;
diff --git a/src/examples/ecore/efl_thread.c b/src/examples/ecore/efl_thread.c
index 301bf5c..5a2ce14 100644
--- a/src/examples/ecore/efl_thread.c
+++ b/src/examples/ecore/efl_thread.c
@@ -35,7 +35,7 @@ _th_read_change(void *data EINA_UNUSED, const Efl_Event *ev)
35 Eina_Error err = efl_io_reader_read(obj, &rw_slice); 35 Eina_Error err = efl_io_reader_read(obj, &rw_slice);
36 if (!err) 36 if (!err)
37 { 37 {
38 buf[rw_slice.len] = 0; 38 buf[rw_slice.len - 1] = 0;
39 printf("--- TH READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); 39 printf("--- TH READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
40 40
41 char *buf2 = "yes-im-here "; 41 char *buf2 = "yes-im-here ";
@@ -112,7 +112,7 @@ _read_change(void *data EINA_UNUSED, const Efl_Event *ev)
112 Eina_Error err = efl_io_reader_read(obj, &rw_slice); 112 Eina_Error err = efl_io_reader_read(obj, &rw_slice);
113 if (!err) 113 if (!err)
114 { 114 {
115 buf[rw_slice.len] = 0; 115 buf[rw_slice.len - 1] = 0;
116 printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); 116 printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
117 } 117 }
118 } 118 }
@@ -146,7 +146,7 @@ _stdin_read_change(void *data EINA_UNUSED, const Efl_Event *ev)
146 Eina_Error err = efl_io_reader_read(obj, &rw_slice); 146 Eina_Error err = efl_io_reader_read(obj, &rw_slice);
147 if (!err) 147 if (!err)
148 { 148 {
149 buf[rw_slice.len] = 0; 149 buf[rw_slice.len - 1] = 0;
150 printf("--- STDIN READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); 150 printf("--- STDIN READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
151 } 151 }
152 } 152 }
diff --git a/src/examples/efl_mono/EoInherit01.cs b/src/examples/efl_mono/EoInherit01.cs
index 26cff96..b9913e8 100644
--- a/src/examples/efl_mono/EoInherit01.cs
+++ b/src/examples/efl_mono/EoInherit01.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using static System.Console; 16using static System.Console;
2 17
3class PlusTenNumberWrapper : Example.Numberwrapper 18class PlusTenNumberWrapper : Example.Numberwrapper
diff --git a/src/examples/efl_mono/FunctionPointer01.cs b/src/examples/efl_mono/FunctionPointer01.cs
index 3eaa29d..edb0a48 100644
--- a/src/examples/efl_mono/FunctionPointer01.cs
+++ b/src/examples/efl_mono/FunctionPointer01.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using static System.Console; 16using static System.Console;
2 17
3public class ExampleFunctionPointer01 18public class ExampleFunctionPointer01
diff --git a/src/examples/efl_mono/example_numberwrapper.c b/src/examples/efl_mono/example_numberwrapper.c
index 52a5af9..c7c3376 100644
--- a/src/examples/efl_mono/example_numberwrapper.c
+++ b/src/examples/efl_mono/example_numberwrapper.c
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1 16
2#ifdef HAVE_CONFIG_H 17#ifdef HAVE_CONFIG_H
3#include "config.h" 18#include "config.h"
diff --git a/src/examples/eina/EinaArray01.cs b/src/examples/eina/EinaArray01.cs
index 944c0bd..2e8906d 100644
--- a/src/examples/eina/EinaArray01.cs
+++ b/src/examples/eina/EinaArray01.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using static System.Console; 16using static System.Console;
2 17
3public class ExampleEinaArray01 18public class ExampleEinaArray01
diff --git a/src/examples/eina/EinaBinbuf01.cs b/src/examples/eina/EinaBinbuf01.cs
index 5482328..778df71 100644
--- a/src/examples/eina/EinaBinbuf01.cs
+++ b/src/examples/eina/EinaBinbuf01.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using static System.Console; 16using static System.Console;
2 17
3public class ExampleEinaBinbuf01 18public class ExampleEinaBinbuf01
diff --git a/src/examples/eina/EinaError01.cs b/src/examples/eina/EinaError01.cs
index 8fceaef..e16c872 100644
--- a/src/examples/eina/EinaError01.cs
+++ b/src/examples/eina/EinaError01.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using static System.Console; 16using static System.Console;
2 17
3public class ExampleEinaError01 18public class ExampleEinaError01
diff --git a/src/examples/eina/EinaHash01.cs b/src/examples/eina/EinaHash01.cs
index 31f3c15..d411762 100644
--- a/src/examples/eina/EinaHash01.cs
+++ b/src/examples/eina/EinaHash01.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using static System.Console; 16using static System.Console;
2 17
3public class ExampleEinaHash01 18public class ExampleEinaHash01
diff --git a/src/examples/eina_cxx/eina_cxx_list_01.cc b/src/examples/eina_cxx/eina_cxx_list_01.cc
index f74f9d6..38f81e9 100644
--- a/src/examples/eina_cxx/eina_cxx_list_01.cc
+++ b/src/examples/eina_cxx/eina_cxx_list_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1//Compile with: 16//Compile with:
2//gcc -g eina_list_01.c -o eina_list_01 `pkg-config --cflags --libs eina` 17//gcc -g eina_list_01.c -o eina_list_01 `pkg-config --cflags --libs eina`
3 18
diff --git a/src/examples/eina_cxx/eina_cxx_thread_01.cc b/src/examples/eina_cxx/eina_cxx_thread_01.cc
index b47b1a6..81c9bcb 100644
--- a/src/examples/eina_cxx/eina_cxx_thread_01.cc
+++ b/src/examples/eina_cxx/eina_cxx_thread_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1//Compile with: 16//Compile with:
2//gcc -g eina_list_01.c -o eina_list_01 `pkg-config --cflags --libs eina` 17//gcc -g eina_list_01.c -o eina_list_01 `pkg-config --cflags --libs eina`
3 18
diff --git a/src/examples/elementary/.gitignore b/src/examples/elementary/.gitignore
index 06e2055..84d951e 100644
--- a/src/examples/elementary/.gitignore
+++ b/src/examples/elementary/.gitignore
@@ -169,5 +169,6 @@
169/efl_ui_list_view_example_3 169/efl_ui_list_view_example_3
170/efl_ui_theme_example_01 170/efl_ui_theme_example_01
171/efl_ui_theme_example_02 171/efl_ui_theme_example_02
172/efl_ui_relative_layout_example_01 172/efl_ui_relative_container_example_01
173/efl_ui_relative_layout_example_02 173/efl_ui_relative_container_example_02
174/efl_canvas_textblock_obstacles_example
diff --git a/src/examples/elementary/bg_cxx_example_01.cc b/src/examples/elementary/bg_cxx_example_01.cc
index 4c1368a..f555f93 100644
--- a/src/examples/elementary/bg_cxx_example_01.cc
+++ b/src/examples/elementary/bg_cxx_example_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#define EFL_CXXPERIMENTAL // for background part 16#define EFL_CXXPERIMENTAL // for background part
2#ifndef EFL_BETA_API_SUPPORT 17#ifndef EFL_BETA_API_SUPPORT
3#define EFL_BETA_API_SUPPORT 18#define EFL_BETA_API_SUPPORT
diff --git a/src/examples/elementary/bg_cxx_example_02.cc b/src/examples/elementary/bg_cxx_example_02.cc
index f276fdd..d9f9159 100644
--- a/src/examples/elementary/bg_cxx_example_02.cc
+++ b/src/examples/elementary/bg_cxx_example_02.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1/* To compile: 16/* 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 17 * 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 * 18 *
diff --git a/src/examples/elementary/bg_example_01.js b/src/examples/elementary/bg_example_01.js
index 410cb3a..f8d9837 100644
--- a/src/examples/elementary/bg_example_01.js
+++ b/src/examples/elementary/bg_example_01.js
@@ -6,7 +6,7 @@ win.setText("Bg Plain");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8bg = new efl.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setColor(255, 0,0,255) 9bg.setColor(255, 0,0,255);
10bg.setHintWeight(1.0, 1.0); 10bg.setHintWeight(1.0, 1.0);
11win.setContent(bg); 11win.setContent(bg);
12bg.setVisible(true); 12bg.setVisible(true);
diff --git a/src/examples/elementary/box_cxx_example_02.cc b/src/examples/elementary/box_cxx_example_02.cc
index e9d802c..e452815 100644
--- a/src/examples/elementary/box_cxx_example_02.cc
+++ b/src/examples/elementary/box_cxx_example_02.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` box_cxx_example_02.cc -o box_cxx_example_02 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` box_cxx_example_02.cc -o box_cxx_example_02
2 17
3#include <Efl_Ui.hh> 18#include <Efl_Ui.hh>
diff --git a/src/examples/elementary/button_cxx_example_00.cc b/src/examples/elementary/button_cxx_example_00.cc
index ae0a0fa..da41f07 100644
--- a/src/examples/elementary/button_cxx_example_00.cc
+++ b/src/examples/elementary/button_cxx_example_00.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_00.cc -o button_cxx_example_00 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_00.cc -o button_cxx_example_00
2 17
3#define EFL_CXXPERIMENTAL 18#define EFL_CXXPERIMENTAL
diff --git a/src/examples/elementary/button_cxx_example_01.cc b/src/examples/elementary/button_cxx_example_01.cc
index 8623dfa..880f955 100644
--- a/src/examples/elementary/button_cxx_example_01.cc
+++ b/src/examples/elementary/button_cxx_example_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_01.cc -o button_cxx_example_01 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_01.cc -o button_cxx_example_01
2 17
3#define EFL_CXXPERIMENTAL 18#define EFL_CXXPERIMENTAL
diff --git a/src/examples/elementary/button_example_01.js b/src/examples/elementary/button_example_01.js
index f2f3a7d..89a4886 100644
--- a/src/examples/elementary/button_example_01.js
+++ b/src/examples/elementary/button_example_01.js
@@ -1,7 +1,7 @@
1efl = require('efl'); 1efl = require('efl');
2 2
3function setIcon(widget, icon) { 3function setIcon(widget, icon) {
4 container = widget.part("icon").cast("Efl.Content"); 4 var container = widget.part("icon").cast("Efl.Content");
5 container.setContent(icon); 5 container.setContent(icon);
6} 6}
7 7
@@ -144,7 +144,7 @@ up.setHintWeight(1.0, 0.0);
144up.setHintAlign(-1.0, 0.0); 144up.setHintAlign(-1.0, 0.0);
145box.packEnd(up); 145box.packEnd(up);
146up.setVisible(true); 146up.setVisible(true);
147up.on('repeated', _btn_cursors_move) 147up.on('repeated', _btn_cursors_move);
148up.on('unpressed', _btn_cursors_release); 148up.on('unpressed', _btn_cursors_release);
149icon_up = new efl.Efl.Ui.Image(win); 149icon_up = new efl.Efl.Ui.Image(win);
150icon_up.setIcon("arrow_up"); 150icon_up.setIcon("arrow_up");
@@ -164,7 +164,7 @@ left.setHintWeight(0.0, 1.0);
164left.setHintAlign(0.0, -1.0); 164left.setHintAlign(0.0, -1.0);
165box_inferior.packEnd(left); 165box_inferior.packEnd(left);
166left.setVisible(true); 166left.setVisible(true);
167left.on('repeated', _btn_cursors_move) 167left.on('repeated', _btn_cursors_move);
168left.on('unpressed', _btn_cursors_release); 168left.on('unpressed', _btn_cursors_release);
169 169
170icon_left = new efl.Efl.Ui.Image(win); 170icon_left = new efl.Efl.Ui.Image(win);
diff --git a/src/examples/elementary/calendar_cxx_example_01.cc b/src/examples/elementary/calendar_cxx_example_01.cc
index fbeccb9..43d91f2 100644
--- a/src/examples/elementary/calendar_cxx_example_01.cc
+++ b/src/examples/elementary/calendar_cxx_example_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#include <Efl_Ui.hh> 16#include <Efl_Ui.hh>
2 17
3using efl::eo::instantiate; 18using efl::eo::instantiate;
diff --git a/src/examples/elementary/calendar_cxx_example_02.cc b/src/examples/elementary/calendar_cxx_example_02.cc
index dba2b1a..0d48fe9 100644
--- a/src/examples/elementary/calendar_cxx_example_02.cc
+++ b/src/examples/elementary/calendar_cxx_example_02.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#define EFL_CXXPERIMENTAL 16#define EFL_CXXPERIMENTAL
2 17
3#include <Efl_Ui.hh> 18#include <Efl_Ui.hh>
diff --git a/src/examples/elementary/calendar_cxx_example_03.cc b/src/examples/elementary/calendar_cxx_example_03.cc
index 3f75b07..9b23d98 100644
--- a/src/examples/elementary/calendar_cxx_example_03.cc
+++ b/src/examples/elementary/calendar_cxx_example_03.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#include <Efl_Ui.hh> 16#include <Efl_Ui.hh>
2 17
3using efl::eo::instantiate; 18using efl::eo::instantiate;
diff --git a/src/examples/elementary/calendar_cxx_example_04.cc b/src/examples/elementary/calendar_cxx_example_04.cc
index ef2a8eb..7bf9d94 100644
--- a/src/examples/elementary/calendar_cxx_example_04.cc
+++ b/src/examples/elementary/calendar_cxx_example_04.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#include <Efl_Ui.hh> 16#include <Efl_Ui.hh>
2 17
3#warning This example can not be implemented with EO APIs... FIXME 18#warning This example can not be implemented with EO APIs... FIXME
diff --git a/src/examples/elementary/calendar_cxx_example_05.cc b/src/examples/elementary/calendar_cxx_example_05.cc
index ccb7891..6fc857d 100644
--- a/src/examples/elementary/calendar_cxx_example_05.cc
+++ b/src/examples/elementary/calendar_cxx_example_05.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#include <Efl_Ui.hh> 16#include <Efl_Ui.hh>
2 17
3#warning This example can not be implemented with EO APIs... FIXME 18#warning This example can not be implemented with EO APIs... FIXME
diff --git a/src/examples/elementary/clock_cxx_example.cc b/src/examples/elementary/clock_cxx_example.cc
index aa08d40..6566eaf 100644
--- a/src/examples/elementary/clock_cxx_example.cc
+++ b/src/examples/elementary/clock_cxx_example.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#include <Efl_Ui.hh> 16#include <Efl_Ui.hh>
2 17
3using efl::eo::instantiate; 18using efl::eo::instantiate;
diff --git a/src/examples/elementary/efl_canvas_layout_text.c b/src/examples/elementary/efl_canvas_layout_text.c
index 593dbe8..268dd48 100644
--- a/src/examples/elementary/efl_canvas_layout_text.c
+++ b/src/examples/elementary/efl_canvas_layout_text.c
@@ -134,8 +134,9 @@ efl_main(void *data EINA_UNUSED,
134 134
135 efl_text_markup_set(efl_part(layout, "text"), "This is an example text. This is a layout text part."); 135 efl_text_markup_set(efl_part(layout, "text"), "This is an example text. This is a layout text part.");
136 efl_text_wrap_set(efl_part(layout, "text"), wraps[wrap_itr].wrap); 136 efl_text_wrap_set(efl_part(layout, "text"), wraps[wrap_itr].wrap);
137 efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 0, 255); 137 efl_text_color_set(efl_part(layout, "text"), 255, 255, 0, 255);
138 efl_text_font_set(efl_part(layout, "text"), "Serif", 12); 138 efl_text_font_family_set(efl_part(layout, "text"), "Serif");
139 efl_text_font_size_set(efl_part(layout, "text"), 12);
139 140
140 efl_canvas_layout_part_text_expand_set(efl_part(layout, "text"), 141 efl_canvas_layout_part_text_expand_set(efl_part(layout, "text"),
141 expands[expand_itr].expand); 142 expands[expand_itr].expand);
diff --git a/src/examples/elementary/efl_canvas_textblock_obstacles_example.c b/src/examples/elementary/efl_canvas_textblock_obstacles_example.c
new file mode 100644
index 0000000..d14123a
--- /dev/null
+++ b/src/examples/elementary/efl_canvas_textblock_obstacles_example.c
@@ -0,0 +1,273 @@
1#define EFL_BETA_API_SUPPORT 1
2
3#include <Efl_Ui.h>
4
5 /**
6 * Example of canvas textblock obstacles.
7 *
8 * You start with two registered obstacle objects. They are not visible
9 * at first, so the canvas textblock simply shows the text that has been set to it.
10 * Once the obstacle is visible (show/hide keys in the example), the text will
11 * wrap around it.
12 * This example allows you to test two obstacles registered to the same
13 * canvas textblock object. Also, you can play with size and position for each.
14 * Use the 'h' key to show the provided options for this test.
15 *
16 * @verbatim
17 * gcc -g efl_canvas_textblock_obstacles_example.c -o efl_canvas_textblock_obstacles_example `pkg-config --cflags --libs elementary`
18 * @endverbatim
19 */
20
21#define WIDTH (360)
22#define HEIGHT (240)
23
24#define POINTER_CYCLE(_ptr, _array) \
25 do \
26 { \
27 if ((unsigned int)(((unsigned char *)(_ptr)) - ((unsigned char *)(_array))) >= \
28 sizeof(_array)) \
29 _ptr = _array; \
30 } \
31 while(0)
32
33static const char *commands = \
34 "commands are:\n"
35 "\tt - change currently controlled obstacle\n"
36 "\tv - show/hide current obstacle\n"
37 "\ts - cycle current obstacle's size\n"
38 "\tp - change current obstacle's position (random)\n"
39 "\tw - cycle text wrapping modes (none/word/char/mixed)\n"
40 "\th - print help\n";
41
42struct text_preset_data
43{
44 const char **font_ptr;
45 const char *font[3];
46
47 const char **wrap_ptr;
48 const char *wrap[4];
49
50 int *obs_size_ptr;
51 int obs_size[3];
52
53 Eo **obs_ptr; /* pointer to the currently controlled obstacle object */
54 Eo *obs[2];
55};
56
57struct test_data
58{
59 Eo *win, *box, *bg, *text;
60 struct text_preset_data t_data;
61 Eina_Size2D size;
62};
63
64static struct test_data d = {0};
65
66static unsigned int
67_getrand(unsigned int low, unsigned int high)
68{
69 return (rand() % (high - low)) + low;
70}
71
72static void
73_style_set(const char *wrap)
74{
75 char buf[2000];
76 snprintf(buf,
77 2000,
78 "font=Sans font_size=16 color=#000 wrap=%s",
79 wrap);
80
81 efl_canvas_textblock_style_apply(d.text, buf);
82}
83
84static void
85_key_down(void *data EINA_UNUSED, const Efl_Event *ev)
86{
87 const char *key = efl_input_key_string_get(ev->info);
88 if (!key)
89 return;
90
91 if (strcmp(key, "h") == 0) /* print help */
92 {
93 printf("%s\n", commands);
94 return;
95 }
96
97 if (strcmp(key, "t") == 0) /* change obstacle type */
98 {
99 (d.t_data.obs_ptr)++;
100 POINTER_CYCLE(d.t_data.obs_ptr, d.t_data.obs);
101
102 printf("Now controlling obstacle: %p\n", *d.t_data.obs_ptr);
103
104 return;
105 }
106
107 if (strcmp(key, "v") == 0) /* change obstacle visibility */
108 {
109 Eo *obj = *d.t_data.obs_ptr;
110 if (efl_gfx_entity_visible_get(obj))
111 efl_gfx_entity_visible_set(obj, EINA_FALSE);
112 else
113 efl_gfx_entity_visible_set(obj, EINA_TRUE);
114
115 printf("Show/hide toggle for obstacle %p\n",
116 *d.t_data.obs_ptr);
117
118 efl_canvas_textblock_obstacles_update(d.text);
119
120 return;
121 }
122
123 if (strcmp(key, "s") == 0) /* change obstacle size */
124 {
125 (d.t_data.obs_size_ptr)++;
126 POINTER_CYCLE(d.t_data.obs_size_ptr, d.t_data.obs_size);
127
128 efl_gfx_entity_size_set(*d.t_data.obs_ptr, EINA_SIZE2D(*d.t_data.obs_size_ptr, *d.t_data.obs_size_ptr));
129
130 efl_canvas_textblock_obstacles_update(d.text);
131
132 printf("Changing obstacle size to: %d,%d\n",
133 *d.t_data.obs_size_ptr, *d.t_data.obs_size_ptr);
134
135 return;
136 }
137
138 if (strcmp(key, "p") == 0) /* change obstacle position */
139 {
140 int x, y;
141 x = _getrand(0, d.size.w);
142 y = _getrand(0, d.size.h);
143
144 efl_gfx_entity_position_set(*d.t_data.obs_ptr, EINA_POSITION2D(x, y));
145 efl_canvas_textblock_obstacles_update(d.text);
146
147 printf("Changing obstacles position\n");
148 efl_gfx_entity_position_set(*d.t_data.obs_ptr, EINA_POSITION2D(x, y));
149
150 Eina_Position2D r_rec = efl_gfx_entity_position_get(d.t_data.obs[0]);
151 Eina_Position2D g_rec = efl_gfx_entity_position_get(d.t_data.obs[1]);
152
153 printf("Obstacle #1 (red) : [%d,%d]\n", r_rec.x, r_rec.y);
154 printf("Obstacle #2 (green): [%d,%d]\n", g_rec.x, g_rec.y);
155
156 return;
157 }
158
159 if (strcmp(key, "w") == 0) /* change obstacle position */
160 {
161 (d.t_data.wrap_ptr)++;
162 POINTER_CYCLE(d.t_data.wrap_ptr, d.t_data.wrap);
163 printf("Changing wrap mode to: %s\n",
164 *d.t_data.wrap_ptr);
165 _style_set(*d.t_data.wrap_ptr);
166 efl_canvas_textblock_obstacles_update(d.text);
167
168 return;
169 }
170}
171
172static void
173_win_resize(void *data EINA_UNUSED, const Efl_Event *ev)
174{
175 Eina_Size2D sz;
176
177 sz = efl_gfx_entity_size_get(ev->object);
178 efl_gfx_entity_size_set(d.bg, sz);
179 efl_gfx_entity_size_set(d.text, sz);
180
181 d.size = sz;
182}
183
184static void
185_text_init()
186{
187 _style_set("word");
188
189 efl_text_markup_set(d.text,
190 "This example text demonstrates the textblock object"
191 " with obstacle objects support."
192 " Any evas object <item size=72x16></item>can register itself as an obstacle to the textblock"
193 " object. Upon regi<color=#0ff>stering, it aff</color>ects the layout of the text in"
194 " certain situations. Usually, when the obstacle shows above the text"
195 " area, it will cause the layout of the text to split and move"
196 " parts of it, so that all text area is apparent."
197 );
198}
199
200static void
201_gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
202{
203 efl_exit(0);
204}
205
206static void
207_gui_setup()
208{
209 /* init values one is going to cycle through while running this
210 * example */
211 struct text_preset_data init_data =
212 {
213 .font = {"DejaVu", "Courier", "Utopia"},
214 .wrap = {"word", "char", "mixed", "none"},
215 .obs_size = {50, 70, 100},
216 .obs = {NULL, NULL},
217 };
218
219 d.t_data = init_data;
220 d.t_data.font_ptr = d.t_data.font;
221 d.t_data.obs_size_ptr = d.t_data.obs_size;
222 d.t_data.obs_ptr = d.t_data.obs;
223
224 d.win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
225 efl_text_set(efl_added, "Obstacles Example"),
226 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
227
228 efl_gfx_entity_size_set(d.win, EINA_SIZE2D(WIDTH, HEIGHT));
229 printf("Window size set to [%d,%d]\n", WIDTH, HEIGHT);
230
231 efl_event_callback_add(d.win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL);
232 efl_event_callback_add(d.win, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _win_resize, NULL);
233 efl_event_callback_add(d.win, EFL_EVENT_KEY_DOWN, _key_down, NULL);
234
235 d.bg = efl_add(EFL_CANVAS_RECTANGLE_CLASS, d.win,
236 efl_gfx_color_set(efl_added, 255, 255, 255, 255));
237
238 efl_gfx_entity_size_set(d.bg, EINA_SIZE2D(WIDTH, HEIGHT));
239 efl_gfx_entity_position_set(d.bg, EINA_POSITION2D(0, 0));
240
241 d.text = efl_add(EFL_CANVAS_TEXTBLOCK_CLASS, d.win,
242 efl_text_multiline_set(efl_added, EINA_TRUE));
243
244 _text_init();
245 efl_gfx_entity_size_set(d.text, EINA_SIZE2D(WIDTH, HEIGHT));
246 efl_gfx_entity_position_set(d.text, EINA_POSITION2D(0, 0));
247
248 d.size.w = WIDTH;
249 d.size.h = HEIGHT;
250
251 /* init obstacles */
252 d.t_data.obs[0] = efl_add(EFL_CANVAS_RECTANGLE_CLASS, d.win,
253 efl_gfx_color_set(efl_added, 255, 0, 0, 255));
254
255 efl_gfx_entity_size_set(d.t_data.obs[0], EINA_SIZE2D(50,50));
256
257 d.t_data.obs[1] = efl_add(EFL_CANVAS_RECTANGLE_CLASS, d.win,
258 efl_gfx_color_set(efl_added, 0, 255, 0, 255));
259
260 efl_gfx_entity_size_set(d.t_data.obs[1], EINA_SIZE2D(50,50));
261
262 efl_canvas_textblock_obstacle_add(d.text, d.t_data.obs[0]);
263 efl_canvas_textblock_obstacle_add(d.text, d.t_data.obs[1]);
264
265 printf("%s\n", commands);
266}
267
268EAPI_MAIN void
269efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
270{
271 _gui_setup();
272}
273EFL_MAIN()
diff --git a/src/examples/elementary/efl_ui_collection_view_example_1.c b/src/examples/elementary/efl_ui_collection_view_example_1.c
index 7296065..3255b17 100644
--- a/src/examples/elementary/efl_ui_collection_view_example_1.c
+++ b/src/examples/elementary/efl_ui_collection_view_example_1.c
@@ -96,7 +96,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
96 li = efl_add(EFL_UI_COLLECTION_VIEW_CLASS, win, 96 li = efl_add(EFL_UI_COLLECTION_VIEW_CLASS, win,
97 efl_ui_collection_view_position_manager_set(efl_added, position_manager), 97 efl_ui_collection_view_position_manager_set(efl_added, position_manager),
98 efl_ui_view_model_set(efl_added, model), 98 efl_ui_view_model_set(efl_added, model),
99 efl_ui_multi_selectable_async_select_mode_set(efl_added, mode), 99 efl_ui_multi_selectable_select_mode_set(efl_added, mode),
100 efl_ui_collection_view_factory_set(efl_added, factory)); 100 efl_ui_collection_view_factory_set(efl_added, factory));
101 101
102 efl_content_set(win, li); 102 efl_content_set(win, li);
diff --git a/src/examples/elementary/efl_ui_grid_view_example_1.c b/src/examples/elementary/efl_ui_grid_view_example_1.c
new file mode 100644
index 0000000..8ccf560
--- /dev/null
+++ b/src/examples/elementary/efl_ui_grid_view_example_1.c
@@ -0,0 +1,477 @@
1// gcc -o efl_ui_grid_view_example_1 efl_ui_grid_view_example_1.c `pkg-config --cflags --libs elementary`
2
3#define EFL_BETA_API_SUPPORT 1
4
5#include <Efl.h>
6#include <Efl_Ui.h>
7#include <Elementary.h>
8#include "efl_ui_grid_view.eo.h"
9
10
11static Efl_Model*
12_make_model(Evas_Object *win)
13{
14 Eina_Value vtext;
15 Efl_Generic_Model *model, *child;
16
17 model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
18 eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
19
20#define IC(x) \
21 child = efl_model_child_add(model); \
22 eina_value_set(&vtext, x); \
23 efl_model_property_set(child, "title", &vtext);
24
25 IC("user-home")
26 IC("user-bookmarks")
27 IC("user-desktop")
28 IC("user-trash")
29 IC("folder")
30 IC("folder-drag-accept")
31 IC("folder-remote")
32 IC("folder-open")
33 IC("folder-home")
34 IC("folder-download")
35 IC("folder-recent")
36 IC("folder-documents")
37 IC("folder-pictures")
38 IC("folder-music")
39 IC("folder-videos")
40 IC("folder-visiting")
41 IC("network-server")
42 IC("network-workgroup")
43 IC("start-here")
44 IC("emblem-default")
45 IC("emblem-documents")
46 IC("emblem-downloads")
47 IC("emblem-favorite")
48 IC("emblem-important")
49 IC("emblem-mail")
50 IC("emblem-photos")
51 IC("emblem-readonly")
52 IC("emblem-shared")
53 IC("emblem-symbolic-link")
54 IC("emblem-unreadable")
55 IC("emblem-system")
56 IC("emblem-synchronized")
57 IC("emblem-synchronizing")
58 IC("address-book-new")
59 IC("application-exit")
60 IC("appointment-new")
61 IC("call-start")
62 IC("call-stop")
63 IC("contact-new")
64 IC("document-open")
65 IC("document-open-recent")
66 IC("document-page-setup")
67 IC("document-properties")
68 IC("document-save")
69 IC("document-save-as")
70 IC("document-send")
71 IC("document-close")
72 IC("document-new")
73 IC("document-print")
74 IC("document-print-preview")
75 IC("document-revert")
76 IC("document-export")
77 IC("document-import")
78 IC("edit-clear")
79 IC("edit-copy")
80 IC("edit-cut")
81 IC("edit-delete")
82 IC("edit-find")
83 IC("edit-find-replace")
84 IC("edit-paste")
85 IC("edit-redo")
86 IC("edit-undo")
87 IC("edit-select-all")
88 IC("folder-copy")
89 IC("folder-move")
90 IC("folder-new")
91 IC("format-indent-less")
92 IC("format-indent-more")
93 IC("format-justify-center")
94 IC("format-justify-fill")
95 IC("format-justify-left")
96 IC("format-justify-right")
97 IC("format-text-direction-ltr")
98 IC("format-text-direction-rtl")
99 IC("format-text-bold")
100 IC("format-text-italic")
101 IC("format-text-underline")
102 IC("format-text-strikethrough")
103 IC("go-home")
104 IC("go-bottom")
105 IC("go-down")
106 IC("go-first")
107 IC("go-jump")
108 IC("go-last")
109 IC("go-next")
110 IC("go-previous")
111 IC("go-top")
112 IC("go-up")
113 IC("insert-image")
114 IC("insert-link")
115 IC("insert-object")
116 IC("insert-text")
117 IC("list-add")
118 IC("list-remove")
119 IC("mail-forward")
120 IC("mail-mark-important")
121 IC("mail-mark-junk")
122 IC("mail-mark-notjunk")
123 IC("mail-mark-read")
124 IC("mail-mark-unread")
125 IC("mail-message-new")
126 IC("mail-reply-all")
127 IC("mail-reply-sender")
128 IC("mail-send")
129 IC("mail-send-receive")
130 IC("media-eject")
131 IC("media-playback-pause")
132 IC("media-playback-start")
133 IC("media-playback-stop")
134 IC("media-record")
135 IC("media-seek-backward")
136 IC("media-seek-forward")
137 IC("media-skip-backward")
138 IC("media-skip-forward")
139 IC("object-flip-horizontal")
140 IC("object-flip-vertical")
141 IC("object-rotate-left")
142 IC("object-rotate-right")
143 IC("process-stop")
144 IC("tools-check-spelling")
145 IC("view-list-compact")
146 IC("view-list-details")
147 IC("view-list-icons")
148 IC("view-fullscreen")
149 IC("view-refresh")
150 IC("view-restore")
151 IC("view-sort-ascending")
152 IC("view-sort-descending")
153 IC("view-close")
154 IC("window-close")
155 IC("window-new")
156 IC("system-run")
157 IC("system-shutdown")
158 IC("system-reboot")
159 IC("system-lock-screen")
160 IC("system-log-out")
161 IC("system-search")
162 IC("help-about")
163 IC("help-contents")
164 IC("help-faq")
165 IC("zoom-in")
166 IC("zoom-out")
167 IC("zoom-original")
168 IC("zoom-fit")
169 IC("zoom-fill")
170 IC("zoom-fit-best")
171 IC("appointment-missed")
172 IC("appointment-soon")
173 IC("audio-volume-high")
174 IC("audio-volume-low")
175 IC("audio-volume-medium")
176 IC("audio-volume-muted")
177 IC("audio-volume")
178 IC("battery-caution")
179 IC("battery-empty")
180 IC("battery-low")
181 IC("battery-good")
182 IC("battery-full")
183 IC("battery-caution-charging")
184 IC("battery-empty-charging")
185 IC("battery-low-charging")
186 IC("battery-good-charging")
187 IC("battery-full-charging")
188 IC("bluetooth-active")
189 IC("bluetooth-disabled")
190 IC("changes-allow")
191 IC("changes-prevent")
192 IC("dialog-error")
193 IC("dialog-information")
194 IC("dialog-password")
195 IC("dialog-question")
196 IC("dialog-warning")
197 IC("media-playlist-repeat")
198 IC("media-playlist-shuffle")
199 IC("network-cellular-3g")
200 IC("network-cellular-4g")
201 IC("network-cellular-edge")
202 IC("network-cellular-gprs")
203 IC("network-cellular-umts")
204 IC("network-cellular-connected")
205 IC("network-cellular-signal-excellent")
206 IC("network-cellular-signal-good")
207 IC("network-cellular-signal-none")
208 IC("network-cellular-signal-ok")
209 IC("network-cellular-signal-weak")
210 IC("network-cellular-signal-acquiring")
211 IC("network-error")
212 IC("network-offline")
213 IC("network-receive")
214 IC("network-transmit-receive")
215 IC("network-transmit")
216 IC("network-idle")
217 IC("network-vpn")
218 IC("network-vpn-acquiring")
219 IC("network-wireless-acquiring")
220 IC("network-wireless-encrypted")
221 IC("network-wireless-signal-excellent")
222 IC("network-wireless-signal-good")
223 IC("network-wireless-signal-none")
224 IC("network-wireless-signal-ok")
225 IC("network-wireless-signal-weak")
226 IC("printer-error")
227 IC("printer-printing")
228 IC("printer-warning")
229 IC("security-high")
230 IC("security-medium")
231 IC("security-low")
232 IC("software-update-available")
233 IC("software-update-urgent")
234 IC("task-due")
235 IC("task-past-due")
236 IC("user-available")
237 IC("user-away")
238 IC("user-busy")
239 IC("user-invisible")
240 IC("user-idle")
241 IC("user-offline")
242 IC("user-trash-full")
243 IC("weather-clear-night")
244 IC("weather-clear")
245 IC("weather-clouds-night")
246 IC("weather-clouds")
247 IC("weather-few-clouds-night")
248 IC("weather-few-clouds")
249 IC("weather-fog")
250 IC("weather-overcast")
251 IC("weather-severe-alert")
252 IC("weather-showers-scattered")
253 IC("weather-showers")
254 IC("weather-snow")
255 IC("weather-storm")
256 IC("mail-attachment")
257 IC("mail-unread")
258 IC("mail-read")
259 IC("mail-replied")
260 IC("mail-signed")
261 IC("mail-signed-verified")
262 IC("starred")
263 IC("non-starred")
264 IC("audio-card")
265 IC("audio-input-microphone")
266 IC("battery")
267 IC("camera")
268 IC("camera-photo")
269 IC("camera-web")
270 IC("camera-video")
271 IC("drive-harddisk")
272 IC("drive-harddisk-ieee1394")
273 IC("drive-harddisk-usb")
274 IC("drive-optical")
275 IC("drive-removable-media")
276 IC("drive-removable-media-ieee1394")
277 IC("drive-removable-media-usb")
278 IC("computer")
279 IC("computer-laptop")
280 IC("multimedia-player")
281 IC("media-optical")
282 IC("media-optical-cd")
283 IC("media-optical-audio")
284 IC("media-optical-dvd")
285 IC("media-optical-bd")
286 IC("media-flash")
287 IC("media-flash-cf")
288 IC("media-flash-ms")
289 IC("media-flash-sd")
290 IC("media-flash-sm")
291 IC("media-floppy")
292 IC("media-zip")
293 IC("media-tape")
294 IC("media-memory")
295 IC("processor")
296 IC("input-mouse")
297 IC("input-tablet")
298 IC("input-keyboard")
299 IC("input-gaming")
300 IC("pda")
301 IC("phone")
302 IC("printer")
303 IC("scanner")
304 IC("modem")
305 IC("video-display")
306 IC("network-wired")
307 IC("network-wireless")
308 IC("applications-accessories")
309 IC("applications-development")
310 IC("applications-games")
311 IC("applications-graphics")
312 IC("applications-internet")
313 IC("applications-multimedia")
314 IC("applications-office")
315 IC("applications-other")
316 IC("applications-science")
317 IC("applications-system")
318 IC("applications-utilities")
319 IC("preferences-desktop")
320 IC("preferences-system")
321 IC("preferences-other")
322 IC("preferences-color")
323 IC("preferences-profile")
324 IC("preferences-desktop-display")
325 IC("preferences-desktop-font")
326 IC("preferences-desktop-keyboard")
327 IC("preferences-desktop-locale")
328 IC("preferences-desktop-multimedia")
329 IC("preferences-desktop-screensaver")
330 IC("preferences-desktop-theme")
331 IC("preferences-desktop-wallpaper")
332 IC("system-file-manager")
333 IC("flag-ad")
334 IC("flag-af")
335 IC("flag-al")
336 IC("flag-am")
337 IC("flag-ar")
338 IC("flag-at")
339 IC("flag-au")
340 IC("flag-az")
341 IC("flag-ba")
342 IC("flag-bd")
343 IC("flag-be")
344 IC("flag-bg")
345 IC("flag-br")
346 IC("flag-bt")
347 IC("flag-bw")
348 IC("flag-by")
349 IC("flag-ca")
350 IC("flag-cd")
351 IC("flag-ch")
352 IC("flag-cm")
353 IC("flag-cn")
354 IC("flag-cz")
355 IC("flag-de")
356 IC("flag-dk")
357 IC("flag-ee")
358 IC("flag-es")
359 IC("flag-et")
360 IC("flag-fi")
361 IC("flag-fo")
362 IC("flag-fr")
363 IC("flag-gb")
364 IC("flag-ge")
365 IC("flag-gh")
366 IC("flag-gn")
367 IC("flag-gr")
368 IC("flag-hr")
369 IC("flag-hu")
370 IC("flag-ie")
371 IC("flag-il")
372 IC("flag-in")
373 IC("flag-iq")
374 IC("flag-ir")
375 IC("flag-is")
376 IC("flag-it")
377 IC("flag-jp")
378 IC("flag-ke")
379 IC("flag-kg")
380 IC("flag-kh")
381 IC("flag-kr")
382 IC("flag-ku")
383 IC("flag-kz")
384 IC("flag-la")
385 IC("flag-lk")
386 IC("flag-lt")
387 IC("flag-lv")
388 IC("flag-ma")
389 IC("flag-md")
390 IC("flag-me")
391 IC("flag-mk")
392 IC("flag-ml")
393 IC("flag-mm")
394 IC("flag-mn")
395 IC("flag-mt")
396 IC("flag-mv")
397 IC("flag-my")
398 IC("flag-ng")
399 IC("flag-nl")
400 IC("flag-no")
401 IC("flag-np")
402 IC("flag-ph")
403 IC("flag-pk")
404 IC("flag-pl")
405 IC("flag-pt")
406 IC("flag-ro")
407 IC("flag-rs")
408 IC("flag-ru")
409 IC("flag-se")
410 IC("flag-si")
411 IC("flag-sk")
412 IC("flag-sn")
413 IC("flag-sy")
414 IC("flag-th")
415 IC("flag-tj")
416 IC("flag-tm")
417 IC("flag-tr")
418 IC("flag-tw")
419 IC("flag-tz")
420 IC("flag-ua")
421 IC("flag-us")
422 IC("flag-uz")
423 IC("flag-vn")
424 IC("flag-za")
425 IC("inode-directory")
426
427 eina_value_flush(&vtext);
428 return model;
429}
430
431static void
432_item_constructing(void *data EINA_UNUSED, const Efl_Event *ev)
433{
434 Efl_Gfx_Entity *item = ev->info;
435
436 if (!efl_key_data_get(item, "efl.ui.widget.factory.size_set"))
437 efl_gfx_hint_size_min_set(item, EINA_SIZE2D(100, 100));
438}
439
440EAPI_MAIN void
441efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
442{
443 Efl_Ui_Factory *factory, *image_factory;
444 Efl_Ui_Win *win;
445 Efl_Ui_Grid_View *grid;
446 Eo *model;
447
448 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
449
450 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
451 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
452 efl_text_set(efl_added, "Efl.Ui.Grid_View example"),
453 efl_ui_win_autodel_set(efl_added, EINA_TRUE)
454 );
455
456 model = _make_model(win);
457 image_factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
458 efl_ui_widget_factory_item_class_set(image_factory, EFL_UI_IMAGE_CLASS);
459 efl_ui_property_bind(image_factory, "icon", "title");
460
461 factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
462 efl_ui_widget_factory_item_class_set(factory, EFL_UI_GRID_DEFAULT_ITEM_CLASS);
463 efl_ui_property_bind(factory, "efl.text", "title");
464 efl_ui_factory_bind(factory, "icon", image_factory);
465 efl_event_callback_add(factory, EFL_UI_FACTORY_EVENT_ITEM_CONSTRUCTING, _item_constructing, NULL);
466
467 grid = efl_add(EFL_UI_GRID_VIEW_CLASS, win,
468 efl_ui_collection_view_factory_set(efl_added, factory),
469 efl_ui_view_model_set(efl_added, model)
470 );
471 evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
472 evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
473
474 efl_content_set(win, grid);
475 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 320));
476}
477EFL_MAIN()
diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c
index ac4976a..d9ade67 100644
--- a/src/examples/elementary/efl_ui_list_example_1.c
+++ b/src/examples/elementary/efl_ui_list_example_1.c
@@ -13,13 +13,6 @@
13#include <Eio.h> 13#include <Eio.h>
14#include <stdio.h> 14#include <stdio.h>
15 15
16//FIXME this can go away when efl_ui_text doesn't need elm_general
17# include <elm_general.h>
18# include <efl_text_interactive.eo.h>
19# include <efl_ui_text.eo.h>
20# include <efl_ui_text_editable.eo.h>
21# include <efl_ui_text_async.eo.h>
22
23#define NUM_ITEMS 400 16#define NUM_ITEMS 400
24 17
25typedef struct _List_Scroll_Data { 18typedef struct _List_Scroll_Data {
@@ -37,7 +30,7 @@ _list_selected(void *data EINA_UNUSED, const Efl_Event *ev)
37 Eo *item = ev->info, *tmp; 30 Eo *item = ev->info, *tmp;
38 printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_selectable_selected_get(item)? "selected" : "unselected")); 31 printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_selectable_selected_get(item)? "selected" : "unselected"));
39 32
40 Eina_Iterator *selects = efl_ui_selectable_selected_iterator_new(list); 33 Eina_Iterator *selects = efl_ui_multi_selectable_selected_iterator_new(list);
41 34
42 EINA_ITERATOR_FOREACH(selects, tmp) 35 EINA_ITERATOR_FOREACH(selects, tmp)
43 printf("selected [%p:%d] ", tmp, efl_ui_item_index_get(tmp)); 36 printf("selected [%p:%d] ", tmp, efl_ui_item_index_get(tmp));
@@ -77,7 +70,7 @@ static void
77_select_radio_changed(void *data, const Efl_Event *ev) 70_select_radio_changed(void *data, const Efl_Event *ev)
78{ 71{
79 Eo *list = data; 72 Eo *list = data;
80 efl_ui_selectable_select_mode_set(list, efl_ui_radio_group_selected_value_get(ev->object)); 73 efl_ui_multi_selectable_select_mode_set(list, efl_ui_radio_group_selected_value_get(ev->object));
81} 74}
82 75
83static void 76static void
@@ -152,9 +145,9 @@ elm_main(int argc EINA_UNUSED, char **argv)
152 ibox = efl_add(EFL_UI_BOX_CLASS, item); 145 ibox = efl_add(EFL_UI_BOX_CLASS, item);
153 efl_ui_layout_orientation_set(ibox, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); 146 efl_ui_layout_orientation_set(ibox, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL);
154 147
155 txt = efl_add(EFL_UI_TEXT_CLASS, ibox); 148 txt = efl_add(EFL_UI_TEXTBOX_CLASS, ibox);
156 efl_gfx_hint_weight_set(txt, 0.95, EFL_GFX_HINT_EXPAND); 149 efl_gfx_hint_weight_set(txt, 0.95, EFL_GFX_HINT_EXPAND);
157 efl_text_halign_set(txt, 0.2); 150 efl_text_horizontal_align_set(txt, 0.2);
158 efl_text_interactive_selection_allowed_set(txt, EINA_FALSE); 151 efl_text_interactive_selection_allowed_set(txt, EINA_FALSE);
159 snprintf(buf, sizeof(buf), "placeholder style item [%d]", i); 152 snprintf(buf, sizeof(buf), "placeholder style item [%d]", i);
160 efl_text_set(txt, buf); 153 efl_text_set(txt, buf);
@@ -230,9 +223,9 @@ elm_main(int argc EINA_UNUSED, char **argv)
230 efl_pack_end(wbox, list); 223 efl_pack_end(wbox, list);
231 224
232 /*select mode */ 225 /*select mode */
233 txt = efl_add(EFL_UI_TEXT_CLASS, wbox); 226 txt = efl_add(EFL_UI_TEXTBOX_CLASS, wbox);
234 efl_gfx_hint_weight_set(txt, EFL_GFX_HINT_EXPAND, 0.01); 227 efl_gfx_hint_weight_set(txt, EFL_GFX_HINT_EXPAND, 0.01);
235 efl_text_halign_set(txt, 0.02); 228 efl_text_horizontal_align_set(txt, 0.02);
236 efl_text_interactive_selection_allowed_set(txt, EINA_FALSE); 229 efl_text_interactive_selection_allowed_set(txt, EINA_FALSE);
237 efl_text_set(txt, "Select Mode"); 230 efl_text_set(txt, "Select Mode");
238 efl_pack_end(wbox, txt); 231 efl_pack_end(wbox, txt);
@@ -257,10 +250,10 @@ elm_main(int argc EINA_UNUSED, char **argv)
257 efl_event_callback_add(bbox, EFL_UI_RADIO_GROUP_EVENT_VALUE_CHANGED, _select_radio_changed, list); 250 efl_event_callback_add(bbox, EFL_UI_RADIO_GROUP_EVENT_VALUE_CHANGED, _select_radio_changed, list);
258 251
259 /* scroll mode */ 252 /* scroll mode */
260 txt = efl_add(EFL_UI_TEXT_CLASS, wbox); 253 txt = efl_add(EFL_UI_TEXTBOX_CLASS, wbox);
261 efl_gfx_hint_weight_set(txt, EFL_GFX_HINT_EXPAND, 0.01); 254 efl_gfx_hint_weight_set(txt, EFL_GFX_HINT_EXPAND, 0.01);
262 efl_text_interactive_selection_allowed_set(txt, EINA_FALSE); 255 efl_text_interactive_selection_allowed_set(txt, EINA_FALSE);
263 efl_text_halign_set(txt, 0.02); 256 efl_text_horizontal_align_set(txt, 0.02);
264 efl_text_set(txt, "Item Scroll"); 257 efl_text_set(txt, "Item Scroll");
265 efl_pack_end(wbox, txt); 258 efl_pack_end(wbox, txt);
266 259
diff --git a/src/examples/elementary/efl_ui_list_view_example_3.c b/src/examples/elementary/efl_ui_list_view_example_3.c
index c9f6b0d..dcf6082 100644
--- a/src/examples/elementary/efl_ui_list_view_example_3.c
+++ b/src/examples/elementary/efl_ui_list_view_example_3.c
@@ -110,7 +110,7 @@ static void
110_bt_none_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 110_bt_none_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
111{ 111{
112 Evas_Object *li = data; 112 Evas_Object *li = data;
113 efl_ui_multi_selectable_async_select_mode_set(li, EFL_UI_SELECT_MODE_NONE); 113 efl_ui_multi_selectable_select_mode_set(li, EFL_UI_SELECT_MODE_NONE);
114} 114}
115 115
116static void 116static void
@@ -124,7 +124,7 @@ static void
124_bt_default_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 124_bt_default_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
125{ 125{
126 Evas_Object *li = data; 126 Evas_Object *li = data;
127 efl_ui_multi_selectable_async_select_mode_set(li, EFL_UI_SELECT_MODE_SINGLE); 127 efl_ui_multi_selectable_select_mode_set(li, EFL_UI_SELECT_MODE_SINGLE);
128} 128}
129 129
130static void 130static void
diff --git a/src/examples/elementary/efl_ui_relative_layout_example_01.c b/src/examples/elementary/efl_ui_relative_container_example_01.c
index 77453cf..f7bcb64 100644
--- a/src/examples/elementary/efl_ui_relative_layout_example_01.c
+++ b/src/examples/elementary/efl_ui_relative_container_example_01.c
@@ -1,4 +1,4 @@
1// gcc -o efl_ui_relative_layout_example_01 efl_ui_relative_layout_example_01.c `pkg-config --cflags --libs elementary` 1// gcc -o efl_ui_relative_container_example_01 efl_ui_relative_container_example_01.c `pkg-config --cflags --libs elementary`
2 2
3#ifdef HAVE_CONFIG_H 3#ifdef HAVE_CONFIG_H
4#include "elementary_config.h" 4#include "elementary_config.h"
@@ -16,10 +16,10 @@ elm_main(int argc, char **argv)
16 Eo *win, *layout, *btn1, *btn2, *btn3; 16 Eo *win, *layout, *btn1, *btn2, *btn3;
17 17
18 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), 18 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
19 efl_text_set(efl_added, "Efl.Ui.Relative_Layout"), 19 efl_text_set(efl_added, "Efl.Ui.Relative_Container"),
20 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 20 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
21 21
22 layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win, 22 layout = efl_add(EFL_UI_RELATIVE_CONTAINER_CLASS, win,
23 efl_content_set(win, efl_added)); 23 efl_content_set(win, efl_added));
24 24
25 btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout, 25 btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout,
@@ -27,20 +27,20 @@ elm_main(int argc, char **argv)
27 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)), 27 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)),
28 efl_gfx_hint_align_set(efl_added, 0, 0), 28 efl_gfx_hint_align_set(efl_added, 0, 0),
29 efl_gfx_hint_margin_set(efl_added, 10, 30, 20, 40), 29 efl_gfx_hint_margin_set(efl_added, 10, 30, 20, 40),
30 efl_ui_relative_layout_relation_right_set(layout, efl_added, layout, 0.0), 30 efl_ui_relative_container_relation_right_set(layout, efl_added, layout, 0.0),
31 efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0)); 31 efl_ui_relative_container_relation_bottom_set(layout, efl_added, layout, 0.0));
32 32
33 btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout, 33 btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout,
34 efl_text_set(efl_added, "btn2"), 34 efl_text_set(efl_added, "btn2"),
35 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 200)), 35 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 200)),
36 efl_gfx_hint_align_set(efl_added, 0.5, 0), 36 efl_gfx_hint_align_set(efl_added, 0.5, 0),
37 efl_ui_relative_layout_relation_left_set(layout, efl_added, btn1, 1.0), 37 efl_ui_relative_container_relation_left_set(layout, efl_added, btn1, 1.0),
38 efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0)); 38 efl_ui_relative_container_relation_bottom_set(layout, efl_added, layout, 0.0));
39 39
40 btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout, 40 btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout,
41 efl_text_set(efl_added, "btn3"), 41 efl_text_set(efl_added, "btn3"),
42 efl_ui_relative_layout_relation_left_set(layout, efl_added, btn2, 0.0), 42 efl_ui_relative_container_relation_left_set(layout, efl_added, btn2, 0.0),
43 efl_ui_relative_layout_relation_top_set(layout, efl_added, btn2, 1.0)); 43 efl_ui_relative_container_relation_top_set(layout, efl_added, btn2, 1.0));
44 44
45 efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300)); 45 efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300));
46 46
diff --git a/src/examples/elementary/efl_ui_relative_layout_example_02.c b/src/examples/elementary/efl_ui_relative_container_example_02.c
index bc3740d..bb18c26 100644
--- a/src/examples/elementary/efl_ui_relative_layout_example_02.c
+++ b/src/examples/elementary/efl_ui_relative_container_example_02.c
@@ -1,4 +1,4 @@
1// gcc -o efl_ui_relative_layout_example_02 efl_ui_relative_layout_example_02.c `pkg-config --cflags --libs elementary` 1// gcc -o efl_ui_relative_container_example_02 efl_ui_relative_container_example_02.c `pkg-config --cflags --libs elementary`
2 2
3#ifdef HAVE_CONFIG_H 3#ifdef HAVE_CONFIG_H
4#include "elementary_config.h" 4#include "elementary_config.h"
@@ -16,10 +16,10 @@ elm_main(int argc, char **argv)
16 Eo *win, *layout, *btn1, *btn2; 16 Eo *win, *layout, *btn1, *btn2;
17 17
18 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), 18 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
19 efl_text_set(efl_added, "Efl.Ui.Relative_Layout"), 19 efl_text_set(efl_added, "Efl.Ui.Relative_Container"),
20 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 20 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
21 21
22 layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win, 22 layout = efl_add(EFL_UI_RELATIVE_CONTAINER_CLASS, win,
23 efl_content_set(win, efl_added)); 23 efl_content_set(win, efl_added));
24 24
25 btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout, 25 btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout,
@@ -30,11 +30,11 @@ elm_main(int argc, char **argv)
30 efl_text_set(efl_added, "btn2"), 30 efl_text_set(efl_added, "btn2"),
31 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 100))); 31 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(0, 100)));
32 32
33 efl_ui_relative_layout_relation_right_set(layout, btn1, btn2, 0.0); 33 efl_ui_relative_container_relation_right_set(layout, btn1, btn2, 0.0);
34 efl_ui_relative_layout_relation_bottom_set(layout, btn1, btn2, 0.0); 34 efl_ui_relative_container_relation_bottom_set(layout, btn1, btn2, 0.0);
35 35
36 efl_ui_relative_layout_relation_left_set(layout, btn2, btn1, 1.0); 36 efl_ui_relative_container_relation_left_set(layout, btn2, btn1, 1.0);
37 efl_ui_relative_layout_relation_top_set(layout, btn2, btn1, 1.0); 37 efl_ui_relative_container_relation_top_set(layout, btn2, btn1, 1.0);
38 38
39 efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300)); 39 efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 300));
40 40
diff --git a/src/examples/elementary/efl_ui_slider_mono.cs b/src/examples/elementary/efl_ui_slider_mono.cs
index 739601a..feaab64 100644
--- a/src/examples/elementary/efl_ui_slider_mono.cs
+++ b/src/examples/elementary/efl_ui_slider_mono.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using System; 16using System;
2 17
3public class Example 18public class Example
diff --git a/src/examples/elementary/efl_ui_slideshow_example.c b/src/examples/elementary/efl_ui_slideshow_example.c
index 6292f43..4be9865 100644
--- a/src/examples/elementary/efl_ui_slideshow_example.c
+++ b/src/examples/elementary/efl_ui_slideshow_example.c
@@ -93,8 +93,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
93 container = efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, win, 93 container = efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, win,
94 efl_event_callback_add(efl_added, EFL_UI_SPOTLIGHT_EVENT_TRANSITION_END, _container_end, NULL), 94 efl_event_callback_add(efl_added, EFL_UI_SPOTLIGHT_EVENT_TRANSITION_END, _container_end, NULL),
95 efl_pack_table(table, efl_added, 0, 0, 1, 1)); 95 efl_pack_table(table, efl_added, 0, 0, 1, 1));
96 efl_ui_spotlight_indicator_set(container, efl_new(EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS)); 96 efl_ui_spotlight_indicator_set(container, efl_new(EFL_UI_SPOTLIGHT_ICON_INDICATOR_CLASS));
97 efl_ui_spotlight_manager_set(container, efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS)); 97 efl_ui_spotlight_manager_set(container, efl_new(EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS));
98 98
99 for (int i = 0; i < IMG_NUM; i++) 99 for (int i = 0; i < IMG_NUM; i++)
100 { 100 {
diff --git a/src/examples/elementary/efl_ui_unit_converter.cs b/src/examples/elementary/efl_ui_unit_converter.cs
index 93a5f89..6d7f200 100644
--- a/src/examples/elementary/efl_ui_unit_converter.cs
+++ b/src/examples/elementary/efl_ui_unit_converter.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1using System; 16using System;
2 17
3public class Example 18public class Example
@@ -17,7 +32,7 @@ public class Example
17 private static void ShowErrorPopup(Efl.Ui.Win win, string message) 32 private static void ShowErrorPopup(Efl.Ui.Win win, string message)
18 { 33 {
19 Efl.Ui.AlertPopup popup = new Efl.Ui.AlertPopup(win); 34 Efl.Ui.AlertPopup popup = new Efl.Ui.AlertPopup(win);
20 Efl.Ui.Text popup_text = new Efl.Ui.Text(popup); 35 Efl.Ui.Textbox popup_text = new Efl.Ui.Textbox(popup);
21 popup_text.SetText($"Error: {message}"); 36 popup_text.SetText($"Error: {message}");
22 popup.SetContent(popup_text); 37 popup.SetContent(popup_text);
23 popup.SetVisible(true); 38 popup.SetVisible(true);
@@ -53,14 +68,15 @@ public class Example
53 68
54 box.DoPack(miles_box); 69 box.DoPack(miles_box);
55 70
56 Efl.Ui.Text miles_label = new Efl.Ui.Text(miles_box); 71 Efl.Ui.Textbox miles_label = new Efl.Ui.Textbox(miles_box);
57 miles_label.SetText("Miles:"); 72 miles_label.SetText("Miles:");
58 miles_label.SetSize(size); 73 miles_label.SetSize(size);
59 miles_label.SetVisible(true); 74 miles_label.SetVisible(true);
60 75
61 Efl.Ui.TextEditable miles_input = new Efl.Ui.TextEditable(miles_box); 76 Efl.Ui.Textbox miles_input = new Efl.Ui.Textbox(miles_box);
62 miles_input.SetText(""); 77 miles_input.SetText("");
63 miles_input.SetScrollable(true); 78 miles_input.SetScrollable(true);
79 miles_input.SetEditable(true);
64 miles_input.SetSize(size); 80 miles_input.SetSize(size);
65 miles_input.SetVisible(true); 81 miles_input.SetVisible(true);
66 82
@@ -79,12 +95,12 @@ public class Example
79 95
80 box.DoPack(kms_box); 96 box.DoPack(kms_box);
81 97
82 Efl.Ui.Text kms_label = new Efl.Ui.Text(kms_box); 98 Efl.Ui.Textbox kms_label = new Efl.Ui.Textbox(kms_box);
83 kms_label.SetText("Kilometers:"); 99 kms_label.SetText("Kilometers:");
84 kms_label.SetSize(size); 100 kms_label.SetSize(size);
85 kms_label.SetVisible(true); 101 kms_label.SetVisible(true);
86 102
87 Efl.Ui.TextEditable kms_input = new Efl.Ui.TextEditable(kms_box); 103 Efl.Ui.TextboxEditable kms_input = new Efl.Ui.TextboxEditable(kms_box);
88 kms_input.SetText(""); 104 kms_input.SetText("");
89 kms_input.SetScrollable(true); 105 kms_input.SetScrollable(true);
90 kms_input.SetSize(size); 106 kms_input.SetSize(size);
diff --git a/src/examples/elementary/icon_cxx_example_01.cc b/src/examples/elementary/icon_cxx_example_01.cc
index 90271c1..97fbe95 100644
--- a/src/examples/elementary/icon_cxx_example_01.cc
+++ b/src/examples/elementary/icon_cxx_example_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#include <Efl_Ui.hh> 16#include <Efl_Ui.hh>
2 17
3EAPI_MAIN int 18EAPI_MAIN int
diff --git a/src/examples/elementary/icon_example_01.js b/src/examples/elementary/icon_example_01.js
index 21d78f1..8288053 100644
--- a/src/examples/elementary/icon_example_01.js
+++ b/src/examples/elementary/icon_example_01.js
@@ -12,7 +12,7 @@ icon.setIcon("home");
12var path, group; 12var path, group;
13r = icon.getFile(path, group); 13r = icon.getFile(path, group);
14path = r[0]; 14path = r[0];
15gruop = r[1]; 15group = r[1];
16console.log("path = " + path + ", group = " + group); 16console.log("path = " + path + ", group = " + group);
17 17
18var name; 18var name;
diff --git a/src/examples/elementary/layout_property_bind.c b/src/examples/elementary/layout_property_bind.c
index f9c5cf9..8dc68a5 100644
--- a/src/examples/elementary/layout_property_bind.c
+++ b/src/examples/elementary/layout_property_bind.c
@@ -27,6 +27,8 @@ struct _Layout_Model_Data
27}; 27};
28typedef struct _Layout_Model_Data Layout_Model_Data; 28typedef struct _Layout_Model_Data Layout_Model_Data;
29 29
30static Evas_Object *win = NULL;
31
30static Eina_Value 32static Eina_Value
31_wait_for_image(Eo *o EINA_UNUSED, void *data, const Eina_Value v) 33_wait_for_image(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
32{ 34{
@@ -50,22 +52,32 @@ _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
50} 52}
51 53
52static void 54static void
53_list_selected_cb(void *data EINA_UNUSED, const Efl_Event *event) 55_list_pressed_item_cb(void *data EINA_UNUSED, const Efl_Event *event)
54{ 56{
55 Layout_Model_Data *priv = data; 57 Layout_Model_Data *priv = data;
56 Eo *child = event->info; 58 Efl_Ui_Item_Clickable_Pressed *pressed = event->info;
57 59 Efl_Ui_Item *item = pressed->item;
58 printf("LIST selected model\n"); 60 Efl_Model *model = efl_ui_view_model_get(item);
59 efl_ui_view_model_set(priv->provider, child); 61
62 printf("LIST pressed model `%s` from item `%s`.\n",
63 efl_debug_name_get(model),
64 efl_debug_name_get(item));
65 efl_ui_view_model_set(priv->provider, model);
60} 66}
61 67
62static void 68static void
63_update_cb(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED) 69_update_cb(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
64{ 70{
65 Layout_Model_Data *priv = data; 71 Layout_Model_Data *priv = data;
72 Efl_Model *newone;
66 73
67 const char *text = elm_object_text_get(priv->entry); 74 const char *text = elm_object_text_get(priv->entry);
68 elm_layout_text_set(priv->label, "default", text); 75 newone = efl_add(EFL_IO_MODEL_CLASS, win,
76 efl_io_model_path_set(efl_added, text));
77 efl_ui_view_model_set(priv->fileview, newone);
78 efl_del(priv->model);
79 priv->model = newone;
80
69} 81}
70 82
71static void 83static void
@@ -103,7 +115,8 @@ EAPI_MAIN int
103elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) 115elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
104{ 116{
105 Layout_Model_Data *priv; 117 Layout_Model_Data *priv;
106 Evas_Object *win, *panes, *bxr, *genlist; 118 Evas_Object *panes, *bxr;
119 Efl_Ui_Factory *factory;
107 Eo *img_factory; 120 Eo *img_factory;
108 char *dirname; 121 char *dirname;
109 122
@@ -122,16 +135,19 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
122 if (argv[1] != NULL) dirname = argv[1]; 135 if (argv[1] != NULL) dirname = argv[1];
123 else dirname = EFL_MODEL_TEST_FILENAME_PATH; 136 else dirname = EFL_MODEL_TEST_FILENAME_PATH;
124 137
125 priv->model = efl_add_ref(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname)); 138 priv->model = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname));
139
140 factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
141 efl_ui_widget_factory_item_class_set(factory, EFL_UI_LIST_DEFAULT_ITEM_CLASS);
142 efl_ui_property_bind(factory, "efl.text", "filename");
126 143
127 genlist = elm_genlist_add(win); 144 priv->fileview = efl_add(EFL_UI_LIST_VIEW_CLASS, panes,
128 priv->fileview = efl_add_ref(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL)); 145 efl_ui_collection_view_factory_set(efl_added, factory),
129 elm_view_list_property_connect(priv->fileview, "filename", "elm.text"); 146 efl_ui_view_model_set(efl_added, priv->model));
130 elm_view_list_model_set(priv->fileview, priv->model); 147 _widget_init(priv->fileview);
131 _widget_init(genlist); 148 elm_object_part_content_set(panes, "left", priv->fileview);
132 elm_object_part_content_set(panes, "left", genlist);
133 elm_panes_content_left_size_set(panes, 0.3); 149 elm_panes_content_left_size_set(panes, 0.3);
134 efl_event_callback_add(priv->fileview, ELM_VIEW_LIST_EVENT_MODEL_SELECTED, _list_selected_cb, priv); 150 efl_event_callback_add(priv->fileview, EFL_UI_EVENT_ITEM_PRESSED, _list_pressed_item_cb, priv);
135 151
136 bxr = elm_box_add(win); 152 bxr = elm_box_add(win);
137 priv->bxr = bxr; 153 priv->bxr = bxr;
diff --git a/src/examples/elementary/location_example_01.c b/src/examples/elementary/location_example_01.c
deleted file mode 100644
index 7b8ad6f..0000000
--- a/src/examples/elementary/location_example_01.c
+++ /dev/null
@@ -1,151 +0,0 @@
1//Compile with:
2//gcc -o location_example_01 location_example_01.c -g `pkg-config --cflags --libs elementary elocation`
3#ifndef EFL_BETA_API_SUPPORT
4# define EFL_BETA_API_SUPPORT
5#endif
6
7#include <Elementary.h>
8#ifdef ELM_ELOCATION
9#include <Elocation.h>
10#endif
11
12static Evas_Object *pos_label, *addr_label, *box, *win;
13
14#ifdef ELM_ELOCATION
15static void
16_print_position(Elocation_Position *position)
17{
18 char buffer[1024];
19
20 if (!position) return;
21 snprintf(buffer, sizeof(buffer),
22 "<b>### Position Detail ###</b><br/>"
23 "<b>GeoClue position reply with data from timestamp</b> %i<br/>"
24 "<b>Latitude:</b> %f<br/>"
25 "<b>Longitude:</b> %f<br/>"
26 "<b>Altitude:</b> %f<br/>"
27 "<b>Accuracy level:</b> %i<br/>"
28 "<b>Accuracy horizontal:</b> %f<br/>"
29 "<b>Accuracy vertical:</b> %f",
30 position->timestamp, position->latitude, position->longitude,
31 position->altitude, position->accur->level,
32 position->accur->horizontal, position->accur->vertical);
33 elm_object_text_set(pos_label, buffer);
34}
35
36static void
37_print_address(Elocation_Address *address)
38{
39 char buffer[1024];
40
41 if (!address) return;
42 snprintf(buffer, sizeof(buffer),
43 "<b>### Address Detail ###</b><br/>"
44 "<b>Address update with data from timestamp:</b> %i<br/>"
45 "<b>Country:</b> %s<br/>"
46 "<b>Countrycode:</b> %s<br/>"
47 "<b>Locality:</b> %s<br/>"
48 "<b>Postalcode:</b> %s<br/>"
49 "<b>Region:</b> %s<br/>"
50 "<b>Timezone:</b> %s<br/>"
51 "<b>Accuracy level:</b> %i<br/>"
52 "<b>Accuracy horizontal:</b> %f<br/>"
53 "<b>Accuracy vertical:</b> %f",
54 address->timestamp, address->country, address->countrycode,
55 address->locality, address->postalcode, address->region,
56 address->timezone, address->accur->level, address->accur->horizontal,
57 address->accur->vertical);
58 elm_object_text_set(addr_label, buffer);
59}
60
61static Eina_Bool
62_position_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
63{
64 Elocation_Position *position;
65
66 position = event;
67 _print_position(position);
68 return ECORE_CALLBACK_DONE;
69}
70
71static Eina_Bool
72_address_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
73{
74 Elocation_Address *address;
75
76 address = event;
77 _print_address(address);
78
79 return ECORE_CALLBACK_DONE;
80}
81#endif
82
83EAPI_MAIN int
84elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
85{
86#ifdef ELM_ELOCATION
87 Elocation_Address *address;
88 Elocation_Position *position;
89#endif
90
91 /* The program will proceed only if Ewebkit library is available. */
92 if (elm_need_elocation() == EINA_FALSE)
93 return -1;
94
95 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
96
97 win = elm_win_util_standard_add("elocation", "Elocation example");
98 elm_win_autodel_set(win, EINA_TRUE);
99
100 box = elm_box_add(win);
101 elm_win_resize_object_add(win, box);
102 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
103 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
104
105 pos_label = elm_label_add(box);
106 elm_label_line_wrap_set(pos_label, ELM_WRAP_CHAR);
107 elm_object_text_set(pos_label, "Getting location ...");
108 evas_object_size_hint_weight_set(pos_label, EVAS_HINT_EXPAND, 0.0);
109 evas_object_size_hint_align_set(pos_label, EVAS_HINT_FILL, EVAS_HINT_FILL);
110 elm_label_slide_mode_set(pos_label, ELM_LABEL_SLIDE_MODE_ALWAYS);
111 elm_box_pack_end(box, pos_label);
112 evas_object_show(pos_label);
113 elm_box_padding_set(box, 0, 50);
114
115 addr_label = elm_label_add(box);
116 elm_label_line_wrap_set(addr_label, ELM_WRAP_CHAR);
117 elm_object_text_set(addr_label, "Getting location ...");
118 evas_object_size_hint_weight_set(addr_label, EVAS_HINT_EXPAND, 0.0);
119 evas_object_size_hint_align_set(addr_label, EVAS_HINT_FILL, EVAS_HINT_FILL);
120 elm_label_slide_mode_set(addr_label, ELM_LABEL_SLIDE_MODE_ALWAYS);
121 elm_box_pack_end(box, addr_label);
122 evas_object_show(addr_label);
123
124#ifdef ELM_ELOCATION
125 address = elocation_address_new();
126 position = elocation_position_new();
127
128 ecore_event_handler_add(ELOCATION_EVENT_POSITION, _position_changed, NULL);
129 ecore_event_handler_add(ELOCATION_EVENT_ADDRESS, _address_changed, NULL);
130
131 elocation_position_get(position);
132 _print_position(position);
133
134 elocation_address_get(address);
135 _print_address(address);
136#endif
137
138 evas_object_show(box);
139 evas_object_resize(win, 600, 480);
140 evas_object_show(win);
141
142 elm_run();
143
144#ifdef ELM_ELOCATION
145 elocation_position_free(position);
146 elocation_address_free(address);
147#endif
148
149 return 0;
150}
151ELM_MAIN()
diff --git a/src/examples/elementary/menu_cxx_example_01.cc b/src/examples/elementary/menu_cxx_example_01.cc
index ff3a62e..dfc717e 100644
--- a/src/examples/elementary/menu_cxx_example_01.cc
+++ b/src/examples/elementary/menu_cxx_example_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#include <Efl_Ui.hh> 16#include <Efl_Ui.hh>
2 17
3#warning This example can not be implemented with EO APIs... FIXME 18#warning This example can not be implemented with EO APIs... FIXME
diff --git a/src/examples/elementary/meson.build b/src/examples/elementary/meson.build
index 5348929..cdb08d4 100644
--- a/src/examples/elementary/meson.build
+++ b/src/examples/elementary/meson.build
@@ -59,7 +59,6 @@ examples = [
59 'list_example_01', 59 'list_example_01',
60 'list_example_02', 60 'list_example_02',
61 'list_example_03', 61 'list_example_03',
62 'location_example_01',
63 'map_example_01', 62 'map_example_01',
64 'map_example_02', 63 'map_example_02',
65 'map_example_03', 64 'map_example_03',
@@ -120,7 +119,9 @@ examples = [
120 'efl_ui_theme_example_02', 119 'efl_ui_theme_example_02',
121 'efl_ui_slideshow_example', 120 'efl_ui_slideshow_example',
122 'efl_ui_radio_example_01', 121 'efl_ui_radio_example_01',
123 'efl_ui_grid_example_1' 122 'efl_ui_grid_example_1',
123 'efl_ui_grid_view_example_1',
124 'efl_canvas_textblock_obstacles_example'
124] 125]
125 126
126foreach example : examples 127foreach example : examples
diff --git a/src/examples/elementary/popup_cxx_example.cc b/src/examples/elementary/popup_cxx_example.cc
index 08c2e2f..7322807 100644
--- a/src/examples/elementary/popup_cxx_example.cc
+++ b/src/examples/elementary/popup_cxx_example.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` popup_cxx_example.cc -o popup_cxx_example 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` popup_cxx_example.cc -o popup_cxx_example
2 17
3#define EFL_CXXPERIMENTAL 18#define EFL_CXXPERIMENTAL
diff --git a/src/examples/elementary/radio_cxx_example_01.cc b/src/examples/elementary/radio_cxx_example_01.cc
index b561d02..572b718 100644
--- a/src/examples/elementary/radio_cxx_example_01.cc
+++ b/src/examples/elementary/radio_cxx_example_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` radio_cxx_example_01.cc -o radio_cxx_example_01 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` radio_cxx_example_01.cc -o radio_cxx_example_01
2 17
3#define EFL_CXXPERIMENTAL 18#define EFL_CXXPERIMENTAL
diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc
index 5521588..2c90656 100644
--- a/src/examples/elementary/slider_cxx_example.cc
+++ b/src/examples/elementary/slider_cxx_example.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` slider_cxx_example.cc -o slider_cxx_example 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` slider_cxx_example.cc -o slider_cxx_example
2 17
3#define EFL_CXXPERIMENTAL 18#define EFL_CXXPERIMENTAL
diff --git a/src/examples/elementary/slider_example.js b/src/examples/elementary/slider_example.js
index ec59ee1..f3125e5 100644
--- a/src/examples/elementary/slider_example.js
+++ b/src/examples/elementary/slider_example.js
@@ -91,13 +91,13 @@ sl.setVisible(true);
91 91
92sl.on('changed', function(obj) 92sl.on('changed', function(obj)
93 { 93 {
94 val = obj.getProgressValue(); 94 var val = obj.getProgressValue();
95 console.log("Changed to " + val); 95 console.log("Changed to " + val);
96 }); 96 });
97 97
98sl.on('delay_changed', function(obj) 98sl.on('delay_changed', function(obj)
99 { 99 {
100 val = obj.getProgressValue(); 100 var val = obj.getProgressValue();
101 console.log("Delay changed to " + val); 101 console.log("Delay changed to " + val);
102 }); 102 });
103 103
diff --git a/src/examples/elementary/spinner_cxx_example.cc b/src/examples/elementary/spinner_cxx_example.cc
index a6f583f..02d2698 100644
--- a/src/examples/elementary/spinner_cxx_example.cc
+++ b/src/examples/elementary/spinner_cxx_example.cc
@@ -1,3 +1,18 @@
1/*
2+ * Copyright 2019 by its authors. See AUTHORS.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` spinner_cxx_example.cc -o spinner_cxx_example 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` spinner_cxx_example.cc -o spinner_cxx_example
2 17
3#define EFL_CXXPERIMENTAL 18#define EFL_CXXPERIMENTAL
diff --git a/src/examples/elementary/table_cxx_example_01.cc b/src/examples/elementary/table_cxx_example_01.cc
index f96bf82..962fc5d 100644
--- a/src/examples/elementary/table_cxx_example_01.cc
+++ b/src/examples/elementary/table_cxx_example_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` table_cxx_example_01.cc -o table_cxx_example_01 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` table_cxx_example_01.cc -o table_cxx_example_01
2 17
3#include <Efl_Ui.hh> 18#include <Efl_Ui.hh>
@@ -19,19 +34,19 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
19// FIXME 34// FIXME
20// table.homogeneous_set(true); 35// table.homogeneous_set(true);
21 36
22 efl::ui::Text label(instantiate, win); 37 efl::ui::Textbox label(instantiate, win);
23 label.text_set("label 0"); 38 label.text_set("label 0");
24 table.pack_table(label, 0, 0, 1, 1); 39 table.pack_table(label, 0, 0, 1, 1);
25 40
26 efl::ui::Text label1(instantiate, win); 41 efl::ui::Textbox label1(instantiate, win);
27 label1.text_set("label 1"); 42 label1.text_set("label 1");
28 table.pack_table(label1, 1, 0, 1, 1); 43 table.pack_table(label1, 1, 0, 1, 1);
29 44
30 efl::ui::Text label2(instantiate, win); 45 efl::ui::Textbox label2(instantiate, win);
31 label2.text_set("label 2"); 46 label2.text_set("label 2");
32 table.pack_table(label2, 0, 1, 1, 1); 47 table.pack_table(label2, 0, 1, 1, 1);
33 48
34 efl::ui::Text label3(instantiate, win); 49 efl::ui::Textbox label3(instantiate, win);
35 label3.text_set("label 3"); 50 label3.text_set("label 3");
36 table.pack_table(label3, 1, 1, 1, 1); 51 table.pack_table(label3, 1, 1, 1, 1);
37} 52}
diff --git a/src/examples/elementary/table_cxx_example_02.cc b/src/examples/elementary/table_cxx_example_02.cc
index 0fe8cf0..aff87a7 100644
--- a/src/examples/elementary/table_cxx_example_02.cc
+++ b/src/examples/elementary/table_cxx_example_02.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` table_cxx_example_01.cc -o table_cxx_example_01 16// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` table_cxx_example_01.cc -o table_cxx_example_01
2 17
3#include <Evas.hh> 18#include <Evas.hh>
diff --git a/src/examples/elementary/toolbar_cxx_example_01.cc b/src/examples/elementary/toolbar_cxx_example_01.cc
index 19a9931..d6ecc44 100644
--- a/src/examples/elementary/toolbar_cxx_example_01.cc
+++ b/src/examples/elementary/toolbar_cxx_example_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#define ELM_WIDGET_PROTECTED 16#define ELM_WIDGET_PROTECTED
2#define ELM_WIDGET_CLASS_PROTECTED 17#define ELM_WIDGET_CLASS_PROTECTED
3 18
diff --git a/src/examples/elementary/twitter_example_01.js b/src/examples/elementary/twitter_example_01.js
index 04edbdd..46237aa 100644
--- a/src/examples/elementary/twitter_example_01.js
+++ b/src/examples/elementary/twitter_example_01.js
@@ -10,7 +10,7 @@ fs = require('fs');
10request = require('request'); 10request = require('request');
11Twitter = require('twitter'); 11Twitter = require('twitter');
12 12
13user_acount = 'EnlightenmentKo' 13user_acount = 'EnlightenmentKo';
14 14
15var twit = new Twitter({ 15var twit = new Twitter({
16 consumer_key: '', // replace with consumer_key 16 consumer_key: '', // replace with consumer_key
@@ -43,7 +43,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
43 if (error) 43 if (error)
44 return; 44 return;
45 45
46 for(i=0; i < tweets.length; i++){ 46 for(var i=0; i < tweets.length; i++){
47 var user_name = tweets[i].user.name; 47 var user_name = tweets[i].user.name;
48 var screen_name = tweets[i].user.screen_name; 48 var screen_name = tweets[i].user.screen_name;
49 var text = tweets[i].text; 49 var text = tweets[i].text;
@@ -52,13 +52,13 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
52 var filename = path.join(__dirname, 'twitter_example_01.edj'); 52 var filename = path.join(__dirname, 'twitter_example_01.edj');
53 layout.setFile(filename, "tweet"); 53 layout.setFile(filename, "tweet");
54 54
55 layout.setPartText("user_name", screen_name); 55 layout.setPartText("user_name", user_name);
56 layout.setPartText("screen_name", " - @"+screen_name); 56 layout.setPartText("screen_name", " - @"+screen_name);
57 57
58 var entry = new efl.Elm.Entry(win); 58 var entry = new efl.Elm.Entry(win);
59 entry.setPartText("elm.text", text); 59 entry.setPartText("elm.text", text);
60 entry.setEditable(false); 60 entry.setEditable(false);
61 part = layout.part("tweet_text").cast("Efl.Content"); 61 var part = layout.part("tweet_text").cast("Efl.Content");
62 part.setContent(entry); 62 part.setContent(entry);
63 63
64 layout.setHintMin(127, 96); 64 layout.setHintMin(127, 96);
@@ -68,7 +68,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
68 var icon = new efl.Efl.Ui.Image(win); 68 var icon = new efl.Efl.Ui.Image(win);
69 icon.fillInside = true; 69 icon.fillInside = true;
70 icon_array.push(icon); 70 icon_array.push(icon);
71 user_icon = layout.part("user_icon").cast("Efl.Content"); 71 var user_icon = layout.part("user_icon").cast("Efl.Content");
72 user_icon.setContent(icon); 72 user_icon.setContent(icon);
73 item = tweet_box.packEnd(layout); 73 item = tweet_box.packEnd(layout);
74 layout.setVisible(true); 74 layout.setVisible(true);
@@ -78,7 +78,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
78 var file = fs.createWriteStream(icon_filename); 78 var file = fs.createWriteStream(icon_filename);
79 file.on('finish', function() { 79 file.on('finish', function() {
80 console.log("finished loading the icon file."); 80 console.log("finished loading the icon file.");
81 for (i=0; i < icon_array.length; i++) { 81 for (var i=0; i < icon_array.length; i++) {
82 icon_array[i].setFile(icon_filename, null); 82 icon_array[i].setFile(icon_filename, null);
83 } 83 }
84 }); 84 });
diff --git a/src/examples/elocation/.gitignore b/src/examples/elocation/.gitignore
deleted file mode 100644
index 5945c2e..0000000
--- a/src/examples/elocation/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
1/elocation
diff --git a/src/examples/elocation/elocation.c b/src/examples/elocation/elocation.c
deleted file mode 100644
index b9c8b99..0000000
--- a/src/examples/elocation/elocation.c
+++ /dev/null
@@ -1,167 +0,0 @@
1#include <stdio.h>
2
3#define EFL_BETA_API_SUPPORT
4
5#include <Ecore.h>
6#include <Elocation.h>
7
8/* A set of callbacks to react on incoming elocation events. They are standard
9 * ecore events and we register callbacks based on these events in the main
10 * function.
11 */
12static Eina_Bool
13status_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
14{
15 int *status = event;
16
17 printf("Status changed to: %i\n", *status);
18 printf("\n");
19
20 return ECORE_CALLBACK_DONE;
21}
22
23static Eina_Bool
24rgeocode_arrived(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
25{
26 Elocation_Address *address;
27
28 address = event;
29 printf("Geocode reply:\n");
30 printf("Country: %s\n", address->country);
31 printf("Countrycode: %s\n", address->countrycode);
32 printf("Locality: %s\n", address->locality);
33 printf("Postalcode: %s\n", address->postalcode);
34 printf("Region: %s\n", address->region);
35 printf("Timezone: %s\n", address->timezone);
36 printf("Accuracy level: %i\n", address->accur->level);
37 printf("Accuracy horizontal: %f\n", address->accur->horizontal);
38 printf("Accuracy vertical: %f\n", address->accur->vertical);
39 printf("\n");
40
41 return ECORE_CALLBACK_DONE;
42}
43
44static Eina_Bool
45geocode_arrived(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
46{
47 Elocation_Position *position;
48
49 position = event;
50 printf("Reverse geocode reply:\n");
51 printf("Latitude:\t %f\n", position->latitude);
52 printf("Longitude:\t %f\n", position->longitude);
53 printf("Altitude:\t %f\n", position->altitude);
54 printf("Accuracy level: %i\n", position->accur->level);
55 printf("Accuracy horizontal: %f\n", position->accur->horizontal);
56 printf("Accuracy vertical: %f\n", position->accur->vertical);
57 printf("\n");
58
59 return ECORE_CALLBACK_DONE;
60}
61
62static Eina_Bool
63address_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
64{
65 Elocation_Address *address;
66
67 address = event;
68 printf("Address update with data from timestamp: %i\n", address->timestamp);
69 printf("Country: %s\n", address->country);
70 printf("Countrycode: %s\n", address->countrycode);
71 printf("Locality: %s\n", address->locality);
72 printf("Postalcode: %s\n", address->postalcode);
73 printf("Region: %s\n", address->region);
74 printf("Timezone: %s\n", address->timezone);
75 printf("Accuracy level: %i\n", address->accur->level);
76 printf("Accuracy horizontal: %f\n", address->accur->horizontal);
77 printf("Accuracy vertical: %f\n", address->accur->vertical);
78 printf("\n");
79
80 return ECORE_CALLBACK_DONE;
81}
82
83static Eina_Bool
84position_changed(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
85{
86 Elocation_Position *position;
87
88 position = event;
89 printf("GeoClue position reply with data from timestamp %i\n", position->timestamp);
90 printf("Latitude:\t %f\n", position->latitude);
91 printf("Longitude:\t %f\n", position->longitude);
92 printf("Altitude:\t %f\n", position->altitude);
93 printf("Accuracy level: %i\n", position->accur->level);
94 printf("Accuracy horizontal: %f\n", position->accur->horizontal);
95 printf("Accuracy vertical: %f\n", position->accur->vertical);
96 printf("\n");
97
98 return ECORE_CALLBACK_DONE;
99}
100
101int
102main(void)
103{
104 Elocation_Address *address, *addr_geocode;
105 Elocation_Position *position, *pos_geocode;
106 int status;
107
108 /* Init the needed efl subsystems so we can safely use them */
109 ecore_init();
110 eldbus_init();
111 elocation_init();
112
113 /* Create an address and positon object that we use for all our operations.
114 * Needs to be freed manually with elocation_*_free when we now longer use
115 * them */
116 address = elocation_address_new();
117 position = elocation_position_new();
118
119 /* Register callback so we get updates later on */
120 ecore_event_handler_add(ELOCATION_EVENT_STATUS, status_changed, NULL);
121 ecore_event_handler_add(ELOCATION_EVENT_POSITION, position_changed, NULL);
122 ecore_event_handler_add(ELOCATION_EVENT_ADDRESS, address_changed, NULL);
123 ecore_event_handler_add(ELOCATION_EVENT_GEOCODE, geocode_arrived, NULL);
124 ecore_event_handler_add(ELOCATION_EVENT_REVERSEGEOCODE, rgeocode_arrived, NULL);
125
126 /* To the initial request for status address and position. This fills in the
127 * objects with the data from GeoClue */
128 elocation_status_get(&status);
129 elocation_position_get(position);
130 elocation_address_get(address);
131
132 /* Another set of address and position object. This time for demonstrating
133 * the GeoCode functionalities */
134 addr_geocode = elocation_address_new();
135 pos_geocode = elocation_position_new();
136
137 /* The Freeform API could use any string to transform it into position
138 * coordinates. How good that works depends on the used GeoClue provider */
139 elocation_freeform_address_to_position("London", pos_geocode);
140
141 /* Some demo values to show the position to address conversion */
142 pos_geocode->latitude = 51.7522;
143 pos_geocode->longitude = -1.25596;
144 pos_geocode->accur->level = 3;
145 elocation_position_to_address(pos_geocode, addr_geocode);
146
147 /* And now from address to position */
148 addr_geocode->locality = "Cambridge";
149 addr_geocode->countrycode = "UK";
150 elocation_address_to_position(addr_geocode, pos_geocode);
151
152 /* Enter the mainloop now that we are setup with initial data and waiting for
153 * events. */
154 ecore_main_loop_begin();
155
156 /* Cleanup allocated memory now that we shut down */
157 elocation_address_free(addr_geocode);
158 elocation_position_free(pos_geocode);
159 elocation_address_free(address);
160 elocation_position_free(position);
161
162 /* Make sure we also shut down the initialized subsystems */
163 elocation_shutdown();
164 eldbus_shutdown();
165 ecore_shutdown();
166 return 0;
167}
diff --git a/src/examples/eolian_cxx/colourable_cxx.cc b/src/examples/eolian_cxx/colourable_cxx.cc
index 66c0d89..b2328dd 100644
--- a/src/examples/eolian_cxx/colourable_cxx.cc
+++ b/src/examples/eolian_cxx/colourable_cxx.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1 16
2#include <iostream> 17#include <iostream>
3#include <iomanip> 18#include <iomanip>
diff --git a/src/examples/eolian_cxx/colourablesquare_cxx.cc b/src/examples/eolian_cxx/colourablesquare_cxx.cc
index ecaf757..c88c93e 100644
--- a/src/examples/eolian_cxx/colourablesquare_cxx.cc
+++ b/src/examples/eolian_cxx/colourablesquare_cxx.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1 16
2#include <iostream> 17#include <iostream>
3#include <iomanip> 18#include <iomanip>
diff --git a/src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc b/src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc
index 9f9845e..59801f6 100644
--- a/src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1 16
2// Disabled test while Ecore Eo API is still rapidly changing 17// Disabled test while Ecore Eo API is still rapidly changing
3#if 0 18#if 0
diff --git a/src/examples/eolian_cxx/eolian_cxx_simple_01.cc b/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
index 257f994..c6fa2eb 100644
--- a/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// EINA_LOG_LEVELS=colourable:4,colourablesquare:4 ./eolian_cxx_simple_01 16// EINA_LOG_LEVELS=colourable:4,colourablesquare:4 ./eolian_cxx_simple_01
2 17
3#include <iostream> 18#include <iostream>
diff --git a/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc b/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc
index 2ca0e97..5b7a0ee 100644
--- a/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1// EINA_LOG_LEVELS=colourable:4,colourablesquare:4 ./eolian_cxx_simple_01 16// EINA_LOG_LEVELS=colourable:4,colourablesquare:4 ./eolian_cxx_simple_01
2 17
3#include <iostream> 18#include <iostream>
diff --git a/src/examples/evas/efl-canvas-animation.c b/src/examples/evas/efl-canvas-animation.c
new file mode 100644
index 0000000..a9058c5
--- /dev/null
+++ b/src/examples/evas/efl-canvas-animation.c
@@ -0,0 +1,179 @@
1/**
2 * Example of animation in efl canvas
3 *
4 * You'll need at least one engine built for it (excluding the buffer
5 * one). See stdout/stderr for output.
6 *
7 */
8
9#ifdef HAVE_CONFIG_H
10#include "config.h"
11#endif
12
13#include <Ecore.h>
14#include <Ecore_Evas.h>
15
16#include <stdlib.h>
17#include <stdio.h>
18#include <string.h>
19
20#define WIDTH (640)
21#define HEIGHT (480)
22
23struct example_data
24{
25 Ecore_Evas *ee;
26 Evas *evas;
27 Evas_Object *bg, *scale;
28 double current_speed;
29};
30
31static struct example_data d;
32
33static Evas_Object * /* new rectangle to be put in the box */
34_new_rectangle_add(Evas *e)
35{
36 Efl_Canvas_Rectangle *rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, e);
37
38 efl_gfx_entity_size_set(rect, EINA_SIZE2D(10, 10));
39 efl_gfx_color_set(rect, 0, 255, 0, 255);
40 efl_gfx_entity_visible_set(rect, EINA_TRUE);
41
42 return rect;
43}
44
45/* use the following commands to interact with this example - 'h' is
46 * the key for help */
47static void
48_on_keydown(void *data EINA_UNUSED, const Efl_Event *ev)
49{
50 if (strcmp(efl_input_key_sym_get(ev->info) , "r") == 0)
51 {
52 Efl_Canvas_Animation *animation = efl_canvas_object_animation_get(d.scale);
53 double current_pos = efl_canvas_object_animation_progress_get(d.scale);
54 d.current_speed *= -1;
55 efl_canvas_object_animation_start(d.scale, animation, d.current_speed, 1.0 - current_pos);
56 }
57 if (strcmp(efl_input_key_sym_get(ev->info), "p") == 0)
58 {
59 efl_canvas_object_animation_pause_set(d.scale, !efl_canvas_object_animation_pause_get(d.scale));
60 }
61}
62
63static void
64_on_delete(Ecore_Evas *ee EINA_UNUSED)
65{
66 ecore_main_loop_quit();
67}
68
69static void /* adjust canvas' contents on resizes */
70_canvas_resize_cb(Ecore_Evas *ee)
71{
72 int w, h;
73
74 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
75
76 efl_gfx_entity_geometry_set(d.bg, EINA_RECT(0, 0, w, h));
77}
78
79static void
80print_help(void)
81{
82 printf("evas-animation example\n Press r to reverse the animation of the red rect.\n Press p to pause the animation of the red rect.\n");
83}
84
85int
86main(void)
87{
88 if (!ecore_evas_init())
89 return EXIT_FAILURE;
90
91 /* this will give you a window with an Evas canvas under the first
92 * engine available */
93 d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
94 if (!d.ee)
95 goto panic;
96
97 print_help();
98
99 ecore_evas_name_class_set(d.ee, "Evas Animation example", "Evas Animation Example");
100 ecore_evas_callback_delete_request_set(d.ee, _on_delete);
101 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
102 ecore_evas_show(d.ee);
103
104 d.evas = ecore_evas_get(d.ee);
105
106 d.bg = _new_rectangle_add(d.evas);
107 efl_gfx_color_set(d.bg, 255, 255, 255, 255);
108 efl_gfx_entity_visible_set(d.bg, EINA_TRUE);
109 efl_canvas_object_key_focus_set(d.bg, EINA_TRUE);
110 efl_event_callback_add(d.bg, EFL_EVENT_KEY_DOWN, _on_keydown, NULL);
111
112 _canvas_resize_cb(d.ee);
113
114 Evas_Object *scale_rect = _new_rectangle_add(d.evas);
115 efl_gfx_entity_geometry_set(scale_rect, EINA_RECT(50, 50, 50, 50));
116 efl_canvas_object_animation_start(scale_rect,
117 efl_new(EFL_CANVAS_SCALE_ANIMATION_CLASS,
118 efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(3.0, 3.0), scale_rect, EINA_VECTOR2(0.5, 0.5)),
119 efl_animation_start_delay_set(efl_added, 5.0),
120 efl_animation_duration_set(efl_added, 2.0),
121 efl_animation_play_count_set(efl_added, 0)
122 ),
123 1.0, 0.0);
124
125 Evas_Object *scale_rect2 = _new_rectangle_add(d.evas);
126 efl_gfx_entity_geometry_set(scale_rect2, EINA_RECT(50, 200, 50, 50));
127 efl_canvas_object_animation_start(scale_rect2,
128 efl_new(EFL_CANVAS_SCALE_ANIMATION_CLASS,
129 efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(3.0, 3.0), scale_rect2, EINA_VECTOR2(0.5, 0.5)),
130 efl_animation_duration_set(efl_added, 2.0),
131 efl_animation_play_count_set(efl_added, 0),
132 efl_animation_repeat_mode_set(efl_added, EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE)
133 ),
134 1.0, 0.0);
135
136 Evas_Object *scale_rect3 = _new_rectangle_add(d.evas);
137 efl_gfx_entity_geometry_set(scale_rect3, EINA_RECT(50, 350, 50, 50));
138 efl_canvas_object_animation_start(scale_rect3,
139 efl_new(EFL_CANVAS_SCALE_ANIMATION_CLASS,
140 efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(3.0, 3.0), scale_rect3, EINA_VECTOR2(0.5, 0.5)),
141 efl_animation_duration_set(efl_added, 2.0),
142 efl_animation_play_count_set(efl_added, 4),
143 efl_animation_repeat_mode_set(efl_added, EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE)
144 ),
145 1.0, 0.0);
146
147 Evas_Object *scale_rect4 = _new_rectangle_add(d.evas);
148 efl_gfx_entity_geometry_set(scale_rect4, EINA_RECT(200, 50, 50, 50));
149 efl_canvas_object_animation_start(scale_rect4,
150 efl_new(EFL_CANVAS_SCALE_ANIMATION_CLASS,
151 efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(3.0, 3.0), scale_rect4, EINA_VECTOR2(0.5, 0.5)),
152 efl_animation_duration_set(efl_added, 2.0),
153 efl_animation_final_state_keep_set(efl_added, EINA_TRUE)
154 ),
155 1.0, 0.0);
156
157
158 Evas_Object *scale_rect5 = d.scale = _new_rectangle_add(d.evas);
159 efl_gfx_color_set(scale_rect5, 255, 0, 0, 255);
160 efl_gfx_entity_geometry_set(scale_rect5, EINA_RECT(200, 200, 50, 50));
161 efl_canvas_object_animation_start(scale_rect5,
162 efl_new(EFL_CANVAS_SCALE_ANIMATION_CLASS,
163 efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(5.0, 5.0), scale_rect5, EINA_VECTOR2(0.5, 0.5)),
164 efl_animation_duration_set(efl_added, 5.0),
165 efl_animation_play_count_set(efl_added, 0)
166 ),
167 1.0, 0.0);
168 d.current_speed = 1.0;
169
170 ecore_main_loop_begin();
171 ecore_evas_shutdown();
172 return 0;
173
174panic:
175 fprintf(stderr, "error: Requires at least one Evas engine built and linked"
176 " to ecore-evas for this example to run properly.\n");
177 return -2;
178}
179
diff --git a/src/examples/evas/efl-canvas-vg-simple.c b/src/examples/evas/efl-canvas-vg-simple.c
new file mode 100644
index 0000000..79a9645
--- /dev/null
+++ b/src/examples/evas/efl-canvas-vg-simple.c
@@ -0,0 +1,663 @@
1/**
2 * Example of Evas' vector graphics object and API.
3 *
4 * @verbatim
5 * gcc -o efl-canvas-vg-simple efl-canvas-vg-simple.c `pkg-config --libs --cflags evas ecore ecore-evas eina ector eo efl` -lm
6 * @endverbatim
7 */
8
9#ifdef HAVE_CONFIG_H
10#include "config.h"
11#else
12#define PACKAGE_EXAMPLES_DIR "."
13#endif
14
15#define WIDTH 600
16#define HEIGHT 800
17
18#include <Eo.h>
19#include <Efl.h>
20#include <Evas.h>
21#include <Ecore.h>
22#include <Ecore_Evas.h>
23#include <Eina.h>
24
25struct example_data
26{
27 Ecore_Evas *ee;
28 Evas *evas;
29 Efl_Canvas_Rectangle *bg;
30 Efl_VG *vg;
31 Eina_List *shape_list;
32
33};
34
35static struct example_data d;
36Ecore_Animator *animator;
37
38/* These data strings follows an SVG-like convention for describing the
39 * nodes of a path. 'M x,y' indicates a move-to operation that sets
40 * where to start drawing. 'L x,y' draws a straight line that ends at
41 * the given point. 'C x1,y1 x2,y2 x,y' defines a Bezier curve's two
42 * control points and the x,y coordinate where the curve ends. 'Z' marks
43 * the end of the path.
44 */
45static const char *batman = "M 256,213 C 245,181 206,187 234,262 147,181 169,71.2 233,18 220,56 235,81 283,88 285,78.7 286,69.3 288,60 289,61.3 290,62.7 291,64 291,64 297,63 300,63 303,63 309,64 309,64 310,62.7 311,61.3 312,60 314,69.3 315,78.7 317,88 365,82 380,56 367,18 431,71 453,181 366,262 394,187 356,181 344,213 328,185 309,184 300,284 291,184 272,185 256,213 Z";
46static const unsigned int batman_commandCnt = 17;
47static const unsigned int batman_pointCnt = 86;
48static const char *morph1[2] = {"M 0,0 L 0,0 L 100,0 L 100,0 L 100,100 L 100,100 L 0,100 L 0,100 L 0,0",
49 "M 0,0 L 50,-80 L 100,0 L 180,50 L 100,100 L 50,180 L 0,100 L -80,50 L 0,0"};
50
51static void _main_menu();
52static void _main_menu_key_handle(void *data EINA_UNUSED, const Efl_Event *ev);
53
54static const char *main_menu = \
55 "Main Menu:\n"
56 "\t1 - Basic Shape test\n"
57 "\t2 - Interpolation\n"
58 "\t3 - Gradient\n"
59 "\te - Exit\n"
60 "\th - Print help\n";
61
62static const char *basic_shape_menu = \
63 "Basic Shape Menu:\n"
64 "\tup - Increase Stroke Width by 0.5\n"
65 "\tdown - Decrease Stroke Width by 0.5\n"
66 "\tr - +10 degree rotation\n"
67 "\tR - -10 degree rotation\n"
68 "\ts - +(.1, .1) scale\n"
69 "\tS - -(.1, .1) scale\n"
70 "\tt - +(10,10) translation\n"
71 "\tT - +(10,10) translation\n"
72 "\td - Reset path data\n"
73 "\te - Exit\n"
74 "\tb - Back to Main Menu\n"
75 "\th - Print help\n";
76
77static const char *interpolation_menu = \
78 "Interpolation Menu:\n"
79 "\te - Exit\n"
80 "\tb - Back to Main Menu\n"
81 "\th - print help\n";
82
83static const char *gradient_menu = \
84 "Gradient Menu:\n"
85 "\te - Exit\n"
86 "\tb - Back to Main Menu\n"
87 "\th - print help\n";
88
89static void
90_on_delete(Ecore_Evas *ee EINA_UNUSED)
91{
92 if (animator) ecore_animator_del(animator);
93 ecore_main_loop_quit();
94}
95
96static void
97_canvas_resize_cb(Ecore_Evas *ee)
98{
99 int w, h;
100
101 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
102
103 efl_gfx_entity_geometry_set(d.bg, EINA_RECT(0, 0, w, h));
104 efl_gfx_entity_geometry_set(d.vg, EINA_RECT(0, 0, w, h));
105}
106
107static void
108reset_test()
109{
110 if(d.vg) efl_del(d.vg);
111 d.shape_list = eina_list_free(d.shape_list);
112
113 d.vg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, d.evas,
114 efl_canvas_object_key_focus_set(efl_added, EINA_TRUE),
115 efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
116
117 _canvas_resize_cb(d.ee);
118}
119
120// 2. Basic shape Test Case START
121
122/* Applies a matrix transformation to a shape. If there is already a
123 * matrix transformation applied, the new tranformation is matrix
124 * multiplied with the existing one so both transformations are used.
125 */
126static void
127_added_transformation(Efl_VG *shape, Eina_Matrix3 *m)
128{
129 Eina_Matrix3 new_m;
130 const Eina_Matrix3 *old_m;
131
132 old_m = efl_canvas_vg_node_transformation_get(shape);
133 if (old_m)
134 {
135 eina_matrix3_compose(m, old_m, &new_m);
136 efl_canvas_vg_node_transformation_set(shape, &new_m);
137 }
138 else
139 {
140 efl_canvas_vg_node_transformation_set(shape, m);
141 }
142}
143
144/*
145 * Applies various modifications to the canvas objects as directed by
146 * the user.
147 */
148static void
149_basic_shape_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
150{
151 Efl_VG *shape;
152 Eina_List *l;
153 Eina_Matrix3 m;
154 double stroke_w;
155
156 if (!strcmp(efl_input_key_sym_get(ev->info) , "h"))
157 {
158 /* h - Print help */
159 puts(basic_shape_menu);
160 }
161 else if (!strcmp(efl_input_key_sym_get(ev->info) , "e"))
162 {
163 /* e - Exit */
164 _on_delete(d.ee);
165 }
166
167 else if (!strcmp(efl_input_key_sym_get(ev->info) , "b"))
168 {
169 /* b - Back to Main Menu */
170 _main_menu();
171 }
172 else if (!strcmp(efl_input_key_sym_get(ev->info) , "Up"))
173 {
174 /* up - Increase Stroke Width by 0.5 */
175 EINA_LIST_FOREACH(d.shape_list, l, shape)
176 {
177 stroke_w = efl_gfx_shape_stroke_width_get(shape);
178 efl_gfx_shape_stroke_width_set(shape, stroke_w + 0.5);
179 efl_gfx_path_commit(shape);
180 }
181 }
182 else if (!strcmp(efl_input_key_sym_get(ev->info) , "Down"))
183 {
184 /* down - Decrease Stroke Width by 0.5 */
185 EINA_LIST_FOREACH(d.shape_list, l, shape)
186 {
187 stroke_w = efl_gfx_shape_stroke_width_get(shape);
188 if (stroke_w <= 0.5) stroke_w = 1;
189 efl_gfx_shape_stroke_width_set(shape, stroke_w - 0.5);
190 efl_gfx_path_commit(shape);
191 }
192 }
193 else if (!strcmp(efl_input_key_sym_get(ev->info) , "r"))
194 {
195 /* r - Rotate the shapes +10 degrees */
196 eina_matrix3_identity(&m);
197 eina_matrix3_rotate(&m, 10.0 * 2 * 3.141 / 360.0);
198 EINA_LIST_FOREACH(d.shape_list, l, shape)
199 {
200 _added_transformation(shape, &m);
201 }
202 }
203 else if (!strcmp(efl_input_key_sym_get(ev->info) , "R"))
204 {
205 /* R - Rotate the shapes -10 degrees */
206 eina_matrix3_identity(&m);
207 eina_matrix3_rotate(&m, -10.0 * 2 * 3.141 / 360.0);
208 EINA_LIST_FOREACH(d.shape_list, l, shape)
209 {
210 _added_transformation(shape, &m);
211 }
212 }
213 else if (!strcmp(efl_input_key_sym_get(ev->info) , "s"))
214 {
215 /* s - Scale the shapes +(.1, .1) */
216 eina_matrix3_identity(&m);
217 eina_matrix3_scale(&m, 1.1, 1.1);
218 EINA_LIST_FOREACH(d.shape_list, l, shape)
219 {
220 _added_transformation(shape, &m);
221 }
222 }
223 else if (!strcmp(efl_input_key_sym_get(ev->info) , "S"))
224 {
225 /* S - Scale the shapes -(.1, .1) */
226 eina_matrix3_identity(&m);
227 eina_matrix3_scale(&m, .9, .9);
228 EINA_LIST_FOREACH(d.shape_list, l, shape)
229 {
230 _added_transformation(shape, &m);
231 }
232 }
233 else if (!strcmp(efl_input_key_sym_get(ev->info) , "t"))
234 {
235 /* t - Translate the shapes +(10,10) */
236 eina_matrix3_identity(&m);
237 eina_matrix3_translate(&m, 10, 10);
238 EINA_LIST_FOREACH(d.shape_list, l, shape)
239 {
240 _added_transformation(shape, &m);
241 }
242 }
243 else if (!strcmp(efl_input_key_sym_get(ev->info) , "T"))
244 {
245 /* T - Translate the shapes +(10,10) */
246 eina_matrix3_identity(&m);
247 eina_matrix3_translate(&m, -10, -10);
248 EINA_LIST_FOREACH(d.shape_list, l, shape)
249 {
250 _added_transformation(shape, &m);
251 }
252 }
253 else if (!strcmp(efl_input_key_sym_get(ev->info) , "d"))
254 {
255 /* d - Reset path data */
256 EINA_LIST_FOREACH(d.shape_list, l, shape)
257 {
258 efl_gfx_path_reset(shape);
259 }
260 }
261}
262
263/* Create several different geometric objects - a line, rectangle,
264 * circle, and arc, each with distinct style and placement.
265 */
266static void
267_1_basic_shape_test()
268{
269 Efl_VG *container, *shape, *new_shape;
270
271 reset_test();
272 efl_event_callback_add(d.vg, EFL_EVENT_KEY_DOWN, _basic_shape_key_handle, NULL);
273 puts(basic_shape_menu);
274
275 container = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, d.vg);
276
277 // Line
278 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
279 efl_gfx_path_append_move_to(efl_added, 0, 0), // Move strating point path
280 efl_gfx_path_append_line_to(efl_added, 100, 0), // Add line form move point
281 efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
282 efl_gfx_shape_stroke_width_set(efl_added, 5),
283 efl_canvas_vg_node_origin_set(efl_added, 50, 50),
284 efl_gfx_shape_stroke_cap_set(efl_added, EFL_GFX_CAP_ROUND)); // Set stroke cap
285 d.shape_list = eina_list_append(d.shape_list, shape);
286
287 new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
288 efl_gfx_path_copy_from(efl_added, shape), // Path duplicate.
289 efl_gfx_shape_stroke_color_set(efl_added, 0, 100, 0, 100),
290 efl_gfx_path_append_line_to(efl_added, 100, 50),
291 efl_canvas_vg_node_origin_set(efl_added, 200, 50),
292 efl_gfx_shape_stroke_cap_set(efl_added, EFL_GFX_CAP_SQUARE));
293 d.shape_list = eina_list_append(d.shape_list, new_shape);
294
295 new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
296 efl_gfx_path_copy_from(efl_added, shape),
297 efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 255, 255),
298 efl_gfx_path_append_line_to(efl_added, 50, 50),
299 efl_canvas_vg_node_origin_set(efl_added, 350, 50),
300 efl_gfx_shape_stroke_cap_set(efl_added, EFL_GFX_CAP_ROUND),
301 efl_gfx_shape_stroke_join_set(efl_added, EFL_GFX_JOIN_ROUND)); // Set stroke join
302 d.shape_list = eina_list_append(d.shape_list, new_shape);
303
304 // Rect
305 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
306 efl_gfx_path_append_rect(efl_added, 0, 0, 100 , 100, 10, 10), // Draw Rectangle
307 efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
308 efl_gfx_shape_stroke_width_set(efl_added, 5),
309 efl_canvas_vg_node_origin_set(efl_added, 50, 150));
310 d.shape_list = eina_list_append(d.shape_list, shape);
311
312 new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
313 efl_gfx_path_copy_from(efl_added, shape),
314 efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 0, 0),
315 efl_gfx_color_set(efl_added, 0, 0, 100, 100), // Set fill color.
316 efl_canvas_vg_node_origin_set(efl_added, 200, 150));
317 d.shape_list = eina_list_append(d.shape_list, new_shape);
318
319 new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
320 efl_gfx_path_copy_from(efl_added, shape),
321 efl_gfx_shape_stroke_color_set(efl_added, 100, 0, 0, 100),
322 efl_gfx_color_set(efl_added, 0, 100, 100, 100),
323 efl_canvas_vg_node_origin_set(efl_added, 350, 150));
324 d.shape_list = eina_list_append(d.shape_list, new_shape);
325
326 // Circle
327 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
328 efl_gfx_path_append_circle(efl_added, 50, 50, 50), //Draw Circle
329 efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
330 efl_gfx_shape_stroke_width_set(efl_added, 5),
331 efl_canvas_vg_node_origin_set(efl_added, 50, 300));
332 d.shape_list = eina_list_append(d.shape_list, shape);
333
334 new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
335 efl_gfx_path_copy_from(efl_added, shape),
336 efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 0, 0),
337 efl_gfx_color_set(efl_added, 0, 0, 255, 255),
338 efl_canvas_vg_node_origin_set(efl_added, 200, 300));
339 d.shape_list = eina_list_append(d.shape_list, new_shape);
340
341 new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
342 efl_gfx_path_copy_from(efl_added, shape),
343 efl_gfx_shape_stroke_color_set(efl_added, 150, 0, 0, 150),
344 efl_gfx_color_set(efl_added, 0, 0, 200, 200),
345 efl_canvas_vg_node_origin_set(efl_added, 350, 300));
346 d.shape_list = eina_list_append(d.shape_list, new_shape);
347
348 // Arc
349 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
350 efl_gfx_path_append_arc(efl_added, 0, 0, 100, 100, 45, -200), // Draw Arc
351 efl_gfx_path_append_line_to(efl_added, 50, 50),
352 efl_gfx_shape_stroke_cap_set(efl_added, EFL_GFX_CAP_ROUND),
353 efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
354 efl_gfx_shape_stroke_width_set(efl_added, 5),
355 efl_canvas_vg_node_origin_set(efl_added, 50, 450));
356 d.shape_list = eina_list_append(d.shape_list, shape);
357
358 new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
359 efl_gfx_path_append_arc(efl_added, 0, 0, 100, 100, 90, 200),
360 efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 0, 0),
361 efl_gfx_color_set(efl_added, 0, 0, 200, 200),
362 efl_canvas_vg_node_origin_set(efl_added, 200, 450));
363 d.shape_list = eina_list_append(d.shape_list, new_shape);
364
365 new_shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
366 efl_gfx_path_append_arc(efl_added, 0, 0, 100, 100, 90, 200),
367 efl_gfx_path_append_line_to(efl_added, 50, 50),
368 efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 0, 0),
369 efl_gfx_color_set(efl_added, 0, 0, 200, 200),
370 efl_canvas_vg_node_origin_set(efl_added, 350, 450));
371 d.shape_list = eina_list_append(d.shape_list, new_shape);
372
373 efl_canvas_vg_object_root_node_set(d.vg, container);
374}
375
376// 2. Basic shape Test Case END
377
378// 2. Interpolation Test Case START
379
380static void
381_interpolation_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
382{
383 if (!strcmp(efl_input_key_sym_get(ev->info) , "h"))
384 {
385 /* h - Print help */
386 puts(basic_shape_menu);
387 }
388 else if (!strcmp(efl_input_key_sym_get(ev->info) , "e"))
389 {
390 /* e - Exit */
391 _on_delete(d.ee);
392 }
393 else if (!strcmp(efl_input_key_sym_get(ev->info) , "b"))
394 {
395 /* b - Back to main menu */
396 _main_menu();
397 }
398}
399
400static int anim_index = 0;
401static Eina_Bool
402_interpolation_keyframe(void *data EINA_UNUSED, double pos)
403{
404 int next = (anim_index == 1) ? 0 : 1;
405
406 // Reset Base Object's path
407 efl_gfx_path_reset(eina_list_nth(d.shape_list, 2));
408 // Set Path that interpolated from 'from' Object and 'to' Object.
409 efl_gfx_path_interpolate(eina_list_nth(d.shape_list, 2),
410 eina_list_nth(d.shape_list, anim_index),
411 eina_list_nth(d.shape_list, next),
412 ecore_animator_pos_map(pos, ECORE_POS_MAP_SINUSOIDAL, 0.0, 0.0));
413
414 if (pos == 1.0)
415 {
416 anim_index = (anim_index == 1) ? 0 : 1;
417 animator = ecore_animator_timeline_add(1, _interpolation_keyframe, NULL);
418 }
419 return EINA_TRUE;
420}
421
422static void
423_2_interpolation_test()
424{
425 anim_index = 0;
426
427 Efl_VG *shape, *container;
428
429 reset_test();
430
431 efl_event_callback_add(d.vg, EFL_EVENT_KEY_DOWN, _interpolation_key_handle, NULL);
432 animator = ecore_animator_timeline_add(1, _interpolation_keyframe, NULL);
433 puts(interpolation_menu);
434
435 // Make Efl.Canvas.Vg.Container Object
436 container = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, d.vg);
437 // Set the root node of Efl.Canvas.Vg.Object
438 // The Efl.Canvas.Vg.Object searches and renders
439 // Efl.Canvas.Vg.Node(Shape, Container, etc...) from set root node.
440 efl_canvas_vg_object_root_node_set(d.vg, container);
441
442 //Interpolation 'from' and 'to' Object
443 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg,
444 efl_gfx_path_append_svg_path(efl_added, morph1[0]), // Set SVG path
445 efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
446 efl_gfx_shape_stroke_width_set(efl_added, 5),
447 efl_canvas_vg_node_origin_set(efl_added, 100, 100));
448 d.shape_list = eina_list_append(d.shape_list, shape);
449
450 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, d.vg,
451 efl_gfx_path_append_svg_path(efl_added, morph1[1]), // Set SVG path
452 efl_gfx_shape_stroke_color_set(efl_added, 0, 0, 255, 255),
453 efl_gfx_shape_stroke_width_set(efl_added, 10),
454 efl_canvas_vg_node_origin_set(efl_added, 150, 150));
455 d.shape_list = eina_list_append(d.shape_list, shape);
456
457 // Base Object
458 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container);
459 d.shape_list = eina_list_append(d.shape_list, shape);
460
461}
462
463// 2. Interpolation Test Case END
464
465
466// 3. Gradient Test Case START
467static void
468_gradient_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
469{
470 if (!strcmp(efl_input_key_sym_get(ev->info) , "h"))
471 {
472 /* h - Print help */
473 puts(basic_shape_menu);
474 }
475 else if (!strcmp(efl_input_key_sym_get(ev->info) , "e"))
476 {
477 /* e - Exit */
478 _on_delete(d.ee);
479 }
480 else if (!strcmp(efl_input_key_sym_get(ev->info) , "b"))
481 {
482 /* b - Back to main menu */
483 _main_menu();
484 }
485}
486
487static void
488_3_gradient_test()
489{
490 Efl_VG *container, *shape;
491 Efl_Canvas_Vg_Gradient *grad_fill, *grad_stroke;
492
493 reset_test();
494 efl_event_callback_add(d.vg, EFL_EVENT_KEY_DOWN, _gradient_key_handle, NULL);
495 puts(gradient_menu);
496
497 container = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, d.vg);
498
499 // Rect Shape
500 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
501 efl_gfx_path_append_rect(efl_added, 0, 0, 100 , 100, 10, 10),
502 efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255),
503 efl_gfx_shape_stroke_width_set(efl_added, 5),
504 efl_canvas_vg_node_origin_set(efl_added, 50, 50));
505
506 //Make Linear gradient for fill
507 grad_stroke = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, container,
508 efl_gfx_gradient_linear_start_set(efl_added, 0, 0),
509 efl_gfx_gradient_linear_end_set(efl_added, 100, 100),
510 efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
511 //Make Stops
512 float pa;
513 Efl_Gfx_Gradient_Stop stops[2];
514 stops[0].offset = 0;
515 pa = 100.0 / 255.0;
516 stops[0].r = (int)(255.0 * pa);
517 stops[0].g = 0;
518 stops[0].b = 0;
519 stops[0].a = 100;
520
521 stops[1].offset = 1;
522 pa = 200.0 / 255;
523 stops[1].r = 0;
524 stops[1].g = 0;
525 stops[1].b = (int)(255.0 * pa);
526 stops[1].a = 200.0;
527 efl_gfx_gradient_stop_set(grad_stroke, stops, 2);
528 //Set Gradient
529 efl_canvas_vg_shape_stroke_fill_set(shape, grad_stroke);
530
531 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
532 efl_gfx_path_append_rect(efl_added, 0, 0, 100 , 100, 10, 10),
533 efl_gfx_shape_stroke_width_set(efl_added, 5),
534 efl_gfx_color_set(efl_added, 0, 0, 100, 100),
535 efl_canvas_vg_node_origin_set(efl_added, 50, 200));
536 //Make Radial Gradient for Stroke
537 grad_fill = efl_add(EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS, container,
538 efl_gfx_gradient_radial_center_set(efl_added, 50, 50),
539 efl_gfx_gradient_radial_focal_set(efl_added, 10, 10),
540 efl_gfx_gradient_radial_radius_set(efl_added, 100),
541 efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
542 //Make Stops
543 stops[0].offset = 0;
544 pa = 100.0 / 255.0;
545 stops[0].r = (int)(255.0 * pa);
546 stops[0].g = 0;
547 stops[0].b = 0;
548 stops[0].a = 100;
549
550 stops[1].offset = 1;
551 pa = 100.0 / 255;
552 stops[1].r = 0;
553 stops[1].g = (int)(255.0 * pa);
554 stops[1].b = 0;
555 stops[1].a = 100.0;
556 efl_gfx_gradient_stop_set(grad_fill, stops, 2);
557 //Set Gradient
558 efl_canvas_vg_shape_fill_set(shape, grad_fill);
559
560 efl_canvas_vg_object_root_node_set(d.vg, container);
561}
562// 3. Gradient Test Case END
563
564// Main Menu START
565static void
566_main_menu()
567{
568 Efl_VG *shape, *container;
569 if (animator) ecore_animator_del(animator);
570 animator = NULL;
571 if(d.vg) efl_del(d.vg);
572 if(d.bg) efl_del(d.bg);
573 d.bg = efl_add(EFL_CANVAS_RECTANGLE_CLASS, d.evas,
574 efl_gfx_color_set(efl_added, 255, 255, 255, 255),
575 efl_gfx_entity_visible_set(efl_added, EINA_TRUE),
576 efl_canvas_object_key_focus_set(efl_added, EINA_TRUE),
577 efl_event_callback_add(efl_added, EFL_EVENT_KEY_DOWN, _main_menu_key_handle, NULL));
578
579 // Create the initial screen - Yellow color bat
580 // Make Efl.Canvas.Vg.Object object
581 d.vg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, d.evas,
582 efl_gfx_entity_visible_set(efl_added, EINA_TRUE));
583
584 // Make Efl.Canvas.Vg.Container Object
585 container = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, d.vg);
586 // Set the root node of Efl.Canvas.Vg.Object
587 // The Efl.Canvas.Vg.Object searches and renders
588 // Efl.Canvas.Vg.Node(Shape, Container, etc...) from set root node.
589 efl_canvas_vg_object_root_node_set(d.vg, container);
590
591 // Make Efl.Canvas.Vg.Shape
592 shape = efl_add(EFL_CANVAS_VG_SHAPE_CLASS, container,
593 efl_gfx_shape_stroke_color_set(efl_added, 255, 0, 0, 255), // Set Stroke color
594 efl_gfx_shape_stroke_width_set(efl_added, 5), // Set Stroke width
595 efl_gfx_color_set(efl_added, 255, 255, 0, 255), // Set Fill color
596 efl_canvas_vg_node_origin_set(efl_added, 25, 100)); // Set Position
597
598 // Reserve memory for the number of commands and pointers
599 efl_gfx_path_reserve(shape, batman_commandCnt, batman_pointCnt);
600 efl_gfx_path_append_svg_path(shape, batman); // Set SVG path
601
602 _canvas_resize_cb(d.ee);
603 puts(main_menu);
604}
605
606static void
607_main_menu_key_handle(void *data EINA_UNUSED, const Efl_Event *ev)
608{
609
610 if (!strcmp(efl_input_key_sym_get(ev->info) , "h"))
611 {
612 /* h - Help menu */
613 puts(main_menu);
614 }
615 else if (!strcmp(efl_input_key_sym_get(ev->info) , "e"))
616 {
617 /* e - Exit */
618 _on_delete(d.ee);
619 }
620 else if (!strcmp(efl_input_key_sym_get(ev->info) , "1"))
621 {
622 /* 1 - Basic Shape test */
623 _1_basic_shape_test();
624 }
625 else if (!strcmp(efl_input_key_sym_get(ev->info) , "2"))
626 {
627 /* 2 - Interpolation */
628 _2_interpolation_test();
629 }
630 else if (!strcmp(efl_input_key_sym_get(ev->info) , "3"))
631 {
632 /* 3 - Gradient */
633 _3_gradient_test();
634 }
635}
636// Main Menu END
637
638int
639main(void)
640{
641 if (!ecore_evas_init())
642 return EXIT_FAILURE;
643
644 d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
645 if (!d.ee)
646 goto error;
647
648 ecore_evas_callback_delete_request_set(d.ee, _on_delete);
649 ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb);
650 ecore_evas_show(d.ee);
651
652 d.evas = ecore_evas_get(d.ee);
653
654 _main_menu();
655
656 ecore_main_loop_begin();
657 ecore_evas_shutdown();
658 return 0;
659
660error:
661 ecore_evas_shutdown();
662 return -1;
663}
diff --git a/src/examples/evas/evas-vg-json.c b/src/examples/evas/evas-vg-json.c
index 248dcb1..cf0519f 100644
--- a/src/examples/evas/evas-vg-json.c
+++ b/src/examples/evas/evas-vg-json.c
@@ -35,10 +35,9 @@
35static Eo *gvg[5]; 35static Eo *gvg[5];
36 36
37static void 37static void
38running_cb(void *data EINA_UNUSED, const Efl_Event *event) 38_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
39{ 39{
40 Efl_Canvas_Animation_Player_Event_Running *event_running = event->info; 40 double progress = *((double*)event->info);
41 double progress = event_running->progress;
42 41
43 int i; 42 int i;
44 for (i = 0; i < 5; i++) 43 for (i = 0; i < 5; i++)
@@ -120,11 +119,8 @@ main(void)
120 //Play custom animation 119 //Play custom animation
121 Eo *anim = efl_add(EFL_CANVAS_ANIMATION_CLASS, evas); 120 Eo *anim = efl_add(EFL_CANVAS_ANIMATION_CLASS, evas);
122 efl_animation_duration_set(anim, efl_gfx_frame_controller_frame_duration_get(vg, 0, 0)); 121 efl_animation_duration_set(anim, efl_gfx_frame_controller_frame_duration_get(vg, 0, 0));
123 122 efl_event_callback_add(vg, EFL_CANVAS_OBJECT_ANIMATION_EVENT_ANIMATION_PROGRESS_UPDATED, _running_cb, NULL);
124 Eo *player = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, evas); 123 efl_canvas_object_animation_start(vg, anim, 1.0, 0.0);
125 efl_animation_player_animation_set(player, anim);
126 efl_event_callback_add(player, EFL_ANIMATION_PLAYER_EVENT_RUNNING, running_cb, NULL);
127 efl_player_playing_set(player, EINA_TRUE);
128 124
129 ecore_main_loop_begin(); 125 ecore_main_loop_begin();
130 ecore_evas_shutdown(); 126 ecore_evas_shutdown();
diff --git a/src/examples/evas/evas_cxx_rectangle.cc b/src/examples/evas/evas_cxx_rectangle.cc
index 7966d62..16b0a83 100644
--- a/src/examples/evas/evas_cxx_rectangle.cc
+++ b/src/examples/evas/evas_cxx_rectangle.cc
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0