summaryrefslogtreecommitdiff
path: root/src/examples/elementary
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/examples/elementary
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/examples/elementary')
-rw-r--r--src/examples/elementary/.gitignore156
-rw-r--r--src/examples/elementary/Makefile.am536
-rw-r--r--src/examples/elementary/actionslider_example_01.c136
-rw-r--r--src/examples/elementary/bg_cxx_example_01.cc23
-rw-r--r--src/examples/elementary/bg_cxx_example_02.cc33
-rw-r--r--src/examples/elementary/bg_example_01.c27
-rw-r--r--src/examples/elementary/bg_example_01.js15
-rw-r--r--src/examples/elementary/bg_example_02.c36
-rw-r--r--src/examples/elementary/bg_example_02.js19
-rw-r--r--src/examples/elementary/bg_example_03.c156
-rw-r--r--src/examples/elementary/box_cxx_example_02.cc142
-rw-r--r--src/examples/elementary/box_example_02.c163
-rw-r--r--src/examples/elementary/box_js_example_01.js34
-rw-r--r--src/examples/elementary/box_js_example_02.js86
-rw-r--r--src/examples/elementary/bubble_cxx_example_01.cc62
-rw-r--r--src/examples/elementary/bubble_example_01.c63
-rw-r--r--src/examples/elementary/bubble_example_01.js54
-rw-r--r--src/examples/elementary/button_cxx_example_00.cc35
-rw-r--r--src/examples/elementary/button_cxx_example_01.cc233
-rw-r--r--src/examples/elementary/button_example_00.c41
-rw-r--r--src/examples/elementary/button_example_00.js21
-rw-r--r--src/examples/elementary/button_example_01.c260
-rw-r--r--src/examples/elementary/button_example_01.js208
-rw-r--r--src/examples/elementary/calendar_cxx_example_01.cc21
-rw-r--r--src/examples/elementary/calendar_cxx_example_02.cc38
-rw-r--r--src/examples/elementary/calendar_cxx_example_03.cc23
-rw-r--r--src/examples/elementary/calendar_cxx_example_04.cc43
-rw-r--r--src/examples/elementary/calendar_cxx_example_05.cc50
-rw-r--r--src/examples/elementary/calendar_example_01.c34
-rw-r--r--src/examples/elementary/calendar_example_01.js14
-rw-r--r--src/examples/elementary/calendar_example_02.c53
-rw-r--r--src/examples/elementary/calendar_example_02.js17
-rw-r--r--src/examples/elementary/calendar_example_03.c37
-rw-r--r--src/examples/elementary/calendar_example_03.js15
-rw-r--r--src/examples/elementary/calendar_example_04.c55
-rw-r--r--src/examples/elementary/calendar_example_04.js32
-rw-r--r--src/examples/elementary/calendar_example_05.c62
-rw-r--r--src/examples/elementary/calendar_example_05.js29
-rw-r--r--src/examples/elementary/calendar_example_06.c89
-rw-r--r--src/examples/elementary/check_example_01.c51
-rw-r--r--src/examples/elementary/clock_cxx_example.cc53
-rw-r--r--src/examples/elementary/clock_example.c72
-rw-r--r--src/examples/elementary/clock_example.js43
-rw-r--r--src/examples/elementary/codegen_example.c140
-rw-r--r--src/examples/elementary/codegen_example.edc109
-rw-r--r--src/examples/elementary/colorselector_example_01.c92
-rw-r--r--src/examples/elementary/combobox_example_01.c135
-rw-r--r--src/examples/elementary/conformant_example_01.c68
-rw-r--r--src/examples/elementary/conformant_example_02.c77
-rw-r--r--src/examples/elementary/ctxpopup_example_01.c136
-rw-r--r--src/examples/elementary/datetime_cxx_example.cc51
-rw-r--r--src/examples/elementary/datetime_example.c55
-rw-r--r--src/examples/elementary/datetime_example.js42
-rw-r--r--src/examples/elementary/dayselector_example.c79
-rw-r--r--src/examples/elementary/dict.txt2913
-rw-r--r--src/examples/elementary/diskselector_example_01.c90
-rw-r--r--src/examples/elementary/diskselector_example_02.c346
-rw-r--r--src/examples/elementary/efl_thread_1.c79
-rw-r--r--src/examples/elementary/efl_thread_2.c95
-rw-r--r--src/examples/elementary/efl_thread_3.c99
-rw-r--r--src/examples/elementary/efl_thread_4.c129
-rw-r--r--src/examples/elementary/efl_thread_5.c112
-rw-r--r--src/examples/elementary/efl_thread_6.c170
-rw-r--r--src/examples/elementary/efl_thread_win32_1.c79
-rw-r--r--src/examples/elementary/efl_thread_win32_2.c95
-rw-r--r--src/examples/elementary/efl_thread_win32_3.c97
-rw-r--r--src/examples/elementary/efl_thread_win32_4.c121
-rw-r--r--src/examples/elementary/entry_example.c576
-rw-r--r--src/examples/elementary/evas3d_map_example.c1210
-rw-r--r--src/examples/elementary/evas3d_map_example.edc966
-rw-r--r--src/examples/elementary/evas3d_object_on_button_example.c289
-rw-r--r--src/examples/elementary/evas3d_scene_on_button_example.c282
-rw-r--r--src/examples/elementary/filemvc.c214
-rw-r--r--src/examples/elementary/fileselector_button_example.c168
-rw-r--r--src/examples/elementary/fileselector_entry_example.c157
-rw-r--r--src/examples/elementary/fileselector_example.c225
-rw-r--r--src/examples/elementary/fileviewlist.c79
-rw-r--r--src/examples/elementary/flip_example_01.c85
-rw-r--r--src/examples/elementary/flipselector_example.c182
-rw-r--r--src/examples/elementary/frame_example_01.c71
-rw-r--r--src/examples/elementary/general_funcs_example.c173
-rw-r--r--src/examples/elementary/gengrid_example.c615
-rw-r--r--src/examples/elementary/genlist_example_01.c79
-rw-r--r--src/examples/elementary/genlist_example_02.c192
-rw-r--r--src/examples/elementary/genlist_example_03.c118
-rw-r--r--src/examples/elementary/genlist_example_04.c353
-rw-r--r--src/examples/elementary/genlist_example_05.c418
-rw-r--r--src/examples/elementary/glview_cxx_example_01.cc263
-rw-r--r--src/examples/elementary/glview_example_01.c321
-rw-r--r--src/examples/elementary/hover_example_01.c74
-rw-r--r--src/examples/elementary/hoversel_cxx_example_01.cc84
-rw-r--r--src/examples/elementary/hoversel_example_01.c128
-rw-r--r--src/examples/elementary/icon_cxx_example_01.cc38
-rw-r--r--src/examples/elementary/icon_example_01.c44
-rw-r--r--src/examples/elementary/icon_example_01.js33
-rw-r--r--src/examples/elementary/image_example_01.c46
-rw-r--r--src/examples/elementary/index_example_01.c177
-rw-r--r--src/examples/elementary/index_example_02.c139
-rw-r--r--src/examples/elementary/inwin_example.c147
-rw-r--r--src/examples/elementary/label_example_01.c75
-rw-r--r--src/examples/elementary/label_example_02.c76
-rw-r--r--src/examples/elementary/label_example_03.c138
-rw-r--r--src/examples/elementary/layout_example.edc180
-rw-r--r--src/examples/elementary/layout_example.js63
-rw-r--r--src/examples/elementary/layout_example_01.c139
-rw-r--r--src/examples/elementary/layout_example_02.c75
-rw-r--r--src/examples/elementary/layout_example_03.c86
-rw-r--r--src/examples/elementary/list_example_01.c57
-rw-r--r--src/examples/elementary/list_example_02.c66
-rw-r--r--src/examples/elementary/list_example_03.c438
-rw-r--r--src/examples/elementary/location_cxx_example_01.cc82
-rw-r--r--src/examples/elementary/location_example_01.c91
-rw-r--r--src/examples/elementary/map_example_01.c110
-rw-r--r--src/examples/elementary/map_example_02.c266
-rw-r--r--src/examples/elementary/map_example_03.c195
-rw-r--r--src/examples/elementary/mapbuf_example.c112
-rw-r--r--src/examples/elementary/menu_cxx_example_01.cc69
-rw-r--r--src/examples/elementary/menu_example_01.c68
-rw-r--r--src/examples/elementary/menu_example_01.js37
-rw-r--r--src/examples/elementary/naviframe_example.c47
-rw-r--r--src/examples/elementary/notify_example_01.c71
-rw-r--r--src/examples/elementary/panel_example_01.c65
-rw-r--r--src/examples/elementary/panes_example.c110
-rw-r--r--src/examples/elementary/performance/HowTo13
-rw-r--r--src/examples/elementary/performance/Makefile.am44
-rw-r--r--src/examples/elementary/performance/Tools.h19
-rw-r--r--src/examples/elementary/performance/background.pngbin0 -> 177255 bytes
-rw-r--r--src/examples/elementary/performance/camera_light.c354
-rw-r--r--src/examples/elementary/performance/graphical.c616
-rw-r--r--src/examples/elementary/performance/graphical_struct.h90
-rw-r--r--src/examples/elementary/performance/initial_config.xml11
-rw-r--r--src/examples/elementary/performance/layout.edc170
-rw-r--r--src/examples/elementary/performance/performance.c957
-rw-r--r--src/examples/elementary/performance/target_texture.pngbin0 -> 2123166 bytes
-rw-r--r--src/examples/elementary/performance/tools_private.h50
-rw-r--r--src/examples/elementary/photocam_example_01.c159
-rw-r--r--src/examples/elementary/popup_cxx_example_01.cc32
-rw-r--r--src/examples/elementary/popup_example_01.c52
-rw-r--r--src/examples/elementary/popup_example_01.js32
-rw-r--r--src/examples/elementary/popup_example_02.c77
-rw-r--r--src/examples/elementary/popup_example_03.c93
-rw-r--r--src/examples/elementary/prefs_data_example.c91
-rw-r--r--src/examples/elementary/prefs_example_01.c109
-rw-r--r--src/examples/elementary/prefs_example_01.epc84
-rw-r--r--src/examples/elementary/prefs_example_02.c110
-rw-r--r--src/examples/elementary/prefs_example_02.epc65
-rw-r--r--src/examples/elementary/prefs_example_03.c112
-rw-r--r--src/examples/elementary/prefs_example_03.edc150
-rw-r--r--src/examples/elementary/prefs_example_03.epc112
-rw-r--r--src/examples/elementary/progressbar_example.c308
-rw-r--r--src/examples/elementary/radio_cxx_example_01.cc79
-rw-r--r--src/examples/elementary/radio_example_01.c87
-rw-r--r--src/examples/elementary/radio_example_01.js65
-rw-r--r--src/examples/elementary/radio_example_02.c94
-rw-r--r--src/examples/elementary/scroller_example_01.c138
-rw-r--r--src/examples/elementary/segment_control_example.c70
-rw-r--r--src/examples/elementary/separator_cxx_example_01.cc51
-rw-r--r--src/examples/elementary/separator_example_01.c49
-rw-r--r--src/examples/elementary/separator_example_01.js41
-rw-r--r--src/examples/elementary/slider_cxx_example.cc109
-rw-r--r--src/examples/elementary/slider_example.c136
-rw-r--r--src/examples/elementary/slider_example.js104
-rw-r--r--src/examples/elementary/slideshow_example.c276
-rw-r--r--src/examples/elementary/sphere_hunter/EFL_defeat.pngbin0 -> 88373 bytes
-rw-r--r--src/examples/elementary/sphere_hunter/EFL_victory.pngbin0 -> 108064 bytes
-rw-r--r--src/examples/elementary/sphere_hunter/Makefile.am42
-rw-r--r--src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c858
-rw-r--r--src/examples/elementary/sphere_hunter/score.jpgbin0 -> 51305 bytes
-rw-r--r--src/examples/elementary/sphere_hunter/sphere_hunter.edc251
-rw-r--r--src/examples/elementary/spinner_cxx_example.cc95
-rw-r--r--src/examples/elementary/spinner_example.c120
-rw-r--r--src/examples/elementary/spinner_example.js90
-rw-r--r--src/examples/elementary/table_cxx_example_01.cc43
-rw-r--r--src/examples/elementary/table_cxx_example_02.cc46
-rw-r--r--src/examples/elementary/table_example_01.c48
-rw-r--r--src/examples/elementary/table_example_01.js34
-rw-r--r--src/examples/elementary/table_example_02.c51
-rw-r--r--src/examples/elementary/table_example_02.js38
-rw-r--r--src/examples/elementary/theme_example.edc194
-rw-r--r--src/examples/elementary/theme_example_01.c74
-rw-r--r--src/examples/elementary/theme_example_02.c65
-rw-r--r--src/examples/elementary/thumb_cxx_example_01.cc48
-rw-r--r--src/examples/elementary/thumb_example_01.c63
-rw-r--r--src/examples/elementary/thumb_example_01.js38
-rw-r--r--src/examples/elementary/toolbar_example_01.c83
-rw-r--r--src/examples/elementary/toolbar_example_02.c74
-rw-r--r--src/examples/elementary/toolbar_example_03.c67
-rw-r--r--src/examples/elementary/track_example_01.c68
-rw-r--r--src/examples/elementary/transit_example_01.c38
-rw-r--r--src/examples/elementary/transit_example_02.c80
-rw-r--r--src/examples/elementary/transit_example_03.c312
-rw-r--r--src/examples/elementary/transit_example_04.c162
-rw-r--r--src/examples/elementary/twitter_example_01.edc89
-rw-r--r--src/examples/elementary/twitter_example_01.js82
-rw-r--r--src/examples/elementary/web_example_01.c49
-rw-r--r--src/examples/elementary/web_example_02.c617
-rw-r--r--src/examples/elementary/win_example.c328
197 files changed, 28897 insertions, 0 deletions
diff --git a/src/examples/elementary/.gitignore b/src/examples/elementary/.gitignore
new file mode 100644
index 0000000000..389c2e92ff
--- /dev/null
+++ b/src/examples/elementary/.gitignore
@@ -0,0 +1,156 @@
1/actionslider_example_01
2/bg_example_01
3/bg_example_02
4/bg_example_03
5/box_example_02
6/box_cxx_example_02
7/bubble_example_01
8/button_example_00
9/button_example_01
10/calendar_example_01
11/calendar_example_02
12/calendar_example_03
13/calendar_example_04
14/calendar_example_05
15/calendar_example_06
16/check_example_01
17/clock_example
18/colorselector_example_01
19/combobox_example_01
20/conformant_example_01
21/conformant_example_02
22/ctxpopup_example_01
23/datetime_example
24/diskselector_example_01
25/diskselector_example_02
26/efl_thread_1
27/efl_thread_2
28/efl_thread_3
29/efl_thread_4
30/efl_thread_5
31/efl_thread_6
32/entry_example
33/fileselector_button_example
34/fileselector_entry_example
35/fileselector_example
36/fileviewlist
37/filemvc
38/flip_example_01
39/flipselector_example
40/frame_example_01
41/general_funcs_example
42/gengrid_example
43/genlist_example_01
44/genlist_example_02
45/genlist_example_03
46/genlist_example_04
47/genlist_example_05
48/hover_example_01
49/hoversel_example_01
50/icon_example_01
51/image_example_01
52/index_example_01
53/index_example_02
54/inwin_example
55/label_example_01
56/layout_example_01
57/layout_example_02
58/layout_example_03
59/list_example_01
60/list_example_02
61/list_example_03
62/map_example_01
63/map_example_02
64/map_example_03
65/mapbuf_example
66/menu_example_01
67/naviframe_example
68/notify_example_01
69/panel_example_01
70/panes_example
71/photocam_example_01
72/popup_example_01
73/popup_example_02
74/popup_example_03
75/progressbar_example
76/radio_example_01
77/radio_example_02
78/scroller_example_01
79/segment_control_example
80/separator_example_01
81/slider_example
82/slideshow_example
83/spinner_example
84/table_example_01
85/table_example_02
86/theme_example_01
87/theme_example_02
88/thumb_example_01
89/toggle_example_01
90/toolbar_example_01
91/toolbar_example_02
92/toolbar_example_03
93/transit_example_01
94/transit_example_02
95/transit_example_03
96/transit_example_04
97/web_example
98/win_example
99/dayselector_example
100/codegen_example
101/codegen_example_generated.c
102/codegen_example_generated.h
103/glview_example_01
104/location_example_01
105/prefs_example_01
106/prefs_example_01.epb
107/prefs_example_02
108/prefs_example_02.epb
109/prefs_example_03
110/prefs_example_03.epb
111/web_example_01
112/web_example_02
113/track_example_01
114/3d_list_example
115/3d_scene_on_button_example
116/button_on_3d_object_example
117/evas3d_object_on_button_example
118/evas3d_scene_on_button_example
119/evas3d_map_example
120/sphere_hunter/sphere_hunter
121/performance/performance
122/bg_cxx_example_01
123/bg_cxx_example_02
124/bubble_cxx_example_01
125/button_cxx_example_00
126/button_cxx_example_01
127/calendar_cxx_example_01
128/calendar_cxx_example_02
129/calendar_cxx_example_03
130/calendar_cxx_example_04
131/calendar_cxx_example_05
132/check_cxx_example_01
133/clock_cxx_example
134/conformant_cxx_example_01
135/conformant_cxx_example_02
136/datetime_cxx_example
137/frame_cxx_example_01
138/glview_cxx_example_01
139/hoversel_cxx_example_01
140/icon_cxx_example_01
141/image_cxx_example_01
142/label_cxx_example_01
143/location_cxx_example_01
144/menu_cxx_example_01
145/notify_cxx_example_01
146/panel_cxx_example_01
147/panes_cxx_example
148/popup_cxx_example_01
149/popup_cxx_example_02
150/radio_cxx_example_01
151/separator_cxx_example_01
152/slider_cxx_example
153/spinner_cxx_example
154/table_cxx_example_01
155/table_cxx_example_02
156/thumb_cxx_example_01
diff --git a/src/examples/elementary/Makefile.am b/src/examples/elementary/Makefile.am
new file mode 100644
index 0000000000..24f1dd2886
--- /dev/null
+++ b/src/examples/elementary/Makefile.am
@@ -0,0 +1,536 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = sphere_hunter performance
4
5include ../../Makefile_Elm_Helpers.am
6
7.PHONY: screenshots
8
9examplesdir = $(pkgdatadir)/examples
10filesdir = $(pkgdatadir)/examples
11files_DATA =
12
13AM_CPPFLAGS = \
14-Wno-unused-parameter \
15-I. \
16-I$(top_srcdir)/src/lib \
17-I$(top_builddir)/src/lib \
18-DPACKAGE_DATA_DIR="\"$(pkgdatadir)\"" \
19-DPACKAGE_BIN_DIR=\"$(bindir)\" \
20-DPACKAGE_LIB_DIR=\"$(libdir)\" \
21@ELEMENTARY_CFLAGS@
22
23AM_CXXFLAGS = \
24@ELEMENTARY_CFLAGS@ \
25@ELEMENTARY_CXX_CFLAGS@
26
27LDADD = \
28@ELEMENTARY_LIBS@ \
29$(top_builddir)/src/lib/libelementary.la
30
31ELEMENTARY_CODEGEN = $(top_builddir)/src/bin/@ELEMENTARY_CODEGEN_PRG@
32ELEMENTARY_CODEGEN_FLAGS = --prefix=codegen_example
33
34SRCS = \
35actionslider_example_01.c \
36bg_example_01.c \
37bg_example_02.c \
38bg_example_03.c \
39box_example_02.c \
40bubble_example_01.c \
41button_example_00.c \
42button_example_01.c \
43calendar_example_01.c \
44calendar_example_02.c \
45calendar_example_03.c \
46calendar_example_04.c \
47calendar_example_05.c \
48calendar_example_06.c \
49check_example_01.c \
50clock_example.c \
51codegen_example.edc \
52colorselector_example_01.c \
53conformant_example_01.c \
54conformant_example_02.c \
55combobox_example_01.c \
56ctxpopup_example_01.c \
57datetime_example.c \
58dayselector_example.c \
59diskselector_example_01.c \
60diskselector_example_02.c \
61efl_thread_1.c \
62efl_thread_2.c \
63efl_thread_3.c \
64efl_thread_4.c \
65efl_thread_5.c \
66efl_thread_6.c \
67efl_thread_win32_1.c \
68efl_thread_win32_2.c \
69efl_thread_win32_3.c \
70efl_thread_win32_4.c \
71entry_example.c \
72fileselector_button_example.c \
73fileselector_entry_example.c \
74fileselector_example.c \
75fileviewlist.c \
76filemvc.c \
77flip_example_01.c \
78flipselector_example.c \
79frame_example_01.c \
80general_funcs_example.c \
81gengrid_example.c \
82genlist_example_01.c \
83genlist_example_02.c \
84genlist_example_03.c \
85genlist_example_04.c \
86genlist_example_05.c \
87glview_example_01.c \
88hover_example_01.c \
89hoversel_example_01.c \
90icon_example_01.c \
91image_example_01.c \
92index_example_01.c \
93index_example_02.c \
94inwin_example.c \
95label_example_01.c \
96layout_example.edc \
97layout_example_01.c \
98layout_example_02.c \
99layout_example_03.c \
100list_example_01.c \
101list_example_02.c \
102list_example_03.c \
103location_example_01.c \
104map_example_01.c \
105map_example_02.c \
106map_example_03.c \
107mapbuf_example.c \
108menu_example_01.c \
109naviframe_example.c \
110notify_example_01.c \
111panes_example.c \
112panel_example_01.c \
113photocam_example_01.c \
114prefs_example_01.c \
115prefs_example_02.c \
116prefs_example_03.c \
117popup_example_01.c \
118popup_example_02.c \
119popup_example_03.c \
120progressbar_example.c \
121radio_example_01.c \
122radio_example_02.c \
123segment_control_example.c \
124separator_example_01.c \
125slider_example.c \
126slideshow_example.c \
127spinner_example.c \
128scroller_example_01.c \
129table_example_01.c \
130table_example_02.c \
131theme_example.edc \
132theme_example_01.c \
133theme_example_02.c \
134thumb_example_01.c \
135toolbar_example_01.c \
136toolbar_example_02.c \
137toolbar_example_03.c \
138transit_example_01.c \
139transit_example_02.c \
140transit_example_03.c \
141transit_example_04.c \
142web_example_01.c \
143web_example_02.c \
144win_example.c \
145evas3d_scene_on_button_example.c \
146evas3d_object_on_button_example.c \
147evas3d_map_example.edc \
148evas3d_map_example.c \
149track_example_01.c \
150twitter_example_01.edc
151
152if HAVE_CXX11
153SRCS += \
154thumb_cxx_example_01.cc \
155table_cxx_example_02.cc \
156table_cxx_example_01.cc \
157spinner_cxx_example.cc \
158slider_cxx_example.cc \
159separator_cxx_example_01.cc \
160radio_cxx_example_01.cc \
161popup_cxx_example_01.cc \
162menu_cxx_example_01.cc \
163location_cxx_example_01.cc \
164icon_cxx_example_01.cc \
165hoversel_cxx_example_01.cc \
166glview_cxx_example_01.cc \
167datetime_cxx_example.cc \
168clock_cxx_example.cc \
169calendar_cxx_example_05.cc \
170calendar_cxx_example_04.cc \
171calendar_cxx_example_03.cc \
172calendar_cxx_example_02.cc \
173calendar_cxx_example_01.cc \
174button_cxx_example_01.cc \
175button_cxx_example_00.cc \
176bubble_cxx_example_01.cc \
177box_cxx_example_02.cc \
178bg_cxx_example_02.cc \
179bg_cxx_example_01.cc
180endif
181
182.edc.edj:
183 $(AM_V_EDJ)$(EDJE_CC) $(EDJE_CC_FLAGS) $< $@
184
185.epc.epb:
186 $(AM_V_EPB)$(ELM_PREFS_CC) $< $@
187
188if EFL_INSTALL_EXAMPLES
189files_DATA += $(SRCS) \
190 dict.txt
191endif
192
193if EFL_BUILD_EXAMPLES
194files_DATA += \
195 prefs_example_01.epb \
196 prefs_example_02.epb \
197 prefs_example_03.epb \
198 prefs_example_03.edj \
199 theme_example.edj \
200 layout_example.edj\
201 codegen_example.edj \
202 evas3d_map_example.edj \
203 twitter_example_01.edj
204
205clean-local:
206 rm -f *.edj *.epb *.cfg *.cfg.bkp
207
208codegen_example_generated.c codegen_example_generated.h: codegen_example.edj
209 $(ELEMENTARY_CODEGEN) $(ELEMENTARY_CODEGEN_FLAGS) codegen_example.edj \
210 elm/example/mylayout/default codegen_example_generated.c codegen_example_generated.h
211
212BUILT_SOURCES = codegen_example_generated.c codegen_example_generated.h
213
214codegen_example_SOURCES = \
215 codegen_example.c
216nodist_codegen_example_SOURCES = \
217codegen_example_generated.c \
218codegen_example_generated.h
219
220examples_PROGRAMS = \
221actionslider_example_01 \
222bg_example_01 \
223bg_example_02 \
224bg_example_03 \
225box_example_02 \
226bubble_example_01 \
227button_example_00 \
228button_example_01 \
229calendar_example_01 \
230calendar_example_02 \
231calendar_example_03 \
232calendar_example_04 \
233calendar_example_05 \
234calendar_example_06 \
235check_example_01 \
236clock_example \
237codegen_example \
238colorselector_example_01 \
239conformant_example_01 \
240conformant_example_02 \
241combobox_example_01 \
242ctxpopup_example_01 \
243datetime_example \
244dayselector_example \
245diskselector_example_01 \
246diskselector_example_02 \
247efl_thread_1 \
248efl_thread_2 \
249efl_thread_3 \
250efl_thread_4 \
251efl_thread_5 \
252efl_thread_6 \
253entry_example \
254fileselector_button_example \
255fileselector_entry_example \
256fileselector_example \
257fileviewlist \
258filemvc \
259flip_example_01 \
260flipselector_example \
261frame_example_01 \
262general_funcs_example \
263gengrid_example \
264genlist_example_01 \
265genlist_example_02 \
266genlist_example_03 \
267genlist_example_04 \
268genlist_example_05 \
269glview_example_01 \
270hover_example_01 \
271hoversel_example_01 \
272icon_example_01 \
273image_example_01 \
274index_example_01 \
275index_example_02 \
276inwin_example \
277label_example_01 \
278layout_example_01 \
279layout_example_02 \
280layout_example_03 \
281list_example_01 \
282list_example_02 \
283list_example_03 \
284location_example_01 \
285map_example_01 \
286map_example_02 \
287map_example_03 \
288mapbuf_example \
289menu_example_01 \
290naviframe_example \
291notify_example_01 \
292panes_example \
293panel_example_01 \
294photocam_example_01 \
295prefs_example_01 \
296prefs_example_02 \
297prefs_example_03 \
298popup_example_01 \
299popup_example_02 \
300popup_example_03 \
301progressbar_example \
302radio_example_01 \
303radio_example_02 \
304segment_control_example \
305separator_example_01 \
306slider_example \
307slideshow_example \
308spinner_example \
309scroller_example_01 \
310table_example_01 \
311table_example_02 \
312theme_example_01 \
313theme_example_02 \
314thumb_example_01 \
315toolbar_example_01 \
316toolbar_example_02 \
317toolbar_example_03 \
318transit_example_01 \
319transit_example_02 \
320transit_example_03 \
321transit_example_04 \
322web_example_01 \
323web_example_02 \
324win_example \
325evas3d_scene_on_button_example \
326evas3d_object_on_button_example \
327evas3d_map_example \
328track_example_01
329
330if HAVE_CXX11
331examples_PROGRAMS += \
332thumb_cxx_example_01 \
333table_cxx_example_02 \
334table_cxx_example_01 \
335spinner_cxx_example \
336slider_cxx_example \
337separator_cxx_example_01 \
338radio_cxx_example_01 \
339popup_cxx_example_01 \
340menu_cxx_example_01 \
341location_cxx_example_01 \
342icon_cxx_example_01 \
343hoversel_cxx_example_01 \
344glview_cxx_example_01 \
345datetime_cxx_example \
346clock_cxx_example \
347calendar_cxx_example_05 \
348calendar_cxx_example_04 \
349calendar_cxx_example_03 \
350calendar_cxx_example_02 \
351calendar_cxx_example_01 \
352button_cxx_example_01 \
353button_cxx_example_00 \
354bubble_cxx_example_01 \
355box_cxx_example_02 \
356bg_cxx_example_02 \
357bg_cxx_example_01
358endif
359
360if ELEMENTARY_WINDOWS_BUILD
361efl_thread_1_SOURCES = efl_thread_win32_1.c
362efl_thread_2_SOURCES = efl_thread_win32_2.c
363efl_thread_3_SOURCES = efl_thread_win32_3.c
364efl_thread_4_SOURCES = efl_thread_win32_4.c
365else
366efl_thread_1_SOURCES = efl_thread_1.c
367efl_thread_2_SOURCES = efl_thread_2.c
368efl_thread_3_SOURCES = efl_thread_3.c
369efl_thread_4_SOURCES = efl_thread_4.c
370endif
371
372if HAVE_CXX11
373thumb_cxx_example_01_SOURCES = thumb_cxx_example_01.cc
374table_cxx_example_02_SOURCES = table_cxx_example_02.cc
375table_cxx_example_01_SOURCES = table_cxx_example_01.cc
376spinner_cxx_example_SOURCES = spinner_cxx_example.cc
377slider_cxx_example_SOURCES = slider_cxx_example.cc
378separator_cxx_example_01_SOURCES = separator_cxx_example_01.cc
379radio_cxx_example_01_SOURCES = radio_cxx_example_01.cc
380popup_cxx_example_01_SOURCES = popup_cxx_example_01.cc
381menu_cxx_example_01_SOURCES = menu_cxx_example_01.cc
382location_cxx_example_01_SOURCES = location_cxx_example_01.cc
383icon_cxx_example_01_SOURCES = icon_cxx_example_01.cc
384hoversel_cxx_example_01_SOURCES = hoversel_cxx_example_01.cc
385glview_cxx_example_01_SOURCES = glview_cxx_example_01.cc
386datetime_cxx_example_SOURCES = datetime_cxx_example.cc
387clock_cxx_example_SOURCES = clock_cxx_example.cc
388calendar_cxx_example_05_SOURCES = calendar_cxx_example_05.cc
389calendar_cxx_example_04_SOURCES = calendar_cxx_example_04.cc
390calendar_cxx_example_03_SOURCES = calendar_cxx_example_03.cc
391calendar_cxx_example_02_SOURCES = calendar_cxx_example_02.cc
392calendar_cxx_example_01_SOURCES = calendar_cxx_example_01.cc
393button_cxx_example_01_SOURCES = button_cxx_example_01.cc
394button_cxx_example_00_SOURCES = button_cxx_example_00.cc
395bubble_cxx_example_01_SOURCES = bubble_cxx_example_01.cc
396box_cxx_example_02_SOURCES = box_cxx_example_02.cc
397bg_cxx_example_02_SOURCES = bg_cxx_example_02.cc
398bg_cxx_example_01_SOURCES = bg_cxx_example_01.cc
399endif
400
401# This variable will hold the list of screenshots that will be made
402# by "make screenshots". Each item in the list is of the form:
403# <example executable>:<screenshot filename>:<delay in seconds>
404SCREENSHOTS = \
405actionslider_example_01:actionslider_01.png:0.0 \
406bg_example_02:bg_01.png:0.0 \
407box_example_02:box_example_02.png:1.3 \
408bubble_example_01:bubble_example_01.png:0.0 \
409button_example_00:button_00.png:0.0 \
410button_example_01:button_01.png:0.0 \
411check_example_01:check_example_01.png:0.0 \
412colorselector_example_01:colorselector_example_01.png:0.0 \
413animator_example_01:animator_example_01.png:0.2 \
414animator_example_01:animator_example_02.png:0.5 \
415animator_example_01:animator_example_03.png:0.9 \
416flip_example_01:flip_example_01.png:0.0 \
417frame_example_01:frame_example_01.png:0.0 \
418hover_example_01:hover_example_01.png:0.0 \
419hoversel_example_01:hoversel_example_01.png:0.0 \
420label_example_01:label_example_01.png:0.0 \
421theme_example_01:theme_example_01.png:0.0 \
422conformant_example_01:conformant_example_01.png:0.0 \
423conformant_example_02:conformant_example_02.png:0.0 \
424combobox_example_01:combobox_example_01.png:0.0 \
425calendar_example_01:calendar_example_01.png:0.0 \
426calendar_example_02:calendar_example_02.png:0.0 \
427calendar_example_03:calendar_example_03.png:0.0 \
428calendar_example_04:calendar_example_04.png:0.0 \
429calendar_example_05:calendar_example_05.png:0.0 \
430calendar_example_06:calendar_example_06.png:0.0 \
431datetime_example:datetime_example.png:0.0 \
432map_example_01:map_example_01.png:2 \
433map_example_02:map_example_02.png:2.5 \
434map_example_03:map_example_03.png:2 \
435toolbar_example_01:toolbar_example_01.png:0.0 \
436toolbar_example_02:toolbar_example_02.png:1 \
437toolbar_example_03:toolbar_example_03.png:1 \
438spinner_example:spinner_example.png:0.0 \
439clock_example:clock_example.png:0.5 \
440dayselector_example:dayselector_example.png:0.0 \
441mapbuf_example:mapbuf_example.png:0.0 \
442image_example_01:image_example_01.png:0.0 \
443diskselector_example_01:diskselector_example_01.png:0.2 \
444diskselector_example_02:diskselector_example_02.png:0.2 \
445icon_example_01:icon_example_01.png:0.0 \
446layout_example_01:layout_example_01.png:0.0 \
447layout_example_02:layout_example_02.png:0.0 \
448layout_example_03:layout_example_03.png:0.0 \
449list_example_01:list_example_01.png:0.0 \
450list_example_02:list_example_02.png:0.0 \
451list_example_03:list_example_03.png:0.0 \
452segment_control_example:segment_control_example.png:0.0 \
453flipselector_example:flipselector_example.png:0.0 \
454fileselector_example:fileselector_example.png:0.0 \
455index_example_02:index_example_03.png:0.3 \
456slider_example:slider_example.png:0.0 \
457panes_example:panes_example.png:0.0 \
458ctxpopup_example_01:ctxpopup_example_01.png:0.0 \
459separator_example_01:separator_example_01.png:0.0 \
460radio_example_01:radio_example_01.png:0.0 \
461radio_example_02:radio_example_02.png:0.0 \
462panel_example_01:panel_example_01.png:0.0 \
463gengrid_example:gengrid_example.png:0.0 \
464genlist_example_01:genlist_example_01.png:0.1 \
465genlist_example_02:genlist_example_02.png:0.1 \
466genlist_example_03:genlist_example_03.png:0.1 \
467genlist_example_04:genlist_example_04.png:0.1 \
468genlist_example_05:genlist_example_05.png:0.1 \
469thumb_example_01:thumb_example_01.png:0.5 \
470entry_example:entry_example.png:0.0 \
471progressbar_example:progressbar_example.png:0.0 \
472notify_example_01:notify_example_01.png:0.0 \
473notify_example_01:notify_example_01_a.png:6.0 \
474popup_example_01:popup_example_01.png:1.0 \
475popup_example_01:popup_example_01_a.png:6.0 \
476popup_example_02:popup_example_02.png:0.2 \
477popup_example_03:popup_example_03.png:0.2 \
478slideshow_example:slideshow_example.png:1.0 \
479photocam_example_01:photocam_example_01.png:3 \
480scroller_example_01:scroller_example_01.png:0.0 \
481inwin_example:inwin_example.png:0.0 \
482inwin_example:inwin_example_a.png:0.2 \
483table_example_01:table_example_01.png:0.0 \
484table_example_02:table_example_02.png:0.0 \
485menu_example_01:menu_example_01.png:0.5
486
487if HAVE_CXX11
488SCREENSHOTS += \
489bg_cxx_example_02:bg_cxx_example_02.png:0.0 \
490box_cxx_example_02:box_cxx_example_02.png:1.3 \
491bubble_cxx_example_01:bubble_cxx_example_01.png:0.0 \
492button_cxx_example_00:button_cxx_example_00.png:0.0 \
493button_cxx_example_01:button_cxx_example_01.png:0.0 \
494calendar_cxx_example_01:calendar_cxx_example_01.png:0.0 \
495calendar_cxx_example_02:calendar_cxx_example_02.png:0.0 \
496calendar_cxx_example_03:calendar_cxx_example_03.png:0.0 \
497calendar_cxx_example_04:calendar_cxx_example_04.png:0.0 \
498calendar_cxx_example_05:calendar_cxx_example_05.png:0.0 \
499clock_cxx_example:clock_cxx_example.png:0.5 \
500datetime_cxx_example:datetime_cxx_example.png:0.0 \
501hoversel_cxx_example_01:hoversel_cxx_example_01.png:0.0 \
502icon_cxx_example_01:icon_cxx_example_01.png:0.0 \
503menu_cxx_example_01:menu_cxx_example_01.png:0.5 \
504popup_cxx_example_01:popup_cxx_example_01.png:1.0 \
505popup_cxx_example_01:popup_cxx_example_01_a.png:6.0 \
506radio_cxx_example_01:radio_cxx_example_01.png:0.0 \
507separator_cxx_example_01:separator_cxx_example_01.png:0.0 \
508slider_cxx_example:slider_cxx_example.png:0.0 \
509spinner_cxx_example:spinner_cxx_example.png:0.0 \
510table_cxx_example_01:table_cxx_example_01.png:0.0 \
511table_cxx_example_02:table_cxx_example_02.png:0.0 \
512thumb_cxx_example_01:thumb_cxx_example_01.png:0.5
513endif
514
515HTML_SS_DIR=$(top_builddir)/doc/html/screenshots
516LATEX_SS_DIR=$(top_builddir)/doc/latex/screenshots
517screenshots: all
518 @mkdir -p $(HTML_SS_DIR)
519 @mkdir -p $(LATEX_SS_DIR)
520 @for ss in $(SCREENSHOTS); do \
521 SS_ENTRY=($${ss//:/ }) ; \
522 EXAMPLE=$${SS_ENTRY[0]} ; \
523 SS_FILE=$${SS_ENTRY[1]} ; \
524 SS_DELAY=$${SS_ENTRY[2]} ; \
525 ILLUME_KBD=0,0,240,123 ILLUME_IND=0,0,240,32 ILLUME_STK=0,288,240,32 ELM_ENGINE="shot:delay=$${SS_DELAY}:file=$(HTML_SS_DIR)/$${SS_FILE}" ./$${EXAMPLE} ; \
526 convert $(HTML_SS_DIR)/$${SS_FILE} $(LATEX_SS_DIR)/$${SS_FILE/.png/.eps} ; \
527 done
528
529else
530
531screenshots:
532 @echo "Examples are not built. Run \"./configure --enable-build-examples\" first."
533
534endif
535
536EXTRA_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/elementary/actionslider_example_01.c b/src/examples/elementary/actionslider_example_01.c
new file mode 100644
index 0000000000..d142d965ab
--- /dev/null
+++ b/src/examples/elementary/actionslider_example_01.c
@@ -0,0 +1,136 @@
1//Compile with:
2//gcc -g actionslider_example_01.c -o actionslider_example_01 `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6static void _pos_selected_cb(void *data, Evas_Object *obj, void *event_info)
7{
8 printf("Selection: %s\n", (char *)event_info);
9 printf("Label selected: %s\n", elm_actionslider_selected_label_get(obj));
10}
11
12static void
13_position_change_magnetic_cb(void *data, Evas_Object * obj, void *event_info)
14{
15 if (!strcmp((char *)event_info, "left"))
16 elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_LEFT);
17 else if (!strcmp((char *)event_info, "right"))
18 elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_RIGHT);
19}
20
21static void
22_magnet_enable_disable_cb(void *data, Evas_Object *obj, void *event_info)
23{
24 if (!strcmp((char *)event_info, "left"))
25 elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_CENTER);
26 else if (!strcmp((char *)event_info, "right"))
27 elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_NONE);
28}
29
30EAPI_MAIN int
31elm_main(int argc, char **argv)
32{
33 Evas_Object *win, *bx, *as;
34
35 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
36
37 win = elm_win_util_standard_add("actionslider", "Actionslider");
38 elm_win_autodel_set(win, EINA_TRUE);
39
40 bx = elm_box_add(win);
41 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0);
42 elm_win_resize_object_add(win, bx);
43 evas_object_show(bx);
44
45 as = elm_actionslider_add(win);
46 evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
47 evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
48 elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_RIGHT);
49 elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_RIGHT);
50 elm_object_part_text_set(as, "left", "Snooze");
51 elm_object_part_text_set(as, "right", "Stop");
52 elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_LEFT |
53 ELM_ACTIONSLIDER_RIGHT);
54 evas_object_smart_callback_add(as, "pos_changed",
55 _position_change_magnetic_cb, NULL);
56 evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
57 evas_object_show(as);
58 elm_box_pack_end(bx, as);
59
60 as = elm_actionslider_add(win);
61 evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
62 evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
63 elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_CENTER);
64 elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER);
65 elm_object_part_text_set(as, "left", "Snooze");
66 elm_object_part_text_set(as, "right", "Stop");
67 elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_LEFT |
68 ELM_ACTIONSLIDER_RIGHT);
69 evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
70 evas_object_show(as);
71 elm_box_pack_end(bx, as);
72
73 as = elm_actionslider_add(win);
74 elm_object_style_set(as, "bar");
75 evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
76 evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
77 elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
78 elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER|
79 ELM_ACTIONSLIDER_RIGHT);
80 elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_CENTER |
81 ELM_ACTIONSLIDER_RIGHT);
82 elm_object_part_text_set(as, "center", "Accept");
83 elm_object_part_text_set(as, "right", "Reject");
84 evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
85 evas_object_show(as);
86 elm_box_pack_end(bx, as);
87
88 as = elm_actionslider_add(win);
89 elm_object_style_set(as, "bar");
90 evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
91 evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
92 elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
93 elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_LEFT);
94 elm_object_part_text_set(as, "center", "Accept");
95 elm_object_part_text_set(as, "right", "Reject");
96 elm_object_text_set(as, "Go");
97 evas_object_smart_callback_add(as, "pos_changed",
98 _position_change_magnetic_cb, NULL);
99 evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
100 evas_object_show(as);
101 elm_box_pack_end(bx, as);
102
103 as = elm_actionslider_add(win);
104 evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
105 evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
106 elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
107 elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_ALL);
108 elm_object_part_text_set(as, "left", "Left");
109 elm_object_part_text_set(as, "center", "Center");
110 elm_object_part_text_set(as, "right", "Right");
111 elm_object_text_set(as, "Go");
112 evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
113 evas_object_show(as);
114 elm_box_pack_end(bx, as);
115
116 as = elm_actionslider_add(win);
117 evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
118 evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
119 elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_CENTER);
120 elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER);
121 elm_object_part_text_set(as, "left", "Enable");
122 elm_object_part_text_set(as, "center", "Magnet");
123 elm_object_part_text_set(as, "right", "Disable");
124 evas_object_smart_callback_add(as, "pos_changed",
125 _magnet_enable_disable_cb, NULL);
126 evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
127 evas_object_show(as);
128 elm_box_pack_end(bx, as);
129
130 evas_object_resize(win, 320, 400);
131 evas_object_show(win);
132
133 elm_run();
134 return 0;
135}
136ELM_MAIN()
diff --git a/src/examples/elementary/bg_cxx_example_01.cc b/src/examples/elementary/bg_cxx_example_01.cc
new file mode 100644
index 0000000000..9fe20f445c
--- /dev/null
+++ b/src/examples/elementary/bg_cxx_example_01.cc
@@ -0,0 +1,23 @@
1#include <Elementary.hh>
2
3EAPI_MAIN int
4elm_main (int argc, char *argv[])
5{
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7
8 ::elm::win_standard win;
9 win.title_set("Bg Plain");
10 win.autohide_set(true);
11
12 ::elm::bg bg(efl::eo::parent = win);
13 bg.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
14 win.resize_object_add(bg);
15 bg.visible_set(true);
16
17 win.size_set(320,320);
18 win.visible_set(true);
19
20 elm_run();
21 return 0;
22}
23ELM_MAIN()
diff --git a/src/examples/elementary/bg_cxx_example_02.cc b/src/examples/elementary/bg_cxx_example_02.cc
new file mode 100644
index 0000000000..56fc7486e4
--- /dev/null
+++ b/src/examples/elementary/bg_cxx_example_02.cc
@@ -0,0 +1,33 @@
1#include <Elementary.hh>
2
3#include <sstream>
4
5EAPI_MAIN int
6elm_main (int argc, char *argv[])
7{
8 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
9
10 ::elm::win_standard win;
11 win.title_set("Bg Image");
12 win.autohide_set(true);
13
14 elm_app_compile_data_dir_set("/usr/share/elementary");
15 elm_app_info_set(reinterpret_cast<void*>(elm_main), "elementary", "images/plant_01.jpg");
16
17 ::elm::bg bg(efl::eo::parent = win);
18 bg.load_size_set(20,20);
19 bg.option_set(ELM_BG_OPTION_CENTER);
20 std::stringstream ss;
21 ss << elm_app_data_dir_get() << "/images/plant_01.jpg";
22 bg.file_set(ss.str(), nullptr);
23 bg.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
24 win.resize_object_add(bg);
25 bg.visible_set(true);
26
27 win.size_set(320, 320);
28 win.visible_set(true);
29
30 elm_run();
31 return 0;
32}
33ELM_MAIN()
diff --git a/src/examples/elementary/bg_example_01.c b/src/examples/elementary/bg_example_01.c
new file mode 100644
index 0000000000..7377e5d1b4
--- /dev/null
+++ b/src/examples/elementary/bg_example_01.c
@@ -0,0 +1,27 @@
1//Compile with:
2//gcc -o bg_example_01 bg_example_01.c -g `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6EAPI_MAIN int
7elm_main(int argc, char **argv)
8{
9 Evas_Object *win;
10
11 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
12 win = elm_win_util_standard_add("bg-plain", "Bg Plain");
13 elm_win_autodel_set(win, EINA_TRUE);
14
15 /* and now just resize the window to a size you want. normally widgets
16 * will determine the initial size though */
17 evas_object_resize(win, 320, 320);
18 /* and show the window */
19 evas_object_show(win);
20
21 elm_run(); /* and run the program now, starting to handle all
22 * events, etc. */
23
24 /* exit code */
25 return 0;
26}
27ELM_MAIN()
diff --git a/src/examples/elementary/bg_example_01.js b/src/examples/elementary/bg_example_01.js
new file mode 100644
index 0000000000..227259b63a
--- /dev/null
+++ b/src/examples/elementary/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/elementary/bg_example_02.c b/src/examples/elementary/bg_example_02.c
new file mode 100644
index 0000000000..a74fc51a7e
--- /dev/null
+++ b/src/examples/elementary/bg_example_02.c
@@ -0,0 +1,36 @@
1//Compile with:
2//gcc -o bg_example_02 bg_example_02.c -g `pkg-config --cflags --libs elementary`
3//where directory is the a path where images/plant_01.jpg can be found.
4
5#include <Elementary.h>
6
7EAPI_MAIN int
8elm_main(int argc, char **argv)
9{
10 Evas_Object *win, *bg;
11 char buf[PATH_MAX];
12
13 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
14 elm_app_info_set(elm_main, "elementary", "images/plant_01.jpg");
15
16 win = elm_win_add(NULL, "bg-image", ELM_WIN_BASIC);
17 elm_win_title_set(win, "Bg Image");
18 elm_win_autodel_set(win, EINA_TRUE);
19
20 bg = elm_bg_add(win);
21 elm_bg_load_size_set(bg, 20, 20);
22 elm_bg_option_set(bg, ELM_BG_OPTION_CENTER);
23 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
24 elm_bg_file_set(bg, buf, NULL);
25 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
26 elm_win_resize_object_add(win, bg);
27 evas_object_show(bg);
28
29 evas_object_resize(win, 320, 320);
30 evas_object_show(win);
31
32 elm_run();
33
34 return 0;
35}
36ELM_MAIN()
diff --git a/src/examples/elementary/bg_example_02.js b/src/examples/elementary/bg_example_02.js
new file mode 100644
index 0000000000..e8e1a63e0f
--- /dev/null
+++ b/src/examples/elementary/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/elementary/bg_example_03.c b/src/examples/elementary/bg_example_03.c
new file mode 100644
index 0000000000..be44f2576d
--- /dev/null
+++ b/src/examples/elementary/bg_example_03.c
@@ -0,0 +1,156 @@
1//Compile with:
2//gcc -o bg_example_03 bg_example_03.c -g `pkg-config --cflags --libs elementary`
3//where directory is the a path where images/plant_01.jpg can be found.
4
5#include <Elementary.h>
6
7static void
8_cb_radio_changed(void *data, Evas_Object *obj, void *event)
9{
10 Evas_Object *o_bg = data;
11
12 elm_bg_option_set(o_bg, elm_radio_value_get((Evas_Object *)obj));
13}
14
15static void
16_cb_overlay_changed(void *data, Evas_Object *obj, void *event)
17{
18 Evas_Object *o_bg = data;
19
20 if (elm_check_state_get(obj))
21 {
22 Evas_Object *parent, *over;
23 char buff[PATH_MAX];
24
25 snprintf(buff, sizeof(buff), "%s/objects/test.edj", elm_app_data_dir_get());
26 parent = elm_object_parent_widget_get(o_bg);
27 over = edje_object_add(evas_object_evas_get(parent));
28 edje_object_file_set(over, buff, "bg_overlay");
29 elm_object_part_content_set(o_bg, "overlay", over);
30 }
31 else
32 elm_object_part_content_set(o_bg, "overlay", NULL);
33}
34
35static void
36_cb_color_changed(void *data, Evas_Object *obj, void *event)
37{
38 Evas_Object *o_bg = data;
39 double val = 0.0;
40
41 val = elm_spinner_value_get(obj);
42 if (val == 1.0)
43 elm_bg_color_set(o_bg, 255, 255, 255);
44 else if (val == 2.0)
45 elm_bg_color_set(o_bg, 255, 0, 0);
46 else if (val == 3.0)
47 elm_bg_color_set(o_bg, 0, 0, 255);
48 else if (val == 4.0)
49 elm_bg_color_set(o_bg, 0, 255, 0);
50}
51
52EAPI_MAIN int
53elm_main(int argc, char **argv)
54{
55 Evas_Object *win;
56 Evas_Object *box, *hbox, *o_bg;
57 Evas_Object *rd, *rdg;
58 char buf[PATH_MAX];
59
60 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
61 elm_app_info_set(elm_main, "elementary", "objects/test.edj");
62
63 win = elm_win_util_standard_add("bg-options", "Bg Options");
64 elm_win_autodel_set(win, EINA_TRUE);
65
66 box = elm_box_add(win);
67 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
68 elm_win_resize_object_add(win, box);
69 evas_object_show(box);
70
71 o_bg = elm_bg_add(win);
72 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
73 elm_bg_file_set(o_bg, buf, NULL);
74 evas_object_size_hint_weight_set(o_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
75 evas_object_size_hint_align_set(o_bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
76 elm_box_pack_end(box, o_bg);
77 evas_object_show(o_bg);
78
79 hbox = elm_box_add(win);
80 elm_box_horizontal_set(hbox, EINA_TRUE);
81 evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
82 evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
83
84 rd = elm_radio_add(win);
85 elm_radio_state_value_set(rd, ELM_BG_OPTION_CENTER);
86 elm_object_text_set(rd, "Center");
87 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
88 evas_object_smart_callback_add(rd, "changed", _cb_radio_changed, o_bg);
89 elm_box_pack_end(hbox, rd);
90 evas_object_show(rd);
91 rdg = rd;
92
93 rd = elm_radio_add(win);
94 elm_radio_state_value_set(rd, ELM_BG_OPTION_SCALE);
95 elm_radio_group_add(rd, rdg);
96 elm_object_text_set(rd, "Scale");
97 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
98 evas_object_smart_callback_add(rd, "changed", _cb_radio_changed, o_bg);
99 elm_box_pack_end(hbox, rd);
100 evas_object_show(rd);
101
102 rd = elm_radio_add(win);
103 elm_radio_state_value_set(rd, ELM_BG_OPTION_STRETCH);
104 elm_radio_group_add(rd, rdg);
105 elm_object_text_set(rd, "Stretch");
106 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
107 evas_object_smart_callback_add(rd, "changed", _cb_radio_changed, o_bg);
108 elm_box_pack_end(hbox, rd);
109 evas_object_show(rd);
110
111 rd = elm_radio_add(win);
112 elm_radio_state_value_set(rd, ELM_BG_OPTION_TILE);
113 elm_radio_group_add(rd, rdg);
114 elm_object_text_set(rd, "Tile");
115 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
116 evas_object_smart_callback_add(rd, "changed", _cb_radio_changed, o_bg);
117 elm_box_pack_end(hbox, rd);
118 evas_object_show(rd);
119
120 elm_radio_value_set(rdg, ELM_BG_OPTION_SCALE);
121
122 rd = elm_check_add(win);
123 elm_object_text_set(rd, "Show Overlay");
124 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
125 evas_object_smart_callback_add(rd, "changed", _cb_overlay_changed, o_bg);
126 elm_box_pack_end(hbox, rd);
127 evas_object_show(rd);
128
129 /* color choices ... this is ghetto, but we don't have a 'colorpicker'
130 * widget yet :( */
131 rd = elm_spinner_add(win);
132 elm_object_style_set(rd, "vertical");
133 elm_spinner_min_max_set(rd, 1, 4);
134 elm_spinner_label_format_set(rd, "%.0f");
135 elm_spinner_editable_set(rd, EINA_FALSE);
136 elm_spinner_special_value_add(rd, 1, "White");
137 elm_spinner_special_value_add(rd, 2, "Red");
138 elm_spinner_special_value_add(rd, 3, "Blue");
139 elm_spinner_special_value_add(rd, 4, "Green");
140 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
141 evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, EVAS_HINT_FILL);
142 evas_object_smart_callback_add(rd, "changed", _cb_color_changed, o_bg);
143 elm_box_pack_end(hbox, rd);
144 evas_object_show(rd);
145
146 elm_box_pack_end(box, hbox);
147 evas_object_show(hbox);
148
149 evas_object_resize(win, 460, 320);
150 evas_object_show(win);
151
152 elm_run();
153
154 return 0;
155}
156ELM_MAIN()
diff --git a/src/examples/elementary/box_cxx_example_02.cc b/src/examples/elementary/box_cxx_example_02.cc
new file mode 100644
index 0000000000..f61990dd65
--- /dev/null
+++ b/src/examples/elementary/box_cxx_example_02.cc
@@ -0,0 +1,142 @@
1//Compile with:
2//gcc -g box_example_02.c -o box_example_02 `pkg-config --cflags --libs elementary`
3
4#include <Elementary.hh>
5#include <Eina.hh>
6
7#include <deque>
8#include <iostream>
9
10struct Transitions_Data
11{
12 efl::eo::wref<elm::box> box;
13 std::deque<Evas_Object_Box_Layout> transitions;
14 Evas_Object_Box_Layout last_layout;
15};
16
17static void
18_test_box_transition_change(void *data)
19{
20 Transitions_Data *tdata = static_cast<Transitions_Data*>(data);
21 Elm_Box_Transition *layout_data;
22 Evas_Object_Box_Layout next_layout;
23
24 assert (!!data);
25 assert (!tdata->transitions.empty());
26
27 if(efl::eina::optional<elm::box> box = tdata->box.lock())
28 {
29 next_layout = tdata->transitions.front();
30 layout_data = elm_box_transition_new(2.0, tdata->transitions.back(),
31 nullptr, nullptr, next_layout, nullptr, nullptr,
32 _test_box_transition_change, tdata);
33 box->layout_set(elm_box_layout_transition, layout_data,
34 elm_box_transition_free);
35 tdata->last_layout = next_layout;
36
37 tdata->transitions.push_back(tdata->transitions[0]);
38 tdata->transitions.pop_front();
39 }
40}
41
42EAPI_MAIN int
43elm_main(int argc, char *argv[])
44{
45 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
46
47 Transitions_Data tdata;
48
49 ::elm::win_standard win;
50 win.title_set("Box Transition");
51 win.autohide_set(true);
52
53 elm::box bigbox ( efl::eo::parent = win );
54 bigbox.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
55 win.resize_object_add(bigbox);
56 bigbox.visible_set(true);
57
58 elm::box buttons ( efl::eo::parent = win );
59 buttons.horizontal_set(EINA_TRUE);
60 bigbox.pack_end(buttons);
61 buttons.visible_set(true);
62
63 elm::button add ( efl::eo::parent = win );
64 add.text_set("elm.text", "Add");
65 buttons.pack_end(add);
66 add.visible_set(true);
67 add.callback_clicked_add
68 (std::bind([&tdata]
69 {
70 if(efl::eina::optional<elm::box> box = tdata.box.lock())
71 {
72 elm::button btn ( efl::eo::parent = *box );
73 btn.text_set(nullptr, "I do nothing");
74 box->pack_end(btn);
75 btn.visible_set(true);
76 }
77 }));
78
79 elm::button clear ( efl::eo::parent = win );
80 clear.text_set("elm.text", "Clear");
81 buttons.pack_end(clear);
82 clear.visible_set(true);
83 clear.callback_clicked_add(std::bind([&tdata] { tdata.box.lock()->clear(); }));
84
85 elm::box dynamic ( efl::eo::parent = win );
86 dynamic.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
87 dynamic.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
88 bigbox.pack_end(dynamic);
89 dynamic.visible_set(true);
90
91 auto unpack = std::bind([&tdata] (evas::clickable_interface obj)
92 {
93 elm::button btn = efl::eo::downcast<elm::button>(obj);
94 tdata.box.lock()->unpack(btn);
95 btn.position_set(0, 50);
96 btn.object_smart::color_set(128, 64, 0, 128);
97 }, std::placeholders::_1)
98 ;
99
100 elm::button bt1 ( efl::eo::parent = win );
101 bt1.text_set("elm.text", "Button 1");
102 bt1.callback_clicked_add(unpack);
103 bt1.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
104 bt1.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
105 dynamic.pack_end(bt1);
106 bt1.visible_set(true);
107
108 elm::button bt2 ( efl::eo::parent = win );
109 bt2.text_set("elm.text", "Button 2");
110 bt2.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0);
111 bt2.size_hint_align_set(1.0, 0.5);
112 bt2.callback_clicked_add(unpack);
113 dynamic.pack_end(bt2);
114 bt2.visible_set(true);
115
116 elm::button bt3 ( efl::eo::parent = win );
117 bt3.text_set("elm.text", "Button 3");
118 bt3.callback_clicked_add(unpack);
119 dynamic.pack_end(bt3);
120 bt3.visible_set(true);
121
122 tdata.box = dynamic;
123 tdata.last_layout = evas_object_box_layout_horizontal;
124 tdata.transitions.push_back(evas_object_box_layout_vertical);
125 tdata.transitions.push_back(evas_object_box_layout_horizontal);
126 tdata.transitions.push_back(evas_object_box_layout_stack);
127 tdata.transitions.push_back(evas_object_box_layout_homogeneous_vertical);
128 tdata.transitions.push_back(evas_object_box_layout_homogeneous_horizontal);
129 tdata.transitions.push_back(evas_object_box_layout_flow_vertical);
130 tdata.transitions.push_back(evas_object_box_layout_flow_horizontal);
131 tdata.transitions.push_back(evas_object_box_layout_stack);
132
133 dynamic.layout_set(evas_object_box_layout_horizontal, nullptr, nullptr);
134 _test_box_transition_change(&tdata);
135
136 win.size_set(300, 320);
137 win.visible_set(true);
138
139 elm_run();
140 return 0;
141}
142ELM_MAIN()
diff --git a/src/examples/elementary/box_example_02.c b/src/examples/elementary/box_example_02.c
new file mode 100644
index 0000000000..24c502d2b4
--- /dev/null
+++ b/src/examples/elementary/box_example_02.c
@@ -0,0 +1,163 @@
1//Compile with:
2//gcc -g box_example_02.c -o box_example_02 `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6typedef struct
7{
8 Eina_List *transitions;
9 Evas_Object *box;
10 Evas_Object_Box_Layout last_layout;
11} Transitions_Data;
12
13static void
14_add_cb(void *data, Evas_Object *obj, void *ev)
15{
16 Evas_Object *btn;
17 Eina_List *children;
18 Transitions_Data *tdata = data;
19
20 btn = elm_button_add(tdata->box);
21 elm_object_text_set(btn, "I do nothing");
22 children = (Eina_List *)elm_box_children_get(tdata->box);
23 if (children)
24 {
25 elm_box_pack_after(tdata->box, btn, (Evas_Object *)children->data);
26 eina_list_free(children);
27 }
28 else
29 elm_box_pack_end(tdata->box, btn);
30 evas_object_show(btn);
31}
32
33static void
34_clear_cb(void *data, Evas_Object *obj, void *ev)
35{
36 Transitions_Data *tdata = data;
37 elm_box_clear(tdata->box);
38}
39
40static void
41_unpack_cb(void *data, Evas_Object *obj, void *ev)
42{
43 Transitions_Data *tdata = data;
44 elm_box_unpack(tdata->box, obj);
45 evas_object_move(obj, 0, 50);
46 evas_object_color_set(obj, 128, 64, 0, 128);
47}
48
49static void
50_test_box_transition_change(void *data)
51{
52 Transitions_Data *tdata = data;
53 Elm_Box_Transition *layout_data;
54 Evas_Object_Box_Layout next_layout;
55
56 if (!data) return;
57 next_layout = eina_list_data_get(tdata->transitions);
58 layout_data = elm_box_transition_new(2.0, tdata->last_layout,
59 NULL, NULL, next_layout, NULL, NULL,
60 _test_box_transition_change, tdata);
61 elm_box_layout_set(tdata->box, elm_box_layout_transition, layout_data,
62 elm_box_transition_free);
63 tdata->last_layout = next_layout;
64
65 tdata->transitions = eina_list_demote_list(tdata->transitions,
66 tdata->transitions);
67}
68
69EAPI_MAIN int
70elm_main(int argc, char *argv[])
71{
72 Evas_Object *win, *bigbox, *bx, *bt;
73 static Transitions_Data tdata = {
74 .transitions = NULL,
75 .box = NULL,
76 .last_layout = NULL
77 };
78
79 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
80
81 win = elm_win_util_standard_add("box-transition", "Box Transition");
82 elm_win_autodel_set(win, EINA_TRUE);
83
84 bigbox = elm_box_add(win);
85 evas_object_size_hint_weight_set(bigbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
86 elm_win_resize_object_add(win, bigbox);
87 evas_object_show(bigbox);
88
89 bx = elm_box_add(win);
90 elm_box_horizontal_set(bx, EINA_TRUE);
91 elm_box_pack_end(bigbox, bx);
92 evas_object_show(bx);
93
94 bt = elm_button_add(win);
95 elm_object_text_set(bt, "Add");
96 elm_box_pack_end(bx, bt);
97 evas_object_show(bt);
98 evas_object_smart_callback_add(bt, "clicked", _add_cb, &tdata);
99
100 bt = elm_button_add(win);
101 elm_object_text_set(bt, "Clear");
102 elm_box_pack_end(bx, bt);
103 evas_object_show(bt);
104 evas_object_smart_callback_add(bt, "clicked", _clear_cb, &tdata);
105
106 bx = elm_box_add(win);
107 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
108 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
109 elm_box_pack_end(bigbox, bx);
110 evas_object_show(bx);
111
112 bt = elm_button_add(win);
113 elm_object_text_set(bt, "Button 1");
114 evas_object_smart_callback_add(bt, "clicked", _unpack_cb, &tdata);
115 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
116 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
117 elm_box_pack_end(bx, bt);
118 evas_object_show(bt);
119
120 bt = elm_button_add(win);
121 elm_object_text_set(bt, "Button 2");
122 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
123 evas_object_size_hint_align_set(bt, 1.0, 0.5);
124 evas_object_smart_callback_add(bt, "clicked", _unpack_cb, &tdata);
125 elm_box_pack_end(bx, bt);
126 evas_object_show(bt);
127
128 bt = elm_button_add(win);
129 elm_object_text_set(bt, "Button 3");
130 evas_object_smart_callback_add(bt, "clicked", _unpack_cb, &tdata);
131 elm_box_pack_end(bx, bt);
132 evas_object_show(bt);
133
134 tdata.box = bx;
135 tdata.last_layout = evas_object_box_layout_horizontal;
136 tdata.transitions = eina_list_append(tdata.transitions,
137 evas_object_box_layout_vertical);
138 tdata.transitions = eina_list_append(tdata.transitions,
139 evas_object_box_layout_horizontal);
140 tdata.transitions = eina_list_append(tdata.transitions,
141 evas_object_box_layout_stack);
142 tdata.transitions = eina_list_append(tdata.transitions,
143 evas_object_box_layout_homogeneous_vertical);
144 tdata.transitions = eina_list_append(tdata.transitions,
145 evas_object_box_layout_homogeneous_horizontal);
146 tdata.transitions = eina_list_append(tdata.transitions,
147 evas_object_box_layout_flow_vertical);
148 tdata.transitions = eina_list_append(tdata.transitions,
149 evas_object_box_layout_flow_horizontal);
150 tdata.transitions = eina_list_append(tdata.transitions,
151 evas_object_box_layout_stack);
152
153 elm_box_layout_set(bx, evas_object_box_layout_horizontal, NULL, NULL);
154 _test_box_transition_change(&tdata);
155
156 evas_object_resize(win, 300, 320);
157 evas_object_show(win);
158
159 elm_run();
160
161 return 0;
162}
163ELM_MAIN()
diff --git a/src/examples/elementary/box_js_example_01.js b/src/examples/elementary/box_js_example_01.js
new file mode 100644
index 0000000000..ba7761da5c
--- /dev/null
+++ b/src/examples/elementary/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/elementary/box_js_example_02.js b/src/examples/elementary/box_js_example_02.js
new file mode 100644
index 0000000000..63684df026
--- /dev/null
+++ b/src/examples/elementary/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.setText("elm.text", "Add");
42bx.packEnd(bt);
43bt.setVisible(true);
44bt.on('clicked', _add_cb);
45
46bt = new elm.Elm.Button(win);
47bt.setText("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.setText("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.setText("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.setText("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/elementary/bubble_cxx_example_01.cc b/src/examples/elementary/bubble_cxx_example_01.cc
new file mode 100644
index 0000000000..dd2284ae05
--- /dev/null
+++ b/src/examples/elementary/bubble_cxx_example_01.cc
@@ -0,0 +1,62 @@
1#include <Elementary.hh>
2#include <Evas.hh>
3
4EAPI_MAIN int
5elm_main (int argc, char *argv[])
6{
7 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
8
9 ::elm::win_standard win;
10 win.title_set("Bg Plain");
11 win.autohide_set(true);
12
13 ::elm::bg bg(efl::eo::parent = win);
14 bg.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
15 win.resize_object_add(bg);
16 bg.visible_set(true);
17
18 ::elm::label label1(efl::eo::parent = win);
19 label1.text_set(nullptr, "Bubble with no icon, info or label");
20 label1.visible_set(true);
21
22 evas::rectangle icon(efl::eo::parent = win);
23 icon.color_set( 0, 0, 255, 255);
24 icon.visible_set(true);
25
26 ::elm::bubble bubble1(efl::eo::parent = win);
27 bubble1.content_set("icon", icon);
28 bubble1.text_set("info", "INFO");
29 bubble1.text_set(nullptr, "LABEL");
30 bubble1.content_set(nullptr, label1);
31 bubble1.size_set(300, 100);
32 bubble1.visible_set(true);
33
34 auto on_click = std::bind([&] ()
35 {
36 static unsigned char corner = 0;
37 ++corner;
38 if (corner > 3)
39 bubble1.pos_set(ELM_BUBBLE_POS_TOP_LEFT);
40 else
41 bubble1.pos_set(static_cast<Elm_Bubble_Pos>(corner));
42 });
43
44 bubble1.callback_clicked_add(on_click);
45
46 ::elm::label label2(efl::eo::parent = win);
47 label2.text_set(nullptr, "Bubble with no icon, info or label");
48 label2.visible_set(true);
49
50 ::elm::bubble bubble2(efl::eo::parent = win);
51 bubble2.content_set(nullptr, label2);
52 bubble2.size_set(200, 50);
53 bubble2.position_set(0, 110);
54 bubble2.visible_set(true);
55
56 win.size_set(300, 200);
57 win.visible_set(true);
58
59 elm_run();
60 return 0;
61}
62ELM_MAIN()
diff --git a/src/examples/elementary/bubble_example_01.c b/src/examples/elementary/bubble_example_01.c
new file mode 100644
index 0000000000..ee49b35986
--- /dev/null
+++ b/src/examples/elementary/bubble_example_01.c
@@ -0,0 +1,63 @@
1//Compile with:
2//gcc -o bubble_example_01 bubble_example_01.c -g `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6void
7_bla(void *data, Evas_Object *obj, void *event_info)
8{
9 static unsigned char corner = 0;
10 ++corner;
11 if (corner > 3)
12 elm_bubble_pos_set(obj, ELM_BUBBLE_POS_TOP_LEFT);
13 else
14 elm_bubble_pos_set(obj, corner);
15
16}
17
18EAPI_MAIN int
19elm_main(int argc, char **argv)
20{
21 Evas_Object *win, *bubble, *label, *icon;
22
23 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
24
25 win = elm_win_util_standard_add("bubble", "Bubble");
26 elm_win_autodel_set(win, EINA_TRUE);
27
28 label = elm_label_add(win);
29 elm_object_text_set(label, "This is the CONTENT of our bubble");
30 evas_object_show(label);
31
32 icon = evas_object_rectangle_add(evas_object_evas_get(win));
33 evas_object_color_set(icon, 0, 0, 255, 255);
34 evas_object_show(icon);
35
36 bubble = elm_bubble_add(win);
37 elm_object_part_content_set(bubble, "icon", icon);
38 elm_object_part_text_set(bubble, "info", "INFO");
39 elm_object_text_set(bubble, "LABEL");
40 elm_object_content_set(bubble, label);
41 evas_object_resize(bubble, 300, 100);
42 evas_object_show(bubble);
43
44 evas_object_smart_callback_add(bubble, "clicked", _bla, NULL);
45
46 label = elm_label_add(win);
47 elm_object_text_set(label, "Bubble with no icon, info or label");
48 evas_object_show(label);
49
50 bubble = elm_bubble_add(win);
51 elm_object_content_set(bubble, label);
52 evas_object_resize(bubble, 200, 50);
53 evas_object_move(bubble, 0, 110);
54 evas_object_show(bubble);
55
56 evas_object_resize(win, 300, 200);
57 evas_object_show(win);
58
59 elm_run();
60
61 return 0;
62}
63ELM_MAIN()
diff --git a/src/examples/elementary/bubble_example_01.js b/src/examples/elementary/bubble_example_01.js
new file mode 100644
index 0000000000..d7b912b378
--- /dev/null
+++ b/src/examples/elementary/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.setPos(corner = 0);
39 else
40 bubble1.setPos(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/elementary/button_cxx_example_00.cc b/src/examples/elementary/button_cxx_example_00.cc
new file mode 100644
index 0000000000..a18d652146
--- /dev/null
+++ b/src/examples/elementary/button_cxx_example_00.cc
@@ -0,0 +1,35 @@
1#include <Elementary.hh>
2
3EAPI_MAIN int
4elm_main (int argc, char *argv[])
5{
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7
8 ::elm::win_standard win;
9 win.title_set("Hello, World!");
10 win.autohide_set(true);
11
12 ::elm::bg bg(efl::eo::parent = win);
13 bg.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
14 win.resize_object_add(bg);
15 bg.visible_set(true);
16
17 ::elm::button btn(efl::eo::parent = win);
18 btn.text_set("elm.text","Good-Bye, World!");
19 btn.size_set(120, 30);
20 btn.position_set(60, 15);
21 btn.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
22 btn.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
23 btn.visible_set(true);
24
25 auto on_click = std::bind([] () { elm_exit(); });
26
27 btn.callback_clicked_add( on_click );
28
29 win.size_set(240, 60);
30 win.visible_set(true);
31
32 elm_run();
33 return 0;
34}
35ELM_MAIN()
diff --git a/src/examples/elementary/button_cxx_example_01.cc b/src/examples/elementary/button_cxx_example_01.cc
new file mode 100644
index 0000000000..72096a3a48
--- /dev/null
+++ b/src/examples/elementary/button_cxx_example_01.cc
@@ -0,0 +1,233 @@
1#include <Elementary.hh>
2
3EAPI_MAIN int
4elm_main(int argc, char *argv[])
5{
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7
8 ::elm::win_standard win;
9 win.title_set("Button example");
10 win.autohide_set(true);
11
12 ::evas::object icon_still(nullptr);
13 ::elm::button mid(efl::eo::parent = win);
14 ::elm::button up(efl::eo::parent = win);
15 ::elm::button down(efl::eo::parent = win);
16 ::elm::button left(efl::eo::parent = win);
17 ::elm::button right(efl::eo::parent = win);
18
19 ::elm::box box(efl::eo::parent = win);
20 box.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
21 win.resize_object_add(box);
22 box.visible_set(true);
23
24 ::elm::box box_initial(efl::eo::parent = win);
25 box_initial.horizontal_set(true);
26 box_initial.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0);
27 box.pack_end(box_initial);
28 box_initial.visible_set(true);
29
30 ::elm::button btn(efl::eo::parent = win);
31 btn.text_set("elm.text", "Initial: 0.0");
32 box_initial.pack_end(btn);
33 btn.visible_set(true);
34
35 auto btn_options = std::bind([&] (evas::clickable_interface ci)
36 {
37 ::elm::button b(eo_ref(ci._eo_ptr()));
38 std::string::size_type ptr;
39 efl::eina::optional<std::string> lbl = b.text_get("elm.text");
40
41 ptr = lbl->find(":");
42 ptr += 2;
43 double t = std::stod(lbl->substr(ptr));
44
45 if (lbl->compare(0,7,"Initial") == 0)
46 {
47 up.autorepeat_initial_timeout_set(t);
48 down.autorepeat_initial_timeout_set(t);
49 left.autorepeat_initial_timeout_set(t);
50 right.autorepeat_initial_timeout_set(t);
51 }
52 else if (lbl->compare(0,3,"Gap") == 0)
53 {
54 up.autorepeat_gap_timeout_set(t);
55 down.autorepeat_gap_timeout_set(t);
56 left.autorepeat_gap_timeout_set(t);
57 right.autorepeat_gap_timeout_set(t);
58 }
59 }, std::placeholders::_1);
60
61 btn.callback_clicked_add(btn_options);
62
63 ::elm::button btn2(efl::eo::parent = win);
64 btn2.text_set("elm.text", "Initial: 1.0");
65 box_initial.pack_end(btn2);
66 btn2.visible_set(true);
67 btn2.callback_clicked_add(btn_options);
68
69 ::elm::button btn3(efl::eo::parent = win);
70 btn3.text_set("elm.text", "Initial: 5.0");
71 box_initial.pack_end(btn3);
72 btn3.visible_set(true);
73 btn3.callback_clicked_add(btn_options);
74
75 ::elm::box box_gap(efl::eo::parent = win);
76 box_gap.horizontal_set(true);
77 box_gap.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0);
78 box.pack_end(box_gap);
79 box_gap.visible_set(true);
80
81 ::elm::button btn4(efl::eo::parent = win);
82 btn4.text_set("elm.text", "Gap: 0.1");
83 box_gap.pack_end(btn4);
84 btn4.visible_set(true);
85 btn4.callback_clicked_add(btn_options);
86
87 ::elm::button btn5(efl::eo::parent = win);
88 btn5.text_set("elm.text", "Gap: 0.5");
89 box_gap.pack_end(btn5);
90 btn5.visible_set(true);
91 btn5.callback_clicked_add(btn_options);
92
93 ::elm::button btn6(efl::eo::parent = win);
94 btn6.text_set("elm.text", "Gap: 1.0");
95 box_gap.pack_end(btn6);
96 btn6.visible_set(true);
97 btn6.callback_clicked_add(btn_options);
98
99 up.autorepeat_set(true);
100 up.autorepeat_initial_timeout_set(1.0);
101 up.autorepeat_gap_timeout_set(0.5);
102 up.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0);
103 up.size_hint_align_set(EVAS_HINT_FILL, 0.0);
104 box.pack_end(up);
105 up.visible_set(true);
106
107 auto btn_cursors_move = std::bind([&] (evas::clickable_interface ci2)
108 {
109 ::elm::button button = efl::eo::downcast<elm::button>(ci2);
110 double ax, ay;
111
112 if (!icon_still)
113 {
114 ::elm::icon obj(efl::eo::parent = mid);
115 efl::eina::optional<evas::object> icon_still_p = mid.content_unset("icon");
116 if(icon_still_p)
117 {
118 icon_still = *icon_still_p;
119 icon_still.visible_set(false);
120 }
121 obj.standard_set("chat");
122 mid.content_set("icon", obj);
123 }
124
125 mid.size_hint_align_get(&ax, &ay);
126 if (button == up)
127 {
128 ay -= 0.05;
129 if (ay < 0.0)
130 ay = 0.0;
131 }
132 else if (button == down)
133 {
134 ay += 0.05;
135 if (ay > 1.0)
136 ay = 1.0;
137 }
138 else if (button == left)
139 {
140 ax -= 0.05;
141 if (ax < 0.0)
142 ax = 0.0;
143 }
144 else if (button == right)
145 {
146 ax += 0.05;
147 if (ax > 1.0)
148 ax = 1.0;
149 }
150 mid.size_hint_align_set(ax, ay);
151 }, std::placeholders::_1);
152
153 up.callback_repeated_add(btn_cursors_move);
154
155 auto btn_cursors_release = std::bind([&] ()
156 {
157 if (icon_still)
158 {
159 mid.content_set("icon", icon_still);
160 icon_still = evas::object(nullptr);
161 }
162 });
163
164 up.callback_unpressed_add(btn_cursors_release);
165
166 ::elm::icon icon_up(efl::eo::parent = win);
167 icon_up.standard_set("arrow_up");
168 up.content_set("icon", icon_up);
169
170 ::elm::box box_inferior(efl::eo::parent = win);
171 box_inferior.horizontal_set(true);
172 box_inferior.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
173 box_inferior.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
174 box.pack_end(box_inferior);
175 box_inferior.visible_set(true);
176
177 left.autorepeat_set(true);
178 left.autorepeat_initial_timeout_set(1.0);
179 left.autorepeat_gap_timeout_set(0.5);
180 left.size_hint_weight_set(0.0, EVAS_HINT_EXPAND);
181 left.size_hint_align_set(0.0, EVAS_HINT_FILL);
182 box_inferior.pack_end(left);
183 left.visible_set(true);
184 left.callback_repeated_add(btn_cursors_move);
185 left.callback_unpressed_add(btn_cursors_release);
186
187 ::elm::icon icon_left(efl::eo::parent = win);
188 icon_left.standard_set("arrow_left");
189 left.content_set("icon", icon_left);
190
191 mid.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
192 box_inferior.pack_end(mid);
193 mid.visible_set(true);
194
195 ::elm::icon icon_mid(efl::eo::parent = win);
196 icon_mid.standard_set("close");
197 mid.content_set("icon", icon_mid);
198
199 right.autorepeat_set(true);
200 right.autorepeat_initial_timeout_set(1.0);
201 right.autorepeat_gap_timeout_set(0.5);
202 right.size_hint_weight_set(0.0, EVAS_HINT_EXPAND);
203 right.size_hint_align_set(0.0, EVAS_HINT_FILL);
204 box_inferior.pack_end(right);
205 right.visible_set(true);
206 right.callback_repeated_add(btn_cursors_move);
207 right.callback_unpressed_add(btn_cursors_release);
208
209 ::elm::icon icon_right(efl::eo::parent = win);
210 icon_right.standard_set("arrow_right");
211 right.content_set("icon", icon_right);
212
213 down.autorepeat_set(true);
214 down.autorepeat_initial_timeout_set(1.0);
215 down.autorepeat_gap_timeout_set(0.5);
216 down.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0);
217 down.size_hint_align_set(EVAS_HINT_FILL, 0.0);
218 box.pack_end(down);
219 down.visible_set(true);
220 down.callback_repeated_add(btn_cursors_move);
221 down.callback_unpressed_add(btn_cursors_release);
222
223 ::elm::icon icon_down(efl::eo::parent = win);
224 icon_down.standard_set("arrow_down");
225 down.content_set("icon", icon_down);
226
227 win.size_set(300, 320);
228 win.visible_set(true);
229
230 elm_run();
231 return 0;
232}
233ELM_MAIN()
diff --git a/src/examples/elementary/button_example_00.c b/src/examples/elementary/button_example_00.c
new file mode 100644
index 0000000000..633232a915
--- /dev/null
+++ b/src/examples/elementary/button_example_00.c
@@ -0,0 +1,41 @@
1/*
2 * gcc -o button_example_00 button_example_00.c `pkg-config --cflags --libs elementary`
3 */
4#include <Elementary.h>
5
6static void
7on_click(void *data, Evas_Object *obj, void *event_info)
8{
9 elm_exit();
10}
11
12EAPI_MAIN int
13elm_main(int argc, char **argv)
14{
15 Evas_Object *win = NULL;
16 Evas_Object *btn = NULL;
17
18 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
19
20 /* Create an win, associate it with a canvas and */
21 /* turn it visible on WM (Window Manager). */
22 win = elm_win_util_standard_add("Greetings", "Hello, World!");
23 elm_win_autodel_set(win, EINA_TRUE);
24
25 /* Create a btn, associate to a function, associate */
26 /* to win, give a dimension and position. */
27 btn = elm_button_add(win);
28 elm_object_text_set(btn, "Good-Bye, World!");
29 evas_object_smart_callback_add(btn, "clicked", on_click, NULL);
30 evas_object_resize(btn, 120, 30);
31 evas_object_move(btn, 60, 15);
32 evas_object_show(btn);
33
34 evas_object_resize(win, 240, 60);
35 evas_object_show(win);
36
37 elm_run();
38
39 return 0;
40}
41ELM_MAIN()
diff --git a/src/examples/elementary/button_example_00.js b/src/examples/elementary/button_example_00.js
new file mode 100644
index 0000000000..64d7c8f6f5
--- /dev/null
+++ b/src/examples/elementary/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/elementary/button_example_01.c b/src/examples/elementary/button_example_01.c
new file mode 100644
index 0000000000..9f49d566da
--- /dev/null
+++ b/src/examples/elementary/button_example_01.c
@@ -0,0 +1,260 @@
1/*
2 * gcc -o button_example_01 button_example_01.c `pkg-config --cflags --libs elementary`
3 */
4#include <Elementary.h>
5
6typedef struct
7{
8 Evas_Object *mid;
9 Evas_Object *icon_still;
10 struct
11 {
12 Evas_Object *up;
13 Evas_Object *down;
14 Evas_Object *left;
15 Evas_Object *right;
16 } cursors;
17} App_Data;
18
19static void
20_btn_cursors_release_cb(void *data, Evas_Object *btn, void *ev)
21{
22 App_Data *app = data;
23 elm_object_part_content_set(app->mid, "icon", app->icon_still);
24 app->icon_still = NULL;
25}
26
27static void
28_btn_cursors_move_cb(void *data, Evas_Object *btn, void *ev)
29{
30 App_Data *app = data;
31 double ax, ay;
32
33 if (!app->icon_still)
34 {
35 Evas_Object *icon;
36 app->icon_still = elm_object_content_unset(app->mid);
37 evas_object_hide(app->icon_still);
38 icon = elm_icon_add(app->mid);
39 elm_icon_standard_set(icon, "chat");
40 elm_object_part_content_set(app->mid, "icon", icon);
41 }
42
43 evas_object_size_hint_align_get(app->mid, &ax, &ay);
44 if (btn == app->cursors.up)
45 {
46 ay -= 0.05;
47 if (ay < 0.0)
48 ay = 0.0;
49 }
50 else if (btn == app->cursors.down)
51 {
52 ay += 0.05;
53 if (ay > 1.0)
54 ay = 1.0;
55 }
56 else if (btn == app->cursors.left)
57 {
58 ax -= 0.05;
59 if (ax < 0.0)
60 ax = 0.0;
61 }
62 else if (btn == app->cursors.right)
63 {
64 ax += 0.05;
65 if (ax > 1.0)
66 ax = 1.0;
67 }
68 evas_object_size_hint_align_set(app->mid, ax, ay);
69}
70
71static void
72_btn_options_cb(void *data, Evas_Object *btn, void *ev)
73{
74 char *ptr;
75 double t;
76 App_Data *app = data;
77 const char *lbl = elm_object_text_get(btn);
78
79 ptr = strchr(lbl, ':');
80 ptr += 2;
81 t = strtod(ptr, NULL);
82
83 if (!strncmp(lbl, "Initial", 7))
84 {
85 elm_button_autorepeat_initial_timeout_set(app->cursors.up, t);
86 elm_button_autorepeat_initial_timeout_set(app->cursors.down, t);
87 elm_button_autorepeat_initial_timeout_set(app->cursors.left, t);
88 elm_button_autorepeat_initial_timeout_set(app->cursors.right, t);
89 }
90 else if (!strncmp(lbl, "Gap", 3))
91 {
92 elm_button_autorepeat_gap_timeout_set(app->cursors.up, t);
93 elm_button_autorepeat_gap_timeout_set(app->cursors.down, t);
94 elm_button_autorepeat_gap_timeout_set(app->cursors.left, t);
95 elm_button_autorepeat_gap_timeout_set(app->cursors.right, t);
96 }
97}
98
99EAPI_MAIN int
100elm_main(int argc, char *argv[])
101{
102 Evas_Object *win, *box, *box2, *btn, *icon;
103 static App_Data data;
104
105 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
106
107 win = elm_win_util_standard_add("Button example", "Button example");
108 elm_win_autodel_set(win, EINA_TRUE);
109
110 box = elm_box_add(win);
111 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
112 elm_win_resize_object_add(win, box);
113 evas_object_show(box);
114
115 box2 = elm_box_add(win);
116 elm_box_horizontal_set(box2, EINA_TRUE);
117 evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, 0.0);
118 elm_box_pack_end(box, box2);
119 evas_object_show(box2);
120
121 btn = elm_button_add(win);
122 elm_object_text_set(btn, "Initial: 0.0");
123 elm_box_pack_end(box2, btn);
124 evas_object_show(btn);
125 evas_object_smart_callback_add(btn, "clicked", _btn_options_cb, &data);
126
127 btn = elm_button_add(win);
128 elm_object_text_set(btn, "Initial: 1.0");
129 elm_box_pack_end(box2, btn);
130 evas_object_show(btn);
131 evas_object_smart_callback_add(btn, "clicked", _btn_options_cb, &data);
132
133 btn = elm_button_add(win);
134 elm_object_text_set(btn, "Initial: 5.0");
135 elm_box_pack_end(box2, btn);
136 evas_object_show(btn);
137 evas_object_smart_callback_add(btn, "clicked", _btn_options_cb, &data);
138
139 box2 = elm_box_add(win);
140 elm_box_horizontal_set(box2, EINA_TRUE);
141 evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, 0.0);
142 elm_box_pack_end(box, box2);
143 evas_object_show(box2);
144
145 btn = elm_button_add(win);
146 elm_object_text_set(btn, "Gap: 0.1");
147 elm_box_pack_end(box2, btn);
148 evas_object_show(btn);
149 evas_object_smart_callback_add(btn, "clicked", _btn_options_cb, &data);
150
151 btn = elm_button_add(win);
152 elm_object_text_set(btn, "Gap: 0.5");
153 elm_box_pack_end(box2, btn);
154 evas_object_show(btn);
155 evas_object_smart_callback_add(btn, "clicked", _btn_options_cb, &data);
156
157 btn = elm_button_add(win);
158 elm_object_text_set(btn, "Gap: 1.0");
159 elm_box_pack_end(box2, btn);
160 evas_object_show(btn);
161 evas_object_smart_callback_add(btn, "clicked", _btn_options_cb, &data);
162
163 btn = elm_button_add(win);
164 elm_button_autorepeat_set(btn, EINA_TRUE);
165 elm_button_autorepeat_initial_timeout_set(btn, 1.0);
166 elm_button_autorepeat_gap_timeout_set(btn, 0.5);
167 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
168 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.0);
169 elm_box_pack_end(box, btn);
170 evas_object_show(btn);
171 evas_object_smart_callback_add(btn, "repeated", _btn_cursors_move_cb, &data);
172 evas_object_smart_callback_add(btn, "unpressed", _btn_cursors_release_cb,
173 &data);
174
175 icon = elm_icon_add(win);
176 elm_icon_standard_set(icon, "arrow_up");
177 elm_object_part_content_set(btn, "icon", icon);
178
179 data.cursors.up = btn;
180
181 box2 = elm_box_add(win);
182 elm_box_horizontal_set(box2, EINA_TRUE);
183 evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
184 evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL);
185 elm_box_pack_end(box, box2);
186 evas_object_show(box2);
187
188 btn = elm_button_add(win);
189 elm_button_autorepeat_set(btn, EINA_TRUE);
190 elm_button_autorepeat_initial_timeout_set(btn, 1.0);
191 elm_button_autorepeat_gap_timeout_set(btn, 0.5);
192 evas_object_size_hint_weight_set(btn, 0.0, EVAS_HINT_EXPAND);
193 evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
194 elm_box_pack_end(box2, btn);
195 evas_object_show(btn);
196 evas_object_smart_callback_add(btn, "repeated", _btn_cursors_move_cb, &data);
197 evas_object_smart_callback_add(btn, "unpressed", _btn_cursors_release_cb,
198 &data);
199
200 icon = elm_icon_add(win);
201 elm_icon_standard_set(icon, "arrow_left");
202 elm_object_part_content_set(btn, "icon", icon);
203
204 data.cursors.left = btn;
205
206 btn = elm_button_add(win);
207 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
208 elm_box_pack_end(box2, btn);
209 evas_object_show(btn);
210
211 icon = elm_icon_add(win);
212 elm_icon_standard_set(icon, "close");
213 elm_object_part_content_set(btn, "icon", icon);
214
215 data.mid = btn;
216
217 btn = elm_button_add(win);
218 elm_button_autorepeat_set(btn, EINA_TRUE);
219 elm_button_autorepeat_initial_timeout_set(btn, 1.0);
220 elm_button_autorepeat_gap_timeout_set(btn, 0.5);
221 evas_object_size_hint_weight_set(btn, 0.0, EVAS_HINT_EXPAND);
222 evas_object_size_hint_align_set(btn, 0.0, EVAS_HINT_FILL);
223 elm_box_pack_end(box2, btn);
224 evas_object_show(btn);
225 evas_object_smart_callback_add(btn, "repeated", _btn_cursors_move_cb, &data);
226 evas_object_smart_callback_add(btn, "unpressed", _btn_cursors_release_cb,
227 &data);
228
229 icon = elm_icon_add(win);
230 elm_icon_standard_set(icon, "arrow_right");
231 elm_object_part_content_set(btn, "icon", icon);
232
233 data.cursors.right = btn;
234
235 btn = elm_button_add(win);
236 elm_button_autorepeat_set(btn, EINA_TRUE);
237 elm_button_autorepeat_initial_timeout_set(btn, 1.0);
238 elm_button_autorepeat_gap_timeout_set(btn, 0.5);
239 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
240 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.0);
241 elm_box_pack_end(box, btn);
242 evas_object_show(btn);
243 evas_object_smart_callback_add(btn, "repeated", _btn_cursors_move_cb, &data);
244 evas_object_smart_callback_add(btn, "unpressed", _btn_cursors_release_cb,
245 &data);
246
247 icon = elm_icon_add(win);
248 elm_icon_standard_set(icon, "arrow_down");
249 elm_object_part_content_set(btn, "icon", icon);
250
251 data.cursors.down = btn;
252
253 evas_object_resize(win, 300, 320);
254 evas_object_show(win);
255
256 elm_run();
257
258 return 0;
259}
260ELM_MAIN()
diff --git a/src/examples/elementary/button_example_01.js b/src/examples/elementary/button_example_01.js
new file mode 100644
index 0000000000..a959427c91
--- /dev/null
+++ b/src/examples/elementary/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.getText("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/elementary/calendar_cxx_example_01.cc b/src/examples/elementary/calendar_cxx_example_01.cc
new file mode 100644
index 0000000000..9014b5cb51
--- /dev/null
+++ b/src/examples/elementary/calendar_cxx_example_01.cc
@@ -0,0 +1,21 @@
1#include <Elementary.hh>
2
3EAPI_MAIN int
4elm_main (int argc, char *argv[])
5{
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7 ::elm::win_standard win;
8 win.title_set("Calendar Creation Example");
9 win.autohide_set(true);
10
11 ::elm::calendar cal(efl::eo::parent = win);
12 cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
13 win.resize_object_add(cal);
14 cal.visible_set(true);
15
16 win.visible_set(true);
17
18 elm_run();
19 return 0;
20}
21ELM_MAIN()
diff --git a/src/examples/elementary/calendar_cxx_example_02.cc b/src/examples/elementary/calendar_cxx_example_02.cc
new file mode 100644
index 0000000000..ce8d0eb68a
--- /dev/null
+++ b/src/examples/elementary/calendar_cxx_example_02.cc
@@ -0,0 +1,38 @@
1#include <Elementary.hh>
2
3static char *
4_format_month_year(struct tm *format_time)
5{
6 char buf[32];
7 if (!strftime(buf, sizeof(buf), "%b %y", format_time)) return NULL;
8 return strdup(buf);
9}
10
11EAPI_MAIN int
12elm_main (int argc, char *argv[])
13{
14 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
15
16 const char *weekdays[] =
17 {
18 "S", "M", "T", "W", "T", "F", "S"
19 };
20
21 ::elm::win_standard win;
22 win.title_set("Calendar Layout Formatting Example");
23 win.autohide_set(true);
24
25 ::elm::calendar cal(efl::eo::parent = win);
26 cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
27 win.resize_object_add(cal);
28
29 cal.format_function_set(_format_month_year);
30 cal.weekdays_names_set(weekdays);
31
32 cal.visible_set(true);
33 win.visible_set(true);
34
35 elm_run();
36 return 0;
37}
38ELM_MAIN()
diff --git a/src/examples/elementary/calendar_cxx_example_03.cc b/src/examples/elementary/calendar_cxx_example_03.cc
new file mode 100644
index 0000000000..9aacadee72
--- /dev/null
+++ b/src/examples/elementary/calendar_cxx_example_03.cc
@@ -0,0 +1,23 @@
1#include <Elementary.hh>
2
3EAPI_MAIN int
4elm_main (int argc, char *argv[])
5{
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7
8 ::elm::win_standard win;
9 win.title_set("Calendar Min/Max Year Example");
10 win.autohide_set(true);
11
12 ::elm::calendar cal(efl::eo::parent = win);
13 cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
14 win.resize_object_add(cal);
15 cal.min_max_year_set(2020, 2022);
16 cal.visible_set(true);
17
18 win.visible_set(true);
19
20 elm_run();
21 return 0;
22}
23ELM_MAIN()
diff --git a/src/examples/elementary/calendar_cxx_example_04.cc b/src/examples/elementary/calendar_cxx_example_04.cc
new file mode 100644
index 0000000000..9df983df91
--- /dev/null
+++ b/src/examples/elementary/calendar_cxx_example_04.cc
@@ -0,0 +1,43 @@
1#include <Elementary.hh>
2
3#define SECS_DAY 86400
4
5EAPI_MAIN int
6elm_main (int argc, char *argv[])
7{
8 struct tm selected_time;
9 time_t current_time;
10
11 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
12
13 ::elm::win_standard win;
14 win.title_set("Calendar Day Selection Example");
15 win.autohide_set(true);
16
17 ::elm::box bx(efl::eo::parent = win);
18 bx.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
19 win.resize_object_add(bx);
20 bx.visible_set(true);
21
22 ::elm::calendar cal(efl::eo::parent = win);
23 cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
24 cal.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
25 cal.select_mode_set(ELM_CALENDAR_SELECT_MODE_NONE);
26 cal.visible_set(true);
27 bx.pack_end(cal);
28
29 ::elm::calendar cal2(efl::eo::parent = win);
30 cal2.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
31 cal2.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
32 current_time = time(NULL) +2 * SECS_DAY;
33 localtime_r(&current_time, &selected_time);
34 cal2.selected_time_set(&selected_time);
35 cal2.visible_set(true);
36 bx.pack_end(cal2);
37
38 win.visible_set(true);
39
40 elm_run();
41 return 0;
42}
43ELM_MAIN()
diff --git a/src/examples/elementary/calendar_cxx_example_05.cc b/src/examples/elementary/calendar_cxx_example_05.cc
new file mode 100644
index 0000000000..b209efedfa
--- /dev/null
+++ b/src/examples/elementary/calendar_cxx_example_05.cc
@@ -0,0 +1,50 @@
1#include <Elementary.hh>
2
3EAPI_MAIN int
4elm_main (int argc, char *argv[])
5{
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7
8 ::elm::win_standard win;
9 win.title_set("Calendar Getters Example");
10 win.autohide_set(true);
11
12 ::elm::calendar cal(efl::eo::parent = win);
13 cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
14 win.resize_object_add(cal);
15
16 auto print_cal_info = std::bind([] (::elm::calendar obj)
17 {
18 int year_min, year_max;
19 bool sel_enabled;
20 const char **wds;
21 struct tm sel_time;
22 double interval;
23
24 if (!obj.selected_time_get(&sel_time))
25 return;
26
27 interval = obj.interval_get();
28 obj.min_max_year_get(&year_min, &year_max);
29 sel_enabled = (obj.select_mode_get() != ELM_CALENDAR_SELECT_MODE_NONE);
30 wds = obj.weekdays_names_get();
31
32 std::cout << "Day: " << sel_time.tm_mday << ", Mon: " << sel_time.tm_mon << ", Year " <<
33 sel_time.tm_year + 1900 << ", WeekDay: " << sel_time.tm_wday << "<br>" << std::endl;
34
35 std::cout << "Interval: " << interval << ", Year_Min: " << year_min << ", Year_Max " <<
36 year_max << ", Sel Enabled: " << sel_enabled << "<br>" << std::endl;
37
38 std::cout << "Weekdays: " << wds[0] << ", " << wds[1] << ", " << wds[2] << ", " << wds[3] <<
39 ", " << wds[4] << ", " << wds[5] << ", " << wds[6] << "<br>" << std::endl << std::endl;
40 } , std::placeholders::_1 );
41
42 cal.callback_changed_add(print_cal_info);
43 cal.visible_set(true);
44
45 win.visible_set(true);
46
47 elm_run();
48 return 0;
49}
50ELM_MAIN()
diff --git a/src/examples/elementary/calendar_example_01.c b/src/examples/elementary/calendar_example_01.c
new file mode 100644
index 0000000000..0ae9f3dc85
--- /dev/null
+++ b/src/examples/elementary/calendar_example_01.c
@@ -0,0 +1,34 @@
1/**
2 * Simple Elementary's <b>calendar widget</b> example, illustrating its
3 * creation.
4 *
5 * See stdout/stderr for output. Compile with:
6 *
7 * @verbatim
8 * gcc -o calendar_example_01 calendar_example_01.c -g `pkg-config --cflags --libs elementary`
9 * @endverbatim
10 */
11
12#include <Elementary.h>
13
14EAPI_MAIN int
15elm_main(int argc, char **argv)
16{
17 Evas_Object *win, *cal;
18
19 win = elm_win_util_standard_add("calendar", "Calendar Creation Example");
20 elm_win_autodel_set(win, EINA_TRUE);
21 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
22
23 cal = elm_calendar_add(win);
24 evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
25 elm_win_resize_object_add(win, cal);
26 evas_object_show(cal);
27
28 evas_object_show(win);
29
30 elm_run();
31
32 return 0;
33}
34ELM_MAIN()
diff --git a/src/examples/elementary/calendar_example_01.js b/src/examples/elementary/calendar_example_01.js
new file mode 100644
index 0000000000..980bf83a29
--- /dev/null
+++ b/src/examples/elementary/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/elementary/calendar_example_02.c b/src/examples/elementary/calendar_example_02.c
new file mode 100644
index 0000000000..d469f88364
--- /dev/null
+++ b/src/examples/elementary/calendar_example_02.c
@@ -0,0 +1,53 @@
1/**
2 * Elementary's <b>calendar widget</b> example, demonstrates how to modify
3 * layout strings, using functions to set weekdays names and to format
4 * month and year label.
5 *
6 * See stdout/stderr for output. Compile with:
7 *
8 * @verbatim
9 * gcc -o calendar_example_02 calendar_example_02.c -g `pkg-config --cflags --libs elementary`
10 * @endverbatim
11 */
12
13#include <Elementary.h>
14
15static char *
16_format_month_year(struct tm *format_time)
17{
18 char buf[32];
19 /* abbreviates month and year */
20 if (!strftime(buf, sizeof(buf), "%b %y", format_time)) return NULL;
21 return strdup(buf);
22}
23
24EAPI_MAIN int
25elm_main(int argc, char **argv)
26{
27 Evas_Object *win, *cal;
28 const char *weekdays[] =
29 {
30 "S", "M", "T", "W", "T", "F", "S"
31 };
32
33 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
34
35 win = elm_win_util_standard_add("calendar", "Calendar Layout Formatting Example");
36 elm_win_autodel_set(win, EINA_TRUE);
37
38 cal = elm_calendar_add(win);
39 evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
40 elm_win_resize_object_add(win, cal);
41
42 elm_calendar_format_function_set(cal, _format_month_year);
43 elm_calendar_weekdays_names_set(cal, weekdays);
44
45 evas_object_show(cal);
46
47 evas_object_show(win);
48
49 elm_run();
50
51 return 0;
52}
53ELM_MAIN()
diff --git a/src/examples/elementary/calendar_example_02.js b/src/examples/elementary/calendar_example_02.js
new file mode 100644
index 0000000000..c8b53fd755
--- /dev/null
+++ b/src/examples/elementary/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/elementary/calendar_example_03.c b/src/examples/elementary/calendar_example_03.c
new file mode 100644
index 0000000000..1f01f4d7c4
--- /dev/null
+++ b/src/examples/elementary/calendar_example_03.c
@@ -0,0 +1,37 @@
1/**
2 * Simple Elementary's <b>calendar widget</b> example, illustrating minimum
3 * and maximum years restriction. User will see a calendar of years
4 * 2020, 2021 and 2022.
5 *
6 * See stdout/stderr for output. Compile with:
7 *
8 * @verbatim
9 * gcc -o calendar_example_03 calendar_example_03.c -g `pkg-config --cflags --libs elementary`
10 * @endverbatim
11 */
12
13#include <Elementary.h>
14
15EAPI_MAIN int
16elm_main(int argc, char **argv)
17{
18 Evas_Object *win, *cal;
19
20 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
21
22 win = elm_win_util_standard_add("calendar", "Calendar Min/Max Year Example");
23 elm_win_autodel_set(win, EINA_TRUE);
24
25 cal = elm_calendar_add(win);
26 evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
27 elm_win_resize_object_add(win, cal);
28 elm_calendar_min_max_year_set(cal, 2020, 2022);
29 evas_object_show(cal);
30
31 evas_object_show(win);
32
33 elm_run();
34
35 return 0;
36}
37ELM_MAIN()
diff --git a/src/examples/elementary/calendar_example_03.js b/src/examples/elementary/calendar_example_03.js
new file mode 100644
index 0000000000..481079fc68
--- /dev/null
+++ b/src/examples/elementary/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/elementary/calendar_example_04.c b/src/examples/elementary/calendar_example_04.c
new file mode 100644
index 0000000000..e2af9e9f06
--- /dev/null
+++ b/src/examples/elementary/calendar_example_04.c
@@ -0,0 +1,55 @@
1/**
2 * Elementary's <b>calendar widget</b> example, regarding date selection.
3 * Shows how to disable day selection by user and how to select a date.
4 * It selects two days from current day.
5 *
6 * See stdout/stderr for output. Compile with:
7 *
8 * @verbatim
9 * gcc -o calendar_example_04 calendar_example_04.c -g `pkg-config --cflags --libs elementary`
10 * @endverbatim
11 */
12
13#include <Elementary.h>
14
15#define SECS_DAY 86400
16
17EAPI_MAIN int
18elm_main(int argc, char **argv)
19{
20 Evas_Object *win, *bx, *cal, *cal2;
21 struct tm selected_time;
22 time_t current_time;
23
24 win = elm_win_util_standard_add("calendar", "Calendar Day Selection Example");
25 elm_win_autodel_set(win, EINA_TRUE);
26 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
27
28 bx = elm_box_add(win);
29 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
30 elm_win_resize_object_add(win, bx);
31 evas_object_show(bx);
32
33 cal = elm_calendar_add(win);
34 evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
35 evas_object_size_hint_align_set(cal, EVAS_HINT_FILL, EVAS_HINT_FILL);
36 elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_NONE);
37 evas_object_show(cal);
38 elm_box_pack_end(bx, cal);
39
40 cal2 = elm_calendar_add(win);
41 evas_object_size_hint_weight_set(cal2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
42 evas_object_size_hint_align_set(cal2, EVAS_HINT_FILL, EVAS_HINT_FILL);
43 current_time = time(NULL) + 2 * SECS_DAY;
44 localtime_r(&current_time, &selected_time);
45 elm_calendar_selected_time_set(cal2, &selected_time);
46 evas_object_show(cal2);
47 elm_box_pack_end(bx, cal2);
48
49 evas_object_show(win);
50
51 elm_run();
52
53 return 0;
54}
55ELM_MAIN()
diff --git a/src/examples/elementary/calendar_example_04.js b/src/examples/elementary/calendar_example_04.js
new file mode 100644
index 0000000000..7f1094149a
--- /dev/null
+++ b/src/examples/elementary/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/elementary/calendar_example_05.c b/src/examples/elementary/calendar_example_05.c
new file mode 100644
index 0000000000..dad576ecfd
--- /dev/null
+++ b/src/examples/elementary/calendar_example_05.c
@@ -0,0 +1,62 @@
1/**
2 * Elementary's <b>calendar widget</b> example, illustrating smart callback
3 * registry and getters usage.
4 *
5 * See stdout/stderr for output. Compile with:
6 *
7 * @verbatim
8 * gcc -o calendar_example_05 calendar_example_05.c -g `pkg-config --cflags --libs elementary`
9 * @endverbatim
10 */
11
12#include <Elementary.h>
13
14static void
15_print_cal_info_cb(void *data, Evas_Object *obj, void *event_info)
16{
17 int year_min, year_max;
18 Eina_Bool sel_enabled;
19 const char **wds;
20 struct tm sel_time;
21 double interval;
22
23 if (!elm_calendar_selected_time_get(obj, &sel_time))
24 return;
25
26 interval = elm_calendar_interval_get(obj);
27 elm_calendar_min_max_year_get(obj, &year_min, &year_max);
28 sel_enabled = (elm_calendar_select_mode_get(obj) != ELM_CALENDAR_SELECT_MODE_NONE);
29 wds = elm_calendar_weekdays_names_get(obj);
30
31 printf("Day: %i, Mon: %i, Year %i, WeekDay: %i<br>\n"
32 "Interval: %0.2f, Year_Min: %i, Year_Max %i, Sel Enabled : %i<br>\n"
33 "Weekdays: %s, %s, %s, %s, %s, %s, %s<br>\n\n",
34 sel_time.tm_mday, sel_time.tm_mon, sel_time.tm_year + 1900, sel_time.tm_wday,
35 interval, year_min, year_max, sel_enabled,
36 wds[0], wds[1], wds[2], wds[3], wds[4], wds[5], wds[6]);
37}
38
39EAPI_MAIN int
40elm_main(int argc, char **argv)
41{
42 Evas_Object *win, *cal;
43
44 win = elm_win_util_standard_add("calendar", "Calendar Getters Example");
45 elm_win_autodel_set(win, EINA_TRUE);
46 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
47
48 cal = elm_calendar_add(win);
49 evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50 elm_win_resize_object_add(win, cal);
51 /* Add callback to display calendar information every time user
52 * selects a new date */
53 evas_object_smart_callback_add(cal, "changed", _print_cal_info_cb, NULL);
54 evas_object_show(cal);
55
56 evas_object_show(win);
57
58 elm_run();
59
60 return 0;
61}
62ELM_MAIN()
diff --git a/src/examples/elementary/calendar_example_05.js b/src/examples/elementary/calendar_example_05.js
new file mode 100644
index 0000000000..7759b2da8b
--- /dev/null
+++ b/src/examples/elementary/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/elementary/calendar_example_06.c b/src/examples/elementary/calendar_example_06.c
new file mode 100644
index 0000000000..54016be00b
--- /dev/null
+++ b/src/examples/elementary/calendar_example_06.c
@@ -0,0 +1,89 @@
1/**
2 * Elementary's <b>calendar widget</b> example to add / del / clear marks.
3 *
4 * See stdout/stderr for output. Compile with:
5 *
6 * @verbatim
7 * gcc -o calendar_example_06 calendar_example_06.c -g `pkg-config --cflags --libs elementary`
8 * @endverbatim
9 */
10
11#include <Elementary.h>
12
13#define SECS_DAY 86400
14
15static void
16_btn_clear_cb(void *data, Evas_Object *btn, void *ev)
17{
18 Evas_Object *cal = data;
19 elm_calendar_marks_clear(cal);
20 elm_calendar_marks_draw(cal);
21}
22
23EAPI_MAIN int
24elm_main(int argc, char **argv)
25{
26 Evas_Object *win, *bt, *bx, *cal;
27 Elm_Calendar_Mark *mark;
28 struct tm selected_time;
29 time_t current_time;
30 struct tm sunday = { 0, 0, 12, 7, 0, 0, 0, 0, -1, 0, NULL };
31 /* tm {sec, min, hour, mday, mon, year, wday, yday, isdst } */
32 /* weekdays since Sunday, range 0 to 6 */
33 struct tm christmas;
34 christmas.tm_mday = 25;
35 /* months since Jan, in the range 0 to 11 */
36 christmas.tm_mon = 11;
37
38 win = elm_win_util_standard_add("calendar", "Calendar Marks Example");
39 elm_win_autodel_set(win, EINA_TRUE);
40 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
41
42 bx = elm_box_add(win);
43 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
44 elm_win_resize_object_add(win, bx);
45 evas_object_show(bx);
46
47 cal = elm_calendar_add(win);
48 evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
49 evas_object_size_hint_align_set(cal, EVAS_HINT_FILL, EVAS_HINT_FILL);
50 elm_box_pack_end(bx, cal);
51 evas_object_show(cal);
52
53 /* check today - we'll remove it later */
54 current_time = time(NULL);
55 localtime_r(&current_time, &selected_time);
56 mark = elm_calendar_mark_add(cal, "checked", &selected_time,
57 ELM_CALENDAR_UNIQUE);
58
59 /* check tomorrow */
60 current_time = time(NULL) + 1 * SECS_DAY;
61 localtime_r(&current_time, &selected_time);
62 elm_calendar_mark_add(cal, "checked", &selected_time, ELM_CALENDAR_UNIQUE);
63
64 /* mark christmas as holiday */
65 elm_calendar_mark_add(cal, "holiday", &christmas, ELM_CALENDAR_ANNUALLY);
66
67 /* mark Sundays as holidays */
68 elm_calendar_mark_add(cal, "holiday", &sunday, ELM_CALENDAR_WEEKLY);
69
70 /* ok, let's remove today's check */
71 elm_calendar_mark_del(mark);
72
73 elm_calendar_marks_draw(cal);
74
75 bt = elm_button_add(win);
76 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
77 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
78 elm_object_text_set(bt, "Clear marks");
79 evas_object_smart_callback_add(bt, "clicked", _btn_clear_cb, cal);
80 elm_box_pack_end(bx, bt);
81 evas_object_show(bt);
82
83 evas_object_show(win);
84
85 elm_run();
86
87 return 0;
88}
89ELM_MAIN()
diff --git a/src/examples/elementary/check_example_01.c b/src/examples/elementary/check_example_01.c
new file mode 100644
index 0000000000..9af278663e
--- /dev/null
+++ b/src/examples/elementary/check_example_01.c
@@ -0,0 +1,51 @@
1//Compile with:
2//gcc -o check_example_01 check_example_01.c -g `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6static void
7_print(void *data, Evas_Object *obj, void *event_info)
8{
9 printf("check %smarked\n", *((Eina_Bool*)data) ? "" : "un");
10}
11
12EAPI_MAIN int
13elm_main(int argc, char **argv)
14{
15 Evas_Object *win, *cb, *cb2, *icon;
16 Eina_Bool value;
17
18 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
19
20 win = elm_win_util_standard_add("check", "Check");
21 elm_win_autodel_set(win, EINA_TRUE);
22
23 cb = elm_check_add(win);
24 elm_object_text_set(cb, "checkbox");
25 elm_check_state_pointer_set(cb, &value);
26 evas_object_smart_callback_add(cb, "changed", _print, &value);
27 evas_object_move(cb, 10, 10);
28 evas_object_resize(cb, 200, 30);
29 evas_object_show(cb);
30
31 icon = evas_object_rectangle_add(evas_object_evas_get(win));
32 evas_object_color_set(icon, 0, 255, 0, 255);
33 evas_object_resize(icon, 20, 20);
34 evas_object_show(icon);
35
36 cb2 = elm_check_add(win);
37 elm_object_text_set(cb2, "another checkbox");
38 elm_check_state_set(cb2, EINA_TRUE);
39 elm_object_part_content_set(cb2, "icon", icon);
40 evas_object_move(cb2, 10, 50);
41 evas_object_resize(cb2, 200, 30);
42 evas_object_show(cb2);
43
44 evas_object_resize(win, 200, 100);
45 evas_object_show(win);
46
47 elm_run();
48
49 return 0;
50}
51ELM_MAIN()
diff --git a/src/examples/elementary/clock_cxx_example.cc b/src/examples/elementary/clock_cxx_example.cc
new file mode 100644
index 0000000000..546ad33bc1
--- /dev/null
+++ b/src/examples/elementary/clock_cxx_example.cc
@@ -0,0 +1,53 @@
1#include <Elementary.hh>
2
3EAPI_MAIN int
4elm_main (int argc, char *argv[])
5{
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
7
8 ::elm::win_standard win;
9 win.title_set("Clock Example");
10 win.autohide_set(true);
11
12 ::elm::box bx(efl::eo::parent = win);
13 bx.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
14 win.resize_object_add(bx);
15 bx.visible_set(true);
16
17 ::elm::clock ck(efl::eo::parent = win);
18 bx.pack_end(ck);
19 ck.visible_set(true);
20
21 ::elm::clock ck2(efl::eo::parent = win);
22 ck2.show_am_pm_set(true);
23 bx.pack_end(ck2);
24 ck2.visible_set(true);
25
26 ::elm::clock ck3(efl::eo::parent = win);
27 ck3.show_seconds_set(true);
28 ck3.time_set(10, 11, 12);
29 bx.pack_end(ck3);
30 ck3.visible_set(true);
31
32 ::elm::clock ck4(efl::eo::parent = win);
33 ck4.edit_set(true);
34 ck4.show_seconds_set(true);
35 ck4.show_am_pm_set(true);
36 ck4.time_set(10, 11, 12);
37 bx.pack_end(ck4);
38 ck4.visible_set(true);
39
40 ::elm::clock ck5(efl::eo::parent = win);
41 ck5.show_seconds_set(true);
42 ck5.edit_set(true);
43 int digedit = ELM_CLOCK_EDIT_HOUR_UNIT | ELM_CLOCK_EDIT_MIN_UNIT | ELM_CLOCK_EDIT_SEC_UNIT;
44 ck5.edit_mode_set(static_cast<Elm_Clock_Edit_Mode>(digedit));
45 bx.pack_end(ck5);
46 ck5.visible_set(true);
47
48 win.visible_set(true);
49
50 elm_run();
51 return 0;
52}
53ELM_MAIN()
diff --git a/src/examples/elementary/clock_example.c b/src/examples/elementary/clock_example.c
new file mode 100644
index 0000000000..a7a9573283
--- /dev/null
+++ b/src/examples/elementary/clock_example.c
@@ -0,0 +1,72 @@
1/**
2 * Simple Elementary's <b>clock widget</b> example, illustrating its
3 * usage and API.
4 *
5 * See stdout/stderr for output. Compile with:
6 *
7 * @verbatim
8 * gcc -g clock_example.c -o clock_example `pkg-config --cflags --libs elementary`
9 * @endverbatim
10 */
11
12#include <Elementary.h>
13
14EAPI_MAIN int
15elm_main(int argc, char **argv)
16{
17 Evas_Object *win, *bx, *ck;
18 unsigned int digedit;
19
20 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
21
22 win = elm_win_util_standard_add("clock", "Clock Example");
23 elm_win_autodel_set(win, EINA_TRUE);
24
25 bx = elm_box_add(win);
26 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
27 elm_win_resize_object_add(win, bx);
28 evas_object_show(bx);
29
30 /* pristine (no seconds, military time) */
31 ck = elm_clock_add(win);
32 elm_box_pack_end(bx, ck);
33 evas_object_show(ck);
34
35 /* am/pm */
36 ck = elm_clock_add(win);
37 elm_clock_show_am_pm_set(ck, EINA_TRUE);
38 elm_box_pack_end(bx, ck);
39 evas_object_show(ck);
40
41 /* with seconds and custom time */
42 ck = elm_clock_add(win);
43 elm_clock_show_seconds_set(ck, EINA_TRUE);
44 elm_clock_time_set(ck, 10, 11, 12);
45 elm_box_pack_end(bx, ck);
46 evas_object_show(ck);
47
48 /* in edition mode, with seconds, custom time and am/pm set */