summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2016-07-26 18:21:02 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2017-02-13 11:58:29 -0300
commit39d9ceeda66329cd7d936a96775c343294dc310b (patch)
tree96f3a68c154acf856d7fe6d941eb66d2b34b93f0
parent556d9de6b6f1469673d1cc5b65d06818cbb9b4c4 (diff)
efl_js: Update JS examples
Changing imports, functions, etc. Also export "cast" function for all eolian_js generated classes. (cherry picked from commit 4f52588b3ce86e3bef7041d76d07eda58c41c79d)
-rw-r--r--src/bin/eolian_js/main.cc3
-rw-r--r--src/bindings/js/efl_js/efl_js.cc5
-rw-r--r--src/examples/elementary/bg_example_01.js13
-rw-r--r--src/examples/elementary/bg_example_02.js16
-rw-r--r--src/examples/elementary/box_js_example_01.js24
-rw-r--r--src/examples/elementary/box_js_example_02.js55
-rw-r--r--src/examples/elementary/bubble_example_01.js31
-rw-r--r--src/examples/elementary/button_example_00.js8
-rw-r--r--src/examples/elementary/button_example_01.js120
-rw-r--r--src/examples/elementary/calendar_example_01.js12
-rw-r--r--src/examples/elementary/calendar_example_02.js13
-rw-r--r--src/examples/elementary/calendar_example_03.js12
-rw-r--r--src/examples/elementary/calendar_example_04.js30
-rw-r--r--src/examples/elementary/calendar_example_05.js15
-rw-r--r--src/examples/elementary/clock_example.js27
-rw-r--r--src/examples/elementary/datetime_example.js49
-rw-r--r--src/examples/elementary/icon_example_01.js11
-rw-r--r--src/examples/elementary/layout_example.js44
-rw-r--r--src/examples/elementary/menu_example_01.js11
-rw-r--r--src/examples/elementary/popup_example_01.js12
-rw-r--r--src/examples/elementary/radio_example_01.js56
-rw-r--r--src/examples/elementary/separator_example_01.js40
-rw-r--r--src/examples/elementary/slider_example.js82
-rw-r--r--src/examples/elementary/spinner_example.js78
-rw-r--r--src/examples/elementary/table_example_01.js16
-rw-r--r--src/examples/elementary/thumb_example_01.js36
-rw-r--r--src/examples/elementary/twitter_example_01.js56
27 files changed, 458 insertions, 417 deletions
diff --git a/src/bin/eolian_js/main.cc b/src/bin/eolian_js/main.cc
index c5786080e8..27ffe8ae75 100644
--- a/src/bin/eolian_js/main.cc
+++ b/src/bin/eolian_js/main.cc
@@ -997,6 +997,9 @@ int main(int argc, char** argv)
997 } 997 }
998 } 998 }
999 999
1000 functions_ss << "\n prototype->Set(::efl::eina::js::compatibility_new<v8::String>(isolate, \"cast\"),\n"
1001 " ::efl::eina::js::compatibility_new<v8::FunctionTemplate>(isolate, &efl::eina::js::cast_function)->GetFunction());\n\n";
1002
1000 // generate all events 1003 // generate all events
1001 std::stringstream events_ss; 1004 std::stringstream events_ss;
1002 auto generate_events = [&] (Eolian_Class const* klass) 1005 auto generate_events = [&] (Eolian_Class const* klass)
diff --git a/src/bindings/js/efl_js/efl_js.cc b/src/bindings/js/efl_js/efl_js.cc
index 4548e90b93..b482e5a3ee 100644
--- a/src/bindings/js/efl_js/efl_js.cc
+++ b/src/bindings/js/efl_js/efl_js.cc
@@ -73,6 +73,7 @@ EAPI void register_ecore_audio_out_sndfile(v8::Handle<v8::Object> global, v8::Is
73 73
74namespace efl { 74namespace efl {
75EAPI void register_animator(v8::Handle<v8::Object> global, v8::Isolate* isolate); 75EAPI void register_animator(v8::Handle<v8::Object> global, v8::Isolate* isolate);
76EAPI void register_container(v8::Handle<v8::Object> global, v8::Isolate* isolate);
76EAPI void register_control(v8::Handle<v8::Object> global, v8::Isolate* isolate); 77EAPI void register_control(v8::Handle<v8::Object> global, v8::Isolate* isolate);
77EAPI void register_file(v8::Handle<v8::Object> global, v8::Isolate* isolate); 78EAPI void register_file(v8::Handle<v8::Object> global, v8::Isolate* isolate);
78EAPI void register_image(v8::Handle<v8::Object> global, v8::Isolate* isolate); 79EAPI void register_image(v8::Handle<v8::Object> global, v8::Isolate* isolate);
@@ -87,6 +88,7 @@ EAPI void register_video(v8::Handle<v8::Object> global, v8::Isolate* isolate);
87EAPI void register_flip(v8::Handle<v8::Object> global, v8::Isolate* isolate); 88EAPI void register_flip(v8::Handle<v8::Object> global, v8::Isolate* isolate);
88EAPI void register_frame(v8::Handle<v8::Object> global, v8::Isolate* isolate); 89EAPI void register_frame(v8::Handle<v8::Object> global, v8::Isolate* isolate);
89EAPI void register_box(v8::Handle<v8::Object> global, v8::Isolate* isolate); 90EAPI void register_box(v8::Handle<v8::Object> global, v8::Isolate* isolate);
91EAPI void register_image(v8::Handle<v8::Object> global, v8::Isolate* isolate);
90}} 92}}
91 93
92namespace efl { namespace ui { namespace win { 94namespace efl { namespace ui { namespace win {
@@ -388,7 +390,7 @@ EAPI void init(v8::Handle<v8::Object> exports)
388 // elm::register_combobox(exports, v8::Isolate::GetCurrent()); 390 // elm::register_combobox(exports, v8::Isolate::GetCurrent());
389 391
390 // doesn't exist 392 // doesn't exist
391 // elm::register_container(exports, v8::Isolate::GetCurrent()); 393 efl::register_container(exports, v8::Isolate::GetCurrent());
392 394
393 elm::register_ctxpopup(exports, v8::Isolate::GetCurrent()); 395 elm::register_ctxpopup(exports, v8::Isolate::GetCurrent());
394 elm::register_datetime(exports, v8::Isolate::GetCurrent()); 396 elm::register_datetime(exports, v8::Isolate::GetCurrent());
@@ -406,6 +408,7 @@ EAPI void init(v8::Handle<v8::Object> exports)
406 elm::register_flipselector(exports, v8::Isolate::GetCurrent()); 408 elm::register_flipselector(exports, v8::Isolate::GetCurrent());
407 efl::ui::register_frame(exports, v8::Isolate::GetCurrent()); 409 efl::ui::register_frame(exports, v8::Isolate::GetCurrent());
408 efl::ui::register_box(exports, v8::Isolate::GetCurrent()); 410 efl::ui::register_box(exports, v8::Isolate::GetCurrent());
411 efl::ui::register_image(exports, v8::Isolate::GetCurrent());
409 412
410 // crash 413 // crash
411 // elm::register_gengrid(exports, v8::Isolate::GetCurrent()); 414 // elm::register_gengrid(exports, v8::Isolate::GetCurrent());
diff --git a/src/examples/elementary/bg_example_01.js b/src/examples/elementary/bg_example_01.js
index 227259b63a..2a4e9214d7 100644
--- a/src/examples/elementary/bg_example_01.js
+++ b/src/examples/elementary/bg_example_01.js
@@ -1,13 +1,14 @@
1 1
2var elm = require('elm') 2var efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Bg Plain"); 5win.setText("Bg Plain");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0); 9bg.setColor(255, 0,0,255)
10win.resizeObjectAdd(bg); 10bg.setHintWeight(1.0, 1.0);
11win.pack(bg);
11bg.setVisible(true); 12bg.setVisible(true);
12 13
13win.setSize(320,320); 14win.setSize(320,320);
diff --git a/src/examples/elementary/bg_example_02.js b/src/examples/elementary/bg_example_02.js
index e8e1a63e0f..72a9f49d60 100644
--- a/src/examples/elementary/bg_example_02.js
+++ b/src/examples/elementary/bg_example_02.js
@@ -1,18 +1,18 @@
1 1
2elm = require('elm'); 2var efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Bg Image"); 5win.setText("Bg Plain");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setLoadSize(20,20); 9bg.setLoadSize(20,20);
10bg.setOption(elm.Elm.Bg.Option.CENTER); 10bg.setOption(efl.Elm.Bg.Option.CENTER);
11 11
12//TODO: elm_app_data_dir_get 12//TODO: elm_app_data_dir_get
13bg.setFile('../../data/images/plant_01.jpg', null); 13bg.setFile(__dirname + '/../../../data/elementary/images/plant_01.jpg', null);
14bg.setSizeHintWeight(1.0, 1.0); 14bg.setHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bg); 15win.pack(bg);
16bg.setVisible(true); 16bg.setVisible(true);
17 17
18win.setSize(320, 320); 18win.setSize(320, 320);
diff --git a/src/examples/elementary/box_js_example_01.js b/src/examples/elementary/box_js_example_01.js
index ba7761da5c..e09d56abbc 100644
--- a/src/examples/elementary/box_js_example_01.js
+++ b/src/examples/elementary/box_js_example_01.js
@@ -1,27 +1,27 @@
1 1
2var elm = require('elm') 2var efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle('title'); 5win.setText('title');
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0); 9bg.setHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bg); 10win.pack(bg);
11bg.setVisible(true); 11bg.setVisible(true);
12 12
13bx = new elm.Elm.Box(win); 13bx = new efl.Efl.Ui.Box(win);
14bx.setSizeHintWeight(1.0, 1.0); 14bx.setHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bx); 15win.pack(bx);
16 16
17entry = new elm.Elm.Label(win); 17entry = new efl.Elm.Label(win);
18entry.setSize(100, 100); 18entry.setSize(100, 100);
19entry.setText(null, "Texto"); 19entry.setText(null, "Texto");
20 20
21console.log('Texto: ', entry.getText(null)); 21console.log('Texto: ', entry.getText(null));
22 22
23entry.setSizeHintWeight(1.0, 1.0); 23entry.setHintWeight(1.0, 1.0);
24entry.setSizeHintAlign(-1.0, -1.0); 24entry.setHintAlign(-1.0, -1.0);
25entry.setWrapWidth(50); 25entry.setWrapWidth(50);
26bx.packEnd(entry); 26bx.packEnd(entry);
27entry.setVisible(true); 27entry.setVisible(true);
diff --git a/src/examples/elementary/box_js_example_02.js b/src/examples/elementary/box_js_example_02.js
index 63684df026..9966704553 100644
--- a/src/examples/elementary/box_js_example_02.js
+++ b/src/examples/elementary/box_js_example_02.js
@@ -1,16 +1,15 @@
1 1
2var efl = require('efl') 2var efl = require('efl')
3var elm = require('elm')
4 3
5_add_cb = function(){ 4_add_cb = function(){
6 var btn = new elm.Elm.Button(win); 5 var btn = new efl.Elm.Button(win);
7 btn.setText("elm.text", "I do nothing"); 6 btn.setText("elm.text", "I do nothing");
8 bx.packEnd(btn); 7 bx.packEnd(btn);
9 btn.setVisible(true); 8 btn.setVisible(true);
10} 9}
11 10
12_clear_cb = function(){ 11_clear_cb = function(){
13 bx.clear(); 12 bx.clearPack();
14} 13}
15 14
16_unpack_cb = function(btn){ 15_unpack_cb = function(btn){
@@ -18,61 +17,63 @@ _unpack_cb = function(btn){
18 btn.setColor(128, 64, 0, 128) 17 btn.setColor(128, 64, 0, 128)
19} 18}
20 19
21win = new elm.Elm.WinStandard(null); 20win = new efl.Efl.Ui.Win.Standard(null);
22win.setTitle("Box example"); 21win.setText("Box example");
23win.setAutohide(true); 22win.setAutohide(true);
24 23
25bg = new elm.Elm.Bg(win); 24bg = new efl.Elm.Bg(win);
26bg.setSizeHintWeight(1.0, 1.0); 25bg.setHintWeight(1.0, 1.0);
27win.resizeObjectAdd(bg); 26win.pack(bg);
28bg.setVisible(true); 27bg.setVisible(true);
29 28
30bigbox = new elm.Elm.Box(win) 29bigbox = new efl.Efl.Ui.Box(win)
31bigbox.setSizeHintWeight(1.0, 1.0); 30bigbox.setHintWeight(1.0, 1.0);
32win.resizeObjectAdd(bigbox); 31win.pack(bigbox);
33 32
34bx = new elm.Elm.Box(win) 33bx = new efl.Efl.Ui.Box(win);
35bx.setSizeHintWeight(1.0, 1.0); 34bx.setHintWeight(1.0, 1.0);
36bx.setHorizontal(true); 35bx_orient = bx.cast("Efl.Orientation");
36bx_orient.setOrientation(efl.Efl.Orient.VERTICAL);
37bigbox.packEnd(bx); 37bigbox.packEnd(bx);
38bx.setVisible(true); 38bx.setVisible(true);
39 39
40bt = new elm.Elm.Button(win); 40bt = new efl.Elm.Button(win);
41bt.setText("elm.text", "Add"); 41bt.setText("elm.text", "Add");
42bx.packEnd(bt); 42bx.packEnd(bt);
43bt.setVisible(true); 43bt.setVisible(true);
44bt.on('clicked', _add_cb); 44bt.on('clicked', _add_cb);
45 45
46bt = new elm.Elm.Button(win); 46bt = new efl.Elm.Button(win);
47bt.setText("elm.text", "Clear"); 47bt.setText("elm.text", "Clear");
48bx.packEnd(bt); 48bx.packEnd(bt);
49bt.setVisible(true); 49bt.setVisible(true);
50bt.on('clicked', _clear_cb); 50bt.on('clicked', _clear_cb);
51 51
52bx = new elm.Elm.Box(win) 52bx = new efl.Efl.Ui.Box(win)
53bx.setSizeHintWeight(1.0, 1.0); 53bx.setHintWeight(1.0, 1.0);
54bx.setSizeHintAlign(-1.0, -1.0); 54bx.setHintAlign(-1.0, -1.0);
55bx.setHorizontal(true); 55bx_orient = bx.cast("Efl.Orientation");
56bx_orient.setOrientation(efl.Efl.Orient.HORIZONTAL);
56bigbox.packEnd(bx); 57bigbox.packEnd(bx);
57bx.setVisible(true); 58bx.setVisible(true);
58 59
59bt = new elm.Elm.Button(win); 60bt = new efl.Elm.Button(win);
60bt.setText("elm.text", "Button 1"); 61bt.setText("elm.text", "Button 1");
61bx.packEnd(bt); 62bx.packEnd(bt);
62bt.setSizeHintWeight(1.0, 1.0); 63bt.setHintWeight(1.0, 1.0);
63bt.setSizeHintAlign(-1.0, -1.0); 64bt.setHintAlign(-1.0, -1.0);
64bt.setVisible(true); 65bt.setVisible(true);
65bt.on('clicked', _unpack_cb); 66bt.on('clicked', _unpack_cb);
66 67
67bt = new elm.Elm.Button(win); 68bt = new efl.Elm.Button(win);
68bt.setText("elm.text", "Button 2"); 69bt.setText("elm.text", "Button 2");
69bx.packEnd(bt); 70bx.packEnd(bt);
70bt.setSizeHintWeight(1.0, 0.0); 71bt.setHintWeight(1.0, 0.0);
71bt.setSizeHintAlign(1.0, 0.5); 72bt.setHintAlign(1.0, 0.5);
72bt.setVisible(true); 73bt.setVisible(true);
73bt.on('clicked', _unpack_cb); 74bt.on('clicked', _unpack_cb);
74 75
75bt = new elm.Elm.Button(win); 76bt = new efl.Elm.Button(win);
76bt.setText("elm.text", "Button 3"); 77bt.setText("elm.text", "Button 3");
77bx.packEnd(bt); 78bx.packEnd(bt);
78bt.setVisible(true); 79bt.setVisible(true);
diff --git a/src/examples/elementary/bubble_example_01.js b/src/examples/elementary/bubble_example_01.js
index d7b912b378..9e91202940 100644
--- a/src/examples/elementary/bubble_example_01.js
+++ b/src/examples/elementary/bubble_example_01.js
@@ -1,31 +1,32 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Bg Plain"); 5win.setText("Bg Plain");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
10bg.setSizeHintWeight(1.0, 1.0); 9bg.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(bg); 10win.pack(bg);
12bg.setVisible(true); 11bg.setVisible(true);
13 12
14label1 = new elm.Elm.Label(win); 13label1 = new efl.Elm.Label(win);
15label1.setText(null, "Bubble with no icon, info or label"); 14label1.setText(null, "Bubble with icon, info and label");
16label1.setVisible(true); 15label1.setVisible(true);
17 16
18console.log(efl); 17console.log(efl);
19 18
20icon = new efl.Evas.Rectangle(win); 19icon = new efl.Efl.Canvas.Rectangle(win);
21icon.setColor( 0, 0, 255, 255); 20icon.setColor( 0, 0, 255, 255);
22icon.setVisible(true); 21icon.setVisible(true);
23 22
24bubble1 = new elm.Elm.Bubble(win); 23bubble1 = new efl.Elm.Bubble(win);
25bubble1.contentSet("icon", icon); 24icon_eo = bubble1.part("icon");
25icon_container = icon_eo.cast("Efl.Container");
26icon_container.setContent(icon);
26bubble1.setText("info", "INFO"); 27bubble1.setText("info", "INFO");
27bubble1.setText(null, "LABEL"); 28bubble1.setText(null, "LABEL");
28bubble1.contentSet(null, label1); 29bubble1.setContent(label1);
29bubble1.setSize(300, 100); 30bubble1.setSize(300, 100);
30bubble1.setVisible(true); 31bubble1.setVisible(true);
31 32
@@ -40,12 +41,12 @@ bubble1.on('clicked',
40 bubble1.setPos(corner); 41 bubble1.setPos(corner);
41 }); 42 });
42 43
43label2 = new elm.Elm.Label(win); 44label2 = new efl.Elm.Label(win);
44label2.setText(null, "Bubble with no icon, info or label"); 45label2.setText(null, "Bubble with no icon, info or label");
45label2.setVisible(true); 46label2.setVisible(true);
46 47
47bubble2 = new elm.Elm.Bubble(win); 48bubble2 = new efl.Elm.Bubble(win);
48bubble2.contentSet(null, label2); 49bubble2.setContent(label2);
49bubble2.setSize(200, 50); 50bubble2.setSize(200, 50);
50bubble2.setPosition(0, 110); 51bubble2.setPosition(0, 110);
51bubble2.setVisible(true); 52bubble2.setVisible(true);
diff --git a/src/examples/elementary/button_example_00.js b/src/examples/elementary/button_example_00.js
index f122bf1994..5a3674a71e 100644
--- a/src/examples/elementary/button_example_00.js
+++ b/src/examples/elementary/button_example_00.js
@@ -1,16 +1,16 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3 3
4win = new efl.Elm.Win.Standard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Hello, World!"); 5win.setText("Hello, World!");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8btn = new efl.Elm.Button(win); 8btn = new efl.Elm.Button(win);
9btn.setText(null, "Good-Bye, World!"); 9btn.setText(null, "Good-Bye, World!");
10btn.setSize(120, 30); 10btn.setSize(120, 30);
11btn.setPosition(60, 15); 11btn.setPosition(60, 15);
12btn.setSizeHintWeight(1.0, 1.0); 12btn.setHintWeight(1.0, 1.0);
13btn.setSizeHintAlign(1.0, 1.0); 13btn.setHintAlign(1.0, 1.0);
14btn.setVisible(true); 14btn.setVisible(true);
15 15
16btn.on('clicked', function () { console.log('clicked'); } ); 16btn.on('clicked', function () { console.log('clicked'); } );
diff --git a/src/examples/elementary/button_example_01.js b/src/examples/elementary/button_example_01.js
index a959427c91..5bb14fa832 100644
--- a/src/examples/elementary/button_example_01.js
+++ b/src/examples/elementary/button_example_01.js
@@ -1,5 +1,9 @@
1efl = require('efl'); 1efl = require('efl');
2elm = require('elm'); 2
3function setIcon(widget, icon) {
4 container = widget.part("icon").cast("Efl.Container");
5 container.setContent(icon);
6}
3 7
4_btn_options_cb = function(_btn) { 8_btn_options_cb = function(_btn) {
5 var text = _btn.getText("elm.text"); 9 var text = _btn.getText("elm.text");
@@ -31,13 +35,13 @@ _btn_cursors_move = function(_btn) {
31 console.log ("cursor move: ", size[0], size[1]); 35 console.log ("cursor move: ", size[0], size[1]);
32 36
33 if (!icon_still) { 37 if (!icon_still) {
34 var icon = new elm.Elm.Icon(mid); 38 var icon = new efl.Elm.Icon(mid);
35 var icon_still_p = mid.contentUnset("icon"); 39 var icon_still_p = mid.contentUnset("icon");
36 if (icon_still_p) { 40 if (icon_still_p) {
37 icon_still_p.setVisible(false); 41 icon_still_p.setVisible(false);
38 } 42 }
39 icon.setStandard("chat"); 43 icon.setIcon("chat");
40 mid.contentSet("icon", icon); 44 setIcon(mid, icon);
41 } 45 }
42 46
43 if (_btn.getPosition()[1] == up.getPosition()[1]) { 47 if (_btn.getPosition()[1] == up.getPosition()[1]) {
@@ -56,78 +60,78 @@ _btn_cursors_move = function(_btn) {
56 ax += 0.05; 60 ax += 0.05;
57 if (ax > 1.0) ax = 1.0; 61 if (ax > 1.0) ax = 1.0;
58 } 62 }
59 mid.setSizeHintAlign(ax, ay); 63 mid.setHintAlign(ax, ay);
60} 64}
61 65
62 66
63win = new elm.Elm.WinStandard(null); 67win = new efl.Efl.Ui.Win.Standard(null);
64win.setTitle("Button example"); 68win.setText("Button example");
65win.setAutohide(true); 69win.setAutohide(true);
66 70
67icon_still = new elm.Elm.Icon(win); 71icon_still = new efl.Elm.Icon(win);
68mid = new elm.Elm.Button(win); 72mid = new efl.Elm.Button(win);
69up = new elm.Elm.Button(win); 73up = new efl.Elm.Button(win);
70down = new elm.Elm.Button(win); 74down = new efl.Elm.Button(win);
71left = new elm.Elm.Button(win); 75left = new efl.Elm.Button(win);
72right = new elm.Elm.Button(win); 76right = new efl.Elm.Button(win);
73 77
74_btn_cursors_release = function() { 78_btn_cursors_release = function() {
75 if (icon_still) 79 if (icon_still)
76 { 80 {
77 mid.contentSet("icon", icon_still); 81 setIcon(mid, icon_still);
78 icon_still = null; 82 icon_still = null;
79 } 83 }
80} 84}
81 85
82box = new elm.Elm.Box(win); 86box = new efl.Efl.Ui.Box(win);
83box.setSizeHintWeight(1.0, 1.0); 87box.setHintWeight(1.0, 1.0);
84win.resizeObjectAdd(box); 88win.pack(box);
85box.setVisible(true); 89box.setVisible(true);
86 90
87box_initial = new elm.Elm.Box(win); 91box_initial = new efl.Efl.Ui.Box(win);
88box_initial.setHorizontal(true); 92box_initial.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
89box_initial.setSizeHintWeight(1.0, 0.0); 93box_initial.setHintWeight(1.0, 0.0);
90box.packEnd(box_initial); 94box.packEnd(box_initial);
91box_initial.setVisible(true); 95box_initial.setVisible(true);
92 96
93btn = new elm.Elm.Button(win); 97btn = new efl.Elm.Button(win);
94btn.setText("elm.text", "Initial: 0.0"); 98btn.setText("elm.text", "Initial: 0.0");
95box_initial.packEnd(btn); 99box_initial.packEnd(btn);
96btn.setVisible(true); 100btn.setVisible(true);
97 101
98btn.on('clicked', _btn_options_cb); 102btn.on('clicked', _btn_options_cb);
99 103
100btn2 = new elm.Elm.Button(win); 104btn2 = new efl.Elm.Button(win);
101btn2.setText("elm.text", "Initial: 1.0"); 105btn2.setText("elm.text", "Initial: 1.0");
102box_initial.packEnd(btn2); 106box_initial.packEnd(btn2);
103btn2.setVisible(true); 107btn2.setVisible(true);
104btn2.on('clicked', _btn_options_cb); 108btn2.on('clicked', _btn_options_cb);
105 109
106btn3 = new elm.Elm.Button(win); 110btn3 = new efl.Elm.Button(win);
107btn3.setText("elm.text", "Initial: 5.0"); 111btn3.setText("elm.text", "Initial: 5.0");
108box_initial.packEnd(btn3); 112box_initial.packEnd(btn3);
109btn3.setVisible(true); 113btn3.setVisible(true);
110btn3.on('clicked', _btn_options_cb); 114btn3.on('clicked', _btn_options_cb);
111 115
112box_gap = new elm.Elm.Box(win); 116box_gap = new efl.Efl.Ui.Box(win);
113box_gap.setHorizontal(true); 117box_gap.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
114box_gap.setSizeHintWeight(1.0, 0.0); 118box_gap.setHintWeight(1.0, 0.0);
115box.packEnd(box_gap); 119box.packEnd(box_gap);
116box_gap.setVisible(true); 120box_gap.setVisible(true);
117 121
118btn4 = new elm.Elm.Button(win); 122btn4 = new efl.Elm.Button(win);
119btn4.setText("elm.text", "Gap: 0.1"); 123btn4.setText("elm.text", "Gap: 0.1");
120box_gap.packEnd(btn4); 124box_gap.packEnd(btn4);
121btn4.setVisible(true); 125btn4.setVisible(true);
122btn4.on('clicked', _btn_options_cb); 126btn4.on('clicked', _btn_options_cb);
123 127
124btn5 = new elm.Elm.Button(win); 128btn5 = new efl.Elm.Button(win);
125btn5.setText("elm.text", "Gap: 0.5"); 129btn5.setText("elm.text", "Gap: 0.5");
126box_gap.packEnd(btn5); 130box_gap.packEnd(btn5);
127btn5.setVisible(true); 131btn5.setVisible(true);
128btn5.on('clicked', _btn_options_cb); 132btn5.on('clicked', _btn_options_cb);
129 133
130btn6 = new elm.Elm.Button(win); 134btn6 = new efl.Elm.Button(win);
131btn6.setText("elm.text", "Gap: 1.0"); 135btn6.setText("elm.text", "Gap: 1.0");
132box_gap.packEnd(btn6); 136box_gap.packEnd(btn6);
133btn6.setVisible(true); 137btn6.setVisible(true);
@@ -136,72 +140,72 @@ btn6.on('clicked', _btn_options_cb);
136up.setAutorepeat(true); 140up.setAutorepeat(true);
137up.setAutorepeatInitialTimeout(1.0); 141up.setAutorepeatInitialTimeout(1.0);
138up.setAutorepeatGapTimeout(0.5); 142up.setAutorepeatGapTimeout(0.5);
139up.setSizeHintWeight(1.0, 0.0); 143up.setHintWeight(1.0, 0.0);
140up.setSizeHintAlign(-1.0, 0.0); 144up.setHintAlign(-1.0, 0.0);
141box.packEnd(up); 145box.packEnd(up);
142up.setVisible(true); 146up.setVisible(true);
143up.on('repeated', _btn_cursors_move) 147up.on('repeated', _btn_cursors_move)
144up.on('unpressed', _btn_cursors_release); 148up.on('unpressed', _btn_cursors_release);
145icon_up = new elm.Elm.Icon(win); 149icon_up = new efl.Elm.Icon(win);
146icon_up.setStandard("arrow_up"); 150icon_up.setIcon("arrow_up");
147up.contentSet("icon", icon_up); 151setIcon(up, icon_up);
148 152
149box_inferior = new elm.Elm.Box(win); 153box_inferior = new efl.Efl.Ui.Box(win);
150box_inferior.setHorizontal(true); 154box_inferior.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
151box_inferior.setSizeHintWeight(1.0, 1.0); 155box_inferior.setHintWeight(1.0, 1.0);
152box_inferior.setSizeHintAlign(-1.0, -1.0); 156box_inferior.setHintAlign(-1.0, -1.0);
153box.packEnd(box_inferior); 157box.packEnd(box_inferior);
154box_inferior.setVisible(true); 158box_inferior.setVisible(true);
155 159
156left.setAutorepeat(true); 160left.setAutorepeat(true);
157left.setAutorepeatInitialTimeout(1.0); 161left.setAutorepeatInitialTimeout(1.0);
158left.setAutorepeatGapTimeout(0.5); 162left.setAutorepeatGapTimeout(0.5);
159left.setSizeHintWeight(0.0, 1.0); 163left.setHintWeight(0.0, 1.0);
160left.setSizeHintAlign(0.0, -1.0); 164left.setHintAlign(0.0, -1.0);
161box_inferior.packEnd(left); 165box_inferior.packEnd(left);
162left.setVisible(true); 166left.setVisible(true);
163left.on('repeated', _btn_cursors_move) 167left.on('repeated', _btn_cursors_move)
164left.on('unpressed', _btn_cursors_release); 168left.on('unpressed', _btn_cursors_release);
165 169
166icon_left = new elm.Elm.Icon(win); 170icon_left = new efl.Elm.Icon(win);
167icon_left.setStandard("arrow_left"); 171icon_left.setIcon("arrow_left");
168left.contentSet("icon", icon_left); 172setIcon(left, icon_left);
169 173
170mid.setSizeHintWeight(1.0, 1.0); 174mid.setHintWeight(1.0, 1.0);
171box_inferior.packEnd(mid); 175box_inferior.packEnd(mid);
172mid.setVisible(true); 176mid.setVisible(true);
173 177
174icon_mid = new elm.Elm.Icon(win); 178icon_mid = new efl.Elm.Icon(win);
175icon_mid.setStandard("close"); 179icon_mid.setIcon("close");
176mid.contentSet("icon", icon_mid); 180setIcon(mid, icon_mid);
177 181
178right.setAutorepeat(true); 182right.setAutorepeat(true);
179right.setAutorepeatInitialTimeout(1.0); 183right.setAutorepeatInitialTimeout(1.0);
180right.setAutorepeatGapTimeout(0.5); 184right.setAutorepeatGapTimeout(0.5);
181right.setSizeHintWeight(0.0, 1.0); 185right.setHintWeight(0.0, 1.0);
182right.setSizeHintAlign(0.0, -1.0); 186right.setHintAlign(0.0, -1.0);
183box_inferior.packEnd(right); 187box_inferior.packEnd(right);
184right.setVisible(true); 188right.setVisible(true);
185right.on('repeated', _btn_cursors_move); 189right.on('repeated', _btn_cursors_move);
186right.on('unpressed', _btn_cursors_release); 190right.on('unpressed', _btn_cursors_release);
187 191
188icon_right = new elm.Elm.Icon(win); 192icon_right = new efl.Elm.Icon(win);
189icon_right.setStandard("arrow_right"); 193icon_right.setIcon("arrow_right");
190right.contentSet("icon", icon_right); 194setIcon(right, icon_right);
191 195
192down.setAutorepeat(true); 196down.setAutorepeat(true);
193down.setAutorepeatInitialTimeout(1.0); 197down.setAutorepeatInitialTimeout(1.0);
194down.setAutorepeatGapTimeout(0.5); 198down.setAutorepeatGapTimeout(0.5);
195down.setSizeHintWeight(1.0, 0.0); 199down.setHintWeight(1.0, 0.0);
196down.setSizeHintAlign(-1.0, 0.0); 200down.setHintAlign(-1.0, 0.0);
197box.packEnd(down); 201box.packEnd(down);
198down.setVisible(true); 202down.setVisible(true);
199down.on('repeated', _btn_cursors_move); 203down.on('repeated', _btn_cursors_move);
200down.on('unpressed', _btn_cursors_release); 204down.on('unpressed', _btn_cursors_release);
201 205
202icon_down = new elm.Elm.Icon(win); 206icon_down = new efl.Elm.Icon(win);
203icon_down.setStandard("arrow_down"); 207icon_down.setIcon("arrow_down");
204down.contentSet("icon", icon_down); 208setIcon(down, icon_down);
205 209
206win.setSize(300, 320); 210win.setSize(300, 320);
207win.setVisible(true); 211win.setVisible(true);
diff --git a/src/examples/elementary/calendar_example_01.js b/src/examples/elementary/calendar_example_01.js
index 980bf83a29..bd0f1113ca 100644
--- a/src/examples/elementary/calendar_example_01.js
+++ b/src/examples/elementary/calendar_example_01.js
@@ -1,14 +1,14 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Calendar Creation Example"); 5win.setText("Calendar Creation Example");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9cal = new elm.Elm.Calendar(win); 8cal = new efl.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0); 9cal.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal); 10win.pack(cal);
11win.setSize(240, 240);
12cal.setVisible(true); 12cal.setVisible(true);
13 13
14win.setVisible(true); 14win.setVisible(true);
diff --git a/src/examples/elementary/calendar_example_02.js b/src/examples/elementary/calendar_example_02.js
index c8b53fd755..535519266b 100644
--- a/src/examples/elementary/calendar_example_02.js
+++ b/src/examples/elementary/calendar_example_02.js
@@ -1,15 +1,16 @@
1elm = require('elm'); 1efl = require('efl');
2 2
3//var weekdays = ["S", "M", "T", "W", "T", "F", "S"]; 3//var weekdays = ["S", "M", "T", "W", "T", "F", "S"];
4 4
5win = new elm.Elm.WinStandard(null); 5win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Calendar Layout Formatting Example"); 6win.setText("Calendar Layout Formatting Example");
7win.setAutohide(true); 7win.setAutohide(true);
8 8
9cal = new elm.Elm.Calendar(win); 9cal = new efl.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0); 10cal.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal);
12 11
12win.pack(cal);
13win.setSize(240, 240);
13//cal.format_function_set(funtion); 14//cal.format_function_set(funtion);
14//cal.weekdays_names_set(weekdays); 15//cal.weekdays_names_set(weekdays);
15 16
diff --git a/src/examples/elementary/calendar_example_03.js b/src/examples/elementary/calendar_example_03.js
index 481079fc68..af6ed84148 100644
--- a/src/examples/elementary/calendar_example_03.js
+++ b/src/examples/elementary/calendar_example_03.js
@@ -1,14 +1,14 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Calendar Min/Max Year Example"); 5win.setText("Calendar Min/Max Year Example");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9cal = new elm.Elm.Calendar(win); 8cal = new efl.Elm.Calendar(win);
10cal.setSizeHintWeight(1.0, 1.0); 9cal.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(cal); 10win.pack(cal);
11win.setSize(240, 240);
12cal.setMinMaxYear(2020,2022); 12cal.setMinMaxYear(2020,2022);
13cal.setVisible(true); 13cal.setVisible(true);
14 14
diff --git a/src/examples/elementary/calendar_example_04.js b/src/examples/elementary/calendar_example_04.js
index 7f1094149a..5f2352593b 100644
--- a/src/examples/elementary/calendar_example_04.js
+++ b/src/examples/elementary/calendar_example_04.js
@@ -1,27 +1,26 @@
1 1
2elm = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Calendar Day Selection Example"); 5win.setText("Calendar Day Selection Example");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9box = new elm.Elm.Box(win); 8box = new efl.Efl.Ui.Box(win);
10box.setSizeHintWeight(1.0, 1.0); 9box.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(box); 10win.pack(box);
12box.setVisible(true); 11box.setVisible(true);
13 12
14cal = new elm.Elm.Calendar(win); 13cal = new efl.Elm.Calendar(win);
15cal.setSizeHintWeight(1.0, 1.0); 14cal.setHintWeight(1.0, 1.0);
16cal.setSizeHintAlign(-1.0, -1.0); 15cal.setHintAlign(-1.0, -1.0);
17cal.setSelectMode(elm.Elm.Calendar.Select.Mode.NONE); 16cal.setSelectMode(efl.Elm.Calendar.Select.Mode.NONE);
18win.resizeObjectAdd(cal); 17win.pack(cal);
19cal.setVisible(true); 18cal.setVisible(true);
20box.packEnd(cal); 19box.packEnd(cal);
21 20
22cal2 = new elm.Elm.Calendar(win); 21cal2 = new efl.Elm.Calendar(win);
23cal2.setSizeHintWeight(1.0, 1.0); 22cal2.setHintWeight(1.0, 1.0);
24cal2.setSizeHintAlign(-1.0, -1.0); 23cal2.setHintAlign(-1.0, -1.0);
25// selected_time_set uses tm* struct 24// selected_time_set uses tm* struct
26//dateCurrent = new Date(); 25//dateCurrent = new Date();
27//dateSelected = dateCurrent.getSeconds() + 2 * 3600 * 24; 26//dateSelected = dateCurrent.getSeconds() + 2 * 3600 * 24;
@@ -29,4 +28,5 @@ cal2.setSizeHintAlign(-1.0, -1.0);
29cal2.setVisible(true); 28cal2.setVisible(true);
30box.packEnd(cal2); 29box.packEnd(cal2);
31 30
31win.setSize(240, 480);
32win.setVisible(true); 32win.setVisible(true);
diff --git a/src/examples/elementary/calendar_example_05.js b/src/examples/elementary/calendar_example_05.js
index 7759b2da8b..d29f8b58b4 100644
--- a/src/examples/elementary/calendar_example_05.js
+++ b/src/examples/elementary/calendar_example_05.js
@@ -1,5 +1,5 @@
1 1
2elm = require('elm'); 2efl = require('efl');
3 3
4_print_cal_info_cb = function () 4_print_cal_info_cb = function ()
5{ 5{
@@ -7,7 +7,7 @@ _print_cal_info_cb = function ()
7 7
8 var interval = cal.getInterval(); 8 var interval = cal.getInterval();
9 var mm_yr = cal.getMinMaxYear(); 9 var mm_yr = cal.getMinMaxYear();
10 var sel_enable = cal.getSelectMode() != elm.Elm.Calendar.Select.Mode.NONE; 10 var sel_enable = cal.getSelectMode() != efl.Elm.Calendar.Select.Mode.NONE;
11 var wds = cal.getWeekdaysNames(); 11 var wds = cal.getWeekdaysNames();
12 12
13 console.log("weekdays= " + wds + ", interval= " + interval + 13 console.log("weekdays= " + wds + ", interval= " + interval +
@@ -15,13 +15,14 @@ _print_cal_info_cb = function ()
15} 15}
16 16
17 17
18win = new elm.Elm.WinStandard(null); 18win = new efl.Efl.Ui.Win.Standard(null);
19win.setTitle("Calendar Getters Example"); 19win.setText("Calendar Getters Example");
20win.setAutohide(true); 20win.setAutohide(true);
21 21
22cal = new elm.Elm.Calendar(win); 22cal = new efl.Elm.Calendar(win);
23cal.setSizeHintWeight(1.0, 1.0); 23cal.setHintWeight(1.0, 1.0);
24win.resizeObjectAdd(cal); 24win.pack(cal);
25win.setSize(240, 240);
25 26
26cal.on('changed', _print_cal_info_cb); 27cal.on('changed', _print_cal_info_cb);
27 28
diff --git a/src/examples/elementary/clock_example.js b/src/examples/elementary/clock_example.js
index f13c07e721..313a30d3a0 100644
--- a/src/examples/elementary/clock_example.js
+++ b/src/examples/elementary/clock_example.js
@@ -1,30 +1,32 @@
1elm = require('elm'); 1efl = require('efl');
2 2
3win = new elm.Elm.WinStandard(null); 3win = new efl.Efl.Ui.Win.Standard(null);
4win.setTitle("Clock Example"); 4win.setText("Clock Example");
5win.setAutohide(true); 5win.setAutohide(true);
6win.setSize(480, 240);
6 7
7bx = new elm.Elm.Box(win); 8bx = new efl.Efl.Ui.Box(win);
8bx.setSizeHintWeight(1.0, 1.0); 9bx.setHintWeight(1.0, 1.0);
9win.resizeObjectAdd(bx); 10win.pack(bx);
10bx.setVisible(true); 11bx.setVisible(true);
12bx.setOrientation(efl.Efl.Orient.VERTICAL);
11 13
12ck = new elm.Elm.Clock(win); 14ck = new efl.Elm.Clock(win);
13bx.packEnd(ck); 15bx.packEnd(ck);
14ck.setVisible(true); 16ck.setVisible(true);
15 17
16ck2 = new elm.Elm.Clock(win); 18ck2 = new efl.Elm.Clock(win);
17ck2.setShowAmPm(true); 19ck2.setShowAmPm(true);
18bx.packEnd(ck2); 20bx.packEnd(ck2);
19ck2.setVisible(true); 21ck2.setVisible(true);
20 22
21ck3 = new elm.Elm.Clock(win); 23ck3 = new efl.Elm.Clock(win);
22ck3.setShowSeconds(true); 24ck3.setShowSeconds(true);
23ck3.setTime(10, 11, 12); 25ck3.setTime(10, 11, 12);
24bx.packEnd(ck3); 26bx.packEnd(ck3);
25ck3.setVisible(true); 27ck3.setVisible(true);
26 28
27ck4 = new elm.Elm.Clock(win); 29ck4 = new efl.Elm.Clock(win);
28ck4.setEdit(true); 30ck4.setEdit(true);
29ck4.setShowSeconds(true); 31ck4.setShowSeconds(true);
30ck4.setShowAmPm(true); 32ck4.setShowAmPm(true);
@@ -32,12 +34,13 @@ ck4.setTime(10, 11, 12);
32bx.packEnd(ck4); 34bx.packEnd(ck4);
33ck4.setVisible(true); 35ck4.setVisible(true);
34 36
35ck5 = new elm.Elm.Clock(win); 37ck5 = new efl.Elm.Clock(win);
36ck5.setShowSeconds(true); 38ck5.setShowSeconds(true);
37ck5.setEdit(true); 39ck5.setEdit(true);
38digedit = elm.Elm.Clock.EditMode.HOUR_UNIT | elm.Elm.Clock.EditMode.MIN_UNIT | elm.Elm.Clock.EditMode.SEC_UNIT; 40digedit = efl.Elm.Clock.EditMode.HOUR_UNIT | efl.Elm.Clock.EditMode.MIN_UNIT | efl.Elm.Clock.EditMode.SEC_UNIT;
39ck5.setEditMode(digedit); 41ck5.setEditMode(digedit);
40bx.packEnd(ck5); 42bx.packEnd(ck5);
41ck5.setVisible(true); 43ck5.setVisible(true);
42 44
45
43win.setVisible(true); 46win.setVisible(true);
diff --git a/src/examples/elementary/datetime_example.js b/src/examples/elementary/datetime_example.js
index 92b361ec8a..0047d03c24 100644
--- a/src/examples/elementary/datetime_example.js
+++ b/src/examples/elementary/datetime_example.js
@@ -1,41 +1,42 @@
1 1
2elm = require('elm'); 2efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Datetime"); 5win.setText("Datetime");
6win.setAutohide(true); 6win.setAutohide(true);
7win.setSize(320,240);
7 8
8bg = new elm.Elm.Bg(win); 9bg = new efl.Elm.Bg(win);
9bg.setSizeHintWeight(1.0, 1.0); 10bg.setHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bg); 11win.pack(bg);
11bg.setVisible(true); 12bg.setVisible(true);
12 13
13bx = new elm.Elm.Box(win); 14bx = new efl.Efl.Ui.Box(win);
14bx.setSizeHintWeight(1.0, 1.0); 15bx.setHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bx); 16win.pack(bx);
16bx.setVisible(true); 17bx.setVisible(true);
17 18
18datetime = new elm.Elm.Datetime(bx); 19datetime = new efl.Elm.Datetime(bx);
19datetime.setSizeHintWeight(1.0, 1.0); 20datetime.setHintWeight(1.0, 1.0);
20datetime.setSizeHintAlign(-1.0, 0.5); 21datetime.setHintAlign(-1.0, 0.5);
21datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.HOUR, false); 22datetime.setFieldVisible(efl.Elm.Datetime.FieldType.HOUR, false);
22datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.MINUTE, false); 23datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MINUTE, false);
23datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.AMPM, false); 24datetime.setFieldVisible(efl.Elm.Datetime.FieldType.AMPM, false);
24bx.packEnd(datetime); 25bx.packEnd(datetime);
25datetime.setVisible(true); 26datetime.setVisible(true);
26 27
27datetime = new elm.Elm.Datetime(bx); 28datetime = new efl.Elm.Datetime(bx);
28datetime.setSizeHintWeight(1.0, 1.0); 29datetime.setHintWeight(1.0, 1.0);
29datetime.setSizeHintAlign(-1.0, 0.5); 30datetime.setHintAlign(-1.0, 0.5);
30datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.YEAR, false); 31datetime.setFieldVisible(efl.Elm.Datetime.FieldType.YEAR, false);
31datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.MONTH, false); 32datetime.setFieldVisible(efl.Elm.Datetime.FieldType.MONTH, false);
32datetime.fieldVisibleSet(elm.Elm.Datetime.FieldType.DATE, false); 33datetime.setFieldVisible(efl.Elm.Datetime.FieldType.DATE, false);
33bx.packEnd(datetime); 34bx.packEnd(datetime);
34datetime.setVisible(true); 35datetime.setVisible(true);
35 36
36datetime = new elm.Elm.Datetime(bx); 37datetime = new efl.Elm.Datetime(bx);
37datetime.setSizeHintWeight(1.0, 1.0); 38datetime.setHintWeight(1.0, 1.0);
38datetime.setSizeHintAlign(-1.0, 0.5); 39datetime.setHintAlign(-1.0, 0.5);
39bx.packEnd(datetime); 40bx.packEnd(datetime);
40datetime.setVisible(true); 41datetime.setVisible(true);
41 42
diff --git a/src/examples/elementary/icon_example_01.js b/src/examples/elementary/icon_example_01.js
index a1689349c9..78f6e2b1e1 100644
--- a/src/examples/elementary/icon_example_01.js
+++ b/src/examples/elementary/icon_example_01.js
@@ -1,12 +1,11 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Icon Plain"); 5win.setText("Icon Plain");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9icon = new elm.Elm.Icon(win); 8icon = new efl.Elm.Icon(win);
10//icon.order_lookup_set(ELM_ICON_LOOKUP_THEME_FDO); Ja eh o default 9//icon.order_lookup_set(ELM_ICON_LOOKUP_THEME_FDO); Ja eh o default
11icon.setStandard("home"); 10icon.setStandard("home");
12 11
@@ -25,8 +24,8 @@ icon.setResizable(false, true);
25icon.setSmooth(false); 24icon.setSmooth(false);
26icon.setFillOutside(true); 25icon.setFillOutside(true);
27 26
28icon.setSizeHintWeight(1.0, 1.0); 27icon.setHintWeight(1.0, 1.0);
29win.resizeObjectAdd(icon); 28win.pack(icon);
30icon.setVisible(true); 29icon.setVisible(true);
31 30
32win.setSize(320, 320); 31win.setSize(320, 320);
diff --git a/src/examples/elementary/layout_example.js b/src/examples/elementary/layout_example.js
index d6e5dd7024..0221d40161 100644
--- a/src/examples/elementary/layout_example.js
+++ b/src/examples/elementary/layout_example.js
@@ -1,15 +1,15 @@
1 1path = require('path');
2Elm = require('elm').Elm;
3efl = require('efl'); 2efl = require('efl');
4Evas = efl.Evas; 3Evas = efl.Evas;
4Elm = efl.Elm;
5 5
6win = new Elm.WinStandard(null); 6win = new efl.Efl.Ui.Win.Standard(null);
7win.setTitle("Layout"); 7win.setText('Layout');
8win.setAutohide(true); 8win.setAutohide(true);
9 9
10box = new Elm.Box(win); 10box = new efl.Efl.Ui.Box(win);
11box.setSizeHintWeight(1.0, 1.0); 11box.setHintWeight(1.0, 1.0);
12win.addResizeObject(box); 12win.pack(box);
13box.setVisible(true); 13box.setVisible(true);
14 14
15ly = new Elm.Layout(box); 15ly = new Elm.Layout(box);
@@ -20,28 +20,31 @@ if (!ly.setTheme("layout", "application", "titlebar"))
20} 20}
21 21
22ly.setPartText('elm.text', 'Some title'); 22ly.setPartText('elm.text', 'Some title');
23ly.setSizeHintWeight(1.0, 1.0); 23ly.setHintWeight(1.0, 1.0);
24ly.setSizeHintAlign(1.0, 1.0); 24ly.setHintAlign(1.0, 1.0);
25box.packEnd(ly); 25box.packEnd(ly);
26ly.setVisible(true); 26ly.setVisible(true);
27 27
28bt = new Elm.Icon(ly); 28bt = new Elm.Icon(ly);
29bt.setStandard('chat'); 29bt.setIcon('chat');
30bt.setSizeHintMin(20, 20); 30bt.setHintMin(20, 20);
31// elm_layout_icon_set(ly, bt); 31// elm_layout_icon_set(ly, bt);
32ly.setContent('elm.swallow.icon', bt); 32icon_container = ly.part('elm.swallow.icon').cast('Efl.Container');
33icon_container.setContent(bt);
33ly.emitSignal('elm,state,icon,visible', 'elm'); 34ly.emitSignal('elm,state,icon,visible', 'elm');
34 35
35bt = new Elm.Icon(ly); 36bt = new Elm.Icon(ly);
36bt.setStandard('close'); 37bt.setIcon('close');
37bt.setSizeHintMin(20, 20); 38bt.setHintMin(20, 20);
38// elm_layout_end_set(ly, bt); 39// elm_layout_end_set(ly, bt);
39ly.setContent('elm.swallow.end', bt); 40end_container = ly.part('elm.swallow.end').cast('Efl.Container');
41end_container.setContent(bt);
40ly.emitSignal('elm,state,end,visible', 'elm'); 42ly.emitSignal('elm,state,end,visible', 'elm');
41 43
42ly = new Elm.Layout(box); 44ly = new Elm.Layout(box);
43ly.setFile('/home/felipe/dev/samsung/upstream/elementary/build/data/objects/test.edj', "layout"); 45filename = path.join(__dirname, 'layout_example.edj');
44ly.setSizeHintWeight(1.0, 1.0); 46ly.setFile(filename, 'example/mylayout');
47ly.setHintWeight(1.0, 1.0);
45box.packEnd(ly); 48box.packEnd(ly);
46ly.setVisible(true); 49ly.setVisible(true);
47 50
@@ -52,11 +55,14 @@ ly.setVisible(true);
52 55
53bt = new Elm.Button(ly); 56bt = new Elm.Button(ly);
54bt.setPartText(null, "Button 1"); 57bt.setPartText(null, "Button 1");
55ly.setContent("element1", bt); 58console.log("Will get part");
59element_container = ly.part('example/custom').cast('Efl.Container');
60console.log("Will setcontent on part");
61element_container.setContent(bt);
56 62
57bt.on("clicked", function() { console.log('button clicked'); }); 63bt.on("clicked", function() { console.log('button clicked'); });
58 64
59ly.setPartCursor("text", 'watch'); 65ly.setPartCursor("example/title", 'watch');
60ly.on('mouse,down', function() { console.log('layout mouse down') }); 66ly.on('mouse,down', function() { console.log('layout mouse down') });
61ly.on('mouse,up', function() { console.log('layout mouse up') }); 67ly.on('mouse,up', function() { console.log('layout mouse up') });
62 68
diff --git a/src/examples/elementary/menu_example_01.js b/src/examples/elementary/menu_example_01.js
index 5ddf9cb120..e9277943b4 100644
--- a/src/examples/elementary/menu_example_01.js
+++ b/src/examples/elementary/menu_example_01.js
@@ -1,13 +1,12 @@
1efl = require('efl'); 1efl = require('efl');
2elm = require('elm');
3 2
4win = new elm.Elm.WinStandard(null); 3win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Menu"); 4win.setText("Menu");
6win.setAutohide(true); 5win.setAutohide(true);
7 6
8rect = new efl.Evas.Rectangle(win); 7rect = new efl.Efl.Canvas.Rectangle(win);
9win.resizeObjectAdd(rect); 8win.pack(rect);
10rect.setSizeHintMin( 0, 0); 9rect.setHintMin( 0, 0);
11rect.setColor( 0, 0, 0, 0); 10rect.setColor( 0, 0, 0, 0);
12rect.setVisible(true); 11rect.setVisible(true);
13 12
diff --git a/src/examples/elementary/popup_example_01.js b/src/examples/elementary/popup_example_01.js
index 2e39763c0a..42cf39c8ed 100644
--- a/src/examples/elementary/popup_example_01.js
+++ b/src/examples/elementary/popup_example_01.js
@@ -1,14 +1,13 @@
1efl = require('efl'); 1efl = require('efl');
2elm = require('elm');
3 2
4win = new elm.Elm.WinStandard(null); 3win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Popup"); 4win.setText("Popup");
6win.setAutohide(true); 5win.setAutohide(true);
7 6
8content = new elm.Elm.Label(win); 7content = new efl.Elm.Label(win);
9content.setText("elm.text", "<align=center>Content</align>"); 8content.setText("elm.text", "<align=center>Content</align>");
10 9
11popup = new elm.Elm.Popup(win); 10popup = new efl.Elm.Popup(win);
12popup.setTimeout(3); 11popup.setTimeout(3);
13 12
14popup.on('timeout', function() 13popup.on('timeout', function()
@@ -17,7 +16,8 @@ popup.on('timeout', function()
17 popup.setVisible(false); 16 popup.setVisible(false);
18 }); 17 });
19 18
20popup.contentSet("elm.swallow.content", content); 19content_container = popup.part("elm.swallow.content").cast("Efl.Container");
20content_container.setContent(content);
21 21
22popup.setText("title,text", "Title"); 22popup.setText("title,text", "Title");
23popup.setVisible(true); 23popup.setVisible(true);
diff --git a/src/examples/elementary/radio_example_01.js b/src/examples/elementary/radio_example_01.js
index 380b0940f2..5d6b9a08cb 100644
--- a/src/examples/elementary/radio_example_01.js
+++ b/src/examples/elementary/radio_example_01.js
@@ -1,63 +1,63 @@
1 1
2elm = require('elm'); 2efl = require('efl');
3 3
4_cb = function(obj){ 4_cb = function(obj){
5 console.log(obj.getText("elm.text"), "state value:", obj.getStateValue()); 5 console.log(obj.getText("elm.text"), "state value:", obj.getStateValue());
6} 6}
7 7
8win = new elm.Elm.WinStandard(null); 8win = new efl.Efl.Ui.Win.Standard(null);
9win.setTitle("Radio"); 9win.setText("Radio");
10win.setAutohide(true); 10win.setAutohide(true);
11 11
12bx = new elm.Elm.Box(win); 12bx = new efl.Efl.Ui.Box(win);
13bx.setHorizontal(true); 13bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
14bx.setSizeHintWeight(1.0, 1.0); 14bx.setHintWeight(1.0, 1.0);
15win.resizeObjectAdd(bx); 15win.pack(bx);
16bx.setVisible(true); 16bx.setVisible(true);
17 17
18radio_g = new elm.Elm.Radio(win); 18radio_g = new efl.Elm.Radio(win);
19radio_g.setText("elm.text", "Radio 1"); 19radio_g.setText("elm.text", "Radio 1");
20radio_g.setStateValue(1); 20radio_g.setStateValue(1);
21radio_g.setValue(1); 21radio_g.setValue(1);
22ic = new elm.Elm.Icon(win); 22ic = new efl.Elm.Icon(win);
23ic.setStandard("home"); 23ic.setIcon("home");
24radio_g.contentSet("icon", ic); 24radio_g.part("icon").cast("Efl.Container").setContent(ic);
25bx.packEnd(radio_g); 25bx.packEnd(radio_g);
26radio_g.setSizeHintWeight(1.0, 1.0); 26radio_g.setHintWeight(1.0, 1.0);
27radio_g.setSizeHintAlign(-1.0, -1.0); 27radio_g.setHintAlign(-1.0, -1.0);
28radio_g.on('changed', _cb); 28radio_g.on('changed', _cb);
29radio_g.setVisible(true); 29radio_g.setVisible(true);
30 30
31radio = new elm.Elm.Radio(win); 31radio = new efl.Elm.Radio(win);
32radio.setText("elm.text", "Radio 2"); 32radio.setText("elm.text", "Radio 2");
33radio.setStateValue(2); 33radio.setStateValue(2);
34radio.groupAdd(radio_g); 34radio.addGroup(radio_g);
35ic = new elm.Elm.Icon(win); 35ic = new efl.Elm.Icon(win);
36ic.setStandard("file"); 36ic.setIcon("file");
37radio.contentSet("icon", ic); 37radio.part("icon").cast("Efl.Container").setContent(ic);
38bx.packEnd(radio); 38bx.packEnd(radio);
39radio.setSizeHintWeight(1.0, 1.0); 39radio.setHintWeight(1.0, 1.0);
40radio.setSizeHintAlign(-1.0, -1.0); 40radio.setHintAlign(-1.0, -1.0);
41radio.on('changed', _cb); 41radio.on('changed', _cb);
42radio.setVisible(true); 42radio.setVisible(true);
43 43
44radio = new elm.Elm.Radio(win); 44radio = new efl.Elm.Radio(win);
45radio.setText("elm.text", "Radio 3"); 45radio.setText("elm.text", "Radio 3");
46radio.setStateValue(3); 46radio.setStateValue(3);
47radio.groupAdd(radio_g); 47radio.addGroup(radio_g);
48bx.packEnd(radio); 48bx.packEnd(radio);
49radio.setSizeHintWeight(1.0, 1.0); 49radio.setHintWeight(1.0, 1.0);
50radio.setSizeHintAlign(-1.0, -1.0); 50radio.setHintAlign(-1.0, -1.0);
51radio.on('changed', _cb); 51radio.on('changed', _cb);
52radio.setVisible(true); 52radio.setVisible(true);
53 53
54radio = new elm.Elm.Radio(win); 54radio = new efl.Elm.Radio(win);
55radio.setText("elm.text", "Radio 4"); 55radio.setText("elm.text", "Radio 4");
56radio.setStateValue(4); 56radio.setStateValue(4);
57radio.groupAdd(radio_g); 57radio.addGroup(radio_g);
58bx.packEnd(radio); 58bx.packEnd(radio);
59radio.setSizeHintWeight(1.0, 1.0); 59radio.setHintWeight(1.0, 1.0);
60radio.setSizeHintAlign(-1.0, -1.0); 60radio.setHintAlign(-1.0, -1.0);
61radio.on('changed', _cb); 61radio.on('changed', _cb);
62radio.setVisible(true); 62radio.setVisible(true);
63 63
diff --git a/src/examples/elementary/separator_example_01.js b/src/examples/elementary/separator_example_01.js
index 53fc3cafa1..fa4097f37b 100644
--- a/src/examples/elementary/separator_example_01.js
+++ b/src/examples/elementary/separator_example_01.js
@@ -1,40 +1,40 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Separator"); 5win.setText("Separator");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9bg = new elm.Elm.Bg(win); 8bg = new efl.Elm.Bg(win);
10bg.setSizeHintWeight(1.0, 1.0); 9bg.setHintWeight(1.0, 1.0);
11win.resizeObjectAdd(bg); 10win.setSize(640, 480);
11win.pack(bg);
12bg.setVisible(true); 12bg.setVisible(true);
13 13
14bx = new elm.Elm.Box(win); 14bx = new efl.Efl.Ui.Box(win);
15bx.setHorizontal(true); 15bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
16bx.setSizeHintWeight(1.0, 1.0); 16bx.setHintWeight(1.0, 1.0);
17win.resizeObjectAdd(bx); 17win.pack(bx);
18bx.setVisible(true); 18bx.setVisible(true);
19 19
20rect = new efl.Evas.Rectangle(win); 20rect = new efl.Efl.Canvas.Rectangle(win);
21rect.setColor( 0, 255, 0, 255) 21rect.setColor( 0, 255, 0, 255)
22rect.setSizeHintMin( 90, 200); 22rect.setHintMin( 90, 200);
23rect.setSizeHintWeight(1.0, 1.0); 23rect.setHintWeight(1.0, 1.0);
24rect.setSizeHintAlign(-1.0, -1.0); 24rect.setHintAlign(-1.0, -1.0);
25rect.setVisible(true); 25rect.setVisible(true);
26bx.packEnd(rect); 26bx.packEnd(rect);
27 27
28separator = new elm.Elm.Separator(win); 28separator = new efl.Elm.Separator(win);
29separator.setHorizontal(true); 29separator.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
30separator.setVisible(true); 30separator.setVisible(true);
31bx.packEnd(separator); 31bx.packEnd(separator);
32 32
33rect2 = new efl.Evas.Rectangle(win); 33rect2 = new efl.Efl.Canvas.Rectangle(win);
34rect2.setColor( 0, 0, 255, 255); 34rect2.setColor( 0, 0, 255, 255);
35rect2.setSizeHintMin( 90, 200); 35rect2.setHintMin( 90, 200);
36rect2.setSizeHintWeight(1.0, 1.0); 36rect2.setHintWeight(1.0, 1.0);
37rect2.setSizeHintAlign(-1.0, -1.0); 37rect2.setHintAlign(-1.0, -1.0);
38rect2.setVisible(true); 38rect2.setVisible(true);
39bx.packEnd(rect2); 39bx.packEnd(rect2);
40 40
diff --git a/src/examples/elementary/slider_example.js b/src/examples/elementary/slider_example.js
index a31692a762..59675fc43e 100644
--- a/src/examples/elementary/slider_example.js
+++ b/src/examples/elementary/slider_example.js
@@ -1,72 +1,72 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
6win.setTitle("Slider Example"); 5win.setText("Slider Example");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9bx = new elm.Elm.Box(win); 8bx = new efl.Efl.Ui.Box(win);
10//bx.setHorizontal(true); 9bx.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.HORIZONTAL);
11bx.setSizeHintWeight(1.0, 1.0); 10bx.setHintWeight(1.0, 1.0);
12win.resizeObjectAdd(bx); 11win.pack(bx);
13bx.setVisible(true); 12bx.setVisible(true);
14 13
15sl = new elm.Elm.Slider(win); 14sl = new efl.Elm.Slider(win);
16sl.setSizeHintAlign(-1.0, 0.5); 15sl.setHintAlign(-1.0, 0.5);
17sl.setSizeHintWeight(1.0, 1.0); 16sl.setHintWeight(1.0, 1.0);
18bx.packEnd(sl); 17bx.packEnd(sl);
19sl.setVisible(true); 18sl.setVisible(true);
20 19
21/* with icon, end and label */ 20/* with icon, end and label */
22sl = new elm.Elm.Slider(win); 21sl = new efl.Elm.Slider(win);
23sl.setText("elm.text", "Counter"); 22sl.setText("elm.text", "Counter");
24 23
25ic = new elm.Elm.Icon(win); 24ic = new efl.Elm.Icon(win);
26ic.setStandard("home"); 25ic.setIcon("home");
27ic.setResizable(false, false); 26// ic.setResizable(false, false);
28sl.contentSet("icon", ic); 27sl.part("icon").cast("Efl.Container").setContent(ic);
29 28
30ic = new elm.Elm.Icon(win); 29ic = new efl.Elm.Icon(win);
31ic.setStandard("folder"); 30ic.setIcon("folder");
32ic.setResizable(false, false); 31// ic.setResizable(false, false);
33sl.contentSet("end", ic); 32sl.part("end").cast("Efl.Container").setContent(ic);
34 33
35sl.setSizeHintAlign(-1.0, 0.5); 34sl.setHintAlign(-1.0, 0.5);
36sl.setSizeHintWeight(1.0, 1.0); 35sl.setHintWeight(1.0, 1.0);
37bx.packEnd(sl); 36bx.packEnd(sl);
38sl.setVisible(true); 37sl.setVisible(true);
39 38
40/* value set and span size */ 39/* value set and span size */
41sl = new elm.Elm.Slider(win); 40sl = new efl.Elm.Slider(win);
42sl.setValue(1); 41sl.setProgressValue(1);
43sl.setSpanSize(200); 42sl.setSpanSize(200);
44sl.setSizeHintAlign(-1.0, 0.5); 43sl.setHintAlign(-1.0, 0.5);
45sl.setSizeHintWeight(1.0, 1.0); 44sl.setHintWeight(1.0, 1.0);
46bx.packEnd(sl); 45bx.packEnd(sl);
47sl.setVisible(true); 46sl.setVisible(true);
48 47
49/* with unit label and min - max */ 48/* with unit label and min - max */
50sl = new elm.Elm.Slider(win); 49sl = new efl.Elm.Slider(win);
51sl.setUnitFormat("%1.0f units"); 50sl.setUnitFormat("%1.0f units");
52sl.setMinMax(0, 100); 51sl.setMinMax(0, 100);
53sl.setSizeHintAlign(-1.0, 0.5); 52sl.setHintAlign(-1.0, 0.5);
54sl.setSizeHintWeight(1.0, 1.0); 53sl.setHintWeight(1.0, 1.0);
55bx.packEnd(sl); 54bx.packEnd(sl);
56sl.setVisible(true); 55sl.setVisible(true);
57 56
58/* with indicator label and inverted */ 57/* with indicator label and inverted */
59sl = new elm.Elm.Slider(win); 58sl = new efl.Elm.Slider(win);
60sl.setIndicatorFormat("%1.2f"); 59sl.setIndicatorFormat("%1.2f");
61sl.setInverted(true); 60// legacy function, not supported.
62sl.setSizeHintAlign(-1.0, 0.5); 61// sl.setInverted(true);
63sl.setSizeHintWeight(1.0, 1.0); 62sl.setHintAlign(-1.0, 0.5);
63sl.setHintWeight(1.0, 1.0);
64bx.packEnd(sl); 64bx.packEnd(sl);
65sl.setVisible(true); 65sl.setVisible(true);
66 66
67/* vertical with indicator format func */ 67/* vertical with indicator format func */
68sl = new elm.Elm.Slider(win); 68sl = new efl.Elm.Slider(win);
69sl.setHorizontal(false); 69sl.cast("Efl.Orientation").setOrientation(efl.Efl.Orient.VERTICAL);
70//indicator_format = function() 70//indicator_format = function()
71// { 71// {
72// indicator = new char[32]; 72// indicator = new char[32];
@@ -76,28 +76,28 @@ sl.setHorizontal(false);
76//indicator_free = function() {console.log("free")} 76//indicator_free = function() {console.log("free")}
77//sl.indicator_format_function_set(indicator_format, indicator_free); 77//sl.indicator_format_function_set(indicator_format, indicator_free);
78 78
79sl.setSizeHintAlign(0.5, -1.0); 79sl.setHintAlign(0.5, -1.0);
80sl.setSizeHintWeight(0.0, 1.0); 80sl.setHintWeight(0.0, 1.0);
81bx.packEnd(sl); 81bx.packEnd(sl);
82sl.setVisible(true); 82sl.setVisible(true);
83 83
84/* callbacks */ 84/* callbacks */
85sl = new elm.Elm.Slider(win); 85sl = new efl.Elm.Slider(win);
86sl.setUnitFormat("%1.3f units"); 86sl.setUnitFormat("%1.3f units");
87sl.setSizeHintAlign(-1.0, 0.5); 87sl.setHintAlign(-1.0, 0.5);
88sl.setSizeHintWeight(1.0, 1.0); 88sl.setHintWeight(1.0, 1.0);
89bx.packEnd(sl); 89bx.packEnd(sl);
90sl.setVisible(true); 90sl.setVisible(true);
91 91
92sl.on('changed', function(obj) 92sl.on('changed', function(obj)
93 { 93 {
94 val = obj.getValue(); 94 val = obj.getProgressValue();
95 console.log("Changed to " + val); 95 console.log("Changed to " + val);
96 }); 96 });
97 97
98sl.on('delay_changed', function(obj) 98sl.on('delay_changed', function(obj)
99 { 99 {
100 val = obj.getValue(); 100 val = obj.getProgressValue();
101 console.log("Delay changed to " + val); 101 console.log("Delay changed to " + val);
102 }); 102 });
103 103
diff --git a/src/examples/elementary/spinner_example.js b/src/examples/elementary/spinner_example.js
index ab582fda7b..c01f34d6e3 100644
--- a/src/examples/elementary/spinner_example.js
+++ b/src/examples/elementary/spinner_example.js
@@ -1,76 +1,76 @@
1 1
2elm = require('elm'); 2efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Spinner Example"); 5win.setText("Spinner Example");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8bx = new elm.Elm.Box(win); 8bx = new efl.Efl.Ui.Box(win);
9bx.setSizeHintWeight(1.0, 1.0); 9bx.setHintWeight(1.0, 1.0);
10win.resizeObjectAdd(bx); 10win.pack(bx);
11bx.setVisible(true); 11bx.setVisible(true);
12 12
13sp = new elm.Elm.Spinner(win); 13sp = new efl.Elm.Spinner(win);
14sp.setSizeHintWeight(1.0, 1.0); 14sp.setHintWeight(1.0, 1.0);
15sp.setSizeHintAlign(-1.0, 0.5); 15sp.setHintAlign(-1.0, 0.5);
16bx.packEnd(sp); 16bx.packEnd(sp);
17sp.setVisible(true); 17sp.setVisible(true);
18 18
19sp2 = new elm.Elm.Spinner(win); 19sp2 = new efl.Elm.Spinner(win);
20sp2.setLabelFormat("Percentage %%%1.2f something"); 20sp2.setLabelFormat("Percentage %%%1.2f something");
21sp2.setSizeHintWeight(1.0, 1.0); 21sp2.setHintWeight(1.0, 1.0);
22sp2.setSizeHintAlign(-1.0, 0.5); 22sp2.setHintAlign(-1.0, 0.5);
23bx.packEnd(sp2); 23bx.packEnd(sp2);
24sp2.setVisible(true); 24sp2.setVisible(true);
25 25
26sp3 = new elm.Elm.Spinner(win); 26sp3 = new efl.Elm.Spinner(win);
27sp3.setLabelFormat("%1.1f units"); 27sp3.setLabelFormat("%1.1f units");
28sp3.setStep(1.5); 28sp3.setStep(1.5);
29sp3.setWrap(true); 29sp3.setWrap(true);
30sp3.setMinMax(-50.0, 250.0); 30sp3.setMinMax(-50.0, 250.0);
31sp3.setSizeHintWeight(1.0, 1.0); 31sp3.setHintWeight(1.0, 1.0);
32sp3.setSizeHintAlign(-1.0, 0.5); 32sp3.setHintAlign(-1.0, 0.5);
33bx.packEnd(sp3); 33bx.packEnd(sp3);
34sp3.setVisible(true); 34sp3.setVisible(true);
35 35
36sp4 = new elm.Elm.Spinner(win); 36sp4 = new efl.Elm.Spinner(win);
37sp4.setStyle("vertical"); 37sp4.setStyle("vertical");
38sp4.setInterval(0.2); 38sp4.setInterval(0.2);
39sp4.setSizeHintWeight(1.0, 1.0); 39sp4.setHintWeight(1.0, 1.0);
40sp4.setSizeHintAlign(-1.0, 0.5); 40sp4.setHintAlign(-1.0, 0.5);
41bx.packEnd(sp4); 41bx.packEnd(sp4);
42sp4.setVisible(true); 42sp4.setVisible(true);
43 43
44sp5 = new elm.Elm.Spinner(win); 44sp5 = new efl.Elm.Spinner(win);
45sp5.setEditable(false); 45sp5.setEditable(false);
46sp5.setSizeHintWeight(1.0, 1.0); 46sp5.setHintWeight(1.0, 1.0);
47sp5.setSizeHintAlign(-1.0, 0.5); 47sp5.setHintAlign(-1.0, 0.5);
48bx.packEnd(sp5); 48bx.packEnd(sp5);
49sp5.setVisible(true); 49sp5.setVisible(true);
50 50
51sp6 = new elm.Elm.Spinner(win); 51sp6 = new efl.Elm.Spinner(win);
52sp6.setEditable(false); 52sp6.setEditable(false);
53sp6.setMinMax(1, 12); 53sp6.setMinMax(1, 12);
54sp6.specialValueAdd(1, "January"); 54sp6.addSpecialValue(1, "January");
55sp6.specialValueAdd(2, "February"); 55sp6.addSpecialValue(2, "February");
56sp6.specialValueAdd(3, "March"); 56sp6.addSpecialValue(3, "March");
57sp6.specialValueAdd(4, "April"); 57sp6.addSpecialValue(4, "April");
58sp6.specialValueAdd(5, "May"); 58sp6.addSpecialValue(5, "May");
59sp6.specialValueAdd(6, "June"); 59sp6.addSpecialValue(6, "June");
60sp6.specialValueAdd(7, "July"); 60sp6.addSpecialValue(7, "July");
61sp6.specialValueAdd(8, "August"); 61sp6.addSpecialValue(8, "August");
62sp6.specialValueAdd(9, "September"); 62sp6.addSpecialValue(9, "September");
63sp6.specialValueAdd(10, "October"); 63sp6.addSpecialValue(10, "October");
64sp6.specialValueAdd(11, "November"); 64sp6.addSpecialValue(11, "November");
65sp6.specialValueAdd(12, "December"); 65sp6.addSpecialValue(12, "December");
66sp6.setSizeHintWeight(1.0, 1.0); 66sp6.setHintWeight(1.0, 1.0);
67sp6.setSizeHintAlign(-1.0, 0.5); 67sp6.setHintAlign(-1.0, 0.5);
68bx.packEnd(sp6); 68bx.packEnd(sp6);
69sp6.setVisible(true); 69sp6.setVisible(true);
70 70
71sp7 = new elm.Elm.Spinner(win); 71sp7 = new efl.Elm.Spinner(win);
72sp7.setSizeHintWeight(1.0, 1.0); 72sp7.setHintWeight(1.0, 1.0);
73sp7.setSizeHintAlign(-1.0, 0.5); 73sp7.setHintAlign(-1.0, 0.5);
74bx.packEnd(sp7); 74bx.packEnd(sp7);
75sp7.setVisible(true); 75sp7.setVisible(true);
76sp7.setEditable(true); 76sp7.setEditable(true);
diff --git a/src/examples/elementary/table_example_01.js b/src/examples/elementary/table_example_01.js
index 928f254945..d5de56bdb8 100644
--- a/src/examples/elementary/table_example_01.js
+++ b/src/examples/elementary/table_example_01.js
@@ -1,32 +1,32 @@
1 1
2elm = require('elm'); 2efl = require('efl');
3 3
4win = new elm.Elm.WinStandard(null); 4win = new efl.Efl.Ui.Win.Standard(null);
5win.setTitle("Table"); 5win.setText("Table");
6win.setAutohide(true); 6win.setAutohide(true);
7 7
8table = new elm.Elm.Table(win); 8table = new efl.Elm.Table(win);
9win.resizeObjectAdd(table); 9win.resizeObjectAdd(table);
10table.setVisible(true); 10table.setVisible(true);
11table.setPadding(5, 5); 11table.setPadding(5, 5);
12table.setHomogeneous(true); 12table.setHomogeneous(true);
13 13
14label = new elm.Elm.Label(win); 14label = new efl.Elm.Label(win);
15label.setText("elm.text", "label 0"); 15label.setText("elm.text", "label 0");
16label.setVisible(true); 16label.setVisible(true);
17table.pack(label, 0, 0, 1, 1); 17table.pack(label, 0, 0, 1, 1);
18 18
19label = new elm.Elm.Label(win); 19label = new efl.Elm.Label(win);
20label.setText("elm.text", "label 1"); 20label.setText("elm.text", "label 1");
21label.setVisible(true); 21label.setVisible(true);
22table.pack(label, 1, 0, 1, 1); 22table.pack(label, 1, 0, 1, 1);
23 23
24label = new elm.Elm.Label(win); 24label = new efl.Elm.Label(win);
25label.setText("elm.text", "label 2"); 25label.setText("elm.text", "label 2");
26label.setVisible(true); 26label.setVisible(true);
27table.pack(label, 0, 1, 1, 1); 27table.pack(label, 0, 1, 1, 1);
28 28
29label = new elm.Elm.Label(win); 29label = new efl.Elm.Label(win);
30label.setText("elm.text", "label 3"); 30label.setText("elm.text", "label 3");
31label.setVisible(true); 31label.setVisible(true);
32table.pack(label, 1, 1, 1, 1); 32table.pack(label, 1, 1, 1, 1);
diff --git a/src/examples/elementary/thumb_example_01.js b/src/examples/elementary/thumb_example_01.js
index c12a98829f..34165ae17c 100644
--- a/src/examples/elementary/thumb_example_01.js
+++ b/src/examples/elementary/thumb_example_01.js
@@ -1,4 +1,5 @@
1elm = require('elm'); 1efl = require('efl');
2path = require('path');
2 3
3_generation_started_cb = function(obj) 4_generation_started_cb = function(obj)
4{ 5{
@@ -15,23 +16,32 @@ _generation_error_cb = function(obj)
15 console.log("thumbnail generation error."); 16 console.log("thumbnail generation error.");
16} 17}
17 18
18win = new elm.Elm.WinStandard(null); 19_client_connected_cb = function(obj)
19win.setTitle("Table"); 20{
21 console.log("Connected client to ethumb daemon");
22}
23
24win = new efl.Efl.Ui.Win.Standard(null);
25win.setText("Thumb example.");
20win.setAutohide(true); 26win.setAutohide(true);
21 27
22thumb = new elm.Elm.Thumb(win); 28thumb = new efl.Elm.Thumb(win);
23 29
24thumb.on('generate_start', _generation_started_cb); 30thumb.on('generate,start', _generation_started_cb);
25thumb.on('generate_stop', _generation_finished_cb); 31thumb.on('generate,stop', _generation_finished_cb);
26thumb.on('generate_error', _generation_error_cb); 32thumb.on('generate,error', _generation_error_cb);
27 33
28thumb.setSize(160, 160); 34thumb.setSize(160, 160);
29thumb.setEditable(false); 35// legacy
30thumb.setFile("../../data/images/plant_01.jpg", null); 36// thumb.setEditable(false);
31thumb.reload(); 37filename = path.join(__dirname, "../../../data/images/plant_01.jpg");
32 38filename = process.argv[2] || filename;
33thumb.setSizeHintWeight(1.0, 1.0); 39thumb.setFile(filename, null);
34win.resizeObjectAdd(thumb); 40// legacy
41// thumb.reload();
42
43thumb.setHintWeight(1.0, 1.0);
44win.pack(thumb);
35 45
36thumb.setVisible(true); 46thumb.setVisible(true);
37win.setSize(320, 320); 47win.setSize(320, 320);
diff --git a/src/examples/elementary/twitter_example_01.js b/src/examples/elementary/twitter_example_01.js
index 34d32d969b..62c4a7fd83 100644
--- a/src/examples/elementary/twitter_example_01.js
+++ b/src/examples/elementary/twitter_example_01.js
@@ -2,6 +2,7 @@
2efl = require('efl'); 2efl = require('efl');
3 3
4util = require('util'); 4util = require('util');
5path = require('path');
5fs = require('fs'); 6fs = require('fs');
6 7
7user_acount = 'EnlightenmentKo' 8user_acount = 'EnlightenmentKo'
@@ -16,20 +17,23 @@ var twit = new Twitter({
16 access_token_secret: 'l7ccNKXTVv6cymfSD1gQH61tmfixkdna2QmOjPtpVxSHD' 17 access_token_secret: 'l7ccNKXTVv6cymfSD1gQH61tmfixkdna2QmOjPtpVxSHD'
17}); 18});
18 19
19win = new efl.ui.WinStandard(null); 20win = new efl.Efl.Ui.Win.Standard(null);
20win.title = "Twitter App"; 21win.title = "Twitter App";
21win.autohide = true; 22win.autohide = true;
22 23
23box = new efl.ui.Box(win); 24box = new efl.Efl.Ui.Box(win);
24box.setSizeHintWeight(1.0, 1.0); 25box.setHintWeight(1.0, 1.0);
25win.resizeObjectAdd(box); 26win.pack(box);
26box.setVisible(true); 27box.setVisible(true);
27 28
28list = new efl.List(win); 29tweet_box = new efl.Efl.Ui.Box(win);
29list.setSizeHintWeight(1.0, 1.0); 30tweet_box.setHintWeight(1.0, 1.0);
30list.setSizeHintAlign(-1.0, -1.0); 31tweet_box.setHintAlign(-1.0, -1.0);
31box.packEnd(list); 32tweet_box.setPackPadding(0.0, 30.0, true);
32list.setVisible(true); 33box.packEnd(tweet_box);
34tweet_box_orient = tweet_box.cast("Efl.Orientation");
35tweet_box_orient.setOrientation(efl.Efl.Orient.VERTICAL);
36
33 37
34icon_array = new Array(); 38icon_array = new Array();
35 39
@@ -40,7 +44,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
40 console.log("finished"); 44 console.log("finished");
41 for (i=0; i < icon_array.length; i++) { 45 for (i=0; i < icon_array.length; i++) {
42 console.log(i); 46 console.log(i);
43 icon_array[i].file = "/tmp/twitter_pic.jpg"; 47 icon_array[i].setFile("/tmp/twitter_pic.jpg", null);
44 } 48 }
45 }); 49 });
46 if (tweets.length > 0) { 50 if (tweets.length > 0) {
@@ -48,8 +52,9 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
48 } 52 }
49 53
50 for(i=0; i < tweets.length; i++){ 54 for(i=0; i < tweets.length; i++){
51 var layout = new efl.ui.Layout(win); 55 var layout = new efl.Elm.Layout(win);
52 layout.file["tweet"] = "twitter_example_01.edj"; 56 var filename = path.join(__dirname, 'twitter_example_01.edj');
57 layout.setFile(filename, "tweet");
53 58
54 var user_name = tweets[i].user.name; 59 var user_name = tweets[i].user.name;
55 var screen_name = tweets[i].user.screen_name; 60 var screen_name = tweets[i].user.screen_name;
@@ -58,24 +63,27 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
58 63
59 layout.setText("user_name", screen_name); 64 layout.setText("user_name", screen_name);
60 layout.setText("screen_name", " - @"+screen_name); 65 layout.setText("screen_name", " - @"+screen_name);
61 var entry = new efl.ui.Entry(win); 66 var entry = new efl.Elm.Entry(win);
62 entry.text["elm.text"] = text; 67 entry.setText("elm.text", text);
63 console.log(text); 68 console.log(text);
64 layout.content["tweet_text"] = entry; 69 part = layout.part("tweet_text").cast("Efl.Container");
70 part.setContent(entry);
65 71
66 layout.sizeHintMin = {127, 96}; 72 layout.setHintMin(127, 96);
67 layout.sizeHintWeight = {1.0, 1.0}; 73 layout.setHintWeight(1.0, 1.0);
68 layout.sizeHintAlign = {-1.0, -1.0}; 74 layout.setHintAlign(-1.0, -1.0);
69 75
70 var icon = new efl.ui.Image(win); 76 var icon = new efl.Efl.Ui.Image(win);
71 icon.fillInside = true; 77 icon.fillInside = true;
72 icon_array.push(icon); 78 icon_array.push(icon);
73 layout.content["user_icon"] = icon; 79 user_icon = layout.part("user_icon").cast("Efl.Container");
74 item = list.itemAppend("", layout, null, null, null); 80 user_icon.setContent(icon);
81 item = tweet_box.packEnd(layout);
82 layout.setVisible(true);
75 } 83 }
76 list.go(); 84 tweet_box.setVisible(true);
77 } 85 }
78}); 86});
79 87
80win.size = {380,400}; 88win.setSize(380, 400);
81win.visible = {true}; 89win.setVisible(true);