aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/edje/src/examples
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-04 18:41:13 +1000
committerDavid Walter Seikel2012-01-04 18:41:13 +1000
commitdd7595a3475407a7fa96a97393bae8c5220e8762 (patch)
treee341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/edje/src/examples
parentAdd the skeleton. (diff)
downloadSledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to '')
-rw-r--r--libraries/edje/src/examples/Makefile.am107
-rw-r--r--libraries/edje/src/examples/Makefile.in827
-rw-r--r--libraries/edje/src/examples/animations.edc93
-rw-r--r--libraries/edje/src/examples/basic.edc39
-rw-r--r--libraries/edje/src/examples/box.edc142
-rw-r--r--libraries/edje/src/examples/bubble.pngbin0 -> 4737 bytes
-rw-r--r--libraries/edje/src/examples/color-class.edc87
-rw-r--r--libraries/edje/src/examples/drag.edc89
-rw-r--r--libraries/edje/src/examples/edje-animations.c156
-rw-r--r--libraries/edje/src/examples/edje-basic.c226
-rw-r--r--libraries/edje/src/examples/edje-box.c191
-rw-r--r--libraries/edje/src/examples/edje-box2.c204
-rw-r--r--libraries/edje/src/examples/edje-color-class.c257
-rw-r--r--libraries/edje/src/examples/edje-drag.c157
-rw-r--r--libraries/edje/src/examples/edje-perspective.c201
-rw-r--r--libraries/edje/src/examples/edje-signals-messages.c230
-rw-r--r--libraries/edje/src/examples/edje-swallow.c95
-rw-r--r--libraries/edje/src/examples/edje-table.c165
-rw-r--r--libraries/edje/src/examples/edje-text.c92
-rw-r--r--libraries/edje/src/examples/lua_script.edc405
-rw-r--r--libraries/edje/src/examples/perspective.edc140
-rw-r--r--libraries/edje/src/examples/red.pngbin0 -> 225 bytes
-rw-r--r--libraries/edje/src/examples/signals-messages.edc174
-rw-r--r--libraries/edje/src/examples/sigtest.c309
-rw-r--r--libraries/edje/src/examples/sigtest.edc303
-rw-r--r--libraries/edje/src/examples/swallow.edc21
-rw-r--r--libraries/edje/src/examples/table.edc19
-rw-r--r--libraries/edje/src/examples/test.pngbin0 -> 22869 bytes
-rw-r--r--libraries/edje/src/examples/text.edc68
29 files changed, 4797 insertions, 0 deletions
diff --git a/libraries/edje/src/examples/Makefile.am b/libraries/edje/src/examples/Makefile.am
new file mode 100644
index 0000000..20e2c81
--- /dev/null
+++ b/libraries/edje/src/examples/Makefile.am
@@ -0,0 +1,107 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3pkglibdir = $(datadir)/$(PACKAGE)/examples
4if ENABLE_MULTISENSE
5MULTISENSE_EDC_FILE = multisense.edc
6SND_DIR = -sd $(srcdir)
7endif
8#put here all EDCs one needs to the examples
9EDCS = basic.edc \
10 swallow.edc \
11 text.edc \
12 table.edc \
13 box.edc \
14 drag.edc \
15 signals-messages.edc \
16 color-class.edc \
17 perspective.edc \
18 animations.edc \
19 lua_script.edc \
20 sigtest.edc \
21 $(MULTISENSE_EDC_FILE)
22
23filesdir = $(datadir)/$(PACKAGE)/examples
24files_DATA =
25
26if BUILD_EXAMPLES
27
28AM_CPPFLAGS = \
29-I. \
30-I$(top_srcdir)/src/lib \
31-I$(top_srcdir)/src/lib/include \
32-DPACKAGE_BIN_DIR=\"$(bindir)\" \
33-DPACKAGE_LIB_DIR=\"$(libdir)\" \
34-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
35-DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\"
36
37pkglib_PROGRAMS =
38
39#the ones using ecore_evas follow
40AM_CPPFLAGS += @EDJE_CFLAGS@
41
42pkglib_PROGRAMS += \
43 edje-basic \
44 edje-swallow \
45 edje-text \
46 edje-table \
47 edje-box \
48 edje-box2 \
49 edje-drag\
50 edje-signals-messages \
51 edje-color-class \
52 edje-perspective \
53 edje-animations \
54 sigtest
55
56LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@
57
58.edc.edj:
59 $(edje_cc) -v -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F)
60
61EDJS = $(EDCS:%.edc=%.edj)
62
63files_DATA += $(EDJS)
64
65endif # if BUILD_EXAMPLES
66
67if INSTALL_EXAMPLES
68
69#put here additional data when installing examples
70files_DATA += \
71 $(srcdir)/bubble.png \
72 $(srcdir)/red.png \
73 $(srcdir)/test.png \
74 $(srcdir)/Vera.ttf
75
76files_DATA += \
77 $(EDCS) \
78 $(srcdir)/edje-basic.c \
79 $(srcdir)/edje-swallow.c \
80 $(srcdir)/edje-text.c \
81 $(srcdir)/edje-table.c \
82 $(srcdir)/edje-box.c \
83 $(srcdir)/edje-box2.c \
84 $(srcdir)/edje-drag.c \
85 $(srcdir)/edje-signals-messages.c \
86 $(srcdir)/edje-color-class.c \
87 $(srcdir)/edje-perspective.c \
88 $(srcdir)/edje-animations.c \
89 $(srcdir)/sigtest.c
90endif
91
92EXTRA_DIST = $(EDCS) \
93 $(srcdir)/bubble.png \
94 $(srcdir)/red.png \
95 $(srcdir)/test.png \
96 $(srcdir)/edje-basic.c \
97 $(srcdir)/edje-swallow.c \
98 $(srcdir)/edje-text.c \
99 $(srcdir)/edje-table.c \
100 $(srcdir)/edje-box.c \
101 $(srcdir)/edje-box2.c \
102 $(srcdir)/edje-drag.c \
103 $(srcdir)/edje-signals-messages.c \
104 $(srcdir)/edje-color-class.c \
105 $(srcdir)/edje-perspective.c \
106 $(srcdir)/edje-animations.c \
107 $(srcdir)/sigtest.c
diff --git a/libraries/edje/src/examples/Makefile.in b/libraries/edje/src/examples/Makefile.in
new file mode 100644
index 0000000..bde628f
--- /dev/null
+++ b/libraries/edje/src/examples/Makefile.in
@@ -0,0 +1,827 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18
19VPATH = @srcdir@
20pkgdatadir = $(datadir)/@PACKAGE@
21pkgincludedir = $(includedir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37@BUILD_EXAMPLES_TRUE@pkglib_PROGRAMS = edje-basic$(EXEEXT) \
38@BUILD_EXAMPLES_TRUE@ edje-swallow$(EXEEXT) edje-text$(EXEEXT) \
39@BUILD_EXAMPLES_TRUE@ edje-table$(EXEEXT) edje-box$(EXEEXT) \
40@BUILD_EXAMPLES_TRUE@ edje-box2$(EXEEXT) edje-drag$(EXEEXT) \
41@BUILD_EXAMPLES_TRUE@ edje-signals-messages$(EXEEXT) \
42@BUILD_EXAMPLES_TRUE@ edje-color-class$(EXEEXT) \
43@BUILD_EXAMPLES_TRUE@ edje-perspective$(EXEEXT) \
44@BUILD_EXAMPLES_TRUE@ edje-animations$(EXEEXT) sigtest$(EXEEXT)
45@BUILD_EXAMPLES_TRUE@am__append_1 = $(EDJS)
46
47#put here additional data when installing examples
48@INSTALL_EXAMPLES_TRUE@am__append_2 = $(srcdir)/bubble.png \
49@INSTALL_EXAMPLES_TRUE@ $(srcdir)/red.png $(srcdir)/test.png \
50@INSTALL_EXAMPLES_TRUE@ $(srcdir)/Vera.ttf $(EDCS) \
51@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-basic.c \
52@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-swallow.c \
53@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-text.c \
54@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-table.c \
55@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-box.c \
56@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-box2.c \
57@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-drag.c \
58@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-signals-messages.c \
59@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-color-class.c \
60@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-perspective.c \
61@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-animations.c \
62@INSTALL_EXAMPLES_TRUE@ $(srcdir)/sigtest.c
63subdir = src/examples
64DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
65ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
66am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
67 $(top_srcdir)/m4/efl_binary.m4 \
68 $(top_srcdir)/m4/efl_coverage.m4 \
69 $(top_srcdir)/m4/efl_doxygen.m4 \
70 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
71 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
72 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
73 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
74am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
75 $(ACLOCAL_M4)
76mkinstalldirs = $(install_sh) -d
77CONFIG_HEADER = $(top_builddir)/config.h
78CONFIG_CLEAN_FILES =
79CONFIG_CLEAN_VPATH_FILES =
80am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)"
81PROGRAMS = $(pkglib_PROGRAMS)
82edje_animations_SOURCES = edje-animations.c
83edje_animations_OBJECTS = edje-animations.$(OBJEXT)
84edje_animations_LDADD = $(LDADD)
85@BUILD_EXAMPLES_TRUE@edje_animations_DEPENDENCIES = \
86@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
87AM_V_lt = $(am__v_lt_$(V))
88am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
89am__v_lt_0 = --silent
90edje_basic_SOURCES = edje-basic.c
91edje_basic_OBJECTS = edje-basic.$(OBJEXT)
92edje_basic_LDADD = $(LDADD)
93@BUILD_EXAMPLES_TRUE@edje_basic_DEPENDENCIES = \
94@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
95edje_box_SOURCES = edje-box.c
96edje_box_OBJECTS = edje-box.$(OBJEXT)
97edje_box_LDADD = $(LDADD)
98@BUILD_EXAMPLES_TRUE@edje_box_DEPENDENCIES = \
99@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
100edje_box2_SOURCES = edje-box2.c
101edje_box2_OBJECTS = edje-box2.$(OBJEXT)
102edje_box2_LDADD = $(LDADD)
103@BUILD_EXAMPLES_TRUE@edje_box2_DEPENDENCIES = \
104@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
105edje_color_class_SOURCES = edje-color-class.c
106edje_color_class_OBJECTS = edje-color-class.$(OBJEXT)
107edje_color_class_LDADD = $(LDADD)
108@BUILD_EXAMPLES_TRUE@edje_color_class_DEPENDENCIES = \
109@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
110edje_drag_SOURCES = edje-drag.c
111edje_drag_OBJECTS = edje-drag.$(OBJEXT)
112edje_drag_LDADD = $(LDADD)
113@BUILD_EXAMPLES_TRUE@edje_drag_DEPENDENCIES = \
114@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
115edje_perspective_SOURCES = edje-perspective.c
116edje_perspective_OBJECTS = edje-perspective.$(OBJEXT)
117edje_perspective_LDADD = $(LDADD)
118@BUILD_EXAMPLES_TRUE@edje_perspective_DEPENDENCIES = \
119@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
120edje_signals_messages_SOURCES = edje-signals-messages.c
121edje_signals_messages_OBJECTS = edje-signals-messages.$(OBJEXT)
122edje_signals_messages_LDADD = $(LDADD)
123@BUILD_EXAMPLES_TRUE@edje_signals_messages_DEPENDENCIES = \
124@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
125edje_swallow_SOURCES = edje-swallow.c
126edje_swallow_OBJECTS = edje-swallow.$(OBJEXT)
127edje_swallow_LDADD = $(LDADD)
128@BUILD_EXAMPLES_TRUE@edje_swallow_DEPENDENCIES = \
129@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
130edje_table_SOURCES = edje-table.c
131edje_table_OBJECTS = edje-table.$(OBJEXT)
132edje_table_LDADD = $(LDADD)
133@BUILD_EXAMPLES_TRUE@edje_table_DEPENDENCIES = \
134@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
135edje_text_SOURCES = edje-text.c
136edje_text_OBJECTS = edje-text.$(OBJEXT)
137edje_text_LDADD = $(LDADD)
138@BUILD_EXAMPLES_TRUE@edje_text_DEPENDENCIES = \
139@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
140sigtest_SOURCES = sigtest.c
141sigtest_OBJECTS = sigtest.$(OBJEXT)
142sigtest_LDADD = $(LDADD)
143@BUILD_EXAMPLES_TRUE@sigtest_DEPENDENCIES = \
144@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la
145DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
146depcomp = $(SHELL) $(top_srcdir)/depcomp
147am__depfiles_maybe = depfiles
148am__mv = mv -f
149COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
150 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
151LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
152 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
153 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
154 $(AM_CFLAGS) $(CFLAGS)
155AM_V_CC = $(am__v_CC_$(V))
156am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
157am__v_CC_0 = @echo " CC " $@;
158AM_V_at = $(am__v_at_$(V))
159am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
160am__v_at_0 = @
161CCLD = $(CC)
162LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
163 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
164 $(AM_LDFLAGS) $(LDFLAGS) -o $@
165AM_V_CCLD = $(am__v_CCLD_$(V))
166am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
167am__v_CCLD_0 = @echo " CCLD " $@;
168AM_V_GEN = $(am__v_GEN_$(V))
169am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
170am__v_GEN_0 = @echo " GEN " $@;
171SOURCES = edje-animations.c edje-basic.c edje-box.c edje-box2.c \
172 edje-color-class.c edje-drag.c edje-perspective.c \
173 edje-signals-messages.c edje-swallow.c edje-table.c \
174 edje-text.c sigtest.c
175DIST_SOURCES = edje-animations.c edje-basic.c edje-box.c edje-box2.c \
176 edje-color-class.c edje-drag.c edje-perspective.c \
177 edje-signals-messages.c edje-swallow.c edje-table.c \
178 edje-text.c sigtest.c
179am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
180am__vpath_adj = case $$p in \
181 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
182 *) f=$$p;; \
183 esac;
184am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
185am__install_max = 40
186am__nobase_strip_setup = \
187 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
188am__nobase_strip = \
189 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
190am__nobase_list = $(am__nobase_strip_setup); \
191 for p in $$list; do echo "$$p $$p"; done | \
192 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
193 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
194 if (++n[$$2] == $(am__install_max)) \
195 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
196 END { for (dir in files) print dir, files[dir] }'
197am__base_list = \
198 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
199 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
200DATA = $(files_DATA)
201ETAGS = etags
202CTAGS = ctags
203DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
204pkglibdir = $(datadir)/$(PACKAGE)/examples
205ACLOCAL = @ACLOCAL@
206ALLOCA = @ALLOCA@
207ALSA_CFLAGS = @ALSA_CFLAGS@
208ALSA_LIBS = @ALSA_LIBS@
209AMTAR = @AMTAR@
210AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
211AR = @AR@
212AS = @AS@
213AUTOCONF = @AUTOCONF@
214AUTOHEADER = @AUTOHEADER@
215AUTOMAKE = @AUTOMAKE@
216AWK = @AWK@
217CC = @CC@
218CCDEPMODE = @CCDEPMODE@
219CFLAGS = @CFLAGS@
220CHECK_CFLAGS = @CHECK_CFLAGS@
221CHECK_LIBS = @CHECK_LIBS@
222CPP = @CPP@
223CPPFLAGS = @CPPFLAGS@
224CYGPATH_W = @CYGPATH_W@
225DEFS = @DEFS@
226DEPDIR = @DEPDIR@
227DLLTOOL = @DLLTOOL@
228DSYMUTIL = @DSYMUTIL@
229DUMPBIN = @DUMPBIN@
230ECHO_C = @ECHO_C@
231ECHO_N = @ECHO_N@
232ECHO_T = @ECHO_T@
233ECORE_IMF_CFLAGS = @ECORE_IMF_CFLAGS@
234ECORE_IMF_LIBS = @ECORE_IMF_LIBS@
235EDJE_CC_CFLAGS = @EDJE_CC_CFLAGS@
236EDJE_CC_LIBS = @EDJE_CC_LIBS@
237EDJE_CC_PRG = @EDJE_CC_PRG@
238EDJE_CFLAGS = @EDJE_CFLAGS@
239EDJE_DECC_CFLAGS = @EDJE_DECC_CFLAGS@
240EDJE_DECC_LIBS = @EDJE_DECC_LIBS@
241EDJE_DECC_PRG = @EDJE_DECC_PRG@
242EDJE_EXTERNAL_INSPECTOR_CFLAGS = @EDJE_EXTERNAL_INSPECTOR_CFLAGS@
243EDJE_EXTERNAL_INSPECTOR_LIBS = @EDJE_EXTERNAL_INSPECTOR_LIBS@
244EDJE_EXTERNAL_INSPECTOR_PRG = @EDJE_EXTERNAL_INSPECTOR_PRG@
245EDJE_INSPECTOR_CFLAGS = @EDJE_INSPECTOR_CFLAGS@
246EDJE_INSPECTOR_LIBS = @EDJE_INSPECTOR_LIBS@
247EDJE_INSPECTOR_PRG = @EDJE_INSPECTOR_PRG@
248EDJE_LIBS = @EDJE_LIBS@
249EDJE_PLAYER_CFLAGS = @EDJE_PLAYER_CFLAGS@
250EDJE_PLAYER_LIBS = @EDJE_PLAYER_LIBS@
251EDJE_PLAYER_PRG = @EDJE_PLAYER_PRG@
252EDJE_RECC_PRG = @EDJE_RECC_PRG@
253EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
254EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
255EFL_EDJE_BUILD = @EFL_EDJE_BUILD@
256EGREP = @EGREP@
257EVIL_CFLAGS = @EVIL_CFLAGS@
258EVIL_LIBS = @EVIL_LIBS@
259EXEEXT = @EXEEXT@
260FGREP = @FGREP@
261FLAC_CFLAGS = @FLAC_CFLAGS@
262FLAC_LIBS = @FLAC_LIBS@
263GREP = @GREP@
264INSTALL = @INSTALL@
265INSTALL_DATA = @INSTALL_DATA@
266INSTALL_PROGRAM = @INSTALL_PROGRAM@
267INSTALL_SCRIPT = @INSTALL_SCRIPT@
268INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
269LD = @LD@
270LDFLAGS = @LDFLAGS@
271LIBOBJS = @LIBOBJS@
272LIBS = @LIBS@
273LIBTOOL = @LIBTOOL@
274LIPO = @LIPO@
275LN_S = @LN_S@
276LTLIBOBJS = @LTLIBOBJS@
277LUA_CFLAGS = @LUA_CFLAGS@
278LUA_LIBS = @LUA_LIBS@
279MAKEINFO = @MAKEINFO@
280MINIMAL_CFLAGS = @MINIMAL_CFLAGS@
281MINIMAL_LIBS = @MINIMAL_LIBS@
282MKDIR_P = @MKDIR_P@
283MODULE_ARCH = @MODULE_ARCH@
284NM = @NM@
285NMEDIT = @NMEDIT@
286OBJDUMP = @OBJDUMP@
287OBJEXT = @OBJEXT@
288OTOOL = @OTOOL@
289OTOOL64 = @OTOOL64@
290PACKAGE = @PACKAGE@
291PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
292PACKAGE_NAME = @PACKAGE_NAME@
293PACKAGE_STRING = @PACKAGE_STRING@
294PACKAGE_TARNAME = @PACKAGE_TARNAME@
295PACKAGE_URL = @PACKAGE_URL@
296PACKAGE_VERSION = @PACKAGE_VERSION@
297PATH_SEPARATOR = @PATH_SEPARATOR@
298PKG_CONFIG = @PKG_CONFIG@
299PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
300PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
301PYTHON = @PYTHON@
302PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
303PYTHON_PLATFORM = @PYTHON_PLATFORM@
304PYTHON_PREFIX = @PYTHON_PREFIX@
305PYTHON_VERSION = @PYTHON_VERSION@
306RANLIB = @RANLIB@
307REMIX_CFLAGS = @REMIX_CFLAGS@
308REMIX_LIBS = @REMIX_LIBS@
309REMIX_PLUGIN_DIR = @REMIX_PLUGIN_DIR@
310SED = @SED@
311SET_MAKE = @SET_MAKE@
312SHELL = @SHELL@
313SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
314SNDFILE_LIBS = @SNDFILE_LIBS@
315STRIP = @STRIP@
316VERSION = @VERSION@
317VMAJ = @VMAJ@
318VORBISENC_CFLAGS = @VORBISENC_CFLAGS@
319VORBISENC_LIBS = @VORBISENC_LIBS@
320abs_builddir = @abs_builddir@
321abs_srcdir = @abs_srcdir@
322abs_top_builddir = @abs_top_builddir@
323abs_top_srcdir = @abs_top_srcdir@
324ac_ct_CC = @ac_ct_CC@
325ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
326am__include = @am__include@
327am__leading_dot = @am__leading_dot@
328am__quote = @am__quote@
329am__tar = @am__tar@
330am__untar = @am__untar@
331bindir = @bindir@
332build = @build@
333build_alias = @build_alias@
334build_cpu = @build_cpu@
335build_os = @build_os@
336build_vendor = @build_vendor@
337builddir = @builddir@
338datadir = @datadir@
339datarootdir = @datarootdir@
340docdir = @docdir@
341dvidir = @dvidir@
342edje_cc = @edje_cc@
343efl_doxygen = @efl_doxygen@
344efl_have_doxygen = @efl_have_doxygen@
345exec_prefix = @exec_prefix@
346have_lcov = @have_lcov@
347host = @host@
348host_alias = @host_alias@
349host_cpu = @host_cpu@
350host_os = @host_os@
351host_vendor = @host_vendor@
352htmldir = @htmldir@
353includedir = @includedir@
354infodir = @infodir@
355install_sh = @install_sh@
356libdir = @libdir@
357libexecdir = @libexecdir@
358localedir = @localedir@
359localstatedir = @localstatedir@
360lt_ECHO = @lt_ECHO@
361lt_enable_auto_import = @lt_enable_auto_import@
362lua_libs = @lua_libs@
363mandir = @mandir@
364mkdir_p = @mkdir_p@
365oldincludedir = @oldincludedir@
366pdfdir = @pdfdir@
367pkgconfig_requires_private = @pkgconfig_requires_private@
368pkgpyexecdir = @pkgpyexecdir@
369pkgpythondir = @pkgpythondir@
370prefix = @prefix@
371program_transform_name = @program_transform_name@
372psdir = @psdir@
373pyexecdir = @pyexecdir@
374pythondir = @pythondir@
375release_info = @release_info@
376requirement_edje = @requirement_edje@
377sbindir = @sbindir@
378sharedstatedir = @sharedstatedir@
379srcdir = @srcdir@
380sysconfdir = @sysconfdir@
381target_alias = @target_alias@
382top_build_prefix = @top_build_prefix@
383top_builddir = @top_builddir@
384top_srcdir = @top_srcdir@
385version_info = @version_info@
386vimdir = @vimdir@
387MAINTAINERCLEANFILES = Makefile.in
388@ENABLE_MULTISENSE_TRUE@MULTISENSE_EDC_FILE = multisense.edc
389@ENABLE_MULTISENSE_TRUE@SND_DIR = -sd $(srcdir)
390#put here all EDCs one needs to the examples
391EDCS = basic.edc \
392 swallow.edc \
393 text.edc \
394 table.edc \
395 box.edc \
396 drag.edc \
397 signals-messages.edc \
398 color-class.edc \
399 perspective.edc \
400 animations.edc \
401 lua_script.edc \
402 sigtest.edc \
403 $(MULTISENSE_EDC_FILE)
404
405filesdir = $(datadir)/$(PACKAGE)/examples
406files_DATA = $(am__append_1) $(am__append_2)
407
408#the ones using ecore_evas follow
409@BUILD_EXAMPLES_TRUE@AM_CPPFLAGS = -I. -I$(top_srcdir)/src/lib \
410@BUILD_EXAMPLES_TRUE@ -I$(top_srcdir)/src/lib/include \
411@BUILD_EXAMPLES_TRUE@ -DPACKAGE_BIN_DIR=\"$(bindir)\" \
412@BUILD_EXAMPLES_TRUE@ -DPACKAGE_LIB_DIR=\"$(libdir)\" \
413@BUILD_EXAMPLES_TRUE@ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
414@BUILD_EXAMPLES_TRUE@ -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \
415@BUILD_EXAMPLES_TRUE@ @EDJE_CFLAGS@ $(am__empty)
416@BUILD_EXAMPLES_TRUE@LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@
417@BUILD_EXAMPLES_TRUE@EDJS = $(EDCS:%.edc=%.edj)
418EXTRA_DIST = $(EDCS) \
419 $(srcdir)/bubble.png \
420 $(srcdir)/red.png \
421 $(srcdir)/test.png \
422 $(srcdir)/edje-basic.c \
423 $(srcdir)/edje-swallow.c \
424 $(srcdir)/edje-text.c \
425 $(srcdir)/edje-table.c \
426 $(srcdir)/edje-box.c \
427 $(srcdir)/edje-box2.c \
428 $(srcdir)/edje-drag.c \
429 $(srcdir)/edje-signals-messages.c \
430 $(srcdir)/edje-color-class.c \
431 $(srcdir)/edje-perspective.c \
432 $(srcdir)/edje-animations.c \
433 $(srcdir)/sigtest.c
434
435all: all-am
436
437.SUFFIXES:
438.SUFFIXES: .c .edc .edj .lo .o .obj
439$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
440 @for dep in $?; do \
441 case '$(am__configure_deps)' in \
442 *$$dep*) \
443 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
444 && { if test -f $@; then exit 0; else break; fi; }; \
445 exit 1;; \
446 esac; \
447 done; \
448 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/examples/Makefile'; \
449 $(am__cd) $(top_srcdir) && \
450 $(AUTOMAKE) --gnu src/examples/Makefile
451.PRECIOUS: Makefile
452Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
453 @case '$?' in \
454 *config.status*) \
455 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
456 *) \
457 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
458 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
459 esac;
460
461$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
462 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
463
464$(top_srcdir)/configure: $(am__configure_deps)
465 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
466$(ACLOCAL_M4): $(am__aclocal_m4_deps)
467 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
468$(am__aclocal_m4_deps):
469install-pkglibPROGRAMS: $(pkglib_PROGRAMS)
470 @$(NORMAL_INSTALL)
471 test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
472 @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \
473 for p in $$list; do echo "$$p $$p"; done | \
474 sed 's/$(EXEEXT)$$//' | \
475 while read p p1; do if test -f $$p || test -f $$p1; \
476 then echo "$$p"; echo "$$p"; else :; fi; \
477 done | \
478 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
479 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
480 sed 'N;N;N;s,\n, ,g' | \
481 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
482 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
483 if ($$2 == $$4) files[d] = files[d] " " $$1; \
484 else { print "f", $$3 "/" $$4, $$1; } } \
485 END { for (d in files) print "f", d, files[d] }' | \
486 while read type dir files; do \
487 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
488 test -z "$$files" || { \
489 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibdir)$$dir'"; \
490 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibdir)$$dir" || exit $$?; \
491 } \
492 ; done
493
494uninstall-pkglibPROGRAMS:
495 @$(NORMAL_UNINSTALL)
496 @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \
497 files=`for p in $$list; do echo "$$p"; done | \
498 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
499 -e 's/$$/$(EXEEXT)/' `; \
500 test -n "$$list" || exit 0; \
501 echo " ( cd '$(DESTDIR)$(pkglibdir)' && rm -f" $$files ")"; \
502 cd "$(DESTDIR)$(pkglibdir)" && rm -f $$files
503
504clean-pkglibPROGRAMS:
505 @list='$(pkglib_PROGRAMS)'; test -n "$$list" || exit 0; \
506 echo " rm -f" $$list; \
507 rm -f $$list || exit $$?; \
508 test -n "$(EXEEXT)" || exit 0; \
509 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
510 echo " rm -f" $$list; \
511 rm -f $$list
512edje-animations$(EXEEXT): $(edje_animations_OBJECTS) $(edje_animations_DEPENDENCIES)
513 @rm -f edje-animations$(EXEEXT)
514 $(AM_V_CCLD)$(LINK) $(edje_animations_OBJECTS) $(edje_animations_LDADD) $(LIBS)
515edje-basic$(EXEEXT): $(edje_basic_OBJECTS) $(edje_basic_DEPENDENCIES)
516 @rm -f edje-basic$(EXEEXT)
517 $(AM_V_CCLD)$(LINK) $(edje_basic_OBJECTS) $(edje_basic_LDADD) $(LIBS)
518edje-box$(EXEEXT): $(edje_box_OBJECTS) $(edje_box_DEPENDENCIES)
519 @rm -f edje-box$(EXEEXT)
520 $(AM_V_CCLD)$(LINK) $(edje_box_OBJECTS) $(edje_box_LDADD) $(LIBS)
521edje-box2$(EXEEXT): $(edje_box2_OBJECTS) $(edje_box2_DEPENDENCIES)
522 @rm -f edje-box2$(EXEEXT)
523 $(AM_V_CCLD)$(LINK) $(edje_box2_OBJECTS) $(edje_box2_LDADD) $(LIBS)
524edje-color-class$(EXEEXT): $(edje_color_class_OBJECTS) $(edje_color_class_DEPENDENCIES)
525 @rm -f edje-color-class$(EXEEXT)
526 $(AM_V_CCLD)$(LINK) $(edje_color_class_OBJECTS) $(edje_color_class_LDADD) $(LIBS)
527edje-drag$(EXEEXT): $(edje_drag_OBJECTS) $(edje_drag_DEPENDENCIES)
528 @rm -f edje-drag$(EXEEXT)
529 $(AM_V_CCLD)$(LINK) $(edje_drag_OBJECTS) $(edje_drag_LDADD) $(LIBS)
530edje-perspective$(EXEEXT): $(edje_perspective_OBJECTS) $(edje_perspective_DEPENDENCIES)
531 @rm -f edje-perspective$(EXEEXT)
532 $(AM_V_CCLD)$(LINK) $(edje_perspective_OBJECTS) $(edje_perspective_LDADD) $(LIBS)
533edje-signals-messages$(EXEEXT): $(edje_signals_messages_OBJECTS) $(edje_signals_messages_DEPENDENCIES)
534 @rm -f edje-signals-messages$(EXEEXT)
535 $(AM_V_CCLD)$(LINK) $(edje_signals_messages_OBJECTS) $(edje_signals_messages_LDADD) $(LIBS)
536edje-swallow$(EXEEXT): $(edje_swallow_OBJECTS) $(edje_swallow_DEPENDENCIES)
537 @rm -f edje-swallow$(EXEEXT)
538 $(AM_V_CCLD)$(LINK) $(edje_swallow_OBJECTS) $(edje_swallow_LDADD) $(LIBS)
539edje-table$(EXEEXT): $(edje_table_OBJECTS) $(edje_table_DEPENDENCIES)
540 @rm -f edje-table$(EXEEXT)
541 $(AM_V_CCLD)$(LINK) $(edje_table_OBJECTS) $(edje_table_LDADD) $(LIBS)
542edje-text$(EXEEXT): $(edje_text_OBJECTS) $(edje_text_DEPENDENCIES)
543 @rm -f edje-text$(EXEEXT)
544 $(AM_V_CCLD)$(LINK) $(edje_text_OBJECTS) $(edje_text_LDADD) $(LIBS)
545sigtest$(EXEEXT): $(sigtest_OBJECTS) $(sigtest_DEPENDENCIES)
546 @rm -f sigtest$(EXEEXT)
547 $(AM_V_CCLD)$(LINK) $(sigtest_OBJECTS) $(sigtest_LDADD) $(LIBS)
548
549mostlyclean-compile:
550 -rm -f *.$(OBJEXT)
551
552distclean-compile:
553 -rm -f *.tab.c
554
555@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-animations.Po@am__quote@
556@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-basic.Po@am__quote@
557@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-box.Po@am__quote@
558@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-box2.Po@am__quote@
559@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-color-class.Po@am__quote@
560@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-drag.Po@am__quote@
561@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-perspective.Po@am__quote@
562@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-signals-messages.Po@am__quote@
563@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-swallow.Po@am__quote@
564@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-table.Po@am__quote@
565@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-text.Po@am__quote@
566@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigtest.Po@am__quote@
567
568.c.o:
569@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
570@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
571@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
572@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
573@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
574@am__fastdepCC_FALSE@ $(COMPILE) -c $<
575
576.c.obj:
577@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
578@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
579@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
580@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
581@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
582@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
583
584.c.lo:
585@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
586@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
587@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
588@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
589@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
590@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
591
592mostlyclean-libtool:
593 -rm -f *.lo
594
595clean-libtool:
596 -rm -rf .libs _libs
597install-filesDATA: $(files_DATA)
598 @$(NORMAL_INSTALL)
599 test -z "$(filesdir)" || $(MKDIR_P) "$(DESTDIR)$(filesdir)"
600 @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \
601 for p in $$list; do \
602 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
603 echo "$$d$$p"; \
604 done | $(am__base_list) | \
605 while read files; do \
606 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filesdir)'"; \
607 $(INSTALL_DATA) $$files "$(DESTDIR)$(filesdir)" || exit $$?; \
608 done
609
610uninstall-filesDATA:
611 @$(NORMAL_UNINSTALL)
612 @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \
613 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
614 test -n "$$files" || exit 0; \
615 echo " ( cd '$(DESTDIR)$(filesdir)' && rm -f" $$files ")"; \
616 cd "$(DESTDIR)$(filesdir)" && rm -f $$files
617
618ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
619 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
620 unique=`for i in $$list; do \
621 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
622 done | \
623 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
624 END { if (nonempty) { for (i in files) print i; }; }'`; \
625 mkid -fID $$unique
626tags: TAGS
627
628TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
629 $(TAGS_FILES) $(LISP)
630 set x; \
631 here=`pwd`; \
632 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
633 unique=`for i in $$list; do \
634 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
635 done | \
636 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
637 END { if (nonempty) { for (i in files) print i; }; }'`; \
638 shift; \
639 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
640 test -n "$$unique" || unique=$$empty_fix; \
641 if test $$# -gt 0; then \
642 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
643 "$$@" $$unique; \
644 else \
645 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
646 $$unique; \
647 fi; \
648 fi
649ctags: CTAGS
650CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
651 $(TAGS_FILES) $(LISP)
652 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
653 unique=`for i in $$list; do \
654 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
655 done | \
656 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
657 END { if (nonempty) { for (i in files) print i; }; }'`; \
658 test -z "$(CTAGS_ARGS)$$unique" \
659 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
660 $$unique
661
662GTAGS:
663 here=`$(am__cd) $(top_builddir) && pwd` \
664 && $(am__cd) $(top_srcdir) \
665 && gtags -i $(GTAGS_ARGS) "$$here"
666
667distclean-tags:
668 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
669
670distdir: $(DISTFILES)
671 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
672 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
673 list='$(DISTFILES)'; \
674 dist_files=`for file in $$list; do echo $$file; done | \
675 sed -e "s|^$$srcdirstrip/||;t" \
676 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
677 case $$dist_files in \
678 */*) $(MKDIR_P) `echo "$$dist_files" | \
679 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
680 sort -u` ;; \
681 esac; \
682 for file in $$dist_files; do \
683 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
684 if test -d $$d/$$file; then \
685 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
686 if test -d "$(distdir)/$$file"; then \
687 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
688 fi; \
689 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
690 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
691 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
692 fi; \
693 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
694 else \
695 test -f "$(distdir)/$$file" \
696 || cp -p $$d/$$file "$(distdir)/$$file" \
697 || exit 1; \
698 fi; \
699 done
700check-am: all-am
701check: check-am
702all-am: Makefile $(PROGRAMS) $(DATA)
703installdirs:
704 for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)"; do \
705 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
706 done
707install: install-am
708install-exec: install-exec-am
709install-data: install-data-am
710uninstall: uninstall-am
711
712install-am: all-am
713 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
714
715installcheck: installcheck-am
716install-strip:
717 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
718 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
719 `test -z '$(STRIP)' || \
720 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
721mostlyclean-generic:
722
723clean-generic:
724
725distclean-generic:
726 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
727 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
728
729maintainer-clean-generic:
730 @echo "This command is intended for maintainers to use"
731 @echo "it deletes files that may require special tools to rebuild."
732 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
733clean: clean-am
734
735clean-am: clean-generic clean-libtool clean-pkglibPROGRAMS \
736 mostlyclean-am
737
738distclean: distclean-am
739 -rm -rf ./$(DEPDIR)
740 -rm -f Makefile
741distclean-am: clean-am distclean-compile distclean-generic \
742 distclean-tags
743
744dvi: dvi-am
745
746dvi-am:
747
748html: html-am
749
750html-am:
751
752info: info-am
753
754info-am:
755
756install-data-am: install-filesDATA
757
758install-dvi: install-dvi-am
759
760install-dvi-am:
761
762install-exec-am: install-pkglibPROGRAMS
763
764install-html: install-html-am
765
766install-html-am:
767
768install-info: install-info-am
769
770install-info-am:
771
772install-man:
773
774install-pdf: install-pdf-am
775
776install-pdf-am:
777
778install-ps: install-ps-am
779
780install-ps-am:
781
782installcheck-am:
783
784maintainer-clean: maintainer-clean-am
785 -rm -rf ./$(DEPDIR)
786 -rm -f Makefile
787maintainer-clean-am: distclean-am maintainer-clean-generic
788
789mostlyclean: mostlyclean-am
790
791mostlyclean-am: mostlyclean-compile mostlyclean-generic \
792 mostlyclean-libtool
793
794pdf: pdf-am
795
796pdf-am:
797
798ps: ps-am
799
800ps-am:
801
802uninstall-am: uninstall-filesDATA uninstall-pkglibPROGRAMS
803
804.MAKE: install-am install-strip
805
806.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
807 clean-libtool clean-pkglibPROGRAMS ctags distclean \
808 distclean-compile distclean-generic distclean-libtool \
809 distclean-tags distdir dvi dvi-am html html-am info info-am \
810 install install-am install-data install-data-am install-dvi \
811 install-dvi-am install-exec install-exec-am install-filesDATA \
812 install-html install-html-am install-info install-info-am \
813 install-man install-pdf install-pdf-am install-pkglibPROGRAMS \
814 install-ps install-ps-am install-strip installcheck \
815 installcheck-am installdirs maintainer-clean \
816 maintainer-clean-generic mostlyclean mostlyclean-compile \
817 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
818 tags uninstall uninstall-am uninstall-filesDATA \
819 uninstall-pkglibPROGRAMS
820
821
822@BUILD_EXAMPLES_TRUE@.edc.edj:
823@BUILD_EXAMPLES_TRUE@ $(edje_cc) -v -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F)
824
825# Tell versions [3.59,3.63) of GNU make to not export all variables.
826# Otherwise a system limit (for SysV at least) may be exceeded.
827.NOEXPORT:
diff --git a/libraries/edje/src/examples/animations.edc b/libraries/edje/src/examples/animations.edc
new file mode 100644
index 0000000..f25296f
--- /dev/null
+++ b/libraries/edje/src/examples/animations.edc
@@ -0,0 +1,93 @@
1collections {
2 group {
3 name: "animations_group";
4 min: 100 80;
5
6 parts {
7 part {
8 name: "part_one";
9 type: RECT;
10 scale: 1;
11 description {
12 min: 50 50;
13 state: "default" 0.0;
14 color: 0 0 0 255; /* black */
15 rel1.relative: 0.0 0.0;
16 rel2.relative: 0.33 1.0;
17 }
18 description {
19 state: "invert" 1.0;
20 inherit: "default" 0.0;
21 rel1.relative: 0.0 0.0;
22 rel2.relative: 1.0 0.33;
23 }
24 }
25
26 part {
27 name: "part_two";
28 type: RECT;
29 scale: 1;
30 description {
31 min: 50 50;
32 state: "default" 0.0;
33 color: 255 255 0 255; /* yellow */
34 rel1.relative: 0.33 0.0;
35 rel2.relative: 0.66 1.0;
36 }
37 description {
38 state: "invert" 1.0;
39 inherit: "default" 0.0;
40 rel1.relative: 0.0 0.66;
41 rel2.relative: 1.0 1.0;
42 }
43 }
44
45 part {
46 name: "part_three";
47 type: RECT;
48 description {
49 state: "default" 0.0;
50 color: 255 0 0 255; /* red */
51 rel1.relative: 0.66 0.0;
52 rel2.relative: 1.0 1.0;
53 }
54 description {
55 state: "invert" 1.0;
56 inherit: "default" 0.0;
57 rel1.relative: 0.0 0.33;
58 rel2.relative: 1.0 0.66;
59 }
60 }
61 }
62
63 program {
64 signal: "load";
65 source: "";
66 in: 2.0 0.0;
67 after: "animation,state1";
68 }
69 program {
70 name: "animation,state1";
71 signal: "animation,start";
72 source: "";
73 in: 1.0 0.0;
74 action: STATE_SET "invert" 1.0;
75 target: "part_one";
76 target: "part_two";
77 target: "part_three";
78 transition: LINEAR 0.6;
79 after: "animation,state2";
80 }
81 program {
82 name: "animation,state2";
83 signal: "animation,start";
84 source: "";
85 in: 1.0 0.0;
86 action: STATE_SET "default" 0.0;
87 target: "part_one";
88 target: "part_two";
89 target: "part_three";
90 transition: LINEAR 0.6;
91 after: "animation,state1";
92 }
93}
diff --git a/libraries/edje/src/examples/basic.edc b/libraries/edje/src/examples/basic.edc
new file mode 100644
index 0000000..a708b50
--- /dev/null
+++ b/libraries/edje/src/examples/basic.edc
@@ -0,0 +1,39 @@
1collections {
2 group {
3 name: "example_group";
4 max: 500 500;
5 min: 50 50;
6
7 data {
8 item: "example_data" "a string";
9 }
10
11 parts {
12 part {
13 name: "part_one";
14 type: RECT;
15 scale: 1;
16 description {
17 min: 50 50;
18 max: 50 50;
19 state: "default" 0.0;
20 color: 0 0 255 255; /* blue */
21 rel1.relative: 0.0 0.0;
22 rel2.relative: 1.0 1.0;
23 }
24 }
25
26 part {
27 name: "part_two";
28 type: RECT;
29 description {
30 state: "default" 0.0;
31 color: 0 255 0 255; /* green */
32 rel1.relative: -1.0 -1.0;
33 rel2.relative: 0.0 0.0;
34 }
35 }
36 }
37
38 }
39}
diff --git a/libraries/edje/src/examples/box.edc b/libraries/edje/src/examples/box.edc
new file mode 100644
index 0000000..79d04a8
--- /dev/null
+++ b/libraries/edje/src/examples/box.edc
@@ -0,0 +1,142 @@
1collections {
2
3 group {
4 name: "example/group";
5
6 parts {
7 part {
8 name: "bg";
9 type: RECT;
10
11 description {
12 state: "default" 0.0;
13 color: 128 128 128 255;
14 rel1.offset: 20 20;
15 rel2.offset: -21 -21;
16 }
17 }
18
19 part {
20 name: "example/title";
21 type: TEXT;
22
23 description {
24 state: "default" 0.0;
25 color: 0 0 0 255;
26 rel1 {
27 relative: 0.0 0.0;
28 offset: 0 0;
29 to: "bg";
30 }
31 rel2 {
32 relative: 1.0 0.2;
33 offset: -1 -1;
34 to: "bg";
35 }
36 text {
37 text: "Box Example";
38 size: 16;
39 font: "sans";
40 min: 1 1;
41 }
42 }
43 }
44
45 part {
46 name: "example/box";
47 type: BOX;
48
49 description {
50 state: "default" 0.0;
51
52 box {
53 layout: "horizontal_flow";
54 padding: 2 2;
55 align: 0.5 0.5;
56 min: 1 1;
57 }
58 rel1 {
59 relative: 0.0 0.2;
60 offset: 0 0;
61 to: "bg";
62 }
63 rel2 {
64 relative: 1.0 1.0;
65 offset: -1 -61;
66 to: "bg";
67 }
68 }
69 } // example/box
70 }
71 }
72
73 group {
74 name: "example/group2";
75
76 parts {
77 part {
78 name: "bg";
79 type: RECT;
80
81 description {
82 state: "default" 0.0;
83 color: 128 128 128 255;
84 rel1.offset: 20 20;
85 rel2.offset: -21 -21;
86 }
87 }
88
89 part {
90 name: "example/title";
91 type: TEXT;
92
93 description {
94 state: "default" 0.0;
95 color: 0 0 0 255;
96 rel1 {
97 relative: 0.0 0.0;
98 offset: 0 0;
99 to: "bg";
100 }
101 rel2 {
102 relative: 1.0 0.2;
103 offset: -1 -1;
104 to: "bg";
105 }
106 text {
107 text: "Box Example 2";
108 size: 16;
109 font: "sans";
110 min: 1 1;
111 }
112 }
113 }
114
115 part {
116 name: "example/box";
117 type: BOX;
118
119 description {
120 state: "default" 0.0;
121
122 box {
123 layout: "custom_layout";
124 padding: 2 2;
125 align: 0.5 0.5;
126 min: 1 1;
127 }
128 rel1 {
129 relative: 0.0 0.2;
130 offset: 0 0;
131 to: "bg";
132 }
133 rel2 {
134 relative: 1.0 1.0;
135 offset: -1 -61;
136 to: "bg";
137 }
138 }
139 } // example/box
140 }
141 }
142}
diff --git a/libraries/edje/src/examples/bubble.png b/libraries/edje/src/examples/bubble.png
new file mode 100644
index 0000000..8fc50f9
--- /dev/null
+++ b/libraries/edje/src/examples/bubble.png
Binary files differ
diff --git a/libraries/edje/src/examples/color-class.edc b/libraries/edje/src/examples/color-class.edc
new file mode 100644
index 0000000..c025455
--- /dev/null
+++ b/libraries/edje/src/examples/color-class.edc
@@ -0,0 +1,87 @@
1color_classes {
2 color_class {
3 name: "red_class";
4 color: 255 0 0 255; /* red */
5 color2: 255 0 0 255; /* red */
6 color3: 255 0 0 255; /* red */
7 }
8 color_class {
9 name: "green_class";
10 color: 0 255 0 255; /* green */
11 color2: 0 255 0 255; /* green */
12 color3: 0 255 0 255; /* green */
13 }
14 color_class {
15 name: "blue_class";
16 color: 0 0 255 255; /* blue */
17 color2: 0 0 255 255; /* blue */
18 color3: 0 0 255 255; /* blue */
19 }
20}
21
22collections {
23 group {
24 name: "example_color_class";
25 max: 500 500;
26 min: 50 50;
27
28 parts {
29 part {
30 name: "part_one";
31 type: RECT;
32 scale: 1;
33 description {
34 state: "default" 0.0;
35 color: 255 255 255 255;
36 color_class: "blue_class";
37 rel1.relative: 0.0 0.0;
38 rel2.relative: 0.5 0.5;
39 }
40 }
41
42 part {
43 name: "part_two";
44 type: RECT;
45 description {
46 state: "default" 0.0;
47 color: 255 255 255 255;
48 color_class: "green_class";
49 rel1.relative: 0.5 0.0;
50 rel2.relative: 1.0 0.5;
51 }
52 }
53 part {
54 name: "part_three";
55 type: RECT;
56 description {
57 state: "default" 0.0;
58 color: 255 255 255 255;
59 color_class: "red_class";
60 rel1.relative: 0.0 0.5;
61 rel2.relative: 1.0 1.0;
62 }
63 }
64 part {
65 name: "part_four";
66 type: TEXT;
67 effect: OUTLINE_SHADOW;
68 description {
69 state: "default" 0.0;
70 min: 50 50;
71 color: 255 255 255 255;
72 color2: 255 255 255 255;
73 color3: 255 255 255 255;
74 color_class: "blue_class";
75 rel1.relative: 0.0 0.5;
76 rel2.relative: 1.0 1.0;
77 text {
78 text_class: "example";
79 font: "arial";
80 size: 45;
81 min: 1 1;
82 }
83 }
84 }
85 }
86 }
87}
diff --git a/libraries/edje/src/examples/drag.edc b/libraries/edje/src/examples/drag.edc
new file mode 100644
index 0000000..b9247ec
--- /dev/null
+++ b/libraries/edje/src/examples/drag.edc
@@ -0,0 +1,89 @@
1collections {
2 group {
3 name: "example/group";
4
5 min: 160 160;
6
7 parts {
8 part {
9 name: "bg";
10 type: RECT;
11
12 mouse_events: 0;
13
14 description {
15 state: "default" 0.0;
16 }
17 } // bg
18
19 part {
20 name: "title";
21 type: TEXT;
22 mouse_events: 0;
23
24 description {
25 state: "default" 0.0;
26 color: 0 0 0 255;
27 rel1 {
28 relative: 0.0 0.0;
29 offset: 0 0;
30 to: "bg";
31 }
32 rel2 {
33 relative: 1.0 0.2;
34 offset: -1 -1;
35 to: "bg";
36 }
37 text {
38 text: "Drag Example";
39 size: 16;
40 font: "sans";
41 min: 1 1;
42 }
43 }
44 }
45
46 part {
47 name: "drag_area";
48 type: RECT;
49
50 mouse_events: 0;
51
52 description {
53 state: "default" 0.0;
54 color: 0 0 0 255;
55 rel1 {
56 relative: 0.5 0.3;
57 offset: -5 0;
58 }
59
60 rel2 {
61 relative: 0.5 0.9;
62 offset: 4 0;
63 }
64 }
65 } // drag_area
66
67 part {
68 name: "example/knob";
69 type: RECT;
70
71 mouse_events: 1;
72
73 dragable {
74 confine: "drag_area";
75 x: 0 0 0;
76 y: 1 1 0;
77 }
78
79 description {
80 state: "default" 0.0;
81
82 color: 255 0 0 200;
83
84 }
85 } // example/knob
86
87 }
88 }
89}
diff --git a/libraries/edje/src/examples/edje-animations.c b/libraries/edje/src/examples/edje-animations.c
new file mode 100644
index 0000000..9363471
--- /dev/null
+++ b/libraries/edje/src/examples/edje-animations.c
@@ -0,0 +1,156 @@
1/**
2 * Simple Edje example illustrating animations functions.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc animations.edc && gcc -o edje-animations edje-animations.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22
23#define WIDTH (400)
24#define HEIGHT (300)
25
26static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/animations.edj";
27static Ecore_Evas *ee;
28static Evas_Object *bg, *edje_obj;
29static double frametime = 1.0/30.0; /* default value */
30
31static void
32_on_delete_cb(Ecore_Evas *ee)
33{
34 ecore_main_loop_quit();
35}
36
37static void
38_canvas_resize_cb(Ecore_Evas *ee)
39{
40 int w, h;
41
42 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
43 evas_object_resize(bg, w, h);
44 evas_object_resize(edje_obj, w, h);
45}
46
47static void
48_on_key_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
49{
50 Evas_Event_Key_Down *ev = event_info;
51 double ft;
52
53 if (!strcmp(ev->key, "plus"))
54 {
55 frametime *= 2.0;
56 fprintf(stdout, "Increasing frametime to: %f\n", frametime);
57 edje_frametime_set(frametime);
58 }
59 else if (!strcmp(ev->key, "minus"))
60 {
61 frametime /= 2.0;
62 fprintf(stdout, "Decreasing frametime to: %f\n", frametime);
63 edje_frametime_set(frametime);
64 }
65 else if (!strcmp(ev->key, "equal"))
66 {
67 ft = edje_frametime_get();
68 fprintf(stdout, "Frametime: %f\n", ft);
69 if (edje_object_play_get(obj))
70 fprintf(stdout, "Object is playing\n");
71 else
72 fprintf(stdout, "Object was paused\n");
73 if (edje_object_animation_get(obj))
74 fprintf(stdout, "Animation is running\n");
75 else
76 fprintf(stdout, "Animation was stopped\n");
77 }
78 else if (!strcmp(ev->key, "s"))
79 {
80 edje_object_play_set(obj, EINA_FALSE);
81 fprintf(stdout, "Pausing the object\n");
82 }
83 else if (!strcmp(ev->key, "p"))
84 {
85 edje_object_play_set(obj, EINA_TRUE);
86 fprintf(stdout, "Playing the object\n");
87 }
88 else if (!strcmp(ev->key, "f"))
89 fprintf(stdout, "Freezing object. Count: %d\n", edje_object_freeze(obj));
90 else if (!strcmp(ev->key, "t"))
91 fprintf(stdout, "Thawing object. Count: %d\n", edje_object_thaw(obj));
92 else if (!strcmp(ev->key, "F"))
93 {
94 edje_freeze();
95 fprintf(stdout, "Freezing all objects\n");
96 }
97 else if (!strcmp(ev->key, "T"))
98 {
99 edje_thaw();
100 fprintf(stdout, "Thawing all objects\n");
101 }
102 else if (!strcmp(ev->key, "a"))
103 {
104 edje_object_animation_set(obj, EINA_TRUE);
105 fprintf(stdout, "Starting the animation in the Edje object\n");
106 }
107 else if (!strcmp(ev->key, "A"))
108 {
109 edje_object_animation_set(obj, EINA_FALSE);
110 fprintf(stdout, "Stopping the animation in the Edje object\n");
111 }
112}
113
114int
115main(int argc, char *argv[])
116{
117 Evas *evas;
118
119 ecore_evas_init();
120 edje_init();
121
122 /* this will give you a window with an Evas canvas under the first
123 * engine available */
124 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
125
126 ecore_evas_callback_delete_request_set(ee, _on_delete_cb);
127 ecore_evas_callback_resize_set(ee, _canvas_resize_cb);
128 ecore_evas_title_set(ee, "Edje Animations Example");
129 ecore_evas_show(ee);
130
131 evas = ecore_evas_get(ee);
132
133 bg = evas_object_rectangle_add(evas);
134 evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
135 evas_object_move(bg, 0, 0); /* at canvas' origin */
136 evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
137 evas_object_show(bg);
138
139 edje_obj = edje_object_add(evas);
140
141 edje_object_file_set(edje_obj, edje_file_path, "animations_group");
142 evas_object_move(edje_obj, 0, 0);
143 evas_object_resize(edje_obj, WIDTH, HEIGHT);
144 evas_object_show(edje_obj);
145
146 evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_KEY_DOWN,
147 _on_key_down_cb, NULL);
148 evas_object_focus_set(edje_obj, EINA_TRUE);
149
150 ecore_main_loop_begin();
151
152 ecore_evas_free(ee);
153 ecore_evas_shutdown();
154 edje_shutdown();
155 return 0;
156}
diff --git a/libraries/edje/src/examples/edje-basic.c b/libraries/edje/src/examples/edje-basic.c
new file mode 100644
index 0000000..2a7a862
--- /dev/null
+++ b/libraries/edje/src/examples/edje-basic.c
@@ -0,0 +1,226 @@
1/**
2 * Simple Edje example illustrating the very basic functions of the
3 * library
4 *
5 * You'll need at least one Evas engine built for it (excluding the
6 * buffer one). See stdout/stderr for output.
7 *
8 * @verbatim
9 * gcc -o edje-basic edje-basic.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
10 * @endverbatim
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#else
16#define PACKAGE_EXAMPLES_DIR "."
17#define __UNUSED__
18#endif
19
20#include <Ecore.h>
21#include <Ecore_Evas.h>
22#include <Edje.h>
23#include <stdio.h>
24
25#define WIDTH (300)
26#define HEIGHT (300)
27
28static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png";
29static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/basic.edj";
30
31static Ecore_Evas *ee;
32static Evas_Object *edje_obj;
33
34static const char commands[] = \
35 "commands are:\n"
36 "\ts - change Edje's global scaling factor\n"
37 "\tr - change center rectangle's scaling factor\n"
38 "\th - print help\n";
39
40static void
41_on_keydown(void *data __UNUSED__,
42 Evas *evas __UNUSED__,
43 Evas_Object *o __UNUSED__,
44 void *einfo)
45{
46 Evas_Event_Key_Down *ev = einfo;
47
48 if (strcmp(ev->keyname, "h") == 0) /* print help */
49 {
50 fprintf(stdout, commands);
51 return;
52 }
53
54 if (strcmp(ev->keyname, "s") == 0) /* global scaling factor */
55 {
56 double scale = edje_scale_get();
57
58 printf("got scale %f\n", scale);
59
60 if (scale != 1.0) scale = 1.0;
61 else scale = 2.0;
62
63 edje_scale_set(scale);
64
65 fprintf(stdout, "Setting global scaling factor to %f.\n", scale);
66
67 return;
68 }
69
70 if (strcmp(ev->keyname, "r") == 0) /* individual scaling factor */
71 {
72 double scale = edje_object_scale_get(edje_obj);
73
74 printf("got scale %f\n", scale);
75
76 if (!scale) scale = 1.0;
77 else if (scale == 1.0) scale = 2.0;
78 else scale = 0.0;
79
80 edje_object_scale_set(edje_obj, scale);
81
82 fprintf(stdout, "Setting center rectangle's scaling factor to %f.\n",
83 scale);
84
85 return;
86 }
87}
88
89static void
90_on_delete(Ecore_Evas *ee __UNUSED__)
91{
92 ecore_main_loop_quit();
93}
94
95int
96main(void)
97{
98 Evas_Object *border, *bg;
99 int x, y, w, h;
100 Evas *evas;
101
102 if (!ecore_evas_init())
103 return EXIT_FAILURE;
104
105 if (!edje_init())
106 return EXIT_FAILURE;
107
108 /* this will give you a window with an Evas canvas under the first
109 * engine available */
110 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
111 if (!ee)
112 goto error;
113
114 ecore_evas_callback_delete_request_set(ee, _on_delete);
115 ecore_evas_title_set(ee, "Edje Basics Example");
116 ecore_evas_show(ee);
117
118 evas = ecore_evas_get(ee);
119
120 bg = evas_object_rectangle_add(evas);
121 evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
122 evas_object_move(bg, 0, 0); /* at canvas' origin */
123 evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
124 evas_object_show(bg);
125 ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
126
127 evas_object_focus_set(bg, EINA_TRUE);
128 evas_object_event_callback_add(
129 bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
130
131 edje_obj = edje_object_add(evas);
132
133 /* exercising Edje loading error, on purpose */
134 if (!edje_object_file_set(edje_obj, edje_file_path, "unexistant_group"))
135 {
136 int err = edje_object_load_error_get(edje_obj);
137 const char *errmsg = edje_load_error_str(err);
138 fprintf(stderr, "Could not load 'unexistant_group' from basic.edj:"
139 " %s\n", errmsg);
140 }
141
142 if (!edje_object_file_set(edje_obj, edje_file_path, "example_group"))
143 {
144 int err = edje_object_load_error_get(edje_obj);
145 const char *errmsg = edje_load_error_str(err);
146 fprintf(stderr, "Could not load 'example_group' from basic.edj: %s\n",
147 errmsg);
148
149 evas_object_del(edje_obj);
150 goto error_edj;
151 }
152
153 fprintf(stdout, "Loaded Edje object bound to group 'example_group' from"
154 " file basic.edj with success!\n");
155
156 evas_object_move(edje_obj, 20, 20);
157 evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40);
158 evas_object_show(edje_obj);
159
160 /* this is a border around the Edje object above, here just to
161 * emphasize its geometry */
162 border = evas_object_image_filled_add(evas);
163 evas_object_image_file_set(border, border_img_path, NULL);
164 evas_object_image_border_set(border, 2, 2, 2, 2);
165 evas_object_image_border_center_fill_set(border, EVAS_BORDER_FILL_NONE);
166
167 evas_object_resize(border, WIDTH - 40 + 4, HEIGHT - 40 + 4);
168 evas_object_move(border, 20 - 2, 20 - 2);
169 evas_object_show(border);
170
171 fprintf(stdout, "'example_data' data field in group 'example_group' has "
172 "the value: %s\n", edje_object_data_get(edje_obj,
173 "example_data"));
174
175 fprintf(stdout, "Testing if 'part_one' part exists: %s\n",
176 edje_object_part_exists(edje_obj, "part_one") ? "yes!" : "no");
177
178 edje_object_part_geometry_get(edje_obj, "part_one", &x, &y, &w, &h);
179 fprintf(stdout, "The geometry of that part inside the Edje object's area "
180 "is: x = %d, y = %d, w = %d, h = %d\n", x, y, w, h);
181
182 evas_object_color_get(edje_object_part_object_get(edje_obj, "part_one"),
183 &x, &y, &w, &h);
184 fprintf(stdout, "That part's color components are: r = %d, g = %d, b = %d,"
185 " a = %d\n", x, y, w, h);
186
187 edje_object_size_max_get(edje_obj, &w, &h);
188 fprintf(stdout, "The Edje object's max. size is: %d, %d\n", w, h);
189
190 edje_object_size_min_get(edje_obj, &w, &h);
191 fprintf(stdout, "The Edje object's min. size is: %d, %d\n", w, h);
192
193 edje_object_size_min_calc(edje_obj, &w, &h);
194 fprintf(stdout, "The Edje object's min. size reported by min. size"
195 " calculation is: w = %d, h = %d\n", w, h);
196
197 edje_object_size_min_restricted_calc(edje_obj, &w, &h, 500, 500);
198 fprintf(stdout, "The Edje object's min. size reported by *restricted* "
199 "min. size calculation is: w = %d, h = %d\n", w, h);
200
201 edje_object_parts_extends_calc(edje_obj, &x, &y, &w, &h);
202 fprintf(stdout, "The Edje object's \"extended\" geometry is: x = %d, "
203 "y = %d, w = %d, h = %d\n", x, y, w, h);
204
205 fprintf(stdout, commands);
206 ecore_main_loop_begin();
207
208 ecore_evas_free(ee);
209 ecore_evas_shutdown();
210 edje_shutdown();
211 return 0;
212
213error:
214 fprintf(stderr, "You got to have at least one evas engine built"
215 " and linked up to ecore-evas for this example to run"
216 " properly.\n");
217 ecore_evas_shutdown();
218 return -1;
219
220error_edj:
221 fprintf(stderr, "Failed to load basic.edj!\n");
222
223 ecore_evas_shutdown();
224 return -2;
225}
226
diff --git a/libraries/edje/src/examples/edje-box.c b/libraries/edje/src/examples/edje-box.c
new file mode 100644
index 0000000..7fffba3
--- /dev/null
+++ b/libraries/edje/src/examples/edje-box.c
@@ -0,0 +1,191 @@
1/**
2 * Simple Edje example illustrating box functions.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc box.edc && gcc -o edje-box edje-box.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22
23#define WIDTH 300
24#define HEIGHT 300
25
26#define RECTW 30
27#define RECTH 30
28
29#define NRECTS 20
30
31static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/box.edj";
32
33struct _App {
34 Ecore_Evas *ee;
35 Evas_Object *edje;
36 Evas_Object *bg;
37};
38
39static void
40_on_destroy(Ecore_Evas *ee __UNUSED__)
41{
42 ecore_main_loop_quit();
43}
44
45/* here just to keep our example's window size and background image's
46 * size in synchrony */
47static void
48_canvas_resize_cb(Ecore_Evas *ee)
49{
50 int w, h;
51 struct _App *app = ecore_evas_data_get(ee, "app");
52
53 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
54 evas_object_resize(app->bg, w, h);
55 evas_object_resize(app->edje, w, h);
56}
57
58static void
59_rect_mouse_down(void *data, Evas *e, Evas_Object *o, void *event_info)
60{
61 struct _App *app = data;
62 Evas_Event_Mouse_Down *ev = event_info;
63
64 if (ev->button == 1)
65 {
66 printf("Removing rect %p under the mouse pointer.\n", o);
67 edje_object_part_box_remove(app->edje, "example/box", o);
68 evas_object_del(o);
69 }
70 else if (ev->button == 3)
71 {
72 Evas_Object *rect;
73 Eina_Bool r;
74
75 rect = evas_object_rectangle_add(e);
76 evas_object_color_set(rect, 0, 0, 255, 255);
77 evas_object_resize(rect, RECTW + 10, RECTH);
78 evas_object_show(rect);
79
80 printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect);
81 r = edje_object_part_box_insert_before(app->edje, "example/box", rect, o);
82 if (!r)
83 printf("An error ocurred when appending rect %p to the box.\n", rect);
84
85 evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app);
86 }
87}
88
89static void
90_bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info)
91{
92 struct _App *app = data;
93 Evas_Event_Key_Down *ev = event_info;
94 Evas_Object *rect;
95 Eina_Bool r;
96
97
98 if (!strcmp(ev->keyname, "i"))
99 {
100 rect = evas_object_rectangle_add(e);
101 evas_object_color_set(rect, 0, 0, 128, 255);
102 evas_object_resize(rect, RECTW + 30, RECTH);
103 evas_object_show(rect);
104
105 printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect);
106 r = edje_object_part_box_insert_at(app->edje, "example/box", rect, 0);
107 if (!r)
108 printf("An error ocurred when appending rect %p to the box.\n", rect);
109
110 evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app);
111 }
112 else if (!strcmp(ev->keyname, "a"))
113 {
114 rect = evas_object_rectangle_add(e);
115 evas_object_color_set(rect, 0, 128, 0, 255);
116 evas_object_resize(rect, RECTW, RECTH);
117 evas_object_show(rect);
118
119 printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect);
120 r = edje_object_part_box_append(app->edje, "example/box", rect);
121 if (!r)
122 printf("An error ocurred when appending rect %p to the box.\n", rect);
123
124 evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app);
125 }
126 else if (!strcmp(ev->keyname, "c"))
127 edje_object_part_box_remove_all(app->edje, "example/box", EINA_TRUE);
128}
129
130int
131main(void)
132{
133 Evas *evas;
134 struct _App app;
135 int i;
136
137 ecore_evas_init();
138 edje_init();
139
140 /* this will give you a window with an Evas canvas under the first
141 * engine available */
142 app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
143
144 ecore_evas_callback_destroy_set(app.ee, _on_destroy);
145 ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb);
146 ecore_evas_title_set(app.ee, "Edje Box Example");
147 ecore_evas_show(app.ee);
148
149 ecore_evas_data_set(app.ee, "app", &app);
150
151 evas = ecore_evas_get(app.ee);
152
153 app.bg = evas_object_rectangle_add(evas);
154 evas_object_color_set(app.bg, 255, 255, 255, 255);
155 evas_object_resize(app.bg, WIDTH, HEIGHT);
156 evas_object_focus_set(app.bg, EINA_TRUE);
157 evas_object_show(app.bg);
158
159 evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app);
160
161 app.edje = edje_object_add(evas);
162
163 edje_object_file_set(app.edje, edje_file_path, "example/group");
164 evas_object_move(app.edje, 0, 0);
165 evas_object_resize(app.edje, WIDTH, HEIGHT);
166 evas_object_show(app.edje);
167
168 for (i = 0; i < NRECTS; i++)
169 {
170 Evas_Object *rect;
171 Eina_Bool r = EINA_FALSE;
172 int red = (i * 10) % 256;
173 rect = evas_object_rectangle_add(evas);
174 evas_object_color_set(rect, red, 0, 0, 255);
175 evas_object_resize(rect, RECTW, RECTH);
176 r = edje_object_part_box_append(app.edje, "example/box", rect);
177 if (!r)
178 printf("An error ocurred when appending rect #%d to the box.\n", i);
179 evas_object_show(rect);
180
181 evas_object_event_callback_add(
182 rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, &app);
183 }
184
185 ecore_main_loop_begin();
186
187 ecore_evas_free(app.ee);
188 ecore_evas_shutdown();
189 edje_shutdown();
190 return 0;
191}
diff --git a/libraries/edje/src/examples/edje-box2.c b/libraries/edje/src/examples/edje-box2.c
new file mode 100644
index 0000000..b3f4e40
--- /dev/null
+++ b/libraries/edje/src/examples/edje-box2.c
@@ -0,0 +1,204 @@
1/**
2 * Simple Edje example illustrating a custom box layout.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc box.edc && gcc -o edje-box2 edje-box2.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Evas.h>
21#include <Ecore_Evas.h>
22#include <Edje.h>
23
24#include <stdlib.h>
25#include <stdio.h>
26#include <string.h>
27
28static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/box.edj";
29
30struct _App {
31 Ecore_Evas *ee;
32 Evas *evas;
33 Evas_Object *bg;
34 Evas_Object *box;
35};
36
37static struct _App app;
38
39static void
40custom_layout(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
41{
42 int x, y, w, h;
43 int xx, yy, ww, hh;
44 int count;
45 Eina_List *l;
46 Evas_Object_Box_Option *opt;
47
48 evas_object_geometry_get(o, &x, &y, &w, &h);
49 count = eina_list_count(p->children);
50 ww = w / (count?:1);
51 hh = h / (count?:1);
52 if (ww < 1) ww = 1;
53 if (hh < 1) hh = 1;
54
55 xx = x;
56 yy = y;
57 EINA_LIST_FOREACH(p->children, l, opt)
58 {
59 evas_object_move(opt->obj, xx, yy);
60 xx += ww;
61 yy += hh;
62 }
63}
64
65static Evas_Object *
66new_greenie_block(Evas *e)
67{
68 Evas_Object *o;
69
70 o = evas_object_rectangle_add(e);
71 evas_object_resize(o, 10, 10);
72 evas_object_color_set(o, 0, 255, 0, 255);
73 evas_object_show(o);
74
75 return o;
76}
77
78static void
79on_keydown(void *data, Evas *evas, Evas_Object *o, void *einfo)
80{
81 struct _App *app = data;
82 Evas_Event_Key_Down *ev = einfo;
83 const Evas_Modifier *mods;
84
85 mods = evas_key_modifier_get(evas);
86 if (evas_key_modifier_is_set(mods, "Shift"))
87 {
88 int pos;
89 Evas_Object *obj = NULL;
90 pos = atoi(ev->keyname);
91 obj = edje_object_part_box_remove_at(app->box, "example/box", pos);
92 if (obj)
93 evas_object_del(obj);
94 return;
95 }
96 if (evas_key_modifier_is_set(mods, "Control"))
97 {
98 Evas_Object *o;
99 int pos;
100 pos = atoi(ev->keyname);
101 o = new_greenie_block(app->evas);
102 if (!edje_object_part_box_insert_at(app->box, "example/box", o, pos))
103 edje_object_part_box_append(app->box, "example/box", o);
104 return;
105 }
106 if (strcmp(ev->keyname, "Escape") == 0)
107 ecore_main_loop_quit();
108}
109
110static Evas_Object *
111box_new(Evas *evas, const char *name, int x, int y, int w, int h)
112{
113 Evas_Object *o;
114
115 o = edje_object_add(evas);
116 evas_object_move(o, x, y);
117 evas_object_resize(o, w, h);
118 if (!edje_object_file_set(o, edje_file_path, "example/group2"))
119 {
120 printf("error: could not load file object.\n");
121 }
122 evas_object_show(o);
123
124 evas_object_name_set(o, name);
125
126 return o;
127}
128
129static void
130on_resize(Ecore_Evas *ee)
131{
132 int w, h;
133
134 evas_output_viewport_get(app.evas, NULL, NULL, &w, &h);
135 evas_object_resize(app.bg, w, h);
136 evas_object_resize(app.box, w, h);
137}
138
139static void
140on_destroy(Ecore_Evas *ee)
141{
142 ecore_main_loop_quit();
143}
144
145int
146main(int argc, char *argv[])
147{
148 Ecore_Evas *ee;
149 int w, h, i;
150 Evas_Object *last;
151 Evas_Object *o;
152
153 evas_init();
154 ecore_init();
155 ecore_evas_init();
156 edje_init();
157
158 ee = ecore_evas_new(NULL, 0, 0, 640, 480, NULL);
159 ecore_evas_show(ee);
160
161 app.ee = ee;
162 app.evas = ecore_evas_get(ee);
163
164 ecore_evas_callback_resize_set(ee, on_resize);
165 ecore_evas_callback_destroy_set(ee, on_destroy);
166
167 evas_output_viewport_get(app.evas, NULL, NULL, &w, &h);
168
169 app.bg = evas_object_rectangle_add(app.evas);
170 evas_object_resize(app.bg, w, h);
171 evas_object_show(app.bg);
172 evas_object_focus_set(app.bg, 1);
173 evas_object_event_callback_add(
174 app.bg, EVAS_CALLBACK_KEY_DOWN, on_keydown, &app);
175
176 edje_box_layout_register("custom_layout", custom_layout, NULL, NULL, NULL, NULL);
177
178 app.box = box_new(app.evas, "box", 0, 0, w, h);
179
180 for (i = 1; i <= 5; i++)
181 {
182 o = last = evas_object_rectangle_add(app.evas);
183 evas_object_size_hint_min_set(o, 50, 50);
184 evas_object_resize(o, 50, 50);
185 evas_object_color_set(o, 255, 0, 0, 128);
186 evas_object_show(o);
187
188 if (!edje_object_part_box_append(app.box, "example/box", o))
189 {
190 fprintf(stderr, "error appending child object!\n");
191 return 1;
192 }
193 }
194
195 ecore_main_loop_begin();
196
197 edje_shutdown();
198 ecore_evas_shutdown();
199 ecore_shutdown();
200 evas_shutdown();
201
202
203 return 0;
204}
diff --git a/libraries/edje/src/examples/edje-color-class.c b/libraries/edje/src/examples/edje-color-class.c
new file mode 100644
index 0000000..9ac8653
--- /dev/null
+++ b/libraries/edje/src/examples/edje-color-class.c
@@ -0,0 +1,257 @@
1/**
2 * Simple Edje example illustrating color class functions.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc color-class.edc && gcc -o edje-table edje-color-class.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22
23#define WIDTH (400)
24#define HEIGHT (400)
25
26static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/color-class.edj";
27
28typedef int color[4]; /* rgba */
29
30static Ecore_Evas *ee, *ee2;
31static Evas *evas, *evas2;
32static Evas_Object *bg, *edje_obj, *bg2, *edje_obj2;
33static const char *selected_class;
34
35static color colors_init_data[] =
36 {{255, 0, 0, 255}, /* red */
37 {0, 255, 0, 255}, /* green */
38 {0, 0, 255, 255}, /* blue */
39 {0, 0, 0, 255}, /* black */
40 {255, 255, 255, 255}, /* white */
41 {128, 128, 128, 255}, /* gray */
42 {255, 255, 0, 255}, /* yellow */
43 {255, 0, 255, 255} /* pink */
44 };
45
46static char *color_names[] =
47 {"red", "green", "blue", "black", "white",
48 "gray", "yellow", "pink"};
49
50static Eina_Bool
51_get_color_from_name(const char *n, color *c)
52{
53 int i;
54 for (i = 0; i < 8; i++)
55 if (!strcmp(n, color_names[i]))
56 {
57 (*c)[0] = (colors_init_data[i])[0];
58 (*c)[1] = (colors_init_data[i])[1];
59 (*c)[2] = (colors_init_data[i])[2];
60 (*c)[3] = (colors_init_data[i])[3];
61 return EINA_TRUE;
62 }
63
64 return EINA_FALSE;
65}
66
67static void
68_color_classes_print(void)
69{
70 Eina_List *classes;
71 char *class_name;
72
73 fprintf(stdout, "Getting the color classes\n\n");
74 classes = edje_color_class_list();
75 EINA_LIST_FREE(classes, class_name)
76 {
77 int r1, r2, r3, g1, g2, g3, b1, b2, b3,
78 a1, a2, a3;
79
80 fprintf(stdout, "\ncolor class: %s\n", class_name);
81 if (!edje_color_class_get(class_name, &r1, &g1, &b1, &a1,
82 &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3))
83 fprintf(stderr, "Cannot get the color class\n");
84 else
85 {
86
87 fprintf(stdout,"Object color r: %d g: %d b: %d a: %d\n",
88 r1, g1, b1, a1);
89 fprintf(stdout,"Text outline color r: %d g: %d b: %d a: %d\n",
90 r2, g2, b2, a2);
91 fprintf(stdout,"Text shadow color r: %d g: %d b: %d a: %d\n",
92 r3, g3, b3, a3);
93 }
94 free(class_name);
95 }
96}
97
98static void
99_on_destroy(Ecore_Evas *ee)
100{
101 ecore_main_loop_quit();
102}
103
104static void
105_on_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
106{
107 Evas_Event_Mouse_Down *ev = event_info;
108
109 if (ev->button == 1)
110 if (obj == edje_obj)
111 edje_color_class_del(selected_class);
112 else
113 edje_object_color_class_del(edje_obj2, selected_class);
114}
115
116/* here just to keep our example's window size
117 * in synchrony. */
118static void
119_canvas_resize_cb(Ecore_Evas *_ee)
120{
121 int w, h;
122
123 ecore_evas_geometry_get(_ee, NULL, NULL, &w, &h);
124
125 if (_ee == ee)
126 {
127 evas_object_resize(bg, w, h);
128 evas_object_resize(edje_obj, w, h);
129 }
130 else
131 {
132 evas_object_resize(bg2, w, h);
133 evas_object_resize(edje_obj2, w, h);
134 }
135}
136
137static void
138_color_class_callback_delete(void *data, Evas *evas, Evas_Object *obj,
139 const char *emission, void *source)
140{
141 if (!strcmp(data, "process"))
142 fprintf(stdout, "Color class: %s deleted on process level\n", emission);
143 else
144 fprintf(stdout, "Color class: %s deleted on object level\n", emission);
145}
146
147static void
148_create_windows(void)
149{
150 /* this will give you a window with an Evas canvas under the first
151 * engine available */
152 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
153 ee2 = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
154
155 ecore_evas_callback_destroy_set(ee, _on_destroy);
156 ecore_evas_callback_resize_set(ee, _canvas_resize_cb);
157 ecore_evas_title_set(ee, "Edje Color Class Example");
158 ecore_evas_show(ee);
159
160 ecore_evas_callback_destroy_set(ee2, _on_destroy);
161 ecore_evas_callback_resize_set(ee2, _canvas_resize_cb);
162 ecore_evas_title_set(ee2, "Edje Object Color Class Example");
163 ecore_evas_show(ee2);
164
165 evas = ecore_evas_get(ee);
166 evas2 = ecore_evas_get(ee2);
167
168 bg = evas_object_rectangle_add(evas);
169 evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
170 evas_object_move(bg, 0, 0); /* at canvas' origin */
171 evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
172 evas_object_show(bg);
173
174 bg2 = evas_object_rectangle_add(evas2);
175 evas_object_color_set(bg2, 255, 255, 255, 255); /* white bg */
176 evas_object_move(bg2, 0, 0); /* at canvas' origin */
177 evas_object_resize(bg2, WIDTH, HEIGHT); /* covers full canvas */
178 evas_object_show(bg2);
179
180 edje_obj = edje_object_add(evas);
181 evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_MOUSE_DOWN,
182 _on_mouse_down, NULL);
183
184 edje_object_file_set(edje_obj, edje_file_path, "example_color_class");
185 evas_object_move(edje_obj, 0, 0); /* at canvas' origin */
186 evas_object_resize(edje_obj, WIDTH, HEIGHT);
187 edje_object_part_text_set(edje_obj, "part_four", "EDJE EXAMPLE");
188 edje_object_signal_callback_add(edje_obj, "color_class,del", "*",
189 (Edje_Signal_Cb) _color_class_callback_delete,
190 "process");
191 evas_object_show(edje_obj);
192
193 edje_obj2 = edje_object_add(evas2);
194 evas_object_event_callback_add(edje_obj2, EVAS_CALLBACK_MOUSE_DOWN,
195 _on_mouse_down, NULL);
196
197 edje_object_file_set(edje_obj2, edje_file_path, "example_color_class");
198 evas_object_move(edje_obj2, 0, 0); /* at canvas' origin */
199 evas_object_resize(edje_obj2, WIDTH, HEIGHT);
200 edje_object_part_text_set(edje_obj2, "part_four", "EDJE OBJECT EXAMPLE");
201 edje_object_signal_callback_add(edje_obj2, "color_class,del", "*",
202 (Edje_Signal_Cb) _color_class_callback_delete,
203 "object");
204 evas_object_show(edje_obj2);
205}
206
207int
208main(int argc, char *argv[])
209{
210 color c1, c2, c3;
211 int i;
212
213 if (argc != 5)
214 {
215 fprintf(stderr, "You have to use: %s color_class_name color1, color2," \
216 "color3\n", argv[0]);
217 fprintf(stderr, "Available colors:\n");
218 for (i = 0; i < 8; i++)
219 fprintf(stderr, "%s\n", color_names[i]);
220
221 return 1;
222 }
223
224 selected_class = argv[1];
225 if (!(_get_color_from_name(argv[2], &c1) &&
226 _get_color_from_name(argv[3], &c2) &&
227 _get_color_from_name(argv[4], &c3)))
228 {
229 fprintf(stderr, "Color not available!\n");
230 return 2;
231 }
232
233 ecore_evas_init();
234 edje_init();
235
236 _create_windows();
237
238 edje_color_class_set(argv[1], /* class name */
239 c1[0], c1[1], c1[2], c1[3], /* Object color */
240 c2[0], c2[1], c2[2], c2[3], /* Text outline */
241 c3[0], c3[1], c3[2], c3[3]); /* Text shadow */
242
243 /* Setting an arbitrary value just to see the difference between */
244 /* process level and object level */
245 edje_object_color_class_set(edje_obj2, argv[1], /* class name */
246 128, 180, 77, 255, /* Object color */
247 200, 22, 86, 255, /* Text outline */
248 39, 90, 187, 255); /* Text shadow */
249
250 _color_classes_print();
251 ecore_main_loop_begin();
252 ecore_evas_free(ee);
253 ecore_evas_free(ee2);
254 ecore_evas_shutdown();
255 edje_shutdown();
256 return 0;
257}
diff --git a/libraries/edje/src/examples/edje-drag.c b/libraries/edje/src/examples/edje-drag.c
new file mode 100644
index 0000000..78e2e72
--- /dev/null
+++ b/libraries/edje/src/examples/edje-drag.c
@@ -0,0 +1,157 @@
1/**
2 * Simple Edje example illustrating drag functions.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc drag.edc && gcc -o drag-box drag-box.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22
23#define WIDTH 300
24#define HEIGHT 300
25
26#define RECTW 30
27#define RECTH 30
28
29#define NRECTS 20
30
31static const char *PARTNAME = "example/knob";
32
33static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/drag.edj";
34
35struct _App {
36 Ecore_Evas *ee;
37 Evas_Object *edje;
38 Evas_Object *bg;
39};
40
41static void
42_on_destroy(Ecore_Evas *ee __UNUSED__)
43{
44 ecore_main_loop_quit();
45}
46
47/* here just to keep our example's window size and background image's
48 * size in synchrony */
49static void
50_canvas_resize_cb(Ecore_Evas *ee)
51{
52 int w, h;
53 struct _App *app = ecore_evas_data_get(ee, "app");
54
55 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
56 evas_object_resize(app->bg, w, h);
57 evas_object_resize(app->edje, w, h);
58}
59
60static void
61_bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info)
62{
63 struct _App *app = data;
64 Evas_Event_Key_Down *ev = event_info;
65 Evas_Object *rect;
66 Eina_Bool r;
67
68
69 if (!strcmp(ev->keyname, "Down"))
70 {
71 edje_object_part_drag_step(app->edje, PARTNAME, 0, 1.0);
72 }
73 else if (!strcmp(ev->keyname, "Up"))
74 {
75 edje_object_part_drag_step(app->edje, PARTNAME, 0, -1.0);
76 }
77 else if (!strcmp(ev->keyname, "m"))
78 {
79 edje_object_part_drag_value_set(app->edje, PARTNAME, 0.0, 0.5);
80 }
81 else if (!strcmp(ev->keyname, "Prior"))
82 {
83 edje_object_part_drag_page(app->edje, PARTNAME, 0.0, -1.0);
84 }
85 else if (!strcmp(ev->keyname, "Next"))
86 {
87 edje_object_part_drag_page(app->edje, PARTNAME, 0.0, 1.0);
88 }
89 else if (!strcmp(ev->keyname, "Escape"))
90 ecore_main_loop_quit();
91 else
92 printf("unhandled key: %s\n", ev->keyname);
93}
94
95static void
96_knob_moved_cb(void *data, Evas_Object *o, const char *emission, const char *source)
97{
98 double val;
99 edje_object_part_drag_value_get(o, PARTNAME, NULL, &val);
100 printf("value changed to: %0.3f\n", val);
101}
102
103int
104main(void)
105{
106 Evas *evas;
107 struct _App app;
108 int i;
109
110 ecore_evas_init();
111 edje_init();
112
113 /* this will give you a window with an Evas canvas under the first
114 * engine available */
115 app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
116
117 ecore_evas_callback_destroy_set(app.ee, _on_destroy);
118 ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb);
119 ecore_evas_title_set(app.ee, "Edje Box Example");
120 ecore_evas_show(app.ee);
121
122 ecore_evas_data_set(app.ee, "app", &app);
123
124 evas = ecore_evas_get(app.ee);
125
126 app.bg = evas_object_rectangle_add(evas);
127 evas_object_color_set(app.bg, 255, 255, 255, 255);
128 evas_object_resize(app.bg, WIDTH, HEIGHT);
129 evas_object_focus_set(app.bg, EINA_TRUE);
130 evas_object_show(app.bg);
131
132 evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app);
133
134 app.edje = edje_object_add(evas);
135
136 edje_object_file_set(app.edje, edje_file_path, "example/group");
137 evas_object_move(app.edje, 0, 0);
138 evas_object_resize(app.edje, WIDTH, HEIGHT);
139 evas_object_show(app.edje);
140
141 edje_object_part_drag_size_set(app.edje, PARTNAME, 1.0, 0.4);
142
143 if (!edje_object_part_drag_step_set(app.edje, PARTNAME, 0.0, 0.1))
144 printf("error when setting drag step size.\n");
145
146 if (!edje_object_part_drag_page_set(app.edje, PARTNAME, 0.0, 0.3))
147 printf("error when setting drag page step size.\n");
148
149 edje_object_signal_callback_add(app.edje, "drag", PARTNAME, _knob_moved_cb, &app);
150
151 ecore_main_loop_begin();
152
153 ecore_evas_free(app.ee);
154 ecore_evas_shutdown();
155 edje_shutdown();
156 return 0;
157}
diff --git a/libraries/edje/src/examples/edje-perspective.c b/libraries/edje/src/examples/edje-perspective.c
new file mode 100644
index 0000000..5220b74
--- /dev/null
+++ b/libraries/edje/src/examples/edje-perspective.c
@@ -0,0 +1,201 @@
1/**
2 * Simple Edje example illustrating drag functions.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc drag.edc && gcc -o drag-box drag-box.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22
23#define WIDTH 480
24#define HEIGHT 320
25
26static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/perspective.edj";
27
28struct _App {
29 Ecore_Evas *ee;
30 Evas_Object *edje;
31 Evas_Object *bg;
32 Edje_Perspective *ps;
33 Eina_Bool animating;
34 int x, y; // relative position of part in the screen
35 int focal;
36};
37
38static void
39_on_destroy(Ecore_Evas *ee __UNUSED__)
40{
41 ecore_main_loop_quit();
42}
43
44/* here just to keep our example's window size and background image's
45 * size in synchrony */
46static void
47_canvas_resize_cb(Ecore_Evas *ee)
48{
49 int w, h;
50 struct _App *app = ecore_evas_data_get(ee, "app");
51
52 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
53 evas_object_resize(app->bg, w, h);
54 evas_object_resize(app->edje, w, h);
55}
56
57static void
58_part_move(struct _App *app, int dx, int dy)
59{
60 char emission[64];
61
62 if (app->animating)
63 return;
64
65 app->x += dx;
66 app->y += dy;
67 if (app->x > 1)
68 app->x = 1;
69 if (app->x < 0)
70 app->x = 0;
71 if (app->y > 1)
72 app->y = 1;
73 if (app->y < 0)
74 app->y = 0;
75
76 snprintf(emission, sizeof(emission), "move,%d,%d", app->x, app->y);
77 edje_object_signal_emit(app->edje, emission, "");
78 app->animating = EINA_TRUE;
79}
80
81
82static void
83_bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info)
84{
85 struct _App *app = data;
86 Evas_Event_Key_Down *ev = event_info;
87
88
89 // just moving the part and text
90 if (!strcmp(ev->keyname, "Down"))
91 {
92 _part_move(app, 0, 1);
93 }
94 else if (!strcmp(ev->keyname, "Up"))
95 {
96 _part_move(app, 0, -1);
97 }
98 else if (!strcmp(ev->keyname, "Left"))
99 {
100 _part_move(app, -1, 0);
101 }
102 else if (!strcmp(ev->keyname, "Right"))
103 {
104 _part_move(app, 1, 0);
105 }
106 else if (!strcmp(ev->keyname, "Prior"))
107 {
108 _part_move(app, -1, -1);
109 }
110 else if (!strcmp(ev->keyname, "Next"))
111 {
112 _part_move(app, 1, 1);
113 }
114 // adjusting the perspective focal point distance
115 else if (!strcmp(ev->keyname, "KP_Add"))
116 {
117 app->focal += 5;
118 edje_perspective_set(app->ps, 240, 160, 0, app->focal);
119 edje_object_calc_force(app->edje);
120 }
121 else if (!strcmp(ev->keyname, "KP_Subtract"))
122 {
123 app->focal -= 5;
124 if (app->focal < 5)
125 app->focal = 5;
126
127 edje_perspective_set(app->ps, 240, 160, 0, app->focal);
128 edje_object_calc_force(app->edje);
129 }
130 // exiting
131 else if (!strcmp(ev->keyname, "Escape"))
132 ecore_main_loop_quit();
133 else
134 printf("unhandled key: %s\n", ev->keyname);
135}
136
137static void
138_animation_end_cb(void *data, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
139{
140 struct _App *app = data;
141
142 app->animating = EINA_FALSE;
143}
144
145int
146main(void)
147{
148 Evas *evas;
149 struct _App app;
150 int i;
151
152 ecore_evas_init();
153 edje_init();
154
155 edje_frametime_set(((double)1) / 60);
156
157 /* this will give you a window with an Evas canvas under the first
158 * engine available */
159 app.animating = EINA_FALSE;
160 app.x = 0;
161 app.y = 0;
162 app.focal = 50;
163 app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
164
165 ecore_evas_callback_destroy_set(app.ee, _on_destroy);
166 ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb);
167 ecore_evas_title_set(app.ee, "Edje Box Example");
168 ecore_evas_show(app.ee);
169
170 ecore_evas_data_set(app.ee, "app", &app);
171
172 evas = ecore_evas_get(app.ee);
173
174 app.bg = evas_object_rectangle_add(evas);
175 evas_object_color_set(app.bg, 255, 255, 255, 255);
176 evas_object_resize(app.bg, WIDTH, HEIGHT);
177 evas_object_focus_set(app.bg, EINA_TRUE);
178 evas_object_show(app.bg);
179
180 evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app);
181
182 app.edje = edje_object_add(evas);
183
184 edje_object_file_set(app.edje, edje_file_path, "example/group");
185 evas_object_move(app.edje, 0, 0);
186 evas_object_resize(app.edje, WIDTH, HEIGHT);
187 evas_object_show(app.edje);
188
189 edje_object_signal_callback_add(app.edje, "animation,end", "", _animation_end_cb, &app);
190
191 app.ps = edje_perspective_new(evas);
192 edje_perspective_set(app.ps, 240, 160, 0, app.focal);
193 edje_perspective_global_set(app.ps, EINA_TRUE);
194
195 ecore_main_loop_begin();
196
197 ecore_evas_free(app.ee);
198 ecore_evas_shutdown();
199 edje_shutdown();
200 return 0;
201}
diff --git a/libraries/edje/src/examples/edje-signals-messages.c b/libraries/edje/src/examples/edje-signals-messages.c
new file mode 100644
index 0000000..2345738
--- /dev/null
+++ b/libraries/edje/src/examples/edje-signals-messages.c
@@ -0,0 +1,230 @@
1/**
2 * Simple Edje example illustrating the Edje signals and messages
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * gcc -o edje-signals-messages edje-signals-messages.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22#include <stdio.h>
23
24#define WIDTH (300)
25#define HEIGHT (300)
26
27#define MSG_COLOR 1
28#define MSG_TEXT 2
29
30static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png";
31static const char *edje_file_path = \
32 PACKAGE_EXAMPLES_DIR "/signals-messages.edj";
33
34static Ecore_Evas *ee;
35static Evas_Object *edje_obj;
36static Eina_Bool right_rect_show = EINA_TRUE;
37
38static const char *commands = \
39 "commands are:\n"
40 "\tt - toggle right rectangle's visibility\n"
41 "\th - print help\n";
42
43static void
44_on_keydown(void *data __UNUSED__,
45 Evas *evas __UNUSED__,
46 Evas_Object *o __UNUSED__,
47 void *einfo)
48{
49 Evas_Event_Key_Down *ev = einfo;
50
51 if (strcmp(ev->keyname, "h") == 0) /* print help */
52 {
53 fprintf(stdout, commands);
54 return;
55 }
56
57 if (strcmp(ev->keyname, "t") == 0) /* toggle right rectangle's visibility */
58 {
59 char buf[1024];
60
61 right_rect_show = !right_rect_show;
62 snprintf(buf, sizeof(buf), "part_right,%s",
63 right_rect_show ? "show" : "hide");
64
65 printf("emitting %s\n", buf);
66
67 edje_object_signal_emit(edje_obj, buf, "");
68
69 return;
70 }
71}
72
73static void
74_on_delete(Ecore_Evas *ee __UNUSED__)
75{
76 ecore_main_loop_quit();
77}
78
79/* print signals coming from theme */
80static void
81_sig_print(const char *emission,
82 const char *source)
83{
84 fprintf(stdout, "Signal %s coming from part %s!\n", emission, source);
85}
86
87static void
88_mouse_wheel_cb(void *data __UNUSED__,
89 Evas_Object *obj __UNUSED__,
90 const char *emission,
91 const char *source)
92{
93 _sig_print(emission, source);
94}
95
96/* mouse over signals */
97static void
98_mouse_over_cb(void *data __UNUSED__,
99 Evas_Object *obj __UNUSED__,
100 const char *emission,
101 const char *source)
102{
103 int i;
104
105 _sig_print(emission, source);
106
107 Edje_Message_Int_Set *msg = malloc(sizeof(*msg) + 3 * sizeof(int));
108 msg->count = 4;
109 for (i = 0; i < 4; i++)
110 msg->val[i] = rand() % 256;
111
112 edje_object_message_send(edje_obj, EDJE_MESSAGE_INT_SET, MSG_COLOR, msg);
113
114 free(msg);
115}
116
117/* print out received message string */
118static void
119_message_handle(void *data __UNUSED__,
120 Evas_Object *obj __UNUSED__,
121 Edje_Message_Type type,
122 int id,
123 void *msg)
124{
125 Edje_Message_String *m;
126
127 if (type != EDJE_MESSAGE_STRING) return;
128 if (id != MSG_TEXT) return;
129
130 m = msg;
131
132 fprintf(stdout, "String message received: %s\n", m->str);
133}
134
135int
136main(void)
137{
138 Evas_Object *border, *bg;
139 Evas *evas;
140
141 srand(time(NULL));
142
143 if (!ecore_evas_init())
144 return EXIT_FAILURE;
145
146 if (!edje_init())
147 return EXIT_FAILURE;
148
149 /* this will give you a window with an Evas canvas under the first
150 * engine available */
151 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
152 if (!ee)
153 goto error;
154
155 ecore_evas_callback_delete_request_set(ee, _on_delete);
156 ecore_evas_title_set(ee, "Edje Basics Example");
157 ecore_evas_show(ee);
158
159 evas = ecore_evas_get(ee);
160
161 bg = evas_object_rectangle_add(evas);
162 evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
163 evas_object_move(bg, 0, 0); /* at canvas' origin */
164 evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
165 evas_object_show(bg);
166 ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
167
168 evas_object_focus_set(bg, EINA_TRUE);
169 evas_object_event_callback_add(
170 bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
171
172 edje_obj = edje_object_add(evas);
173
174 if (!edje_object_file_set(edje_obj, edje_file_path, "example_group"))
175 {
176 int err = edje_object_load_error_get(edje_obj);
177 const char *errmsg = edje_load_error_str(err);
178 fprintf(stderr, "Could not load 'example_group' from "
179 "signals-messages.edj: %s\n", errmsg);
180
181 evas_object_del(edje_obj);
182 goto error_edj;
183 }
184
185 edje_object_signal_callback_add(edje_obj, "mouse,wheel,*", "part_left",
186 _mouse_wheel_cb, NULL);
187
188 edje_object_signal_callback_add(edje_obj, "mouse,over", "part_right",
189 _mouse_over_cb, NULL);
190
191 edje_object_message_handler_set(edje_obj, _message_handle, NULL);
192
193 evas_object_move(edje_obj, 20, 20);
194 evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40);
195 evas_object_show(edje_obj);
196
197 /* this is a border around the Edje object above, here just to
198 * emphasize its geometry */
199 border = evas_object_image_filled_add(evas);
200 evas_object_image_file_set(border, border_img_path, NULL);
201 evas_object_image_border_set(border, 2, 2, 2, 2);
202 evas_object_image_border_center_fill_set(border, EVAS_BORDER_FILL_NONE);
203
204 evas_object_resize(border, WIDTH - 40 + 4, HEIGHT - 40 + 4);
205 evas_object_move(border, 20 - 2, 20 - 2);
206 evas_object_repeat_events_set(border, EINA_TRUE);
207 evas_object_show(border);
208
209 fprintf(stdout, commands);
210 ecore_main_loop_begin();
211
212 ecore_evas_free(ee);
213 ecore_evas_shutdown();
214 edje_shutdown();
215 return 0;
216
217error:
218 fprintf(stderr, "You got to have at least one Evas engine built"
219 " and linked up to ecore-evas for this example to run"
220 " properly.\n");
221 ecore_evas_shutdown();
222 return -1;
223
224error_edj:
225 fprintf(stderr, "Failed to load signals-messages.edj!\n");
226
227 ecore_evas_shutdown();
228 return -2;
229}
230
diff --git a/libraries/edje/src/examples/edje-swallow.c b/libraries/edje/src/examples/edje-swallow.c
new file mode 100644
index 0000000..a1d30e2
--- /dev/null
+++ b/libraries/edje/src/examples/edje-swallow.c
@@ -0,0 +1,95 @@
1/**
2 * Simple Edje example illustrating swallow functions.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc swallow.edc && gcc -o edje-swallow edje-swallow.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22
23#define WIDTH (300)
24#define HEIGHT (300)
25
26static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/swallow.edj";
27
28static Ecore_Evas *ee;
29static Evas_Object *bg;
30
31static void
32_on_delete(Ecore_Evas *ee __UNUSED__)
33{
34 ecore_main_loop_quit();
35}
36
37/* here just to keep our example's window size and background image's
38 * size in synchrony */
39static void
40_canvas_resize_cb(Ecore_Evas *ee)
41{
42 int w, h;
43
44 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
45 evas_object_resize(bg, w, h);
46}
47
48int
49main(void)
50{
51 Evas_Object *edje_obj, *rect, *obj;
52 Evas *evas;
53
54 ecore_evas_init();
55 edje_init();
56
57 /* this will give you a window with an Evas canvas under the first
58 * engine available */
59 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
60
61 ecore_evas_callback_delete_request_set(ee, _on_delete);
62 ecore_evas_callback_resize_set(ee, _canvas_resize_cb);
63 ecore_evas_title_set(ee, "Edje Swallow Example");
64 ecore_evas_show(ee);
65
66 evas = ecore_evas_get(ee);
67
68 bg = evas_object_rectangle_add(evas);
69 evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
70 evas_object_move(bg, 0, 0); /* at canvas' origin */
71 evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
72 evas_object_show(bg);
73
74 edje_obj = edje_object_add(evas);
75
76 edje_object_file_set(edje_obj, edje_file_path, "example_group");
77 evas_object_move(edje_obj, 20, 20);
78 evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40);
79 evas_object_show(edje_obj);
80
81 rect = evas_object_rectangle_add(evas);
82 evas_object_color_set(rect, 255, 0, 0, 255);
83 edje_object_part_swallow(edje_obj, "part_one", rect);
84
85 obj = edje_object_part_swallow_get(edje_obj, "part_one");
86 if(obj == rect)
87 printf("Swallowing worked!\n");
88
89 ecore_main_loop_begin();
90
91 ecore_evas_free(ee);
92 ecore_evas_shutdown();
93 edje_shutdown();
94 return 0;
95}
diff --git a/libraries/edje/src/examples/edje-table.c b/libraries/edje/src/examples/edje-table.c
new file mode 100644
index 0000000..3866d22
--- /dev/null
+++ b/libraries/edje/src/examples/edje-table.c
@@ -0,0 +1,165 @@
1/**
2 * Simple Edje example illustrating table functions.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc table.edc && gcc -o edje-table edje-table.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22
23#define WIDTH (400)
24#define HEIGHT (400)
25
26static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/table.edj";
27
28static Ecore_Evas *ee;
29static Evas *evas;
30static Evas_Object *bg, *edje_obj, *rects[4];
31
32static void
33_on_delete(Ecore_Evas *ee __UNUSED__)
34{
35 ecore_main_loop_quit();
36}
37
38/* Try to get the number of columns and rows of the table
39 * and print them. */
40static void
41_columns_rows_print(void)
42{
43 int cols, rows;
44
45 if (edje_object_part_table_col_row_size_get(edje_obj, "table_part", &cols,
46 &rows))
47 fprintf(stdout, "Number of columns: %d\nNumber of rows: %d\n", cols, rows);
48 else
49 fprintf(stderr, "Cannot get the number of columns and rows\n");
50}
51
52/* here just to keep our example's window size and table items
53 * size in synchrony. */
54static void
55_canvas_resize_cb(Ecore_Evas *ee)
56{
57 int i, w, h;
58
59 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
60
61 evas_object_resize(bg, w, h);
62 evas_object_resize(edje_obj, w, h);
63
64 for (i = 0; i < 4; i++)
65 evas_object_size_hint_min_set(rects[i], w/2, h/2);
66}
67
68/* Mouse button 1 = remove the clicked item
69 * any other button = remove all items. */
70static void
71_on_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
72{
73 Evas_Event_Mouse_Down *ev = event_info;
74
75 if (ev->button != 1)
76 edje_object_part_table_clear(edje_obj, "table_part", EINA_TRUE);
77 else if (!edje_object_part_table_unpack(edje_obj, "table_part", obj))
78 fprintf(stderr, "Cannot remove the selected rectangle\n");
79
80 evas_object_del(obj);
81 _columns_rows_print();
82}
83
84static void
85_rects_create(void)
86{
87 int i;
88
89 for (i = 0; i < 4; i++)
90 {
91 rects[i] = evas_object_rectangle_add(evas);
92 evas_object_size_hint_min_set(rects[i], 200, 200);
93 evas_object_size_hint_weight_set(rects[i], 1.0, 1.0);
94 evas_object_show(rects[i]);
95 evas_object_event_callback_add(rects[i], EVAS_CALLBACK_MOUSE_DOWN,
96 _on_mouse_down, NULL);
97 }
98}
99
100int
101main(void)
102{
103 int i;
104
105 ecore_evas_init();
106 edje_init();
107
108 /* this will give you a window with an Evas canvas under the first
109 * engine available */
110 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
111
112 ecore_evas_callback_delete_request_set(ee, _on_delete);
113 ecore_evas_callback_resize_set(ee, _canvas_resize_cb);
114 ecore_evas_title_set(ee, "Edje Table Example");
115 ecore_evas_show(ee);
116
117 evas = ecore_evas_get(ee);
118
119 bg = evas_object_rectangle_add(evas);
120 evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
121 evas_object_move(bg, 0, 0); /* at canvas' origin */
122 evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
123 evas_object_show(bg);
124
125 edje_obj = edje_object_add(evas);
126
127 edje_object_file_set(edje_obj, edje_file_path, "example_table");
128 evas_object_move(edje_obj, 0, 0); /* at canvas' origin */
129 evas_object_resize(edje_obj, WIDTH, HEIGHT);
130 evas_object_show(edje_obj);
131
132 _rects_create();
133
134 /* Colouring the rectangles */
135 evas_object_color_set(rects[0], 255, 0, 0, 255);
136 evas_object_color_set(rects[1], 0, 255, 0, 255);
137 evas_object_color_set(rects[2], 0, 0, 255, 255);
138 evas_object_color_set(rects[3], 128, 128, 128, 255);
139
140 /* Packing the rectangles into the table */
141 if (!edje_object_part_table_pack(edje_obj, "table_part", rects[0],
142 0, 0, 1, 2))
143 fprintf(stderr, "Cannot add the rectangle 1 to table\n");
144
145 if (!edje_object_part_table_pack(edje_obj, "table_part", rects[1],
146 0, 1, 1, 1))
147 fprintf(stderr, "Cannot add the rectangle 2 to table\n");
148
149 if (!edje_object_part_table_pack(edje_obj, "table_part", rects[2],
150 1, 0, 1, 1))
151 fprintf(stderr, "Cannot add the rectangle 3 to table\n");
152
153 if (!edje_object_part_table_pack(edje_obj, "table_part", rects[3],
154 1, 1, 1, 1))
155 fprintf(stderr, "Cannot add the rectangle 4 to table\n");
156
157 _columns_rows_print();
158
159 ecore_main_loop_begin();
160
161 ecore_evas_free(ee);
162 ecore_evas_shutdown();
163 edje_shutdown();
164 return 0;
165}
diff --git a/libraries/edje/src/examples/edje-text.c b/libraries/edje/src/examples/edje-text.c
new file mode 100644
index 0000000..0916509
--- /dev/null
+++ b/libraries/edje/src/examples/edje-text.c
@@ -0,0 +1,92 @@
1/**
2 * Simple Edje example illustrating text functions.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * edje_cc text.edc && gcc -o edje-text edje-text.c `pkg-config --libs --cflags ecore-evas edje`
9 * @endverbatim
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#else
15#define PACKAGE_EXAMPLES_DIR "."
16#define __UNUSED__
17#endif
18
19#include <Ecore.h>
20#include <Ecore_Evas.h>
21#include <Edje.h>
22
23#define WIDTH (300)
24#define HEIGHT (300)
25
26static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/text.edj";
27
28static Ecore_Evas *ee;
29static Evas_Object *bg;
30
31static void
32_on_delete(Ecore_Evas *ee __UNUSED__)
33{
34 ecore_main_loop_quit();
35}
36
37static void
38_cb(void *data, Evas_Object *obj, const char *part)
39{
40 printf("text: %s\n", edje_object_part_text_unescaped_get(obj, part));
41}
42
43int
44main(void)
45{
46 Evas_Object *edje_obj, *rect, *obj;
47 Evas *evas;
48
49 ecore_evas_init();
50 edje_init();
51
52 /* this will give you a window with an Evas canvas under the first
53 * engine available */
54 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
55
56 ecore_evas_callback_delete_request_set(ee, _on_delete);
57 ecore_evas_title_set(ee, "Edje text Example");
58 ecore_evas_show(ee);
59
60 evas = ecore_evas_get(ee);
61
62 bg = evas_object_rectangle_add(evas);
63 evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
64 evas_object_move(bg, 0, 0); /* at canvas' origin */
65 evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
66 evas_object_show(bg);
67 ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
68
69 edje_obj = edje_object_add(evas);
70
71 edje_object_file_set(edje_obj, edje_file_path, "example_group");
72 evas_object_move(edje_obj, 20, 20);
73 evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40);
74 evas_object_show(edje_obj);
75
76 edje_object_text_change_cb_set(edje_obj, _cb, NULL);
77 edje_object_part_text_set(edje_obj, "part_one", "one");
78 edje_object_part_text_set(edje_obj, "part_two", "<b>two");
79
80 edje_object_part_text_select_allow_set(edje_obj, "part_two", EINA_TRUE);
81 edje_object_part_text_select_all(edje_obj, "part_two");
82 printf("selection: %s\n", edje_object_part_text_selection_get(edje_obj, "part_two"));
83 edje_object_part_text_select_none(edje_obj, "part_two");
84 printf("selection: %s\n", edje_object_part_text_selection_get(edje_obj, "part_two"));
85
86 ecore_main_loop_begin();
87
88 ecore_evas_free(ee);
89 ecore_evas_shutdown();
90 edje_shutdown();
91 return 0;
92}
diff --git a/libraries/edje/src/examples/lua_script.edc b/libraries/edje/src/examples/lua_script.edc
new file mode 100644
index 0000000..24e8ebe
--- /dev/null
+++ b/libraries/edje/src/examples/lua_script.edc
@@ -0,0 +1,405 @@
1color_classes {
2 color_class { name: "test_colour"; color: 255 255 255 255; }
3}
4
5fonts {
6 font: "Vera.ttf" "default";
7}
8
9images {
10 image: "bubble.png" COMP;
11 image: "test.png" COMP;
12}
13
14collections {
15 group {
16 name: "main";
17 lua_script_only: 1;
18 lua_script {
19 --// stick object private/local vars here
20 local D;
21 local count = 0;
22 local fndata = 99;
23 local text_geom;
24
25 --// Functions to print tables.
26 local print_table, print_table_start;
27
28 function print_table_start(table, space, name)
29 print(space .. name .. ": ");
30 print(space .. "{");
31 print_table(table, space .. " ");
32 print(space .. "}");
33 end
34
35 function print_table(table, space)
36 for k, v in pairs(table) do
37 if type(v) == "table" then
38 print_table_start(v, space, k);
39 elseif type(v) == "string" then
40 print(space .. k .. ': "' .. v .. '";')
41 else
42 print(space .. k .. ": " .. v .. ";")
43 end
44 end
45 end
46
47 local function mycb3 (v)
48 print("lua::callback transition " .. D.val .. " v: " .. v);
49 d = {};
50 d = edje.size(d);
51 print("lua::objsize= " .. d.w .. " , " .. d.h);
52 sz = {w=v * 80, h=v * 40};
53 D.rect:geom(((d.w / 2) * math.sin(v * 2 * math.pi)) + ((d.w - sz.w) / 2),
54 ((d.h / 2) * math.cos(v * 2 * math.pi)) + ((d.h - sz.h) / 2),
55 sz.w, sz.h);
56 D.rect:color(255, 128, v * 255, 255);
57 d = D.rect:move(d);
58 print("lua::pos= " .. d.x .. " , " .. d.y);
59
60 r = D.rect:above();
61 if (r ~= nil) then
62 print("lua::rcol");
63 r:color(20, v * 255, 60, 255);
64 else
65 print("lua::r none!!!!!!!!!!!!!!1");
66 end
67 d = edje.size();
68 D.clip:geom(10, 10, d.w - 20, d.h - 20);
69 c = D.clip:clipees();
70 for i=1,table.getn(c),1 do
71 d = c[i]:geom();
72 print("lua::" .. i .. " geom = " .. d.x .. "," .. d.y .. " " .. d.w .. "x" .. d.h);
73 end
74 return true; --// repeat the timer
75 end
76
77 local function mycb2 ()
78 print("lua::callback animator " .. count .. " seconds: " .. edje.seconds() .. " looptime: " .. edje.looptime());
79 edje.color_class("test_colour", 255, (count * 10) % 255, 255, 255);
80 edje.text_class("test_text_class", "Sans:style=Bold", ((count * 3) % 100) + 8);
81 if (5 > (count % 10)) then
82 D.text:font("default", 32);
83 else
84 D.text:font("Sans:style=Bold", 32);
85 end
86 edje_geom = edje.geom();
87 text_geom = D.text:geom();
88 D.text:move((edje_geom.w - text_geom.w) / 2, (edje_geom.h - text_geom.h) / 8);
89 return true; --// repeat the timer
90 end
91
92 local function mycb ()
93 print("lua::callback timer " .. count .. " fndata = " .. fndata);
94 count = count + 1; --// keep count of calls - object data
95 fndata = fndata + 3; --// play with object vars to see if they persist
96 D.tim = edje.timer(0.25, mycb); --// inside cb add new timer
97 return false; --// cease repeating the timer
98 end
99
100 --// init object here
101 D = {}; --// data is empty table to start
102 D.val = math.random(); --// start with some random value so
103 fndata = fndata + D.val; --// func data start point
104 print("lua::init ... " .. D.val);
105 edje.echo("lua::echo('hello world')");
106
107 --// actually add the timer to call mycb in 1.23 sec
108 D.tim = edje.timer(1.23, mycb);
109 D.tra = edje.transition(5.0, mycb3);
110 D.ani = edje.animator(mycb2);
111 edje_geom = edje.geom();
112
113 if (edje.spanky) then edje.spanky(); end
114
115 local date = edje.date();
116 print("lua:: date: " ..
117 date.year .. "|" ..
118 date.month .. "|" ..
119 date.day .. "|" ..
120 date.yearday .. "|" ..
121 date.weekday .. "|" ..
122 date.hour .. "|" ..
123 date.min .. "|" ..
124 date.sec
125 );
126
127 --// send some random edje message
128 edje.messagesend(7, "none" );
129 edje.messagesend(7, "sig", "signal", "source");
130 edje.messagesend(7, "str", "hello world");
131 edje.messagesend(7, "int", 987);
132 edje.messagesend(7, "float", 987.321);
133 edje.messagesend(7, "strset", {"hello", "there", "world"});
134 edje.messagesend(7, "intset", {1, 2, 3});
135 edje.messagesend(7, "floatset", {1.1, 2.2, 3.3});
136 edje.messagesend(7, "strint", "hello world", 7);
137 edje.messagesend(7, "strfloat", "hello world", 7.654);
138 edje.messagesend(7, "strintset","hello world", {1, 2, 3});
139
140 D.edje = edje.edje();
141 D.edje:file("plain/edje/group");
142 D.edje:show();
143
144 D.rect = edje.rect();
145 D.rect:geom (5, 10, 50, 30);
146 D.rect:color (255, 128, 60, 255);
147 D.rect:show ();
148
149 D.rect2 = edje.rect();
150 D.rect2:geom (50, 50, 50, 50);
151 D.rect2:color (20, 30, 60, 120);
152 D.rect2:show ();
153
154 D.clip = edje.rect();
155 D.clip:geom (10, 10, 150, 150);
156 D.clip:color (200, 200, 50, 200);
157 D.clip:show ();
158
159 D.rect2:clip(D.clip);
160 D.rect:clip(D.clip);
161
162 D.text = edje.text();
163 D.text:geom (50, 5, 150, 50);
164 D.text:color (255, 0, 0, 255);
165 D.text:font("Sans:style=Bold", 32);
166 D.text:text("Lua rocks!");
167 text_geom = D.text:geom();
168 print(D.text:text());
169 D.text:show();
170
171 --// Fun with maps!
172 D.map = edje.map(4); --// 4 is the only supported map size at the moment.
173 --// These all do the same thing.
174 --// Note, lua likes to start at 1, C (and thus evas) at 0. I choose to agree with C.
175 D.map:coord(0, 50, 50, 0);
176 D.map:coord(1, 100, 50, 0);
177 D.map:coord(2, 100, 100, 0);
178 D.map:coord(3, 50, 100, 0);
179 D.map:populate(50, 50, 50, 50, 0);
180 D.map:populate(D.rect2, 0);
181 D.map:populate(D.rect2);
182
183 --// print the results
184 D.coord = D.map:coord(0);
185 print("lua::map coords for point 0 x=" .. D.coord.x .. " y=" .. D.coord.y .. " z=" .. D.coord.z);
186 D.coord = D.map:coord(1);
187 print("lua::map coords for point 1 x=" .. D.coord.x .. " y=" .. D.coord.y .. " z=" .. D.coord.z);
188 D.coord = D.map:coord(2);
189 print("lua::map coords for point 2 x=" .. D.coord.x .. " y=" .. D.coord.y .. " z=" .. D.coord.z);
190 D.coord = D.map:coord(3);
191 print("lua::map coords for point 3 x=" .. D.coord.x .. " y=" .. D.coord.y .. " z=" .. D.coord.z);
192
193 D.map:smooth(false);
194 D.map:alpha(true);
195
196 if (D.map:alpha()) then
197 print("lua::map is alpha");
198 end
199
200 if (D.map:smooth()) then
201 print("lua::map is smooooth");
202 end
203
204 if (D.map:clockwise()) then
205 print("lua::map is clockwise");
206 end
207
208 D.map:color(255, 255, 255, 255); // set all points to this colour.
209 D.map:color(1, 255, 0, 255, 255); // set just one point to this colour.
210
211 D.map:lighting(75, 75, 10, 255, 255, 255, 0, 255, 0); // Ambient light and a 3D light source.
212
213 --// Toss it around.
214 D.map:rotate(45.0, 75, 75);
215 D.map:zoom(1.5, 1.5, 75, 75);
216 D.map:rotate3d(10.0, 20.0, 30.0, 75, 75, 0);
217 D.map:perspective(200, 200, 0, 20);
218
219 --// For image UV mapping.
220 D.map:uv(0, 0.0, 0.0);
221 D.map:uv(1, 50.0, 0.0);
222 D.map:uv(2, 50.0, 50.0);
223 D.map:uv(3, 0.0, 50.0);
224
225 --// Actually apply the resulting transformations.
226 D.rect2:map(D.map);
227 D.rect2:map_enable(true);
228 if (D.rect2:map_enable()) then
229 print("lua::map enabled");
230 end
231
232 D.rect2:map_source(D.rect); --// Don't think this is actually implemented in evas.
233
234--// D.map:dup();
235--// D.map:size(); --// perhaps overide the # operator? For now it's only gonna return 4 anyway.
236
237 --// example of deleting something
238 --// D.tim:del();
239
240 --// test the color_class stuff
241 colour = edje.color_class("test_colour");
242 print("lua::color_class= " .. colour.r .. "," .. colour.g .. "," .. colour.b .. "," .. colour.a);
243 colour = edje.color_class("test_colour", 32, 64, 255, 128);
244 print("lua::color_class= " .. colour.r .. "," .. colour.g .. "," .. colour.b .. "," .. colour.a);
245 colour = edje.color_class("test_colour", { r=255, g=0, b=255, a=255 });
246 print("lua::color_class= " .. colour.r .. "," .. colour.g .. "," .. colour.b .. "," .. colour.a);
247 text = edje.text_class("test_text_class", "Sans:style=Bold", 8);
248 print("lua::text_class= " .. text.font .. " size " .. text.size);
249
250 --// Do something bad, just to see what happens.
251--// edje.color_class(nil);
252
253 --// shutdown func - generally empty or not there. everything garbage collected for you
254 function shutdown ()
255 print("lua::shutdown ... " .. D.val);
256 end
257
258 function show ()
259 print("lua::show ... " .. D.val);
260 end
261
262 function hide ()
263 print("lua::hide ... " .. D.val);
264 end
265
266 function move (x, y)
267 print("lua::move x=" .. x .. " x=" .. y);
268 D.edje:move(0, 0);
269 end
270
271 function resize (w, h)
272 print("lua::resize w=" .. w .. " h=" .. h);
273 D.text:move((w - text_geom.w) / 2, (h - text_geom.h) / 8);
274 D.edje:resize(w, h);
275 end
276
277 function message (id, type, ...)
278 print("lua::message id=" .. id .. " type=" .. type);
279 --// handle your message type here. check id + type then use the
280 --// vararg appropriately. they are the same as the params passed
281 --// to edje:messagesend() (if any are passed at all). Any array
282 --// arguments are passed as a single table.
283
284 if ("none" == type) then
285 print("lua::message no args");
286 elseif ("strset" == type) then
287 strs = ... ;
288 print_table_start(strs, "", "lua::message strings");
289 elseif ("intset" == type) then
290 ints = ... ;
291 print_table_start(ints, "", "lua::message ints");
292 elseif ("floatset" == type) then
293 floats = ... ;
294 print_table_start(floats, "", "lua::message floats");
295 elseif ("strintset" == type) then
296 str, ints = ... ;
297 print("lua::message " .. str);
298 print_table_start(ints, "", "lua::message ints");
299 elseif ("strfloatset" == type) then
300 str, floats = ... ;
301 print("lua::message " .. str);
302 print_table_start(floats, "", "lua::message floats");
303 else
304 print("lua::message " .. ... );
305 end
306 end
307
308 function signal (sig, src)
309 print("lua::signal sig= " .. sig .. " src= " .. src);
310 end
311 }
312 }
313
314 // The group name NEEDS a / in it,
315 // or the part below that tries to swallow it won't work.
316 // Leaving just the lua part visible.
317 group {
318 name: "bubbles/lua";
319 lua_script_only: 1;
320 lua_script {
321 local bubbles = { };
322 local bubbleCols = 8;
323 local bubbleRows = 6;
324
325 for i = 1, bubbleRows do
326 row = { };
327 for j = 1, bubbleCols do
328 image = edje.image();
329 image:image("bubble.png");
330 image:show();
331 table.insert(row, image);
332 end
333 table.insert(bubbles, row);
334 end
335
336 function resize (w, h)
337 for i = 1, bubbleRows do
338 for j = 1, bubbleCols do
339 w1 = w / bubbleCols;
340 h1 = h / bubbleRows;
341 bubbles[i][j]:geom((j - 1) * w1, (i - 1) * h1, w1, h1);
342 if ((1 == i) or (1 == j) or (bubbleRows == i) or (bubbleCols == j)) then
343 bubbles[i][j]:color(0, 255, 0, 200);
344 else
345 bubbles[i][j]:color(math.random(200) + 55, 0, math.random(255) + 55, 200);
346 end
347 end
348 end
349 end
350 }
351 }
352
353 group {
354 name: "plain/edje/group";
355 parts {
356 part {
357 name: "background";
358 type: RECT;
359 mouse_events: 0;
360 description {
361 state: "default" 0.0;
362 color: 0 0 0 255;
363 }
364 }
365
366 // A lua group embedded in an edje group.
367 part {
368 name: "bubbles_lua";
369 type: GROUP;
370 source: "bubbles/lua";
371 mouse_events: 0;
372 description { state: "default" 0.0; }
373 }
374
375 part {
376 name: "background_image";
377 type: IMAGE;
378 mouse_events: 0;
379 description {
380 state: "default" 0.0;
381 aspect_preference: HORIZONTAL;
382 color_class: "test_colour";
383 image { normal: "test.png"; }
384 }
385 }
386
387 part {
388 name: "some_text";
389 type: TEXT;
390 mouse_events: 0;
391 description {
392 state: "default" 0;
393 text
394 {
395 text: "This is test text.";
396 text_class: "test_text_class";
397 }
398 }
399 }
400
401 }
402 }
403
404}
405
diff --git a/libraries/edje/src/examples/perspective.edc b/libraries/edje/src/examples/perspective.edc
new file mode 100644
index 0000000..810ae18
--- /dev/null
+++ b/libraries/edje/src/examples/perspective.edc
@@ -0,0 +1,140 @@
1collections {
2 group {
3 name: "example/group";
4
5 min: 480 320;
6
7 parts {
8 part {
9 name: "bg";
10 type: RECT;
11 mouse_events: 1;
12
13 description {
14 state: "default" 0.0;
15 }
16 } // bg
17
18 part {
19 name: "rectangle";
20 type: RECT;
21 mouse_events: 0;
22
23 description {
24 state: "default" 0.0;
25 color: 255 0 0 128;
26
27 rel1 {
28 offset: -5 -5;
29 to: "title";
30 }
31 rel2 {
32 offset: 4 4;
33 to: "title";
34 }
35
36 map {
37 on: 1;
38 perspective_on: 1;
39 rotation {
40 x: 45;
41 }
42 }
43 }
44 } // rectangle
45
46 part {
47 name: "title";
48 type: TEXT;
49 mouse_events: 0;
50
51 description {
52 state: "default" 0.0;
53 color: 200 200 200 255;
54
55 align: 0.0 0.5;
56
57 rel1.relative: 0.1 0.1;
58 rel2.relative: 0.1 0.1;
59
60 text {
61 text: "Perspective example";
62 font: "Sans";
63 size: 16;
64 min: 1 1;
65 }
66
67 map {
68 on: 1;
69 perspective_on: 1;
70 rotation {
71 x: 45;
72 }
73 }
74 }
75
76 description {
77 state: "right" 0.0;
78 inherit: "default" 0.0;
79
80 rel1.relative: 0.5 0.1;
81 rel2.relative: 0.5 0.1;
82 }
83 description {
84 state: "bottom" 0.0;
85 inherit: "default" 0.0;
86
87 rel1.relative: 0.1 0.9;
88 rel2.relative: 0.1 0.9;
89 }
90 description {
91 state: "bottomright" 0.0;
92 inherit: "default" 0.0;
93
94 rel1.relative: 0.5 0.9;
95 rel2.relative: 0.5 0.9;
96 }
97 } // title
98 }
99
100 programs {
101 program {
102 name: "move,right";
103 signal: "move,1,0";
104 action: STATE_SET "right" 0.0;
105 transition: SINUSOIDAL 1.0;
106 target: "title";
107 after: "animation,end";
108 }
109 program {
110 name: "move,bottom";
111 signal: "move,0,1";
112 action: STATE_SET "bottom" 0.0;
113 transition: SINUSOIDAL 1.0;
114 target: "title";
115 after: "animation,end";
116 }
117 program {
118 name: "move,bottomright";
119 signal: "move,1,1";
120 action: STATE_SET "bottomright" 0.0;
121 transition: SINUSOIDAL 1.0;
122 target: "title";
123 after: "animation,end";
124 }
125 program {
126 name: "move,default";
127 signal: "move,0,0";
128 action: STATE_SET "default" 0.0;
129 transition: SINUSOIDAL 1.0;
130 target: "title";
131 after: "animation,end";
132 }
133
134 program {
135 name: "animation,end";
136 action: SIGNAL_EMIT "animation,end" "";
137 }
138 }
139 }
140}
diff --git a/libraries/edje/src/examples/red.png b/libraries/edje/src/examples/red.png
new file mode 100644
index 0000000..dd03528
--- /dev/null
+++ b/libraries/edje/src/examples/red.png
Binary files differ
diff --git a/libraries/edje/src/examples/signals-messages.edc b/libraries/edje/src/examples/signals-messages.edc
new file mode 100644
index 0000000..45d9c58
--- /dev/null
+++ b/libraries/edje/src/examples/signals-messages.edc
@@ -0,0 +1,174 @@
1#define MSG_COLOR 1
2#define MSG_TEXT 2
3
4collections {
5 group {
6 name: "example_group";
7
8 parts {
9 part {
10 name: "part_right";
11 type: RECT;
12 clip_to: "part_right_clipper";
13 description {
14 min: 50 50;
15 max: 50 50;
16 state: "default" 0.0;
17 color: 0 0 255 255; /* blue */
18 rel1.relative: 1.0 0.5;
19 rel1.offset: -49 0;
20 rel2.relative: 1.0 0.5;
21 }
22 }
23
24 part {
25 name: "part_left";
26 type: RECT;
27 description {
28 color_class: "cc";
29 min: 50 50;
30 max: 50 50;
31 state: "default" 0.0;
32 rel1.relative: 0.0 0.5;
33 rel2.relative: 0.0 0.5;
34 rel2.offset: 50 -1;
35 }
36 }
37
38 part {
39 name: "text";
40 type: TEXT;
41 description {
42 min: 150 50;
43 max: 150 50;
44 fixed: 1 1;
45 color: 0 0 0 255;
46 state: "default" 0.0;
47 rel1.relative: 0.5 0.5;
48 rel2.relative: 0.5 0.5;
49 text {
50 font: "Sans";
51 size: 20;
52 min: 1 1;
53 align: 0.5 0.5;
54 }
55 }
56 }
57
58 part {
59 name: "part_right_clipper";
60 type: RECT;
61 repeat_events: 1;
62
63 description {
64 min: 50 50;
65 max: 50 50;
66
67 state: "default" 0.0;
68 rel1.relative: 1.0 0.5;
69 rel1.offset: -49 0;
70 rel2.relative: 1.0 0.5;
71 }
72
73 description {
74 state: "hidden" 0.0;
75 inherit: "default" 0.0;
76 visible: 0;
77 }
78 }
79 }
80
81 script {
82 public global_str0;
83 public global_str1;
84 public global_str2;
85 public str_idx;
86
87 public set_text_string() {
88 new tmp[1024];
89 new idx;
90 idx = get_int(str_idx);
91
92 if (idx == 0)
93 get_str(global_str0, tmp, 1024);
94 else if (idx == 1)
95 get_str(global_str1, tmp, 1024);
96 else if (idx == 2)
97 get_str(global_str2, tmp, 1024);
98 else return;
99
100 set_text(PART:"text", tmp);
101 send_message(MSG_STRING, MSG_TEXT, tmp);
102 }
103
104 public message(Msg_Type:type, id, ...) {
105 if ((type == MSG_INT_SET) && (id == MSG_COLOR)) {
106 new r, g, b, a;
107
108 r = getarg(3);
109 g = getarg(4);
110 b = getarg(5);
111 a = getarg(6);
112
113 set_color_class("cc", r, g, b, a);
114 }
115 }
116 }
117
118 programs {
119 program {
120 name: "bootstrap";
121 signal: "load";
122 source: "";
123 script {
124 set_str(global_str0, "String one");
125 set_str(global_str1, "String two");
126 set_str(global_str2, "String three");
127 set_int(str_idx, 0);
128 set_text_string();
129 }
130 }
131
132 program { /* custom signal */
133 name: "part_right,hovered";
134 signal: "mouse,move";
135 source: "part_right";
136 action: SIGNAL_EMIT "mouse,over" "part_right";
137 }
138
139 program { /* hide right rectangle */
140 name: "part_right,hide";
141 signal: "part_right,hide";
142 source: "";
143 action: STATE_SET "hidden" 0.0;
144 target: "part_right_clipper";
145 }
146
147 program {
148 name: "part_right,show";
149 signal: "part_right,show";
150 source: "";
151 action: STATE_SET "default" 0.0;
152 target: "part_right_clipper";
153 }
154
155 program { /* change text part's string value */
156 name: "text,change";
157 signal: "mouse,clicked,1";
158 source: "part_left";
159 script {
160 new idx;
161 idx = get_int(str_idx);
162 idx = idx + 1;
163
164 if (idx > 2)
165 set_int(str_idx, 0);
166 else
167 set_int(str_idx, idx);
168
169 set_text_string();
170 }
171 }
172 }
173 }
174}
diff --git a/libraries/edje/src/examples/sigtest.c b/libraries/edje/src/examples/sigtest.c
new file mode 100644
index 0000000..6e4d85f
--- /dev/null
+++ b/libraries/edje/src/examples/sigtest.c
@@ -0,0 +1,309 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#else
4#define PACKAGE_EXAMPLES_DIR "."
5#define __UNUSED__
6#endif
7
8#include <Ecore.h>
9#include <Ecore_Evas.h>
10#include <Edje.h>
11#include <stdio.h>
12
13#define WIDTH (300)
14#define HEIGHT (300)
15
16static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png";
17static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/sigtest.edj";
18
19static Ecore_Evas *ee;
20static Evas_Object *edje_obj;
21
22static const char commands[] = \
23 "commands are:\n"
24 "\te - change te edje base\n"
25 "\tl - change to lua base\n"
26 "\tm - send message\n"
27 "\ts - send signal\n"
28 "\th - print help\n";
29
30static void
31_on_keydown(void *data __UNUSED__,
32 Evas *evas __UNUSED__,
33 Evas_Object *o __UNUSED__,
34 void *einfo)
35{
36 Evas_Event_Key_Down *ev = einfo;
37
38 if (strcmp(ev->keyname, "h") == 0)
39 {
40 fprintf(stdout, commands);
41 return;
42 }
43
44 if (strcmp(ev->keyname, "e") == 0)
45 {
46 if (!edje_object_file_set(edje_obj, edje_file_path, "plain/edje/group"))
47 {
48 int err = edje_object_load_error_get(edje_obj);
49 const char *errmsg = edje_load_error_str(err);
50
51 fprintf(stderr, "Could not load 'plain/edje/group' from sigtest.edj: %s\n", errmsg);
52 }
53 else
54 fprintf(stdout, "Loaded Edje object bound to group 'plain/edje/group' from"
55 " file sigtest.edj with success!\n");
56 return;
57 }
58
59 if (strcmp(ev->keyname, "l") == 0)
60 {
61 if (!edje_object_file_set(edje_obj, edje_file_path, "lua_base"))
62 {
63 int err = edje_object_load_error_get(edje_obj);
64 const char *errmsg = edje_load_error_str(err);
65
66 fprintf(stderr, "Could not load 'lua_base' from sigtest.edj: %s\n", errmsg);
67 }
68 else
69 fprintf(stdout, "Loaded Edje object bound to group 'lua_base' from"
70 " file sigtest.edj with success!\n");
71 return;
72 }
73
74 if (strcmp(ev->keyname, "m") == 0)
75 {
76 Edje_Message_String *msg = malloc(sizeof(*msg));
77
78 fprintf(stdout, "\n");
79 msg->str = strdup("C message text");
80 edje_object_message_send(edje_obj, EDJE_MESSAGE_STRING, 2, msg);
81 free(msg);
82 fprintf(stdout, "C message sent\n");
83 return;
84 }
85
86 if (strcmp(ev->keyname, "s") == 0)
87 {
88 fprintf(stdout, "\n");
89 edje_object_signal_emit(edje_obj, "C signal 1", "Csource");
90 edje_object_signal_emit(edje_obj, "bubbles_lua:C signal 2", "Csource");
91 fprintf(stdout, "C signal sent\n");
92 return;
93 }
94}
95
96static void
97_on_message(void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg)
98{
99 int i;
100
101 fprintf(stdout, "C::message id=%d type=%d ", id, type);
102 switch (type)
103 {
104 case EDJE_MESSAGE_NONE :
105 {
106 fprintf(stdout, " NONE");
107 break;
108 }
109
110 case EDJE_MESSAGE_SIGNAL :
111 {
112 fprintf(stdout, " SIGNAL ");
113 break;
114 }
115
116 case EDJE_MESSAGE_STRING :
117 {
118 Edje_Message_String *mmsg = msg;
119
120 fprintf(stdout, " STRING %s", mmsg->str);
121 break;
122 }
123
124 case EDJE_MESSAGE_INT :
125 {
126 Edje_Message_Int *mmsg = msg;
127
128 fprintf(stdout, " INT %d", mmsg->val);
129 break;
130 }
131
132 case EDJE_MESSAGE_FLOAT :
133 {
134 Edje_Message_Float *mmsg = msg;
135
136 fprintf(stdout, " FLOAT %f", mmsg->val);
137 break;
138 }
139
140 case EDJE_MESSAGE_STRING_SET :
141 {
142 Edje_Message_String_Set *mmsg = msg;
143
144 fprintf(stdout, " STRING_SET -\n");
145 for (i = 0; i < mmsg->count; i++)
146 fprintf(stdout, " %s\n", mmsg->str[i]);
147 break;
148 }
149
150 case EDJE_MESSAGE_INT_SET :
151 {
152 Edje_Message_Int_Set *mmsg = msg;
153
154 fprintf(stdout, " INT_SET -\n");
155 for (i = 0; i < mmsg->count; i++)
156 fprintf(stdout, " %d\n", mmsg->val[i]);
157 break;
158 }
159
160 case EDJE_MESSAGE_FLOAT_SET :
161 {
162 Edje_Message_Float_Set *mmsg = msg;
163
164 fprintf(stdout, " FLOAT_SET -\n");
165 for (i = 0; i < mmsg->count; i++)
166 fprintf(stdout, " %f\n", mmsg->val[i]);
167 break;
168 }
169
170 case EDJE_MESSAGE_STRING_INT :
171 {
172 Edje_Message_String_Int *mmsg = msg;
173
174 fprintf(stdout, " STRING_INT %s %d", mmsg->str, mmsg->val);
175 break;
176 }
177
178 case EDJE_MESSAGE_STRING_FLOAT :
179 {
180 Edje_Message_String_Float *mmsg = msg;
181
182 fprintf(stdout, " STRING_FLOAT %s %f", mmsg->str, mmsg->val);
183 break;
184 }
185
186 case EDJE_MESSAGE_STRING_INT_SET :
187 {
188 Edje_Message_String_Int_Set *mmsg = msg;
189
190 fprintf(stdout, " STRING_INT_SET %s -\n", mmsg->str);
191 for (i = 0; i < mmsg->count; i++)
192 fprintf(stdout, " %d\n", mmsg->val[i]);
193 break;
194 }
195
196 case EDJE_MESSAGE_STRING_FLOAT_SET :
197 {
198 Edje_Message_String_Float_Set *mmsg = msg;
199
200 fprintf(stdout, " STRING_FLOAT_SET %s -\n", mmsg->str);
201 for (i = 0; i < mmsg->count; i++)
202 fprintf(stdout, " %f\n", mmsg->val[i]);
203 break;
204 }
205 }
206 fprintf(stdout, "\n");
207}
208
209static void
210_on_signal(void *data, Evas_Object *obj __UNUSED__, const char *emission, const char *source)
211{
212 fprintf(stdout, "C::signal sig=|%s| src=|%s|\n", emission, source);
213}
214
215static void
216_on_delete(Ecore_Evas *ee __UNUSED__)
217{
218 ecore_main_loop_quit();
219}
220
221int
222main(void)
223{
224 Evas_Object *border, *bg;
225 Evas *evas;
226
227 if (!ecore_evas_init())
228 return EXIT_FAILURE;
229
230 if (!edje_init())
231 return EXIT_FAILURE;
232
233 /* this will give you a window with an Evas canvas under the first
234 * engine available */
235 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
236 if (!ee)
237 goto error;
238
239 ecore_evas_callback_delete_request_set(ee, _on_delete);
240 ecore_evas_title_set(ee, "Signals and wessages tester");
241 ecore_evas_show(ee);
242
243 evas = ecore_evas_get(ee);
244
245 bg = evas_object_rectangle_add(evas);
246 evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
247 evas_object_move(bg, 0, 0); /* at canvas' origin */
248 evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
249 evas_object_show(bg);
250 ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
251
252 evas_object_focus_set(bg, EINA_TRUE);
253 evas_object_event_callback_add(
254 bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL);
255
256 edje_obj = edje_object_add(evas);
257
258 edje_object_message_handler_set(edje_obj, _on_message, NULL);
259 edje_object_signal_callback_add(edje_obj, "*", "*", _on_signal, NULL);
260
261 if (!edje_object_file_set(edje_obj, edje_file_path, "lua_base"))
262 {
263 int err = edje_object_load_error_get(edje_obj);
264 const char *errmsg = edje_load_error_str(err);
265 fprintf(stderr, "Could not load 'lua_base' from sigtest.edj: %s\n",
266 errmsg);
267
268 evas_object_del(edje_obj);
269 goto error_edj;
270 }
271
272 fprintf(stdout, "Loaded Edje object bound to group 'lua_base' from"
273 " file sigtest.edj with success!\n");
274
275 evas_object_move(edje_obj, 20, 20);
276 evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40);
277 evas_object_show(edje_obj);
278
279 /* this is a border around the Edje object above, here just to
280 * emphasize its geometry */
281 border = evas_object_image_filled_add(evas);
282 evas_object_image_file_set(border, border_img_path, NULL);
283 evas_object_image_border_set(border, 2, 2, 2, 2);
284 evas_object_image_border_center_fill_set(border, EVAS_BORDER_FILL_NONE);
285
286 evas_object_resize(border, WIDTH - 40 + 4, HEIGHT - 40 + 4);
287 evas_object_move(border, 20 - 2, 20 - 2);
288 evas_object_show(border);
289
290 ecore_main_loop_begin();
291
292 ecore_evas_free(ee);
293 ecore_evas_shutdown();
294 edje_shutdown();
295 return 0;
296
297error:
298 fprintf(stderr, "You got to have at least one evas engine built"
299 " and linked up to ecore-evas for this example to run"
300 " properly.\n");
301 ecore_evas_shutdown();
302 return -1;
303
304error_edj:
305 fprintf(stderr, "Failed to load sigtest.edj!\n");
306
307 ecore_evas_shutdown();
308 return -2;
309}
diff --git a/libraries/edje/src/examples/sigtest.edc b/libraries/edje/src/examples/sigtest.edc
new file mode 100644
index 0000000..ef2a854
--- /dev/null
+++ b/libraries/edje/src/examples/sigtest.edc
@@ -0,0 +1,303 @@
1fonts {
2 font: "Vera.ttf" "default";
3}
4
5images {
6 image: "bubble.png" COMP;
7}
8
9collections {
10 group {
11 name: "lua_base";
12 lua_script_only: 1;
13 lua_script {
14 --// stick object private/local vars here
15 local D;
16 local text_geom;
17
18 --// Functions to print tables.
19 local print_table, print_table_start;
20
21 function print_table_start(table, space, name)
22 print(space .. name .. ": ");
23 print(space .. "{");
24 print_table(table, space .. " ");
25 print(space .. "}");
26 end
27
28 function print_table(table, space)
29 for k, v in pairs(table) do
30 if type(v) == "table" then
31 print_table_start(v, space, k);
32 elseif type(v) == "string" then
33 print(space .. k .. ': "' .. v .. '";')
34 else
35 print(space .. k .. ": " .. v .. ";")
36 end
37 end
38 end
39
40
41 --// init object here
42 D = {}; --// data is empty table to start
43 edje_geom = edje.geom();
44
45 D.edje = edje.edje();
46 D.edje:file("plain/edje/group");
47 D.edje:move(0, 0);
48 D.edje:resize(edje_geom.w, edje_geom.h);
49 D.edje:show();
50
51 edje.text_class("test_text_class", "Sans:style=Bold", 10);
52
53 --// send some random edje message
54 edje.messagesend(7, "none" );
55 edje.messagesend(7, "sig", "lua message signal", "luaSource");
56 edje.messagesend(7, "str", "hello world");
57 edje.messagesend(7, "int", 987);
58 edje.messagesend(7, "float", 987.321);
59 edje.messagesend(7, "strset", {"hello", "there", "world"});
60 edje.messagesend(7, "intset", {1, 2, 3});
61 edje.messagesend(7, "floatset", {1.1, 2.2, 3.3});
62 edje.messagesend(7, "strint", "hello world", 7);
63 edje.messagesend(7, "strfloat", "hello world", 7.654);
64 edje.messagesend(7, "strintset","hello world", {1, 2, 3});
65 --// and a signal
66 edje.emit("lua signal", "luaSource");
67
68
69 function move (x, y)
70 print("lua::move x=" .. x .. " x=" .. y);
71 D.edje:move(0, 0);
72 end
73
74 function resize (w, h)
75 print("lua::resize w=" .. w .. " h=" .. h);
76 D.edje:resize(w, h);
77 end
78
79 function message (id, type, ...)
80 print("lua::message id=" .. id .. " type=" .. type);
81 --// handle your message type here. check id + type then use the
82 --// vararg appropriately. they are the same as the params passed
83 --// to edje:messagesend() (if any are passed at all). Any array
84 --// arguments are passed as a single table.
85
86 if ("none" == type) then
87 print("lua::message no args");
88 elseif ("strset" == type) then
89 strs = ... ;
90 print_table_start(strs, "", "lua::message strings");
91 elseif ("intset" == type) then
92 ints = ... ;
93 print_table_start(ints, "", "lua::message ints");
94 elseif ("floatset" == type) then
95 floats = ... ;
96 print_table_start(floats, "", "lua::message floats");
97 elseif ("strintset" == type) then
98 str, ints = ... ;
99 print("lua::message " .. str);
100 print_table_start(ints, "", "lua::message ints");
101 elseif ("strfloatset" == type) then
102 str, floats = ... ;
103 print("lua::message " .. str);
104 print_table_start(floats, "", "lua::message floats");
105 else
106 print("lua::message " .. ... );
107 end
108 end
109
110 function signal (sig, src)
111 print("lua::signal sig=|" .. sig .. "| src=" .. src .. "|");
112 end
113 }
114 }
115
116 // The group name NEEDS a / in it,
117 // or the part below that tries to swallow it won't work.
118 // Leaving just the lua part visible.
119 group {
120 name: "bubbles/lua";
121 lua_script_only: 1;
122 lua_script {
123 local bubbles = { };
124 local bubbleCols = 8;
125 local bubbleRows = 6;
126
127 --// Functions to print tables.
128 local print_table, print_table_start;
129
130 function print_table_start(table, space, name)
131 print(space .. name .. ": ");
132 print(space .. "{");
133 print_table(table, space .. " ");
134 print(space .. "}");
135 end
136
137 function print_table(table, space)
138 for k, v in pairs(table) do
139 if type(v) == "table" then
140 print_table_start(v, space, k);
141 elseif type(v) == "string" then
142 print(space .. k .. ': "' .. v .. '";')
143 else
144 print(space .. k .. ": " .. v .. ";")
145 end
146 end
147 end
148
149
150 for i = 1, bubbleRows do
151 row = { };
152 for j = 1, bubbleCols do
153 image = edje.image();
154 image:image("bubble.png");
155 image:show();
156 table.insert(row, image);
157 end
158 table.insert(bubbles, row);
159 end
160
161 function resize (w, h)
162 for i = 1, bubbleRows do
163 for j = 1, bubbleCols do
164 w1 = w / bubbleCols;
165 h1 = h / bubbleRows;
166 bubbles[i][j]:geom((j - 1) * w1, (i - 1) * h1, w1, h1);
167 if ((1 == i) or (1 == j) or (bubbleRows == i) or (bubbleCols == j)) then
168 bubbles[i][j]:color(0, 255, 0, 200);
169 else
170 bubbles[i][j]:color(math.random(200) + 55, 0, math.random(255) + 55, 200);
171 end
172 end
173 end
174 end
175
176 function message (id, type, ...)
177 print("bubbles::message id=" .. id .. " type=" .. type);
178 --// handle your message type here. check id + type then use the
179 --// vararg appropriately. they are the same as the params passed
180 --// to edje:messagesend() (if any are passed at all). Any array
181 --// arguments are passed as a single table.
182
183 if ("none" == type) then
184 print("bubbles::message no args");
185 elseif ("strset" == type) then
186 strs = ... ;
187 print_table_start(strs, "", "bubbles::message strings");
188 elseif ("intset" == type) then
189 ints = ... ;
190 print_table_start(ints, "", "bubbles::message ints");
191 elseif ("floatset" == type) then
192 floats = ... ;
193 print_table_start(floats, "", "bubbles::message floats");
194 elseif ("strintset" == type) then
195 str, ints = ... ;
196 print("bubbles::message " .. str);
197 print_table_start(ints, "", "bubbles::message ints");
198 elseif ("strfloatset" == type) then
199 str, floats = ... ;
200 print("bubbles::message " .. str);
201 print_table_start(floats, "", "bubbles::message floats");
202 else
203 print("bubbles::message " .. ... );
204 end
205 end
206
207 function signal (sig, src)
208 print("bubbles::signal sig=|" .. sig .. "| src=|" .. src .. "|");
209 end
210 }
211 }
212
213 group {
214 name: "plain/edje/group";
215 parts {
216 part {
217 name: "background";
218 type: RECT;
219 mouse_events: 0;
220 description {
221 state: "default" 0.0;
222 color: 0 0 0 255;
223 }
224 }
225
226 // A lua group embedded in an edje group.
227 part {
228 name: "bubbles_lua";
229 type: GROUP;
230 source: "bubbles/lua";
231 mouse_events: 0;
232 description { state: "default" 0.0; visible: 1; }
233 }
234
235 part {
236 name: "some_text";
237 type: TEXT;
238 mouse_events: 0;
239 description {
240 state: "default" 0;
241 visible: 1;
242 text
243 {
244 text: "This is test text.";
245 text_class: "test_text_class";
246 }
247 }
248 }
249
250 program { name: "show_signals";
251 signal: "*";
252 source: "*";
253 script
254 {
255 new buf[128];
256
257 snprintf(buf, 128, "edje::signal sig=%s sig=%s", sig, src);
258 set_text(PART:"some_text", buf);
259 }
260 }
261
262 script {
263 public global_str0;
264 public global_str1;
265 public global_str2;
266 public str_idx;
267
268 public set_text_string() {
269 new tmp[1024];
270 new idx;
271 idx = get_int(str_idx);
272
273 if (idx == 0)
274 get_str(global_str0, tmp, 1024);
275 else if (idx == 1)
276 get_str(global_str1, tmp, 1024);
277 else if (idx == 2)
278 get_str(global_str2, tmp, 1024);
279 else return;
280
281 set_text(PART:"some_text", tmp);
282 send_message(MSG_STRING, 1, tmp);
283 }
284
285 public message(Msg_Type:type, id, ...) {
286 if (type == MSG_STRING) {
287 new text[64];
288 new buf[128];
289
290 getsarg(3, text, 64);
291 snprintf(buf, 128, "embryo::message |%s|", text);
292 set_text(PART:"some_text", buf);
293 }
294 }
295
296
297 }
298
299 }
300 }
301
302}
303
diff --git a/libraries/edje/src/examples/swallow.edc b/libraries/edje/src/examples/swallow.edc
new file mode 100644
index 0000000..a62a0b5
--- /dev/null
+++ b/libraries/edje/src/examples/swallow.edc
@@ -0,0 +1,21 @@
1collections {
2 group {
3 name: "example_group";
4 max: 500 500;
5 min: 50 50;
6
7 parts {
8 part {
9 name: "part_one";
10 type: SWALLOW;
11 description {
12 min: 50 50;
13 state: "default" 0.0;
14 rel1.relative: 0.0 0.0;
15 rel2.relative: 1.0 1.0;
16 }
17 }
18 }
19
20 }
21}
diff --git a/libraries/edje/src/examples/table.edc b/libraries/edje/src/examples/table.edc
new file mode 100644
index 0000000..5453705
--- /dev/null
+++ b/libraries/edje/src/examples/table.edc
@@ -0,0 +1,19 @@
1collections {
2 group {
3 name: "example_table";
4 min: 50 50;
5
6 parts {
7 part {
8 name: "table_part";
9 type: TABLE;
10 description {
11 min: 50 50;
12 state: "default" 0.0;
13 rel1.relative: 0.0 0.0;
14 rel2.relative: 1.0 1.0;
15 }
16 }
17 }
18 }
19}
diff --git a/libraries/edje/src/examples/test.png b/libraries/edje/src/examples/test.png
new file mode 100644
index 0000000..fb620d7
--- /dev/null
+++ b/libraries/edje/src/examples/test.png
Binary files differ
diff --git a/libraries/edje/src/examples/text.edc b/libraries/edje/src/examples/text.edc
new file mode 100644
index 0000000..257a078
--- /dev/null
+++ b/libraries/edje/src/examples/text.edc
@@ -0,0 +1,68 @@
1collections {
2 group {
3 name: "sel_group";
4 parts {
5 part {
6 name: "rect";
7 type: RECT;
8 description {
9 state: "default" 0.0;
10 color: 0 255 0 255; /* green */
11 rel1.relative: 0.0 0.0;
12 rel2.relative: 1.0 1.0;
13 }
14 }
15 }
16 }
17 group {
18 name: "example_group";
19 max: 500 500;
20 min: 50 50;
21
22 styles {
23 style {
24 name: "textblock_style";
25 base: "font=Sans font_size=22 color=#600 wrap=word";
26 tag: "br" "\n";
27 tag: "hilight" "+ font_weight=Bold";
28 tag: "b" "+ font_weight=Bold";
29 tag: "tab" "\t";
30 }
31 }
32 parts {
33 part {
34 name: "part_one";
35 type: TEXT;
36 description {
37 min: 50 50;
38 state: "default" 0.0;
39 color: 0 0 255 255; /* blue */
40 rel1.relative: 0.0 0.0;
41 rel2.relative: 1.0 0.5;
42 text {
43 font: "arial";
44 size: 22;
45 min: 1 1;
46 }
47 }
48 }
49 part {
50 name: "part_two";
51 type: TEXTBLOCK;
52 select_mode: EXPLICIT;
53 source: "sel_group";
54 entry_mode: PLAIN;
55 description {
56 min: 50 50;
57 state: "default" 0.0;
58 rel1.relative: 0.0 0.5;
59 rel2.relative: 1.0 1.0;
60 text {
61 style: "textblock_style";
62 min: 1 1;
63 }
64 }
65 }
66 }
67 }
68}