summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 02:08:14 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 02:08:14 +0000
commit9ea2ce1041549c90f94062ce5ec145056e7fbdfa (patch)
tree3bcd3fb016bc498a72ff99c8d67c8b7ef2d91718 /src
parente2ce20e9a4dfd12bb383a1b60032f2ef7b507850 (diff)
efl: merge edje.
this is still in progress, mostly the multisense stuff is pending. it seems that when we merge ecore_audio in edje the libremix and similar are gone, at least from Edje, and will be in ecore_audio itself (or pulseaudio). Changes: * __UNUSED__ to EINA_UNUSED * binaries (epp, embryo_cc, edje_cc) now consider EFL_RUN_IN_TREE and will assume the binaries are still not installed, running from build tree location (needs more testing, maybe doesn't work with srcdir != builddir, still doesn't solve cross compile builds) SVN revision: 82139
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am6
-rw-r--r--src/Makefile_Edje.am255
-rw-r--r--src/Makefile_Embryo.am1
-rw-r--r--src/bin/edje/edje_cc.c340
-rw-r--r--src/bin/edje/edje_cc.h243
-rw-r--r--src/bin/edje/edje_cc_handlers.c9386
-rw-r--r--src/bin/edje/edje_cc_mem.c34
-rw-r--r--src/bin/edje/edje_cc_out.c2650
-rw-r--r--src/bin/edje/edje_cc_parse.c1641
-rw-r--r--src/bin/edje/edje_cc_sources.c252
-rw-r--r--src/bin/edje/edje_codegen.c1229
-rw-r--r--src/bin/edje/edje_convert.c459
-rw-r--r--src/bin/edje/edje_convert.h154
-rw-r--r--src/bin/edje/edje_convert_main.c205
-rw-r--r--src/bin/edje/edje_data_convert.c451
-rw-r--r--src/bin/edje/edje_decc.c558
-rw-r--r--src/bin/edje/edje_decc.h57
-rw-r--r--src/bin/edje/edje_external_inspector.c663
-rw-r--r--src/bin/edje/edje_inspector.c1637
-rw-r--r--src/bin/edje/edje_multisense_convert.c329
-rw-r--r--src/bin/edje/edje_multisense_convert.h25
-rw-r--r--src/bin/edje/edje_pick.c1376
-rw-r--r--src/bin/edje/edje_player.c1121
-rw-r--r--src/bin/edje/edje_recc69
-rw-r--r--src/bin/edje/edje_watch.c154
-rw-r--r--src/bin/edje/epp/cppalloc.c70
-rw-r--r--src/bin/edje/epp/cpperror.c148
-rw-r--r--src/bin/edje/epp/cppexp.c1092
-rw-r--r--src/bin/edje/epp/cpphash.c199
-rw-r--r--src/bin/edje/epp/cpphash.h41
-rw-r--r--src/bin/edje/epp/cpplib.c7462
-rw-r--r--src/bin/edje/epp/cpplib.h646
-rw-r--r--src/bin/edje/epp/cppmain.c147
-rw-r--r--src/bin/embryo/embryo_cc_sc1.c14
-rw-r--r--src/examples/Makefile.am4
-rw-r--r--src/examples/edje/Makefile.am198
-rw-r--r--src/examples/edje/Vera.ttfbin0 -> 65932 bytes
-rw-r--r--src/examples/edje/animations.edc93
-rw-r--r--src/examples/edje/animations2.c96
-rw-r--r--src/examples/edje/animations2.edc48
-rw-r--r--src/examples/edje/basic.edc39
-rw-r--r--src/examples/edje/basic2.edc24
-rw-r--r--src/examples/edje/box.edc142
-rw-r--r--src/examples/edje/bubble-blue.pngbin0 -> 4505 bytes
-rw-r--r--src/examples/edje/bubble.pngbin0 -> 4737 bytes
-rw-r--r--src/examples/edje/codegen.edc84
-rw-r--r--src/examples/edje/color-class.edc87
-rw-r--r--src/examples/edje/drag.edc89
-rw-r--r--src/examples/edje/duck.wavbin0 -> 22982 bytes
-rw-r--r--src/examples/edje/edje-animations.c227
-rw-r--r--src/examples/edje/edje-basic.c257
-rw-r--r--src/examples/edje/edje-basic2.c171
-rw-r--r--src/examples/edje/edje-box.c252
-rw-r--r--src/examples/edje/edje-box2.c247
-rw-r--r--src/examples/edje/edje-codegen-example.c202
-rw-r--r--src/examples/edje/edje-color-class.c295
-rw-r--r--src/examples/edje/edje-drag.c210
-rw-r--r--src/examples/edje/edje-multisense.c80
-rw-r--r--src/examples/edje/edje-nested.edc39
-rw-r--r--src/examples/edje/edje-perspective.c253
-rw-r--r--src/examples/edje/edje-signals-messages.c254
-rw-r--r--src/examples/edje/edje-swallow.c130
-rw-r--r--src/examples/edje/edje-swallow2.c135
-rw-r--r--src/examples/edje/edje-table.c210
-rw-r--r--src/examples/edje/edje-text.c121
-rw-r--r--src/examples/edje/edje_example.c81
-rw-r--r--src/examples/edje/edje_example.edc101
-rw-r--r--src/examples/edje/embryo_custom_state.edc184
-rw-r--r--src/examples/edje/embryo_pong.edc270
-rw-r--r--src/examples/edje/embryo_run_program.edc66
-rw-r--r--src/examples/edje/embryo_set_state.edc46
-rw-r--r--src/examples/edje/embryo_set_text.edc39
-rw-r--r--src/examples/edje/embryo_timer.edc90
-rw-r--r--src/examples/edje/external_elm_anchorblock.edc160
-rw-r--r--src/examples/edje/external_elm_button.edc270
-rw-r--r--src/examples/edje/external_elm_check.edc211
-rw-r--r--src/examples/edje/external_elm_panes.edc140
-rw-r--r--src/examples/edje/external_emotion_elm.edc239
-rw-r--r--src/examples/edje/lua_script.edc417
-rw-r--r--src/examples/edje/messages_echo.edc97
-rw-r--r--src/examples/edje/multisense.edc91
-rw-r--r--src/examples/edje/perspective.edc140
-rw-r--r--src/examples/edje/physics_3d.edc271
-rw-r--r--src/examples/edje/physics_actions.edc573
-rw-r--r--src/examples/edje/physics_backcull.edc228
-rw-r--r--src/examples/edje/physics_basic.edc86
-rw-r--r--src/examples/edje/physics_complex.edc142
-rw-r--r--src/examples/edje/physics_soft_bodies.edc197
-rw-r--r--src/examples/edje/red.pngbin0 -> 225 bytes
-rw-r--r--src/examples/edje/signals-messages.edc174
-rw-r--r--src/examples/edje/signals2.c134
-rw-r--r--src/examples/edje/signalsBubble.edc22
-rw-r--r--src/examples/edje/sigtest.c341
-rw-r--r--src/examples/edje/sigtest.edc303
-rw-r--r--src/examples/edje/swallow.edc21
-rw-r--r--src/examples/edje/table.edc19
-rw-r--r--src/examples/edje/test.pngbin0 -> 22869 bytes
-rw-r--r--src/examples/edje/text.edc68
-rw-r--r--src/examples/edje/toggle_using_filter.edc66
-rw-r--r--src/lib/edje/Edje.h6711
-rw-r--r--src/lib/edje/Edje_Edit.h3539
-rw-r--r--src/lib/edje/edje_box_layout.c251
-rw-r--r--src/lib/edje/edje_cache.c671
-rw-r--r--src/lib/edje/edje_calc.c3498
-rw-r--r--src/lib/edje/edje_callbacks.c499
-rw-r--r--src/lib/edje/edje_container.c955
-rw-r--r--src/lib/edje/edje_container.h165
-rw-r--r--src/lib/edje/edje_convert.c499
-rw-r--r--src/lib/edje/edje_convert.h143
-rw-r--r--src/lib/edje/edje_data.c1022
-rw-r--r--src/lib/edje/edje_edit.c7830
-rw-r--r--src/lib/edje/edje_embryo.c3764
-rw-r--r--src/lib/edje/edje_entry.c3908
-rw-r--r--src/lib/edje/edje_external.c640
-rw-r--r--src/lib/edje/edje_load.c1915
-rw-r--r--src/lib/edje/edje_lua.c5150
-rw-r--r--src/lib/edje/edje_lua2.c4385
-rw-r--r--src/lib/edje/edje_lua_script_only.c59
-rw-r--r--src/lib/edje/edje_main.c295
-rw-r--r--src/lib/edje/edje_match.c829
-rw-r--r--src/lib/edje/edje_message_queue.c890
-rw-r--r--src/lib/edje/edje_misc.c1
-rw-r--r--src/lib/edje/edje_module.c154
-rw-r--r--src/lib/edje/edje_multisense.c422
-rw-r--r--src/lib/edje/edje_private.h2490
-rw-r--r--src/lib/edje/edje_program.c2335
-rw-r--r--src/lib/edje/edje_script_only.c643
-rw-r--r--src/lib/edje/edje_smart.c623
-rw-r--r--src/lib/edje/edje_text.c619
-rw-r--r--src/lib/edje/edje_textblock_styles.c424
-rw-r--r--src/lib/edje/edje_util.c6659
-rw-r--r--src/lib/edje/edje_var.c1093
-rw-r--r--src/modules/edje/alsa_snd_player/alsa_snd_player.c405
-rw-r--r--src/modules/edje/eet_snd_reader/eet_snd_reader.c498
-rw-r--r--src/modules/edje/multisense_factory/multisense_factory.c33
-rw-r--r--src/tests/edje/edje_suite.c101
-rw-r--r--src/tests/edje/edje_suite.h9
-rw-r--r--src/tests/edje/edje_test_edje.c28
138 files changed, 106541 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index e409af2ce4..20656081fc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -67,6 +67,7 @@ endif
67if HAVE_EPHYSICS 67if HAVE_EPHYSICS
68include Makefile_EPhysics.am 68include Makefile_EPhysics.am
69endif 69endif
70include Makefile_Edje.am
70 71
71.PHONY: benchmark examples 72.PHONY: benchmark examples
72 73
@@ -85,6 +86,7 @@ clean-local:
85 rm -rf bin/eet/*.gcno 86 rm -rf bin/eet/*.gcno
86 rm -rf bin/efreet/*.gcno 87 rm -rf bin/efreet/*.gcno
87 rm -rf bin/eeze/*.gcno 88 rm -rf bin/eeze/*.gcno
89 rm -rf bin/edje/*.gcno
88 rm -rf lib/evil/*.gcno 90 rm -rf lib/evil/*.gcno
89 rm -rf lib/eina/*.gcno 91 rm -rf lib/eina/*.gcno
90 rm -rf lib/eo/*.gcno 92 rm -rf lib/eo/*.gcno
@@ -103,6 +105,7 @@ clean-local:
103 rm -rf lib/efreet/*.gcno 105 rm -rf lib/efreet/*.gcno
104 rm -rf lib/eeze/*.gcno 106 rm -rf lib/eeze/*.gcno
105 rm -rf lib/ephysics/*.gcno 107 rm -rf lib/ephysics/*.gcno
108 rm -rf lib/edje/*.gcno
106 rm -rf modules/eina/mp/pass_through/*.gcno 109 rm -rf modules/eina/mp/pass_through/*.gcno
107 rm -rf modules/eina/mp/one_big/*.gcno 110 rm -rf modules/eina/mp/one_big/*.gcno
108 rm -rf modules/eina/mp/chained_pool/*.gcno 111 rm -rf modules/eina/mp/chained_pool/*.gcno
@@ -139,5 +142,8 @@ clean-local:
139 rm -rf modules/evas/savers/jpeg/*.gcno 142 rm -rf modules/evas/savers/jpeg/*.gcno
140 rm -rf modules/evas/savers/png/*.gcno 143 rm -rf modules/evas/savers/png/*.gcno
141 rm -rf modules/evas/savers/tiff/*.gcno 144 rm -rf modules/evas/savers/tiff/*.gcno
145 rm -rf modules/edje/alsa_snd_player/*.gcno
146 rm -rf modules/edje/eet_snd_reader/*.gcno
147 rm -rf modules/edje/multisense_factory/*.gcno
142 rm -rf static_libs/liblinebreak/*.gcno 148 rm -rf static_libs/liblinebreak/*.gcno
143 rm -rf static_libs/lz4/*.gcno 149 rm -rf static_libs/lz4/*.gcno
diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am
new file mode 100644
index 0000000000..952554d68f
--- /dev/null
+++ b/src/Makefile_Edje.am
@@ -0,0 +1,255 @@
1
2### Library
3
4lib_LTLIBRARIES += lib/edje/libedje.la
5
6EDJE_COMMON_CPPFLAGS = \
7-I$(top_srcdir) \
8-I$(top_srcdir)/src/lib/eina \
9-I$(top_builddir)/src/lib/eina \
10-I$(top_srcdir)/src/lib/eo \
11-I$(top_builddir)/src/lib/eo \
12-I$(top_srcdir)/src/lib/eet \
13-I$(top_builddir)/src/lib/eet \
14-I$(top_srcdir)/src/lib/evas \
15-I$(top_builddir)/src/lib/evas \
16-I$(top_srcdir)/src/lib/ecore \
17-I$(top_builddir)/src/lib/ecore \
18-I$(top_srcdir)/src/lib/ecore_evas \
19-I$(top_builddir)/src/lib/ecore_evas \
20-I$(top_srcdir)/src/lib/ecore_file \
21-I$(top_builddir)/src/lib/ecore_file \
22-I$(top_srcdir)/src/lib/ecore_input \
23-I$(top_builddir)/src/lib/ecore_input \
24-I$(top_srcdir)/src/lib/ecore_imf \
25-I$(top_builddir)/src/lib/ecore_imf \
26-I$(top_srcdir)/src/lib/embryo \
27-I$(top_builddir)/src/lib/embryo \
28-I$(top_srcdir)/src/lib/eio \
29-I$(top_builddir)/src/lib/eio \
30-I$(top_srcdir)/src/lib/ephysics \
31-I$(top_builddir)/src/lib/ephysics \
32-I$(top_srcdir)/src/lib/edje \
33-I$(top_builddir)/src/lib/edje \
34-DPACKAGE_BIN_DIR=\"$(bindir)\" \
35-DPACKAGE_LIB_DIR=\"$(libdir)\" \
36-DPACKAGE_DATA_DIR=\"$(datadir)/edje\" \
37-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
38-DEFL_EDJE_BUILD \
39@EFL_COV_CFLAGS@ \
40@EDJE_CFLAGS@ \
41@USE_EVIL_CFLAGS@
42
43EDJE_COMMON_LIBS = \
44lib/eina/libeina.la \
45lib/eo/libeo.la \
46lib/eet/libeet.la \
47lib/evas/libevas.la \
48lib/ecore/libecore.la \
49lib/ecore_evas/libecore_evas.la \
50lib/ecore_file/libecore_file.la \
51lib/ecore_input/libecore_input.la \
52lib/ecore_imf/libecore_imf.la \
53lib/ecore_imf/libecore_imf_evas.la \
54lib/embryo/libembryo.la \
55lib/eio/libeio.la \
56@USE_EVIL_LIBS@ \
57@EFL_COV_LIBS@
58
59if HAVE_EPHYSICS
60EDJE_COMMON_LIBS += lib/ephysics/libephysics.la
61endif
62
63installed_edjemainheadersdir = $(includedir)/edje-@VMAJ@
64dist_installed_edjemainheaders_DATA = \
65lib/edje/Edje.h \
66lib/edje/Edje_Edit.h
67
68lib_edje_libedje_la_SOURCES = \
69lib/edje/edje_private.h \
70lib/edje/edje_container.h \
71lib/edje/edje_convert.h \
72lib/edje/edje_box_layout.c \
73lib/edje/edje_cache.c \
74lib/edje/edje_calc.c \
75lib/edje/edje_callbacks.c \
76lib/edje/edje_container.c \
77lib/edje/edje_data.c \
78lib/edje/edje_edit.c \
79lib/edje/edje_embryo.c \
80lib/edje/edje_entry.c \
81lib/edje/edje_external.c \
82lib/edje/edje_load.c \
83lib/edje/edje_lua.c \
84lib/edje/edje_lua2.c \
85lib/edje/edje_lua_script_only.c \
86lib/edje/edje_main.c \
87lib/edje/edje_match.c \
88lib/edje/edje_message_queue.c \
89lib/edje/edje_misc.c \
90lib/edje/edje_module.c \
91lib/edje/edje_multisense.c \
92lib/edje/edje_program.c \
93lib/edje/edje_script_only.c \
94lib/edje/edje_smart.c \
95lib/edje/edje_text.c \
96lib/edje/edje_textblock_styles.c \
97lib/edje/edje_util.c \
98lib/edje/edje_var.c
99
100lib_edje_libedje_la_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
101lib_edje_libedje_la_LIBADD = $(EDJE_COMMON_LIBS) @EDJE_LIBS@
102lib_edje_libedje_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
103
104if ENABLE_MULTISENSE
105# edjemoduleXXXdir = $(libdir)/edje/modules/
106# edjemoduleXXX_LTLIBRARIES = modules/edje/XXX/module.la
107#
108# modules_edje_XXX_module_la_SOURCES = modules/edje/XXX/XXX.c
109# modules_edje_XXX_module_la_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS) @XXX_LIBS@
110# modules_edje_XXX_module_la_LIBADD = $(EDJE_COMMON_USER_LIBADD)
111# modules_edje_XXX_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
112# modules_edje_XXX_module_la_LIBTOOLFLAGS = --tag=disable-static
113
114# edjemodulemultisensefactorydir = $(libdir)/edje/modules/multisense_factory/$(MODULE_ARCH)
115# edjemodulemultisensefactory_LTLIBRARIES = modules/edje/multisense_factory/module.la
116#
117# modules_edje_multisense_factory_module_la_SOURCES = \
118# modules/edje/multisense_factory/multisense_factory.c
119# modules_edje_multisense_factory_module_la_CPPFLAGS = \
120# $(EDJE_COMMON_CPPFLAGS) \
121# @REMIX_CFLAGS@
122# modules_edje_multisense_factory_module_la_LIBADD = \
123# $(EDJE_COMMON_USER_LIBADD) \
124# @REMIX_LIBS@
125# modules_edje_multisense_factory_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
126# modules_edje_multisense_factory_module_la_LIBTOOLFLAGS = --tag=disable-static
127
128endif
129
130### Binary
131
132EDJE_COMMON_USER_LDADD = \
133$(EDJE_COMMON_LIBS) \
134lib/edje/libedje.la \
135@EDJE_LDFLAGS@
136
137bin_PROGRAMS += \
138bin/edje/edje_cc \
139bin/edje/edje_decc \
140bin/edje/edje_player \
141bin/edje/edje_inspector \
142bin/edje/edje_external_inspector \
143bin/edje/edje_codegen \
144bin/edje/edje_pick \
145bin/edje/edje_watch
146
147bin_edje_edje_cc_SOURCES = \
148bin/edje/edje_multisense_convert.h \
149bin/edje/edje_cc.h \
150bin/edje/edje_cc.c \
151bin/edje/edje_cc_out.c \
152bin/edje/edje_cc_parse.c \
153bin/edje/edje_cc_mem.c \
154bin/edje/edje_cc_handlers.c \
155bin/edje/edje_cc_sources.c \
156bin/edje/edje_multisense_convert.c
157bin_edje_edje_cc_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
158bin_edje_edje_cc_LDADD = $(EDJE_COMMON_USER_LDADD)
159
160bin_edje_edje_decc_SOURCES = \
161bin/edje/edje_decc.c \
162bin/edje/edje_decc.h \
163bin/edje/edje_cc_mem.c \
164bin/edje/edje_cc_sources.c
165bin_edje_edje_decc_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
166bin_edje_edje_decc_LDADD = $(EDJE_COMMON_USER_LDADD)
167
168bin_edje_edje_player_SOURCES = bin/edje/edje_player.c
169bin_edje_edje_player_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
170bin_edje_edje_player_LDADD = $(EDJE_COMMON_USER_LDADD)
171
172bin_edje_edje_inspector_SOURCES = bin/edje/edje_inspector.c
173bin_edje_edje_inspector_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
174bin_edje_edje_inspector_LDADD = $(EDJE_COMMON_USER_LDADD)
175
176bin_edje_edje_external_inspector_SOURCES = bin/edje/edje_external_inspector.c
177bin_edje_edje_external_inspector_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
178bin_edje_edje_external_inspector_LDADD = $(EDJE_COMMON_USER_LDADD)
179
180bin_edje_edje_codegen_SOURCES = bin/edje/edje_codegen.c
181bin_edje_edje_codegen_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
182bin_edje_edje_codegen_LDADD = $(EDJE_COMMON_USER_LDADD)
183
184bin_edje_edje_pick_SOURCES = bin/edje/edje_pick.c
185bin_edje_edje_pick_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
186bin_edje_edje_pick_LDADD = $(EDJE_COMMON_USER_LDADD)
187
188bin_edje_edje_watch_SOURCES = bin/edje/edje_watch.c
189bin_edje_edje_watch_CPPFLAGS = $(EDJE_COMMON_CPPFLAGS)
190bin_edje_edje_watch_LDADD = $(EDJE_COMMON_USER_LDADD)
191
192# EPP (Edje's CPP)
193eppdir = $(libdir)/edje/utils
194epp_PROGRAMS = bin/edje/epp/epp
195bin_edje_epp_epp_SOURCES = \
196bin/edje/epp/cpplib.h \
197bin/edje/epp/cpphash.h \
198bin/edje/epp/cppalloc.c \
199bin/edje/epp/cpperror.c \
200bin/edje/epp/cppexp.c \
201bin/edje/epp/cpphash.c \
202bin/edje/epp/cpplib.c \
203bin/edje/epp/cppmain.c
204
205# Note: eina is included only because of EINA_UNUSED
206bin_edje_epp_epp_CPPFLAGS = \
207-I$(top_builddir) \
208-I$(top_srcdir)/src/lib/eina \
209-I$(top_builddir)/src/lib/eina \
210$(CWARNFLAGS) \
211-DHAVE_CONFIG_H \
212-DHAVE_STRERROR \
213-DFATAL_EXIT_CODE=1 \
214-DSUCCESS_EXIT_CODE=0 \
215-DGCC_INCLUDE_DIR=\"/usr/include\" \
216-DGPLUSPLUS_INCLUDE_DIR=\"/usr/include\" \
217-DTOOL_INCLUDE_DIR=\"/usr/bin\" \
218-DHOST_BITS_PER_LONG=32 \
219-DBITS_PER_UNIT=8 \
220-DHOST_BITS_PER_INT=32 \
221-DBITS_PER_WORD=16 \
222-DTARGET_BELL=7 \
223-DTARGET_BS=8 \
224-DTARGET_FF=12 \
225-DTARGET_NEWLINE=10 \
226-DTARGET_CR=13 \
227-DTARGET_TAB=9 \
228-DTARGET_VT=11
229
230# TODO: why keep these?
231EXTRA_DIST += \
232bin/edje/edje_convert.h \
233bin/edje/edje_convert.c \
234bin/edje/edje_data_convert.c
235
236### Unit tests
237
238if EFL_ENABLE_TESTS
239
240check_PROGRAMS += tests/edje/edje_suite
241
242tests_edje_edje_suite_SOURCES = \
243tests/edje/edje_suite.c \
244tests/edje/edje_test_edje.c \
245tests/edje/edje_suite.h
246
247tests_edje_edje_suite_CPPFLAGS = \
248$(EDJE_COMMON_CPPFLAGS) \
249@CHECK_CFLAGS@
250
251tests_edje_edje_suite_LDADD = \
252$(EDJE_COMMON_USER_LDADD) \
253@CHECK_LIBS@
254
255endif
diff --git a/src/Makefile_Embryo.am b/src/Makefile_Embryo.am
index f5bb307ea9..77c0123cc3 100644
--- a/src/Makefile_Embryo.am
+++ b/src/Makefile_Embryo.am
@@ -60,6 +60,7 @@ bin_embryo_embryo_cc_CPPFLAGS = \
60-DPACKAGE_BIN_DIR=\"$(bindir)\" \ 60-DPACKAGE_BIN_DIR=\"$(bindir)\" \
61-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 61-DPACKAGE_LIB_DIR=\"$(libdir)\" \
62-DPACKAGE_DATA_DIR=\"$(datadir)/embryo\" \ 62-DPACKAGE_DATA_DIR=\"$(datadir)/embryo\" \
63-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
63@EMBRYO_CFLAGS@ \ 64@EMBRYO_CFLAGS@ \
64@USE_EVIL_CFLAGS@ 65@USE_EVIL_CFLAGS@
65 66
diff --git a/src/bin/edje/edje_cc.c b/src/bin/edje/edje_cc.c
new file mode 100644
index 0000000000..6d898905c9
--- /dev/null
+++ b/src/bin/edje/edje_cc.c
@@ -0,0 +1,340 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <string.h>
6#include <locale.h>
7#include <limits.h>
8#include <sys/stat.h>
9
10#include "edje_cc.h"
11int _edje_cc_log_dom = -1;
12static void main_help(void);
13
14Eina_Prefix *pfx = NULL;
15Eina_List *snd_dirs = NULL;
16Eina_List *img_dirs = NULL;
17Eina_List *fnt_dirs = NULL;
18Eina_List *defines = NULL;
19char *file_in = NULL;
20char *tmp_dir = NULL;
21char *file_out = NULL;
22char *watchfile = NULL;
23
24static const char *progname = NULL;
25
26int no_lossy = 0;
27int no_comp = 0;
28int no_raw = 0;
29int no_save = 0;
30int min_quality = 0;
31int max_quality = 100;
32int compress_mode = EET_COMPRESSION_HI;
33int threads = 0;
34int anotate = 0;
35
36static void
37_edje_cc_log_cb(const Eina_Log_Domain *d,
38 Eina_Log_Level level,
39 const char *file,
40 const char *fnc,
41 int fline,
42 const char *fmt,
43 EINA_UNUSED void *data,
44 va_list args)
45{
46 if ((d->name) && (d->namelen == sizeof("edje_cc") - 1) &&
47 (memcmp(d->name, "edje_cc", sizeof("edje_cc") - 1) == 0))
48 {
49 const char *prefix;
50
51 eina_log_console_color_set(stderr, eina_log_level_color_get(level));
52 switch (level)
53 {
54 case EINA_LOG_LEVEL_CRITICAL:
55 prefix = "Critical. ";
56 break;
57 case EINA_LOG_LEVEL_ERR:
58 prefix = "Error. ";
59 break;
60 case EINA_LOG_LEVEL_WARN:
61 prefix = "Warning. ";
62 break;
63 default:
64 prefix = "";
65 }
66 fprintf(stderr, "%s: %s", progname, prefix);
67 eina_log_console_color_set(stderr, EINA_COLOR_RESET);
68
69 vfprintf(stderr, fmt, args);
70 putc('\n', stderr);
71 }
72 else
73 eina_log_print_cb_stderr(d, level, file, fnc, fline, fmt, NULL, args);
74}
75
76static void
77main_help(void)
78{
79 printf
80 ("Usage:\n"
81 "\t%s [OPTIONS] input_file.edc [output_file.edj]\n"
82 "\n"
83 "Where OPTIONS is one or more of:\n"
84 "\n"
85 "-w files.txt Dump all sources files path into files.txt\n"
86 "-anotate Anotate the dumped files.\n"
87 "-id image/directory Add a directory to look in for relative path images\n"
88 "-fd font/directory Add a directory to look in for relative path fonts\n"
89 "-sd sound/directory Add a directory to look in for relative path sounds samples\n"
90 "-td temp/directory Directory to store temporary files\n"
91 "-v Verbose output\n"
92 "-no-lossy Do NOT allow images to be lossy\n"
93 "-no-comp Do NOT allow images to be stored with lossless compression\n"
94 "-no-raw Do NOT allow images to be stored with zero compression (raw)\n"
95 "-no-save Do NOT store the input EDC file in the EDJ file\n"
96 "-min-quality VAL Do NOT allow lossy images with quality < VAL (0-100)\n"
97 "-max-quality VAL Do NOT allow lossy images with quality > VAL (0-100)\n"
98 "-Ddefine_val=to CPP style define to define input macro definitions to the .edc source\n"
99 "-fastcomp Use a faster compression algorithm (LZ4) (mutually exclusive with -fastdecomp)\n"
100 "-fastdecomp Use a faster decompression algorithm (LZ4HC) (mutually exclusive with -fastcomp)\n"
101 "-threads Compile the edje file using multiple parallel threads (by default)\n"
102 "-nothreads Compile the edje file using only the main loop\n"
103 ,progname);
104}
105
106int
107main(int argc, char **argv)
108{
109 int i;
110 struct stat st;
111 char rpath[PATH_MAX], rpath2[PATH_MAX];
112
113 setlocale(LC_NUMERIC, "C");
114
115 if (!eina_init())
116 return -1;
117
118 _edje_cc_log_dom = eina_log_domain_register
119 ("edje_cc", EDJE_CC_DEFAULT_LOG_COLOR);
120 if (_edje_cc_log_dom < 0)
121 {
122 EINA_LOG_ERR("Enable to create a log domain.");
123 exit(-1);
124 }
125 if (!eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_WARN))
126 eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_WARN);
127
128 progname = ecore_file_file_get(argv[0]);
129 eina_log_print_cb_set(_edje_cc_log_cb, NULL);
130
131 tmp_dir = getenv("TMPDIR");
132
133 img_dirs = eina_list_append(img_dirs, ".");
134
135 /* add defines to epp so edc files can detect edje_cc version */
136 defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12"));
137
138 for (i = 1; i < argc; i++)
139 {
140 if (!strcmp(argv[i], "-h"))
141 {
142 main_help();
143 exit(0);
144 }
145 else if (!strcmp(argv[i], "-v"))
146 {
147 eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_INFO);
148 }
149 else if (!strcmp(argv[i], "-no-lossy"))
150 {
151 no_lossy = 1;
152 }
153 else if (!strcmp(argv[i], "-no-comp"))
154 {
155 no_comp = 1;
156 }
157 else if (!strcmp(argv[i], "-no-raw"))
158 {
159 no_raw = 1;
160 }
161 else if (!strcmp(argv[i], "-no-save"))
162 {
163 no_save = 1;
164 }
165 else if ((!strcmp(argv[i], "-id") || !strcmp(argv[i], "--image_dir")) && (i < (argc - 1)))
166 {
167 i++;
168 img_dirs = eina_list_append(img_dirs, argv[i]);
169 }
170 else if ((!strcmp(argv[i], "-fd") || !strcmp(argv[i], "--font_dir")) && (i < (argc - 1)))
171 {
172 i++;
173 fnt_dirs = eina_list_append(fnt_dirs, argv[i]);
174 }
175 else if ((!strcmp(argv[i], "-sd") || !strcmp(argv[i], "--sound_dir")) && (i < (argc - 1)))
176 {
177 i++;
178 snd_dirs = eina_list_append(snd_dirs, argv[i]);
179 }
180 else if ((!strcmp(argv[i], "-td") || !strcmp(argv[i], "--tmp_dir")) && (i < (argc - 1)))
181 {
182 i++;
183 if (!tmp_dir)
184 tmp_dir = argv[i];
185 }
186 else if ((!strcmp(argv[i], "-min-quality")) && (i < (argc - 1)))
187 {
188 i++;
189 min_quality = atoi(argv[i]);
190 if (min_quality < 0) min_quality = 0;
191 if (min_quality > 100) min_quality = 100;
192 }
193 else if ((!strcmp(argv[i], "-max-quality")) && (i < (argc - 1)))
194 {
195 i++;
196 max_quality = atoi(argv[i]);
197 if (max_quality < 0) max_quality = 0;
198 if (max_quality > 100) max_quality = 100;
199 }
200 else if (!strcmp(argv[i], "-fastcomp"))
201 {
202 compress_mode = EET_COMPRESSION_SUPERFAST;
203 }
204 else if (!strcmp(argv[i], "-fastdecomp"))
205 {
206 compress_mode = EET_COMPRESSION_VERYFAST;
207 }
208 else if (!strcmp(argv[i], "-threads"))
209 {
210 threads = 1;
211 }
212 else if (!strcmp(argv[i], "-nothreads"))
213 {
214 threads = 0;
215 }
216 else if (!strncmp(argv[i], "-D", 2))
217 {
218 defines = eina_list_append(defines, mem_strdup(argv[i]));
219 }
220 else if ((!strcmp(argv[i], "-o")) && (i < (argc - 1)))
221 {
222 i++;
223 file_out = argv[i];
224 }
225 else if ((!strcmp(argv[i], "-w")) && (i < (argc - 1)))
226 {
227 i++;
228 watchfile = argv[i];
229 unlink(watchfile);
230 }
231 else if (!strcmp(argv[i], "-anotate"))
232 {
233 anotate = 1;
234 }
235 else if (!file_in)
236 file_in = argv[i];
237 else if (!file_out)
238 file_out = argv[i];
239 }
240
241 if (!file_in)
242 {
243 ERR("no input file specified.");
244 main_help();
245 exit(-1);
246 }
247
248
249
250 pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */
251 main, /* an optional symbol to check path of */
252 "EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
253 "edje", /* dir to add after "share" (PREFIX/share/DIRNAME) */
254 "include/edje.inc", /* a magic file to check for in PREFIX/share/DIRNAME for success */
255 PACKAGE_BIN_DIR, /* package bin dir @ compile time */
256 PACKAGE_LIB_DIR, /* package lib dir @ compile time */
257 PACKAGE_DATA_DIR, /* package data dir @ compile time */
258 PACKAGE_DATA_DIR /* if locale needed use LOCALE_DIR */
259 );
260
261 /* check whether file_in exists */
262#ifdef HAVE_REALPATH
263 if (!realpath(file_in, rpath) || stat(rpath, &st) || !S_ISREG(st.st_mode))
264#else
265 if (stat(file_in, &st) || !S_ISREG(st.st_mode))
266#endif
267 {
268 ERR("file not found: %s.", file_in);
269 main_help();
270 exit(-1);
271 }
272
273 if (!file_out)
274 {
275 char *suffix;
276
277 if ((suffix = strstr(file_in,".edc")) && (suffix[4] == 0))
278 {
279 file_out = strdup(file_in);
280 if (file_out)
281 {
282 suffix = strstr(file_out,".edc");
283 strcpy(suffix,".edj");
284 }
285 }
286 }
287 if (!file_out)
288 {
289 ERR("no output file specified.");
290 main_help();
291 exit(-1);
292 }
293
294#ifdef HAVE_REALPATH
295 if (realpath(file_out, rpath2) && !strcmp (rpath, rpath2))
296#else
297 if (!strcmp (file_in, file_out))
298#endif
299 {
300 ERR("input file equals output file.");
301 main_help();
302 exit(-1);
303 }
304
305 using_file(file_in, 'E');
306 if (anotate) using_file(file_out, 'O');
307
308 if (!edje_init())
309 exit(-1);
310
311 edje_file = mem_alloc(SZ(Edje_File));
312 edje_file->compiler = strdup("edje_cc");
313 edje_file->version = EDJE_FILE_VERSION;
314 edje_file->minor = EDJE_FILE_MINOR;
315 edje_file->feature_ver = 1; /* increment this every time we add a field
316 * or feature to the edje file format that
317 * does not load nicely as a NULL or 0 value
318 * and needs a special fallback initialization
319 */
320
321 source_edd();
322 source_fetch();
323
324 data_setup();
325 compile();
326 reorder_parts();
327 data_process_scripts();
328 data_process_lookups();
329 data_process_script_lookups();
330 data_write();
331
332 eina_prefix_free(pfx);
333 pfx = NULL;
334
335 edje_shutdown();
336 eina_log_domain_unregister(_edje_cc_log_dom);
337 eina_shutdown();
338
339 return 0;
340}
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
new file mode 100644
index 0000000000..49c0bc4649
--- /dev/null
+++ b/src/bin/edje/edje_cc.h
@@ -0,0 +1,243 @@
1#ifndef EDJE_CC_H
2#define EDJE_CC_H
3
4#include <edje_private.h>
5
6extern Eina_Prefix *pfx;
7
8/*
9 * On Windows, if the file is not opened in binary mode,
10 * read does not return the correct size, because of
11 * CR / LF translation.
12 */
13#ifndef O_BINARY
14# define O_BINARY 0
15#endif
16
17/* logging variables */
18extern int _edje_cc_log_dom ;
19#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
20
21#ifdef ERR
22# undef ERR
23#endif
24#define ERR(...) EINA_LOG_DOM_ERR(_edje_cc_log_dom, __VA_ARGS__)
25#ifdef INF
26# undef INF
27#endif
28#define INF(...) EINA_LOG_DOM_INFO(_edje_cc_log_dom, __VA_ARGS__)
29#ifdef WRN
30# undef WRN
31#endif
32#define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
33#ifdef CRIT
34# undef CRIT
35#endif
36#define CRIT(...) EINA_LOG_DOM_CRIT(_edje_cc_log_dom, __VA_ARGS__)
37#ifdef DBG
38# undef DBG
39#endif
40#define DBG(...) EINA_LOG_DOM_DBG(_edje_cc_log_dom, __VA_ARGS__)
41
42/* types */
43typedef struct _New_Object_Handler New_Object_Handler;
44typedef struct _New_Statement_Handler New_Statement_Handler;
45typedef struct _New_Nested_Handler New_Nested_Handler;
46typedef struct _External_List External_List;
47typedef struct _External External;
48typedef struct _Code Code;
49typedef struct _Code_Program Code_Program;
50typedef struct _SrcFile SrcFile;
51typedef struct _SrcFile_List SrcFile_List;
52
53typedef struct _Edje_Program_Parser Edje_Program_Parser;
54typedef struct _Edje_Pack_Element_Parser Edje_Pack_Element_Parser;
55typedef struct _Edje_Part_Parser Edje_Part_Parser;
56
57struct _New_Object_Handler
58{
59 const char *type;
60 void (*func)(void);
61};
62
63struct _New_Statement_Handler
64{
65 const char *type;
66 void (*func)(void);
67};
68
69struct _New_Nested_Handler
70{
71 const char *type;
72 const char *token;
73 void (*func_push)(void);
74 void (*func_pop)(void);
75};
76
77struct _External_List
78{
79 Eina_List *list;
80};
81
82struct _External
83{
84 char *name;
85};
86
87struct _Code
88{
89 int l1, l2;
90 char *shared;
91 char *original;
92 Eina_List *programs;
93 int is_lua;
94};
95
96struct _Code_Program
97{
98 int l1, l2;
99 int id;
100 char *script;
101 char *original;
102};
103
104struct _SrcFile
105{
106 char *name;
107 char *file;
108};
109
110struct _SrcFile_List
111{
112 Eina_List *list;
113};
114
115struct _Edje_Program_Parser
116{
117 Edje_Program common;
118 Eina_Bool can_override;
119};
120
121struct _Edje_Pack_Element_Parser
122{
123 Edje_Pack_Element common;
124 Eina_Bool can_override;
125};
126
127struct _Edje_Part_Parser
128{
129 Edje_Part common;
130 struct {
131 Eina_Bool done;
132 const char *insert_before; /* the part name for insertion in front of */
133 const char *insert_after; /* the part name for insertion behind of */
134 Edje_Part_Parser *before;
135 Edje_Part_Parser *after;
136 int linked_prev; /* the number linked previous part for reorder */
137 int linked_next; /* the number linked next part for reorder */
138 } reorder;
139 Eina_Bool can_override;
140};
141
142/* global fn calls */
143void data_setup(void);
144void data_write(void);
145void data_queue_face_group_lookup(const char *name);
146void data_queue_group_lookup(const char *name, Edje_Part *part);
147void data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest);
148void data_queue_copied_part_lookup(Edje_Part_Collection *pc, int *src, int *dest);
149void data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, int *dest);
150void data_queue_copied_program_lookup(Edje_Part_Collection *pc, int *src, int *dest);
151void data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *dest);
152void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest);
153void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set);
154void data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set);
155void data_queue_image_remove(int *dest, Eina_Bool *set);
156void data_queue_part_slave_lookup(int *master, int *slave);
157void data_queue_image_slave_lookup(int *master, int *slave);
158void data_queue_spectrum_lookup(char *name, int *dest);
159void data_queue_spectrum_slave_lookup(int *master, int *slave);
160void data_process_lookups(void);
161void data_process_scripts(void);
162void data_process_script_lookups(void);
163
164void part_description_image_cleanup(Edje_Part *ep);
165
166int is_verbatim(void);
167void track_verbatim(int on);
168void set_verbatim(char *s, int l1, int l2);
169char *get_verbatim(void);
170int get_verbatim_line1(void);
171int get_verbatim_line2(void);
172void compile(void);
173int is_param(int n);
174int is_num(int n);
175char *parse_str(int n);
176int parse_enum(int n, ...);
177int parse_flags(int n, ...);
178int parse_int(int n);
179int parse_int_range(int n, int f, int t);
180int parse_bool(int n);
181double parse_float(int n);
182double parse_float_range(int n, double f, double t);
183int get_arg_count(void);
184void check_arg_count(int n);
185void check_min_arg_count(int n);
186
187int object_handler_num(void);
188int statement_handler_num(void);
189int nested_handler_num(void);
190
191void reorder_parts(void);
192void source_edd(void);
193void source_fetch(void);
194int source_append(Eet_File *ef);
195SrcFile_List *source_load(Eet_File *ef);
196int source_fontmap_save(Eet_File *ef, Eina_List *fonts);
197Edje_Font_List *source_fontmap_load(Eet_File *ef);
198
199void *mem_alloc(size_t size);
200char *mem_strdup(const char *s);
201#define SZ sizeof
202
203void using_file(const char *filename, const char type);
204
205void error_and_abort(Eet_File *ef, const char *fmt, ...);
206
207
208void edje_cc_handlers_hierarchy_alloc(void);
209void edje_cc_handlers_hierarchy_free(void);
210
211/* global vars */
212extern Eina_List *ext_dirs;
213extern Eina_List *img_dirs;
214extern Eina_List *fnt_dirs;
215extern Eina_List *snd_dirs;
216extern char *file_in;
217extern char *tmp_dir;
218extern char *file_out;
219extern char *watchfile;
220extern int no_lossy;
221extern int no_comp;
222extern int no_raw;
223extern int no_save;
224extern int min_quality;
225extern int max_quality;
226extern int line;
227extern Eina_List *stack;
228extern Edje_File *edje_file;
229extern Eina_List *edje_collections;
230extern Eina_Hash *edje_collections_lookup;
231extern Eina_List *externals;
232extern Eina_List *fonts;
233extern Eina_List *codes;
234extern Eina_List *defines;
235extern Eina_List *aliases;
236extern New_Object_Handler object_handlers[];
237extern New_Statement_Handler statement_handlers[];
238extern New_Nested_Handler nested_handlers[];
239extern int compress_mode;
240extern int threads;
241extern int anotate;
242
243#endif
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
new file mode 100644
index 0000000000..4a007c6d17
--- /dev/null
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -0,0 +1,9386 @@
1/*
2 Concerning the EDC reference:
3
4 The formatting for blocks and properties has been implemented as a table
5 which is filled using ALIASES.
6 For maximum flexibility I implemented them in the \@code/\@encode style,
7 this means that missing one or changing the order most certainly cause
8 formatting errors.
9
10 \@block
11 block name
12 \@context
13 code sample of the block
14 \@description
15 the block's description
16 \@endblock
17
18 \@property
19 property name
20 \@parameters
21 property's parameter list
22 \@effect
23 the property description (lol)
24 \@endproperty
25*/
26
27#ifdef HAVE_CONFIG_H
28# include "config.h"
29#endif
30
31#include <string.h>
32#include <errno.h>
33#include <sys/stat.h>
34#include <fcntl.h>
35#include <sys/mman.h>
36#include <unistd.h>
37
38#include "edje_cc.h"
39
40/**
41 * @page edcref Edje Data Collection reference
42 * An Edje Data Collection, it's a plain text file (normally identified with the
43 * .edc extension), consisting of instructions for the Edje Compiler.
44 *
45 * The syntax for the edje data collection files follows a simple structure of
46 * "blocks { .. }" that can contain "properties: ..", more blocks, or both.
47 *
48 * @anchor sec_quickaccess Quick access to block descriptions:
49 * <ul>
50 * <li>@ref sec_toplevel "Top-Level"</li>
51 * <ul>
52 * <li>@ref sec_toplevel_externals "Externals"</li>
53 * <li>@ref sec_toplevel_images "Images"</li>
54 * <ul>
55 * <li>@ref sec_toplevel_images_set "Set"</li>
56 * <ul>
57 * <li>@ref sec_toplevel_images_image "Image"</li>
58 * </ul>
59 * </ul>
60 * <li>@ref sec_toplevel_fonts "Fonts"</li>
61 * <li>@ref sec_toplevel_data "Data"</li>
62 * <li>@ref sec_toplevel_color_classes "Color Classes"</li>
63 * <li>@ref sec_toplevel_styles "Styles"</li>
64 * </ul>
65 * <li>@ref sec_collections "Collections"</li>
66 * <ul>
67 * <li>@ref sec_collections_sounds "Sounds"</li>
68 * <ul>
69 * <li>@ref sec_collections_sounds_sample "Sample"</li>
70 * </ul>
71 * <li>@ref sec_collections_group "Group"</li>
72 * <ul>
73 * <li>@ref sec_collections_group_script "Script"</li>
74 * <li>@ref sec_collections_group_limits "Limits"</li>
75 * <li>@ref sec_toplevel_data "Data"</li>
76 * <li>@ref sec_collections_group_parts "Parts"</li>
77 * <ul>
78 * <li>@ref sec_collections_group_parts_part "Part"</li>
79 * <ul>
80 * <li>@ref sec_collections_group_parts_dragable "Dragable"</li>
81 * <li>@ref sec_collections_group_parts_items "Items"</li>
82 * <li>@ref sec_collections_group_parts_description "Description"</li>
83 * <ul>
84 * <li>@ref sec_collections_group_parts_description_relatives "Relatives (rel1/rel2)"</li>
85 * <li>@ref sec_collections_group_parts_description_image "Image"</li>
86 * <ul>
87 * <li>@ref sec_collections_group_parts_description_image_fill "Fill"</li>
88 * <ul>
89 * <li>@ref sec_collections_group_parts_description_image_fill_origin "Origin"</li>
90 * <li>@ref sec_collections_group_parts_description_image_fill_size "Size"</li>
91 * </ul>
92 * </ul>
93 * <li>@ref sec_collections_group_parts_description_text "Text"</li>
94 * <li>@ref sec_collections_group_parts_description_box "Box"</li>
95 * <ul>
96 * <li>@ref sec_collections_group_parts_items "Items"</li>
97 * </ul>
98 * <li>@ref sec_collections_group_parts_description_table "Table"</li>
99 * <li>@ref sec_collections_group_parts_description_physics "Physics"</li>
100 * <ul>
101 * <li>@ref sec_collections_group_parts_description_physics_movement_freedom "Movement Freedom"</li>
102 * <li>@ref sec_collections_group_parts_description_physics_faces "Faces"</li>
103 * </ul>
104 * <li>@ref sec_collections_group_parts_description_map "Map (3d/transformations)"</li>
105 * <ul>
106 * <li>@ref sec_collections_group_parts_description_map_rotation "Rotation"</li>
107 * </ul>
108 * <li>@ref sec_collections_group_parts_description_perspective "Perspective"</li>
109 * <li>@ref sec_collections_group_parts_descriptions_params "Params"</li>
110 * </ul>
111 * </ul>
112 * </ul>
113 * <li>@ref sec_collections_group_programs "Programs"</li>
114 * <ul>
115 * <li>@ref sec_collections_group_script "Script"</li>
116 * </ul>
117 * <li>@ref sec_collections_group_physics "Physics"</li>
118 * <ul>
119 * <li>@ref sec_collections_group_physics_world "World"</li>
120 * </ul>
121 * </ul>
122 * </ul>
123 * </ul>
124 *
125 * @author Andres Blanc (dresb) andresblanc@gmail.com
126 *
127 * <table class="edcref" border="0">
128 */
129
130static Edje_Part_Collection_Directory_Entry *current_de = NULL;
131static Edje_Part *current_part = NULL;
132static Edje_Pack_Element *current_item = NULL;
133static Edje_Part_Description_Common *current_desc = NULL;
134static Edje_Part_Description_Common *parent_desc = NULL;
135static Edje_Program *current_program = NULL;
136
137struct _Edje_Cc_Handlers_Hierarchy_Info
138{ /* Struct that keeps globals value to impl hierarchy */
139 Edje_Part_Collection_Directory_Entry *current_de;
140 Edje_Part *current_part;
141 Edje_Pack_Element *current_item;
142 Edje_Part_Description_Common *current_desc;
143 Edje_Part_Description_Common *parent_desc;
144 Edje_Program *current_program;
145 Edje_Part *ep;
146};
147typedef struct _Edje_Cc_Handlers_Hierarchy_Info Edje_Cc_Handlers_Hierarchy_Info;
148
149static Eina_Array *part_hierarchy = NULL; /* stack parts,support nested parts */
150static void edje_cc_handlers_hierarchy_set(Edje_Part *src);
151static Edje_Part *edje_cc_handlers_hierarchy_parent_get(void);
152static void edje_cc_handlers_hierarchy_push(Edje_Part *ep, Edje_Part *cp);
153static void edje_cc_handlers_hierarchy_rename(Edje_Part *old, Edje_Part *new);
154static void edje_cc_handlers_hierarchy_pop(void);
155
156static void st_externals_external(void);
157
158static void st_images_image(void);
159static void ob_images_set(void);
160static void st_images_set_name(void);
161static void ob_images_set_image(void);
162static void st_images_set_image_image(void);
163static void st_images_set_image_size(void);
164
165static void st_fonts_font(void);
166
167static void st_data_item(void);
168static void st_data_file(void);
169
170static void ob_styles_style(void);
171static void st_styles_style_name(void);
172static void st_styles_style_base(void);
173static void st_styles_style_tag(void);
174
175static void ob_color_class(void);
176static void st_color_class_name(void);
177static void st_color_class_color(void);
178static void st_color_class_color2(void);
179static void st_color_class_color3(void);
180
181static void ob_collections(void);
182
183static void ob_collections_group(void);
184static void st_collections_group_name(void);
185static void st_collections_group_inherit(void);
186static void st_collections_group_script_only(void);
187static void st_collections_group_alias(void);
188static void st_collections_group_min(void);
189static void st_collections_group_max(void);
190static void st_collections_group_broadcast_signal(void);
191static void st_collections_group_data_item(void);
192static void st_collections_group_orientation(void);
193
194static void st_collections_group_limits_vertical(void);
195static void st_collections_group_limits_horizontal(void);
196
197static void ob_collections_group_script(void);
198static void ob_collections_group_lua_script(void);
199
200static void st_collections_group_parts_alias(void);
201
202static Edje_Part *edje_cc_handlers_part_make(void);
203static void ob_collections_group_parts_part(void);
204static void st_collections_group_parts_part_name(void);
205static void st_collections_group_parts_part_type(void);
206#ifdef HAVE_EPHYSICS
207static void st_collections_group_parts_part_physics_body(void);
208#endif
209static void st_collections_group_parts_part_insert_before(void);
210static void st_collections_group_parts_part_insert_after(void);
211static void st_collections_group_parts_part_effect(void);
212static void st_collections_group_parts_part_mouse_events(void);
213static void st_collections_group_parts_part_repeat_events(void);
214static void st_collections_group_parts_part_ignore_flags(void);
215static void st_collections_group_parts_part_scale(void);
216static void st_collections_group_parts_part_pointer_mode(void);
217static void st_collections_group_parts_part_precise_is_inside(void);
218static void st_collections_group_parts_part_use_alternate_font_metrics(void);
219static void st_collections_group_parts_part_clip_to_id(void);
220static void st_collections_group_parts_part_source(void);
221static void st_collections_group_parts_part_source2(void);
222static void st_collections_group_parts_part_source3(void);
223static void st_collections_group_parts_part_source4(void);
224static void st_collections_group_parts_part_source5(void);
225static void st_collections_group_parts_part_source6(void);
226static void st_collections_group_parts_part_entry_mode(void);
227static void st_collections_group_parts_part_select_mode(void);
228static void st_collections_group_parts_part_cursor_mode(void);
229static void st_collections_group_parts_part_multiline(void);
230static void st_collections_group_parts_part_access(void);
231static void st_collections_group_parts_part_dragable_x(void);
232static void st_collections_group_parts_part_dragable_y(void);
233static void st_collections_group_parts_part_dragable_confine(void);
234static void st_collections_group_parts_part_dragable_events(void);
235
236/* box and table items share these */
237static void ob_collections_group_parts_part_box_items_item(void);
238static void st_collections_group_parts_part_box_items_item_type(void);
239static void st_collections_group_parts_part_box_items_item_name(void);
240static void st_collections_group_parts_part_box_items_item_source(void);
241static void st_collections_group_parts_part_box_items_item_min(void);
242static void st_collections_group_parts_part_box_items_item_prefer(void);
243static void st_collections_group_parts_part_box_items_item_max(void);
244static void st_collections_group_parts_part_box_items_item_padding(void);
245static void st_collections_group_parts_part_box_items_item_align(void);
246static void st_collections_group_parts_part_box_items_item_weight(void);
247static void st_collections_group_parts_part_box_items_item_aspect(void);
248static void st_collections_group_parts_part_box_items_item_aspect_mode(void);
249static void st_collections_group_parts_part_box_items_item_options(void);
250/* but these are only for table */
251static void st_collections_group_parts_part_table_items_item_position(void);
252static void st_collections_group_parts_part_table_items_item_span(void);
253
254static void ob_collections_group_parts_part_description(void);
255static void st_collections_group_parts_part_description_inherit(void);
256static void st_collections_group_parts_part_description_source(void);
257static void st_collections_group_parts_part_description_state(void);
258static void st_collections_group_parts_part_description_visible(void);
259static void st_collections_group_parts_part_description_limit(void);
260static void st_collections_group_parts_part_description_align(void);
261static void st_collections_group_parts_part_description_fixed(void);
262static void st_collections_group_parts_part_description_min(void);
263static void st_collections_group_parts_part_description_minmul(void);
264static void st_collections_group_parts_part_description_max(void);
265static void st_collections_group_parts_part_description_step(void);
266static void st_collections_group_parts_part_description_aspect(void);
267static void st_collections_group_parts_part_description_aspect_preference(void);
268static void st_collections_group_parts_part_description_rel1_relative(void);
269static void st_collections_group_parts_part_description_rel1_offset(void);
270static void st_collections_group_parts_part_description_rel1_to_set(const char *name);
271static void st_collections_group_parts_part_description_rel1_to(void);
272static void st_collections_group_parts_part_description_rel1_to_x(void);
273static void st_collections_group_parts_part_description_rel1_to_y(void);
274static void st_collections_group_parts_part_description_rel2_relative(void);
275static void st_collections_group_parts_part_description_rel2_offset(void);
276static void st_collections_group_parts_part_description_rel2_to_set(const char *name);
277static void st_collections_group_parts_part_description_rel2_to(void);
278static void st_collections_group_parts_part_description_rel2_to_x(void);
279static void st_collections_group_parts_part_description_rel2_to_y(void);
280static void st_collections_group_parts_part_description_image_normal(void);
281static void st_collections_group_parts_part_description_image_tween(void);
282static void st_collections_group_parts_part_description_image_border(void);
283static void st_collections_group_parts_part_description_image_middle(void);
284static void st_collections_group_parts_part_description_image_border_scale(void);
285static void st_collections_group_parts_part_description_image_border_scale_by(void);
286static void st_collections_group_parts_part_description_image_scale_hint(void);
287static void st_collections_group_parts_part_description_fill_smooth(void);
288static void st_collections_group_parts_part_description_fill_origin_relative(void);
289static void st_collections_group_parts_part_description_fill_origin_offset(void);
290static void st_collections_group_parts_part_description_fill_size_relative(void);
291static void st_collections_group_parts_part_description_fill_size_offset(void);
292static void st_collections_group_parts_part_description_fill_spread(void);
293static void st_collections_group_parts_part_description_fill_type(void);
294static void st_collections_group_parts_part_description_color_class(void);
295static void st_collections_group_parts_part_description_color(void);
296static void st_collections_group_parts_part_description_color2(void);
297static void st_collections_group_parts_part_description_color3(void);
298static void st_collections_group_parts_part_description_text_text(void);
299static void st_collections_group_parts_part_description_text_text_class(void);
300static void st_collections_group_parts_part_description_text_font(void);
301static void st_collections_group_parts_part_description_text_style(void);
302static void st_collections_group_parts_part_description_text_repch(void);
303static void st_collections_group_parts_part_description_text_size(void);
304static void st_collections_group_parts_part_description_text_size_range(void);
305static void st_collections_group_parts_part_description_text_fit(void);
306static void st_collections_group_parts_part_description_text_min(void);
307static void st_collections_group_parts_part_description_text_max(void);
308static void st_collections_group_parts_part_description_text_align(void);
309static void st_collections_group_parts_part_description_text_source(void);
310static void st_collections_group_parts_part_description_text_text_source(void);
311static void st_collections_group_parts_part_description_text_elipsis(void);
312static void st_collections_group_parts_part_description_box_layout(void);
313static void st_collections_group_parts_part_description_box_align(void);
314static void st_collections_group_parts_part_description_box_padding(void);
315static void st_collections_group_parts_part_description_box_min(void);
316static void st_collections_group_parts_part_description_table_homogeneous(void);
317static void st_collections_group_parts_part_description_table_align(void);
318static void st_collections_group_parts_part_description_table_padding(void);
319static void st_collections_group_parts_part_description_table_min(void);
320#ifdef HAVE_EPHYSICS
321static void st_collections_group_parts_part_description_physics_mass(void);
322static void st_collections_group_parts_part_description_physics_restitution(void);
323static void st_collections_group_parts_part_description_physics_friction(void);
324static void st_collections_group_parts_part_description_physics_damping(void);
325static void st_collections_group_parts_part_description_physics_sleep(void);
326static void st_collections_group_parts_part_description_physics_material(void);
327static void st_collections_group_parts_part_description_physics_density(void);
328static void st_collections_group_parts_part_description_physics_hardness(void);
329static void st_collections_group_parts_part_description_physics_ignore_part_pos(void);
330static void st_collections_group_parts_part_description_physics_light_on(void);
331static void st_collections_group_parts_part_description_physics_z(void);
332static void st_collections_group_parts_part_description_physics_depth(void);
333static void st_collections_group_parts_part_description_physics_movement_freedom_linear(void);
334static void st_collections_group_parts_part_description_physics_movement_freedom_angular(void);
335static void st_collections_group_parts_part_description_physics_backface_cull(void);
336static void st_collections_group_parts_part_description_physics_face(void);
337static void st_collections_group_parts_part_description_physics_face_type(void);
338static void st_collections_group_parts_part_description_physics_face_source(void);
339#endif
340static void st_collections_group_parts_part_description_map_perspective(void);
341static void st_collections_group_parts_part_description_map_light(void);
342static void st_collections_group_parts_part_description_map_rotation_center(void);
343static void st_collections_group_parts_part_description_map_rotation_x(void);
344static void st_collections_group_parts_part_description_map_rotation_y(void);
345static void st_collections_group_parts_part_description_map_rotation_z(void);
346static void st_collections_group_parts_part_description_map_on(void);
347static void st_collections_group_parts_part_description_map_smooth(void);
348static void st_collections_group_parts_part_description_map_alpha(void);
349static void st_collections_group_parts_part_description_map_backface_cull(void);
350static void st_collections_group_parts_part_description_map_perspective_on(void);
351static void st_collections_group_parts_part_description_perspective_zplane(void);
352static void st_collections_group_parts_part_description_perspective_focal(void);
353static void st_collections_group_parts_part_api(void);
354
355/* external part parameters */
356static void st_collections_group_parts_part_description_params_int(void);
357static void ob_collections_group_programs_program(void);
358static void st_collections_group_parts_part_description_params_double(void);
359
360static void st_collections_group_programs_program_name(void);
361static void st_collections_group_parts_part_description_params_string(void);
362static void st_collections_group_parts_part_description_params_bool(void);
363static void st_collections_group_parts_part_description_params_choice(void);
364static void st_collections_group_programs_program_signal(void);
365static void st_collections_group_programs_program_source(void);
366static void st_collections_group_programs_program_filter(void);
367static void st_collections_group_programs_program_in(void);
368static void st_collections_group_programs_program_action(void);
369static void st_collections_group_programs_program_transition(void);
370static void st_collections_group_programs_program_target(void);
371static void st_collections_group_programs_program_after(void);
372static void st_collections_group_programs_program_api(void);
373
374static void ob_collections_group_programs_program_script(void);
375static void st_collections_group_sound_sample_name(void);
376static void st_collections_group_sound_sample_source(void);
377static void st_collections_group_sound_tone(void);
378
379#ifdef HAVE_EPHYSICS
380static void st_collections_group_physics_world_gravity(void);
381static void st_collections_group_physics_world_rate(void);
382static void st_collections_group_physics_world_z(void);
383static void st_collections_group_physics_world_depth(void);
384#endif
385
386/*****/
387
388New_Statement_Handler statement_handlers[] =
389{
390 {"externals.external", st_externals_external},
391 {"images.image", st_images_image},
392 {"images.set.name", st_images_set_name},
393 {"images.set.image.image", st_images_set_image_image},
394 {"images.set.image.size", st_images_set_image_size},
395 {"fonts.font", st_fonts_font},
396 {"data.item", st_data_item},
397 {"data.file", st_data_file},
398 {"styles.style.name", st_styles_style_name},
399 {"styles.style.base", st_styles_style_base},
400 {"styles.style.tag", st_styles_style_tag},
401 {"color_classes.color_class.name", st_color_class_name},
402 {"color_classes.color_class.color", st_color_class_color},
403 {"color_classes.color_class.color2", st_color_class_color2},
404 {"color_classes.color_class.color3", st_color_class_color3},
405 {"collections.externals.external", st_externals_external}, /* dup */
406 {"collections.image", st_images_image}, /* dup */
407 {"collections.set.name", st_images_set_name}, /* dup */
408 {"collections.set.image.image", st_images_set_image_image}, /* dup */
409 {"collections.set.image.size", st_images_set_image_size}, /* dup */
410 {"collections.images.image", st_images_image}, /* dup */
411 {"collections.images.set.name", st_images_set_name}, /* dup */
412 {"collections.images.set.image.image", st_images_set_image_image}, /* dup */
413 {"collections.images.set.image.size", st_images_set_image_size}, /* dup */
414 {"collections.font", st_fonts_font}, /* dup */
415 {"collections.fonts.font", st_fonts_font}, /* dup */
416 {"collections.styles.style.name", st_styles_style_name}, /* dup */
417 {"collections.styles.style.base", st_styles_style_base}, /* dup */
418 {"collections.styles.style.tag", st_styles_style_tag}, /* dup */
419 {"collections.color_classes.color_class.name", st_color_class_name}, /* dup */
420 {"collections.color_classes.color_class.color", st_color_class_color}, /* dup */
421 {"collections.color_classes.color_class.color2", st_color_class_color2}, /* dup */
422 {"collections.color_classes.color_class.color3", st_color_class_color3}, /* dup */
423
424 {"collections.sounds.sample.name", st_collections_group_sound_sample_name},
425 {"collections.sounds.sample.source", st_collections_group_sound_sample_source},
426 {"collections.group.sounds.sample.name", st_collections_group_sound_sample_name}, /* dup */
427 {"collections.group.sounds.sample.source", st_collections_group_sound_sample_source}, /* dup */
428 {"collections.sounds.tone", st_collections_group_sound_tone},
429 {"collections.group.sounds.tone", st_collections_group_sound_tone}, /* dup */
430 {"collections.group.name", st_collections_group_name},
431 {"collections.group.inherit", st_collections_group_inherit},
432 {"collections.group.script_only", st_collections_group_script_only},
433 {"collections.group.lua_script_only", st_collections_group_script_only},
434 {"collections.group.alias", st_collections_group_alias},
435 {"collections.group.min", st_collections_group_min},
436 {"collections.group.max", st_collections_group_max},
437 {"collections.group.broadcast_signal", st_collections_group_broadcast_signal},
438 {"collections.group.orientation", st_collections_group_orientation},
439 {"collections.group.data.item", st_collections_group_data_item},
440 {"collections.group.limits.horizontal", st_collections_group_limits_horizontal},
441 {"collections.group.limits.vertical", st_collections_group_limits_vertical},
442 {"collections.group.externals.external", st_externals_external}, /* dup */
443 {"collections.group.image", st_images_image}, /* dup */
444 {"collections.group.set.name", st_images_set_name},
445 {"collections.group.set.image.image", st_images_set_image_image},
446 {"collections.group.set.image.size", st_images_set_image_size},
447 {"collections.group.images.image", st_images_image}, /* dup */
448 {"collections.group.images.set.name", st_images_set_name},
449 {"collections.group.images.set.image.image", st_images_set_image_image},
450 {"collections.group.images.set.image.size", st_images_set_image_size},
451 {"collections.group.font", st_fonts_font}, /* dup */
452 {"collections.group.fonts.font", st_fonts_font}, /* dup */
453 {"collections.group.styles.style.name", st_styles_style_name}, /* dup */
454 {"collections.group.styles.style.base", st_styles_style_base}, /* dup */
455 {"collections.group.styles.style.tag", st_styles_style_tag}, /* dup */
456 {"collections.group.color_classes.color_class.name", st_color_class_name}, /* dup */
457 {"collections.group.color_classes.color_class.color", st_color_class_color}, /* dup */
458 {"collections.group.color_classes.color_class.color2", st_color_class_color2}, /* dup */
459 {"collections.group.color_classes.color_class.color3", st_color_class_color3}, /* dup */
460 {"collections.group.parts.alias", st_collections_group_parts_alias },
461 {"collections.group.parts.image", st_images_image}, /* dup */
462 {"collections.group.parts.set.name", st_images_set_name},
463 {"collections.group.parts.set.image.image", st_images_set_image_image},
464 {"collections.group.parts.set.image.size", st_images_set_image_size},
465 {"collections.group.parts.images.image", st_images_image}, /* dup */
466 {"collections.group.parts.images.set.name", st_images_set_name},
467 {"collections.group.parts.images.set.image.image", st_images_set_image_image},
468 {"collections.group.parts.images.set.image.size", st_images_set_image_size},
469 {"collections.group.parts.font", st_fonts_font}, /* dup */
470 {"collections.group.parts.fonts.font", st_fonts_font}, /* dup */
471 {"collections.group.parts.styles.style.name", st_styles_style_name}, /* dup */
472 {"collections.group.parts.styles.style.base", st_styles_style_base}, /* dup */
473 {"collections.group.parts.styles.style.tag", st_styles_style_tag}, /* dup */
474 {"collections.group.parts.color_classes.color_class.name", st_color_class_name}, /* dup */
475 {"collections.group.parts.color_classes.color_class.color", st_color_class_color}, /* dup */
476 {"collections.group.parts.color_classes.color_class.color2", st_color_class_color2}, /* dup */
477 {"collections.group.parts.color_classes.color_class.color3", st_color_class_color3}, /* dup */
478 {"collections.group.parts.part.name", st_collections_group_parts_part_name},
479 {"collections.group.parts.part.api", st_collections_group_parts_part_api},
480 {"collections.group.parts.part.type", st_collections_group_parts_part_type},
481#ifdef HAVE_EPHYSICS
482 {"collections.group.parts.part.physics_body", st_collections_group_parts_part_physics_body},
483#endif
484 {"collections.group.parts.part.insert_before", st_collections_group_parts_part_insert_before},
485 {"collections.group.parts.part.insert_after", st_collections_group_parts_part_insert_after},
486 {"collections.group.parts.part.effect", st_collections_group_parts_part_effect},
487 {"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events},
488 {"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
489 {"collections.group.parts.part.ignore_flags", st_collections_group_parts_part_ignore_flags},
490 {"collections.group.parts.part.scale", st_collections_group_parts_part_scale},
491 {"collections.group.parts.part.pointer_mode", st_collections_group_parts_part_pointer_mode},
492 {"collections.group.parts.part.precise_is_inside", st_collections_group_parts_part_precise_is_inside},
493 {"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics},
494 {"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
495 {"collections.group.parts.part.source", st_collections_group_parts_part_source},
496 {"collections.group.parts.part.source2", st_collections_group_parts_part_source2},
497 {"collections.group.parts.part.source3", st_collections_group_parts_part_source3},
498 {"collections.group.parts.part.source4", st_collections_group_parts_part_source4},
499 {"collections.group.parts.part.source5", st_collections_group_parts_part_source5},
500 {"collections.group.parts.part.source6", st_collections_group_parts_part_source6},
501 {"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
502 {"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
503 {"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
504 {"collections.group.parts.part.dragable.events", st_collections_group_parts_part_dragable_events},
505 {"collections.group.parts.part.entry_mode", st_collections_group_parts_part_entry_mode},
506 {"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
507 {"collections.group.parts.part.cursor_mode", st_collections_group_parts_part_cursor_mode},
508 {"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
509 {"collections.group.parts.part.access", st_collections_group_parts_part_access},
510 {"collections.group.parts.part.image", st_images_image}, /* dup */
511 {"collections.group.parts.part.set.name", st_images_set_name},
512 {"collections.group.parts.part.set.image.image", st_images_set_image_image},
513 {"collections.group.parts.part.set.image.size", st_images_set_image_size},
514 {"collections.group.parts.part.images.image", st_images_image}, /* dup */
515 {"collections.group.parts.part.images.set.name", st_images_set_name},
516 {"collections.group.parts.part.images.set.image.image", st_images_set_image_image},
517 {"collections.group.parts.part.images.set.image.size", st_images_set_image_size},
518 {"collections.group.parts.part.font", st_fonts_font}, /* dup */
519 {"collections.group.parts.part.fonts.font", st_fonts_font}, /* dup */
520 {"collections.group.parts.part.styles.style.name", st_styles_style_name}, /* dup */
521 {"collections.group.parts.part.styles.style.base", st_styles_style_base}, /* dup */
522 {"collections.group.parts.part.styles.style.tag", st_styles_style_tag}, /* dup */
523 {"collections.group.parts.part.color_classes.color_class.name", st_color_class_name}, /* dup */
524 {"collections.group.parts.part.color_classes.color_class.color", st_color_class_color}, /* dup */
525 {"collections.group.parts.part.color_classes.color_class.color2", st_color_class_color2}, /* dup */
526 {"collections.group.parts.part.color_classes.color_class.color3", st_color_class_color3}, /* dup */
527 {"collections.group.parts.part.box.items.item.type", st_collections_group_parts_part_box_items_item_type},
528 {"collections.group.parts.part.box.items.item.name", st_collections_group_parts_part_box_items_item_name},
529 {"collections.group.parts.part.box.items.item.source", st_collections_group_parts_part_box_items_item_source},
530 {"collections.group.parts.part.box.items.item.min", st_collections_group_parts_part_box_items_item_min},
531 {"collections.group.parts.part.box.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer},
532 {"collections.group.parts.part.box.items.item.max", st_collections_group_parts_part_box_items_item_max},
533 {"collections.group.parts.part.box.items.item.padding", st_collections_group_parts_part_box_items_item_padding},
534 {"collections.group.parts.part.box.items.item.align", st_collections_group_parts_part_box_items_item_align},
535 {"collections.group.parts.part.box.items.item.weight", st_collections_group_parts_part_box_items_item_weight},
536 {"collections.group.parts.part.box.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect},
537 {"collections.group.parts.part.box.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode},
538 {"collections.group.parts.part.box.items.item.options", st_collections_group_parts_part_box_items_item_options},
539 {"collections.group.parts.part.table.items.item.type", st_collections_group_parts_part_box_items_item_type}, /* dup */
540 {"collections.group.parts.part.table.items.item.name", st_collections_group_parts_part_box_items_item_name}, /* dup */
541 {"collections.group.parts.part.table.items.item.source", st_collections_group_parts_part_box_items_item_source}, /* dup */
542 {"collections.group.parts.part.table.items.item.min", st_collections_group_parts_part_box_items_item_min}, /* dup */
543 {"collections.group.parts.part.table.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer}, /* dup */
544 {"collections.group.parts.part.table.items.item.max", st_collections_group_parts_part_box_items_item_max}, /* dup */
545 {"collections.group.parts.part.table.items.item.padding", st_collections_group_parts_part_box_items_item_padding}, /* dup */
546 {"collections.group.parts.part.table.items.item.align", st_collections_group_parts_part_box_items_item_align}, /* dup */
547 {"collections.group.parts.part.table.items.item.weight", st_collections_group_parts_part_box_items_item_weight}, /* dup */
548 {"collections.group.parts.part.table.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect}, /* dup */
549 {"collections.group.parts.part.table.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode}, /* dup */
550 {"collections.group.parts.part.table.items.item.options", st_collections_group_parts_part_box_items_item_options}, /* dup */
551 {"collections.group.parts.part.table.items.item.position", st_collections_group_parts_part_table_items_item_position},
552 {"collections.group.parts.part.table.items.item.span", st_collections_group_parts_part_table_items_item_span},
553 {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
554 {"collections.group.parts.part.description.source", st_collections_group_parts_part_description_source},
555 {"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
556 {"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible},
557 {"collections.group.parts.part.description.limit", st_collections_group_parts_part_description_limit},
558 {"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align},
559 {"collections.group.parts.part.description.fixed", st_collections_group_parts_part_description_fixed},
560 {"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min},
561 {"collections.group.parts.part.description.minmul", st_collections_group_parts_part_description_minmul},
562 {"collections.group.parts.part.description.max", st_collections_group_parts_part_description_max},
563 {"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step},
564 {"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect},
565 {"collections.group.parts.part.description.aspect_preference", st_collections_group_parts_part_description_aspect_preference},
566 {"collections.group.parts.part.description.rel1.relative", st_collections_group_parts_part_description_rel1_relative},
567 {"collections.group.parts.part.description.rel1.offset", st_collections_group_parts_part_description_rel1_offset},
568 {"collections.group.parts.part.description.rel1.to", st_collections_group_parts_part_description_rel1_to},
569 {"collections.group.parts.part.description.rel1.to_x", st_collections_group_parts_part_description_rel1_to_x},
570 {"collections.group.parts.part.description.rel1.to_y", st_collections_group_parts_part_description_rel1_to_y},
571 {"collections.group.parts.part.description.rel2.relative", st_collections_group_parts_part_description_rel2_relative},
572 {"collections.group.parts.part.description.rel2.offset", st_collections_group_parts_part_description_rel2_offset},
573 {"collections.group.parts.part.description.rel2.to", st_collections_group_parts_part_description_rel2_to},
574 {"collections.group.parts.part.description.rel2.to_x", st_collections_group_parts_part_description_rel2_to_x},
575 {"collections.group.parts.part.description.rel2.to_y", st_collections_group_parts_part_description_rel2_to_y},
576 {"collections.group.parts.part.description.image.normal", st_collections_group_parts_part_description_image_normal},
577 {"collections.group.parts.part.description.image.tween", st_collections_group_parts_part_description_image_tween},
578 {"collections.group.parts.part.description.image.image", st_images_image}, /* dup */
579 {"collections.group.parts.part.description.image.set.name", st_images_set_name},
580 {"collections.group.parts.part.description.image.set.image.image", st_images_set_image_image},
581 {"collections.group.parts.part.description.image.set.image.size", st_images_set_image_size},
582 {"collections.group.parts.part.description.image.images.image", st_images_image}, /* dup */
583 {"collections.group.parts.part.description.image.images.set.name", st_images_set_name},
584 {"collections.group.parts.part.description.image.images.set.image.image", st_images_set_image_image},
585 {"collections.group.parts.part.description.image.images.set.image.size", st_images_set_image_size},
586 {"collections.group.parts.part.description.image.border", st_collections_group_parts_part_description_image_border},
587 {"collections.group.parts.part.description.image.middle", st_collections_group_parts_part_description_image_middle},
588 {"collections.group.parts.part.description.image.border_scale", st_collections_group_parts_part_description_image_border_scale},
589 {"collections.group.parts.part.description.image.border_scale_by", st_collections_group_parts_part_description_image_border_scale_by},
590 {"collections.group.parts.part.description.image.scale_hint", st_collections_group_parts_part_description_image_scale_hint},
591 {"collections.group.parts.part.description.fill.smooth", st_collections_group_parts_part_description_fill_smooth},
592 {"collections.group.parts.part.description.fill.origin.relative", st_collections_group_parts_part_description_fill_origin_relative},
593 {"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset},
594 {"collections.group.parts.part.description.fill.size.relative", st_collections_group_parts_part_description_fill_size_relative},
595 {"collections.group.parts.part.description.fill.size.offset", st_collections_group_parts_part_description_fill_size_offset},
596 {"collections.group.parts.part.description.fill.spread", st_collections_group_parts_part_description_fill_spread},
597 {"collections.group.parts.part.description.fill.type", st_collections_group_parts_part_description_fill_type},
598 {"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class},
599 {"collections.group.parts.part.description.color", st_collections_group_parts_part_description_color},
600 {"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2},
601 {"collections.group.parts.part.description.color3", st_collections_group_parts_part_description_color3},
602 {"collections.group.parts.part.description.text.text", st_collections_group_parts_part_description_text_text},
603 {"collections.group.parts.part.description.text.text_class", st_collections_group_parts_part_description_text_text_class},
604 {"collections.group.parts.part.description.text.font", st_collections_group_parts_part_description_text_font},
605 {"collections.group.parts.part.description.text.style", st_collections_group_parts_part_description_text_style},
606 {"collections.group.parts.part.description.text.repch", st_collections_group_parts_part_description_text_repch},
607 {"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size},
608 {"collections.group.parts.part.description.text.size_range", st_collections_group_parts_part_description_text_size_range},
609 {"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit},
610 {"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min},
611 {"collections.group.parts.part.description.text.max", st_collections_group_parts_part_description_text_max},
612 {"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align},
613 {"collections.group.parts.part.description.text.source", st_collections_group_parts_part_description_text_source},
614 {"collections.group.parts.part.description.text.text_source", st_collections_group_parts_part_description_text_text_source},
615 {"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */
616 {"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */
617 {"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_elipsis},
618 {"collections.group.parts.part.description.text.ellipsis", st_collections_group_parts_part_description_text_elipsis},
619 {"collections.group.parts.part.description.box.layout", st_collections_group_parts_part_description_box_layout},
620 {"collections.group.parts.part.description.box.align", st_collections_group_parts_part_description_box_align},
621 {"collections.group.parts.part.description.box.padding", st_collections_group_parts_part_description_box_padding},
622 {"collections.group.parts.part.description.box.min", st_collections_group_parts_part_description_box_min},
623 {"collections.group.parts.part.description.table.homogeneous", st_collections_group_parts_part_description_table_homogeneous},
624 {"collections.group.parts.part.description.table.align", st_collections_group_parts_part_description_table_align},
625 {"collections.group.parts.part.description.table.padding", st_collections_group_parts_part_description_table_padding},
626 {"collections.group.parts.part.description.table.min", st_collections_group_parts_part_description_table_min},
627#ifdef HAVE_EPHYSICS
628 {"collections.group.parts.part.description.physics.mass", st_collections_group_parts_part_description_physics_mass},
629 {"collections.group.parts.part.description.physics.restitution", st_collections_group_parts_part_description_physics_restitution},
630 {"collections.group.parts.part.description.physics.friction", st_collections_group_parts_part_description_physics_friction},
631 {"collections.group.parts.part.description.physics.damping", st_collections_group_parts_part_description_physics_damping},
632 {"collections.group.parts.part.description.physics.sleep", st_collections_group_parts_part_description_physics_sleep},
633 {"collections.group.parts.part.description.physics.material", st_collections_group_parts_part_description_physics_material},
634 {"collections.group.parts.part.description.physics.density", st_collections_group_parts_part_description_physics_density},
635 {"collections.group.parts.part.description.physics.hardness", st_collections_group_parts_part_description_physics_hardness},
636 {"collections.group.parts.part.description.physics.movement_freedom.linear", st_collections_group_parts_part_description_physics_movement_freedom_linear},
637 {"collections.group.parts.part.description.physics.movement_freedom.angular", st_collections_group_parts_part_description_physics_movement_freedom_angular},
638 {"collections.group.parts.part.description.physics.ignore_part_pos", st_collections_group_parts_part_description_physics_ignore_part_pos},
639 {"collections.group.parts.part.description.physics.light_on", st_collections_group_parts_part_description_physics_light_on},
640 {"collections.group.parts.part.description.physics.z", st_collections_group_parts_part_description_physics_z},
641 {"collections.group.parts.part.description.physics.depth", st_collections_group_parts_part_description_physics_depth},
642 {"collections.group.parts.part.description.physics.backface_cull", st_collections_group_parts_part_description_physics_backface_cull},
643 {"collections.group.parts.part.description.physics.faces.face.type", st_collections_group_parts_part_description_physics_face_type},
644 {"collections.group.parts.part.description.physics.faces.face.source", st_collections_group_parts_part_description_physics_face_source},
645#endif
646 {"collections.group.parts.part.description.map.perspective", st_collections_group_parts_part_description_map_perspective},
647 {"collections.group.parts.part.description.map.light", st_collections_group_parts_part_description_map_light},
648 {"collections.group.parts.part.description.map.rotation.center", st_collections_group_parts_part_description_map_rotation_center},
649 {"collections.group.parts.part.description.map.rotation.x", st_collections_group_parts_part_description_map_rotation_x},
650 {"collections.group.parts.part.description.map.rotation.y", st_collections_group_parts_part_description_map_rotation_y},
651 {"collections.group.parts.part.description.map.rotation.z", st_collections_group_parts_part_description_map_rotation_z},
652 {"collections.group.parts.part.description.map.on", st_collections_group_parts_part_description_map_on},
653 {"collections.group.parts.part.description.map.smooth", st_collections_group_parts_part_description_map_smooth},
654 {"collections.group.parts.part.description.map.alpha", st_collections_group_parts_part_description_map_alpha},
655 {"collections.group.parts.part.description.map.backface_cull", st_collections_group_parts_part_description_map_backface_cull},
656 {"collections.group.parts.part.description.map.perspective_on", st_collections_group_parts_part_description_map_perspective_on},
657 {"collections.group.parts.part.description.perspective.zplane", st_collections_group_parts_part_description_perspective_zplane},
658 {"collections.group.parts.part.description.perspective.focal", st_collections_group_parts_part_description_perspective_focal},
659 {"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int},
660 {"collections.group.parts.part.description.params.double", st_collections_group_parts_part_description_params_double},
661 {"collections.group.parts.part.description.params.string", st_collections_group_parts_part_description_params_string},
662 {"collections.group.parts.part.description.params.bool", st_collections_group_parts_part_description_params_bool},
663 {"collections.group.parts.part.description.params.choice", st_collections_group_parts_part_description_params_choice},
664 {"collections.group.parts.part.description.images.image", st_images_image}, /* dup */
665 {"collections.group.parts.part.description.images.set.name", st_images_set_name},
666 {"collections.group.parts.part.description.images.set.image.image", st_images_set_image_image},
667 {"collections.group.parts.part.description.images.set.image.size", st_images_set_image_size},
668 {"collections.group.parts.part.description.font", st_fonts_font}, /* dup */
669 {"collections.group.parts.part.description.fonts.font", st_fonts_font}, /* dup */
670 {"collections.group.parts.part.description.styles.style.name", st_styles_style_name}, /* dup */
671 {"collections.group.parts.part.description.styles.style.base", st_styles_style_base}, /* dup */
672 {"collections.group.parts.part.description.styles.style.tag", st_styles_style_tag}, /* dup */
673 {"collections.group.parts.part.description.color_classes.color_class.name", st_color_class_name}, /* dup */
674 {"collections.group.parts.part.description.color_classes.color_class.color", st_color_class_color}, /* dup */
675 {"collections.group.parts.part.description.color_classes.color_class.color2", st_color_class_color2}, /* dup */
676 {"collections.group.parts.part.description.color_classes.color_class.color3", st_color_class_color3}, /* dup */
677 {"collections.group.parts.part.description.programs.image", st_images_image}, /* dup */
678 {"collections.group.parts.part.description.programs.set.name", st_images_set_name},
679 {"collections.group.parts.part.description.programs.set.image.image", st_images_set_image_image},
680 {"collections.group.parts.part.description.programs.set.image.size", st_images_set_image_size},
681 {"collections.group.parts.part.description.programs.images.image", st_images_image}, /* dup */
682 {"collections.group.parts.part.description.programs.images.set.name", st_images_set_name},
683 {"collections.group.parts.part.description.programs.images.set.image.image", st_images_set_image_image},
684 {"collections.group.parts.part.description.programs.images.set.image.size", st_images_set_image_size},
685 {"collections.group.parts.part.description.programs.font", st_fonts_font}, /* dup */
686 {"collections.group.parts.part.description.programs.fonts.font", st_fonts_font}, /* dup */
687 {"collections.group.parts.part.description.programs.program.name", st_collections_group_programs_program_name}, /* dup */
688 {"collections.group.parts.part.description.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
689 {"collections.group.parts.part.description.programs.program.source", st_collections_group_programs_program_source}, /* dup */
690 {"collections.group.parts.part.description.programs.program.in", st_collections_group_programs_program_in}, /* dup */
691 {"collections.group.parts.part.description.programs.program.action", st_collections_group_programs_program_action}, /* dup */
692 {"collections.group.parts.part.description.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
693 {"collections.group.parts.part.description.programs.program.target", st_collections_group_programs_program_target}, /* dup */
694 {"collections.group.parts.part.description.programs.program.after", st_collections_group_programs_program_after}, /* dup */
695 {"collections.group.parts.part.description.programs.program.api", st_collections_group_programs_program_api}, /* dup */
696 {"collections.group.parts.part.description.program.name", st_collections_group_programs_program_name}, /* dup */
697 {"collections.group.parts.part.description.program.signal", st_collections_group_programs_program_signal}, /* dup */
698 {"collections.group.parts.part.description.program.source", st_collections_group_programs_program_source}, /* dup */
699 {"collections.group.parts.part.description.program.in", st_collections_group_programs_program_in}, /* dup */
700 {"collections.group.parts.part.description.program.action", st_collections_group_programs_program_action}, /* dup */
701 {"collections.group.parts.part.description.program.transition", st_collections_group_programs_program_transition}, /* dup */
702 {"collections.group.parts.part.description.program.target", st_collections_group_programs_program_target}, /* dup */
703 {"collections.group.parts.part.description.program.after", st_collections_group_programs_program_after}, /* dup */
704 {"collections.group.parts.part.description.program.api", st_collections_group_programs_program_api}, /* dup */
705 {"collections.group.parts.part.programs.image", st_images_image}, /* dup */
706 {"collections.group.parts.part.programs.set.name", st_images_set_name},
707 {"collections.group.parts.part.programs.set.image.image", st_images_set_image_image},
708 {"collections.group.parts.part.programs.set.image.size", st_images_set_image_size},
709 {"collections.group.parts.part.programs.images.image", st_images_image}, /* dup */
710 {"collections.group.parts.part.programs.images.set.name", st_images_set_name},
711 {"collections.group.parts.part.programs.images.set.image.image", st_images_set_image_image},
712 {"collections.group.parts.part.programs.images.set.image.size", st_images_set_image_size},
713 {"collections.group.parts.part.programs.font", st_fonts_font}, /* dup */
714 {"collections.group.parts.part.programs.fonts.font", st_fonts_font}, /* dup */
715 {"collections.group.parts.part.programs.program.name", st_collections_group_programs_program_name}, /* dup */
716 {"collections.group.parts.part.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
717 {"collections.group.parts.part.programs.program.source", st_collections_group_programs_program_source}, /* dup */
718 {"collections.group.parts.part.programs.program.in", st_collections_group_programs_program_in}, /* dup */
719 {"collections.group.parts.part.programs.program.action", st_collections_group_programs_program_action}, /* dup */
720 {"collections.group.parts.part.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
721 {"collections.group.parts.part.programs.program.target", st_collections_group_programs_program_target}, /* dup */
722 {"collections.group.parts.part.programs.program.after", st_collections_group_programs_program_after}, /* dup */
723 {"collections.group.parts.part.programs.program.api", st_collections_group_programs_program_api}, /* dup */
724 {"collections.group.parts.part.program.name", st_collections_group_programs_program_name}, /* dup */
725 {"collections.group.parts.part.program.signal", st_collections_group_programs_program_signal}, /* dup */
726 {"collections.group.parts.part.program.source", st_collections_group_programs_program_source}, /* dup */
727 {"collections.group.parts.part.program.in", st_collections_group_programs_program_in}, /* dup */
728 {"collections.group.parts.part.program.action", st_collections_group_programs_program_action}, /* dup */
729 {"collections.group.parts.part.program.transition", st_collections_group_programs_program_transition}, /* dup */
730 {"collections.group.parts.part.program.target", st_collections_group_programs_program_target}, /* dup */
731 {"collections.group.parts.part.program.after", st_collections_group_programs_program_after}, /* dup */
732 {"collections.group.parts.part.program.api", st_collections_group_programs_program_api}, /* dup */
733 {"collections.group.parts.programs.image", st_images_image}, /* dup */
734 {"collections.group.parts.programs.set.name", st_images_set_name},
735 {"collections.group.parts.programs.set.image.image", st_images_set_image_image},
736 {"collections.group.parts.programs.set.image.size", st_images_set_image_size},
737 {"collections.group.parts.programs.images.image", st_images_image}, /* dup */
738 {"collections.group.parts.programs.images.set.name", st_images_set_name},
739 {"collections.group.parts.programs.images.set.image.image", st_images_set_image_image},
740 {"collections.group.parts.programs.images.set.image.size", st_images_set_image_size},
741 {"collections.group.parts.programs.font", st_fonts_font}, /* dup */
742 {"collections.group.parts.programs.fonts.font", st_fonts_font}, /* dup */
743 {"collections.group.parts.programs.program.name", st_collections_group_programs_program_name}, /* dup */
744 {"collections.group.parts.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
745 {"collections.group.parts.programs.program.source", st_collections_group_programs_program_source}, /* dup */
746 {"collections.group.parts.programs.program.filter", st_collections_group_programs_program_filter}, /* dup */
747 {"collections.group.parts.programs.program.in", st_collections_group_programs_program_in}, /* dup */
748 {"collections.group.parts.programs.program.action", st_collections_group_programs_program_action}, /* dup */
749 {"collections.group.parts.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
750 {"collections.group.parts.programs.program.target", st_collections_group_programs_program_target}, /* dup */
751 {"collections.group.parts.programs.program.after", st_collections_group_programs_program_after},
752 {"collections.group.parts.programs.program.api", st_collections_group_programs_program_api},
753 {"collections.group.parts.program.name", st_collections_group_programs_program_name}, /* dup */
754 {"collections.group.parts.program.signal", st_collections_group_programs_program_signal}, /* dup */
755 {"collections.group.parts.program.source", st_collections_group_programs_program_source}, /* dup */
756 {"collections.group.parts.program.filter", st_collections_group_programs_program_filter}, /* dup */
757 {"collections.group.parts.program.in", st_collections_group_programs_program_in}, /* dup */
758 {"collections.group.parts.program.action", st_collections_group_programs_program_action}, /* dup */
759 {"collections.group.parts.program.transition", st_collections_group_programs_program_transition}, /* dup */
760 {"collections.group.parts.program.target", st_collections_group_programs_program_target}, /* dup */
761 {"collections.group.parts.program.after", st_collections_group_programs_program_after}, /* dup */
762 {"collections.group.parts.program.api", st_collections_group_programs_program_api}, /* dup */
763#ifdef HAVE_EPHYSICS
764 {"collections.group.physics.world.gravity", st_collections_group_physics_world_gravity},
765 {"collections.group.physics.world.rate", st_collections_group_physics_world_rate},
766 {"collections.group.physics.world.z", st_collections_group_physics_world_z},
767 {"collections.group.physics.world.depth", st_collections_group_physics_world_depth},
768#endif
769 {"collections.group.program.name", st_collections_group_programs_program_name}, /* dup */
770 {"collections.group.program.signal", st_collections_group_programs_program_signal}, /* dup */
771 {"collections.group.program.source", st_collections_group_programs_program_source}, /* dup */
772 {"collections.group.program.filter", st_collections_group_programs_program_filter}, /* dup */
773 {"collections.group.program.in", st_collections_group_programs_program_in}, /* dup */
774 {"collections.group.program.action", st_collections_group_programs_program_action}, /* dup */
775 {"collections.group.program.transition", st_collections_group_programs_program_transition}, /* dup */
776 {"collections.group.program.target", st_collections_group_programs_program_target}, /* dup */
777 {"collections.group.program.after", st_collections_group_programs_program_after}, /* dup */
778 {"collections.group.program.api", st_collections_group_programs_program_api}, /* dup */
779 {"collections.group.programs.program.name", st_collections_group_programs_program_name},
780 {"collections.group.programs.program.signal", st_collections_group_programs_program_signal},
781 {"collections.group.programs.program.source", st_collections_group_programs_program_source},
782 {"collections.group.programs.program.filter", st_collections_group_programs_program_filter}, /* dup */
783 {"collections.group.programs.program.in", st_collections_group_programs_program_in},
784 {"collections.group.programs.program.action", st_collections_group_programs_program_action},
785 {"collections.group.programs.program.transition", st_collections_group_programs_program_transition},
786 {"collections.group.programs.program.target", st_collections_group_programs_program_target},
787 {"collections.group.programs.program.after", st_collections_group_programs_program_after},
788 {"collections.group.programs.program.api", st_collections_group_programs_program_api},
789 {"collections.group.programs.image", st_images_image}, /* dup */
790 {"collections.group.programs.set.name", st_images_set_name},
791 {"collections.group.programs.set.image.image", st_images_set_image_image},
792 {"collections.group.programs.set.image.size", st_images_set_image_size},
793 {"collections.group.programs.images.image", st_images_image}, /* dup */
794 {"collections.group.programs.images.set.name", st_images_set_name},
795 {"collections.group.programs.images.set.image.image", st_images_set_image_image},
796 {"collections.group.programs.images.set.image.size", st_images_set_image_size},
797 {"collections.group.programs.font", st_fonts_font}, /* dup */
798 {"collections.group.programs.fonts.font", st_fonts_font} /* dup */
799};
800
801New_Object_Handler object_handlers[] =
802{
803 {"externals", NULL},
804 {"images", NULL},
805 {"images.set", ob_images_set},
806 {"images.set.image", ob_images_set_image},
807 {"fonts", NULL},
808 {"data", NULL},
809 {"styles", NULL},
810 {"styles.style", ob_styles_style},
811 {"color_classes", NULL},
812 {"color_classes.color_class", ob_color_class},
813 {"spectra", NULL},
814 {"collections", ob_collections},
815 {"collections.externals", NULL}, /* dup */
816 {"collections.set", ob_images_set}, /* dup */
817 {"collections.set.image", ob_images_set_image}, /* dup */
818 {"collections.images", NULL}, /* dup */
819 {"collections.images.set", ob_images_set}, /* dup */
820 {"collections.images.set.image", ob_images_set_image}, /* dup */
821 {"collections.fonts", NULL}, /* dup */
822 {"collections.styles", NULL}, /* dup */
823 {"collections.styles.style", ob_styles_style}, /* dup */
824 {"collections.color_classes", NULL}, /* dup */
825 {"collections.color_classes.color_class", ob_color_class}, /* dup */
826 {"collections.sounds", NULL},
827 {"collections.group.sounds", NULL}, /* dup */
828 {"collections.sounds.sample", NULL},
829 {"collections.group.sounds.sample", NULL}, /* dup */
830 {"collections.group", ob_collections_group},
831 {"collections.group.data", NULL},
832 {"collections.group.limits", NULL},
833 {"collections.group.script", ob_collections_group_script},
834 {"collections.group.lua_script", ob_collections_group_lua_script},
835 {"collections.group.externals", NULL}, /* dup */
836 {"collections.group.set", ob_images_set}, /* dup */
837 {"collections.group.set.image", ob_images_set_image}, /* dup */
838 {"collections.group.images", NULL}, /* dup */
839 {"collections.group.images.set", ob_images_set}, /* dup */
840 {"collections.group.images.set.image", ob_images_set_image}, /* dup */
841 {"collections.group.fonts", NULL}, /* dup */
842 {"collections.group.styles", NULL}, /* dup */
843 {"collections.group.styles.style", ob_styles_style}, /* dup */
844 {"collections.group.color_classes", NULL}, /* dup */
845 {"collections.group.color_classes.color_class", ob_color_class}, /* dup */
846 {"collections.group.parts", NULL},
847 {"collections.group.parts.set", ob_images_set}, /* dup */
848 {"collections.group.parts.set.image", ob_images_set_image}, /* dup */
849 {"collections.group.parts.images", NULL}, /* dup */
850 {"collections.group.parts.images.set", ob_images_set}, /* dup */
851 {"collections.group.parts.images.set.image", ob_images_set_image}, /* dup */
852 {"collections.group.parts.fonts", NULL}, /* dup */
853 {"collections.group.parts.styles", NULL}, /* dup */
854 {"collections.group.parts.styles.style", ob_styles_style}, /* dup */
855 {"collections.group.parts.color_classes", NULL}, /* dup */
856 {"collections.group.parts.color_classes.color_class", ob_color_class}, /* dup */
857 {"collections.group.parts.part", ob_collections_group_parts_part},
858 {"collections.group.parts.part.dragable", NULL},
859 {"collections.group.parts.part.set", ob_images_set}, /* dup */
860 {"collections.group.parts.part.set.image", ob_images_set_image}, /* dup */
861 {"collections.group.parts.part.images", NULL}, /* dup */
862 {"collections.group.parts.part.images.set", ob_images_set}, /* dup */
863 {"collections.group.parts.part.images.set.image", ob_images_set_image}, /* dup */
864 {"collections.group.parts.part.fonts", NULL}, /* dup */
865 {"collections.group.parts.part.styles", NULL}, /* dup */
866 {"collections.group.parts.part.styles.style", ob_styles_style}, /* dup */
867 {"collections.group.parts.part.color_classes", NULL}, /* dup */
868 {"collections.group.parts.part.color_classes.color_class", ob_color_class}, /* dup */
869 {"collections.group.parts.part.box", NULL},
870 {"collections.group.parts.part.box.items", NULL},
871 {"collections.group.parts.part.box.items.item", ob_collections_group_parts_part_box_items_item},
872 {"collections.group.parts.part.table", NULL},
873 {"collections.group.parts.part.table.items", NULL},
874 {"collections.group.parts.part.table.items.item", ob_collections_group_parts_part_box_items_item}, /* dup */
875 {"collections.group.parts.part.description", ob_collections_group_parts_part_description},
876 {"collections.group.parts.part.description.rel1", NULL},
877 {"collections.group.parts.part.description.rel2", NULL},
878 {"collections.group.parts.part.description.image", NULL}, /* dup */
879 {"collections.group.parts.part.description.image.set", ob_images_set}, /* dup */
880 {"collections.group.parts.part.description.image.set.image", ob_images_set_image}, /* dup */
881 {"collections.group.parts.part.description.image.images", NULL}, /* dup */
882 {"collections.group.parts.part.description.image.images.set", ob_images_set}, /* dup */
883 {"collections.group.parts.part.description.image.images.set.image", ob_images_set_image}, /* dup */
884 {"collections.group.parts.part.description.fill", NULL},
885 {"collections.group.parts.part.description.fill.origin", NULL},
886 {"collections.group.parts.part.description.fill.size", NULL},
887 {"collections.group.parts.part.description.text", NULL},
888 {"collections.group.parts.part.description.text.fonts", NULL}, /* dup */
889 {"collections.group.parts.part.description.images", NULL}, /* dup */
890 {"collections.group.parts.part.description.images.set", ob_images_set}, /* dup */
891 {"collections.group.parts.part.description.images.set.image", ob_images_set_image}, /* dup */
892 {"collections.group.parts.part.description.fonts", NULL}, /* dup */
893 {"collections.group.parts.part.description.styles", NULL}, /* dup */
894 {"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
895 {"collections.group.parts.part.description.box", NULL},
896 {"collections.group.parts.part.description.table", NULL},
897#ifdef HAVE_EPHYSICS
898 {"collections.group.parts.part.description.physics", NULL},
899 {"collections.group.parts.part.description.physics.movement_freedom", NULL},
900 {"collections.group.parts.part.description.physics.faces", NULL},
901 {"collections.group.parts.part.description.physics.faces.face", st_collections_group_parts_part_description_physics_face},
902#endif
903 {"collections.group.parts.part.description.map", NULL},
904 {"collections.group.parts.part.description.map.rotation", NULL},
905 {"collections.group.parts.part.description.perspective", NULL},
906 {"collections.group.parts.part.description.params", NULL},
907 {"collections.group.parts.part.description.color_classes", NULL}, /* dup */
908 {"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */
909 {"collections.group.parts.part.description.program", ob_collections_group_programs_program}, /* dup */
910 {"collections.group.parts.part.description.program.script", ob_collections_group_programs_program_script}, /* dup */
911 {"collections.group.parts.part.description.programs", NULL}, /* dup */
912 {"collections.group.parts.part.description.programs.set", ob_images_set}, /* dup */
913 {"collections.group.parts.part.description.programs.set.image", ob_images_set_image}, /* dup */
914 {"collections.group.parts.part.description.programs.images", NULL}, /* dup */
915 {"collections.group.parts.part.description.programs.images.set", ob_images_set},
916 {"collections.group.parts.part.description.programs.images.set.image", ob_images_set_image}, /* dup */
917 {"collections.group.parts.part.description.programs.fonts", NULL}, /* dup */
918 {"collections.group.parts.part.description.programs.program", ob_collections_group_programs_program}, /* dup */
919 {"collections.group.parts.part.description.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
920 {"collections.group.parts.part.description.script", ob_collections_group_script}, /* dup */
921 {"collections.group.parts.part.program", ob_collections_group_programs_program}, /* dup */
922 {"collections.group.parts.part.program.script", ob_collections_group_programs_program_script}, /* dup */
923 {"collections.group.parts.part.programs", NULL}, /* dup */
924 {"collections.group.parts.part.programs.set", ob_images_set}, /* dup */
925 {"collections.group.parts.part.programs.set.image", ob_images_set_image}, /* dup */
926 {"collections.group.parts.part.programs.images", NULL}, /* dup */
927 {"collections.group.parts.part.programs.images.set", ob_images_set}, /* dup */
928 {"collections.group.parts.part.programs.images.set.image", ob_images_set_image}, /* dup */
929 {"collections.group.parts.part.programs.fonts", NULL}, /* dup */
930 {"collections.group.parts.part.programs.program", ob_collections_group_programs_program}, /* dup */
931 {"collections.group.parts.part.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
932 {"collections.group.parts.part.script", ob_collections_group_script}, /* dup */
933 {"collections.group.parts.program", ob_collections_group_programs_program}, /* dup */
934 {"collections.group.parts.program.script", ob_collections_group_programs_program_script}, /* dup */
935 {"collections.group.parts.programs", NULL}, /* dup */
936 {"collections.group.parts.programs.set", ob_images_set}, /* dup */
937 {"collections.group.parts.programs.set.image", ob_images_set_image}, /* dup */
938 {"collections.group.parts.programs.images", NULL}, /* dup */
939 {"collections.group.parts.programs.images.set", ob_images_set}, /* dup */
940 {"collections.group.parts.programs.images.set.image", ob_images_set_image}, /* dup */
941 {"collections.group.parts.programs.fonts", NULL}, /* dup */
942 {"collections.group.parts.programs.program", ob_collections_group_programs_program}, /* dup */
943 {"collections.group.parts.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
944 {"collections.group.parts.script", ob_collections_group_script}, /* dup */
945#ifdef HAVE_EPHYSICS
946 {"collections.group.physics", NULL},
947 {"collections.group.physics.world", NULL},
948#endif
949 {"collections.group.program", ob_collections_group_programs_program}, /* dup */
950 {"collections.group.program.script", ob_collections_group_programs_program_script}, /* dup */
951 {"collections.group.programs", NULL},
952 {"collections.group.programs.set", ob_images_set}, /* dup */
953 {"collections.group.programs.set.image", ob_images_set_image}, /* dup */
954 {"collections.group.programs.images", NULL}, /* dup */
955 {"collections.group.programs.images.set", ob_images_set}, /* dup */
956 {"collections.group.programs.images.set.image", ob_images_set_image}, /* dup */
957 {"collections.group.programs.fonts", NULL}, /* dup */
958 {"collections.group.programs.program", ob_collections_group_programs_program},
959 {"collections.group.programs.program.script", ob_collections_group_programs_program_script},
960 {"collections.group.programs.script", ob_collections_group_script} /* dup */
961};
962
963New_Nested_Handler nested_handlers[] = {
964 {"collections.group.parts", "part", NULL, edje_cc_handlers_hierarchy_pop }
965};
966
967/*****/
968
969int
970object_handler_num(void)
971{
972 return sizeof(object_handlers) / sizeof (New_Object_Handler);
973}
974
975int
976statement_handler_num(void)
977{
978 return sizeof(statement_handlers) / sizeof (New_Object_Handler);
979}
980
981int
982nested_handler_num(void)
983{
984 return sizeof(nested_handlers) / sizeof (New_Nested_Handler);
985}
986
987static void
988_edje_part_description_fill(Edje_Part_Description_Spec_Fill *fill)
989{
990 fill->smooth = 1;
991 fill->pos_rel_x = FROM_DOUBLE(0.0);
992 fill->pos_abs_x = 0;
993 fill->rel_x = FROM_DOUBLE(1.0);
994 fill->abs_x = 0;
995 fill->pos_rel_y = FROM_DOUBLE(0.0);
996 fill->pos_abs_y = 0;
997 fill->rel_y = FROM_DOUBLE(1.0);
998 fill->abs_y = 0;
999 fill->angle = 0;
1000 fill->spread = 0;
1001 fill->type = EDJE_FILL_TYPE_SCALE;
1002}
1003
1004static void
1005_edje_part_description_image_remove(Edje_Part_Description_Image *ed)
1006{
1007 unsigned int j;
1008
1009 if (!ed) return;
1010
1011 data_queue_image_remove(&(ed->image.id), &(ed->image.set));
1012
1013 for (j = 0; j < ed->image.tweens_count; ++j)
1014 data_queue_image_remove(&(ed->image.tweens[j]->id),
1015 &(ed->image.tweens[j]->set));
1016}
1017
1018void
1019part_description_image_cleanup(Edje_Part *ep)
1020{
1021 Edje_Part_Description_Image *ed;
1022 unsigned int j;
1023
1024 if (ep->type != EDJE_PART_TYPE_IMAGE)
1025 return ;
1026
1027 ed = (Edje_Part_Description_Image*) ep->default_desc;
1028 _edje_part_description_image_remove(ed);
1029
1030 for (j = 0; j < ep->other.desc_count; j++)
1031 {
1032 ed = (Edje_Part_Description_Image*) ep->other.desc[j];
1033 _edje_part_description_image_remove(ed);
1034 }
1035}
1036
1037static Edje_Part_Description_Common *
1038_edje_part_description_alloc(unsigned char type, const char *collection, const char *part)
1039{
1040 Edje_Part_Description_Common *result = NULL;
1041
1042 switch (type)
1043 {
1044 case EDJE_PART_TYPE_SPACER:
1045 case EDJE_PART_TYPE_RECTANGLE:
1046 case EDJE_PART_TYPE_SWALLOW:
1047 case EDJE_PART_TYPE_GROUP:
1048 result = mem_alloc(SZ(Edje_Part_Description_Common));
1049 break;
1050 case EDJE_PART_TYPE_TEXT:
1051 case EDJE_PART_TYPE_TEXTBLOCK:
1052 {
1053 Edje_Part_Description_Text *ed;
1054
1055 ed = mem_alloc(SZ(Edje_Part_Description_Text));
1056
1057 ed->text.color3.r = 0;
1058 ed->text.color3.g = 0;
1059 ed->text.color3.b = 0;
1060 ed->text.color3.a = 128;
1061 ed->text.align.x = FROM_DOUBLE(0.5);
1062 ed->text.align.y = FROM_DOUBLE(0.5);
1063 ed->text.id_source = -1;
1064 ed->text.id_text_source = -1;
1065
1066 result = &ed->common;
1067 break;
1068 }
1069 case EDJE_PART_TYPE_IMAGE:
1070 {
1071 Edje_Part_Description_Image *ed;
1072
1073 ed = mem_alloc(SZ(Edje_Part_Description_Image));
1074
1075 ed->image.id = -1;
1076
1077 _edje_part_description_fill(&ed->image.fill);
1078
1079 result = &ed->common;
1080 break;
1081 }
1082 case EDJE_PART_TYPE_PROXY:
1083 {
1084 Edje_Part_Description_Proxy *ed;
1085
1086 ed = mem_alloc(SZ(Edje_Part_Description_Proxy));
1087
1088 ed->proxy.id = -1;
1089
1090 _edje_part_description_fill(&ed->proxy.fill);
1091
1092 result = &ed->common;
1093 break;
1094 }
1095 case EDJE_PART_TYPE_BOX:
1096 {
1097 Edje_Part_Description_Box *ed;
1098
1099 ed = mem_alloc(SZ(Edje_Part_Description_Box));
1100
1101 ed->box.layout = NULL;
1102 ed->box.alt_layout = NULL;
1103 ed->box.align.x = FROM_DOUBLE(0.5);
1104 ed->box.align.y = FROM_DOUBLE(0.5);
1105 ed->box.padding.x = 0;
1106 ed->box.padding.y = 0;
1107
1108 result = &ed->common;
1109 break;
1110 }
1111 case EDJE_PART_TYPE_TABLE:
1112 {
1113 Edje_Part_Description_Table *ed;
1114
1115 ed = mem_alloc(SZ(Edje_Part_Description_Table));
1116
1117 ed->table.homogeneous = EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE;
1118 ed->table.align.x = FROM_DOUBLE(0.5);
1119 ed->table.align.y = FROM_DOUBLE(0.5);
1120 ed->table.padding.x = 0;
1121 ed->table.padding.y = 0;
1122
1123 result = &ed->common;
1124 break;
1125 }
1126 case EDJE_PART_TYPE_EXTERNAL:
1127 {
1128 Edje_Part_Description_External *ed;
1129
1130 ed = mem_alloc(SZ(Edje_Part_Description_External));
1131
1132 ed->external_params = NULL;
1133
1134 result = &ed->common;
1135 break;
1136 }
1137 }
1138
1139 if (!result)
1140 {
1141 ERR("Unknown type %i of part %s in collection %s.",
1142 type, part, collection);
1143 exit(-1);
1144 }
1145
1146#ifdef HAVE_EPHYSICS
1147 result->physics.mass = FROM_DOUBLE(1.0);
1148 result->physics.friction = FROM_DOUBLE(0.5);
1149 result->physics.sleep.linear = FROM_DOUBLE(24);
1150 result->physics.sleep.angular = FROM_DOUBLE(57.29);
1151 result->physics.hardness = FROM_DOUBLE(1.0);
1152 result->physics.ignore_part_pos = 1;
1153 result->physics.mov_freedom.lin.x = 1;
1154 result->physics.mov_freedom.lin.y = 1;
1155 result->physics.mov_freedom.ang.z = 1;
1156 result->physics.z = -15;
1157 result->physics.depth = 30;
1158#endif
1159
1160 return result;
1161}
1162
1163static void
1164_edje_program_check(const char *name, Edje_Program *me, Edje_Program **pgrms, unsigned int count)
1165{
1166 Edje_Part_Collection *pc;
1167 unsigned int i;
1168 Edje_Program_Parser *epp;
1169
1170 pc = eina_list_data_get(eina_list_last(edje_collections));
1171
1172 for (i = 0; i < count; ++i)
1173 if (pgrms[i]->name)
1174 if (pgrms[i] != me && (!strcmp(name, pgrms[i]->name)))
1175 {
1176 epp = (Edje_Program_Parser *)pgrms[i];
1177 if (!epp->can_override)
1178 {
1179 ERR("parse error %s:%i. There is already a program of the name %s",
1180 file_in, line - 1, name);
1181 exit(-1);
1182 }
1183 else
1184 {
1185 _edje_program_remove(pc, me);
1186 current_program = pgrms[i];
1187 epp->can_override = EINA_FALSE;
1188 return;
1189 }
1190 }
1191}
1192
1193static void
1194_edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
1195{
1196 Edje_Part_Collection *pc;
1197 Edje_Program_Target *et, *et2;
1198 Edje_Program_After *pa, *pa2;
1199 Edje_Program_Parser *epp;
1200 Eina_List *l;
1201 char *name;
1202 char *copy;
1203
1204 pc = eina_list_data_get(eina_list_last(edje_collections));
1205
1206 #define STRDUP(x) x ? strdup(x) : NULL
1207 ep->name = STRDUP(ep2->name);
1208
1209 _edje_program_remove(pc, current_program);
1210 ep->signal = STRDUP(ep2->signal);
1211 ep->source = STRDUP(ep2->source);
1212 _edje_program_insert(pc, current_program);
1213
1214 ep->filter.part = STRDUP(ep2->filter.part);
1215 ep->filter.state = STRDUP(ep2->filter.state);
1216 ep->in.from = ep2->in.from;
1217 ep->in.range = ep2->in.range;
1218 ep->action = ep2->action;
1219 ep->state = STRDUP(ep2->state);
1220 ep->state2 = STRDUP(ep2->state2);
1221 ep->value = ep2->value;
1222 ep->value2 = ep2->value2;
1223 ep->tween.mode = ep2->tween.mode;
1224 ep->tween.time = ep2->tween.time;
1225 ep->tween.v1 = ep2->tween.v1;
1226 ep->tween.v2 = ep2->tween.v2;
1227 ep->sample_name = STRDUP(ep2->sample_name);
1228 ep->tone_name = STRDUP(ep2->tone_name);
1229 ep->duration = ep2->duration;
1230 ep->speed = ep2->speed;
1231
1232 EINA_LIST_FOREACH(ep2->targets, l, et2)
1233 {
1234 name = (char*) (et2 + 1);
1235 et = mem_alloc(SZ(Edje_Program_Target) + strlen(name) + 1);
1236 ep->targets = eina_list_append(ep->targets, et);
1237 copy = (char*) (et + 1);
1238
1239 memcpy(copy, name, strlen(name) + 1);
1240
1241 if (ep2->action == EDJE_ACTION_TYPE_STATE_SET)
1242 data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
1243 else if (ep2->action == EDJE_ACTION_TYPE_ACTION_STOP)
1244 data_queue_copied_program_lookup(pc, &(et2->id), &(et->id));
1245 else if (ep2->action == EDJE_ACTION_TYPE_SCRIPT)
1246 data_queue_copied_program_lookup(pc, &(et2->id), &(et->id));
1247 else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_SET)
1248 data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
1249 else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP)
1250 data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
1251 else if (ep2->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE)
1252 data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
1253 else if (ep2->action == EDJE_ACTION_TYPE_FOCUS_SET)
1254
1255 data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
1256 else if (ep2->action == EDJE_ACTION_TYPE_FOCUS_OBJECT)
1257 data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
1258 else
1259 {
1260 ERR("parse error %s:%i. target may only be used after action",
1261 file_in, line - 1);
1262 exit(-1);
1263 }
1264 }
1265
1266 EINA_LIST_FOREACH(ep2->after, l, pa2)
1267 {
1268 name = (char*) (pa2 + 1);
1269 pa = mem_alloc(SZ(Edje_Program_After) + strlen(name) + 1);
1270 ep->after = eina_list_append(ep->after, pa);
1271 copy = (char*) (pa + 1);
1272 memcpy(copy, name, strlen(name) + 1);
1273 data_queue_copied_program_lookup(pc, &(pa2->id), &(pa->id));
1274 }
1275
1276 ep->api.name = STRDUP(ep2->api.name);
1277 ep->api.description = STRDUP(ep2->api.description);
1278 data_queue_copied_part_lookup(pc, &(ep2->param.src), &(ep->param.src));
1279 data_queue_copied_part_lookup(pc, &(ep2->param.dst), &(ep->param.dst));
1280
1281 epp = (Edje_Program_Parser *)ep;
1282 epp->can_override = EINA_TRUE;
1283
1284 #undef STRDUP
1285}
1286
1287/*****/
1288
1289/**
1290 @edcsection{toplevel,Top-Level blocks}
1291 */
1292
1293/**
1294 @edcsubsection{toplevel_externals,Externals}
1295 */
1296
1297/**
1298 @page edcref
1299
1300 @block
1301 externals
1302 @context
1303 externals {
1304 external: "name";
1305 }
1306 @description
1307 The "externals" block is used to list each external module file that will be used in others
1308 programs.
1309 @endblock
1310
1311 @property
1312 external
1313 @parameters
1314 [external filename]
1315 @effect
1316 Used to add a file to the externals list.
1317 @endproperty
1318 */
1319static void
1320st_externals_external(void)
1321{
1322 External *ex;
1323
1324 check_arg_count(1);
1325
1326 if (!edje_file->external_dir)
1327 edje_file->external_dir = mem_alloc(SZ(Edje_External_Directory));
1328
1329 ex = mem_alloc(SZ(External));
1330 ex->name = parse_str(0);
1331 {
1332 Eina_List *l;
1333 External *lex;
1334
1335 EINA_LIST_FOREACH(externals, l, lex)
1336 {
1337 if (!strcmp(lex->name, ex->name))
1338 {
1339 free(ex->name);
1340 free(ex);
1341 return;
1342 }
1343 }
1344 }
1345 externals = eina_list_append(externals, ex);
1346
1347 if (edje_file->external_dir)
1348 {
1349 edje_file->external_dir->entries_count++;
1350 edje_file->external_dir->entries = realloc(edje_file->external_dir->entries,
1351 sizeof (Edje_External_Directory) * edje_file->external_dir->entries_count);
1352 memset(edje_file->external_dir->entries + edje_file->external_dir->entries_count - 1,
1353 0, sizeof (Edje_External_Directory));
1354 if (!edje_file->external_dir->entries)
1355 {
1356 ERR("not enough memory");
1357 exit(-1);
1358 }
1359
1360 edje_file->external_dir->entries[edje_file->external_dir->entries_count - 1].entry = mem_strdup(ex->name);
1361 }
1362}
1363
1364/**
1365 @edcsubsection{toplevel_images,Images}
1366 */
1367
1368/**
1369 @page edcref
1370
1371 @block
1372 images
1373 @context
1374 images {
1375 image: "filename1.ext" COMP;
1376 image: "filename2.ext" LOSSY 99;
1377 set {
1378 name: "image_name_used";
1379 image {
1380 image: "filename3.ext" LOSSY 90;
1381 size: 201 201 500 500;
1382 }
1383 image {
1384 image: "filename4.ext" COMP;
1385 size: 51 51 200 200;
1386 }
1387 image {
1388 image: "filename5.ext" COMP;
1389 size: 11 11 50 50;
1390 }
1391 image {
1392 image: "filename6.ext" RAW;
1393 size: 0 0 10 10;
1394 }
1395 }
1396 ..
1397 }
1398 @description
1399 The "images" block is used to list each image file that will be used in
1400 the theme along with its compression method (if any).
1401 Besides the document's root, additional "images" blocks can be
1402 included inside other blocks, normally "collections", "group" and
1403 "part", easing maintenance of the file list when the theme is split
1404 among multiple files.
1405 @endblock
1406
1407 @property
1408 image
1409 @parameters
1410 [image file] [compression method] (compression level)
1411 @effect
1412 Used to include each image file. The full path to the directory holding
1413 the images can be defined later with edje_cc's "-id" option.
1414 Compression methods:
1415 @li RAW: Uncompressed.
1416 @li COMP: Lossless compression.
1417 @li LOSSY [0-100]: Lossy compression with quality from 0 to 100.
1418 @li USER: Do not embed the file, refer to the external file instead.
1419 @endproperty
1420 */
1421static void
1422st_images_image(void)
1423{
1424 Edje_Image_Directory_Entry *img;
1425 const char *tmp;
1426 unsigned int i;
1427 int v;
1428
1429 check_min_arg_count(2);
1430
1431 if (!edje_file->image_dir)
1432 edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
1433
1434 tmp = parse_str(0);
1435
1436 for (i = 0; i < edje_file->image_dir->entries_count; ++i)
1437 if (!strcmp(edje_file->image_dir->entries[i].entry, tmp))
1438 {
1439 free((char*) tmp);
1440 return;
1441 }
1442
1443 edje_file->image_dir->entries_count++;
1444 edje_file->image_dir->entries = realloc(edje_file->image_dir->entries,
1445 sizeof (Edje_Image_Directory_Entry) * edje_file->image_dir->entries_count);
1446 memset(edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1,
1447 0, sizeof (Edje_Image_Directory_Entry));
1448 if (!edje_file->image_dir->entries)
1449 {
1450 ERR("No enough memory.");
1451 exit(-1);
1452 }
1453
1454 img = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1;
1455
1456 img->entry = tmp;
1457 img->id = edje_file->image_dir->entries_count - 1;
1458 v = parse_enum(1,
1459 "RAW", 0,
1460 "COMP", 1,
1461 "LOSSY", 2,
1462 "USER", 3,
1463 NULL);
1464 if (v == 0)
1465 {
1466 img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
1467 img->source_param = 0;
1468 }
1469 else if (v == 1)
1470 {
1471 img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
1472 img->source_param = 1;
1473 }
1474 else if (v == 2)
1475 {
1476 img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY;
1477 img->source_param = 0;
1478 }
1479 else if (v == 3)
1480 {
1481 img->source_type = EDJE_IMAGE_SOURCE_TYPE_EXTERNAL;
1482 img->source_param = 0;
1483 }
1484 if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY)
1485 check_arg_count(2);
1486 else
1487 {
1488 img->source_param = parse_int_range(2, 0, 100);
1489 check_arg_count(3);
1490 }
1491}
1492
1493/**
1494 @edcsubsection{toplevel_images_set,Set}
1495 */
1496
1497/**
1498 @page edcref
1499
1500 @block
1501 set
1502 @context
1503 set {
1504 name: "image_name_used";
1505 image {
1506 image: "filename3.ext" LOSSY 90;
1507 size: 201 201 500 500;
1508 }
1509 image {
1510 image: "filename4.ext" COMP;
1511 size: 51 51 200 200;
1512 }
1513 image {
1514 image: "filename5.ext" COMP;
1515 size: 11 11 50 50;
1516 }
1517 image {
1518 image: "filename6.ext" RAW;
1519 size: 0 0 10 10;
1520 }
1521 }
1522 @description
1523 The "set" block is used to define an image with different content depending on their size.
1524 Besides the document's root, additional "set" blocks can be
1525 included inside other blocks, normally "collections", "group" and
1526 "part", easing maintenance of the file list when the theme is split
1527 among multiple files.
1528 @endblock
1529 */
1530static void
1531ob_images_set(void)
1532{
1533 if (!edje_file->image_dir)
1534 edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
1535
1536 edje_file->image_dir->sets_count++;
1537 edje_file->image_dir->sets = realloc(edje_file->image_dir->sets,
1538 sizeof (Edje_Image_Directory_Set) * edje_file->image_dir->sets_count);
1539 memset(edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1,
1540 0, sizeof (Edje_Image_Directory_Set));
1541 if (!edje_file->image_dir->sets)
1542 {
1543 ERR("Not enough memory.");
1544 exit(-1);
1545 }
1546 edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1;
1547}
1548
1549/**
1550 @page edcref
1551
1552 @property
1553 name
1554 @parameters
1555 [image name]
1556 @effect
1557 Define the name that refer to this image description.
1558 @endproperty
1559*/
1560static void
1561st_images_set_name(void)
1562{
1563 check_arg_count(1);
1564
1565 edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].name = parse_str(0);
1566}
1567
1568/**
1569 @edcsubsection{toplevel_images_image,Image}
1570 */
1571
1572/**
1573 @page edcref
1574
1575 @block
1576 image
1577 @description
1578 The "image" block inside a "set" block define the characteristic of an image.
1579 Every block will describe one image and the size rule to use it.
1580 @endblock
1581**/
1582static void
1583ob_images_set_image(void)
1584{
1585 Edje_Image_Directory_Set_Entry *entry;
1586 Edje_Image_Directory_Set *set;
1587
1588 set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1;
1589
1590 entry = mem_alloc(SZ(Edje_Image_Directory_Set_Entry));
1591
1592 set->entries = eina_list_append(set->entries, entry);
1593}
1594
1595/**
1596 @page edcref
1597
1598 @property
1599 image
1600 @parameters
1601 [image file] [compression method] (compression level)
1602 @effect
1603 Used to include each image file. The full path to the directory holding
1604 the images can be defined later with edje_cc's "-id" option.
1605 Compression methods:
1606 @li RAW: Uncompressed.
1607 @li COMP: Lossless compression.
1608 @li LOSSY [0-100]: Lossy compression with quality from 0 to 100.
1609 @li USER: Do not embed the file, refer to the external file instead.
1610 @endproperty
1611**/
1612static void
1613st_images_set_image_image(void)
1614{
1615 Edje_Image_Directory_Set_Entry *entry;
1616 Edje_Image_Directory_Set *set;
1617 unsigned int i;
1618
1619 set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1;
1620 entry = eina_list_data_get(eina_list_last(set->entries));
1621
1622 /* Add the image to the global pool with the same syntax. */
1623 st_images_image();
1624
1625 entry->name = parse_str(0);
1626
1627 for (i = 0; i < edje_file->image_dir->entries_count; ++i)
1628 if (!strcmp(edje_file->image_dir->entries[i].entry, entry->name))
1629 {
1630 entry->id = i;
1631 return;
1632 }
1633}
1634
1635/**
1636 @page edcref
1637
1638 @property
1639 size
1640 @parameters
1641 [minw minh maxw mawh]
1642 @effect
1643 Define the minimal and maximal size that will select the specified image.
1644 @endproperty
1645*/
1646static void
1647st_images_set_image_size(void)
1648{
1649 Edje_Image_Directory_Set_Entry *entry;
1650 Edje_Image_Directory_Set *set;
1651
1652 set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1;
1653 entry = eina_list_data_get(eina_list_last(set->entries));
1654
1655 entry->size.min.w = parse_int(0);
1656 entry->size.min.h = parse_int(1);
1657 entry->size.max.w = parse_int(2);
1658 entry->size.max.h = parse_int(3);
1659
1660 if (entry->size.min.w > entry->size.max.w
1661 || entry->size.min.h > entry->size.max.h)
1662 {
1663 ERR("parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
1664 file_in, line - 1,
1665 entry->size.min.w, entry->size.min.h,
1666 entry->size.max.w, entry->size.max.h);
1667 exit(-1);
1668 }
1669}
1670
1671/**
1672 @edcsubsection{toplevel_fonts,Fonts}
1673 */
1674
1675/**
1676 @page edcref
1677
1678 @block
1679 fonts
1680 @context
1681 fonts {
1682 font: "filename1.ext" "fontname";
1683 font: "filename2.ext" "otherfontname";
1684 ..
1685 }
1686 @description
1687 The "fonts" block is used to list each font file with an alias used later
1688 in the theme. As with the "images" block, additional "fonts" blocks can
1689 be included inside other blocks.
1690 @endblock
1691
1692 @property
1693 font
1694 @parameters
1695 [font filename] [font alias]
1696 @effect
1697 Defines each font "file" and "alias", the full path to the directory
1698 holding the font files can be defined with edje_cc's "-fd" option.
1699 @endproperty
1700 */
1701static void
1702st_fonts_font(void)
1703{
1704 Edje_Font *fn;
1705
1706 check_arg_count(2);
1707
1708 if (!edje_file->fonts)
1709 edje_file->fonts = eina_hash_string_small_new(free);
1710
1711 fn = mem_alloc(SZ(Edje_Font));
1712 fn->file = parse_str(0);
1713 fn->name = parse_str(1);
1714
1715 if (eina_hash_find(edje_file->fonts, fn->name))
1716 {
1717 free(fn->file);
1718 free(fn->name);
1719 free(fn);
1720 return;
1721 }
1722
1723 eina_hash_direct_add(edje_file->fonts, fn->name, fn);
1724}
1725
1726/**
1727 @edcsubsection{toplevel_data,Data}
1728 */
1729
1730/**
1731 @page edcref
1732 @block
1733 data
1734 @context
1735 data {
1736 item: "key" "value";
1737 file: "otherkey" "filename.ext";
1738 ..
1739 }
1740 @description
1741 The "data" block is used to pass arbitrary parameters from the theme to
1742 the application. Unlike the "images" and "fonts" blocks, additional
1743 "data" blocks can only be included inside the "group" block.
1744 @endblock
1745
1746 @property
1747 item
1748 @parameters
1749 [parameter name] [parameter value]
1750 @effect
1751 Defines a new parameter, the value will be the string specified next to
1752 it.
1753 @endproperty
1754 */
1755static void
1756st_data_item(void)
1757{
1758 Edje_String *es;
1759 char *key;
1760
1761 check_arg_count(2);
1762
1763 key = parse_str(0);
1764
1765 es = mem_alloc(SZ(Edje_String));
1766 es->str = parse_str(1);
1767
1768 if (!edje_file->data)
1769 edje_file->data = eina_hash_string_small_new(free);
1770
1771 /* FIXME: check if data already exist */
1772 eina_hash_direct_add(edje_file->data, key, es);
1773}
1774
1775/**
1776 @page edcref
1777 @property
1778 file
1779 @parameters
1780 [parameter name] [parameter filename]
1781 @effect
1782 Defines a new parameter, the value will be the contents of the
1783 specified file formated as a single string of text. This property only
1784 works with plain text files.
1785 @endproperty
1786 */
1787static void
1788st_data_file(void)
1789{
1790 const char *data;
1791 const char *over;
1792 Edje_String *es;
1793 char *filename;
1794 char *value;
1795 char *key;
1796 int fd;
1797 int i;
1798 struct stat buf;
1799
1800 check_arg_count(2);
1801
1802 key = parse_str(0);
1803
1804 es = mem_alloc(SZ(Edje_String));
1805 filename = parse_str(1);
1806
1807 fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
1808 if (fd < 0)
1809 {
1810 ERR("%s:%i when opening file \"%s\": \"%s\"",
1811 file_in, line, filename, strerror(errno));
1812 exit(-1);
1813 }
1814
1815 if (fstat(fd, &buf))
1816 {
1817 ERR("%s:%i when stating file \"%s\": \"%s\"",
1818 file_in, line, filename, strerror(errno));
1819 exit(-1);
1820 }
1821
1822 data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
1823 if (data == MAP_FAILED)
1824 {
1825 ERR("%s:%i when mapping file \"%s\": \"%s\"",
1826 file_in, line, filename, strerror(errno));
1827 exit(-1);
1828 }
1829
1830 over = data;
1831 for (i = 0; i < buf.st_size; ++i, ++over)
1832 if (*over == '\0')
1833 {
1834 ERR("%s:%i file \"%s\" is a binary file.", file_in, line, filename);
1835 exit(-1);
1836 }
1837
1838 value = malloc(sizeof (char) * buf.st_size + 1);
1839 snprintf(value, buf.st_size + 1, "%s", data);
1840
1841 munmap((void*)data, buf.st_size);
1842 close(fd);
1843
1844 es->str = value;
1845
1846 eina_hash_direct_add(edje_file->data, key, es);
1847
1848 free(filename);
1849}
1850
1851/**
1852 @edcsubsection{toplevel_color_classes,Color Classes}
1853 */
1854
1855/**
1856 @page edcref
1857 @block
1858 color_classes
1859 @context
1860 color_classes {
1861 color_class {
1862 name: "colorclassname";
1863 color: [0-255] [0-255] [0-255] [0-255];
1864 color2: [0-255] [0-255] [0-255] [0-255];
1865 color3: [0-255] [0-255] [0-255] [0-255]
1866 }
1867 ..
1868 }
1869 @description
1870 The "color_classes" block contains a list of one or more "color_class"
1871 blocks. Each "color_class" allows the designer to name an arbitrary
1872 group of colors to be used in the theme, the application can use that
1873 name to alter the color values at runtime.
1874 @endblock
1875*/
1876static void
1877ob_color_class(void)
1878{
1879 Edje_Color_Class *cc;
1880
1881 cc = mem_alloc(SZ(Edje_Color_Class));
1882 edje_file->color_classes = eina_list_append(edje_file->color_classes, cc);
1883
1884 cc->r = 0;
1885 cc->g = 0;
1886 cc->b = 0;
1887 cc->a = 0;
1888 cc->r2 = 0;
1889 cc->g2 = 0;
1890 cc->b2 = 0;
1891 cc->a2 = 0;
1892 cc->r3 = 0;
1893 cc->g3 = 0;
1894 cc->b3 = 0;
1895 cc->a3 = 0;
1896}
1897
1898/**
1899 @page edcref
1900
1901 @property
1902 name
1903 @parameters
1904 [color class name]
1905 @effect
1906 Sets the name for the color class, used as reference by both the theme
1907 and the application.
1908 @endproperty
1909*/
1910static void
1911st_color_class_name(void)
1912{
1913 Edje_Color_Class *cc, *tcc;
1914 Eina_List *l;
1915
1916 cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
1917 cc->name = parse_str(0);
1918 EINA_LIST_FOREACH(edje_file->color_classes, l, tcc)
1919 {
1920 if ((cc != tcc) && (!strcmp(cc->name, tcc->name)))
1921 {
1922 ERR("parse error %s:%i. There is already a color class named \"%s\"",
1923 file_in, line - 1, cc->name);
1924 exit(-1);
1925 }
1926 }
1927}
1928
1929/**
1930 @page edcref
1931 @property
1932 color
1933 @parameters
1934 [red] [green] [blue] [alpha]
1935 @effect
1936 The main color.
1937 @endproperty
1938*/
1939static void
1940st_color_class_color(void)
1941{
1942 Edje_Color_Class *cc;
1943
1944 check_arg_count(4);
1945
1946 cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
1947 cc->r = parse_int_range(0, 0, 255);
1948 cc->g = parse_int_range(1, 0, 255);
1949 cc->b = parse_int_range(2, 0, 255);
1950 cc->a = parse_int_range(3, 0, 255);
1951}
1952
1953/**
1954 @page edcref
1955 @property
1956 color2
1957 @parameters
1958 [red] [green] [blue] [alpha]
1959 @effect
1960 Used as outline in text and textblock parts.
1961 @endproperty
1962*/
1963static void
1964st_color_class_color2(void)
1965{
1966 Edje_Color_Class *cc;
1967
1968 check_arg_count(4);
1969
1970 cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
1971 cc->r2 = parse_int_range(0, 0, 255);
1972 cc->g2 = parse_int_range(1, 0, 255);
1973 cc->b2 = parse_int_range(2, 0, 255);
1974 cc->a2 = parse_int_range(3, 0, 255);
1975}
1976
1977/**
1978 @page edcref
1979 @property
1980 color3
1981 @parameters
1982 [red] [green] [blue] [alpha]
1983 @effect
1984 Used as shadow in text and textblock parts.
1985 @endproperty
1986*/
1987static void
1988st_color_class_color3(void)
1989{
1990 Edje_Color_Class *cc;
1991
1992 check_arg_count(4);
1993
1994 cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
1995 cc->r3 = parse_int_range(0, 0, 255);
1996 cc->g3 = parse_int_range(1, 0, 255);
1997 cc->b3 = parse_int_range(2, 0, 255);
1998 cc->a3 = parse_int_range(3, 0, 255);
1999}
2000
2001/**
2002 @edcsubsection{toplevel_styles,Styles}
2003 */
2004
2005/**
2006 @page edcref
2007 @block
2008 styles
2009 @context
2010 styles {
2011 style {
2012 name: "stylename";
2013 base: "..default style properties..";
2014
2015 tag: "tagname" "..style properties..";
2016 ..
2017 }
2018 ..
2019 }
2020 @description
2021 The "styles" block contains a list of one or more "style" blocks. A
2022 "style" block is used to create style \<tags\> for advanced TEXTBLOCK
2023 formatting.
2024 @endblock
2025*/
2026static void
2027ob_styles_style(void)
2028{
2029 Edje_Style *stl;
2030
2031 stl = mem_alloc(SZ(Edje_Style));
2032 edje_file->styles = eina_list_append(edje_file->styles, stl);
2033}
2034
2035/**
2036 @page edcref
2037 @property
2038 name
2039 @parameters
2040 [style name]
2041 @effect
2042 The name of the style to be used as reference later in the theme.
2043 @endproperty
2044*/
2045static void
2046st_styles_style_name(void)
2047{
2048 Edje_Style *stl, *tstl;
2049 Eina_List *l;
2050
2051 stl = eina_list_data_get(eina_list_last(edje_file->styles));
2052 stl->name = parse_str(0);
2053 EINA_LIST_FOREACH(edje_file->styles, l, tstl)
2054 {
2055 if (stl->name && tstl->name && (stl != tstl) && (!strcmp(stl->name, tstl->name)))
2056 {
2057 ERR("parse error %s:%i. There is already a style named \"%s\"",
2058 file_in, line - 1, stl->name);
2059 exit(-1);
2060 }
2061 }
2062}
2063
2064/**
2065 @page edcref
2066 @property
2067 base
2068 @parameters
2069 [style properties string]
2070 @effect
2071 The default style properties that will be applied to the complete
2072 text.
2073 @endproperty
2074*/
2075static void
2076st_styles_style_base(void)
2077{
2078 Edje_Style *stl;
2079 Edje_Style_Tag *tag;
2080
2081 stl = eina_list_data_get(eina_list_last(edje_file->styles));
2082 if (stl->tags)
2083 {
2084 ERR("parse error %s:%i. There is already a basic format for the style",
2085 file_in, line - 1);
2086 exit(-1);
2087 }
2088 tag = mem_alloc(SZ(Edje_Style_Tag));
2089 tag->key = mem_strdup("DEFAULT");
2090 tag->value = parse_str(0);
2091 stl->tags = eina_list_append(stl->tags, tag);
2092}
2093
2094/**
2095 @page edcref
2096 @property
2097 tag
2098 @parameters
2099 [tag name] [style properties string]
2100 @effect
2101 Style to be applied only to text between style \<tags\>..\</tags\>.
2102 When creating "paired" tags, like \<bold\>\</bold\>, A '+' should be added at the start of the style properties of the first part (\<bold\>).
2103 If the second part (\</bold\>) is also defined, a '-' should be prepended to it's style properties.
2104 This only applies to paired tags; Single tags, like \<tab\>, must not include a starting '+'.
2105 @endproperty
2106*/
2107static void
2108st_styles_style_tag(void)
2109{
2110 Edje_Style *stl;
2111 Edje_Style_Tag *tag;
2112
2113 stl = eina_list_data_get(eina_list_last(edje_file->styles));
2114 tag = mem_alloc(SZ(Edje_Style_Tag));
2115 tag->key = parse_str(0);
2116 tag->value = parse_str(1);
2117 stl->tags = eina_list_append(stl->tags, tag);
2118}
2119
2120/**
2121 @edcsection{collections,Collections Blocks}
2122 */
2123
2124/**
2125 @page edcref
2126 @block
2127 collections
2128 @context
2129 collections {
2130 ..
2131 sounds { }
2132 group { }
2133 group { }
2134 ..
2135 }
2136 @description
2137 The "collections" block is used to list the groups that compose the
2138 theme. Additional "collections" blocks do not prevent overriding group
2139 names. The "sounds" block comprises of all sound definitions.
2140 @endblock
2141*/
2142static void
2143ob_collections(void)
2144{
2145 if (!edje_file->collection)
2146 {
2147 edje_file->collection = eina_hash_string_small_new(NULL);
2148 edje_collections_lookup = eina_hash_int32_new(NULL);
2149 }
2150}
2151
2152/**
2153 @edcsubsection{collections_sounds,Sounds}
2154 */
2155
2156/**
2157 @page edcref
2158 @block
2159 sounds
2160 @context
2161 sounds {
2162 sample {
2163 name: "sound_file1" COMP;
2164 source: "sound_file1.wav";
2165 }
2166 sample {
2167 name: "sound_file2" LOSSY 0.4;
2168 source: "sound_file2.wav";
2169 }
2170 tone: "tone-1" 2300;
2171 }
2172
2173 @description
2174 The "sounds" block contains a list of one or more sound sample and tones items.
2175 @endblock
2176*/
2177
2178/**
2179 @edcsubsection{collections_sounds_sample,Sample}
2180 */
2181
2182/**
2183 @page edcref
2184 @block
2185 sample
2186 @context
2187 sample {
2188 name: "sound_file1" RAW;
2189 source: "sound_file1.wav";
2190 }
2191 sample {
2192 name: "sound_file2" LOSSY 0.5;
2193 source: "sound_file2.wav";
2194 }
2195 sample {
2196 name: "sound_file3" COMP;
2197 source: "sound_file3.wav";
2198 }
2199 sample {
2200 name: "sound_file4" AS_IS;
2201 source: "sound_file1.wav";
2202 }
2203 @description
2204 The sample block defines the sound sample.
2205 @endblock
2206 @property
2207 name
2208 @parameters
2209 [sample name] [compression type] [if lossy, then quality]
2210 @effect
2211 Used to include each sound file. The full path to the directory holding
2212 the sounds can be defined later with edje_cc's "-sd" option.
2213 @li RAW: Uncompressed.
2214 @li COMP: Lossless compression.
2215 @li LOSSY [-0.1 - 1.0]: Lossy compression with quality from 0 to 1.0.
2216 @li AS_IS: Check for re-encoding, no compression/encoding, just write the file information as it is.
2217 @endproperty
2218 @since 1.1.0
2219 */
2220static void
2221st_collections_group_sound_sample_name(void)
2222{
2223 Edje_Sound_Sample *sample;
2224 const char *tmp;
2225 unsigned int i;
2226
2227 if (!edje_file->sound_dir)
2228 edje_file->sound_dir = mem_alloc(SZ(Edje_Sound_Directory));
2229
2230 tmp = parse_str(0);
2231
2232 for (i = 0; i < edje_file->sound_dir->samples_count; i++)
2233 {
2234 if (!strcmp(edje_file->sound_dir->samples[i].name, tmp))
2235 {
2236 free((char *)tmp);
2237 return;
2238 }
2239 }
2240
2241 edje_file->sound_dir->samples_count++;
2242 edje_file->sound_dir->samples =
2243 realloc(edje_file->sound_dir->samples,
2244 sizeof(Edje_Sound_Sample) *
2245 edje_file->sound_dir->samples_count);
2246
2247 if (!edje_file->sound_dir->samples)
2248 {
2249 ERR("No enough memory.");
2250 exit(-1);
2251 }
2252
2253 sample =
2254 edje_file->sound_dir->samples +
2255 edje_file->sound_dir->samples_count - 1;
2256 memset(sample, 0, sizeof (Edje_Sound_Sample));
2257
2258 sample->name = tmp;
2259 sample->id = edje_file->sound_dir->samples_count - 1;
2260 sample->compression = parse_enum(1,
2261 "RAW", EDJE_SOUND_SOURCE_TYPE_INLINE_RAW,
2262 "COMP", EDJE_SOUND_SOURCE_TYPE_INLINE_COMP,
2263 "LOSSY", EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY,
2264 "AS_IS", EDJE_SOUND_SOURCE_TYPE_INLINE_AS_IS,
2265 NULL);
2266
2267 if (sample->compression == EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY)
2268 {
2269 sample->quality = parse_float_range(2, 45.0, 1000.0);
2270 check_arg_count(3);
2271 }
2272 else
2273 check_arg_count(2);
2274
2275}
2276
2277/**
2278 @page edcref
2279 @property
2280 source
2281 @parameters
2282 [sound file name]
2283 @effect
2284 The Sound source file name (Source can be mono/stereo WAV file.
2285 Only files with 44.1 KHz sample rate supported now)
2286 @endproperty
2287 @since 1.1.0
2288 */
2289static void
2290st_collections_group_sound_sample_source(void)
2291{
2292 Edje_Sound_Sample *sample;
2293
2294 if (!edje_file->sound_dir->samples)
2295 {
2296 ERR("Invalid sound sample source definition.");
2297 exit(-1);
2298 }
2299
2300 sample =
2301 edje_file->sound_dir->samples +
2302 edje_file->sound_dir->samples_count - 1;
2303
2304 if (!sample)
2305 {
2306 ERR("Invalid sound sample source definition.");
2307 exit(-1);
2308 }
2309 sample->snd_src = parse_str(0);
2310 check_arg_count(1);
2311}
2312
2313/**
2314 @page edcref
2315 @property
2316 tone
2317 @parameters
2318 [tone name] [frequency]
2319 @effect
2320 sound of specific frequency
2321 @endproperty
2322 @since 1.1.0
2323 */
2324static void
2325st_collections_group_sound_tone(void)
2326{
2327 Edje_Sound_Tone *tone;
2328 const char *tmp;
2329 unsigned int i;
2330 int value;
2331
2332 check_arg_count(2);
2333
2334 if (!edje_file->sound_dir)
2335 edje_file->sound_dir = mem_alloc(SZ(Edje_Sound_Directory));
2336
2337 tmp = parse_str(0);
2338 /* Audible range 20 to 20KHz */
2339 value = parse_int_range(1, 20, 20000);
2340
2341 /* Check for Tone duplication */
2342 for (i = 0; i < edje_file->sound_dir->tones_count; i++)
2343 {
2344 if (!strcmp(edje_file->sound_dir->tones[i].name, tmp))
2345 {
2346 ERR("Tone name: %s already exist.", tmp);
2347 free((char *)tmp);
2348 exit(-1);
2349 }
2350 if (edje_file->sound_dir->tones[i].value == value)
2351 {
2352 ERR("Tone name %s with same frequency %d exist.",
2353 edje_file->sound_dir->tones[i].name, value);
2354 exit(-1);
2355 }
2356 }
2357 edje_file->sound_dir->tones_count++;
2358 edje_file->sound_dir->tones =
2359 realloc(edje_file->sound_dir->tones,
2360 sizeof (Edje_Sound_Tone) *
2361 edje_file->sound_dir->tones_count);
2362
2363 if (!edje_file->sound_dir->tones)
2364 {
2365 ERR("No enough memory.");
2366 exit(-1);
2367 }
2368
2369 tone = edje_file->sound_dir->tones + edje_file->sound_dir->tones_count - 1;
2370 memset(tone, 0, sizeof (Edje_Sound_Tone));
2371
2372 tone->name = tmp;
2373 tone->value = value;
2374 tone->id = edje_file->sound_dir->tones_count - 1;
2375}
2376
2377/**
2378 @edcsubsection{collections_group,Group}
2379 */
2380
2381/**
2382 @page edcref
2383 @block
2384 group
2385 @context
2386 collections {
2387 ..
2388 group {
2389 name: "nameusedbytheapplication";
2390 alias: "anothername";
2391 min: width height;
2392 max: width height;
2393
2394 script { }
2395 limits { }
2396 data { }
2397 parts { }
2398 programs { }
2399 }
2400 ..
2401 }
2402 @description
2403 A "group" block contains the list of parts and programs that compose a
2404 given Edje Object.
2405 @endblock
2406*/
2407static void
2408ob_collections_group(void)
2409{
2410 Edje_Part_Collection *pc;
2411 Code *cd;
2412
2413 if (current_de && !current_de->entry)
2414 {
2415 ERR("A collection without a name was detected, that's not allowed.");
2416 exit(-1);
2417 }
2418
2419 current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
2420 current_de->id = eina_list_count(edje_collections);
2421
2422 eina_hash_add(edje_collections_lookup, &current_de->id, current_de);
2423
2424 pc = mem_alloc(SZ(Edje_Part_Collection));
2425 edje_collections = eina_list_append(edje_collections, pc);
2426 pc->id = current_de->id;
2427 pc->broadcast_signal = EINA_TRUE; /* This was the behaviour by default in Edje 1.1 */
2428
2429 cd = mem_alloc(SZ(Code));
2430 codes = eina_list_append(codes, cd);
2431
2432#ifdef HAVE_EPHYSICS
2433 pc->physics.world.gravity.x = 0;
2434 pc->physics.world.gravity.y = 294;
2435 pc->physics.world.gravity.z = 0;
2436 pc->physics.world.depth = 100;
2437 pc->physics.world.z = -50;
2438 pc->physics.world.rate = FROM_DOUBLE(30);
2439#endif
2440}
2441
2442/**
2443 @page edcref
2444 @property
2445 name
2446 @parameters
2447 [group name]
2448 @effect
2449 The name that will be used by the application to load the resulting
2450 Edje object and to identify the group to swallow in a GROUP part. If a
2451 group with the same name exists already it will be completely overriden
2452 by the new group.
2453 @endproperty
2454*/
2455static void
2456st_collections_group_name(void)
2457{
2458 Edje_Part_Collection_Directory_Entry *alias;
2459 Edje_Part_Collection_Directory_Entry *older;
2460 Edje_Part_Collection *current_pc;
2461 Eina_List *l = NULL;
2462
2463 check_arg_count(1);
2464
2465 current_pc = eina_list_data_get(eina_list_last(edje_collections));
2466
2467 current_de->entry = parse_str(0);
2468 current_pc->part = current_de->entry;
2469
2470 older = eina_hash_find(edje_file->collection, current_de->entry);
2471 if (older) eina_hash_del(edje_file->collection, current_de->entry, older);
2472 eina_hash_direct_add(edje_file->collection, current_de->entry, current_de);
2473 if (!older) return;
2474
2475 EINA_LIST_FOREACH(aliases, l, alias)
2476 if (strcmp(alias->entry, current_de->entry) == 0)
2477 {
2478 Edje_Part_Collection *pc;
2479
2480 pc = eina_list_nth(edje_collections, older->id);
2481 INF("overriding alias ('%s' => '%s') by group '%s'",
2482 alias->entry, pc->part,
2483 current_de->entry);
2484 aliases = eina_list_remove_list(aliases, l);
2485 free(alias);
2486 break;
2487 }
2488
2489}
2490
2491typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data;
2492struct _Edje_List_Foreach_Data
2493{
2494 Eina_List *list;
2495};
2496
2497static Eina_Bool
2498_edje_data_item_list_foreach(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data EINA_UNUSED, void *fdata)
2499{
2500 Edje_List_Foreach_Data *fd;
2501
2502 fd = fdata;
2503 fd->list = eina_list_append(fd->list, strdup(key));
2504
2505 return EINA_TRUE;
2506}
2507
2508/**
2509 @page edcref
2510 @property
2511 inherit
2512 @parameters
2513 [parent group name]
2514 @effect
2515 Parent group name for inheritance.
2516 Group "inherit" is used to inherit any predefined group and change
2517 some property which belongs to "part", "description", "items" or "program".
2518 The child group has the same property as parent group. If you specify the
2519 type again in an inherited part, it will cause an error (unless you plan
2520 to fix that).
2521 @endproperty
2522 @since 1.1.0
2523*/
2524static void
2525st_collections_group_inherit(void)
2526{
2527 Edje_Part_Collection *pc, *pc2;
2528 Edje_Part *ep, *ep2;
2529 Edje_Part_Parser *epp, *epp2;
2530 Edje_Pack_Element *item, *item2;
2531 Edje_Pack_Element_Parser *pitem;
2532 Edje_Part_Description_Common *ed, *ed2;
2533 Edje_List_Foreach_Data fdata;
2534 Eina_List *l;
2535 char *parent_name;
2536 unsigned int i, j;
2537
2538 check_arg_count(1);
2539
2540 pc = eina_list_data_get(eina_list_last(edje_collections));
2541
2542 parent_name = parse_str(0);
2543
2544 EINA_LIST_FOREACH(edje_collections, l, pc2)
2545 {
2546 if (!strcmp(parent_name, pc2->part))
2547 break;
2548 }
2549 if (!pc2)
2550 {
2551 ERR("parse error %s:%i. There isn't a group with the name %s",
2552 file_in, line - 1, parent_name);
2553 exit(-1);
2554 }
2555 if (pc2 == pc)
2556 {
2557 ERR("parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible."
2558 "If there is another group of the same name, you want to inherit from that group and have the"
2559 "same name as that group, there is a trick ! Just put the inherit before the directive that set"
2560 "the name !", file_in, line - 1, parent_name);
2561 exit(-1);
2562 }
2563
2564 if (pc2->data)
2565 {
2566 char *key, *data;
2567
2568 memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
2569 eina_hash_foreach(pc2->data,
2570 _edje_data_item_list_foreach, &fdata);
2571
2572 if (!pc->data) pc->data = eina_hash_string_small_new(free);
2573 EINA_LIST_FREE(fdata.list, key)
2574 {
2575 data = eina_hash_find(pc2->data, key);
2576 eina_hash_direct_add(pc->data, key, data);
2577 }
2578 }
2579
2580 if (pc2->alias)
2581 {
2582 char *key, *alias;
2583
2584 memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
2585 eina_hash_foreach(pc2->alias,
2586 _edje_data_item_list_foreach, &fdata);
2587 if (!pc->alias) pc->alias = eina_hash_string_small_new(free);
2588 EINA_LIST_FREE(fdata.list, key)
2589 {
2590 alias = eina_hash_find(pc2->alias, key);
2591 eina_hash_direct_add(pc->alias, key, alias);
2592 }
2593 }
2594 if (pc2->aliased)
2595 {
2596 char *key, *aliased;
2597
2598 memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
2599 eina_hash_foreach(pc2->aliased,
2600 _edje_data_item_list_foreach, &fdata);
2601 if (!pc->aliased) pc->aliased = eina_hash_string_small_new(free);
2602 EINA_LIST_FREE(fdata.list, key)
2603 {
2604 aliased = eina_hash_find(pc2->aliased, key);
2605 eina_hash_direct_add(pc->aliased, key, aliased);
2606 }
2607 }
2608
2609#ifdef HAVE_EPHYSICS
2610 pc->physics.world.gravity.x = pc2->physics.world.gravity.x;
2611 pc->physics.world.gravity.y = pc2->physics.world.gravity.y;
2612 pc->physics.world.gravity.z = pc2->physics.world.gravity.z;
2613 pc->physics.world.depth = pc2->physics.world.depth;
2614 pc->physics.world.z = pc2->physics.world.z;
2615 pc->physics.world.rate = pc2->physics.world.rate;
2616#endif
2617
2618 pc->prop.min.w = pc2->prop.min.w;
2619 pc->prop.min.h = pc2->prop.min.h;
2620 pc->prop.orientation = pc2->prop.orientation;
2621
2622 pc->lua_script_only = pc2->lua_script_only;
2623
2624 #define STRDUP(x) x ? strdup(x) : NULL
2625 for (i = 0 ; i < pc2->parts_count ; i++)
2626 {
2627 // copy the part
2628 edje_cc_handlers_part_make();
2629 ep = pc->parts[i];
2630 ep2 = pc2->parts[i];
2631 ep->name = STRDUP(ep2->name);
2632 ep->source = STRDUP(ep2->source);
2633 ep->source2 = STRDUP(ep2->source2);
2634 ep->source3 = STRDUP(ep2->source3);
2635 ep->source4 = STRDUP(ep2->source4);
2636 ep->source5 = STRDUP(ep2->source5);
2637 ep->source6 = STRDUP(ep2->source6);
2638
2639 data_queue_copied_part_lookup(pc, &(ep2->clip_to_id), &(ep->clip_to_id));
2640
2641 ep->type = ep2->type;
2642 ep->mouse_events = ep2->mouse_events;
2643 ep->repeat_events = ep2->repeat_events;
2644 ep->ignore_flags = ep2->ignore_flags;
2645 ep->scale = ep2->scale;
2646 ep->pointer_mode = ep2->pointer_mode;
2647 ep->precise_is_inside = ep2->precise_is_inside;
2648 ep->use_alternate_font_metrics = ep2->use_alternate_font_metrics;
2649 ep->effect = ep2->effect;
2650 ep->entry_mode = ep2->entry_mode;
2651 ep->select_mode = ep2->select_mode;
2652 ep->cursor_mode = ep2->cursor_mode;
2653 ep->multiline = ep2->multiline;
2654 ep->access = ep2->access;
2655 ep->dragable.x = ep2->dragable.x;
2656 ep->dragable.step_x = ep2->dragable.step_x;
2657 ep->dragable.count_x = ep2->dragable.count_x;
2658 ep->dragable.y = ep2->dragable.y;
2659 ep->dragable.step_y = ep2->dragable.step_y;
2660 ep->dragable.count_y = ep2->dragable.count_y;
2661 ep->nested_children_count = ep2->nested_children_count;
2662
2663 data_queue_copied_part_lookup(pc, &(ep2->dragable.confine_id), &(ep->dragable.confine_id));
2664 data_queue_copied_part_lookup(pc, &(ep2->dragable.event_id), &(ep->dragable.event_id));
2665
2666 epp = (Edje_Part_Parser *)ep;
2667 epp2 = (Edje_Part_Parser *)ep2;
2668 epp->reorder.insert_before = STRDUP(epp2->reorder.insert_before);
2669 epp->reorder.insert_after = STRDUP(epp2->reorder.insert_after);
2670 epp->can_override = EINA_TRUE;
2671
2672 for (j = 0 ; j < ep2->items_count ; j++)
2673 {
2674 ob_collections_group_parts_part_box_items_item();
2675 item = ep->items[j];
2676 item2 = ep2->items[j];
2677 item->type = item2->type;
2678 item->name = STRDUP(item2->name);
2679 item->source = STRDUP(item2->source);
2680 item->min.w = item2->min.w;
2681 item->min.h = item2->min.h;
2682 item->prefer.w = item2->prefer.w;
2683 item->prefer.h = item2->prefer.h;
2684 item->max.w = item2->max.w;
2685 item->max.h = item2->max.h;
2686 item->padding.l = item2->padding.l;
2687 item->padding.r = item2->padding.r;
2688 item->padding.t = item2->padding.t;
2689 item->padding.b = item2->padding.b;
2690 item->align.x = item2->align.x;
2691 item->align.y = item2->align.y;
2692 item->weight.x = item2->weight.x;
2693 item->weight.y = item2->weight.y;
2694 item->aspect.w = item2->aspect.w;
2695 item->aspect.h = item2->aspect.h;
2696 item->aspect.mode = item2->aspect.mode;
2697 item->options = STRDUP(item2->options);
2698 item->col = item2->col;
2699 item->row = item2->row;
2700 item->colspan = item2->colspan;
2701 item->rowspan = item2->rowspan;
2702
2703 pitem = (Edje_Pack_Element_Parser *)item;
2704 pitem->can_override = EINA_TRUE;
2705 }
2706
2707 ep->api.name = STRDUP(ep2->api.name);
2708 if (ep2->api.description) ep->api.description = STRDUP(ep2->api.description);
2709
2710 // copy default description
2711 ob_collections_group_parts_part_description();
2712 ed = ep->default_desc;
2713 parent_desc = ed2 = ep2->default_desc;
2714 ed->state.name = STRDUP(ed2->state.name);
2715 ed->state.value = ed2->state.value;
2716 st_collections_group_parts_part_description_inherit();
2717 parent_desc = NULL;
2718
2719 // copy other description
2720 for (j = 0 ; j < ep2->other.desc_count ; j++)
2721 {
2722 ob_collections