summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-12-09 16:41:16 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-12-19 17:09:41 -0200
commit122cebb7125d44affb04e362dce3239e57bf094c (patch)
tree1d554bc37b8ca4b65fcf630b5b4e77abc9131d11
parenta9be1d488daf74d11181909fb6c454991272fe1e (diff)
efl-js: JavaScript Eolian bindingdevs/felipealmeida/js-20151219
To configure elementary sources with bindings to use in nodejs add ––with-js=nodejs in configure flags in EFL compilation to generate node files, then compile elementary normally: path/to/efl$ configure --with-js=nodejs path/to/efl$ make path/to/efl$ make install path/to/elm$ configure path/to/efl$ make path/to/efl$ make install To use, you have to require elm: elm = require('elm') The bindings is divided in two parts: generated and manually written. The generation uses the Eolian library for parsing Eo files and generate C++ code that is compiled against V8 interpreter library to create a elm.node file that can be required in a node.js instance. @feature
-rw-r--r--Makefile_Eolian_Cxx_Helper.am2
-rw-r--r--Makefile_Eolian_Js_Helper.am15
-rw-r--r--configure.ac78
-rw-r--r--doc/Doxyfile.in2
-rw-r--r--doc/examples-js.dox1022
-rw-r--r--m4/ac_define_if.m47
-rw-r--r--src/examples/Makefile.am8
-rw-r--r--src/examples/bg_example_01.js15
-rw-r--r--src/examples/bg_example_02.js19
-rw-r--r--src/examples/box_js_example_01.js34
-rw-r--r--src/examples/box_js_example_02.js86
-rw-r--r--src/examples/bubble_example_01.js54
-rw-r--r--src/examples/button_example_00.js21
-rw-r--r--src/examples/button_example_01.js208
-rw-r--r--src/examples/calendar_example_01.js14
-rw-r--r--src/examples/calendar_example_02.js17
-rw-r--r--src/examples/calendar_example_03.js15
-rw-r--r--src/examples/calendar_example_04.js32
-rw-r--r--src/examples/calendar_example_05.js29
-rw-r--r--src/examples/clock_example.js43
-rw-r--r--src/examples/datetime_example.js42
-rw-r--r--src/examples/icon_example_01.js33
-rw-r--r--src/examples/menu_example_01.js37
-rw-r--r--src/examples/popup_example_01.js32
-rw-r--r--src/examples/radio_example_01.js65
-rw-r--r--src/examples/separator_example_01.js41
-rw-r--r--src/examples/slider_example.js104
-rw-r--r--src/examples/spinner_example.js90
-rw-r--r--src/examples/table_example_01.js34
-rw-r--r--src/examples/table_example_02.js38
-rw-r--r--src/examples/thumb_example_01.js38
-rw-r--r--src/examples/twitter_example_01.edc89
-rw-r--r--src/examples/twitter_example_01.js82
-rw-r--r--src/lib/Makefile.am47
-rw-r--r--src/lib/elc_fileselector_entry.c2
-rw-r--r--src/lib/elc_multibuttonentry.c2
-rw-r--r--src/lib/elc_naviframe.c2
-rw-r--r--src/lib/elc_popup.c2
-rw-r--r--src/lib/elementary_js.cc288
-rw-r--r--src/lib/elm_actionslider.c2
-rw-r--r--src/lib/elm_actionslider.eo4
-rw-r--r--src/lib/elm_bubble.eo2
-rw-r--r--src/lib/elm_entry.c2
-rw-r--r--src/lib/elm_entry.eo4
-rw-r--r--src/lib/elm_fileselector.eo2
-rw-r--r--src/lib/elm_fileselector_entry.eo4
-rw-r--r--src/lib/elm_label.eo2
-rw-r--r--src/lib/elm_layout.c2
-rw-r--r--src/lib/elm_layout.eo24
-rw-r--r--src/lib/elm_multibuttonentry.eo4
-rw-r--r--src/lib/elm_naviframe.eo4
-rw-r--r--src/lib/elm_popup.eo4
52 files changed, 2803 insertions, 46 deletions
diff --git a/Makefile_Eolian_Cxx_Helper.am b/Makefile_Eolian_Cxx_Helper.am
index 8b792e012..bbae6f0c5 100644
--- a/Makefile_Eolian_Cxx_Helper.am
+++ b/Makefile_Eolian_Cxx_Helper.am
@@ -6,7 +6,7 @@ AM_V_EOLCXX = $(am__v_EOLCXX_@AM_V@)
6am__v_EOLCXX_ = $(am__v_EOLCXX_@AM_DEFAULT_V@) 6am__v_EOLCXX_ = $(am__v_EOLCXX_@AM_DEFAULT_V@)
7am__v_EOLCXX_0 = @echo " EOLCXX " $@; 7am__v_EOLCXX_0 = @echo " EOLCXX " $@;
8 8
9SUFFIXES += .eo.hh 9SUFFIXES += .eo.hh .eo.impl.hh
10 10
11%.eo.impl.hh %.eo.hh: %.eo $(_EOLIAN_CXX_DEP) 11%.eo.impl.hh %.eo.hh: %.eo $(_EOLIAN_CXX_DEP)
12 $(AM_V_EOLCXX) \ 12 $(AM_V_EOLCXX) \
diff --git a/Makefile_Eolian_Js_Helper.am b/Makefile_Eolian_Js_Helper.am
new file mode 100644
index 000000000..11c31347e
--- /dev/null
+++ b/Makefile_Eolian_Js_Helper.am
@@ -0,0 +1,15 @@
1
2if HAVE_JS
3EOLIAN_JS = @eolian_js@
4_EOLIAN_JS_DEP = @eolian_js@
5endif
6
7AM_V_EOLJS = $(am__v_EOLJS_@AM_V@)
8am__v_EOLJS_ = $(am__v_EOLJS_@AM_DEFAULT_V@)
9am__v_EOLJS_0 = @echo " EOLJS " $@;
10
11SUFFIXES += .eo.js.cc
12
13%.eo.js.cc: %.eo $(_EOLIAN_JS_DEP)
14 $(AM_V_EOLJS)$(EOLIAN_JS) $(EOLIAN_FLAGS) -o $@ $<
15
diff --git a/configure.ac b/configure.ac
index 1271665b8..c1856fa8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,12 @@ AC_ARG_ENABLE([cxx-bindings],
36 [want_cxx11="${enableval}"], 36 [want_cxx11="${enableval}"],
37 [want_cxx11="yes"]) 37 [want_cxx11="yes"])
38 38
39AC_ARG_ENABLE([js-bindings],
40 [AS_HELP_STRING([--enable-js-bindings],
41 [enable JS bindings. @<:@default=disabled@:>@])],
42 [want_js="${enableval}"],
43 [want_js="yes"])
44
39# Tests 45# Tests
40 46
41AC_ARG_WITH([tests], 47AC_ARG_WITH([tests],
@@ -196,6 +202,7 @@ EFL_WITH_BIN([eldbus], [eldbus_codegen], [eldbus-codegen])
196# Force the helper to try external eolian generators 202# Force the helper to try external eolian generators
197AM_CONDITIONAL([HAVE_EOLIAN_GEN], [true]) 203AM_CONDITIONAL([HAVE_EOLIAN_GEN], [true])
198AM_CONDITIONAL([HAVE_EOLIAN_CXX], [true]) 204AM_CONDITIONAL([HAVE_EOLIAN_CXX], [true])
205AM_CONDITIONAL([HAVE_EOLIAN_JS], [true])
199 206
200EFL_ENABLE_BIN([elementary-test]) 207EFL_ENABLE_BIN([elementary-test])
201EFL_ENABLE_BIN([elementary-codegen]) 208EFL_ENABLE_BIN([elementary-codegen])
@@ -256,13 +263,6 @@ ELM_CHECK_OPTION([eweather], [0.2.0])
256ELM_CHECK_OPTION([emap], [0.1.0]) 263ELM_CHECK_OPTION([emap], [0.1.0])
257ELM_CHECK_OPTION([eweb]) 264ELM_CHECK_OPTION([eweb])
258 265
259PKG_CHECK_MODULES([ELEMENTARY], [${requirement_elm_pc}])
260PKG_CHECK_MODULES([ELEMENTARY_PC], [${requirement_elm_pc_only}])
261
262EFL_ENABLE_EO_API_SUPPORT
263EFL_ENABLE_BETA_API_SUPPORT
264
265
266if test "x${HAVE_CXX11}" = "x1" -a "x${want_cxx11}" = "xyes"; then 266if test "x${HAVE_CXX11}" = "x1" -a "x${want_cxx11}" = "xyes"; then
267 PKG_CHECK_MODULES([ELEMENTARY_CXX], 267 PKG_CHECK_MODULES([ELEMENTARY_CXX],
268 [ 268 [
@@ -294,6 +294,67 @@ else
294fi 294fi
295AM_CONDITIONAL([HAVE_CXX11], [test "x${have_cxx11}" = "xyes"]) 295AM_CONDITIONAL([HAVE_CXX11], [test "x${have_cxx11}" = "xyes"])
296 296
297if test "x${want_js}" = "xyes"; then
298 PKG_CHECK_MODULES([ELEMENTARY_JS],
299 [
300 eolian-js >= efl_version
301 eo-js >= efl_version
302 efl-js >= efl_version
303 eina-js >= efl_version
304 efl-cxx >= efl_version
305 eo-cxx >= efl_version
306 eina-cxx >= efl_version
307 ],
308 [
309 requirement_elm_js_pc="${requirement_elm_js_pc} \
310 eolian-js >= efl_version \
311 eo-js >= efl_version \
312 efl-js >= efl_version \
313 eina-js >= efl_version \
314 efl-cxx >= efl_version \
315 eina-cxx >= efl_version \
316 eo-cxx >= efl_version \
317 "
318 have_js="yes"
319 dep_js=`$PKG_CONFIG --variable=want_js efl-js`
320 ],
321 [have_js="no"
322 dep_js="none"
323 ]
324 )
325else
326 have_js="no"
327 dep_js="none"
328fi
329
330PKG_CHECK_MODULES([ELEMENTARY], [${requirement_elm_pc}])
331if test "x${have_js}" = "xyes"; then
332 PKG_CHECK_MODULES([ELEMENTARY_JS], [${requirement_elm_js_pc}])
333fi
334PKG_CHECK_MODULES([ELEMENTARY_PC], [${requirement_elm_pc_only}])
335
336EFL_ENABLE_EO_API_SUPPORT
337EFL_ENABLE_BETA_API_SUPPORT
338
339AM_CONDITIONAL([HAVE_JS], [test "x${have_js}" = "xyes"])
340
341AM_CONDITIONAL([HAVE_NODEJS], [test "x${dep_js}" = "xnodejs"])
342AC_DEFINE_IF([HAVE_NODEJS], [test "x${dep_js}" = "xnodejs"],
343 [1], [Using NodeJS])
344AC_SUBST([want_js])
345AC_SUBST([HAVE_NODEJS])
346
347AM_CONDITIONAL([HAVE_JS], [test "x${dep_js}" = "xnodejs" -o "x${dep_js}" = "xlibv8" -o "x${dep_js}" = "xlibuv"])
348AC_DEFINE_IF([HAVE_JS], [test "x${dep_js}" = "xnodejs" -o "x${dep_js}" = "xlibv8" -o "x${dep_js}" = "xlibuv"],
349 [1], [Compiling bindings for JavaScript])
350AC_SUBST([HAVE_JS])
351
352AM_CONDITIONAL([HAVE_LIBUV], [test "x${dep_js}" = "xnodejs" -o "x${dep_js}" = "xlibuv"])
353AC_DEFINE_IF([HAVE_LIBUV], [test "x${dep_js}" = "xnodejs" -o "x${dep_js}" = "xlibuv"],
354 [1], [Compiling libuv event loop integration])
355AC_SUBST([HAVE_LIBUV])
356
357EFL_WITH_BIN([eolian-js], [eolian-js], [eolian_js])
297 358
298MODULE_EDJE=`${PKG_CONFIG} --variable=module_arch edje` 359MODULE_EDJE=`${PKG_CONFIG} --variable=module_arch edje`
299AC_SUBST([MODULE_EDJE]) 360AC_SUBST([MODULE_EDJE])
@@ -359,6 +420,7 @@ ELEMENTARY_LIBS="${ELEMENTARY_LIBS} ${requirement_elm_libs}"
359ELEMENTARY_PC_LIBS="${ELEMENTARY_PC_LIBS} ${requirement_elm_libs}" 420ELEMENTARY_PC_LIBS="${ELEMENTARY_PC_LIBS} ${requirement_elm_libs}"
360 421
361AC_SUBST([requirement_elm_pc]) 422AC_SUBST([requirement_elm_pc])
423AC_SUBST([requirement_elm_js_pc])
362 424
363# check unit testing library 425# check unit testing library
364if test "${want_tests}" = "yes"; then 426if test "${want_tests}" = "yes"; then
@@ -564,6 +626,7 @@ echo " elm_prefs_cc.............: ${elm_prefs_cc}"
564echo " eolian_gen...............: ${eolian_gen}" 626echo " eolian_gen...............: ${eolian_gen}"
565echo " eolian_cxx...............: ${eolian_cxx}" 627echo " eolian_cxx...............: ${eolian_cxx}"
566echo " eldbus_codegen...........: ${eldbus_codegen}" 628echo " eldbus_codegen...........: ${eldbus_codegen}"
629echo " eolian_js...............: ${eolian_js}"
567echo 630echo
568echo " Build elementary_test....: ${have_elementary_test}" 631echo " Build elementary_test....: ${have_elementary_test}"
569echo " Build elementary_codegen.: ${have_elementary_codegen}" 632echo " Build elementary_codegen.: ${have_elementary_codegen}"
@@ -573,6 +636,7 @@ echo " Examples installed.......: ${enable_install_examples}"
573echo " Build elementary_config..: ${have_elementary_config}" 636echo " Build elementary_config..: ${have_elementary_config}"
574echo " Enable debug.............: ${want_elementary_debug}" 637echo " Enable debug.............: ${want_elementary_debug}"
575echo " Enable C++...............: ${have_cxx11}" 638echo " Enable C++...............: ${have_cxx11}"
639echo " Enable JavaScript........: ${have_js}"
576echo 640echo
577echo "Compilation................: make (or gmake)" 641echo "Compilation................: make (or gmake)"
578echo " CPPFLAGS.................: $CPPFLAGS" 642echo " CPPFLAGS.................: $CPPFLAGS"
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 7c0e86a61..6ad06e39a 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -1,7 +1,7 @@
1PROJECT_NAME = Elementary 1PROJECT_NAME = Elementary
2PROJECT_NUMBER = @PACKAGE_VERSION@ 2PROJECT_NUMBER = @PACKAGE_VERSION@
3OUTPUT_DIRECTORY = . 3OUTPUT_DIRECTORY = .
4INPUT = @srcdir@/examples.dox @srcdir@/examples-cxx.dox @top_srcdir@/src/lib @srcdir@/index.doxy @top_srcdir@/src/bin/elm_prefs_cc_handlers.c 4INPUT = @srcdir@/examples.dox @srcdir@/examples-cxx.dox @srcdir@/examples-js.dox @top_srcdir@/src/lib @srcdir@/index.doxy @top_srcdir@/src/bin/elm_prefs_cc_handlers.c
5IMAGE_PATH = @srcdir@/img 5IMAGE_PATH = @srcdir@/img
6OUTPUT_LANGUAGE = English 6OUTPUT_LANGUAGE = English
7GENERATE_HTML = YES 7GENERATE_HTML = YES
diff --git a/doc/examples-js.dox b/doc/examples-js.dox
new file mode 100644
index 000000000..37f867a63
--- /dev/null
+++ b/doc/examples-js.dox
@@ -0,0 +1,1022 @@
1/**
2 * @page Examples-js Examples with Javascript Bindings.
3 *
4 * Here is a list of Elementary JS Examples.
5 *
6 * @ref bg_js_example_02
7 *
8 * @ref calendar_js_example_01
9 *
10 * @ref calendar_js_example_03
11 *
12 * @ref clock_js_example
13 *
14 * @ref datetime_js_example
15 *
16 * @ref icon_js_example_01
17 *
18 * @ref separator_js_example_01
19 *
20 */
21
22/**
23 * @page bg_js_example_02 elm.Bg - Image background using Javascript Binding
24 * @dontinclude bg_example_02.js
25
26 * This is the second background example and shows how to use the
27 * Elementary background object to set an image as background of your
28 * application.
29
30 * The first part consists of including the necessary modules and for
31 * this we'll use the Node.js require() function. In this example, we
32 * are working solely with elm module.
33
34 * @skipline require
35
36 * Next step is creating an Elementary window with Win_Standard
37 * without a parent, which is the type used for all of our
38 * examples. Here we also set the title that will appear at the top of
39 * our window and then the autohide state for it.
40
41 * The autohide works automatically handling "delete,request" signals
42 * when set to @p true, hidding the window, instead of destroying it.
43
44 * @skip win
45 * @until autohide_set
46
47 * Our background will have an image, that will be displayed over the
48 * background color.
49
50 * To do so, first we create the background that will display our
51 * image.
52
53 * @skipline bg
54
55 * Then, before loading this image, we set the load size of the
56 * image. The load size is a hint about the size that we want the
57 * image displayed in the screen. It's not the exact size that the
58 * image will have, but usually a bit bigger. The background object
59 * can still be scaled to a size bigger than the one set here. Setting
60 * the image load size to something smaller than its real size will
61 * reduce the memory used to keep the pixmap representation of the
62 * image, and the time to load it. Here we set the load size to 20x20
63 * pixels, but the image is loaded with a size bigger than that (since
64 * it's just a hint).
65
66 * @skipline load_size_set
67
68 * Now we load our image from it's directory, using file_set. Notice
69 * that the second argument of the file_set() function is @c null,
70 * since we are setting an image to this background. This function
71 * also supports setting an Eet file as background, in which case the
72 * @c key parameter wouldn't be @c null, but be the name of the Eet
73 * key instead.
74
75 * @skipline file
76
77 * To better understand, the function @c size_hint_weight_set for JS
78 * bindings originated from C bindings function
79 * evas_object_size_hint_weight_set, that is EFL Evas type function.
80 * With this function we set the hints for an object's weight. The
81 * parameters are:
82
83 * @li x - Double ranging from 0.0 to 1.0 use as horizontal hint.
84
85 * @li y - Double ranging from 0.0 to 1.0 use as vertical hint.
86
87 * This is not a size enforcement in any way, it's just a hint that
88 * should be used whenever appropriate. This is a hint on how a
89 * container object should resize a given child within its area.
90
91 * Containers may adhere to the simpler logic of just expanding the
92 * child object's dimensions to fit its own or the complete one of
93 * taking each child's weight hint as real weights to how much of its
94 * size to allocate for them in each axis. A container is supposed to,
95 * after normalizing the weights of its children (with weight hints),
96 * distribute the space it has to layout them by those factors – most
97 * weighted children get larger in this process than the least ones.
98
99 * @skipline weight_set
100
101 * @note Default weight hint values are 0.0, for both axis.
102
103 * Now we add the background as a resize_object to win informing that
104 * when the size of the win changes so should the background's
105 * size. And finally we make background visible.
106
107 * @skip win
108 * @until visible
109
110 * Now we only have to set the size for our window and make it
111 * visible.
112
113 * @skip size_set
114 * @until visible
115
116 * The full code for this example can be found at @ref
117 * bg_example_02.js .
118
119 * This example will look like this:
120
121 * @image html screenshots/bg_example_02.png
122 * @image latex screenshots/bg_example_02.eps width=\textwidth
123 * @example bg_example_02.js
124 */
125
126/**
127 * @page calendar_js_example_01 Calendar - Simple creation with Javascript Binding
128 * @dontinclude calendar_example_01.js
129
130 * As a first example, let's just display a calendar in our window,
131 * explaining all steps required to do so.
132
133 * The first part consists of including the necessary modules and for
134 * this we'll use the Node.js require() function. In this example, we
135 * are working solely with elm module.
136
137 * @skipline require
138
139 * Next step is creating an Elementary window with Win_Standard
140 * without a parent, which is the type used for all of our
141 * examples. Here we also set the title that will appear at the top of
142 * our window and then the autohide state for it.
143
144 * The autohide works automatically handling "delete,request" signals
145 * when set to @p true, hidding the window, instead of destroying it.
146
147 * @skip Win
148 * @until autohide_set
149
150 * Now, the exciting part, let's create the calendar with the JS
151 * binding method, passing our window object as parent.
152
153 * @skipline Calendar
154
155 * To better understand, the function @c size_hint_weight_set for JS
156 * bindings originated from C bindings function
157 * evas_object_size_hint_weight_set, that is EFL Evas type function.
158 * With this function we set the hints for an object's weight. The
159 * parameters are:
160
161 * @li x - Double ranging from 0.0 to 1.0 use as horizontal hint.
162
163 * @li y - Double ranging from 0.0 to 1.0 use as vertical hint.
164
165 * This is not a size enforcement in any way, it's just a hint that
166 * should be used whenever appropriate.
167
168 * This is a hint on how a container object should resize a given
169 * child within its area.
170
171 * Containers may adhere to the simpler logic of just expanding the
172 * child object's dimensions to fit its own or the complete one of
173 * taking each child's weight hint as real weights to how much of its
174 * size to allocate for them in each axis. A container is supposed to,
175 * after normalizing the weights of its children (with weight hints),
176 * distribute the space it has to layout them by those factors – most
177 * weighted children get larger in this process than the least ones.
178
179 * @skipline weight_set
180
181 * @note Default weight hint values are 0.0, for both axis.
182
183 * Now we add the calendar as a resize-object to win informing that
184 * when the size of the win changes so should the calendar's
185 * size. And finally we make our calendar and window visibles.
186
187 * @skip win
188 * @until win.visible
189
190 * Our example will look like this:
191
192 * @image html screenshots/calendar_example_01.png
193
194 * @image latex screenshots/calendar_example_01.eps width=\textwidth
195
196 * See the full source code @ref calendar_example_01.js here.
197
198 * @example calendar_example_01.js
199 */
200
201/**
202 * @page calendar_js_example_03 Calendar - Years restrictions with Javascript Binding
203 * @dontinclude calendar_example_03.js
204
205 * This example explains how to set max and min year to be displayed
206 * by a calendar object. This means that user won't be able to see or
207 * select a date before and after selected years. By default, limits
208 * are 1902 and maximum value will depends on platform architecture
209 * (year 2037 for 32 bits); You can read more about time functions on
210 * @c ctime manpage.
211
212 * Next step is creating an Elementary window with Win_Standard
213 * without a parent, which is the type used for all of our
214 * examples. Here we also set the title that will appear at the top of
215 * our window and then the autohide state for it.
216
217 * The autohide works automatically handling "delete,request" signals
218 * when set to @p true, hidding the window, instead of destroying it.
219
220 * @skip win
221 * @until autohide_set
222
223 * Now let's create the calendar with the JS binding method, passing
224 * our window object as parent.
225
226 * @skipline Calendar
227
228 * To better understand, the function @c size_hint_weight_set for JS
229 * bindings originated from C bindings function
230 * evas_object_size_hint_weight_set, that is EFL Evas type function.
231 * With this function we set the hints for an object's weight. The
232 * parameters are:
233
234 * @li x - Double ranging from 0.0 to 1.0 use as horizontal hint.
235
236 * @li y - Double ranging from 0.0 to 1.0 use as vertical hint.
237
238 * This is not a size enforcement in any way, it's just a hint that
239 * should be used whenever appropriate.
240
241 * This is a hint on how a container object should resize a given
242 * child within its area.
243
244 * Containers may adhere to the simpler logic of just expanding the
245 * child object's dimensions to fit its own or the complete one of
246 * taking each child's weight hint as real weights to how much of its
247 * size to allocate for them in each axis. A container is supposed to,
248 * after normalizing the weights of its children (with weight hints),
249 * distribute the space it has to layout them by those factors – most
250 * weighted children get larger in this process than the least ones.
251
252 * @skipline weight_set
253
254 * @note Default weight hint values are 0.0, for both axis.
255
256 * Now we add the calendar as a resize-object to win informing that
257 * when the size of the win changes so should the calendar's
258 * size.
259
260 * @skipline win
261
262 * Straigh to the point, to set the limits for years you need only to
263 * call min_max_year_set(). First value is minimum year, second is
264 * maximum. If first value is negative, it won't apply limit for min
265 * year, if the second one is negative, won't apply for max year.
266 * Setting both to negative value will clear limits (default state):
267
268 * @skipline min_max_year_set
269
270 * Finally we just have to make calendar and window visible.
271
272 * @skip cal.visible
273 * @until win.visible
274
275 * Our example will look like this:
276
277 * @image html screenshots/calendar_example_03.png
278 * @image latex screenshots/calendar_example_03.eps width=\textwidth
279
280 * See the full source code @ref calendar_example_03.js here.
281
282 * @example calendar_example_03.js
283 */
284
285/**
286 * @page datetime_js_example Datetime Example with Javascript Binding
287 * @dontinclude datetime_example.js
288
289 * This example places three Elementary Datetime widgets on a window,
290 * each of them exemplifying the widget's different usage.
291
292 * The first part consists of including the necessary modules and for
293 * this we'll use the Node.js require() function. In this example, we
294 * are working with elm and efl modules.
295
296 * @skip efl
297 * @until elm
298
299 * Next step is creating an Elementary window with Win_Standard
300 * without a parent, which is the type used for all of our
301 * examples. Here we also set the title that will appear at the top of
302 * our window and then the autohide state for it.
303
304 * The autohide works automatically handling "delete,request" signals
305 * when set to @p true, hidding the window, instead of destroying it.
306
307 * @skip Win
308 * @until autohide_set
309
310 * Now we construct the elm background and for this we use the JS
311 * method below, setting win as it's parent.
312
313 * @skipline elm.Bg
314
315 * To better understand, the function @c size_hint_weight_set for JS
316 * bindings originated from C bindings function
317 * evas_object_size_hint_weight_set, that is EFL Evas type function.
318 * With this function we set the hints for an object's weight. The
319 * parameters are:
320
321 * @li x - Double ranging from 0.0 to 1.0 use as horizontal hint.
322
323 * @li y - Double ranging from 0.0 to 1.0 use as vertical hint.
324
325 * This is not a size enforcement in any way, it's just a hint that
326 * should be used whenever appropriate. This is a hint on how a
327 * container object should resize a given child within its area.
328
329 * Containers may adhere to the simpler logic of just expanding the
330 * child object's dimensions to fit its own or the complete one of
331 * taking each child's weight hint as real weights to how much of its
332 * size to allocate for them in each axis. A container is supposed to,
333 * after normalizing the weights of its children (with weight hints),
334 * distribute the space it has to layout them by those factors – most
335 * weighted children get larger in this process than the least ones.
336
337 * @skipline weight_set
338
339 * @note Default weight hint values are 0.0, for both axis.
340
341 * Now we add the background as a resize_object to win informing that
342 * when the size of the win changes so should the background's
343 * size. And finally we make it visible.
344
345 * @skip win
346 * @until visible
347
348 * @remarks If a color it's not setted the default color will be used.
349
350 * A box arranges objects in a linear fashion, governed by a layout
351 * function that defines the details of this arrangement. The box will
352 * use an internal function to set the layout to a single row,
353 * vertical by default.
354
355 * Now let's create the box with the JS binding method, passing our
356 * window object as parent. Using Evas weight_set function again to
357 * hint on how a container object should resize a given child within
358 * its area.
359
360 * @skipline elm.Box
361 * @until weight_set
362
363 * Then we add the box as a resize-object to win informing that when
364 * the size of the win changes so should the box's size. Remember
365 * always to set the box visibility to true.
366
367 * @skip win
368 * @until visible
369
370 * The first of them is <b>"only Date display"</b>. We will create it
371 * using the JS method below. The weight hint works with datetime the
372 * same as it did with background and box.
373
374 * @skip datetime
375 * @until weight
376
377 * Now we have to The function @c size_hint_align_set for JS bindings
378 * originated from C bindings function
379 * evas_object_size_hint_align_set, that is EFL Evas type
380 * function. With this function we set the hints for an object's
381 * alignment. The parameters are:
382
383 * @li x - Double ranging from 0.0 to 1.0 use as horizontal alignment
384 * hint.
385
386 * @li y - Double ranging from 0.0 to 1.0 use as vertical alignment
387 * hint.
388
389 * These are hints on how to align an object inside the boundaries of
390 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
391 * used to specify "justify" or "fill" by some users. In this case,
392 * maximum size hints should be enforced with higher priority, if they
393 * are set. Also, any padding hint set on objects should add up to the
394 * alignment space on the final scene composition.
395
396 * For the horizontal component, 0.0 means to the left, 1.0 means to
397 * the right. Analogously, for the vertical component, 0.0 to the top,
398 * 1.0 means to the bottom. This is not a size enforcement in any way,
399 * it's just a hint that should be used whenever appropriate.
400
401 * @skipline align
402
403 * @note Default alignment hint values are 0.5, for both axis.
404
405 * An important feature for the datetime is the setting of what we
406 * want it to display. We can achieve that by using:
407
408 * @p field_visible_set (elm.Elm_Datetime_Field_Type.fieldtype_, visible_)
409
410 * Parameters are:
411
412 * @li @p fieldtype_: type of the field, supports 6 fields:
413
414 * @p year: Indicates Year field.
415
416 * @p month: Indicates Month field.
417
418 * @p date: Indicates Date field.
419
420 * @p hour: Indicates Hour field,
421
422 * @p minute: Indicates Minute field.
423
424 * @p ampm: Indicates AM/PM field.
425
426 * @li @p visible_: @p true field can be visible, @p false otherwise.
427
428 * @attention Setting this API True does not ensure that the field is
429 * visible, apart from this, the field's format must be present in
430 * Datetime overall format. If a field's visibility is set to False
431 * then it won't appear even though its format is present in overall
432 * format. So if and only if this API is set true and the
433 * corresponding field's format is present in Datetime format, the
434 * field is visible.
435
436 * @note By default the field visibility is set to @p true.
437
438 * For this first datetime we are setting the hour, minute and am/pm
439 * to not be visible, doing this we'll display in our datetime the
440 * year, month and date.
441
442 * @note Hour format 12hr(1-12) or 24hr(0-23) display can be selected
443 * by setting the corresponding user format. The corresponding Month
444 * and AM/PM strings are displayed according to the system’s language
445 * settings.
446
447 * @skip hour
448 * @until ampm
449
450 * When using the elm box the packing method of the subobj - datetime
451 * in this case - should be defined. There are four possible methods:
452
453 * @li @c pack_start(subobj_) - Add an object to the beginning of the
454 * pack list. Pack @c subobj_ into the box obj, placing it first in
455 * the list of children objects. The actual position the object will
456 * get on screen depends on the layout used. If no custom layout is
457 * set, it will be at the top or left, depending if the box is
458 * vertical or horizontal, respectively.
459
460 * @li @c pack_end(subobj_) - Add an object at the end of the pack
461 * list. Pack @c subobj_ into the box obj, placing it last in the list
462 * of children objects. The actual position the object will get on
463 * screen depends on the layout used. If no custom layout is set, it
464 * will be at the bottom or right, depending if the box is vertical or
465 * horizontal, respectively.
466
467 * @li @c pack_before(subobj_, before_) - Adds an object to the box
468 * before the indicated object. This will add the @c subobj_ to the
469 * box indicated before the object indicated with @c before_. If
470 * before is not already in the box, results are undefined. Before
471 * means either to the left of the indicated object or above it
472 * depending on orientation.
473
474 * @li @c pack_after(subobj_, after_) - Adds an object to the box
475 * after the indicated object. This will add the @c subobj_ to the box
476 * indicated after the object indicated with @c after_. If after is
477 * not already in the box, results are undefined. After means either
478 * to the right of the indicated object or below it depending on
479 * orientation.
480
481 * In this and most examples we use pack_end by choice and
482 * practicality. In this part of the code we also make datetime
483 * visible.
484
485 * @skip pack_end
486 * @until visible
487
488 * For our second datetime, we'll also set the size hints weight and
489 * align, but in this case, the fields year, month and date will be not
490 * visible, and thus displaying in our datetime the hour, minute and
491 * AM/PM. Finally we choose it's packing method and set the visibility
492 * of datetime to @p true.
493
494 * @skip datetime
495 * @until visible
496
497 * For our third and last datetime, we setted the weight and align as
498 * before, chose our packing method and made it visible. Note that in
499 * this case we didn't exclude any type of field leaving all
500 * visible. Beeing this datetime the last one, here we'll also set win
501 * to be visible.
502
503 * @skip datetime
504 * @until win.visible
505
506 * See the full @ref datetime_example.js .
507
508 * This example should look like:
509
510 * @image html screenshots/datetime_example.png
511 * @image latex screenshots/datetime_example.eps width=\textwidth
512
513 * @example datetime_example.js
514 */
515
516/**
517 * @page clock_js_example Clock widget example with Javascript Binding.
518 * @dontinclude clock_example.js
519
520 * This code places five Elementary clock widgets on a window, each of
521 * them exemplifying a part of the widget's API. Before explaining
522 * each clock to be more didatical let's start with the basics.
523
524 * The first part consists of including the necessary modules and for
525 * this we'll use the Node.js require() function. In this example, we
526 * are working with elm and efl modules.
527
528 * @skip efl
529 * @until elm
530
531 * Next step is creating an Elementary window with Win_Standard
532 * without a parent, which is the type used for all of our
533 * examples. Here we also set the title that will appear at the top of
534 * our window and then the autohide state for it.
535
536 * The autohide works automatically handling "delete,request" signals
537 * when set to @p true, hidding the window, instead of destroying it.
538
539 * @skip Win
540 * @until autohide_set
541
542 * A box arranges objects in a linear fashion, governed by a layout
543 * function that defines the details of this arrangement. The box will
544 * use an internal function to set the layout to a single row,
545 * vertical by default.
546
547 * Now let's create the box with the JS binding method, passing our
548 * window object as parent.
549
550 * @skipline elm.Box
551
552 * To better understand, the function @c size_hint_weight_set for JS
553 * bindings originated from C bindings function
554 * evas_object_size_hint_weight_set, that is EFL Evas type function.
555 * With this function we set the hints for an object's weight. The
556 * parameters are:
557
558 * @li x - Double ranging from 0.0 to 1.0 use as horizontal hint.
559
560 * @li y - Double ranging from 0.0 to 1.0 use as vertical hint.
561
562 * This is not a size enforcement in any way, it's just a hint that
563 * should be used whenever appropriate. This is a hint on how a
564 * container object should resize a given child within its area.
565
566 * Containers may adhere to the simpler logic of just expanding the
567 * child object's dimensions to fit its own or the complete one of
568 * taking each child's weight hint as real weights to how much of its
569 * size to allocate for them in each axis. A container is supposed to,
570 * after normalizing the weights of its children (with weight hints),
571 * distribute the space it has to layout them by those factors – most
572 * weighted children get larger in this process than the least ones.
573
574 * @skipline weight_set
575
576 * @note Default weight hint values are 0.0, for both axis.
577
578 * Then we add the box as a resize-object to win informing that when
579 * the size of the win changes so should the box's size. Remember
580 * always to set the box visibility to true.
581
582 * @skip win
583 * @until visible
584
585 * We create each clock with the JS binding method, passing our
586 * window object as parent. The first of them is the pristine clock,
587 * using the defaults for a clock, which are military time with no
588 * seconds shown.
589
590 * @skipline Clock
591
592 * When using the elm.Box the packing method of the subobj - clock
593 * in this case - should be defined. There are four possible methods:
594
595 * @li @c pack_start(subobj_) - Add an object to the beginning of the
596 * pack list. Pack @c subobj_ into the box obj, placing it first in
597 * the list of children objects. The actual position the object will
598 * get on screen depends on the layout used. If no custom layout is
599 * set, it will be at the top or left, depending if the box is
600 * vertical or horizontal, respectively.
601
602 * @li @c pack_end(subobj_) - Add an object at the end of the pack
603 * list. Pack @c subobj_ into the box obj, placing it last in the list
604 * of children objects. The actual position the object will get on
605 * screen depends on the layout used. If no custom layout is set, it
606 * will be at the bottom or right, depending if the box is vertical or
607 * horizontal, respectively.
608
609 * @li @c pack_before(subobj_, before_) - Adds an object to the box
610 * before the indicated object. This will add the @c subobj_ to the
611 * box indicated before the object indicated with @c before_. If
612 * before is not already in the box, results are undefined. Before
613 * means either to the left of the indicated object or above it
614 * depending on orientation.
615
616 * @li @c pack_after(subobj_, after_) - Adds an object to the box
617 * after the indicated object. This will add the @c subobj_ to the box
618 * indicated after the object indicated with @c after_. If after is
619 * not already in the box, results are undefined. After means either
620 * to the right of the indicated object or below it depending on
621 * orientation.
622
623 * In this and most examples we use pack_end by choice and
624 * practicality. In this part of the code we also make clock
625 * visible.
626
627 * @skip pack_end
628 * @until visible
629
630 * The second clock shows ther am/pm time, that we also create with
631 * the JS binding method, passing our window object as
632 * parent. Setting show_am_pm to true and again choosing the packing
633 * method and making clock visible.
634
635 * @skip Clock
636 * @until visible
637
638 * The third one will show the seconds digits, which will flip in
639 * synchrony with system time. Note, besides, that the time itself is
640 * @b different from the system's -- it was customly set with
641 * time_set():
642
643 * @skip ck3
644 * @until visible
645
646 * In both fourth and fifth ones, we turn on the <b>edition
647 * mode</b>. See how you can change each of the sheets on it, and be
648 * sure to try holding the mouse pressed over one of the sheet
649 * arrows. The forth one also starts with a custom time set:
650
651 * @skip ck4
652 * @until visible
653
654 * The fifth, besides editable, it has only the time @b units
655 * editable, for hours, minutes and seconds. For this we used
656 * edit_mode_set with the parameter digedit that sets indentifiers for
657 * which clock digits should be editable, when a clock widget is in
658 * edition mode. Values may be OR-ed together to make a mask,
659 * naturally.
660
661 * Possible values for digedit:
662
663 * @li @p default: Default value. Means that all digits are
664 * editable, when in edition mode.
665
666 * @li @p hour_decimal: Decimal digit of hours value should
667 * be editable;
668
669 * @li @p hour_unit: Unit digit of hours value should be
670 * editable;
671
672 * @li @p min_decimal: Decimal digit of minutes value should
673 * be editable;
674
675 * @li @p min_unit: Unit digit of minutes value should be
676 * editable;
677
678 * @li @p sec_decimal: Decimal digit of seconds value should
679 * be editable;
680
681 * @li @p sec_unit: Unit digit of seconds value should be
682 * editable;
683
684 * @li @p all: All digits should be editable;
685
686 * Finishing this example we should set win to be visible.
687
688 * @skip ck5
689 * @until win.visible
690
691 * See the full @ref clock_example.js, whose window should look
692 * like this picture:
693
694 * @image html screenshots/clock_example.png
695 * @image latex screenshots/clock_example.eps width=\textwidth
696 * @example clock_example.js
697 */
698
699/**
700 * @page separator_js_example_01 Separator with Javascript Binding
701 * @dontinclude separator_example_01.js
702
703 * Separator is a very thin object used to separate other objects,
704 * wich can be vertical or horizontal.
705
706 * This example shows how to create a window and separate in two
707 * parts, each one will be filled with a background color to show the
708 * division. The @a separator is used to visually mark the division
709 * between two parts.
710
711 * The first part consists of including the necessary modules and for
712 * this we'll use the Node.js require() function. In this example, we
713 * are working with elm and efl modules.
714
715 * @skip efl
716 * @until elm
717
718 * Next step is creating an Elementary window with Win_Standard
719 * without a parent, which is the type used for all of our
720 * examples. Here we also set the title that will appear at the top of
721 * our window and then the autohide state for it.
722
723 * The autohide works automatically handling "delete,request" signals
724 * when set to @p true, hidding the window, instead of destroying it.
725
726 * @skip win
727 * @until autohide_set
728
729 * Now let's create the background with the JS binding method, passing
730 * our window as parent.
731
732 * @skipline bg
733
734 * To better understand, the function @c size_hint_weight_set for JS
735 * bindings originated from C bindings function
736 * evas_object_size_hint_weight_set, that is EFL Evas type function.
737 * With this function we set the hints for an object's weight. The
738 * parameters are:
739
740 * @li x - Double ranging from 0.0 to 1.0 use as horizontal hint.
741
742 * @li y - Double ranging from 0.0 to 1.0 use as vertical hint.
743
744 * This is not a size enforcement in any way, it's just a hint that
745 * should be used whenever appropriate. This is a hint on how a
746 * container object should resize a given child within its area.
747
748 * Containers may adhere to the simpler logic of just expanding the
749 * child object's dimensions to fit its own or the complete one of
750 * taking each child's weight hint as real weights to how much of its
751 * size to allocate for them in each axis. A container is supposed to,
752 * after normalizing the weights of its children (with weight hints),
753 * distribute the space it has to layout them by those factors – most
754 * weighted children get larger in this process than the least ones.
755
756 * @skipline weight_set
757
758 * @note Default weight hint values are 0.0, for both axis.
759
760 * Now we add the background as a resize-object to win informing that
761 * when the size of the win changes so should the background's size
762 * and setting it's visibility. You can change the background's color
763 * using color_set, if not, the default color will be used.
764
765 * @skip win
766 * @until visible
767
768 * To put a box in the window we also need to set it's parent. By
769 * default, box object arranges their contents vertically from top to
770 * bottom. By calling this function with horizontal as @a true, the
771 * box will become horizontal, arranging contents from left to right.
772
773 * @skip bx
774 * @until horizontal
775
776 * The value that we set EFL Evas function size_hint_weight_set
777 * expands the box to cover all win's area and adding it as a
778 * resize_object to win informing that when the size of the win
779 * changes so should the box's size. In the end we make the box
780 * visible.
781
782 * @skip weight
783 * @until visible
784
785 * Now we create a retangle, like before, we just need to setting it's
786 * parent. After created, we set the color to show the difference
787 * between the next rectangle and define the minimun size of each side
788 * by using size_hint_min_set(minimum width, minimum height).
789
790 * @skip rect
791 * @until min_set
792
793 * As in the background, the value we set EFL Evas function
794 * size_hint_weight_set expands the background to cover all area
795 * defined in size_hint_min_set. We also need to expand the rectangle
796 * to fill the area if the win's size change, if not, win can change
797 * it's size and the rectangle will only fill it's own previous area.
798
799 * @until weight
800
801 * Now we have to The function @c size_hint_align_set for JS bindings
802 * originated from C bindings function
803 * evas_object_size_hint_align_set, that is EFL Evas type
804 * function. With this function we set the hints for an object's
805 * alignment. The parameters are:
806
807 * @li x - Double ranging from 0.0 to 1.0 use as horizontal alignment
808 * hint.
809
810 * @li y - Double ranging from 0.0 to 1.0 use as vertical alignment
811 * hint.
812
813 * These are hints on how to align an object inside the boundaries of
814 * a container/manager. Accepted values are in the 0.0 to 1.0 range,
815 * used to specify "justify" or "fill" by some users. In this case,
816 * maximum size hints should be enforced with higher priority, if they
817 * are set. Also, any padding hint set on objects should add up to the
818 * alignment space on the final scene composition.
819
820 * For the horizontal component, 0.0 means to the left, 1.0 means to
821 * the right. Analogously, for the vertical component, 0.0 to the top,
822 * 1.0 means to the bottom. This is not a size enforcement in any way,
823 * it's just a hint that should be used whenever appropriate.
824
825 * @skipline align
826
827 * @note Default alignment hint values are 0.5, for both axis.
828
829 * Now we only need to set the visibility of the rectangle and add our
830 * retangle to box with the packing method of the subobj - rectangle
831 * in this case. There are four possible methods:
832
833 * @li @c pack_start(subobj_) - Add an object to the beginning of the
834 * pack list. Pack @c subobj_ into the box obj, placing it first in
835 * the list of children objects. The actual position the object will
836 * get on screen depends on the layout used. If no custom layout is
837 * set, it will be at the top or left, depending if the box is
838 * vertical or horizontal, respectively.
839
840 * @li @c pack_end(subobj_) - Add an object at the end of the pack
841 * list. Pack @c subobj_ into the box obj, placing it last in the list
842 * of children objects. The actual position the object will get on
843 * screen depends on the layout used. If no custom layout is set, it
844 * will be at the bottom or right, depending if the box is vertical or
845 * horizontal, respectively.
846
847 * @li @c pack_before(subobj_, before_) - Adds an object to the box
848 * before the indicated object. This will add the @c subobj_ to the
849 * box indicated before the object indicated with @c before_. If
850 * before is not already in the box, results are undefined. Before
851 * means either to the left of the indicated object or above it
852 * depending on orientation.
853
854 * @li @c pack_after(subobj_, after_) - Adds an object to the box
855 * after the indicated object. This will add the @c subobj_ to the box
856 * indicated after the object indicated with @c after_. If after is
857 * not already in the box, results are undefined. After means either
858 * to the right of the indicated object or below it depending on
859 * orientation.
860
861 * In this and most examples we use pack_end by choice and
862 * practicality.
863
864 * @skip visible
865 * @until pack
866
867 * Once we have our first rectangle in the box we create and add our
868 * separator. Using the same approach, we setting it's parent. Since
869 * our box is in horizontal mode it's a good idea to set the separator
870 * to be horizontal too. Finishing with the visibility and packing
871 * method.
872
873 * @skip separator
874 * @until pack
875
876 * After all this, we just need to create another rectangle, setting
877 * the color, size hints, make rect2 visible and packing in the
878 * box. Don't forget to set the win's visibility as @p true.
879
880 * @skip rect2
881 * @until win.visible
882
883 * The full code for this example can be found at @ref separator_example_01.js .
884
885 * This example will look like:
886
887 * @image html screenshots/separator_example_01.png
888 * @image latex screenshots/separator_example_01.eps width=\textwidth
889
890 * @example separator_example_01.js
891 */
892
893
894/**
895 * @page icon_js_example_01 Icon Example with Javascript Binding
896 * @dontinclude icon_example_01.js
897
898 * This example is as simple as possible. An icon object will be added
899 * to the window over a blank background, and set to be resizable
900 * together with the window. All the options set through the example
901 * will affect the behavior of this icon.
902
903 * The first part consists of including the necessary modules and for
904 * this we'll use the Node.js require() function. In this example, we
905 * are working with elm and efl modules.
906
907 * @skip efl
908 * @until elm
909
910 * Next step is creating an Elementary window with Win_Standard
911 * without a parent, which is the type used for all of our
912 * examples. Here we also set the title that will appear at the top of
913 * our window and then the autohide state for it.
914
915 * The autohide works automatically handling "delete,request" signals
916 * when set to @p true, hidding the window, instead of destroying it.
917
918 * @skip win
919 * @until autohide_set
920
921 * Now we construct the elm icon and for this we use the JS method
922 * below, setting it's parent. An icon object is used to display
923 * standard icon images ("delete", "edit", "arrows", etc.) or images
924 * coming from a custom file (PNG, JPG, EDJE, etc.), on icon contexts.
925
926 * @skipline icon
927
928 * Now we can set the standard "home" icon, chosen for this example.
929
930 * @skipline standard
931
932 * An interesting thing is that after setting this, it's possible to
933 * check where in the filesystem is the theme used by this icon, and
934 * the name of the group used, using file_get. Note that when a
935 * function get returns two parameters, they are therefore stored in a
936 * array, following the same order as the function.
937
938 * @skip path
939 * @until console
940
941 * We can also get the name of the standard icon that we setted
942 * before.
943
944 * @skip name
945 * @until console
946
947 * We can now go setting our options.
948
949 * no_scale_set() is used just to set this value to true as we don't
950 * actually want to scale our icon, just resize it.
951
952 * resizable_set() is used to allow the icon to be resized to a size
953 * smaller than the original one, but not to a size bigger than it.
954
955 * smooth_set() will disable the smooth scaling, so the scale
956 * algorithm used to scale the icon to the new object size is going to
957 * be faster, but with a lower quality.
958
959 * fill_outside_set() is used to ensure that the icon will fill the
960 * entire area available to it, even if keeping the aspect ratio. The
961 * icon will overflow its width or height (any of them that is
962 * necessary) to the object area, instead of resizing the icon down
963 * until it can fit entirely in this area.
964
965 * This is the code for setting these options:
966
967 * @until fill_outside
968
969 * However, if you try this example you may notice that this image is
970 * not being affected by all of these options. This happens because
971 * the used icon will be from elementary theme, and thus it has its
972 * own set of options like smooth scaling and fill_outside
973 * options. You can change the "home" icon to use some image (from
974 * your system) and see that then those options will be respected.
975
976 * To better understand, the function @c size_hint_weight_set for JS
977 * bindings originated from C bindings function
978 * evas_object_size_hint_weight_set, that is EFL Evas type function.
979 * With this function we set the hints for an object's weight. The
980 * parameters are:
981
982 * @li x - Double ranging from 0.0 to 1.0 use as horizontal hint.
983
984 * @li y - Double ranging from 0.0 to 1.0 use as vertical hint.
985
986 * This is not a size enforcement in any way, it's just a hint that
987 * should be used whenever appropriate. This is a hint on how a
988 * container object should resize a given child within its area.
989
990 * Containers may adhere to the simpler logic of just expanding the
991 * child object's dimensions to fit its own or the complete one of
992 * taking each child's weight hint as real weights to how much of its
993 * size to allocate for them in each axis. A container is supposed to,
994 * after normalizing the weights of its children (with weight hints),
995 * distribute the space it has to layout them by those factors – most
996 * weighted children get larger in this process than the least ones.
997
998 * @skipline weight_set
999
1000 * @note Default weight hint values are 0.0, for both axis.
1001
1002 * Now we add the icon as a resize_object to win informing that
1003 * when the size of the win changes so should the icon's
1004 * size. And finally we make icon visible.
1005
1006 * @skip resize
1007 * @until visible
1008
1009 * Now we set the size for the window, making it visible in the end:
1010
1011 * @skip size_set
1012 * @until visible
1013
1014 * The full code for this example can be found at @ref icon_example_01.js
1015
1016 * This example will look like this:
1017
1018 * @image html screenshots/icon_example_01.png
1019 * @image latex screenshots/icon_example_01.eps width=\textwidth
1020
1021 * @example icon_example_01.js
1022 */ \ No newline at end of file
diff --git a/m4/ac_define_if.m4 b/m4/ac_define_if.m4
new file mode 100644
index 000000000..961ca6445
--- /dev/null
+++ b/m4/ac_define_if.m4
@@ -0,0 +1,7 @@
1dnl use: AC_DEFINE_IF(id, testcond, val, comment)
2AC_DEFUN([AC_DEFINE_IF],
3[
4if $2; then
5 AC_DEFINE($1, $3, $4)
6fi
7])
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index dc18ec719..112dbeb0e 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -145,7 +145,8 @@ evas3d_scene_on_button_example.c \
145evas3d_object_on_button_example.c \ 145evas3d_object_on_button_example.c \
146evas3d_map_example.edc \ 146evas3d_map_example.edc \
147evas3d_map_example.c \ 147evas3d_map_example.c \
148track_example_01.c 148track_example_01.c \
149twitter_example_01.edc
149 150
150if HAVE_CXX11 151if HAVE_CXX11
151SRCS += \ 152SRCS += \
@@ -197,7 +198,8 @@ files_DATA += \
197 theme_example.edj \ 198 theme_example.edj \
198 layout_example.edj\ 199 layout_example.edj\
199 codegen_example.edj \ 200 codegen_example.edj \
200 evas3d_map_example.edj 201 evas3d_map_example.edj \
202 twitter_example_01.edj
201 203
202clean-local: 204clean-local:
203 rm -f *.edj *.epb *.cfg *.cfg.bkp 205 rm -f *.edj *.epb *.cfg *.cfg.bkp
@@ -528,4 +530,4 @@ screenshots:
528 530
529endif 531endif
530 532
531EXTRA_DIST = dict.txt layout_example.edc theme_example.edc codegen_example.edc evas3d_map_example.edc 533EXTRA_DIST = dict.txt layout_example.edc theme_example.edc codegen_example.edc evas3d_map_example.edc twitter_example_01.edc
diff --git a/src/examples/bg_example_01.js b/src/examples/bg_example_01.js
new file mode 100644
index 000000000..227259b63
--- /dev/null
+++ b/src/examples/bg_example_01.js
@@ -0,0 +1,15 @@
1
2var elm = require('elm')
3
4win = new elm.Elm.WinStandard(null);
5win.setTitle("Bg Plain");
6win.setAutohide(true);
7
8bg = new elm.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bg);
11bg.setVisible(true);
12
13win.setSize(320,320);
14win.setVisible(true);
15
diff --git a/src/examples/bg_example_02.js b/src/examples/bg_example_02.js
new file mode 100644
index 000000000..e8e1a63e0
--- /dev/null
+++ b/src/examples/bg_example_02.js
@@ -0,0 +1,19 @@
1
2elm = require('elm');
3
4win = new elm.Elm.WinStandard(null);
5win.setTitle("Bg Image");
6win.setAutohide(true);
7
8bg = new elm.Elm.Bg(win);
9bg.setLoadSize(20,20);
10bg.setOption(elm.Elm.Bg.Option.CENTER);
11
12//TODO: elm_app_data_dir_get
13bg.setFile('../../data/images/plant_01.jpg', null);
14bg.setSizeHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bg);
16bg.setVisible(true);
17
18win.setSize(320, 320);
19win.setVisible(true);
diff --git a/src/examples/box_js_example_01.js b/src/examples/box_js_example_01.js
new file mode 100644
index 000000000..ba7761da5
--- /dev/null
+++ b/src/examples/box_js_example_01.js
@@ -0,0 +1,34 @@
1
2var elm = require('elm')
3
4win = new elm.Elm.WinStandard(null);
5win.setTitle('title');
6win.setAutohide(true);
7
8bg = new elm.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bg);
11bg.setVisible(true);
12
13bx = new elm.Elm.Box(win);
14bx.setSizeHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bx);
16
17entry = new elm.Elm.Label(win);
18entry.setSize(100, 100);
19entry.setText(null, "Texto");
20
21console.log('Texto: ', entry.getText(null));
22
23entry.setSizeHintWeight(1.0, 1.0);
24entry.setSizeHintAlign(-1.0, -1.0);
25entry.setWrapWidth(50);
26bx.packEnd(entry);
27entry.setVisible(true);
28
29bx.setVisible(true);
30
31win.setSize(300, 320);
32win.setVisible(true);
33
34console.log("Going to wait now\n");
diff --git a/src/examples/box_js_example_02.js b/src/examples/box_js_example_02.js
new file mode 100644
index 000000000..6e76bd11a
--- /dev/null
+++ b/src/examples/box_js_example_02.js
@@ -0,0 +1,86 @@
1
2var efl = require('efl')
3var elm = require('elm')
4
5_add_cb = function(){
6 var btn = new elm.Elm.Button(win);
7 btn.setText("elm.text", "I do nothing");
8 bx.packEnd(btn);
9 btn.setVisible(true);
10}
11
12_clear_cb = function(){
13 bx.clear();
14}
15
16_unpack_cb = function(btn){
17 bx.unpack(btn);
18 btn.setColor(128, 64, 0, 128)
19}
20
21win = new elm.Elm.WinStandard(null);
22win.setTitle("Box example");
23win.setAutohide(true);
24
25bg = new elm.Elm.Bg(win);
26bg.setSizeHintWeight(1.0, 1.0);
27win.resizeObjectAdd(bg);
28bg.setVisible(true);
29
30bigbox = new elm.Elm.Box(win)
31bigbox.setSizeHintWeight(1.0, 1.0);
32win.resizeObjectAdd(bigbox);
33
34bx = new elm.Elm.Box(win)
35bx.setSizeHintWeight(1.0, 1.0);
36bx.setHorizontal(true);
37bigbox.packEnd(bx);
38bx.setVisible(true);
39
40bt = new elm.Elm.Button(win);
41bt.textSet("elm.text", "Add");
42bx.packEnd(bt);
43bt.setVisible(true);
44bt.on('clicked', _add_cb);
45
46bt = new elm.Elm.Button(win);
47bt.textSet("elm.text", "Clear");
48bx.packEnd(bt);
49bt.setVisible(true);
50bt.on('clicked', _clear_cb);
51
52bx = new elm.Elm.Box(win)
53bx.setSizeHintWeight(1.0, 1.0);
54bx.setSizeHintAlign(-1.0, -1.0);
55bx.setHorizontal(true);
56bigbox.packEnd(bx);
57bx.setVisible(true);
58
59bt = new elm.Elm.Button(win);
60bt.textSet("elm.text", "Button 1");
61bx.packEnd(bt);
62bt.setSizeHintWeight(1.0, 1.0);
63bt.setSizeHintAlign(-1.0, -1.0);
64bt.setVisible(true);
65bt.on('clicked', _unpack_cb);
66
67bt = new elm.Elm.Button(win);
68bt.textSet("elm.text", "Button 2");
69bx.packEnd(bt);
70bt.setSizeHintWeight(1.0, 0.0);
71bt.setSizeHintAlign(1.0, 0.5);
72bt.setVisible(true);
73bt.on('clicked', _unpack_cb);
74
75bt = new elm.Elm.Button(win);
76bt.textSet("elm.text", "Button 3");
77bx.packEnd(bt);
78bt.setVisible(true);
79bt.on('clicked', _unpack_cb);
80
81bigbox.setVisible(true);
82
83win.setSize(300, 320);
84win.setVisible(true);
85
86console.log("Going to wait now\n");
diff --git a/src/examples/bubble_example_01.js b/src/examples/bubble_example_01.js
new file mode 100644
index 000000000..89ee4737b
--- /dev/null
+++ b/src/examples/bubble_example_01.js
@@ -0,0 +1,54 @@
1
2efl = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Bg Plain");
7win.setAutohide(true);
8
9bg = new elm.Elm.Bg(win);
10bg.setSizeHintWeight(1.0, 1.0);
11win.resizeObjectAdd(bg);
12bg.setVisible(true);
13
14label1 = new elm.Elm.Label(win);
15label1.setText(null, "Bubble with no icon, info or label");
16label1.setVisible(true);
17
18console.log(efl);
19
20icon = new efl.Evas.Rectangle(win);
21icon.setColor( 0, 0, 255, 255);
22icon.setVisible(true);
23
24bubble1 = new elm.Elm.Bubble(win);
25bubble1.contentSet("icon", icon);
26bubble1.setText("info", "INFO");
27bubble1.setText(null, "LABEL");
28bubble1.contentSet(null, label1);
29bubble1.setSize(300, 100);
30bubble1.setVisible(true);
31
32corner = 0;
33bubble1.on('clicked',
34 function()
35 {
36 ++corner;
37 if (corner > 3)
38 bubble1.pos_set(corner = 0);
39 else
40 bubble1.pos_set(corner);
41 });
42
43label2 = new elm.Elm.Label(win);
44label2.setText(null, "Bubble with no icon, info or label");
45label2.setVisible(true);
46
47bubble2 = new elm.Elm.Bubble(win);
48bubble2.contentSet(null, label2);
49bubble2.setSize(200, 50);
50bubble2.setPosition(0, 110);
51bubble2.setVisible(true);
52
53win.setSize(300, 200);
54win.setVisible(true);
diff --git a/src/examples/button_example_00.js b/src/examples/button_example_00.js
new file mode 100644
index 000000000..64d7c8f6f
--- /dev/null
+++ b/src/examples/button_example_00.js
@@ -0,0 +1,21 @@
1
2efl = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Hello, World!");
7win.setAutohide(true);
8
9btn = new elm.Elm.Button(win);
10btn.setText(null, "Good-Bye, World!");
11btn.setSize(120, 30);
12btn.setPosition(60, 15);
13btn.setSizeHintWeight(1.0, 1.0);
14btn.setSizeHintAlign(1.0, 1.0);
15btn.setVisible(true);
16
17btn.on('clicked', function () { console.log('clicked'); } );
18
19win.setSize(240, 60);
20win.setVisible(true);
21
diff --git a/src/examples/button_example_01.js b/src/examples/button_example_01.js
new file mode 100644
index 000000000..5f34c112a
--- /dev/null
+++ b/src/examples/button_example_01.js
@@ -0,0 +1,208 @@
1efl = require('efl');
2elm = require('elm');
3
4_btn_options_cb = function(_btn) {
5 var text = _btn.textGet("elm.text");
6 var lbl = text.split(": ");
7
8 var t = parseFloat(lbl[1]);
9 if (lbl[0] === "Initial")
10 {
11 console.log ("Initial: " + lbl[1]);
12 up.setAutorepeatInitialTimeout(t);
13 down.setAutorepeatInitialTimeout(t);
14 left.setAutorepeatInitialTimeout(t);
15 right.setAutorepeatInitialTimeout(t);
16 }
17 else if (lbl[0] === "Gap")
18 {
19 console.log ("Gap: " + lbl[1]);
20 up.setAutorepeatGapTimeout(t);
21 down.setAutorepeatGapTimeout(t);
22 left.setAutorepeatGapTimeout(t);
23 right.setAutorepeatGapTimeout(t);
24 }
25}
26
27_btn_cursors_move = function(_btn) {
28 var size = mid.getSizeHintAlign();
29 var ax = size[0];
30 var ay = size[1];
31 console.log ("cursor move: ", size[0], size[1]);
32
33 if (!icon_still) {
34 var icon = new elm.Elm.Icon(mid);
35 var icon_still_p = mid.contentUnset("icon");
36 if (icon_still_p) {
37 icon_still_p.setVisible(false);
38 }
39 icon.setStandard("chat");
40 mid.contentSet("icon", icon);
41 }
42
43 if (_btn.getPosition()[1] == up.getPosition()[1]) {
44 ay -= 0.05;
45 if (ay < 0.0) ay = 0.0;
46 }
47 else if (_btn.getPosition()[1] == down.getPosition()[1]) {
48 ay += 0.05;
49 if (ay > 1.0) ay = 1.0;
50 }
51 else if (_btn.getPosition()[0] == left.getPosition()[0]) {
52 ax -= 0.05;
53 if (ax < 0.0) ax = 0.0;
54 }
55 else if (_btn.getPosition()[0] == right.getPosition()[0]) {
56 ax += 0.05;
57 if (ax > 1.0) ax = 1.0;
58 }
59 mid.setSizeHintAlign(ax, ay);
60}
61
62
63win = new elm.Elm.WinStandard(null);
64win.setTitle("Button example");
65win.setAutohide(true);
66
67icon_still = new elm.Elm.Icon(win);
68mid = new elm.Elm.Button(win);
69up = new elm.Elm.Button(win);
70down = new elm.Elm.Button(win);
71left = new elm.Elm.Button(win);
72right = new elm.Elm.Button(win);
73
74_btn_cursors_release = function() {
75 if (icon_still)
76 {
77 mid.contentSet("icon", icon_still);
78 icon_still = null;
79 }
80}
81
82box = new elm.Elm.Box(win);
83box.setSizeHintWeight(1.0, 1.0);
84win.resizeObjectAdd(box);
85box.setVisible(true);
86
87box_initial = new elm.Elm.Box(win);
88box_initial.setHorizontal(true);
89box_initial.setSizeHintWeight(1.0, 0.0);
90box.packEnd(box_initial);
91box_initial.setVisible(true);
92
93btn = new elm.Elm.Button(win);
94btn.setText("elm.text", "Initial: 0.0");
95box_initial.packEnd(btn);
96btn.setVisible(true);
97
98btn.on('clicked', _btn_options_cb);
99
100btn2 = new elm.Elm.Button(win);
101btn2.setText("elm.text", "Initial: 1.0");
102box_initial.packEnd(btn2);
103btn2.setVisible(true);
104btn2.on('clicked', _btn_options_cb);
105
106btn3 = new elm.Elm.Button(win);
107btn3.setText("elm.text", "Initial: 5.0");
108box_initial.packEnd(btn3);
109btn3.setVisible(true);
110btn3.on('clicked', _btn_options_cb);
111
112box_gap = new elm.Elm.Box(win);
113box_gap.setHorizontal(true);
114box_gap.setSizeHintWeight(1.0, 0.0);
115box.packEnd(box_gap);
116box_gap.setVisible(true);
117
118btn4 = new elm.Elm.Button(win);
119btn4.setText("elm.text", "Gap: 0.1");
120box_gap.packEnd(btn4);
121btn4.setVisible(true);
122btn4.on('clicked', _btn_options_cb);
123
124btn5 = new elm.Elm.Button(win);
125btn5.setText("elm.text", "Gap: 0.5");
126box_gap.packEnd(btn5);
127btn5.setVisible(true);
128btn5.on('clicked', _btn_options_cb);
129
130btn6 = new elm.Elm.Button(win);
131btn6.setText("elm.text", "Gap: 1.0");
132box_gap.packEnd(btn6);
133btn6.setVisible(true);
134btn6.on('clicked', _btn_options_cb);
135
136up.setAutorepeat(true);
137up.setAutorepeatInitialTimeout(1.0);
138up.setAutorepeatGapTimeout(0.5);
139up.setSizeHintWeight(1.0, 0.0);
140up.setSizeHintAlign(-1.0, 0.0);
141box.packEnd(up);
142up.setVisible(true);
143up.on('repeated', _btn_cursors_move)
144up.on('unpressed', _btn_cursors_release);
145icon_up = new elm.Elm.Icon(win);
146icon_up.setStandard("arrow_up");
147up.contentSet("icon", icon_up);
148
149box_inferior = new elm.Elm.Box(win);
150box_inferior.setHorizontal(true);
151box_inferior.setSizeHintWeight(1.0, 1.0);
152box_inferior.setSizeHintAlign(-1.0, -1.0);
153box.packEnd(box_inferior);
154box_inferior.setVisible(true);
155
156left.setAutorepeat(true);
157left.setAutorepeatInitialTimeout(1.0);
158left.setAutorepeatGapTimeout(0.5);
159left.setSizeHintWeight(0.0, 1.0);
160left.setSizeHintAlign(0.0, -1.0);
161box_inferior.packEnd(left);
162left.setVisible(true);
163left.on('repeated', _btn_cursors_move)
164left.on('unpressed', _btn_cursors_release);
165
166icon_left = new elm.Elm.Icon(win);
167icon_left.setStandard("arrow_left");
168left.contentSet("icon", icon_left);
169
170mid.setSizeHintWeight(1.0, 1.0);
171box_inferior.packEnd(mid);
172mid.setVisible(true);
173
174icon_mid = new elm.Elm.Icon(win);
175icon_mid.setStandard("close");
176mid.contentSet("icon", icon_mid);
177
178right.setAutorepeat(true);
179right.setAutorepeatInitialTimeout(1.0);
180right.setAutorepeatGapTimeout(0.5);
181right.setSizeHintWeight(0.0, 1.0);
182right.setSizeHintAlign(0.0, -1.0);
183box_inferior.packEnd(right);
184right.setVisible(true);
185right.on('repeated', _btn_cursors_move);
186right.on('unpressed', _btn_cursors_release);
187
188icon_right = new elm.Elm.Icon(win);
189icon_right.setStandard("arrow_right");
190right.contentSet("icon", icon_right);
191
192down.setAutorepeat(true);
193down.setAutorepeatInitialTimeout(1.0);
194down.setAutorepeatGapTimeout(0.5);
195down.setSizeHintWeight(1.0, 0.0);
196down.setSizeHintAlign(-1.0, 0.0);
197box.packEnd(down);
198down.setVisible(true);
199down.on('repeated', _btn_cursors_move);
200down.on('unpressed', _btn_cursors_release);
201
202icon_down = new elm.Elm.Icon(win);
203icon_down.setStandard("arrow_down");
204down.contentSet("icon", icon_down);
205
206win.setSize(300, 320);
207win.setVisible(true);
208
diff --git a/src/examples/calendar_example_01.js b/src/examples/calendar_example_01.js
new file mode 100644
index 000000000..980bf83a2
--- /dev/null
+++ b/src/examples/calendar_example_01.js
@@ -0,0 +1,14 @@
1
2efl = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Calendar Creation Example");
7win.setAutohide(true);
8
9cal = new elm.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal);
12cal.setVisible(true);
13
14win.setVisible(true);
diff --git a/src/examples/calendar_example_02.js b/src/examples/calendar_example_02.js
new file mode 100644
index 000000000..c8b53fd75
--- /dev/null
+++ b/src/examples/calendar_example_02.js
@@ -0,0 +1,17 @@
1elm = require('elm');
2
3//var weekdays = ["S", "M", "T", "W", "T", "F", "S"];
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Calendar Layout Formatting Example");
7win.setAutohide(true);
8
9cal = new elm.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal);
12
13//cal.format_function_set(funtion);
14//cal.weekdays_names_set(weekdays);
15
16cal.setVisible(true);
17win.setVisible(true);
diff --git a/src/examples/calendar_example_03.js b/src/examples/calendar_example_03.js
new file mode 100644
index 000000000..481079fc6
--- /dev/null
+++ b/src/examples/calendar_example_03.js
@@ -0,0 +1,15 @@
1
2efl = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Calendar Min/Max Year Example");
7win.setAutohide(true);
8
9cal = new elm.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal);
12cal.setMinMaxYear(2020,2022);
13cal.setVisible(true);
14
15win.setVisible(true);
diff --git a/src/examples/calendar_example_04.js b/src/examples/calendar_example_04.js
new file mode 100644
index 000000000..7f1094149
--- /dev/null
+++ b/src/examples/calendar_example_04.js
@@ -0,0 +1,32 @@
1
2elm = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Calendar Day Selection Example");
7win.setAutohide(true);
8
9box = new elm.Elm.Box(win);
10box.setSizeHintWeight(1.0, 1.0);
11win.resizeObjectAdd(box);
12box.setVisible(true);
13
14cal = new elm.Elm.Calendar(win);
15cal.setSizeHintWeight(1.0, 1.0);
16cal.setSizeHintAlign(-1.0, -1.0);
17cal.setSelectMode(elm.Elm.Calendar.Select.Mode.NONE);
18win.resizeObjectAdd(cal);
19cal.setVisible(true);
20box.packEnd(cal);
21
22cal2 = new elm.Elm.Calendar(win);
23cal2.setSizeHintWeight(1.0, 1.0);
24cal2.setSizeHintAlign(-1.0, -1.0);
25// selected_time_set uses tm* struct
26//dateCurrent = new Date();
27//dateSelected = dateCurrent.getSeconds() + 2 * 3600 * 24;
28//cal2.selected_time_set(dateSelected);
29cal2.setVisible(true);
30box.packEnd(cal2);
31
32win.setVisible(true);
diff --git a/src/examples/calendar_example_05.js b/src/examples/calendar_example_05.js
new file mode 100644
index 000000000..7759b2da8
--- /dev/null
+++ b/src/examples/calendar_example_05.js
@@ -0,0 +1,29 @@
1
2elm = require('elm');
3
4_print_cal_info_cb = function ()
5{
6 //var sel_time = cal.selected_time_get()
7
8 var interval = cal.getInterval();
9 var mm_yr = cal.getMinMaxYear();
10 var sel_enable = cal.getSelectMode() != elm.Elm.Calendar.Select.Mode.NONE;
11 var wds = cal.getWeekdaysNames();
12
13 console.log("weekdays= " + wds + ", interval= " + interval +
14 "\nYear_Min: "+mm_yr[0]+ ", Year_Max: "+mm_yr[1]+", Sel Enabled: "+sel_enable);
15}
16
17
18win = new elm.Elm.WinStandard(null);
19win.setTitle("Calendar Getters Example");
20win.setAutohide(true);
21
22cal = new elm.Elm.Calendar(win);
23cal.setSizeHintWeight(1.0, 1.0);
24win.resizeObjectAdd(cal);
25
26cal.on('changed', _print_cal_info_cb);
27
28cal.setVisible(true);
29win.setVisible(true);
diff --git a/src/examples/clock_example.js b/src/examples/clock_example.js
new file mode 100644
index 000000000..f13c07e72
--- /dev/null
+++ b/src/examples/clock_example.js
@@ -0,0 +1,43 @@
1elm = require('elm');
2
3win = new elm.Elm.WinStandard(null);
4win.setTitle("Clock Example");
5win.setAutohide(true);
6
7bx = new elm.Elm.Box(win);
8bx.setSizeHintWeight(1.0, 1.0);
9win.resizeObjectAdd(bx);
10bx.setVisible(true);
11
12ck = new elm.Elm.Clock(win);
13bx.packEnd(ck);
14ck.setVisible(true);
15
16ck2 = new elm.Elm.Clock(win);
17ck2.setShowAmPm(true);
18bx.packEnd(ck2);
19ck2.setVisible(true);
20
21ck3 = new elm.Elm.Clock(win);
22ck3.setShowSeconds(true);
23ck3.setTime(10, 11, 12);
24bx.packEnd(ck3);
25ck3.setVisible(true);
26
27ck4 = new elm.Elm.Clock(win);
28ck4.setEdit(true);
29ck4.setShowSeconds(true);
30ck4.setShowAmPm(true);
31ck4.setTime(10, 11, 12);
32bx.packEnd(ck4);
33ck4.setVisible(true);
34
35ck5 = new elm.Elm.Clock(win);
36ck5.setShowSeconds(true);
37ck5.setEdit(true);
38digedit = elm.Elm.Clock.EditMode.HOUR_UNIT | elm.Elm.Clock.EditMode.MIN_UNIT | elm.Elm.Clock.EditMode.SEC_UNIT;
39ck5.setEditMode(digedit);
40bx.packEnd(ck5);
41ck5.setVisible(true);
42
43win.setVisible(true);
diff --git a/src/examples/datetime_example.js b/src/examples/datetime_example.js
new file mode 100644
index 000000000..92b361ec8
--- /dev/null
+++ b/src/examples/datetime_example.js
@@ -0,0 +1,42 @@
1
2elm = require('elm');
3
4win = new elm.Elm.WinStandard(null);
5win.setTitle("Datetime");
6win.setAutohide(true);
7
8bg = new elm.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bg);
11bg.setVisible(true);
12
13bx = new elm.Elm.Box(win);
14bx.setSizeHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bx);
16bx.setVisible(true);
17
18datetime = new elm.Elm.Datetime(bx);
19datetime.setSizeHintWeight(1.0, 1.0);
20datetime.setSizeHintAlign(-1.0, 0.5);
21datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.HOUR, false);
22datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.MINUTE, false);
23datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.AMPM, false);
24bx.packEnd(datetime);
25datetime.setVisible(true);
26
27datetime = new elm.Elm.Datetime(bx);
28datetime.setSizeHintWeight(1.0, 1.0);
29datetime.setSizeHintAlign(-1.0, 0.5);
30datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.YEAR, false);
31datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.MONTH, false);
32datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.DATE, false);
33bx.packEnd(datetime);
34datetime.setVisible(true);
35
36datetime = new elm.Elm.Datetime(bx);
37datetime.setSizeHintWeight(1.0, 1.0);
38datetime.setSizeHintAlign(-1.0, 0.5);
39bx.packEnd(datetime);
40datetime.setVisible(true);
41
42win.setVisible(true);
diff --git a/src/examples/icon_example_01.js b/src/examples/icon_example_01.js
new file mode 100644
index 000000000..a1689349c
--- /dev/null
+++ b/src/examples/icon_example_01.js
@@ -0,0 +1,33 @@
1
2efl = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Icon Plain");
7win.setAutohide(true);
8
9icon = new elm.Elm.Icon(win);
10//icon.order_lookup_set(ELM_ICON_LOOKUP_THEME_FDO); Ja eh o default
11icon.setStandard("home");
12
13var path, group;
14r = icon.getFile(path, group);
15path = r[0];
16gruop = r[1];
17console.log("path = " + path + ", group = " + group);
18
19var name;
20name = icon.getStandard();
21console.log("name = " + name);
22
23icon.setNoScale(true);
24icon.setResizable(false, true);
25icon.setSmooth(false);
26icon.setFillOutside(true);
27
28icon.setSizeHintWeight(1.0, 1.0);
29win.resizeObjectAdd(icon);
30icon.setVisible(true);
31
32win.setSize(320, 320);
33win.setVisible(true);
diff --git a/src/examples/menu_example_01.js b/src/examples/menu_example_01.js
new file mode 100644
index 000000000..9e3170fe8
--- /dev/null
+++ b/src/examples/menu_example_01.js
@@ -0,0 +1,37 @@
1efl = require('efl');
2elm = require('elm');
3
4win = new elm.Elm.WinStandard(null);
5win.setTitle("Menu");
6win.setAutohide(true);
7
8rect = new efl.Evas.Rectangle(win);
9win.resizeObjectAdd(rect);
10rect.setSizeHintMin( 0, 0);
11rect.setColor( 0, 0, 0, 0);
12rect.setVisible(true);
13
14menu = new elm.Elm.Menu(win);
15menu.itemAdd(null, null, "first item", null, null); // item_add nao implementado
16menu_it = menu.itemAdd(null, "mail-reply-all", "second intem", null, null);
17
18menu.itemAdd(menu_it, "object-rotate-left", "menu 1", null, null);
19button = new elm.Elm.Button(win);
20button.textSet("elm.text", "button - delete items");
21menu_it1 = menu.itemAdd(menu_it, null, null, null, null);
22menu_it1.setPartContent(null, button);
23
24//button.event_clicked(del_it);
25
26menu.itemSeparatorAdd(menu_it);
27menu.itemAdd(menu_it, null, "third item", null, null);
28menu.itemAdd(menu_it, null, "fourth item", null, null);
29menu.itemAdd(menu_it, "window-new", "sub menu", null, null);
30
31menu_it = menu.itemAdd(null, null, "third item", null, null);
32menu_it.setDisabled(true);
33
34menu.setVisible(true);
35rect.on('mouse_down', function(){menu.visible_set(true)});
36win.setSize(250, 350);
37win.setVisible(true);
diff --git a/src/examples/popup_example_01.js b/src/examples/popup_example_01.js
new file mode 100644
index 000000000..2e39763c0
--- /dev/null
+++ b/src/examples/popup_example_01.js
@@ -0,0 +1,32 @@
1efl = require('efl');
2elm = require('elm');
3
4win = new elm.Elm.WinStandard(null);
5win.setTitle("Popup");
6win.setAutohide(true);
7
8content = new elm.Elm.Label(win);
9content.setText("elm.text", "<align=center>Content</align>");
10
11popup = new elm.Elm.Popup(win);
12popup.setTimeout(3);
13
14popup.on('timeout', function()
15 {
16 console.log("timeout");
17 popup.setVisible(false);
18 });
19
20popup.contentSet("elm.swallow.content", content);
21
22popup.setText("title,text", "Title");
23popup.setVisible(true);
24
25popup.on('block_clicked', function()
26 {
27 console.log("clicked")
28 popup.setVisible(false);
29 });
30
31win.setSize(480, 800);
32win.setVisible(true);
diff --git a/src/examples/radio_example_01.js b/src/examples/radio_example_01.js
new file mode 100644
index 000000000..ac91c2c41
--- /dev/null
+++ b/src/examples/radio_example_01.js
@@ -0,0 +1,65 @@
1
2elm = require('elm');
3
4_cb = function(obj){
5 console.log(obj.textGet("elm.text"), "state value:", obj.getStateValue());
6}
7
8win = new elm.Elm.WinStandard(null);
9win.setTitle("Radio");
10win.setAutohide(true);
11
12bx = new elm.Elm.Box(win);
13bx.setHorizontal(true);
14bx.setSizeHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bx);
16bx.setVisible(true);
17
18radio_g = new elm.Elm.Radio(win);
19radio_g.textSet("elm.text", "Radio 1");
20radio_g.setStateValue(1);
21radio_g.setValue(1);
22ic = new elm.Elm.Icon(win);
23ic.setStandard("home");
24radio_g.contentSet("icon", ic);
25bx.packEnd(radio_g);
26radio_g.setSizeHintWeight(1.0, 1.0);
27radio_g.setSizeHintAlign(-1.0, -1.0);
28radio_g.on('changed', _cb);
29radio_g.setVisible(true);
30
31radio = new elm.Elm.Radio(win);
32radio.textSet("elm.text", "Radio 2");
33radio.setStateValue(2);
34radio.groupAdd(radio_g);
35ic = new elm.Elm.Icon(win);
36ic.setStandard("file");
37radio.contentSet("icon", ic);
38bx.packEnd(radio);
39radio.setSizeHintWeight(1.0, 1.0);
40radio.setSizeHintAlign(-1.0, -1.0);
41radio.on('changed', _cb);
42radio.setVisible(true);
43
44radio = new elm.Elm.Radio(win);
45radio.textSet("elm.text", "Radio 3");
46radio.setStateValue(3);
47radio.groupAdd(radio_g);
48bx.packEnd(radio);
49radio.setSizeHintWeight(1.0, 1.0);
50radio.setSizeHintAlign(-1.0, -1.0);
51radio.on('changed', _cb);
52radio.setVisible(true);
53
54radio = new elm.Elm.Radio(win);
55radio.textSet("elm.text", "Radio 4");
56radio.setStateValue(4);
57radio.groupAdd(radio_g);
58bx.packEnd(radio);
59radio.setSizeHintWeight(1.0, 1.0);
60radio.setSizeHintAlign(-1.0, -1.0);
61radio.on('changed', _cb);
62radio.setVisible(true);
63
64
65win.setVisible(true);
diff --git a/src/examples/separator_example_01.js b/src/examples/separator_example_01.js
new file mode 100644
index 000000000..53fc3cafa
--- /dev/null
+++ b/src/examples/separator_example_01.js
@@ -0,0 +1,41 @@
1
2efl = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Separator");
7win.setAutohide(true);
8
9bg = new elm.Elm.Bg(win);
10bg.setSizeHintWeight(1.0, 1.0);
11win.resizeObjectAdd(bg);
12bg.setVisible(true);
13
14bx = new elm.Elm.Box(win);
15bx.setHorizontal(true);
16bx.setSizeHintWeight(1.0, 1.0);
17win.resizeObjectAdd(bx);
18bx.setVisible(true);
19
20rect = new efl.Evas.Rectangle(win);
21rect.setColor( 0, 255, 0, 255)
22rect.setSizeHintMin( 90, 200);
23rect.setSizeHintWeight(1.0, 1.0);
24rect.setSizeHintAlign(-1.0, -1.0);
25rect.setVisible(true);
26bx.packEnd(rect);
27
28separator = new elm.Elm.Separator(win);
29separator.setHorizontal(true);
30separator.setVisible(true);
31bx.packEnd(separator);
32
33rect2 = new efl.Evas.Rectangle(win);
34rect2.setColor( 0, 0, 255, 255);
35rect2.setSizeHintMin( 90, 200);
36rect2.setSizeHintWeight(1.0, 1.0);
37rect2.setSizeHintAlign(-1.0, -1.0);
38rect2.setVisible(true);
39bx.packEnd(rect2);
40
41win.setVisible(true);
diff --git a/src/examples/slider_example.js b/src/examples/slider_example.js
new file mode 100644
index 000000000..e585119d9
--- /dev/null
+++ b/src/examples/slider_example.js
@@ -0,0 +1,104 @@
1
2efl = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Slider Example");
7win.setAutohide(true);
8
9bx = new elm.Elm.Box(win);
10//bx.setHorizontal(true);
11bx.setSizeHintWeight(1.0, 1.0);
12win.resizeObjectAdd(bx);
13bx.setVisible(true);
14
15sl = new elm.Elm.Slider(win);
16sl.setSizeHintAlign(-1.0, 0.5);
17sl.setSizeHintWeight(1.0, 1.0);
18bx.packEnd(sl);
19sl.setVisible(true);
20
21/* with icon, end and label */
22sl = new elm.Elm.Slider(win);
23sl.textSet("elm.text", "Counter");
24
25ic = new elm.Elm.Icon(win);
26ic.setStandard("home");
27ic.setResizable(false, false);
28sl.contentSet("icon", ic);
29
30ic = new elm.Elm.Icon(win);
31ic.setStandard("folder");
32ic.setResizable(false, false);
33sl.contentSet("end", ic);
34
35sl.setSizeHintAlign(-1.0, 0.5);
36sl.setSizeHintWeight(1.0, 1.0);
37bx.packEnd(sl);
38sl.setVisible(true);
39
40/* value set and span size */
41sl = new elm.Elm.Slider(win);
42sl.setValue(1);
43sl.setSpanSize(200);
44sl.setSizeHintAlign(-1.0, 0.5);
45sl.setSizeHintWeight(1.0, 1.0);
46bx.packEnd(sl);
47sl.setVisible(true);
48
49/* with unit label and min - max */
50sl = new elm.Elm.Slider(win);
51sl.setUnitFormat("%1.0f units");
52sl.setMinMax(0, 100);
53sl.setSizeHintAlign(-1.0, 0.5);
54sl.setSizeHintWeight(1.0, 1.0);
55bx.packEnd(sl);
56sl.setVisible(true);
57
58/* with indicator label and inverted */
59sl = new elm.Elm.Slider(win);
60sl.setIndicatorFormat("%1.2f");
61sl.setInverted(true);
62sl.setSizeHintAlign(-1.0, 0.5);
63sl.setSizeHintWeight(1.0, 1.0);
64bx.packEnd(sl);
65sl.setVisible(true);
66
67/* vertical with indicator format func */
68sl = new elm.Elm.Slider(win);
69sl.setHorizontal(false);
70//indicator_format = function()
71// {
72// indicator = new char[32];
73// nprintf(indicator, 32, "%1.2f u", val);
74// return indicator;
75// }
76//indicator_free = function() {console.log("free")}
77//sl.indicator_format_function_set(indicator_format, indicator_free);
78
79sl.setSizeHintAlign(0.5, -1.0);
80sl.setSizeHintWeight(0.0, 1.0);
81bx.packEnd(sl);
82sl.setVisible(true);
83
84/* callbacks */
85sl = new elm.Elm.Slider(win);
86sl.setUnitFormat("%1.3f units");
87sl.setSizeHintAlign(-1.0, 0.5);
88sl.setSizeHintWeight(1.0, 1.0);
89bx.packEnd(sl);
90sl.setVisible(true);
91
92sl.on('changed', function(obj)
93 {
94 val = obj.value_get();
95 console.log("Changed to " + val);
96 });
97
98sl.on('delay_changed', function(obj)
99 {
100 val = obj.value_get();
101 console.log("Delay changed to " + val);
102 });
103
104win.setVisible(true);
diff --git a/src/examples/spinner_example.js b/src/examples/spinner_example.js
new file mode 100644
index 000000000..c9d2917da
--- /dev/null
+++ b/src/examples/spinner_example.js
@@ -0,0 +1,90 @@
1
2elm = require('elm');
3
4win = new elm.Elm.WinStandard(null);
5win.setTitle("Spinner Example");
6win.setAutohide(true);
7
8bx = new elm.Elm.Box(win);
9bx.setSizeHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bx);
11bx.setVisible(true);
12
13sp = new elm.Elm.Spinner(win);
14sp.setSizeHintWeight(1.0, 1.0);
15sp.setSizeHintAlign(-1.0, 0.5);
16bx.packEnd(sp);
17sp.setVisible(true);
18
19sp2 = new elm.Elm.Spinner(win);
20sp2.setLabelFormat("Percentage %%%1.2f something");
21sp2.setSizeHintWeight(1.0, 1.0);
22sp2.setSizeHintAlign(-1.0, 0.5);
23bx.packEnd(sp2);
24sp2.setVisible(true);
25
26sp3 = new elm.Elm.Spinner(win);
27sp3.setLabelFormat("%1.1f units");
28sp3.setStep(1.5);
29sp3.setWrap(true);
30sp3.setMinMax(-50.0, 250.0);
31sp3.setSizeHintWeight(1.0, 1.0);
32sp3.setSizeHintAlign(-1.0, 0.5);
33bx.packEnd(sp3);
34sp3.setVisible(true);
35
36sp4 = new elm.Elm.Spinner(win);
37sp4.setStyle("vertical");
38sp4.setInterval(0.2);
39sp4.setSizeHintWeight(1.0, 1.0);
40sp4.setSizeHintAlign(-1.0, 0.5);
41bx.packEnd(sp4);
42sp4.setVisible(true);
43
44sp5 = new elm.Elm.Spinner(win);
45sp5.setEditable(false);
46sp5.setSizeHintWeight(1.0, 1.0);
47sp5.setSizeHintAlign(-1.0, 0.5);
48bx.packEnd(sp5);
49sp5.setVisible(true);
50
51sp6 = new elm.Elm.Spinner(win);
52sp6.setEditable(false);
53sp6.setMinMax(1, 12);
54sp6.specialValueAdd(1, "January");
55sp6.specialValueAdd(2, "February");
56sp6.specialValueAdd(3, "March");
57sp6.specialValueAdd(4, "April");
58sp6.specialValueAdd(5, "May");
59sp6.specialValueAdd(6, "June");
60sp6.specialValueAdd(7, "July");
61sp6.specialValueAdd(8, "August");
62sp6.specialValueAdd(9, "September");
63sp6.specialValueAdd(10, "October");
64sp6.specialValueAdd(11, "November");
65sp6.specialValueAdd(12, "December");
66sp6.setSizeHintWeight(1.0, 1.0);
67sp6.setSizeHintAlign(-1.0, 0.5);
68bx.packEnd(sp6);
69sp6.setVisible(true);
70
71sp7 = new elm.Elm.Spinner(win);
72sp7.setSizeHintWeight(1.0, 1.0);
73sp7.setSizeHintAlign(-1.0, 0.5);
74bx.packEnd(sp7);
75sp7.setVisible(true);
76sp7.setEditable(true);
77
78sp7.on('changed',
79 function(obj)
80 {
81 console.log("Value changed to " + obj.value_get());
82 });
83
84sp7.on('delay_changed',
85 function(obj)
86 {
87 console.log("Value delay changed to " + obj.value_get());
88 });
89
90win.setVisible(true);
diff --git a/src/examples/table_example_01.js b/src/examples/table_example_01.js
new file mode 100644
index 000000000..928f25494
--- /dev/null
+++ b/src/examples/table_example_01.js
@@ -0,0 +1,34 @@
1
2elm = require('elm');
3
4win = new elm.Elm.WinStandard(null);
5win.setTitle("Table");
6win.setAutohide(true);
7
8table = new elm.Elm.Table(win);
9win.resizeObjectAdd(table);
10table.setVisible(true);
11table.setPadding(5, 5);
12table.setHomogeneous(true);
13
14label = new elm.Elm.Label(win);
15label.setText("elm.text", "label 0");
16label.setVisible(true);
17table.pack(label, 0, 0, 1, 1);
18
19label = new elm.Elm.Label(win);
20label.setText("elm.text", "label 1");
21label.setVisible(true);
22table.pack(label, 1, 0, 1, 1);
23
24label = new elm.Elm.Label(win);
25label.setText("elm.text", "label 2");
26label.setVisible(true);
27table.pack(label, 0, 1, 1, 1);
28
29label = new elm.Elm.Label(win);
30label.setText("elm.text", "label 3");
31label.setVisible(true);
32table.pack(label, 1, 1, 1, 1);
33
34win.setVisible(true);
diff --git a/src/examples/table_example_02.js b/src/examples/table_example_02.js
new file mode 100644
index 000000000..af51ec793
--- /dev/null
+++ b/src/examples/table_example_02.js
@@ -0,0 +1,38 @@
1
2efl = require('efl');
3elm = require('elm');
4
5win = new elm.Elm.WinStandard(null);
6win.setTitle("Table");
7win.setAutohide(true);
8
9table = new elm.Elm.Table(win);
10win.resizeObjectAdd(table);
11table.setVisible(true);
12table.setHomogeneous(false);
13
14rect = new efl.Evas.Rectangle(win);
15rect.setColor( 255, 0, 0, 255)
16rect.setSizeHintMin( 100, 50);
17rect.setVisible(true)
18table.pack(rect, 0, 0, 2, 1);
19
20rect2 = new efl.Evas.Rectangle(win);
21rect2.setColor( 0, 255, 0, 255)
22rect2.setSizeHintMin( 50, 100);
23rect2.setVisible(true)
24table.pack(rect2, 0, 1, 1, 2);
25
26rect3 = new efl.Evas.Rectangle(win);
27rect3.setColor( 0, 0, 255, 255)
28rect3.setSizeHintMin( 50, 50);
29rect3.setVisible(true)
30table.pack(rect3, 1, 1, 1, 1);
31
32rect4 = new efl.Evas.Rectangle(win);
33rect4.setColor( 255, 255, 0, 255)
34rect4.setSizeHintMin( 50, 50);
35rect4.setVisible(true)
36table.pack(rect4, 1, 2, 1, 1);
37
38win.setVisible(true);
diff --git a/src/examples/thumb_example_01.js b/src/examples/thumb_example_01.js
new file mode 100644
index 000000000..c12a98829
--- /dev/null
+++ b/src/examples/thumb_example_01.js
@@ -0,0 +1,38 @@
1elm = require('elm');
2
3_generation_started_cb = function(obj)
4{
5 console.log("thumbnail generation started.");
6}
7
8_generation_finished_cb = function(obj)
9{
10 console.log("thumbnail generation finished.");
11}
12
13_generation_error_cb = function(obj)
14{
15 console.log("thumbnail generation error.");
16}
17
18win = new elm.Elm.WinStandard(null);
19win.setTitle("Table");
20win.setAutohide(true);
21
22thumb = new elm.Elm.Thumb(win);
23
24thumb.on('generate_start', _generation_started_cb);
25thumb.on('generate_stop', _generation_finished_cb);
26thumb.on('generate_error', _generation_error_cb);
27
28thumb.setSize(160, 160);
29thumb.setEditable(false);
30thumb.setFile("../../data/images/plant_01.jpg", null);
31thumb.reload();
32
33thumb.setSizeHintWeight(1.0, 1.0);
34win.resizeObjectAdd(thumb);
35
36thumb.setVisible(true);
37win.setSize(320, 320);
38win.setVisible(true);
diff --git a/src/examples/twitter_example_01.edc b/src/examples/twitter_example_01.edc
new file mode 100644
index 000000000..8a98930ff
--- /dev/null
+++ b/src/examples/twitter_example_01.edc
@@ -0,0 +1,89 @@
1collections {
2 group {
3 name: "tweet";
4 parts
5 {
6 part {
7 name: "user_icon";
8 type: SWALLOW;
9 description {
10 rel1 {
11 relative: 0.0 0.0;
12 offset: 2 2;
13 }
14 rel2 {
15 relative: 0.0 0.0;
16 offset: 50 50 ;
17 }
18 }
19 }
20 part {
21 name: "user_name";
22 type: TEXT;
23 effect: SOFT_SHADOW;
24 description {
25 color: 0 190 255 255;
26 rel1 {
27 relative: 1.0 0.0;
28 to_x: "user_icon";
29 offset: 7 4;
30 }
31 rel2 {
32 relative: 1.0 0.0;
33 to_x: "user_icon";
34 offset: 120 30;
35 }
36 text {
37 text: "User Name";
38 size: 12;
39 font: "sans:style=Bold";
40 min: 1 1;
41 ellipsis: -1;
42 align: 0.0 0.0;
43 }
44 }
45 }
46 part {
47 name: "screen_name";
48 type: TEXT;
49 description {
50 rel1 {
51 relative: 1.0 0.0;
52 to: "user_name";
53 offset: 15 4;
54 }
55 rel2 {
56 relative: 1.0 1.0;
57 to: "user_name";
58 offset: 75 10;
59 }
60 text {
61 text: "scname";
62 size: 10;
63 font: "sans";
64 min: 1 1;
65 ellipsis: -1;
66 align: 0.0 0.0;
67 }
68 }
69 }
70 part {
71 name: "tweet_text";
72 type: SWALLOW;
73 description {
74 rel1 {
75 relative: 0.0 1.0;
76 to: "user_name";
77 offset: 0 0;
78 }
79 rel2 {
80 relative: 0.0 1.0;
81 to: "user_name";
82 offset: 250 80;
83 }
84 }
85 }
86 }
87 }
88}
89
diff --git a/src/examples/twitter_example_01.js b/src/examples/twitter_example_01.js
new file mode 100644
index 000000000..84d1d7d76
--- /dev/null
+++ b/src/examples/twitter_example_01.js
@@ -0,0 +1,82 @@
1
2efl = require('efl');
3elm = require('elm');
4
5util = require('util');
6fs = require('fs');
7
8user_acount = 'EnlightenmentKo'
9
10request = require('request'); //need "npm install request"
11Twitter = require('twitter'); //need "npm install twitter"
12
13var twit = new Twitter({
14 consumer_key: 'ZbSM93w5Sp2cyZ2SG0XuCvoHV',
15 consumer_secret: 'g8N7EEQLpdKPnAsS9hWuQV29FYjBkhH62jhZzXyYymDw87DKye',
16 access_token_key: '222611263-pPhKKjYh59uuNLP0b86sP7aAtLhdecjVQaEsCDCv',
17 access_token_secret: 'l7ccNKXTVv6cymfSD1gQH61tmfixkdna2QmOjPtpVxSHD'
18});
19
20win = new elm.Elm.WinStandard(null);
21win.setTitle("Twitter App");
22win.setAutohide(true);
23
24box = new elm.Elm.Box(win);
25box.setSizeHintWeight(1.0, 1.0);
26win.resizeObjectAdd(box);
27box.setVisible(true);
28
29list = new elm.Elm.List(win);
30list.setSizeHintWeight(1.0, 1.0);
31list.setSizeHintAlign(-1.0, -1.0);
32box.packEnd(list);
33list.setVisible(true);
34
35icon_array = new Array();
36
37twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, function(error, tweets, response) {
38 if (!error){
39 file = fs.createWriteStream('/tmp/twitter_pic.jpg');
40 file.on('finish', function() {
41 console.log("finished");
42 for (i=0; i < icon_array.length; i++) {
43 console.log(i);
44 icon_array[i].setFile("/tmp/twitter_pic.jpg", null);
45 }
46 });
47 if (tweets.length > 0) {
48 request(tweets[0].user.profile_image_url).pipe(file);
49 }
50
51 for(i=0; i < tweets.length; i++){
52 var layout = new elm.Elm.Layout(win);
53 layout.setFile("twitter_example_01.edj", "tweet");
54
55 var user_name = tweets[i].user.name;
56 var screen_name = tweets[i].user.screen_name;
57 var user_icon_url = tweets[i].user.profile_image_url;
58 var text = tweets[i].text;
59
60 layout.setText("user_name", screen_name);
61 layout.setText("screen_name", " - @"+screen_name);
62 var entry = new elm.Elm.Entry(win);
63 entry.setText("elm.text", text);
64 console.log(text);
65 layout.contentSet("tweet_text", entry);
66
67 layout.setSizeHintMin(127, 96);
68 layout.setSizeHintWeight(1.0, 1.0);
69 layout.setSizeHintAlign(-1.0, -1.0);
70
71 var icon = new elm.Elm.Image(win);
72 icon.setFillInside(true);
73 icon_array.push(icon);
74 layout.contentSet("user_icon", icon);
75 item = list.itemAppend("", layout, null, null, null);
76 }
77 list.go();
78 }
79});
80
81win.setSize(380,400);
82win.setVisible(true);
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 3b6153272..7f2d61598 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -8,6 +8,7 @@ EOLIAN_FLAGS = @DEPS_EOLIAN_FLAGS@ \
8 8
9include $(top_srcdir)/Makefile_Eolian_Helper.am 9include $(top_srcdir)/Makefile_Eolian_Helper.am
10include $(top_srcdir)/Makefile_Eolian_Cxx_Helper.am 10include $(top_srcdir)/Makefile_Eolian_Cxx_Helper.am
11include $(top_srcdir)/Makefile_Eolian_Js_Helper.am
11 12
12AM_CPPFLAGS = \ 13AM_CPPFLAGS = \
13-DELM_INTERNAL_API_ARGESFSDFEFC=1 \ 14-DELM_INTERNAL_API_ARGESFSDFEFC=1 \
@@ -634,6 +635,8 @@ elm_eolian_impl_hh = $(elm_eolian_files:%.eo=%.eo.impl.hh)
634 635
635elm_eolian_eot_h = $(elm_eolian_type_files:%.eot=%.eot.h) 636elm_eolian_eot_h = $(elm_eolian_type_files:%.eot=%.eot.h)
636 637
638elm_eolian_js_cc = $(elm_eolian_files:%.eo=%.eo.js.cc)
639
637BUILT_SOURCES = \ 640BUILT_SOURCES = \
638 $(elm_eolian_c) \ 641 $(elm_eolian_c) \
639 $(elm_eolian_h) \ 642 $(elm_eolian_h) \
@@ -656,3 +659,47 @@ nodist_includecxxbindings_HEADERS = Elementary.hh $(elm_eolian_hh) $(elm_eolian_
656CLEANFILES += $(nodist_includecxxbindings_HEADERS) 659CLEANFILES += $(nodist_includecxxbindings_HEADERS)
657EXTRA_DIST += Elementary.hh.in 660EXTRA_DIST += Elementary.hh.in
658endif 661endif
662
663if HAVE_JS
664CLEANFILES += $(elm_eolian_js_cc)
665
666lib_LTLIBRARIES += libelementary_js.la
667
668AM_V_CP = $(am__v_CP_@AM_V@)
669am__v_CP_ = $(am__v_CP_@AM_DEFAULT_V@)
670am__v_CP_0 = @echo " CP " $@;
671CP = cp
672
673if HAVE_NODEJS
674elm.node: libelementary_js.la
675 $(AM_V_CP)$(CP) $(abs_top_builddir)/src/lib/.libs/libelementary_js.so $(abs_top_builddir)/src/lib/elm.node
676
677elmnodedir = $(libdir)
678elmnode_DATA = elm.node
679
680CLEANFILES += ${elmnodedir_DATA}
681EXTRA_DIST += ${elmnodedir_DATA}
682
683BUILT_SOURCES += ${elmnodedir_DATA}
684endif
685
686AM_CXXFLAGS = @ELEMENTARY_CFLAGS@ @ELEMENTARY_JS_CFLAGS@
687
688elm_js_object_files = $(elm_eolian_files:%.eo=%.eo.js.l$(OBJEXT))
689elm_js_object_files: $(elm_eolian_js_cc)
690
691libelementary_js_la_SOURCES = elementary_js.cc
692nodist_EXTRA_libelementary_js_la_SOURCES = $(elm_eolian_js_cc)
693
694libelementary_js_la_CXXFLAGS = @ELEMENTARY_CFLAGS@ @ELEMENTARY_JS_CFLAGS@
695libelementary_js_la_LIBADD = \
696@ELEMENTARY_LIBS@ \
697@ELEMENTARY_JS_LIBS@ \
698libelementary.la \
699@LTLIBINTL@ \
700$(elm_js_object_files)
701
702libelementary_js_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
703
704endif
705
diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c
index e998c433e..afaa43301 100644
--- a/src/lib/elc_fileselector_entry.c
+++ b/src/lib/elc_fileselector_entry.c
@@ -226,7 +226,7 @@ _elm_fileselector_entry_elm_layout_text_set(Eo *obj, Elm_Fileselector_Entry_Data
226} 226}
227 227
228EOLIAN static const char * 228EOLIAN static const char *
229_elm_fileselector_entry_elm_layout_text_get(const Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part) 229_elm_fileselector_entry_elm_layout_text_get(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
230{ 230{
231 if (part && strcmp(part, "default")) 231 if (part && strcmp(part, "default"))
232 { 232 {
diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c
index f6e1a2d77..003b227f5 100644
--- a/src/lib/elc_multibuttonentry.c
+++ b/src/lib/elc_multibuttonentry.c
@@ -1495,7 +1495,7 @@ _elm_multibuttonentry_elm_layout_text_set(Eo *obj, Elm_Multibuttonentry_Data *sd
1495} 1495}
1496 1496
1497EOLIAN static const char* 1497EOLIAN static const char*
1498_elm_multibuttonentry_elm_layout_text_get(const Eo *obj, Elm_Multibuttonentry_Data *sd, const char *part) 1498_elm_multibuttonentry_elm_layout_text_get(Eo *obj, Elm_Multibuttonentry_Data *sd, const char *part)
1499{ 1499{
1500 const char *text = NULL; 1500 const char *text = NULL;
1501 1501
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index 0a7998a22..8770e02a3 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -1039,7 +1039,7 @@ _elm_naviframe_elm_layout_text_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED,
1039} 1039}
1040 1040
1041EOLIAN static const char* 1041EOLIAN static const char*
1042_elm_naviframe_elm_layout_text_get(const Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part) 1042_elm_naviframe_elm_layout_text_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
1043{ 1043{
1044 Elm_Object_Item *it = elm_naviframe_top_item_get(obj); 1044 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
1045 if (!it) return NULL; 1045 if (!it) return NULL;
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index ead2646ab..84814bbe2 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -1059,7 +1059,7 @@ _content_text_get(const Elm_Popup_Data *sd)
1059} 1059}
1060 1060
1061EOLIAN static const char* 1061EOLIAN static const char*
1062_elm_popup_elm_layout_text_get(const Eo *obj EINA_UNUSED, Elm_Popup_Data *_pd, const char *part) 1062_elm_popup_elm_layout_text_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *_pd, const char *part)
1063{ 1063{
1064 const char *text = NULL; 1064 const char *text = NULL;
1065 1065
diff --git a/src/lib/elementary_js.cc b/src/lib/elementary_js.cc
new file mode 100644
index 000000000..873d637ab
--- /dev/null
+++ b/src/lib/elementary_js.cc
@@ -0,0 +1,288 @@
1
2#ifdef HAVE_CONFIG_H
3#include <elementary_config.h>
4#endif
5
6#include <Elementary.h>
7
8#include <Eina.hh>
9#include <Eina_Js.hh>
10
11#include <iostream>
12
13#include <Efl.h>
14#include <Eo.h>
15#include <Ecore.h>
16#include <Ecore_Evas.h>
17
18#include <Eina.hh>
19
20#ifdef EAPI
21# undef EAPI
22#endif
23#ifdef _WIN32
24# define EAPI __declspec(dllimport)
25#else
26# ifdef __GNUC__
27# if __GNUC__ >= 4
28# define EAPI __attribute__ ((visibility("default")))
29# else
30# define EAPI
31# endif
32# else
33# define EAPI
34# endif
35#endif /* ! _WIN32 */
36
37EAPI void register_elm_app_client(v8::Handle<v8::Object> global, v8::Isolate* isolate);
38EAPI void register_elm_app_client_view(v8::Handle<v8::Object> global, v8::Isolate* isolate);
39EAPI void register_elm_app_server(v8::Handle<v8::Object> global, v8::Isolate* isolate);
40EAPI void register_elm_app_server_view(v8::Handle<v8::Object> global, v8::Isolate* isolate);
41EAPI void register_elm_atspi_app_object(v8::Handle<v8::Object> global, v8::Isolate* isolate);
42EAPI void register_elm_interface_atspi_accessible(v8::Handle<v8::Object> global, v8::Isolate* isolate);
43EAPI void register_elm_interface_atspi_action(v8::Handle<v8::Object> global, v8::Isolate* isolate);
44EAPI void register_elm_interface_atspi_component(v8::Handle<v8::Object> global, v8::Isolate* isolate);
45EAPI void register_elm_interface_atspi_editable_text(v8::Handle<v8::Object> global, v8::Isolate* isolate);
46EAPI void register_elm_interface_atspi_image(v8::Handle<v8::Object> global, v8::Isolate* isolate);
47EAPI void register_elm_interface_atspi_selection(v8::Handle<v8::Object> global, v8::Isolate* isolate);
48EAPI void register_elm_interface_atspi_text(v8::Handle<v8::Object> global, v8::Isolate* isolate);
49EAPI void register_elm_interface_atspi_value(v8::Handle<v8::Object> global, v8::Isolate* isolate);
50EAPI void register_elm_interface_atspi_widget_action(v8::Handle<v8::Object> global, v8::Isolate* isolate);
51EAPI void register_elm_interface_atspi_window(v8::Handle<v8::Object> global, v8::Isolate* isolate);
52EAPI void register_elm_interface_fileselector(v8::Handle<v8::Object> global, v8::Isolate* isolate);
53EAPI void register_elm_interface_scrollable(v8::Handle<v8::Object> global, v8::Isolate* isolate);
54EAPI void register_elm_pan(v8::Handle<v8::Object> global, v8::Isolate* isolate);
55
56namespace elm {
57
58EAPI void register_access(v8::Handle<v8::Object> global, v8::Isolate* isolate);
59EAPI void register_actionslider(v8::Handle<v8::Object> global, v8::Isolate* isolate);
60EAPI void register_bg(v8::Handle<v8::Object> global, v8::Isolate* isolate);
61EAPI void register_box(v8::Handle<v8::Object> global, v8::Isolate* isolate);
62EAPI void register_bubble(v8::Handle<v8::Object> global, v8::Isolate* isolate);
63EAPI void register_button(v8::Handle<v8::Object> global, v8::Isolate* isolate);
64EAPI void register_calendar(v8::Handle<v8::Object> global, v8::Isolate* isolate);
65EAPI void register_check(v8::Handle<v8::Object> global, v8::Isolate* isolate);
66EAPI void register_clock(v8::Handle<v8::Object> global, v8::Isolate* isolate);
67EAPI void register_colorselector(v8::Handle<v8::Object> global, v8::Isolate* isolate);
68EAPI void register_conformant(v8::Handle<v8::Object> global, v8::Isolate* isolate);
69EAPI void register_container(v8::Handle<v8::Object> global, v8::Isolate* isolate);
70EAPI void register_ctxpopup(v8::Handle<v8::Object> global, v8::Isolate* isolate);
71EAPI void register_datetime(v8::Handle<v8::Object> global, v8::Isolate* isolate);
72EAPI void register_dayselector(v8::Handle<v8::Object> global, v8::Isolate* isolate);
73EAPI void register_diskselector(v8::Handle<v8::Object> global, v8::Isolate* isolate);
74EAPI void register_entry(v8::Handle<v8::Object> global, v8::Isolate* isolate);
75EAPI void register_fileselector(v8::Handle<v8::Object> global, v8::Isolate* isolate);
76EAPI void register_fileselector_button(v8::Handle<v8::Object> global, v8::Isolate* isolate);
77EAPI void register_fileselector_entry(v8::Handle<v8::Object> global, v8::Isolate* isolate);
78EAPI void register_flip(v8::Handle<v8::Object> global, v8::Isolate* isolate);
79EAPI void register_flipselector(v8::Handle<v8::Object> global, v8::Isolate* isolate);
80EAPI void register_frame(v8::Handle<v8::Object> global, v8::Isolate* isolate);
81EAPI void register_gengrid(v8::Handle<v8::Object> global, v8::Isolate* isolate);
82EAPI void register_gengrid_pan(v8::Handle<v8::Object> global, v8::Isolate* isolate);
83EAPI void register_genlist(v8::Handle<v8::Object> global, v8::Isolate* isolate);
84EAPI void register_genlist_pan(v8::Handle<v8::Object> global, v8::Isolate* isolate);
85EAPI void register_gesture_layer(v8::Handle<v8::Object> global, v8::Isolate* isolate);
86EAPI void register_glview(v8::Handle<v8::Object> global, v8::Isolate* isolate);
87EAPI void register_grid(v8::Handle<v8::Object> global, v8::Isolate* isolate);
88EAPI void register_hover(v8::Handle<v8::Object> global, v8::Isolate* isolate);
89EAPI void register_hoversel(v8::Handle<v8::Object> global, v8::Isolate* isolate);
90EAPI void register_icon(v8::Handle<v8::Object> global, v8::Isolate* isolate);
91EAPI void register_image(v8::Handle<v8::Object> global, v8::Isolate* isolate);
92EAPI void register_index(v8::Handle<v8::Object> global, v8::Isolate* isolate);
93EAPI void register_inwin(v8::Handle<v8::Object> global, v8::Isolate* isolate);
94EAPI void register_label(v8::Handle<v8::Object> global, v8::Isolate* isolate);
95EAPI void register_layout(v8::Handle<v8::Object> global, v8::Isolate* isolate);
96EAPI void register_list(v8::Handle<v8::Object> global, v8::Isolate* isolate);
97EAPI void register_map(v8::Handle<v8::Object> global, v8::Isolate* isolate);
98EAPI void register_map_pan(v8::Handle<v8::Object> global, v8::Isolate* isolate);
99EAPI void register_mapbuf(v8::Handle<v8::Object> global, v8::Isolate* isolate);
100EAPI void register_menu(v8::Handle<v8::Object> global, v8::Isolate* isolate);
101EAPI void register_multibuttonentry(v8::Handle<v8::Object> global, v8::Isolate* isolate);
102EAPI void register_naviframe(v8::Handle<v8::Object> global, v8::Isolate* isolate);
103EAPI void register_notify(v8::Handle<v8::Object> global, v8::Isolate* isolate);
104EAPI void register_panel(v8::Handle<v8::Object> global, v8::Isolate* isolate);
105EAPI void register_panes(v8::Handle<v8::Object> global, v8::Isolate* isolate);
106EAPI void register_photo(v8::Handle<v8::Object> global, v8::Isolate* isolate);
107EAPI void register_photocam(v8::Handle<v8::Object> global, v8::Isolate* isolate);
108EAPI void register_photocam_pan(v8::Handle<v8::Object> global, v8::Isolate* isolate);
109EAPI void register_player(v8::Handle<v8::Object> global, v8::Isolate* isolate);
110EAPI void register_plug(v8::Handle<v8::Object> global, v8::Isolate* isolate);
111EAPI void register_popup(v8::Handle<v8::Object> global, v8::Isolate* isolate);
112EAPI void register_prefs(v8::Handle<v8::Object> global, v8::Isolate* isolate);
113EAPI void register_progressbar(v8::Handle<v8::Object> global, v8::Isolate* isolate);
114EAPI void register_radio(v8::Handle<v8::Object> global, v8::Isolate* isolate);
115EAPI void register_route(v8::Handle<v8::Object> global, v8::Isolate* isolate);
116EAPI void register_scroller(v8::Handle<v8::Object> global, v8::Isolate* isolate);
117EAPI void register_segment_control(v8::Handle<v8::Object> global, v8::Isolate* isolate);
118EAPI void register_separator(v8::Handle<v8::Object> global, v8::Isolate* isolate);
119EAPI void register_slider(v8::Handle<v8::Object> global, v8::Isolate* isolate);
120EAPI void register_slideshow(v8::Handle<v8::Object> global, v8::Isolate* isolate);
121EAPI void register_spinner(v8::Handle<v8::Object> global, v8::Isolate* isolate);
122EAPI void register_systray(v8::Handle<v8::Object> global, v8::Isolate* isolate);
123EAPI void register_table(v8::Handle<v8::Object> global, v8::Isolate* isolate);
124EAPI void register_thumb(v8::Handle<v8::Object> global, v8::Isolate* isolate);
125EAPI void register_toolbar(v8::Handle<v8::Object> global, v8::Isolate* isolate);
126EAPI void register_video(v8::Handle<v8::Object> global, v8::Isolate* isolate);
127EAPI void register_web(v8::Handle<v8::Object> global, v8::Isolate* isolate);
128EAPI void register_widget(v8::Handle<v8::Object> global, v8::Isolate* isolate);
129EAPI void register_win(v8::Handle<v8::Object> global, v8::Isolate* isolate);
130EAPI void register_win_standard(v8::Handle<v8::Object> global, v8::Isolate* isolate);
131EAPI void register_widget_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
132EAPI void register_color_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
133EAPI void register_dayselector_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
134EAPI void register_hoversel_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
135EAPI void register_segment_control_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
136EAPI void register_slideshow_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
137EAPI void register_flipselector_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
138EAPI void register_menu_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
139EAPI void register_ctxpopup_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
140EAPI void register_index_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
141EAPI void register_multibuttonentry_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
142EAPI void register_naviframe_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
143EAPI void register_genlist_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
144EAPI void register_gengrid_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
145EAPI void register_list_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
146EAPI void register_toolbar_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
147EAPI void register_diskselector_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
148EAPI void register_popup_item(v8::Handle<v8::Object> global, v8::Isolate* isolate);
149
150}
151
152#ifdef HAVE_NODEJS
153#include <eina_js_node.hh>
154
155namespace {
156#endif
157
158void init(v8::Handle<v8::Object> exports)
159{
160#ifdef HAVE_NODEJS
161 static char* argv[] = {const_cast<char*>("node")};
162 ::elm_init(1, argv);
163
164 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
165#endif
166
167 try
168 {
169 elm::register_access(exports, v8::Isolate::GetCurrent());
170 elm::register_actionslider(exports, v8::Isolate::GetCurrent());
171 ::register_elm_app_client(exports, v8::Isolate::GetCurrent());
172 ::register_elm_app_client_view(exports, v8::Isolate::GetCurrent());
173 ::register_elm_app_server(exports, v8::Isolate::GetCurrent());
174 ::register_elm_app_server_view(exports, v8::Isolate::GetCurrent());
175 ::register_elm_atspi_app_object(exports, v8::Isolate::GetCurrent());
176 elm::register_bg(exports, v8::Isolate::GetCurrent());
177 elm::register_box(exports, v8::Isolate::GetCurrent());
178 elm::register_bubble(exports, v8::Isolate::GetCurrent());
179 elm::register_button(exports, v8::Isolate::GetCurrent());
180 elm::register_calendar(exports, v8::Isolate::GetCurrent());
181 elm::register_check(exports, v8::Isolate::GetCurrent());
182 elm::register_clock(exports, v8::Isolate::GetCurrent());
183 elm::register_colorselector(exports, v8::Isolate::GetCurrent());
184 elm::register_conformant(exports, v8::Isolate::GetCurrent());
185 elm::register_container(exports, v8::Isolate::GetCurrent());
186 elm::register_ctxpopup(exports, v8::Isolate::GetCurrent());
187 elm::register_datetime(exports, v8::Isolate::GetCurrent());
188 elm::register_dayselector(exports, v8::Isolate::GetCurrent());
189 elm::register_diskselector(exports, v8::Isolate::GetCurrent());
190 elm::register_entry(exports, v8::Isolate::GetCurrent());
191 elm::register_fileselector(exports, v8::Isolate::GetCurrent());
192 elm::register_fileselector_button(exports, v8::Isolate::GetCurrent());
193 elm::register_fileselector_entry(exports, v8::Isolate::GetCurrent());
194 elm::register_flip(exports, v8::Isolate::GetCurrent());
195 elm::register_flipselector(exports, v8::Isolate::GetCurrent());
196 elm::register_frame(exports, v8::Isolate::GetCurrent());
197 elm::register_gengrid(exports, v8::Isolate::GetCurrent());
198 elm::register_gengrid_pan(exports, v8::Isolate::GetCurrent());
199 elm::register_genlist(exports, v8::Isolate::GetCurrent());
200 elm::register_genlist_pan(exports, v8::Isolate::GetCurrent());
201 elm::register_gesture_layer(exports, v8::Isolate::GetCurrent());
202 elm::register_glview(exports, v8::Isolate::GetCurrent());
203 elm::register_grid(exports, v8::Isolate::GetCurrent());
204 elm::register_hover(exports, v8::Isolate::GetCurrent());
205 elm::register_hoversel(exports, v8::Isolate::GetCurrent());
206 elm::register_icon(exports, v8::Isolate::GetCurrent());
207 elm::register_image(exports, v8::Isolate::GetCurrent());
208 elm::register_index(exports, v8::Isolate::GetCurrent());
209 ::register_elm_interface_atspi_accessible(exports, v8::Isolate::GetCurrent());
210 ::register_elm_interface_atspi_action(exports, v8::Isolate::GetCurrent());
211 ::register_elm_interface_atspi_component(exports, v8::Isolate::GetCurrent());
212 ::register_elm_interface_atspi_editable_text(exports, v8::Isolate::GetCurrent());
213 ::register_elm_interface_atspi_image(exports, v8::Isolate::GetCurrent());
214 ::register_elm_interface_atspi_selection(exports, v8::Isolate::GetCurrent());
215 ::register_elm_interface_atspi_text(exports, v8::Isolate::GetCurrent());
216 ::register_elm_interface_atspi_value(exports, v8::Isolate::GetCurrent());
217 ::register_elm_interface_atspi_widget_action(exports, v8::Isolate::GetCurrent());
218 ::register_elm_interface_atspi_window(exports, v8::Isolate::GetCurrent());
219 ::register_elm_interface_fileselector(exports, v8::Isolate::GetCurrent());
220 ::register_elm_interface_scrollable(exports, v8::Isolate::GetCurrent());
221 elm::register_inwin(exports, v8::Isolate::GetCurrent());
222 elm::register_label(exports, v8::Isolate::GetCurrent());
223 elm::register_layout(exports, v8::Isolate::GetCurrent());
224 elm::register_list(exports, v8::Isolate::GetCurrent());
225 elm::register_map(exports, v8::Isolate::GetCurrent());
226 elm::register_map_pan(exports, v8::Isolate::GetCurrent());
227 elm::register_mapbuf(exports, v8::Isolate::GetCurrent());
228 elm::register_menu(exports, v8::Isolate::GetCurrent());
229 elm::register_multibuttonentry(exports, v8::Isolate::GetCurrent());
230 elm::register_naviframe(exports, v8::Isolate::GetCurrent());
231 elm::register_notify(exports, v8::Isolate::GetCurrent());
232 ::register_elm_pan(exports, v8::Isolate::GetCurrent());
233 elm::register_panel(exports, v8::Isolate::GetCurrent());
234 elm::register_panes(exports, v8::Isolate::GetCurrent());
235 elm::register_photo(exports, v8::Isolate::GetCurrent());
236 elm::register_photocam(exports, v8::Isolate::GetCurrent());
237 elm::register_photocam_pan(exports, v8::Isolate::GetCurrent());
238 elm::register_player(exports, v8::Isolate::GetCurrent());
239 elm::register_plug(exports, v8::Isolate::GetCurrent());
240 elm::register_popup(exports, v8::Isolate::GetCurrent());
241 elm::register_prefs(exports, v8::Isolate::GetCurrent());
242 elm::register_progressbar(exports, v8::Isolate::GetCurrent());
243 elm::register_radio(exports, v8::Isolate::GetCurrent());
244 elm::register_route(exports, v8::Isolate::GetCurrent());
245 elm::register_scroller(exports, v8::Isolate::GetCurrent());
246 elm::register_segment_control(exports, v8::Isolate::GetCurrent());
247 elm::register_separator(exports, v8::Isolate::GetCurrent());
248 elm::register_slider(exports, v8::Isolate::GetCurrent());
249 elm::register_slideshow(exports, v8::Isolate::GetCurrent());
250 elm::register_spinner(exports, v8::Isolate::GetCurrent());
251 elm::register_systray(exports, v8::Isolate::GetCurrent());
252 elm::register_table(exports, v8::Isolate::GetCurrent());
253 elm::register_thumb(exports, v8::Isolate::GetCurrent());
254 elm::register_toolbar(exports, v8::Isolate::GetCurrent());
255 elm::register_video(exports, v8::Isolate::GetCurrent());
256 elm::register_web(exports, v8::Isolate::GetCurrent());
257 elm::register_widget(exports, v8::Isolate::GetCurrent());
258 elm::register_win(exports, v8::Isolate::GetCurrent());
259 elm::register_win_standard(exports, v8::Isolate::GetCurrent());
260 elm::register_widget_item(exports, v8::Isolate::GetCurrent());
261 elm::register_color_item(exports, v8::Isolate::GetCurrent());
262 elm::register_dayselector_item(exports, v8::Isolate::GetCurrent());
263 elm::register_hoversel_item(exports, v8::Isolate::GetCurrent());
264 elm::register_segment_control_item(exports, v8::Isolate::GetCurrent());
265 elm::register_slideshow_item(exports, v8::Isolate::GetCurrent());
266 elm::register_flipselector_item(exports, v8::Isolate::GetCurrent());
267 elm::register_menu_item(exports, v8::Isolate::GetCurrent());
268 elm::register_ctxpopup_item(exports, v8::Isolate::GetCurrent());
269 elm::register_index_item(exports, v8::Isolate::GetCurrent());
270 elm::register_multibuttonentry_item(exports, v8::Isolate::GetCurrent());
271 elm::register_naviframe_item(exports, v8::Isolate::GetCurrent());
272 elm::register_genlist_item(exports, v8::Isolate::GetCurrent());
273 elm::register_gengrid_item(exports, v8::Isolate::GetCurrent());
274 elm::register_list_item(exports, v8::Isolate::GetCurrent());
275 elm::register_toolbar_item(exports, v8::Isolate::GetCurrent());
276 elm::register_diskselector_item(exports, v8::Isolate::GetCurrent());
277 elm::register_popup_item(exports, v8::Isolate::GetCurrent());
278 }
279 catch(...)
280 {
281 std::cout << "Exception" << std::endl;
282 }
283}
284
285#ifdef HAVE_NODEJS
286}
287NODE_MODULE(elm, init)
288#endif
diff --git a/src/lib/elm_actionslider.c b/src/lib/elm_actionslider.c
index f7095a92d..3f1dbc19c 100644
--- a/src/lib/elm_actionslider.c
+++ b/src/lib/elm_actionslider.c
@@ -459,7 +459,7 @@ _elm_actionslider_elm_layout_text_set(Eo *obj, Elm_Actionslider_Data *_pd EINA_U
459} 459}
460 460
461EOLIAN static const char* 461EOLIAN static const char*
462_elm_actionslider_elm_layout_text_get(const Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, const char *part) 462_elm_actionslider_elm_layout_text_get(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, const char *part)
463{ 463{
464 const char *text = NULL; 464 const char *text = NULL;
465 465
diff --git a/src/lib/elm_actionslider.eo b/src/lib/elm_actionslider.eo
index c41a4e328..dbae20722 100644
--- a/src/lib/elm_actionslider.eo
+++ b/src/lib/elm_actionslider.eo
@@ -70,8 +70,8 @@ class Elm.Actionslider (Elm.Layout, Evas.Selectable_Interface)
70 Elm.Widget.focus_next_manager_is; 70 Elm.Widget.focus_next_manager_is;
71 Elm.Widget.focus_direction_manager_is; 71 Elm.Widget.focus_direction_manager_is;
72 Elm.Widget.theme_apply; 72 Elm.Widget.theme_apply;
73 Elm.Layout.text_set; 73 Elm.Layout.text.set;
74 Elm.Layout.text_get; 74 Elm.Layout.text.get;
75 Elm.Layout.text_aliases.get; 75 Elm.Layout.text_aliases.get;
76 Elm.Layout.sizing_eval; 76 Elm.Layout.sizing_eval;
77 } 77 }
diff --git a/src/lib/elm_bubble.eo b/src/lib/elm_bubble.eo
index a98c07d33..b574ef79c 100644
--- a/src/lib/elm_bubble.eo
+++ b/src/lib/elm_bubble.eo
@@ -46,7 +46,7 @@ class Elm.Bubble (Elm.Layout, Evas.Clickable_Interface)
46 Elm.Widget.focus_next; 46 Elm.Widget.focus_next;
47 Elm.Widget.focus_direction_manager_is; 47 Elm.Widget.focus_direction_manager_is;
48 Elm.Widget.access; 48 Elm.Widget.access;
49 Elm.Layout.text_set; 49 Elm.Layout.text.set;
50 Elm.Layout.text_aliases.get; 50 Elm.Layout.text_aliases.get;
51 Elm.Layout.content_aliases.get; 51 Elm.Layout.content_aliases.get;
52 Elm.Layout.sizing_eval; 52 Elm.Layout.sizing_eval;
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index baedc2770..ea0197931 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -3001,7 +3001,7 @@ _elm_entry_elm_layout_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, co
3001} 3001}
3002 3002
3003EOLIAN static const char * 3003EOLIAN static const char *
3004_elm_entry_elm_layout_text_get(const Eo *obj, Elm_Entry_Data *sd, const char *item) 3004_elm_entry_elm_layout_text_get(Eo *obj, Elm_Entry_Data *sd, const char *item)
3005{ 3005{
3006 const char *text; 3006 const char *text;
3007 3007
diff --git a/src/lib/elm_entry.eo b/src/lib/elm_entry.eo
index 9dd9e3646..f3eb285a9 100644
--- a/src/lib/elm_entry.eo
+++ b/src/lib/elm_entry.eo
@@ -917,11 +917,11 @@ class Elm.Entry (Elm.Layout, Elm_Interface_Scrollable, Evas.Clickable_Interface,
917 Elm.Container.content_set; 917 Elm.Container.content_set;
918 Elm.Layout.theme_enable; 918 Elm.Layout.theme_enable;
919 Elm.Layout.sizing_eval; 919 Elm.Layout.sizing_eval;
920 Elm.Layout.text_get; 920 Elm.Layout.text.get;
921 Elm.Layout.signal_callback_add; 921 Elm.Layout.signal_callback_add;
922 Elm.Layout.signal_callback_del; 922 Elm.Layout.signal_callback_del;
923 Elm.Layout.signal_emit; 923 Elm.Layout.signal_emit;
924 Elm.Layout.text_set; 924 Elm.Layout.text.set;
925 Elm.Layout.content_aliases.get; 925 Elm.Layout.content_aliases.get;
926 Elm_Interface_Scrollable.policy.set; 926 Elm_Interface_Scrollable.policy.set;
927 Elm_Interface_Scrollable.bounce_allow.set; 927 Elm_Interface_Scrollable.bounce_allow.set;
diff --git a/src/lib/elm_fileselector.eo b/src/lib/elm_fileselector.eo
index 891a18024..14a9f8a7e 100644
--- a/src/lib/elm_fileselector.eo
+++ b/src/lib/elm_fileselector.eo
@@ -41,7 +41,7 @@ class Elm.Fileselector (Elm.Layout, Elm_Interface_Fileselector,
41 Elm.Widget.theme_apply; 41 Elm.Widget.theme_apply;
42 Elm.Widget.focus_next_manager_is; 42 Elm.Widget.focus_next_manager_is;
43 Elm.Layout.sizing_eval; 43 Elm.Layout.sizing_eval;
44 Elm.Layout.text_set; 44 Elm.Layout.text.set;
45 Elm_Interface_Fileselector.selected_paths.get; 45 Elm_Interface_Fileselector.selected_paths.get;
46 Elm_Interface_Fileselector.custom_filter_append; 46 Elm_Interface_Fileselector.custom_filter_append;
47 Elm_Interface_Fileselector.expandable; 47 Elm_Interface_Fileselector.expandable;
diff --git a/src/lib/elm_fileselector_entry.eo b/src/lib/elm_fileselector_entry.eo
index 00c51c243..43ed2a69e 100644
--- a/src/lib/elm_fileselector_entry.eo
+++ b/src/lib/elm_fileselector_entry.eo
@@ -93,8 +93,8 @@ class Elm.Fileselector_Entry (Elm.Layout, Elm_Interface_Fileselector,
93 Elm.Container.content_get; 93 Elm.Container.content_get;
94 Elm.Container.content_unset; 94 Elm.Container.content_unset;
95 Elm.Container.content_set; 95 Elm.Container.content_set;
96 Elm.Layout.text_set; 96 Elm.Layout.text.set;
97 Elm.Layout.text_get; 97 Elm.Layout.text.get;
98 Elm.Layout.sizing_eval; 98 Elm.Layout.sizing_eval;
99 Elm_Interface_Fileselector.selected; 99 Elm_Interface_Fileselector.selected;
100 Elm_Interface_Fileselector.folder_only; 100 Elm_Interface_Fileselector.folder_only;
diff --git a/src/lib/elm_label.eo b/src/lib/elm_label.eo
index 9f18be18b..509741726 100644
--- a/src/lib/elm_label.eo
+++ b/src/lib/elm_label.eo
@@ -125,7 +125,7 @@ class Elm.Label (Elm.Layout)
125 Elm.Widget.focus_next_manager_is; 125 Elm.Widget.focus_next_manager_is;
126 Elm.Widget.focus_direction_manager_is; 126 Elm.Widget.focus_direction_manager_is;
127 Elm.Widget.theme_apply; 127 Elm.Widget.theme_apply;
128 Elm.Layout.text_set; 128 Elm.Layout.text.set;
129 Elm.Layout.text_aliases.get; 129 Elm.Layout.text_aliases.get;
130 Elm.Layout.sizing_eval; 130 Elm.Layout.sizing_eval;
131 } 131 }
diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index d5250869a..972ffa7e3 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -1190,7 +1190,7 @@ _elm_layout_text_set(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part, const
1190} 1190}
1191 1191
1192EOLIAN static const char* 1192EOLIAN static const char*
1193_elm_layout_text_get(const Eo *obj, Elm_Layout_Smart_Data *sd, const char *part) 1193_elm_layout_text_get(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part)
1194{ 1194{
1195 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); 1195 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
1196 1196
diff --git a/src/lib/elm_layout.eo b/src/lib/elm_layout.eo
index 49d1b3b3f..6e3e37631 100644
--- a/src/lib/elm_layout.eo
+++ b/src/lib/elm_layout.eo
@@ -211,19 +211,19 @@ class Elm.Layout (Elm.Container, Efl.File)
211 @in part_name: const(char)*; [[A part from loaded edje group.]] 211 @in part_name: const(char)*; [[A part from loaded edje group.]]
212 } 212 }
213 } 213 }
214 text_set { 214 @property text {
215 [[Set the text of the given part.]] 215 set {
216 return: bool; 216 [[Set the text of the given part.]]
217 params { 217 return: bool;
218 @in part: const(char)* @nullable; [[The TEXT part where to set the text.]]
219 @in text: const(char)* @nullable; [[The text to set.]]
220 } 218 }
221 } 219 get {
222 text_get @const { 220 [[Get the text set in the given part.]]
223 [[Get the text set in the given part.]] 221 }
224 return: const(char)*; 222 keys {
225 params { 223 part: const(char)* @nullable; [[The TEXT part where to set the text.]]
226 @in part: const(char)*; [[The TEXT part to retrieve the text off.]] 224 }
225 values {
226 text: const(char)* @nullable; [[The text to set.]]
227 } 227 }
228 } 228 }
229 signal_callback_add { 229 signal_callback_add {
diff --git a/src/lib/elm_multibuttonentry.eo b/src/lib/elm_multibuttonentry.eo
index 92f2a9054..2d266fd1b 100644
--- a/src/lib/elm_multibuttonentry.eo
+++ b/src/lib/elm_multibuttonentry.eo
@@ -181,8 +181,8 @@ class Elm.Multibuttonentry (Elm.Layout)
181 Elm.Widget.on_focus; 181 Elm.Widget.on_focus;
182 Elm.Widget.translate; 182 Elm.Widget.translate;
183 Elm.Widget.event; 183 Elm.Widget.event;
184 Elm.Layout.text_set; 184 Elm.Layout.text.set;
185 Elm.Layout.text_get; 185 Elm.Layout.text.get;
186 Elm.Layout.sizing_eval; 186 Elm.Layout.sizing_eval;
187 Elm_Interface_Atspi_Accessible.children.get; 187 Elm_Interface_Atspi_Accessible.children.get;
188 } 188 }
diff --git a/src/lib/elm_naviframe.eo b/src/lib/elm_naviframe.eo
index 0978797b1..b5571412c 100644
--- a/src/lib/elm_naviframe.eo
+++ b/src/lib/elm_naviframe.eo
@@ -154,8 +154,8 @@ class Elm.Naviframe (Elm.Layout, Elm_Interface_Atspi_Widget_Action)
154 Elm.Container.content_get; 154 Elm.Container.content_get;
155 Elm.Container.content_set; 155 Elm.Container.content_set;
156 Elm.Container.content_unset; 156 Elm.Container.content_unset;
157 Elm.Layout.text_set; 157 Elm.Layout.text.set;
158 Elm.Layout.text_get; 158 Elm.Layout.text.get;
159 Elm.Layout.signal_emit; 159 Elm.Layout.signal_emit;
160 Elm.Layout.sizing_eval; 160 Elm.Layout.sizing_eval;
161 Elm_Interface_Atspi_Widget_Action.elm_actions.get; 161 Elm_Interface_Atspi_Widget_Action.elm_actions.get;
diff --git a/src/lib/elm_popup.eo b/src/lib/elm_popup.eo
index b80f8f8ec..ec90a9e80 100644
--- a/src/lib/elm_popup.eo
+++ b/src/lib/elm_popup.eo
@@ -175,8 +175,8 @@ class Elm.Popup (Elm.Layout, Elm_Interface_Atspi_Widget_Action)
175 Elm.Container.content_get; 175 Elm.Container.content_get;
176 Elm.Container.content_set; 176 Elm.Container.content_set;
177 Elm.Container.content_unset; 177 Elm.Container.content_unset;
178 Elm.Layout.text_set; 178 Elm.Layout.text.set;
179 Elm.Layout.text_get; 179 Elm.Layout.text.get;
180 Elm.Layout.sizing_eval; 180 Elm.Layout.sizing_eval;
181 Elm_Interface_Atspi_Widget_Action.elm_actions.get; 181 Elm_Interface_Atspi_Widget_Action.elm_actions.get;
182 Elm_Interface_Atspi_Accessible.state_set.get; 182 Elm_Interface_Atspi_Accessible.state_set.get;