diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/evas/src/examples | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to '')
20 files changed, 0 insertions, 5419 deletions
diff --git a/libraries/evas/src/examples/Makefile.am b/libraries/evas/src/examples/Makefile.am deleted file mode 100644 index a52e3f8..0000000 --- a/libraries/evas/src/examples/Makefile.am +++ /dev/null | |||
@@ -1,147 +0,0 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | ||
2 | |||
3 | examplesdir = $(datadir)/$(PACKAGE)/examples | ||
4 | |||
5 | #put here all EDCs one needs to the tests | ||
6 | EDCS = aspect.edc | ||
7 | |||
8 | filesdir = $(datadir)/$(PACKAGE)/examples | ||
9 | files_DATA = | ||
10 | |||
11 | if BUILD_EXAMPLES | ||
12 | |||
13 | AM_CPPFLAGS = \ | ||
14 | -I. \ | ||
15 | -I$(top_srcdir)/src/lib \ | ||
16 | -I$(top_srcdir)/src/lib/include \ | ||
17 | -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | ||
18 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
19 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
20 | -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ | ||
21 | @EINA_CFLAGS@ \ | ||
22 | @FREETYPE_CFLAGS@ \ | ||
23 | @PIXMAN_CFLAGS@ \ | ||
24 | @FRIBIDI_CFLAGS@ \ | ||
25 | @EET_CFLAGS@ \ | ||
26 | @FONTCONFIG_CFLAGS@ \ | ||
27 | @pthread_cflags@ | ||
28 | |||
29 | examples_PROGRAMS = | ||
30 | |||
31 | if BUILD_ENGINE_BUFFER | ||
32 | AM_CPPFLAGS += -I$(top_srcdir)/src/modules/engines/buffer | ||
33 | |||
34 | examples_PROGRAMS += evas_buffer_simple | ||
35 | evas_buffer_simple_SOURCES = evas-buffer-simple.c | ||
36 | evas_buffer_simple_LDADD = $(top_builddir)/src/lib/libevas.la | ||
37 | endif | ||
38 | |||
39 | examples_PROGRAMS += evas_init_shutdown | ||
40 | evas_init_shutdown_SOURCES = evas-init-shutdown.c | ||
41 | evas_init_shutdown_LDADD = $(top_builddir)/src/lib/libevas.la | ||
42 | |||
43 | #the ones using ecore_evas follow | ||
44 | AM_CPPFLAGS += @ECORE_EVAS_CFLAGS@ | ||
45 | |||
46 | examples_PROGRAMS += evas_images | ||
47 | evas_images_SOURCES = evas-images.c | ||
48 | evas_images_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
49 | |||
50 | examples_PROGRAMS += evas_events | ||
51 | evas_events_SOURCES = evas-events.c | ||
52 | evas_events_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
53 | |||
54 | examples_PROGRAMS += evas_object_manipulation | ||
55 | evas_object_manipulation_SOURCES = evas-object-manipulation.c | ||
56 | evas_object_manipulation_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
57 | |||
58 | examples_PROGRAMS += evas_hints | ||
59 | evas_hints_SOURCES = evas-hints.c | ||
60 | evas_hints_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
61 | |||
62 | examples_PROGRAMS += evas_stacking | ||
63 | evas_stacking_SOURCES = evas-stacking.c | ||
64 | evas_stacking_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
65 | |||
66 | examples_PROGRAMS += evas_images2 | ||
67 | evas_images2_SOURCES = evas-images2.c | ||
68 | evas_images2_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
69 | |||
70 | examples_PROGRAMS += evas_text | ||
71 | evas_text_SOURCES = evas-text.c | ||
72 | evas_text_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
73 | |||
74 | examples_PROGRAMS += evas_smart_object | ||
75 | evas_smart_object_SOURCES = evas-smart-object.c | ||
76 | evas_smart_object_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
77 | |||
78 | examples_PROGRAMS += evas_box | ||
79 | evas_box_SOURCES = evas-box.c | ||
80 | evas_box_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ @EINA_LIBS@ | ||
81 | |||
82 | #the ones using ecore_evas and edje follow | ||
83 | AM_CPPFLAGS += @EDJE_CFLAGS@ | ||
84 | |||
85 | examples_PROGRAMS += evas_aspect_hints | ||
86 | evas_aspect_hints_DEPS = $(srcdir)/aspect.edc | ||
87 | evas_aspect_hints_SOURCES = evas-aspect-hints.c | ||
88 | evas_aspect_hints_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ @EDJE_LIBS@ | ||
89 | |||
90 | examples_PROGRAMS += evas_map_utils | ||
91 | evas_map_utils_SOURCES = evas-map-utils.c | ||
92 | evas_map_utils_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
93 | |||
94 | aspect.edj: ${evas_aspect_hints_DEPS} | ||
95 | |||
96 | .edc.edj: | ||
97 | $(edje_cc) -v -id $(srcdir) $< $(builddir)/$(@F) | ||
98 | |||
99 | EDJS = $(EDCS:%.edc=%.edj) | ||
100 | |||
101 | files_DATA += $(EDJS) | ||
102 | |||
103 | endif # if BUILD_EXAMPLES | ||
104 | |||
105 | if INSTALL_EXAMPLES | ||
106 | |||
107 | #put here additional data when installing examples | ||
108 | files_DATA += $(srcdir)/enlightenment.png \ | ||
109 | $(srcdir)/red.png \ | ||
110 | $(srcdir)/im1.png \ | ||
111 | $(srcdir)/cube1.png | ||
112 | |||
113 | files_DATA += \ | ||
114 | $(EDCS) \ | ||
115 | $(srcdir)/evas-buffer-simple.c \ | ||
116 | $(srcdir)/evas-init-shutdown.c \ | ||
117 | $(srcdir)/evas-images.c \ | ||
118 | $(srcdir)/evas-images2.c \ | ||
119 | $(srcdir)/evas-object-manipulation.c \ | ||
120 | $(srcdir)/evas-events.c \ | ||
121 | $(srcdir)/evas-aspect-hints.c \ | ||
122 | $(srcdir)/evas-hints.c \ | ||
123 | $(srcdir)/evas-stacking.c \ | ||
124 | $(srcdir)/evas-map-utils.c \ | ||
125 | $(srcdir)/evas-text.c \ | ||
126 | $(srcdir)/evas-smart-object.c \ | ||
127 | $(srcdir)/evas-box.c | ||
128 | endif | ||
129 | |||
130 | EXTRA_DIST = $(EDCS) \ | ||
131 | $(srcdir)/evas-buffer-simple.c \ | ||
132 | $(srcdir)/evas-init-shutdown.c \ | ||
133 | $(srcdir)/evas-images.c \ | ||
134 | $(srcdir)/evas-images2.c \ | ||
135 | $(srcdir)/evas-object-manipulation.c \ | ||
136 | $(srcdir)/evas-events.c \ | ||
137 | $(srcdir)/evas-aspect-hints.c \ | ||
138 | $(srcdir)/evas-hints.c \ | ||
139 | $(srcdir)/evas-stacking.c \ | ||
140 | $(srcdir)/evas-map-utils.c \ | ||
141 | $(srcdir)/evas-text.c \ | ||
142 | $(srcdir)/evas-smart-object.c \ | ||
143 | $(srcdir)/evas-box.c \ | ||
144 | $(srcdir)/enlightenment.png \ | ||
145 | $(srcdir)/red.png \ | ||
146 | $(srcdir)/im1.png \ | ||
147 | $(srcdir)/cube1.png | ||
diff --git a/libraries/evas/src/examples/Makefile.in b/libraries/evas/src/examples/Makefile.in deleted file mode 100644 index 1cc1108..0000000 --- a/libraries/evas/src/examples/Makefile.in +++ /dev/null | |||
@@ -1,988 +0,0 @@ | |||
1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, | ||
6 | # Inc. | ||
7 | # This Makefile.in is free software; the Free Software Foundation | ||
8 | # gives unlimited permission to copy and/or distribute it, | ||
9 | # with or without modifications, as long as this notice is preserved. | ||
10 | |||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
14 | # PARTICULAR PURPOSE. | ||
15 | |||
16 | @SET_MAKE@ | ||
17 | |||
18 | |||
19 | VPATH = @srcdir@ | ||
20 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
21 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
22 | pkglibdir = $(libdir)/@PACKAGE@ | ||
23 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
24 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
25 | install_sh_DATA = $(install_sh) -c -m 644 | ||
26 | install_sh_PROGRAM = $(install_sh) -c | ||
27 | install_sh_SCRIPT = $(install_sh) -c | ||
28 | INSTALL_HEADER = $(INSTALL_DATA) | ||
29 | transform = $(program_transform_name) | ||
30 | NORMAL_INSTALL = : | ||
31 | PRE_INSTALL = : | ||
32 | POST_INSTALL = : | ||
33 | NORMAL_UNINSTALL = : | ||
34 | PRE_UNINSTALL = : | ||
35 | POST_UNINSTALL = : | ||
36 | build_triplet = @build@ | ||
37 | host_triplet = @host@ | ||
38 | @BUILD_EXAMPLES_TRUE@examples_PROGRAMS = $(am__EXEEXT_1) \ | ||
39 | @BUILD_EXAMPLES_TRUE@ evas_init_shutdown$(EXEEXT) \ | ||
40 | @BUILD_EXAMPLES_TRUE@ evas_images$(EXEEXT) evas_events$(EXEEXT) \ | ||
41 | @BUILD_EXAMPLES_TRUE@ evas_object_manipulation$(EXEEXT) \ | ||
42 | @BUILD_EXAMPLES_TRUE@ evas_hints$(EXEEXT) \ | ||
43 | @BUILD_EXAMPLES_TRUE@ evas_stacking$(EXEEXT) \ | ||
44 | @BUILD_EXAMPLES_TRUE@ evas_images2$(EXEEXT) evas_text$(EXEEXT) \ | ||
45 | @BUILD_EXAMPLES_TRUE@ evas_smart_object$(EXEEXT) \ | ||
46 | @BUILD_EXAMPLES_TRUE@ evas_box$(EXEEXT) \ | ||
47 | @BUILD_EXAMPLES_TRUE@ evas_aspect_hints$(EXEEXT) \ | ||
48 | @BUILD_EXAMPLES_TRUE@ evas_map_utils$(EXEEXT) | ||
49 | @BUILD_ENGINE_BUFFER_TRUE@@BUILD_EXAMPLES_TRUE@am__append_1 = -I$(top_srcdir)/src/modules/engines/buffer | ||
50 | @BUILD_ENGINE_BUFFER_TRUE@@BUILD_EXAMPLES_TRUE@am__append_2 = evas_buffer_simple | ||
51 | @BUILD_EXAMPLES_TRUE@am__append_3 = $(EDJS) | ||
52 | |||
53 | #put here additional data when installing examples | ||
54 | @INSTALL_EXAMPLES_TRUE@am__append_4 = $(srcdir)/enlightenment.png \ | ||
55 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/red.png $(srcdir)/im1.png \ | ||
56 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/cube1.png $(EDCS) \ | ||
57 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-buffer-simple.c \ | ||
58 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-init-shutdown.c \ | ||
59 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-images.c \ | ||
60 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-images2.c \ | ||
61 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-object-manipulation.c \ | ||
62 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-events.c \ | ||
63 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-aspect-hints.c \ | ||
64 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-hints.c \ | ||
65 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-stacking.c \ | ||
66 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-map-utils.c \ | ||
67 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-text.c \ | ||
68 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-smart-object.c \ | ||
69 | @INSTALL_EXAMPLES_TRUE@ $(srcdir)/evas-box.c | ||
70 | subdir = src/examples | ||
71 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
72 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
73 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | ||
74 | $(top_srcdir)/m4/efl_coverage.m4 \ | ||
75 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
76 | $(top_srcdir)/m4/efl_fnmatch.m4 \ | ||
77 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
78 | $(top_srcdir)/m4/evas_check_engine.m4 \ | ||
79 | $(top_srcdir)/m4/evas_check_loader.m4 \ | ||
80 | $(top_srcdir)/m4/evas_converter.m4 \ | ||
81 | $(top_srcdir)/m4/evas_dither.m4 \ | ||
82 | $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
83 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
84 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
85 | $(top_srcdir)/configure.ac | ||
86 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
87 | $(ACLOCAL_M4) | ||
88 | mkinstalldirs = $(install_sh) -d | ||
89 | CONFIG_HEADER = $(top_builddir)/config.h | ||
90 | CONFIG_CLEAN_FILES = | ||
91 | CONFIG_CLEAN_VPATH_FILES = | ||
92 | @BUILD_ENGINE_BUFFER_TRUE@@BUILD_EXAMPLES_TRUE@am__EXEEXT_1 = evas_buffer_simple$(EXEEXT) | ||
93 | am__installdirs = "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(filesdir)" | ||
94 | PROGRAMS = $(examples_PROGRAMS) | ||
95 | am__evas_aspect_hints_SOURCES_DIST = evas-aspect-hints.c | ||
96 | @BUILD_EXAMPLES_TRUE@am_evas_aspect_hints_OBJECTS = \ | ||
97 | @BUILD_EXAMPLES_TRUE@ evas-aspect-hints.$(OBJEXT) | ||
98 | evas_aspect_hints_OBJECTS = $(am_evas_aspect_hints_OBJECTS) | ||
99 | @BUILD_EXAMPLES_TRUE@evas_aspect_hints_DEPENDENCIES = \ | ||
100 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
101 | AM_V_lt = $(am__v_lt_$(V)) | ||
102 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
103 | am__v_lt_0 = --silent | ||
104 | am__evas_box_SOURCES_DIST = evas-box.c | ||
105 | @BUILD_EXAMPLES_TRUE@am_evas_box_OBJECTS = evas-box.$(OBJEXT) | ||
106 | evas_box_OBJECTS = $(am_evas_box_OBJECTS) | ||
107 | @BUILD_EXAMPLES_TRUE@evas_box_DEPENDENCIES = \ | ||
108 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
109 | am__evas_buffer_simple_SOURCES_DIST = evas-buffer-simple.c | ||
110 | @BUILD_ENGINE_BUFFER_TRUE@@BUILD_EXAMPLES_TRUE@am_evas_buffer_simple_OBJECTS = evas-buffer-simple.$(OBJEXT) | ||
111 | evas_buffer_simple_OBJECTS = $(am_evas_buffer_simple_OBJECTS) | ||
112 | @BUILD_ENGINE_BUFFER_TRUE@@BUILD_EXAMPLES_TRUE@evas_buffer_simple_DEPENDENCIES = $(top_builddir)/src/lib/libevas.la | ||
113 | am__evas_events_SOURCES_DIST = evas-events.c | ||
114 | @BUILD_EXAMPLES_TRUE@am_evas_events_OBJECTS = evas-events.$(OBJEXT) | ||
115 | evas_events_OBJECTS = $(am_evas_events_OBJECTS) | ||
116 | @BUILD_EXAMPLES_TRUE@evas_events_DEPENDENCIES = \ | ||
117 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
118 | am__evas_hints_SOURCES_DIST = evas-hints.c | ||
119 | @BUILD_EXAMPLES_TRUE@am_evas_hints_OBJECTS = evas-hints.$(OBJEXT) | ||
120 | evas_hints_OBJECTS = $(am_evas_hints_OBJECTS) | ||
121 | @BUILD_EXAMPLES_TRUE@evas_hints_DEPENDENCIES = \ | ||
122 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
123 | am__evas_images_SOURCES_DIST = evas-images.c | ||
124 | @BUILD_EXAMPLES_TRUE@am_evas_images_OBJECTS = evas-images.$(OBJEXT) | ||
125 | evas_images_OBJECTS = $(am_evas_images_OBJECTS) | ||
126 | @BUILD_EXAMPLES_TRUE@evas_images_DEPENDENCIES = \ | ||
127 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
128 | am__evas_images2_SOURCES_DIST = evas-images2.c | ||
129 | @BUILD_EXAMPLES_TRUE@am_evas_images2_OBJECTS = evas-images2.$(OBJEXT) | ||
130 | evas_images2_OBJECTS = $(am_evas_images2_OBJECTS) | ||
131 | @BUILD_EXAMPLES_TRUE@evas_images2_DEPENDENCIES = \ | ||
132 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
133 | am__evas_init_shutdown_SOURCES_DIST = evas-init-shutdown.c | ||
134 | @BUILD_EXAMPLES_TRUE@am_evas_init_shutdown_OBJECTS = \ | ||
135 | @BUILD_EXAMPLES_TRUE@ evas-init-shutdown.$(OBJEXT) | ||
136 | evas_init_shutdown_OBJECTS = $(am_evas_init_shutdown_OBJECTS) | ||
137 | @BUILD_EXAMPLES_TRUE@evas_init_shutdown_DEPENDENCIES = \ | ||
138 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
139 | am__evas_map_utils_SOURCES_DIST = evas-map-utils.c | ||
140 | @BUILD_EXAMPLES_TRUE@am_evas_map_utils_OBJECTS = \ | ||
141 | @BUILD_EXAMPLES_TRUE@ evas-map-utils.$(OBJEXT) | ||
142 | evas_map_utils_OBJECTS = $(am_evas_map_utils_OBJECTS) | ||
143 | @BUILD_EXAMPLES_TRUE@evas_map_utils_DEPENDENCIES = \ | ||
144 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
145 | am__evas_object_manipulation_SOURCES_DIST = \ | ||
146 | evas-object-manipulation.c | ||
147 | @BUILD_EXAMPLES_TRUE@am_evas_object_manipulation_OBJECTS = \ | ||
148 | @BUILD_EXAMPLES_TRUE@ evas-object-manipulation.$(OBJEXT) | ||
149 | evas_object_manipulation_OBJECTS = \ | ||
150 | $(am_evas_object_manipulation_OBJECTS) | ||
151 | @BUILD_EXAMPLES_TRUE@evas_object_manipulation_DEPENDENCIES = \ | ||
152 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
153 | am__evas_smart_object_SOURCES_DIST = evas-smart-object.c | ||
154 | @BUILD_EXAMPLES_TRUE@am_evas_smart_object_OBJECTS = \ | ||
155 | @BUILD_EXAMPLES_TRUE@ evas-smart-object.$(OBJEXT) | ||
156 | evas_smart_object_OBJECTS = $(am_evas_smart_object_OBJECTS) | ||
157 | @BUILD_EXAMPLES_TRUE@evas_smart_object_DEPENDENCIES = \ | ||
158 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
159 | am__evas_stacking_SOURCES_DIST = evas-stacking.c | ||
160 | @BUILD_EXAMPLES_TRUE@am_evas_stacking_OBJECTS = \ | ||
161 | @BUILD_EXAMPLES_TRUE@ evas-stacking.$(OBJEXT) | ||
162 | evas_stacking_OBJECTS = $(am_evas_stacking_OBJECTS) | ||
163 | @BUILD_EXAMPLES_TRUE@evas_stacking_DEPENDENCIES = \ | ||
164 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
165 | am__evas_text_SOURCES_DIST = evas-text.c | ||
166 | @BUILD_EXAMPLES_TRUE@am_evas_text_OBJECTS = evas-text.$(OBJEXT) | ||
167 | evas_text_OBJECTS = $(am_evas_text_OBJECTS) | ||
168 | @BUILD_EXAMPLES_TRUE@evas_text_DEPENDENCIES = \ | ||
169 | @BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
170 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
171 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
172 | am__depfiles_maybe = depfiles | ||
173 | am__mv = mv -f | ||
174 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
175 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
176 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
177 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
178 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
179 | $(AM_CFLAGS) $(CFLAGS) | ||
180 | AM_V_CC = $(am__v_CC_$(V)) | ||
181 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
182 | am__v_CC_0 = @echo " CC " $@; | ||
183 | AM_V_at = $(am__v_at_$(V)) | ||
184 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
185 | am__v_at_0 = @ | ||
186 | CCLD = $(CC) | ||
187 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
188 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
189 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
190 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
191 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
192 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
193 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
194 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
195 | am__v_GEN_0 = @echo " GEN " $@; | ||
196 | SOURCES = $(evas_aspect_hints_SOURCES) $(evas_box_SOURCES) \ | ||
197 | $(evas_buffer_simple_SOURCES) $(evas_events_SOURCES) \ | ||
198 | $(evas_hints_SOURCES) $(evas_images_SOURCES) \ | ||
199 | $(evas_images2_SOURCES) $(evas_init_shutdown_SOURCES) \ | ||
200 | $(evas_map_utils_SOURCES) $(evas_object_manipulation_SOURCES) \ | ||
201 | $(evas_smart_object_SOURCES) $(evas_stacking_SOURCES) \ | ||
202 | $(evas_text_SOURCES) | ||
203 | DIST_SOURCES = $(am__evas_aspect_hints_SOURCES_DIST) \ | ||
204 | $(am__evas_box_SOURCES_DIST) \ | ||
205 | $(am__evas_buffer_simple_SOURCES_DIST) \ | ||
206 | $(am__evas_events_SOURCES_DIST) $(am__evas_hints_SOURCES_DIST) \ | ||
207 | $(am__evas_images_SOURCES_DIST) \ | ||
208 | $(am__evas_images2_SOURCES_DIST) \ | ||
209 | $(am__evas_init_shutdown_SOURCES_DIST) \ | ||
210 | $(am__evas_map_utils_SOURCES_DIST) \ | ||
211 | $(am__evas_object_manipulation_SOURCES_DIST) \ | ||
212 | $(am__evas_smart_object_SOURCES_DIST) \ | ||
213 | $(am__evas_stacking_SOURCES_DIST) \ | ||
214 | $(am__evas_text_SOURCES_DIST) | ||
215 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
216 | am__vpath_adj = case $$p in \ | ||
217 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
218 | *) f=$$p;; \ | ||
219 | esac; | ||
220 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
221 | am__install_max = 40 | ||
222 | am__nobase_strip_setup = \ | ||
223 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
224 | am__nobase_strip = \ | ||
225 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
226 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
227 | for p in $$list; do echo "$$p $$p"; done | \ | ||
228 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
229 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
230 | if (++n[$$2] == $(am__install_max)) \ | ||
231 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
232 | END { for (dir in files) print dir, files[dir] }' | ||
233 | am__base_list = \ | ||
234 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
235 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
236 | DATA = $(files_DATA) | ||
237 | ETAGS = etags | ||
238 | CTAGS = ctags | ||
239 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
240 | ACLOCAL = @ACLOCAL@ | ||
241 | ALLOCA = @ALLOCA@ | ||
242 | AMTAR = @AMTAR@ | ||
243 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
244 | AR = @AR@ | ||
245 | AS = @AS@ | ||
246 | AUTOCONF = @AUTOCONF@ | ||
247 | AUTOHEADER = @AUTOHEADER@ | ||
248 | AUTOMAKE = @AUTOMAKE@ | ||
249 | AWK = @AWK@ | ||
250 | CC = @CC@ | ||
251 | CCDEPMODE = @CCDEPMODE@ | ||
252 | CFLAGS = @CFLAGS@ | ||
253 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
254 | CHECK_LIBS = @CHECK_LIBS@ | ||
255 | CPP = @CPP@ | ||
256 | CPPFLAGS = @CPPFLAGS@ | ||
257 | CXX = @CXX@ | ||
258 | CXXCPP = @CXXCPP@ | ||
259 | CXXDEPMODE = @CXXDEPMODE@ | ||
260 | CXXFLAGS = @CXXFLAGS@ | ||
261 | CYGPATH_W = @CYGPATH_W@ | ||
262 | DEFS = @DEFS@ | ||
263 | DEPDIR = @DEPDIR@ | ||
264 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
265 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
266 | DLLTOOL = @DLLTOOL@ | ||
267 | DSYMUTIL = @DSYMUTIL@ | ||
268 | DUMPBIN = @DUMPBIN@ | ||
269 | ECHO_C = @ECHO_C@ | ||
270 | ECHO_N = @ECHO_N@ | ||
271 | ECHO_T = @ECHO_T@ | ||
272 | ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ | ||
273 | ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ | ||
274 | EDB_CFLAGS = @EDB_CFLAGS@ | ||
275 | EDB_LIBS = @EDB_LIBS@ | ||
276 | EDJE_CFLAGS = @EDJE_CFLAGS@ | ||
277 | EDJE_LIBS = @EDJE_LIBS@ | ||
278 | EET_CFLAGS = @EET_CFLAGS@ | ||
279 | EET_LIBS = @EET_LIBS@ | ||
280 | EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ | ||
281 | EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ | ||
282 | EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ | ||
283 | EGREP = @EGREP@ | ||
284 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
285 | EINA_LIBS = @EINA_LIBS@ | ||
286 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
287 | EVAS_LIBS = @EVAS_LIBS@ | ||
288 | EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | ||
289 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
290 | EVIL_LIBS = @EVIL_LIBS@ | ||
291 | EXEEXT = @EXEEXT@ | ||
292 | EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ | ||
293 | EXOTIC_LIBS = @EXOTIC_LIBS@ | ||
294 | FGREP = @FGREP@ | ||
295 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | ||
296 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | ||
297 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | ||
298 | FREETYPE_LIBS = @FREETYPE_LIBS@ | ||
299 | FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ | ||
300 | FRIBIDI_LIBS = @FRIBIDI_LIBS@ | ||
301 | GL_EET_CFLAGS = @GL_EET_CFLAGS@ | ||
302 | GL_EET_LIBS = @GL_EET_LIBS@ | ||
303 | GREP = @GREP@ | ||
304 | HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ | ||
305 | HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ | ||
306 | INSTALL = @INSTALL@ | ||
307 | INSTALL_DATA = @INSTALL_DATA@ | ||
308 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
309 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
310 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
311 | LD = @LD@ | ||
312 | LDFLAGS = @LDFLAGS@ | ||
313 | LIBOBJS = @LIBOBJS@ | ||
314 | LIBS = @LIBS@ | ||
315 | LIBTOOL = @LIBTOOL@ | ||
316 | LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ | ||
317 | LINEBREAK_LIBS = @LINEBREAK_LIBS@ | ||
318 | LIPO = @LIPO@ | ||
319 | LN_S = @LN_S@ | ||
320 | LTLIBOBJS = @LTLIBOBJS@ | ||
321 | MAKEINFO = @MAKEINFO@ | ||
322 | MKDIR_P = @MKDIR_P@ | ||
323 | MODULE_ARCH = @MODULE_ARCH@ | ||
324 | NM = @NM@ | ||
325 | NMEDIT = @NMEDIT@ | ||
326 | OBJC = @OBJC@ | ||
327 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
328 | OBJCFLAGS = @OBJCFLAGS@ | ||
329 | OBJDUMP = @OBJDUMP@ | ||
330 | OBJEXT = @OBJEXT@ | ||
331 | OTOOL = @OTOOL@ | ||
332 | OTOOL64 = @OTOOL64@ | ||
333 | PACKAGE = @PACKAGE@ | ||
334 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
335 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
336 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
337 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
338 | PACKAGE_URL = @PACKAGE_URL@ | ||
339 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
340 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
341 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
342 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
343 | PKG_CONFIG = @PKG_CONFIG@ | ||
344 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
345 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
346 | PNG_CFLAGS = @PNG_CFLAGS@ | ||
347 | PNG_LIBS = @PNG_LIBS@ | ||
348 | RANLIB = @RANLIB@ | ||
349 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
350 | SDL_LIBS = @SDL_LIBS@ | ||
351 | SED = @SED@ | ||
352 | SET_MAKE = @SET_MAKE@ | ||
353 | SHELL = @SHELL@ | ||
354 | SHM_OPEN_LINK = @SHM_OPEN_LINK@ | ||
355 | STRIP = @STRIP@ | ||
356 | SVG_CFLAGS = @SVG_CFLAGS@ | ||
357 | SVG_LIBS = @SVG_LIBS@ | ||
358 | VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | ||
359 | VALGRIND_LIBS = @VALGRIND_LIBS@ | ||
360 | VERSION = @VERSION@ | ||
361 | VMAJ = @VMAJ@ | ||
362 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
363 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
364 | XCB_CFLAGS = @XCB_CFLAGS@ | ||
365 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | ||
366 | XCB_GL_LIBS = @XCB_GL_LIBS@ | ||
367 | XCB_LIBS = @XCB_LIBS@ | ||
368 | XEXT_CFLAGS = @XEXT_CFLAGS@ | ||
369 | XEXT_LIBS = @XEXT_LIBS@ | ||
370 | XMKMF = @XMKMF@ | ||
371 | X_CFLAGS = @X_CFLAGS@ | ||
372 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
373 | X_LIBS = @X_LIBS@ | ||
374 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
375 | abs_builddir = @abs_builddir@ | ||
376 | abs_srcdir = @abs_srcdir@ | ||
377 | abs_top_builddir = @abs_top_builddir@ | ||
378 | abs_top_srcdir = @abs_top_srcdir@ | ||
379 | ac_ct_CC = @ac_ct_CC@ | ||
380 | ac_ct_CXX = @ac_ct_CXX@ | ||
381 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
382 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
383 | altivec_cflags = @altivec_cflags@ | ||
384 | am__include = @am__include@ | ||
385 | am__leading_dot = @am__leading_dot@ | ||
386 | am__quote = @am__quote@ | ||
387 | am__tar = @am__tar@ | ||
388 | am__untar = @am__untar@ | ||
389 | bindir = @bindir@ | ||
390 | build = @build@ | ||
391 | build_alias = @build_alias@ | ||
392 | build_cpu = @build_cpu@ | ||
393 | build_os = @build_os@ | ||
394 | build_vendor = @build_vendor@ | ||
395 | builddir = @builddir@ | ||
396 | datadir = @datadir@ | ||
397 | datarootdir = @datarootdir@ | ||
398 | dlopen_libs = @dlopen_libs@ | ||
399 | docdir = @docdir@ | ||
400 | dvidir = @dvidir@ | ||
401 | edje_cc = @edje_cc@ | ||
402 | efl_doxygen = @efl_doxygen@ | ||
403 | efl_have_doxygen = @efl_have_doxygen@ | ||
404 | evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ | ||
405 | evas_engine_buffer_libs = @evas_engine_buffer_libs@ | ||
406 | evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ | ||
407 | evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ | ||
408 | evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ | ||
409 | evas_engine_directfb_libs = @evas_engine_directfb_libs@ | ||
410 | evas_engine_fb_cflags = @evas_engine_fb_cflags@ | ||
411 | evas_engine_fb_libs = @evas_engine_fb_libs@ | ||
412 | evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ | ||
413 | evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ | ||
414 | evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ | ||
415 | evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ | ||
416 | evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ | ||
417 | evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ | ||
418 | evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ | ||
419 | evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ | ||
420 | evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ | ||
421 | evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ | ||
422 | evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ | ||
423 | evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ | ||
424 | evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ | ||
425 | evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ | ||
426 | evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ | ||
427 | evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ | ||
428 | evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ | ||
429 | evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ | ||
430 | evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ | ||
431 | evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ | ||
432 | evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ | ||
433 | evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | ||
434 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | ||
435 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | ||
436 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | ||
437 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | ||
438 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | ||
439 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | ||
440 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | ||
441 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
442 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
443 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
444 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
445 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | ||
446 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | ||
447 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | ||
448 | evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ | ||
449 | evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ | ||
450 | evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ | ||
451 | evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ | ||
452 | evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ | ||
453 | evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ | ||
454 | evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ | ||
455 | evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ | ||
456 | evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ | ||
457 | evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ | ||
458 | evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ | ||
459 | evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ | ||
460 | evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ | ||
461 | evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ | ||
462 | evas_image_loader_png_libs = @evas_image_loader_png_libs@ | ||
463 | evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ | ||
464 | evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ | ||
465 | evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ | ||
466 | evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ | ||
467 | evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ | ||
468 | evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ | ||
469 | evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ | ||
470 | evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ | ||
471 | evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ | ||
472 | evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ | ||
473 | evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ | ||
474 | evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ | ||
475 | exec_prefix = @exec_prefix@ | ||
476 | have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ | ||
477 | have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ | ||
478 | have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ | ||
479 | have_evas_engine_software_x11 = @have_evas_engine_software_x11@ | ||
480 | have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ | ||
481 | have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ | ||
482 | have_lcov = @have_lcov@ | ||
483 | host = @host@ | ||
484 | host_alias = @host_alias@ | ||
485 | host_cpu = @host_cpu@ | ||
486 | host_os = @host_os@ | ||
487 | host_vendor = @host_vendor@ | ||
488 | htmldir = @htmldir@ | ||
489 | includedir = @includedir@ | ||
490 | infodir = @infodir@ | ||
491 | install_sh = @install_sh@ | ||
492 | libdir = @libdir@ | ||
493 | libexecdir = @libexecdir@ | ||
494 | localedir = @localedir@ | ||
495 | localstatedir = @localstatedir@ | ||
496 | lt_ECHO = @lt_ECHO@ | ||
497 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
498 | mandir = @mandir@ | ||
499 | mkdir_p = @mkdir_p@ | ||
500 | oldincludedir = @oldincludedir@ | ||
501 | pdfdir = @pdfdir@ | ||
502 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
503 | prefix = @prefix@ | ||
504 | program_transform_name = @program_transform_name@ | ||
505 | psdir = @psdir@ | ||
506 | pthread_cflags = @pthread_cflags@ | ||
507 | pthread_libs = @pthread_libs@ | ||
508 | release_info = @release_info@ | ||
509 | requirement_evas = @requirement_evas@ | ||
510 | sbindir = @sbindir@ | ||
511 | sharedstatedir = @sharedstatedir@ | ||
512 | srcdir = @srcdir@ | ||
513 | sysconfdir = @sysconfdir@ | ||
514 | target_alias = @target_alias@ | ||
515 | top_build_prefix = @top_build_prefix@ | ||
516 | top_builddir = @top_builddir@ | ||
517 | top_srcdir = @top_srcdir@ | ||
518 | version_info = @version_info@ | ||
519 | MAINTAINERCLEANFILES = Makefile.in | ||
520 | examplesdir = $(datadir)/$(PACKAGE)/examples | ||
521 | |||
522 | #put here all EDCs one needs to the tests | ||
523 | EDCS = aspect.edc | ||
524 | filesdir = $(datadir)/$(PACKAGE)/examples | ||
525 | files_DATA = $(am__append_3) $(am__append_4) | ||
526 | |||
527 | #the ones using ecore_evas follow | ||
528 | |||
529 | #the ones using ecore_evas and edje follow | ||
530 | @BUILD_EXAMPLES_TRUE@AM_CPPFLAGS = -I. -I$(top_srcdir)/src/lib \ | ||
531 | @BUILD_EXAMPLES_TRUE@ -I$(top_srcdir)/src/lib/include \ | ||
532 | @BUILD_EXAMPLES_TRUE@ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | ||
533 | @BUILD_EXAMPLES_TRUE@ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
534 | @BUILD_EXAMPLES_TRUE@ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
535 | @BUILD_EXAMPLES_TRUE@ -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ | ||
536 | @BUILD_EXAMPLES_TRUE@ @EINA_CFLAGS@ @FREETYPE_CFLAGS@ \ | ||
537 | @BUILD_EXAMPLES_TRUE@ @PIXMAN_CFLAGS@ @FRIBIDI_CFLAGS@ \ | ||
538 | @BUILD_EXAMPLES_TRUE@ @EET_CFLAGS@ @FONTCONFIG_CFLAGS@ \ | ||
539 | @BUILD_EXAMPLES_TRUE@ @pthread_cflags@ $(am__append_1) \ | ||
540 | @BUILD_EXAMPLES_TRUE@ @ECORE_EVAS_CFLAGS@ @EDJE_CFLAGS@ \ | ||
541 | @BUILD_EXAMPLES_TRUE@ $(am__empty) | ||
542 | @BUILD_ENGINE_BUFFER_TRUE@@BUILD_EXAMPLES_TRUE@evas_buffer_simple_SOURCES = evas-buffer-simple.c | ||
543 | @BUILD_ENGINE_BUFFER_TRUE@@BUILD_EXAMPLES_TRUE@evas_buffer_simple_LDADD = $(top_builddir)/src/lib/libevas.la | ||
544 | @BUILD_EXAMPLES_TRUE@evas_init_shutdown_SOURCES = evas-init-shutdown.c | ||
545 | @BUILD_EXAMPLES_TRUE@evas_init_shutdown_LDADD = $(top_builddir)/src/lib/libevas.la | ||
546 | @BUILD_EXAMPLES_TRUE@evas_images_SOURCES = evas-images.c | ||
547 | @BUILD_EXAMPLES_TRUE@evas_images_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
548 | @BUILD_EXAMPLES_TRUE@evas_events_SOURCES = evas-events.c | ||
549 | @BUILD_EXAMPLES_TRUE@evas_events_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
550 | @BUILD_EXAMPLES_TRUE@evas_object_manipulation_SOURCES = evas-object-manipulation.c | ||
551 | @BUILD_EXAMPLES_TRUE@evas_object_manipulation_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
552 | @BUILD_EXAMPLES_TRUE@evas_hints_SOURCES = evas-hints.c | ||
553 | @BUILD_EXAMPLES_TRUE@evas_hints_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
554 | @BUILD_EXAMPLES_TRUE@evas_stacking_SOURCES = evas-stacking.c | ||
555 | @BUILD_EXAMPLES_TRUE@evas_stacking_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
556 | @BUILD_EXAMPLES_TRUE@evas_images2_SOURCES = evas-images2.c | ||
557 | @BUILD_EXAMPLES_TRUE@evas_images2_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
558 | @BUILD_EXAMPLES_TRUE@evas_text_SOURCES = evas-text.c | ||
559 | @BUILD_EXAMPLES_TRUE@evas_text_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
560 | @BUILD_EXAMPLES_TRUE@evas_smart_object_SOURCES = evas-smart-object.c | ||
561 | @BUILD_EXAMPLES_TRUE@evas_smart_object_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
562 | @BUILD_EXAMPLES_TRUE@evas_box_SOURCES = evas-box.c | ||
563 | @BUILD_EXAMPLES_TRUE@evas_box_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ @EINA_LIBS@ | ||
564 | @BUILD_EXAMPLES_TRUE@evas_aspect_hints_DEPS = $(srcdir)/aspect.edc | ||
565 | @BUILD_EXAMPLES_TRUE@evas_aspect_hints_SOURCES = evas-aspect-hints.c | ||
566 | @BUILD_EXAMPLES_TRUE@evas_aspect_hints_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ @EDJE_LIBS@ | ||
567 | @BUILD_EXAMPLES_TRUE@evas_map_utils_SOURCES = evas-map-utils.c | ||
568 | @BUILD_EXAMPLES_TRUE@evas_map_utils_LDADD = $(top_builddir)/src/lib/libevas.la @ECORE_EVAS_LIBS@ | ||
569 | @BUILD_EXAMPLES_TRUE@EDJS = $(EDCS:%.edc=%.edj) | ||
570 | EXTRA_DIST = $(EDCS) \ | ||
571 | $(srcdir)/evas-buffer-simple.c \ | ||
572 | $(srcdir)/evas-init-shutdown.c \ | ||
573 | $(srcdir)/evas-images.c \ | ||
574 | $(srcdir)/evas-images2.c \ | ||
575 | $(srcdir)/evas-object-manipulation.c \ | ||
576 | $(srcdir)/evas-events.c \ | ||
577 | $(srcdir)/evas-aspect-hints.c \ | ||
578 | $(srcdir)/evas-hints.c \ | ||
579 | $(srcdir)/evas-stacking.c \ | ||
580 | $(srcdir)/evas-map-utils.c \ | ||
581 | $(srcdir)/evas-text.c \ | ||
582 | $(srcdir)/evas-smart-object.c \ | ||
583 | $(srcdir)/evas-box.c \ | ||
584 | $(srcdir)/enlightenment.png \ | ||
585 | $(srcdir)/red.png \ | ||
586 | $(srcdir)/im1.png \ | ||
587 | $(srcdir)/cube1.png | ||
588 | |||
589 | all: all-am | ||
590 | |||
591 | .SUFFIXES: | ||
592 | .SUFFIXES: .c .edc .edj .lo .o .obj | ||
593 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
594 | @for dep in $?; do \ | ||
595 | case '$(am__configure_deps)' in \ | ||
596 | *$$dep*) \ | ||
597 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
598 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
599 | exit 1;; \ | ||
600 | esac; \ | ||
601 | done; \ | ||
602 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/examples/Makefile'; \ | ||
603 | $(am__cd) $(top_srcdir) && \ | ||
604 | $(AUTOMAKE) --gnu src/examples/Makefile | ||
605 | .PRECIOUS: Makefile | ||
606 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
607 | @case '$?' in \ | ||
608 | *config.status*) \ | ||
609 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
610 | *) \ | ||
611 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
612 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
613 | esac; | ||
614 | |||
615 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
616 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
617 | |||
618 | $(top_srcdir)/configure: $(am__configure_deps) | ||
619 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
620 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
621 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
622 | $(am__aclocal_m4_deps): | ||
623 | install-examplesPROGRAMS: $(examples_PROGRAMS) | ||
624 | @$(NORMAL_INSTALL) | ||
625 | test -z "$(examplesdir)" || $(MKDIR_P) "$(DESTDIR)$(examplesdir)" | ||
626 | @list='$(examples_PROGRAMS)'; test -n "$(examplesdir)" || list=; \ | ||
627 | for p in $$list; do echo "$$p $$p"; done | \ | ||
628 | sed 's/$(EXEEXT)$$//' | \ | ||
629 | while read p p1; do if test -f $$p || test -f $$p1; \ | ||
630 | then echo "$$p"; echo "$$p"; else :; fi; \ | ||
631 | done | \ | ||
632 | sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ | ||
633 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ | ||
634 | sed 'N;N;N;s,\n, ,g' | \ | ||
635 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ | ||
636 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ | ||
637 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ | ||
638 | else { print "f", $$3 "/" $$4, $$1; } } \ | ||
639 | END { for (d in files) print "f", d, files[d] }' | \ | ||
640 | while read type dir files; do \ | ||
641 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ | ||
642 | test -z "$$files" || { \ | ||
643 | echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(examplesdir)$$dir'"; \ | ||
644 | $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(examplesdir)$$dir" || exit $$?; \ | ||
645 | } \ | ||
646 | ; done | ||
647 | |||
648 | uninstall-examplesPROGRAMS: | ||
649 | @$(NORMAL_UNINSTALL) | ||
650 | @list='$(examples_PROGRAMS)'; test -n "$(examplesdir)" || list=; \ | ||
651 | files=`for p in $$list; do echo "$$p"; done | \ | ||
652 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ | ||
653 | -e 's/$$/$(EXEEXT)/' `; \ | ||
654 | test -n "$$list" || exit 0; \ | ||
655 | echo " ( cd '$(DESTDIR)$(examplesdir)' && rm -f" $$files ")"; \ | ||
656 | cd "$(DESTDIR)$(examplesdir)" && rm -f $$files | ||
657 | |||
658 | clean-examplesPROGRAMS: | ||
659 | @list='$(examples_PROGRAMS)'; test -n "$$list" || exit 0; \ | ||
660 | echo " rm -f" $$list; \ | ||
661 | rm -f $$list || exit $$?; \ | ||
662 | test -n "$(EXEEXT)" || exit 0; \ | ||
663 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ | ||
664 | echo " rm -f" $$list; \ | ||
665 | rm -f $$list | ||
666 | evas_aspect_hints$(EXEEXT): $(evas_aspect_hints_OBJECTS) $(evas_aspect_hints_DEPENDENCIES) | ||
667 | @rm -f evas_aspect_hints$(EXEEXT) | ||
668 | $(AM_V_CCLD)$(LINK) $(evas_aspect_hints_OBJECTS) $(evas_aspect_hints_LDADD) $(LIBS) | ||
669 | evas_box$(EXEEXT): $(evas_box_OBJECTS) $(evas_box_DEPENDENCIES) | ||
670 | @rm -f evas_box$(EXEEXT) | ||
671 | $(AM_V_CCLD)$(LINK) $(evas_box_OBJECTS) $(evas_box_LDADD) $(LIBS) | ||
672 | evas_buffer_simple$(EXEEXT): $(evas_buffer_simple_OBJECTS) $(evas_buffer_simple_DEPENDENCIES) | ||
673 | @rm -f evas_buffer_simple$(EXEEXT) | ||
674 | $(AM_V_CCLD)$(LINK) $(evas_buffer_simple_OBJECTS) $(evas_buffer_simple_LDADD) $(LIBS) | ||
675 | evas_events$(EXEEXT): $(evas_events_OBJECTS) $(evas_events_DEPENDENCIES) | ||
676 | @rm -f evas_events$(EXEEXT) | ||
677 | $(AM_V_CCLD)$(LINK) $(evas_events_OBJECTS) $(evas_events_LDADD) $(LIBS) | ||
678 | evas_hints$(EXEEXT): $(evas_hints_OBJECTS) $(evas_hints_DEPENDENCIES) | ||
679 | @rm -f evas_hints$(EXEEXT) | ||
680 | $(AM_V_CCLD)$(LINK) $(evas_hints_OBJECTS) $(evas_hints_LDADD) $(LIBS) | ||
681 | evas_images$(EXEEXT): $(evas_images_OBJECTS) $(evas_images_DEPENDENCIES) | ||
682 | @rm -f evas_images$(EXEEXT) | ||
683 | $(AM_V_CCLD)$(LINK) $(evas_images_OBJECTS) $(evas_images_LDADD) $(LIBS) | ||
684 | evas_images2$(EXEEXT): $(evas_images2_OBJECTS) $(evas_images2_DEPENDENCIES) | ||
685 | @rm -f evas_images2$(EXEEXT) | ||
686 | $(AM_V_CCLD)$(LINK) $(evas_images2_OBJECTS) $(evas_images2_LDADD) $(LIBS) | ||
687 | evas_init_shutdown$(EXEEXT): $(evas_init_shutdown_OBJECTS) $(evas_init_shutdown_DEPENDENCIES) | ||
688 | @rm -f evas_init_shutdown$(EXEEXT) | ||
689 | $(AM_V_CCLD)$(LINK) $(evas_init_shutdown_OBJECTS) $(evas_init_shutdown_LDADD) $(LIBS) | ||
690 | evas_map_utils$(EXEEXT): $(evas_map_utils_OBJECTS) $(evas_map_utils_DEPENDENCIES) | ||
691 | @rm -f evas_map_utils$(EXEEXT) | ||
692 | $(AM_V_CCLD)$(LINK) $(evas_map_utils_OBJECTS) $(evas_map_utils_LDADD) $(LIBS) | ||
693 | evas_object_manipulation$(EXEEXT): $(evas_object_manipulation_OBJECTS) $(evas_object_manipulation_DEPENDENCIES) | ||
694 | @rm -f evas_object_manipulation$(EXEEXT) | ||
695 | $(AM_V_CCLD)$(LINK) $(evas_object_manipulation_OBJECTS) $(evas_object_manipulation_LDADD) $(LIBS) | ||
696 | evas_smart_object$(EXEEXT): $(evas_smart_object_OBJECTS) $(evas_smart_object_DEPENDENCIES) | ||
697 | @rm -f evas_smart_object$(EXEEXT) | ||
698 | $(AM_V_CCLD)$(LINK) $(evas_smart_object_OBJECTS) $(evas_smart_object_LDADD) $(LIBS) | ||
699 | evas_stacking$(EXEEXT): $(evas_stacking_OBJECTS) $(evas_stacking_DEPENDENCIES) | ||
700 | @rm -f evas_stacking$(EXEEXT) | ||
701 | $(AM_V_CCLD)$(LINK) $(evas_stacking_OBJECTS) $(evas_stacking_LDADD) $(LIBS) | ||
702 | evas_text$(EXEEXT): $(evas_text_OBJECTS) $(evas_text_DEPENDENCIES) | ||
703 | @rm -f evas_text$(EXEEXT) | ||
704 | $(AM_V_CCLD)$(LINK) $(evas_text_OBJECTS) $(evas_text_LDADD) $(LIBS) | ||
705 | |||
706 | mostlyclean-compile: | ||
707 | -rm -f *.$(OBJEXT) | ||
708 | |||
709 | distclean-compile: | ||
710 | -rm -f *.tab.c | ||
711 | |||
712 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-aspect-hints.Po@am__quote@ | ||
713 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-box.Po@am__quote@ | ||
714 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-buffer-simple.Po@am__quote@ | ||
715 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-events.Po@am__quote@ | ||
716 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-hints.Po@am__quote@ | ||
717 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-images.Po@am__quote@ | ||
718 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-images2.Po@am__quote@ | ||
719 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-init-shutdown.Po@am__quote@ | ||
720 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-map-utils.Po@am__quote@ | ||
721 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-object-manipulation.Po@am__quote@ | ||
722 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-smart-object.Po@am__quote@ | ||
723 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-stacking.Po@am__quote@ | ||
724 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas-text.Po@am__quote@ | ||
725 | |||
726 | .c.o: | ||
727 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
728 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
729 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
730 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
731 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
732 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
733 | |||
734 | .c.obj: | ||
735 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
736 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
737 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
738 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
739 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
740 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
741 | |||
742 | .c.lo: | ||
743 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
744 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
745 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
746 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
747 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
748 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
749 | |||
750 | mostlyclean-libtool: | ||
751 | -rm -f *.lo | ||
752 | |||
753 | clean-libtool: | ||
754 | -rm -rf .libs _libs | ||
755 | install-filesDATA: $(files_DATA) | ||
756 | @$(NORMAL_INSTALL) | ||
757 | test -z "$(filesdir)" || $(MKDIR_P) "$(DESTDIR)$(filesdir)" | ||
758 | @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \ | ||
759 | for p in $$list; do \ | ||
760 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
761 | echo "$$d$$p"; \ | ||
762 | done | $(am__base_list) | \ | ||
763 | while read files; do \ | ||
764 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filesdir)'"; \ | ||
765 | $(INSTALL_DATA) $$files "$(DESTDIR)$(filesdir)" || exit $$?; \ | ||
766 | done | ||
767 | |||
768 | uninstall-filesDATA: | ||
769 | @$(NORMAL_UNINSTALL) | ||
770 | @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \ | ||
771 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | ||
772 | test -n "$$files" || exit 0; \ | ||
773 | echo " ( cd '$(DESTDIR)$(filesdir)' && rm -f" $$files ")"; \ | ||
774 | cd "$(DESTDIR)$(filesdir)" && rm -f $$files | ||
775 | |||
776 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
777 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
778 | unique=`for i in $$list; do \ | ||
779 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
780 | done | \ | ||
781 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
782 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
783 | mkid -fID $$unique | ||
784 | tags: TAGS | ||
785 | |||
786 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
787 | $(TAGS_FILES) $(LISP) | ||
788 | set x; \ | ||
789 | here=`pwd`; \ | ||
790 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
791 | unique=`for i in $$list; do \ | ||
792 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
793 | done | \ | ||
794 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
795 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
796 | shift; \ | ||
797 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
798 | test -n "$$unique" || unique=$$empty_fix; \ | ||
799 | if test $$# -gt 0; then \ | ||
800 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
801 | "$$@" $$unique; \ | ||
802 | else \ | ||
803 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
804 | $$unique; \ | ||
805 | fi; \ | ||
806 | fi | ||
807 | ctags: CTAGS | ||
808 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
809 | $(TAGS_FILES) $(LISP) | ||
810 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
811 | unique=`for i in $$list; do \ | ||
812 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
813 | done | \ | ||
814 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
815 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
816 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
817 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
818 | $$unique | ||
819 | |||
820 | GTAGS: | ||
821 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
822 | && $(am__cd) $(top_srcdir) \ | ||
823 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
824 | |||
825 | distclean-tags: | ||
826 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
827 | |||
828 | distdir: $(DISTFILES) | ||
829 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
830 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
831 | list='$(DISTFILES)'; \ | ||
832 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
833 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
834 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
835 | case $$dist_files in \ | ||
836 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
837 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
838 | sort -u` ;; \ | ||
839 | esac; \ | ||
840 | for file in $$dist_files; do \ | ||
841 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
842 | if test -d $$d/$$file; then \ | ||
843 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
844 | if test -d "$(distdir)/$$file"; then \ | ||
845 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
846 | fi; \ | ||
847 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
848 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
849 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
850 | fi; \ | ||
851 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
852 | else \ | ||
853 | test -f "$(distdir)/$$file" \ | ||
854 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
855 | || exit 1; \ | ||
856 | fi; \ | ||
857 | done | ||
858 | check-am: all-am | ||
859 | check: check-am | ||
860 | all-am: Makefile $(PROGRAMS) $(DATA) | ||
861 | installdirs: | ||
862 | for dir in "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(filesdir)"; do \ | ||
863 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
864 | done | ||
865 | install: install-am | ||
866 | install-exec: install-exec-am | ||
867 | install-data: install-data-am | ||
868 | uninstall: uninstall-am | ||
869 | |||
870 | install-am: all-am | ||
871 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
872 | |||
873 | installcheck: installcheck-am | ||
874 | install-strip: | ||
875 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
876 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
877 | `test -z '$(STRIP)' || \ | ||
878 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
879 | mostlyclean-generic: | ||
880 | |||
881 | clean-generic: | ||
882 | |||
883 | distclean-generic: | ||
884 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
885 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
886 | |||
887 | maintainer-clean-generic: | ||
888 | @echo "This command is intended for maintainers to use" | ||
889 | @echo "it deletes files that may require special tools to rebuild." | ||
890 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
891 | clean: clean-am | ||
892 | |||
893 | clean-am: clean-examplesPROGRAMS clean-generic clean-libtool \ | ||
894 | mostlyclean-am | ||
895 | |||
896 | distclean: distclean-am | ||
897 | -rm -rf ./$(DEPDIR) | ||
898 | -rm -f Makefile | ||
899 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
900 | distclean-tags | ||
901 | |||
902 | dvi: dvi-am | ||
903 | |||
904 | dvi-am: | ||
905 | |||
906 | html: html-am | ||
907 | |||
908 | html-am: | ||
909 | |||
910 | info: info-am | ||
911 | |||
912 | info-am: | ||
913 | |||
914 | install-data-am: install-examplesPROGRAMS install-filesDATA | ||
915 | |||
916 | install-dvi: install-dvi-am | ||
917 | |||
918 | install-dvi-am: | ||
919 | |||
920 | install-exec-am: | ||
921 | |||
922 | install-html: install-html-am | ||
923 | |||
924 | install-html-am: | ||
925 | |||
926 | install-info: install-info-am | ||
927 | |||
928 | install-info-am: | ||
929 | |||
930 | install-man: | ||
931 | |||
932 | install-pdf: install-pdf-am | ||
933 | |||
934 | install-pdf-am: | ||
935 | |||
936 | install-ps: install-ps-am | ||
937 | |||
938 | install-ps-am: | ||
939 | |||
940 | installcheck-am: | ||
941 | |||
942 | maintainer-clean: maintainer-clean-am | ||
943 | -rm -rf ./$(DEPDIR) | ||
944 | -rm -f Makefile | ||
945 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
946 | |||
947 | mostlyclean: mostlyclean-am | ||
948 | |||
949 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
950 | mostlyclean-libtool | ||
951 | |||
952 | pdf: pdf-am | ||
953 | |||
954 | pdf-am: | ||
955 | |||
956 | ps: ps-am | ||
957 | |||
958 | ps-am: | ||
959 | |||
960 | uninstall-am: uninstall-examplesPROGRAMS uninstall-filesDATA | ||
961 | |||
962 | .MAKE: install-am install-strip | ||
963 | |||
964 | .PHONY: CTAGS GTAGS all all-am check check-am clean \ | ||
965 | clean-examplesPROGRAMS clean-generic clean-libtool ctags \ | ||
966 | distclean distclean-compile distclean-generic \ | ||
967 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
968 | html-am info info-am install install-am install-data \ | ||
969 | install-data-am install-dvi install-dvi-am \ | ||
970 | install-examplesPROGRAMS install-exec install-exec-am \ | ||
971 | install-filesDATA install-html install-html-am install-info \ | ||
972 | install-info-am install-man install-pdf install-pdf-am \ | ||
973 | install-ps install-ps-am install-strip installcheck \ | ||
974 | installcheck-am installdirs maintainer-clean \ | ||
975 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
976 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
977 | tags uninstall uninstall-am uninstall-examplesPROGRAMS \ | ||
978 | uninstall-filesDATA | ||
979 | |||
980 | |||
981 | @BUILD_EXAMPLES_TRUE@aspect.edj: ${evas_aspect_hints_DEPS} | ||
982 | |||
983 | @BUILD_EXAMPLES_TRUE@.edc.edj: | ||
984 | @BUILD_EXAMPLES_TRUE@ $(edje_cc) -v -id $(srcdir) $< $(builddir)/$(@F) | ||
985 | |||
986 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
987 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
988 | .NOEXPORT: | ||
diff --git a/libraries/evas/src/examples/aspect.edc b/libraries/evas/src/examples/aspect.edc deleted file mode 100644 index b8bfb31..0000000 --- a/libraries/evas/src/examples/aspect.edc +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | collections { | ||
2 | group { | ||
3 | name: "main"; | ||
4 | parts { | ||
5 | part { | ||
6 | name: "content"; | ||
7 | mouse_events: 0; | ||
8 | type: SWALLOW; | ||
9 | description { | ||
10 | state: "default" 0.0; | ||
11 | visible: 1; | ||
12 | } | ||
13 | } | ||
14 | } | ||
15 | } | ||
16 | } | ||
17 | |||
diff --git a/libraries/evas/src/examples/cube1.png b/libraries/evas/src/examples/cube1.png deleted file mode 100644 index c2f4fda..0000000 --- a/libraries/evas/src/examples/cube1.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/libraries/evas/src/examples/enlightenment.png b/libraries/evas/src/examples/enlightenment.png deleted file mode 100644 index aeb836b..0000000 --- a/libraries/evas/src/examples/enlightenment.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/libraries/evas/src/examples/evas-aspect-hints.c b/libraries/evas/src/examples/evas-aspect-hints.c deleted file mode 100644 index de8ed50..0000000 --- a/libraries/evas/src/examples/evas-aspect-hints.c +++ /dev/null | |||
@@ -1,249 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating aspect control hints on objects. | ||
3 | * | ||
4 | * You'll need at least one engine built for it (excluding the buffer | ||
5 | * one) and the png image loader also built. See stdout/stderr for | ||
6 | * output. | ||
7 | * | ||
8 | * You'll also need @b Edje for this one, as it has the only smart | ||
9 | * object implementing aspect control for children. | ||
10 | * | ||
11 | * @verbatim | ||
12 | * gcc -o evas-events evas-events.c `pkg-config --libs --cflags ecore-evas edje` | ||
13 | * @endverbatim | ||
14 | */ | ||
15 | |||
16 | #ifdef HAVE_CONFIG_H | ||
17 | |||
18 | #include "config.h" | ||
19 | #endif | ||
20 | |||
21 | #include <Ecore.h> | ||
22 | #include <Ecore_Evas.h> | ||
23 | #include <Edje.h> | ||
24 | #include <stdio.h> | ||
25 | #include <errno.h> | ||
26 | |||
27 | #define WIDTH 320 | ||
28 | #define HEIGHT 480 | ||
29 | |||
30 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
31 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/aspect.edj"; | ||
32 | |||
33 | struct test_data | ||
34 | { | ||
35 | Ecore_Evas *ee; | ||
36 | Evas *canvas; | ||
37 | Evas_Object *bg, *rect, *container, *border; | ||
38 | }; | ||
39 | |||
40 | static struct test_data d = {0}; | ||
41 | |||
42 | /* here just to keep our example's window size and background image's | ||
43 | * size in synchrony */ | ||
44 | static void | ||
45 | _canvas_resize_cb(Ecore_Evas *ee) | ||
46 | { | ||
47 | int w, h; | ||
48 | |||
49 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
50 | evas_object_resize(d.bg, w, h); | ||
51 | } | ||
52 | |||
53 | static const char * | ||
54 | _get_aspect_name(Evas_Aspect_Control aspect) | ||
55 | { | ||
56 | switch (aspect) | ||
57 | { | ||
58 | case 0: | ||
59 | return "NONE"; | ||
60 | |||
61 | case 1: | ||
62 | return "NEITHER"; | ||
63 | |||
64 | case 2: | ||
65 | return "HORIZONTAL"; | ||
66 | |||
67 | case 3: | ||
68 | return "VERTICAL"; | ||
69 | |||
70 | case 4: | ||
71 | return "BOTH"; | ||
72 | |||
73 | default: | ||
74 | return "INVALID"; | ||
75 | } | ||
76 | } | ||
77 | |||
78 | static void | ||
79 | _on_keydown(void *data __UNUSED__, | ||
80 | Evas *evas __UNUSED__, | ||
81 | Evas_Object *o, | ||
82 | void *einfo) | ||
83 | { | ||
84 | const Evas_Modifier *mods; | ||
85 | Evas_Event_Key_Down *ev = einfo; | ||
86 | |||
87 | mods = evas_key_modifier_get(evas_object_evas_get(o)); | ||
88 | |||
89 | if (evas_key_modifier_is_set(mods, "Shift") && | ||
90 | strcmp(ev->keyname, "h") == 0) /* print help */ | ||
91 | { | ||
92 | fprintf(stdout, "commands are:\n" | ||
93 | "\tc - cycle aspect control on object\n" | ||
94 | "\th - change horizontal aspect component\n" | ||
95 | "\tv - change vertical aspect component\n" | ||
96 | "\ts - print current object's status\n" | ||
97 | "\tH - print help\n"); | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | if (strcmp(ev->keyname, "s") == 0) /* get aspect status of the obj */ | ||
102 | { | ||
103 | Evas_Coord w, h; | ||
104 | Evas_Aspect_Control aspect; | ||
105 | |||
106 | evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h); | ||
107 | |||
108 | fprintf(stdout, "Object has aspect %s, with horizontal compontent %d" | ||
109 | " and vertical compontent %d\n", | ||
110 | _get_aspect_name(aspect), w, h); | ||
111 | |||
112 | return; | ||
113 | } | ||
114 | |||
115 | if (strcmp(ev->keyname, "c") == 0) /* cycle aspect control on obj */ | ||
116 | { | ||
117 | Evas_Coord w, h; | ||
118 | Evas_Aspect_Control aspect; | ||
119 | |||
120 | evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h); | ||
121 | |||
122 | aspect = (aspect + 1) % 5; | ||
123 | |||
124 | evas_object_size_hint_aspect_set(d.rect, aspect, w, h); | ||
125 | |||
126 | fprintf(stdout, "Changing aspect control to %s\n", | ||
127 | _get_aspect_name(aspect)); | ||
128 | |||
129 | return; | ||
130 | } | ||
131 | |||
132 | if (strcmp(ev->keyname, "h") == 0) /* change horizontal aspect component */ | ||
133 | { | ||
134 | Evas_Coord w, h; | ||
135 | Evas_Aspect_Control aspect; | ||
136 | |||
137 | evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h); | ||
138 | |||
139 | w = (w + 1) % 3; | ||
140 | |||
141 | evas_object_size_hint_aspect_set(d.rect, aspect, w, h); | ||
142 | |||
143 | fprintf(stdout, "Changing horizontal aspect component to %d\n", w); | ||
144 | |||
145 | return; | ||
146 | } | ||
147 | |||
148 | if (strcmp(ev->keyname, "v") == 0) /* change vertical aspect component */ | ||
149 | { | ||
150 | Evas_Coord w, h; | ||
151 | Evas_Aspect_Control aspect; | ||
152 | |||
153 | evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h); | ||
154 | |||
155 | h = (h + 1) % 3; | ||
156 | |||
157 | evas_object_size_hint_aspect_set(d.rect, aspect, w, h); | ||
158 | |||
159 | fprintf(stdout, "Changing vertical aspect component to %d\n", h); | ||
160 | |||
161 | return; | ||
162 | } | ||
163 | } | ||
164 | |||
165 | int | ||
166 | main(void) | ||
167 | { | ||
168 | Eina_Bool ret; | ||
169 | |||
170 | if (!ecore_evas_init()) | ||
171 | return EXIT_FAILURE; | ||
172 | |||
173 | if (!edje_init()) | ||
174 | return EXIT_FAILURE; | ||
175 | |||
176 | /* this will give you a window with an Evas canvas under the first | ||
177 | * engine available */ | ||
178 | d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); | ||
179 | if (!d.ee) | ||
180 | goto error; | ||
181 | |||
182 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
183 | ecore_evas_show(d.ee); | ||
184 | |||
185 | /* the canvas pointer, de facto */ | ||
186 | d.canvas = ecore_evas_get(d.ee); | ||
187 | |||
188 | d.bg = evas_object_rectangle_add(d.canvas); | ||
189 | evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */ | ||
190 | evas_object_move(d.bg, 0, 0); /* at canvas' origin */ | ||
191 | evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
192 | evas_object_show(d.bg); | ||
193 | |||
194 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
195 | evas_object_event_callback_add( | ||
196 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
197 | |||
198 | d.container = edje_object_add(d.canvas); | ||
199 | ret = edje_object_file_set(d.container, edje_file_path, "main"); | ||
200 | if (!ret) | ||
201 | { | ||
202 | Edje_Load_Error err = edje_object_load_error_get(d.container); | ||
203 | const char *msg = edje_load_error_str(err); | ||
204 | fprintf(stderr, "could not load 'main' from %s: %s", | ||
205 | edje_file_path, msg); | ||
206 | |||
207 | goto panic; | ||
208 | } | ||
209 | |||
210 | evas_object_move(d.container, (WIDTH / 4), (HEIGHT / 4)); | ||
211 | evas_object_resize(d.container, (WIDTH / 2), (HEIGHT / 2)); | ||
212 | evas_object_show(d.container); | ||
213 | |||
214 | d.rect = evas_object_rectangle_add(d.canvas); | ||
215 | evas_object_color_set(d.rect, 0, 0, 255, 255); | ||
216 | evas_object_size_hint_aspect_set(d.rect, EVAS_ASPECT_CONTROL_NONE, 1, 1); | ||
217 | evas_object_show(d.rect); | ||
218 | |||
219 | edje_object_part_swallow(d.container, "content", d.rect); | ||
220 | evas_object_smart_changed(d.container); | ||
221 | |||
222 | /* this is a border around the edje object, container of the | ||
223 | * rectangle we are going to experiment with (change its aspect | ||
224 | * hints). this way you can see how their sizes relate */ | ||
225 | d.border = evas_object_image_filled_add(d.canvas); | ||
226 | evas_object_image_file_set(d.border, border_img_path, NULL); | ||
227 | evas_object_image_border_set(d.border, 3, 3, 3, 3); | ||
228 | evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE); | ||
229 | evas_object_move(d.border, (WIDTH / 4) - 3, (HEIGHT / 4) - 3); | ||
230 | evas_object_resize(d.border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6); | ||
231 | evas_object_show(d.border); | ||
232 | |||
233 | ecore_main_loop_begin(); | ||
234 | |||
235 | ecore_evas_free(d.ee); | ||
236 | ecore_evas_shutdown(); | ||
237 | edje_shutdown(); | ||
238 | return 0; | ||
239 | |||
240 | error: | ||
241 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
242 | " up to ecore-evas for this example to run properly.\n"); | ||
243 | panic: | ||
244 | ecore_evas_free(d.ee); | ||
245 | ecore_evas_shutdown(); | ||
246 | edje_shutdown(); | ||
247 | |||
248 | return -1; | ||
249 | } | ||
diff --git a/libraries/evas/src/examples/evas-box.c b/libraries/evas/src/examples/evas-box.c deleted file mode 100644 index ec79535..0000000 --- a/libraries/evas/src/examples/evas-box.c +++ /dev/null | |||
@@ -1,382 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating a custom Evas box object | ||
3 | * | ||
4 | * You'll need at least one engine built for it (excluding the buffer | ||
5 | * one). See stdout/stderr for output. | ||
6 | * | ||
7 | * @verbatim | ||
8 | * gcc -o evas-box evas-box.c `pkg-config --libs --cflags evas ecore ecore-evas eina` | ||
9 | * @endverbatim | ||
10 | */ | ||
11 | |||
12 | #ifdef HAVE_CONFIG_H | ||
13 | |||
14 | #include "config.h" | ||
15 | #else | ||
16 | #define PACKAGE_EXAMPLES_DIR "." | ||
17 | #define __UNUSED__ | ||
18 | #endif | ||
19 | |||
20 | #include <Ecore.h> | ||
21 | #include <Ecore_Evas.h> | ||
22 | |||
23 | #include <stdlib.h> | ||
24 | #include <stdio.h> | ||
25 | #include <string.h> | ||
26 | |||
27 | #define WIDTH (640) | ||
28 | #define HEIGHT (480) | ||
29 | |||
30 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
31 | |||
32 | static const char *commands = \ | ||
33 | "commands are:\n" | ||
34 | "\ta - change the box's alignment values\n" | ||
35 | "\tp - change the box's padding values\n" | ||
36 | "\t1 - change the box's layout to horizontal\n" | ||
37 | "\t2 - change the box's layout to vertical\n" | ||
38 | "\t3 - change the box's layout to horizontal homogeneous\n" | ||
39 | "\t4 - change the box's layout to vertical homogeneous\n" | ||
40 | "\t5 - change the box's layout to horizontal maximum size homogeneous\n" | ||
41 | "\t6 - change the box's layout to vertical maximum size homogeneous\n" | ||
42 | "\t7 - change the box's layout to horizontal flow\n" | ||
43 | "\t8 - change the box's layout to vertical flow\n" | ||
44 | "\t9 - change the box's layout to stack\n" | ||
45 | "\t0 - change the box's layout to a custom-made one\n" | ||
46 | "\tCtrl + NUMBER - insert a new child object at that position in the box\n" | ||
47 | "\tShift + NUMBER - remove the child object at that position in the box\n" | ||
48 | "\th - print help\n"; | ||
49 | |||
50 | struct exemple_data | ||
51 | { | ||
52 | Ecore_Evas *ee; | ||
53 | Evas *evas; | ||
54 | Evas_Object *bg, *box, *border; | ||
55 | }; | ||
56 | |||
57 | static struct exemple_data d; | ||
58 | |||
59 | static void /* custom 'diagonal' layout */ | ||
60 | _custom_layout(Evas_Object *o, | ||
61 | Evas_Object_Box_Data *p, | ||
62 | void *data __UNUSED__) | ||
63 | { | ||
64 | int x, y, w, h; | ||
65 | int xx, yy, ww, hh; | ||
66 | int count; | ||
67 | Eina_List *l; | ||
68 | Evas_Object_Box_Option *opt; | ||
69 | |||
70 | evas_object_geometry_get(o, &x, &y, &w, &h); | ||
71 | count = eina_list_count(p->children); | ||
72 | ww = w / (count ? : 1); | ||
73 | hh = h / (count ? : 1); | ||
74 | if (ww < 1) ww = 1; | ||
75 | if (hh < 1) hh = 1; | ||
76 | |||
77 | xx = x; | ||
78 | yy = y; | ||
79 | EINA_LIST_FOREACH(p->children, l, opt) | ||
80 | { | ||
81 | evas_object_move(opt->obj, xx, yy); | ||
82 | xx += ww; | ||
83 | yy += hh; | ||
84 | } | ||
85 | } | ||
86 | |||
87 | static Evas_Object * /* new rectangle to be put in the box */ | ||
88 | _new_rectangle_add(Evas *e) | ||
89 | { | ||
90 | Evas_Object *o; | ||
91 | |||
92 | o = evas_object_rectangle_add(e); | ||
93 | evas_object_resize(o, 10, 10); | ||
94 | evas_object_color_set(o, 0, 255, 0, 255); | ||
95 | evas_object_show(o); | ||
96 | |||
97 | return o; | ||
98 | } | ||
99 | |||
100 | /* use the following commands to interact with this example - 'h' is | ||
101 | * the key for help */ | ||
102 | static void | ||
103 | _on_keydown(void *data __UNUSED__, | ||
104 | Evas *evas __UNUSED__, | ||
105 | Evas_Object *o __UNUSED__, | ||
106 | void *einfo) | ||
107 | { | ||
108 | Evas_Event_Key_Down *ev = einfo; | ||
109 | const Evas_Modifier *mods = evas_key_modifier_get(evas); | ||
110 | |||
111 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
112 | { | ||
113 | fprintf(stdout, commands); | ||
114 | return; | ||
115 | } | ||
116 | |||
117 | if (evas_key_modifier_is_set(mods, "Shift")) | ||
118 | { | ||
119 | int pos; | ||
120 | Eina_Bool ret; | ||
121 | Evas_Object *obj; | ||
122 | Eina_List *children; | ||
123 | |||
124 | pos = atoi(ev->keyname); | ||
125 | children = evas_object_box_children_get(d.box); | ||
126 | |||
127 | obj = eina_list_nth(children, pos); | ||
128 | if (!obj) goto list_free; | ||
129 | |||
130 | ret = evas_object_box_remove_at(d.box, pos); | ||
131 | if (ret) evas_object_del(obj); | ||
132 | |||
133 | list_free: | ||
134 | eina_list_free(children); | ||
135 | return; | ||
136 | } | ||
137 | |||
138 | if (evas_key_modifier_is_set(mods, "Control")) | ||
139 | { | ||
140 | Evas_Object *o; | ||
141 | int pos; | ||
142 | pos = atoi(ev->keyname); | ||
143 | o = _new_rectangle_add(d.evas); | ||
144 | if (!evas_object_box_insert_at(d.box, o, pos)) | ||
145 | evas_object_box_append(d.box, o); | ||
146 | return; | ||
147 | } | ||
148 | |||
149 | if (strcmp(ev->keyname, "a") == 0) | ||
150 | { | ||
151 | double h, v; | ||
152 | |||
153 | evas_object_box_align_get(d.box, &h, &v); | ||
154 | |||
155 | if (h == 0.5) | ||
156 | h = v = 1.0; | ||
157 | else if (h == 1.0) | ||
158 | h = v = -1.0; | ||
159 | else if (h == -1.0) | ||
160 | h = v = 0.0; | ||
161 | else if (h == 0.0) | ||
162 | h = v = 0.5; | ||
163 | |||
164 | evas_object_box_align_set(d.box, h, v); | ||
165 | |||
166 | fprintf(stdout, "Applying new alignment values (%.1f, %.1f)" | ||
167 | " on the box\n", h, v); | ||
168 | return; | ||
169 | } | ||
170 | |||
171 | if (strcmp(ev->keyname, "p") == 0) | ||
172 | { | ||
173 | int h, v; | ||
174 | |||
175 | evas_object_box_padding_get(d.box, &h, &v); | ||
176 | |||
177 | if (h == 0) | ||
178 | h = v = 50; | ||
179 | else | ||
180 | h = v = 0; | ||
181 | |||
182 | evas_object_box_padding_set(d.box, h, v); | ||
183 | |||
184 | fprintf(stdout, "Applying new padding values (%d, %d)" | ||
185 | " on the box\n", h, v); | ||
186 | return; | ||
187 | } | ||
188 | |||
189 | if (strcmp(ev->keyname, "1") == 0) | ||
190 | { | ||
191 | evas_object_box_layout_set( | ||
192 | d.box, evas_object_box_layout_horizontal, NULL, NULL); | ||
193 | |||
194 | fprintf(stdout, "Applying '%s' layout on the box\n", "horizontal"); | ||
195 | return; | ||
196 | } | ||
197 | |||
198 | if (strcmp(ev->keyname, "2") == 0) | ||
199 | { | ||
200 | evas_object_box_layout_set( | ||
201 | d.box, evas_object_box_layout_vertical, NULL, NULL); | ||
202 | |||
203 | fprintf(stdout, "Applying '%s' layout on the box\n", "vertical"); | ||
204 | return; | ||
205 | } | ||
206 | |||
207 | if (strcmp(ev->keyname, "3") == 0) | ||
208 | { | ||
209 | evas_object_box_layout_set( | ||
210 | d.box, evas_object_box_layout_homogeneous_horizontal, NULL, | ||
211 | NULL); | ||
212 | |||
213 | fprintf(stdout, "Applying '%s' layout on the box\n", | ||
214 | "horizontal homogeneous"); | ||
215 | return; | ||
216 | } | ||
217 | |||
218 | if (strcmp(ev->keyname, "4") == 0) | ||
219 | { | ||
220 | evas_object_box_layout_set( | ||
221 | d.box, evas_object_box_layout_homogeneous_vertical, NULL, NULL); | ||
222 | |||
223 | fprintf(stdout, "Applying '%s' layout on the box\n", | ||
224 | "vertical homogeneous"); | ||
225 | return; | ||
226 | } | ||
227 | |||
228 | if (strcmp(ev->keyname, "5") == 0) | ||
229 | { | ||
230 | evas_object_box_layout_set( | ||
231 | d.box, evas_object_box_layout_homogeneous_max_size_horizontal, | ||
232 | NULL, NULL); | ||
233 | |||
234 | fprintf(stdout, "Applying '%s' layout on the box\n", | ||
235 | "horizontal maximum size homogeneous"); | ||
236 | return; | ||
237 | } | ||
238 | |||
239 | if (strcmp(ev->keyname, "6") == 0) | ||
240 | { | ||
241 | evas_object_box_layout_set( | ||
242 | d.box, evas_object_box_layout_homogeneous_max_size_vertical, | ||
243 | NULL, NULL); | ||
244 | |||
245 | fprintf(stdout, "Applying '%s' layout on the box\n", | ||
246 | "vertical maximum size homogeneous"); | ||
247 | return; | ||
248 | } | ||
249 | |||
250 | if (strcmp(ev->keyname, "7") == 0) | ||
251 | { | ||
252 | evas_object_box_layout_set( | ||
253 | d.box, evas_object_box_layout_flow_horizontal, NULL, NULL); | ||
254 | |||
255 | fprintf(stdout, "Applying '%s' layout on the box\n", "horizontal flow"); | ||
256 | return; | ||
257 | } | ||
258 | |||
259 | if (strcmp(ev->keyname, "8") == 0) | ||
260 | { | ||
261 | evas_object_box_layout_set( | ||
262 | d.box, evas_object_box_layout_flow_vertical, NULL, NULL); | ||
263 | |||
264 | fprintf(stdout, "Applying '%s' layout on the box\n", "vertical flow"); | ||
265 | return; | ||
266 | } | ||
267 | |||
268 | if (strcmp(ev->keyname, "9") == 0) | ||
269 | { | ||
270 | evas_object_box_layout_set( | ||
271 | d.box, evas_object_box_layout_stack, NULL, NULL); | ||
272 | |||
273 | fprintf(stdout, "Applying '%s' layout on the box\n", "stack"); | ||
274 | return; | ||
275 | } | ||
276 | |||
277 | if (strcmp(ev->keyname, "0") == 0) | ||
278 | { | ||
279 | evas_object_box_layout_set(d.box, _custom_layout, NULL, NULL); | ||
280 | |||
281 | fprintf(stdout, "Applying '%s' layout on the box\n", "CUSTOM"); | ||
282 | return; | ||
283 | } | ||
284 | } | ||
285 | |||
286 | static void | ||
287 | _on_delete(Ecore_Evas *ee __UNUSED__) | ||
288 | { | ||
289 | ecore_main_loop_quit(); | ||
290 | } | ||
291 | |||
292 | static void /* adjust canvas' contents on resizes */ | ||
293 | _canvas_resize_cb(Ecore_Evas *ee) | ||
294 | { | ||
295 | int w, h; | ||
296 | |||
297 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
298 | |||
299 | evas_object_resize(d.bg, w, h); | ||
300 | |||
301 | evas_object_move(d.box, (w / 4), (h / 4)); | ||
302 | evas_object_resize(d.box, (w / 2), (h / 2)); | ||
303 | |||
304 | evas_object_move(d.border, (w / 4) - 2, (h / 4) - 2); | ||
305 | evas_object_resize(d.border, (w / 2) + 4, (h / 2) + 4); | ||
306 | } | ||
307 | |||
308 | int | ||
309 | main(void) | ||
310 | { | ||
311 | Evas_Object *last, *o; | ||
312 | int i; | ||
313 | |||
314 | srand(time(NULL)); | ||
315 | |||
316 | if (!ecore_evas_init()) | ||
317 | return EXIT_FAILURE; | ||
318 | |||
319 | /* this will give you a window with an Evas canvas under the first | ||
320 | * engine available */ | ||
321 | d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
322 | if (!d.ee) | ||
323 | goto panic; | ||
324 | |||
325 | ecore_evas_callback_delete_request_set(d.ee, _on_delete); | ||
326 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
327 | ecore_evas_show(d.ee); | ||
328 | |||
329 | d.evas = ecore_evas_get(d.ee); | ||
330 | |||
331 | d.bg = evas_object_rectangle_add(d.evas); | ||
332 | evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */ | ||
333 | evas_object_show(d.bg); | ||
334 | |||
335 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
336 | evas_object_event_callback_add( | ||
337 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
338 | |||
339 | d.box = evas_object_box_add(d.evas); | ||
340 | evas_object_show(d.box); | ||
341 | |||
342 | for (i = 1; i <= 5; i++) | ||
343 | { | ||
344 | o = last = evas_object_rectangle_add(d.evas); | ||
345 | evas_object_size_hint_min_set(o, 50, 50); | ||
346 | evas_object_color_set( | ||
347 | o, rand() % 256, rand() % 256, rand() % 256, 255); | ||
348 | evas_object_show(o); | ||
349 | |||
350 | if (!evas_object_box_append(d.box, o)) | ||
351 | { | ||
352 | fprintf(stderr, "Error appending child object on the box!\n"); | ||
353 | goto error; | ||
354 | } | ||
355 | } | ||
356 | |||
357 | /* this is a border around the box, container of the rectangles we | ||
358 | * are going to experiment with. this way you can see how the | ||
359 | * container relates to the children */ | ||
360 | d.border = evas_object_image_filled_add(d.evas); | ||
361 | evas_object_image_file_set(d.border, border_img_path, NULL); | ||
362 | evas_object_image_border_set(d.border, 2, 2, 2, 2); | ||
363 | evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE); | ||
364 | evas_object_show(d.border); | ||
365 | |||
366 | fprintf(stdout, commands); | ||
367 | |||
368 | _canvas_resize_cb(d.ee); | ||
369 | ecore_main_loop_begin(); | ||
370 | ecore_evas_shutdown(); | ||
371 | return 0; | ||
372 | |||
373 | error: | ||
374 | ecore_evas_shutdown(); | ||
375 | return -1; | ||
376 | |||
377 | panic: | ||
378 | fprintf(stderr, "You got to have at least one evas engine built and linked" | ||
379 | " up to ecore-evas for this example to run properly.\n"); | ||
380 | return -2; | ||
381 | } | ||
382 | |||
diff --git a/libraries/evas/src/examples/evas-buffer-simple.c b/libraries/evas/src/examples/evas-buffer-simple.c deleted file mode 100644 index 6676ef1..0000000 --- a/libraries/evas/src/examples/evas-buffer-simple.c +++ /dev/null | |||
@@ -1,228 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example using the Buffer engine. | ||
3 | * | ||
4 | * You must have Evas compiled with the buffer engine, and have the | ||
5 | * evas-software-buffer pkg-config files installed. | ||
6 | * | ||
7 | * Compile with: | ||
8 | * | ||
9 | * @verbatim | ||
10 | * gcc -o evas-buffer-simple evas-buffer-simple.c `pkg-config --libs --cflags evas evas-software-buffer` | ||
11 | * @endverbatim | ||
12 | * | ||
13 | */ | ||
14 | #include <Evas.h> | ||
15 | #include <Evas_Engine_Buffer.h> | ||
16 | #include <stdio.h> | ||
17 | #include <errno.h> | ||
18 | |||
19 | #define WIDTH (320) | ||
20 | #define HEIGHT (240) | ||
21 | |||
22 | /* | ||
23 | * create_canvas(), destroy_canvas() and draw_scene() are support functions. | ||
24 | * | ||
25 | * They are only required to use raw Evas, but for real world usage, | ||
26 | * it is recommended to use ecore and its ecore-evas submodule, that | ||
27 | * provide convenience canvas creators, integration with main loop and | ||
28 | * automatic render of updates (draw_scene()) when system goes back to | ||
29 | * main loop. | ||
30 | */ | ||
31 | static Evas *create_canvas(int width, int height); | ||
32 | static void destroy_canvas(Evas *canvas); | ||
33 | static void draw_scene(Evas *canvas); | ||
34 | |||
35 | // support function to save scene as PPM image | ||
36 | static void save_scene(Evas *canvas, const char *dest); | ||
37 | |||
38 | int main(void) | ||
39 | { | ||
40 | Evas *canvas; | ||
41 | Evas_Object *bg, *r1, *r2, *r3; | ||
42 | |||
43 | evas_init(); | ||
44 | |||
45 | // create your canvas | ||
46 | // NOTE: consider using ecore_evas_buffer_new() instead! | ||
47 | canvas = create_canvas(WIDTH, HEIGHT); | ||
48 | if (!canvas) | ||
49 | return -1; | ||
50 | |||
51 | bg = evas_object_rectangle_add(canvas); | ||
52 | evas_object_color_set(bg, 255, 255, 255, 255); // white bg | ||
53 | evas_object_move(bg, 0, 0); // at origin | ||
54 | evas_object_resize(bg, WIDTH, HEIGHT); // covers full canvas | ||
55 | evas_object_show(bg); | ||
56 | |||
57 | puts("initial scene, with just background:"); | ||
58 | draw_scene(canvas); | ||
59 | |||
60 | r1 = evas_object_rectangle_add(canvas); | ||
61 | evas_object_color_set(r1, 255, 0, 0, 255); // 100% opaque red | ||
62 | evas_object_move(r1, 10, 10); | ||
63 | evas_object_resize(r1, 100, 100); | ||
64 | evas_object_show(r1); | ||
65 | |||
66 | // pay attention to transparency! Evas color values are pre-multiplied by | ||
67 | // alpha, so 50% opaque green is: | ||
68 | // non-premul: r=0, g=255, b=0 a=128 (50% alpha) | ||
69 | // premul: | ||
70 | // r_premul = r * a / 255 = 0 * 128 / 255 = 0 | ||
71 | // g_premul = g * a / 255 = 255 * 128 / 255 = 128 | ||
72 | // b_premul = b * a / 255 = 0 * 128 / 255 = 0 | ||
73 | // | ||
74 | // this 50% green is over a red background, so it will show in the | ||
75 | // final output as yellow (green + red = yellow) | ||
76 | r2 = evas_object_rectangle_add(canvas); | ||
77 | evas_object_color_set(r2, 0, 128, 0, 128); // 50% opaque green | ||
78 | evas_object_move(r2, 10, 10); | ||
79 | evas_object_resize(r2, 50, 50); | ||
80 | evas_object_show(r2); | ||
81 | |||
82 | r3 = evas_object_rectangle_add(canvas); | ||
83 | evas_object_color_set(r3, 0, 128, 0, 255); // 100% opaque dark green | ||
84 | evas_object_move(r3, 60, 60); | ||
85 | evas_object_resize(r3, 50, 50); | ||
86 | evas_object_show(r3); | ||
87 | |||
88 | puts("final scene (note updates):"); | ||
89 | draw_scene(canvas); | ||
90 | save_scene(canvas, "/tmp/evas-buffer-simple-render.ppm"); | ||
91 | |||
92 | // NOTE: use ecore_evas_buffer_new() and here ecore_evas_free() | ||
93 | destroy_canvas(canvas); | ||
94 | |||
95 | evas_shutdown(); | ||
96 | |||
97 | return 0; | ||
98 | } | ||
99 | |||
100 | static Evas *create_canvas(int width, int height) | ||
101 | { | ||
102 | Evas *canvas; | ||
103 | Evas_Engine_Info_Buffer *einfo; | ||
104 | int method; | ||
105 | void *pixels; | ||
106 | |||
107 | method = evas_render_method_lookup("buffer"); | ||
108 | if (method <= 0) | ||
109 | { | ||
110 | fputs("ERROR: evas was not compiled with 'buffer' engine!\n", stderr); | ||
111 | return NULL; | ||
112 | } | ||
113 | |||
114 | canvas = evas_new(); | ||
115 | if (!canvas) | ||
116 | { | ||
117 | fputs("ERROR: could not instantiate new evas canvas.\n", stderr); | ||
118 | return NULL; | ||
119 | } | ||
120 | |||
121 | evas_output_method_set(canvas, method); | ||
122 | evas_output_size_set(canvas, width, height); | ||
123 | evas_output_viewport_set(canvas, 0, 0, width, height); | ||
124 | |||
125 | einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(canvas); | ||
126 | if (!einfo) | ||
127 | { | ||
128 | fputs("ERROR: could not get evas engine info!\n", stderr); | ||
129 | evas_free(canvas); | ||
130 | return NULL; | ||
131 | } | ||
132 | |||
133 | // ARGB32 is sizeof(int), that is 4 bytes, per pixel | ||
134 | pixels = malloc(width * height * sizeof(int)); | ||
135 | if (!pixels) | ||
136 | { | ||
137 | fputs("ERROR: could not allocate canvas pixels!\n", stderr); | ||
138 | evas_free(canvas); | ||
139 | return NULL; | ||
140 | } | ||
141 | |||
142 | einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32; | ||
143 | einfo->info.dest_buffer = pixels; | ||
144 | einfo->info.dest_buffer_row_bytes = width * sizeof(int); | ||
145 | einfo->info.use_color_key = 0; | ||
146 | einfo->info.alpha_threshold = 0; | ||
147 | einfo->info.func.new_update_region = NULL; | ||
148 | einfo->info.func.free_update_region = NULL; | ||
149 | evas_engine_info_set(canvas, (Evas_Engine_Info *)einfo); | ||
150 | |||
151 | return canvas; | ||
152 | } | ||
153 | |||
154 | static void destroy_canvas(Evas *canvas) | ||
155 | { | ||
156 | Evas_Engine_Info_Buffer *einfo; | ||
157 | |||
158 | einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(canvas); | ||
159 | if (!einfo) | ||
160 | { | ||
161 | fputs("ERROR: could not get evas engine info!\n", stderr); | ||
162 | evas_free(canvas); | ||
163 | return; | ||
164 | } | ||
165 | |||
166 | free(einfo->info.dest_buffer); | ||
167 | evas_free(canvas); | ||
168 | } | ||
169 | |||
170 | static void draw_scene(Evas *canvas) | ||
171 | { | ||
172 | Eina_List *updates, *n; | ||
173 | Eina_Rectangle *update; | ||
174 | |||
175 | // render and get the updated rectangles: | ||
176 | updates = evas_render_updates(canvas); | ||
177 | |||
178 | // informative only here, just print the updated areas: | ||
179 | EINA_LIST_FOREACH(updates, n, update) | ||
180 | printf("UPDATED REGION: pos: %3d, %3d size: %3dx%3d\n", | ||
181 | update->x, update->y, update->w, update->h); | ||
182 | |||
183 | // free list of updates | ||
184 | evas_render_updates_free(updates); | ||
185 | } | ||
186 | |||
187 | static void save_scene(Evas *canvas, const char *dest) | ||
188 | { | ||
189 | Evas_Engine_Info_Buffer *einfo; | ||
190 | const unsigned int *pixels, *pixels_end; | ||
191 | int width, height; | ||
192 | FILE *f; | ||
193 | |||
194 | einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(canvas); | ||
195 | if (!einfo) | ||
196 | { | ||
197 | fputs("ERROR: could not get evas engine info!\n", stderr); | ||
198 | return; | ||
199 | } | ||
200 | evas_output_size_get(canvas, &width, &height); | ||
201 | |||
202 | f = fopen(dest, "wb+"); | ||
203 | if (!f) | ||
204 | { | ||
205 | fprintf(stderr, "ERROR: could not open for writing '%s': %s\n", | ||
206 | dest, strerror(errno)); | ||
207 | return; | ||
208 | } | ||
209 | |||
210 | pixels = einfo->info.dest_buffer; | ||
211 | pixels_end = pixels + (width * height); | ||
212 | |||
213 | // PPM P6 format is dead simple to write: | ||
214 | fprintf(f, "P6\n%d %d\n255\n", width, height); | ||
215 | for (; pixels < pixels_end; pixels++) | ||
216 | { | ||
217 | int r, g, b; | ||
218 | |||
219 | r = ((*pixels) & 0xff0000) >> 16; | ||
220 | g = ((*pixels) & 0x00ff00) >> 8; | ||
221 | b = (*pixels) & 0x0000ff; | ||
222 | |||
223 | fprintf(f, "%c%c%c", r, g, b); | ||
224 | } | ||
225 | |||
226 | fclose(f); | ||
227 | printf("saved scene as '%s'\n", dest); | ||
228 | } | ||
diff --git a/libraries/evas/src/examples/evas-events.c b/libraries/evas/src/examples/evas-events.c deleted file mode 100644 index 28b22ed..0000000 --- a/libraries/evas/src/examples/evas-events.c +++ /dev/null | |||
@@ -1,413 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating how to interact with canvas' (and | ||
3 | * its objects') events and other canvas operations. | ||
4 | * | ||
5 | * You'll need at least one engine built for it (excluding the buffer | ||
6 | * one) and the png image loader also built. See stdout/stderr for | ||
7 | * output. | ||
8 | * | ||
9 | * @verbatim | ||
10 | * gcc -o evas-events evas-events.c `pkg-config --libs --cflags evas ecore ecore-evas` | ||
11 | * @endverbatim | ||
12 | */ | ||
13 | |||
14 | #ifdef HAVE_CONFIG_H | ||
15 | |||
16 | #include "config.h" | ||
17 | #else | ||
18 | |||
19 | #define PACKAGE_EXAMPLES_DIR "." | ||
20 | #define __UNUSED__ | ||
21 | |||
22 | #endif | ||
23 | |||
24 | #include <Ecore.h> | ||
25 | #include <Ecore_Evas.h> | ||
26 | #include <stdio.h> | ||
27 | #include <errno.h> | ||
28 | |||
29 | #define WIDTH (320) | ||
30 | #define HEIGHT (240) | ||
31 | |||
32 | static const char *img_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png"; | ||
33 | |||
34 | static const char *commands = \ | ||
35 | "commands are:\n" | ||
36 | "\ta - toggle animation timer\n" | ||
37 | "\tc - cycle between focus and key grabs for key input\n" | ||
38 | "\td - delete canvas callbacks\n" | ||
39 | "\tf - freeze input for 3 seconds\n" | ||
40 | "\tp - toggle precise point collision detection on image\n" | ||
41 | "\tControl + o - add an obscured rectangle\n" | ||
42 | "\th - print help\n"; | ||
43 | |||
44 | struct test_data | ||
45 | { | ||
46 | Ecore_Evas *ee; | ||
47 | Evas *canvas; | ||
48 | Evas_Object *img, *bg; | ||
49 | Ecore_Timer *resize_timer, *freeze_timer; | ||
50 | Eina_Bool obscured, focus; | ||
51 | }; | ||
52 | |||
53 | static struct test_data d = {0}; | ||
54 | |||
55 | /* here to keep our example's window size and background image's | ||
56 | * size in synchrony */ | ||
57 | static void | ||
58 | _canvas_resize_cb(Ecore_Evas *ee) | ||
59 | { | ||
60 | int w, h; | ||
61 | |||
62 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
63 | evas_object_resize(d.bg, w, h); | ||
64 | } | ||
65 | |||
66 | /* called when our rectangle gets focus */ | ||
67 | static void | ||
68 | _object_focus_in_cb(void *data __UNUSED__, | ||
69 | Evas *e, | ||
70 | void *event_info) | ||
71 | { | ||
72 | fprintf(stdout, "An object got focused: %s\n", | ||
73 | evas_object_name_get(event_info)); | ||
74 | |||
75 | fprintf(stdout, "Let's recheck it: %s\n", | ||
76 | evas_object_name_get(evas_focus_get(e))); | ||
77 | |||
78 | fprintf(stdout, "And again: %s\n", evas_object_focus_get(event_info) ? | ||
79 | "OK!" : "Oops, something is bad."); | ||
80 | } | ||
81 | |||
82 | /* render flush callback */ | ||
83 | static void | ||
84 | _render_flush_cb(void *data __UNUSED__, | ||
85 | Evas *e __UNUSED__, | ||
86 | void *event_info __UNUSED__) | ||
87 | { | ||
88 | fprintf(stdout, "Canvas is about to flush its rendering pipeline!\n"); | ||
89 | } | ||
90 | |||
91 | /* put some action in the canvas */ | ||
92 | static Eina_Bool | ||
93 | _resize_cb(void *data __UNUSED__) | ||
94 | { | ||
95 | int w, h, cw, ch; | ||
96 | |||
97 | evas_object_geometry_get(d.img, NULL, NULL, &w, &h); | ||
98 | ecore_evas_geometry_get(d.ee, NULL, NULL, &cw, &ch); | ||
99 | |||
100 | if (w < cw) | ||
101 | evas_object_resize(d.img, cw, ch); | ||
102 | else | ||
103 | evas_object_resize(d.img, cw / 2, ch / 2); | ||
104 | |||
105 | return EINA_TRUE; /* re-issue the timer */ | ||
106 | } | ||
107 | |||
108 | /* let's have our events back */ | ||
109 | static Eina_Bool | ||
110 | _thaw_cb(void *data __UNUSED__) | ||
111 | { | ||
112 | fprintf(stdout, "Canvas was frozen %d times, now thawing.\n", | ||
113 | evas_event_freeze_get(d.canvas)); | ||
114 | evas_event_thaw(d.canvas); | ||
115 | return EINA_FALSE; /* do not re-issue the timer */ | ||
116 | } | ||
117 | |||
118 | /* mouse enters the object's area */ | ||
119 | static void | ||
120 | _on_mouse_in(void *data __UNUSED__, | ||
121 | Evas *evas __UNUSED__, | ||
122 | Evas_Object *o __UNUSED__, | ||
123 | void *einfo __UNUSED__) | ||
124 | { | ||
125 | fprintf(stdout, "Enlightenment logo has had the mouse in.\n"); | ||
126 | } | ||
127 | |||
128 | static void | ||
129 | _on_mouse_out(void *data __UNUSED__, | ||
130 | Evas *evas __UNUSED__, | ||
131 | Evas_Object *o __UNUSED__, | ||
132 | void *einfo __UNUSED__) | ||
133 | { | ||
134 | fprintf(stdout, "Enlightenment logo has had the mouse out.\n"); | ||
135 | } /* mouse exits the object's area */ | ||
136 | |||
137 | /* examine the keys pressed */ | ||
138 | static void | ||
139 | _on_keydown(void *data __UNUSED__, | ||
140 | Evas *evas, | ||
141 | Evas_Object *o __UNUSED__, | ||
142 | void *einfo) | ||
143 | { | ||
144 | const Evas_Modifier *mods; | ||
145 | Evas_Event_Key_Down *ev = einfo; | ||
146 | |||
147 | fprintf(stdout, "We've got key input: %s\n", ev->keyname); | ||
148 | fprintf(stdout, "It actually came from %s\n", d.focus ? | ||
149 | "focus" : "key grab"); | ||
150 | |||
151 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
152 | { | ||
153 | fprintf(stdout, commands); | ||
154 | return; | ||
155 | } | ||
156 | |||
157 | if (strcmp(ev->keyname, "a") == 0) /* toggle animation timer */ | ||
158 | { | ||
159 | if (d.resize_timer != NULL) | ||
160 | { | ||
161 | fprintf(stdout, "Stopping animation timer\n"); | ||
162 | ecore_timer_del(d.resize_timer); | ||
163 | d.resize_timer = NULL; | ||
164 | } | ||
165 | else | ||
166 | { | ||
167 | fprintf(stdout, "Re-issuing animation timer\n"); | ||
168 | d.resize_timer = ecore_timer_add(2, _resize_cb, NULL); | ||
169 | } | ||
170 | return; | ||
171 | } | ||
172 | |||
173 | if (strcmp(ev->keyname, "c") == 0) /* cycle between focus and key | ||
174 | * grabs for key input */ | ||
175 | { | ||
176 | Eina_Bool ret; | ||
177 | Evas_Modifier_Mask mask = | ||
178 | evas_key_modifier_mask_get(d.canvas, "Control"); | ||
179 | |||
180 | fprintf(stdout, "Switching to %s for key input\n", d.focus ? | ||
181 | "key grabs" : "focus"); | ||
182 | |||
183 | if (d.focus) | ||
184 | { | ||
185 | evas_object_focus_set(d.bg, EINA_FALSE); | ||
186 | fprintf(stdout, "Focused object is now %s\n", | ||
187 | evas_focus_get(d.canvas) ? | ||
188 | "still valid! Something went wrong." : "none."); | ||
189 | |||
190 | ret = evas_object_key_grab(d.bg, "a", 0, 0, EINA_TRUE); | ||
191 | if (!ret) | ||
192 | { | ||
193 | fprintf(stdout, "Something went wrong with key grabs.\n"); | ||
194 | goto c_end; | ||
195 | } | ||
196 | ret = evas_object_key_grab(d.bg, "c", 0, 0, EINA_TRUE); | ||
197 | if (!ret) | ||
198 | { | ||
199 | fprintf(stdout, "Something went wrong with key grabs.\n"); | ||
200 | goto c_end; | ||
201 | } | ||
202 | ret = evas_object_key_grab(d.bg, "d", 0, 0, EINA_TRUE); | ||
203 | if (!ret) | ||
204 | { | ||
205 | fprintf(stdout, "Something went wrong with key grabs.\n"); | ||
206 | goto c_end; | ||
207 | } | ||
208 | ret = evas_object_key_grab(d.bg, "f", 0, 0, EINA_TRUE); | ||
209 | if (!ret) | ||
210 | { | ||
211 | fprintf(stdout, "Something went wrong with key grabs.\n"); | ||
212 | goto c_end; | ||
213 | } | ||
214 | ret = evas_object_key_grab(d.bg, "p", 0, 0, EINA_TRUE); | ||
215 | if (!ret) | ||
216 | { | ||
217 | fprintf(stdout, "Something went wrong with key grabs.\n"); | ||
218 | goto c_end; | ||
219 | } | ||
220 | ret = evas_object_key_grab(d.bg, "o", mask, 0, EINA_TRUE); | ||
221 | if (!ret) | ||
222 | { | ||
223 | fprintf(stdout, "Something went wrong with key grabs.\n"); | ||
224 | goto c_end; | ||
225 | } | ||
226 | ret = evas_object_key_grab(d.bg, "h", 0, 0, EINA_TRUE); | ||
227 | if (!ret) | ||
228 | { | ||
229 | fprintf(stdout, "Something went wrong with key grabs.\n"); | ||
230 | goto c_end; | ||
231 | } | ||
232 | } | ||
233 | else /* got here by key grabs */ | ||
234 | { | ||
235 | evas_object_key_ungrab(d.bg, "a", 0, 0); | ||
236 | evas_object_key_ungrab(d.bg, "c", 0, 0); | ||
237 | evas_object_key_ungrab(d.bg, "d", 0, 0); | ||
238 | evas_object_key_ungrab(d.bg, "f", 0, 0); | ||
239 | evas_object_key_ungrab(d.bg, "p", 0, 0); | ||
240 | evas_object_key_ungrab(d.bg, "o", mask, 0); | ||
241 | evas_object_key_ungrab(d.bg, "h", 0, 0); | ||
242 | |||
243 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
244 | } | ||
245 | |||
246 | c_end: | ||
247 | d.focus = !d.focus; | ||
248 | |||
249 | return; | ||
250 | } | ||
251 | |||
252 | if (strcmp(ev->keyname, "d") == 0) /* delete canvas' callbacks */ | ||
253 | { | ||
254 | fprintf(stdout, "Deleting canvas event callbacks\n"); | ||
255 | evas_event_callback_del_full(evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, | ||
256 | _render_flush_cb, NULL); | ||
257 | evas_event_callback_del_full( | ||
258 | evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
259 | _object_focus_in_cb, NULL); | ||
260 | return; | ||
261 | } | ||
262 | |||
263 | if (strcmp(ev->keyname, "f") == 0) /* freeze input for 3 seconds */ | ||
264 | { | ||
265 | fprintf(stdout, "Freezing input for 3 seconds\n"); | ||
266 | evas_event_freeze(evas); | ||
267 | d.freeze_timer = ecore_timer_add(3, _thaw_cb, NULL); | ||
268 | return; | ||
269 | } | ||
270 | |||
271 | if (strcmp(ev->keyname, "p") == 0) /* toggle precise point | ||
272 | * collision detection */ | ||
273 | { | ||
274 | Eina_Bool precise = evas_object_precise_is_inside_get(d.img); | ||
275 | |||
276 | fprintf(stdout, "Toggling precise point collision detection %s on" | ||
277 | " Enlightenment logo\n", precise ? "off" : "on"); | ||
278 | evas_object_precise_is_inside_set(d.img, !precise); | ||
279 | |||
280 | return; | ||
281 | } | ||
282 | |||
283 | mods = evas_key_modifier_get(evas); | ||
284 | if (evas_key_modifier_is_set(mods, "Control") && | ||
285 | (strcmp(ev->keyname, "o") == 0)) /* add an obscured | ||
286 | * rectangle to the middle | ||
287 | * of the canvas */ | ||
288 | { | ||
289 | fprintf(stdout, "Toggling obscured rectangle on canvas\n"); | ||
290 | if (!d.obscured) | ||
291 | { | ||
292 | int w, h; | ||
293 | evas_output_viewport_get(evas, NULL, NULL, &w, &h); | ||
294 | evas_obscured_rectangle_add(evas, w / 4, h / 4, w / 2, h / 2); | ||
295 | } | ||
296 | else | ||
297 | { | ||
298 | int w, h; | ||
299 | Eina_Rectangle *rect; | ||
300 | Eina_List *updates, *l; | ||
301 | |||
302 | evas_output_viewport_get(evas, NULL, NULL, &w, &h); | ||
303 | evas_obscured_clear(evas); | ||
304 | |||
305 | /* we have to flag a damage region here because | ||
306 | * evas_obscured_clear() doesn't change the canvas' | ||
307 | * state. we'd have to wait for an animation step, for | ||
308 | * example, to get the result, without it */ | ||
309 | evas_damage_rectangle_add(evas, 0, 0, w, h); | ||
310 | |||
311 | updates = evas_render_updates(evas); | ||
312 | |||
313 | EINA_LIST_FOREACH(updates, l, rect) | ||
314 | { | ||
315 | fprintf(stdout, "Rectangle (%d, %d, %d, %d) on canvas got a" | ||
316 | " rendering update.\n", rect->x, rect->y, | ||
317 | rect->w, | ||
318 | rect->h); | ||
319 | } | ||
320 | evas_render_updates_free(updates); | ||
321 | } | ||
322 | d.obscured = !d.obscured; | ||
323 | } /* end of obscured region command */ | ||
324 | } | ||
325 | |||
326 | int | ||
327 | main(void) | ||
328 | { | ||
329 | int err; | ||
330 | |||
331 | if (!ecore_evas_init()) | ||
332 | return EXIT_FAILURE; | ||
333 | |||
334 | /* this will give you a window with an Evas canvas under the first | ||
335 | * engine available */ | ||
336 | d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); | ||
337 | if (!d.ee) | ||
338 | goto error; | ||
339 | |||
340 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
341 | ecore_evas_show(d.ee); | ||
342 | |||
343 | /* the canvas pointer, de facto */ | ||
344 | d.canvas = ecore_evas_get(d.ee); | ||
345 | |||
346 | evas_event_callback_add(d.canvas, EVAS_CALLBACK_RENDER_FLUSH_PRE, | ||
347 | _render_flush_cb, NULL); | ||
348 | if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE) | ||
349 | { | ||
350 | fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n"); | ||
351 | goto panic; | ||
352 | } | ||
353 | |||
354 | evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, | ||
355 | _object_focus_in_cb, NULL); | ||
356 | if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE) | ||
357 | { | ||
358 | fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n"); | ||
359 | goto panic; | ||
360 | } /* two canvas event callbacks */ | ||
361 | |||
362 | d.bg = evas_object_rectangle_add(d.canvas); | ||
363 | evas_object_name_set(d.bg, "our dear rectangle"); | ||
364 | evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */ | ||
365 | evas_object_move(d.bg, 0, 0); /* at canvas' origin */ | ||
366 | evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
367 | evas_object_show(d.bg); | ||
368 | |||
369 | evas_object_focus_set(d.bg, EINA_TRUE); /* so we get input events */ | ||
370 | d.focus = EINA_TRUE; | ||
371 | |||
372 | evas_object_event_callback_add( | ||
373 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
374 | if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE) | ||
375 | { | ||
376 | fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n"); | ||
377 | goto panic; | ||
378 | } | ||
379 | |||
380 | d.img = evas_object_image_filled_add(d.canvas); | ||
381 | evas_object_image_file_set(d.img, img_path, NULL); | ||
382 | err = evas_object_image_load_error_get(d.img); | ||
383 | if (err != EVAS_LOAD_ERROR_NONE) | ||
384 | { | ||
385 | goto panic; | ||
386 | } | ||
387 | else | ||
388 | { | ||
389 | evas_object_move(d.img, 0, 0); | ||
390 | evas_object_resize(d.img, WIDTH, HEIGHT); | ||
391 | evas_object_show(d.img); | ||
392 | evas_object_event_callback_add( | ||
393 | d.img, EVAS_CALLBACK_MOUSE_IN, _on_mouse_in, NULL); | ||
394 | evas_object_event_callback_add( | ||
395 | d.img, EVAS_CALLBACK_MOUSE_OUT, _on_mouse_out, NULL); | ||
396 | } | ||
397 | |||
398 | d.resize_timer = ecore_timer_add(2, _resize_cb, NULL); | ||
399 | |||
400 | fprintf(stdout, commands); | ||
401 | ecore_main_loop_begin(); | ||
402 | |||
403 | ecore_evas_free(d.ee); | ||
404 | ecore_evas_shutdown(); | ||
405 | return 0; | ||
406 | |||
407 | error: | ||
408 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
409 | " up to ecore-evas for this example to run properly.\n"); | ||
410 | panic: | ||
411 | ecore_evas_shutdown(); | ||
412 | return -1; | ||
413 | } | ||
diff --git a/libraries/evas/src/examples/evas-hints.c b/libraries/evas/src/examples/evas-hints.c deleted file mode 100644 index 78c09ba..0000000 --- a/libraries/evas/src/examples/evas-hints.c +++ /dev/null | |||
@@ -1,378 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating <b>alignment, minimum size, maximum | ||
3 | * size, padding and weight</b> hints on objects. | ||
4 | * | ||
5 | * To exemplify those hints, whe use the Evas box object, one of the | ||
6 | * managers using size hints to layout its children. | ||
7 | * | ||
8 | * You'll need at least one engine built for it (excluding the buffer | ||
9 | * one) and the png image loader also built. See stdout/stderr for | ||
10 | * output. | ||
11 | * | ||
12 | * @verbatim | ||
13 | * gcc -o evas-events evas-events.c `pkg-config --libs --cflags ecore-evas` | ||
14 | * @endverbatim | ||
15 | */ | ||
16 | |||
17 | #ifdef HAVE_CONFIG_H | ||
18 | #include "config.h" | ||
19 | #else | ||
20 | #define __UNUSED__ | ||
21 | #endif | ||
22 | |||
23 | #include <Ecore.h> | ||
24 | #include <Ecore_Evas.h> | ||
25 | |||
26 | #include <stdlib.h> | ||
27 | #include <stdio.h> | ||
28 | #include <string.h> | ||
29 | |||
30 | #define WIDTH 320 | ||
31 | #define HEIGHT 480 | ||
32 | #define PACKAGE_EXAMPLES_DIR "." | ||
33 | |||
34 | static const char commands[] = \ | ||
35 | "commands are:\n" | ||
36 | "\tShift + a - change alignment hints on top rectangle\n" | ||
37 | "\tShift + m - change min. size hint on top rectangle\n" | ||
38 | "\tShift + n - change max. size hint on top rectangle\n" | ||
39 | "\tShift + p - change padding hints on top rectangle\n" | ||
40 | "\tShift + w - change weight hints on top rectangle\n\n" | ||
41 | "\tControl + a - change alignment hints on bottom rectangle\n" | ||
42 | "\tControl + m - change min. size hint on bottom rectangle\n" | ||
43 | "\tControl + n - change max. size hint on bottom rectangle\n" | ||
44 | "\tControl + p - change padding hints on bottom rectangle\n" | ||
45 | "\tControl + w - change weight hints on bottom rectangle\n\n" | ||
46 | "\ts - print current hints information\n" | ||
47 | "\th - print help\n"; | ||
48 | |||
49 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
50 | |||
51 | struct coord_tuple | ||
52 | { | ||
53 | Evas_Coord w, h; | ||
54 | }; | ||
55 | |||
56 | struct weight_tuple | ||
57 | { | ||
58 | double x, y; | ||
59 | }; | ||
60 | |||
61 | struct padding_tuple | ||
62 | { | ||
63 | Evas_Coord l, r, t, b; | ||
64 | }; | ||
65 | |||
66 | struct rect_data | ||
67 | { | ||
68 | struct coord_tuple *min_ptr; | ||
69 | struct coord_tuple min[4]; | ||
70 | |||
71 | struct coord_tuple *max_ptr; | ||
72 | struct coord_tuple max[4]; | ||
73 | |||
74 | struct weight_tuple *align_ptr; | ||
75 | struct weight_tuple align[3]; | ||
76 | |||
77 | struct weight_tuple *weight_ptr; | ||
78 | struct weight_tuple weight[3]; | ||
79 | |||
80 | struct padding_tuple *padding_ptr; | ||
81 | struct padding_tuple padding[3]; | ||
82 | }; | ||
83 | |||
84 | struct test_data | ||
85 | { | ||
86 | Ecore_Evas *ee; | ||
87 | Evas *canvas; | ||
88 | struct rect_data t_data, b_data; | ||
89 | Evas_Object *bg, *box, *t_rect, *b_rect, *border; | ||
90 | }; | ||
91 | |||
92 | static struct test_data d = {0}; | ||
93 | |||
94 | /* here just to keep our example's window size and background image's | ||
95 | * size in synchrony */ | ||
96 | static void | ||
97 | _canvas_resize_cb(Ecore_Evas *ee) | ||
98 | { | ||
99 | int w, h; | ||
100 | |||
101 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
102 | evas_object_resize(d.bg, w, h); | ||
103 | |||
104 | evas_object_move(d.box, (w / 4), (h / 4)); | ||
105 | evas_object_resize(d.box, (w / 2), (h / 2)); | ||
106 | |||
107 | evas_object_move(d.border, (w / 4) - 3, (h / 4) - 3); | ||
108 | evas_object_resize(d.border, (w / 2) + 6, (h / 2) + 6); | ||
109 | } | ||
110 | |||
111 | static void | ||
112 | _print_rect_stats(Evas_Object *rect) | ||
113 | { | ||
114 | Evas_Coord w, h, l, r, t, b; | ||
115 | double x, y; | ||
116 | |||
117 | evas_object_size_hint_align_get(rect, &x, &y); | ||
118 | fprintf(stdout, "\talign hints: h(%f), v(%f)\n", x, y); | ||
119 | |||
120 | evas_object_size_hint_min_get(rect, &w, &h); | ||
121 | fprintf(stdout, "\tmin. size hints: h(%d), v(%d)\n", w, h); | ||
122 | |||
123 | evas_object_size_hint_max_get(rect, &w, &h); | ||
124 | fprintf(stdout, "\tmax. size hints: h(%d), v(%d)\n", w, h); | ||
125 | |||
126 | evas_object_size_hint_padding_get(rect, &l, &r, &t, &b); | ||
127 | fprintf(stdout, "\tpadding hints: l(%d), r(%d), t(%d), b(%d)\n", | ||
128 | l, r, t, b); | ||
129 | |||
130 | evas_object_size_hint_weight_get(rect, &x, &y); | ||
131 | fprintf(stdout, "\tweight hints: h(%f), v(%f)\n", x, y); | ||
132 | } | ||
133 | |||
134 | /* use the following commands to interact with this example - 'h' is | ||
135 | * the key for help */ | ||
136 | static void | ||
137 | _on_keydown(void *data __UNUSED__, | ||
138 | Evas *evas __UNUSED__, | ||
139 | Evas_Object *o __UNUSED__, | ||
140 | void *einfo) | ||
141 | { | ||
142 | Evas_Event_Key_Down *ev = einfo; | ||
143 | struct rect_data *r_data = NULL; | ||
144 | const Evas_Modifier *mods; | ||
145 | Evas_Object *rect = NULL; | ||
146 | const char *name = NULL; | ||
147 | |||
148 | mods = evas_key_modifier_get(evas); | ||
149 | if (evas_key_modifier_is_set(mods, "Shift")) | ||
150 | { | ||
151 | rect = d.t_rect; | ||
152 | r_data = &d.t_data; | ||
153 | name = "top"; | ||
154 | } | ||
155 | else if (evas_key_modifier_is_set(mods, "Control")) | ||
156 | { | ||
157 | rect = d.b_rect; | ||
158 | r_data = &d.b_data; | ||
159 | name = "bottom"; | ||
160 | } | ||
161 | else if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
162 | { | ||
163 | fprintf(stdout, commands); | ||
164 | return; | ||
165 | } | ||
166 | else if (strcmp(ev->keyname, "s") == 0) /* get aspect status of the | ||
167 | * rectangles WRT size | ||
168 | * hints */ | ||
169 | { | ||
170 | fprintf(stdout, "Top rectangle:\n"); | ||
171 | _print_rect_stats(d.t_rect); | ||
172 | |||
173 | fprintf(stdout, "\nBottom rectangle:\n"); | ||
174 | _print_rect_stats(d.b_rect); | ||
175 | |||
176 | return; | ||
177 | } | ||
178 | |||
179 | if (!rect) return; | ||
180 | |||
181 | if (strcmp(ev->keyname, "a") == 0) /* alignment hints */ | ||
182 | { | ||
183 | (r_data->align_ptr)++; | ||
184 | |||
185 | if ((unsigned) | ||
186 | (((void *)(r_data->align_ptr)) - ((void *)(r_data->align))) >= | ||
187 | sizeof(r_data->align)) | ||
188 | r_data->align_ptr = r_data->align; | ||
189 | |||
190 | evas_object_size_hint_align_set( | ||
191 | rect, r_data->align_ptr->x, r_data->align_ptr->y); | ||
192 | |||
193 | fprintf(stdout, "Changing align hints for %s rect. to (%f, %f)\n", | ||
194 | name, r_data->align_ptr->x, r_data->align_ptr->y); | ||
195 | return; | ||
196 | } | ||
197 | |||
198 | if (strcmp(ev->keyname, "m") == 0) /* min. size hints */ | ||
199 | { | ||
200 | (r_data->min_ptr)++; | ||
201 | |||
202 | if ((unsigned) | ||
203 | (((void *)(r_data->min_ptr)) - ((void *)(r_data->min))) >= | ||
204 | sizeof(r_data->min)) | ||
205 | r_data->min_ptr = r_data->min; | ||
206 | |||
207 | evas_object_size_hint_min_set( | ||
208 | rect, r_data->min_ptr->w, r_data->min_ptr->h); | ||
209 | |||
210 | fprintf(stdout, "Changing min. size hints for %s rect. to (%d, %d)\n", | ||
211 | name, r_data->min_ptr->w, r_data->min_ptr->h); | ||
212 | return; | ||
213 | } | ||
214 | |||
215 | if (strcmp(ev->keyname, "n") == 0) /* max. size hints */ | ||
216 | { | ||
217 | (r_data->max_ptr)++; | ||
218 | |||
219 | if ((unsigned) | ||
220 | (((void *)(r_data->max_ptr)) - ((void *)(r_data->max))) >= | ||
221 | sizeof(r_data->max)) | ||
222 | r_data->max_ptr = r_data->max; | ||
223 | |||
224 | evas_object_size_hint_max_set( | ||
225 | rect, r_data->max_ptr->w, r_data->max_ptr->h); | ||
226 | |||
227 | fprintf(stdout, "Changing max. size hints for %s rect. to (%d, %d)\n", | ||
228 | name, r_data->max_ptr->w, r_data->max_ptr->h); | ||
229 | return; | ||
230 | } | ||
231 | |||
232 | if (strcmp(ev->keyname, "p") == 0) /* padding size hints */ | ||
233 | { | ||
234 | (r_data->padding_ptr)++; | ||
235 | |||
236 | if ((unsigned) | ||
237 | (((void *)(r_data->padding_ptr)) - ((void *)(r_data->padding))) >= | ||
238 | sizeof(r_data->padding)) | ||
239 | r_data->padding_ptr = r_data->padding; | ||
240 | |||
241 | evas_object_size_hint_padding_set( | ||
242 | rect, r_data->padding_ptr->l, r_data->padding_ptr->r, | ||
243 | r_data->padding_ptr->t, r_data->padding_ptr->b); | ||
244 | |||
245 | fprintf(stdout, "Changing padding size hints for %s rect." | ||
246 | " to (%d, %d, %d, %d)\n", | ||
247 | name, r_data->padding_ptr->l, r_data->padding_ptr->r, | ||
248 | r_data->padding_ptr->t, r_data->padding_ptr->b); | ||
249 | return; | ||
250 | } | ||
251 | |||
252 | /* experiment with weights here. keep in mind that, for the box | ||
253 | * object, only if all the children have non zero weights this hint | ||
254 | * will have an effect */ | ||
255 | if (strcmp(ev->keyname, "w") == 0) /* weight hints */ | ||
256 | { | ||
257 | (r_data->weight_ptr)++; | ||
258 | |||
259 | if ((unsigned) | ||
260 | (((void *)(r_data->weight_ptr)) - ((void *)(r_data->weight))) >= | ||
261 | sizeof(r_data->weight)) | ||
262 | r_data->weight_ptr = r_data->weight; | ||
263 | |||
264 | evas_object_size_hint_weight_set( | ||
265 | rect, r_data->weight_ptr->x, r_data->weight_ptr->y); | ||
266 | |||
267 | fprintf(stdout, "Changing weight hints for %s rect. to (%f, %f)\n", | ||
268 | name, r_data->weight_ptr->x, r_data->weight_ptr->y); | ||
269 | return; | ||
270 | } | ||
271 | } | ||
272 | |||
273 | static void | ||
274 | _on_destroy(Ecore_Evas *ee __UNUSED__) | ||
275 | { | ||
276 | ecore_main_loop_quit(); | ||
277 | } | ||
278 | |||
279 | int | ||
280 | main(void) | ||
281 | { | ||
282 | if (!ecore_evas_init()) | ||
283 | return EXIT_FAILURE; | ||
284 | |||
285 | /* init values one is going to cycle through while running this | ||
286 | * example */ | ||
287 | struct rect_data init_data = \ | ||
288 | { | ||
289 | .min = {{0, 0}, {30, 30}, {100, 70}, {200, 200}}, | ||
290 | .max = {{0, 0}, {100, 100}, {100, 70}, {300, 300}}, | ||
291 | .align = {{0.0, 0.0}, {0.5, 0.5}, {1.0, 0.5}}, | ||
292 | .weight = {{0.0, 0.0}, {3, 6}, {10, 100}}, | ||
293 | .padding = {{0, 0, 0, 0}, {3, 6, 9, 12}, {10, 20, 0, 30}} | ||
294 | }; | ||
295 | |||
296 | d.t_data = init_data; | ||
297 | |||
298 | d.t_data.min_ptr = d.t_data.min + 1; | ||
299 | d.t_data.max_ptr = d.t_data.max + 1; | ||
300 | d.t_data.align_ptr = d.t_data.align; | ||
301 | d.t_data.weight_ptr = d.t_data.weight; | ||
302 | d.t_data.padding_ptr = d.t_data.padding; | ||
303 | |||
304 | d.b_data = init_data; | ||
305 | |||
306 | d.b_data.min_ptr = d.b_data.min + 1; | ||
307 | d.b_data.max_ptr = d.b_data.max + 1; | ||
308 | d.b_data.align_ptr = d.b_data.align; | ||
309 | d.b_data.weight_ptr = d.b_data.weight; | ||
310 | d.b_data.padding_ptr = d.b_data.padding; | ||
311 | |||
312 | /* this will give you a window with an Evas canvas under the first | ||
313 | * engine available */ | ||
314 | d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
315 | if (!d.ee) | ||
316 | goto error; | ||
317 | |||
318 | ecore_evas_callback_destroy_set(d.ee, _on_destroy); | ||
319 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
320 | ecore_evas_show(d.ee); | ||
321 | |||
322 | /* the canvas pointer, de facto */ | ||
323 | d.canvas = ecore_evas_get(d.ee); | ||
324 | |||
325 | d.bg = evas_object_rectangle_add(d.canvas); | ||
326 | evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */ | ||
327 | evas_object_move(d.bg, 0, 0); /* at canvas' origin */ | ||
328 | evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
329 | evas_object_show(d.bg); | ||
330 | |||
331 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
332 | evas_object_event_callback_add( | ||
333 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
334 | |||
335 | /* Evas box with vertical layout */ | ||
336 | d.box = evas_object_box_add(d.canvas); | ||
337 | evas_object_box_layout_set( | ||
338 | d.box, evas_object_box_layout_vertical, NULL, NULL); | ||
339 | evas_object_show(d.box); | ||
340 | |||
341 | /* this is a border around the box, container of the rectangles we | ||
342 | * are going to experiment with (changing some size hints). this | ||
343 | * way you can see how the container relates to the children */ | ||
344 | d.border = evas_object_image_filled_add(d.canvas); | ||
345 | evas_object_image_file_set(d.border, border_img_path, NULL); | ||
346 | evas_object_image_border_set(d.border, 3, 3, 3, 3); | ||
347 | evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE); | ||
348 | evas_object_show(d.border); | ||
349 | |||
350 | d.t_rect = evas_object_rectangle_add(d.canvas); | ||
351 | evas_object_color_set(d.t_rect, 0, 0, 255, 255); | ||
352 | |||
353 | evas_object_size_hint_min_set( | ||
354 | d.t_rect, d.t_data.min_ptr->w, d.t_data.min_ptr->h); | ||
355 | evas_object_show(d.t_rect); | ||
356 | evas_object_box_append(d.box, d.t_rect); | ||
357 | |||
358 | d.b_rect = evas_object_rectangle_add(d.canvas); | ||
359 | evas_object_color_set(d.b_rect, 0, 255, 0, 255); | ||
360 | |||
361 | evas_object_size_hint_min_set( | ||
362 | d.b_rect, d.b_data.min_ptr->w, d.b_data.min_ptr->h); | ||
363 | evas_object_show(d.b_rect); | ||
364 | evas_object_box_append(d.box, d.b_rect); | ||
365 | |||
366 | _canvas_resize_cb(d.ee); | ||
367 | |||
368 | fprintf(stdout, commands); | ||
369 | ecore_main_loop_begin(); | ||
370 | ecore_evas_shutdown(); | ||
371 | return 0; | ||
372 | |||
373 | error: | ||
374 | fprintf(stderr, "You got to have at least one evas engine built and linked" | ||
375 | " up to ecore-evas for this example to run properly.\n"); | ||
376 | return -1; | ||
377 | } | ||
378 | |||
diff --git a/libraries/evas/src/examples/evas-images.c b/libraries/evas/src/examples/evas-images.c deleted file mode 100644 index a8cf3c4..0000000 --- a/libraries/evas/src/examples/evas-images.c +++ /dev/null | |||
@@ -1,353 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating some image objects functions | ||
3 | * | ||
4 | * You'll need at least one engine built for it (excluding the buffer | ||
5 | * one) and the png image loader also built. See stdout/stderr for | ||
6 | * output. | ||
7 | * | ||
8 | * @verbatim | ||
9 | * gcc -o evas-images evas-images.c `pkg-config --libs --cflags evas ecore ecore-evas` | ||
10 | * @endverbatim | ||
11 | */ | ||
12 | |||
13 | #ifdef HAVE_CONFIG_H | ||
14 | |||
15 | #include "config.h" | ||
16 | #else | ||
17 | |||
18 | #define PACKAGE_EXAMPLES_DIR "." | ||
19 | #define __UNUSED__ | ||
20 | |||
21 | #endif | ||
22 | |||
23 | #include <Ecore.h> | ||
24 | #include <Ecore_Evas.h> | ||
25 | #include <stdio.h> | ||
26 | #include <errno.h> | ||
27 | |||
28 | #define WIDTH (320) | ||
29 | #define HEIGHT (240) | ||
30 | |||
31 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
32 | static const char *valid_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png"; | ||
33 | static const char *bogus_path = "/tmp/non-existent-220986.png"; | ||
34 | static const char *commands = \ | ||
35 | "commands are:\n" | ||
36 | "\tx - change image's x fill coordinate\n" | ||
37 | "\ty - change image's y fill coordinate\n" | ||
38 | "\tw - change image's w fill size\n" | ||
39 | "\te - change image's h fill size\n" | ||
40 | "\tf - toggle image filled property (overrides fill)\n" | ||
41 | "\ta - toggle image's alpha channel usage\n" | ||
42 | "\tm - toggle border's smooth scaling\n" | ||
43 | "\tt - change border's thickness\n" | ||
44 | "\tb - change border's center region aspect\n" | ||
45 | "\tc - change border's scaling factor\n" | ||
46 | "\ts - print image's fill property status\n" | ||
47 | "\th - print help\n"; | ||
48 | |||
49 | struct test_data | ||
50 | { | ||
51 | Ecore_Evas *ee; | ||
52 | Evas *evas; | ||
53 | Evas_Object *img1, *img2, *bg, *border; | ||
54 | }; | ||
55 | |||
56 | static struct test_data d = {0}; | ||
57 | |||
58 | static void | ||
59 | _on_destroy(Ecore_Evas *ee __UNUSED__) | ||
60 | { | ||
61 | ecore_main_loop_quit(); | ||
62 | } | ||
63 | |||
64 | /* here just to keep our example's window size and background image's | ||
65 | * size in synchrony */ | ||
66 | static void | ||
67 | _canvas_resize_cb(Ecore_Evas *ee) | ||
68 | { | ||
69 | int w, h; | ||
70 | |||
71 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
72 | evas_object_resize(d.bg, w, h); | ||
73 | } | ||
74 | |||
75 | static const char * | ||
76 | _border_fill_mode_to_str(Evas_Border_Fill_Mode mode) | ||
77 | { | ||
78 | switch (mode) | ||
79 | { | ||
80 | case EVAS_BORDER_FILL_NONE: | ||
81 | return "none"; | ||
82 | |||
83 | case EVAS_BORDER_FILL_DEFAULT: | ||
84 | return "default"; | ||
85 | |||
86 | case EVAS_BORDER_FILL_SOLID: | ||
87 | return "solid"; | ||
88 | |||
89 | default: | ||
90 | return "invalid"; | ||
91 | } | ||
92 | } | ||
93 | |||
94 | static void | ||
95 | _on_keydown(void *data __UNUSED__, | ||
96 | Evas *evas __UNUSED__, | ||
97 | Evas_Object *o __UNUSED__, | ||
98 | void *einfo) | ||
99 | { | ||
100 | Evas_Event_Key_Down *ev = einfo; | ||
101 | |||
102 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
103 | { | ||
104 | fprintf(stdout, commands); | ||
105 | return; | ||
106 | } | ||
107 | |||
108 | if (strcmp(ev->keyname, "m") == 0) /* toggle border image's smooth scaling */ | ||
109 | { | ||
110 | Eina_Bool smooth_scale = evas_object_image_smooth_scale_get(d.border); | ||
111 | |||
112 | evas_object_image_smooth_scale_set(d.border, !smooth_scale); | ||
113 | |||
114 | fprintf(stdout, "Image's border is now %s smooth scaling\n", | ||
115 | smooth_scale ? "without" : "with"); | ||
116 | |||
117 | return; | ||
118 | } | ||
119 | |||
120 | if (strcmp(ev->keyname, "t") == 0) /* change border's thickness */ | ||
121 | { | ||
122 | int l, r, t, b; | ||
123 | |||
124 | evas_object_image_border_get(d.border, &l, &r, &t, &b); | ||
125 | |||
126 | l = (l + 3) % 9; | ||
127 | r = (r + 3) % 9; | ||
128 | t = (t + 3) % 9; | ||
129 | b = (b + 3) % 9; | ||
130 | |||
131 | evas_object_image_border_set(d.border, l, r, t, b); | ||
132 | |||
133 | fprintf(stdout, "Image's border thickness is now %d\n", l); | ||
134 | |||
135 | return; | ||
136 | } | ||
137 | |||
138 | if (strcmp(ev->keyname, "c") == 0) /* change border's scaling factor */ | ||
139 | { | ||
140 | double scale = evas_object_image_border_scale_get(d.border); | ||
141 | |||
142 | scale *= 2; | ||
143 | if (scale > 4.0) scale = 1.0; | ||
144 | |||
145 | evas_object_image_border_scale_set(d.border, scale); | ||
146 | |||
147 | fprintf(stdout, "Image's border scaling factor is now %f\n", scale); | ||
148 | |||
149 | return; | ||
150 | } | ||
151 | |||
152 | if (strcmp(ev->keyname, "b") == 0) /* change border's center | ||
153 | * region's aspect */ | ||
154 | { | ||
155 | Eina_Bool fill = \ | ||
156 | evas_object_image_border_center_fill_get(d.border); | ||
157 | |||
158 | fill = (fill + 1) % 3; | ||
159 | |||
160 | evas_object_image_border_center_fill_set(d.border, fill); | ||
161 | |||
162 | fprintf(stdout, "Image's border center region aspect is now \"%s\"\n", | ||
163 | _border_fill_mode_to_str(fill)); | ||
164 | |||
165 | return; | ||
166 | } | ||
167 | |||
168 | if (strcmp(ev->keyname, "a") == 0) /* toggle alpha channel usage */ | ||
169 | { | ||
170 | Eina_Bool alpha = evas_object_image_alpha_get(d.img1); | ||
171 | |||
172 | evas_object_image_alpha_set(d.img1, !alpha); | ||
173 | |||
174 | fprintf(stdout, "Image's alpha channel is now %s\n", | ||
175 | alpha ? "off" : "on"); | ||
176 | |||
177 | return; | ||
178 | } | ||
179 | |||
180 | if (strcmp(ev->keyname, "f") == 0) /* toggle filled property */ | ||
181 | { | ||
182 | Eina_Bool filled = evas_object_image_filled_get(d.img1); | ||
183 | |||
184 | evas_object_image_filled_set(d.img1, !filled); | ||
185 | |||
186 | fprintf(stdout, "Image's x filled property is now %s\n", | ||
187 | filled ? "off" : "on"); | ||
188 | |||
189 | return; | ||
190 | } | ||
191 | |||
192 | if (strcmp(ev->keyname, "x") == 0) /* change x fill coordinate */ | ||
193 | { | ||
194 | Evas_Coord x, y, w, h; | ||
195 | |||
196 | evas_object_image_fill_get(d.img1, &x, &y, &w, &h); | ||
197 | x = (x + 20) % (WIDTH / 2); | ||
198 | evas_object_image_fill_set(d.img1, x, y, w, h); | ||
199 | |||
200 | fprintf(stdout, "Image's x fill coordinate changed to %d\n", x); | ||
201 | |||
202 | return; | ||
203 | } | ||
204 | |||
205 | if (strcmp(ev->keyname, "y") == 0) /* change y fill coordinate */ | ||
206 | { | ||
207 | Evas_Coord x, y, w, h; | ||
208 | |||
209 | evas_object_image_fill_get(d.img1, &x, &y, &w, &h); | ||
210 | y = (y + 20) % (HEIGHT / 2); | ||
211 | evas_object_image_fill_set(d.img1, x, y, w, h); | ||
212 | |||
213 | fprintf(stdout, "Image's y fill coordinate changed to %d\n", y); | ||
214 | |||
215 | return; | ||
216 | } | ||
217 | |||
218 | if (strcmp(ev->keyname, "w") == 0) /* change w fill size */ | ||
219 | { | ||
220 | Evas_Coord x, y, w, h; | ||
221 | |||
222 | evas_object_image_fill_get(d.img1, &x, &y, &w, &h); | ||
223 | if (w == (WIDTH / 4)) w = (WIDTH / 2); | ||
224 | else if (w == WIDTH / 2) w = WIDTH; | ||
225 | else w = (WIDTH / 4); | ||
226 | evas_object_image_fill_set(d.img1, x, y, w, h); | ||
227 | |||
228 | fprintf(stdout, "Image's w fill size changed to %d\n", w); | ||
229 | |||
230 | return; | ||
231 | } | ||
232 | |||
233 | if (strcmp(ev->keyname, "e") == 0) /* change h fill size */ | ||
234 | { | ||
235 | Evas_Coord x, y, w, h; | ||
236 | |||
237 | evas_object_image_fill_get(d.img1, &x, &y, &w, &h); | ||
238 | if (h == (HEIGHT / 4)) h = (HEIGHT / 2); | ||
239 | else if (h == HEIGHT / 2) h = HEIGHT; | ||
240 | else h = (HEIGHT / 4); | ||
241 | evas_object_image_fill_set(d.img1, x, y, w, h); | ||
242 | |||
243 | fprintf(stdout, "Image's h fill size changed to %d\n", h); | ||
244 | |||
245 | return; | ||
246 | } | ||
247 | |||
248 | if (strcmp(ev->keyname, "s") == 0) /* status */ | ||
249 | { | ||
250 | Evas_Coord x, y, w, h; | ||
251 | |||
252 | evas_object_image_fill_get(d.img1, &x, &y, &w, &h); | ||
253 | |||
254 | fprintf(stdout, "Image has fill properties set to: %d, %d, %d, %d\n", | ||
255 | x, y, w, h); | ||
256 | |||
257 | return; | ||
258 | } | ||
259 | } | ||
260 | |||
261 | int | ||
262 | main(void) | ||
263 | { | ||
264 | int err; | ||
265 | |||
266 | if (!ecore_evas_init()) | ||
267 | return EXIT_FAILURE; | ||
268 | |||
269 | /* this will give you a window with an Evas canvas under the first | ||
270 | * engine available */ | ||
271 | d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); | ||
272 | if (!d.ee) | ||
273 | goto error; | ||
274 | |||
275 | ecore_evas_callback_destroy_set(d.ee, _on_destroy); | ||
276 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
277 | ecore_evas_show(d.ee); | ||
278 | |||
279 | /* the canvas pointer, de facto */ | ||
280 | d.evas = ecore_evas_get(d.ee); | ||
281 | |||
282 | d.bg = evas_object_rectangle_add(d.evas); | ||
283 | evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */ | ||
284 | evas_object_move(d.bg, 0, 0); /* at canvas' origin */ | ||
285 | evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
286 | evas_object_show(d.bg); | ||
287 | |||
288 | d.img1 = evas_object_image_add(d.evas); | ||
289 | evas_object_image_file_set(d.img1, valid_path, NULL); | ||
290 | err = evas_object_image_load_error_get(d.img1); | ||
291 | if (err != EVAS_LOAD_ERROR_NONE) | ||
292 | { | ||
293 | fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n", | ||
294 | valid_path, evas_load_error_str(err)); | ||
295 | } | ||
296 | else | ||
297 | { | ||
298 | fprintf(stdout, | ||
299 | "loaded image '%s' with succes! error string is \"%s\"\n", | ||
300 | valid_path, evas_load_error_str(err)); | ||
301 | |||
302 | evas_object_move(d.img1, 3, 3); | ||
303 | evas_object_image_fill_set(d.img1, 0, 0, WIDTH / 2, HEIGHT / 2); | ||
304 | evas_object_resize(d.img1, WIDTH / 2, HEIGHT / 2); | ||
305 | evas_object_show(d.img1); | ||
306 | |||
307 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
308 | evas_object_event_callback_add( | ||
309 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
310 | } | ||
311 | |||
312 | /* this is a border around the image above, here just to emphasize | ||
313 | * its geometry */ | ||
314 | d.border = evas_object_image_filled_add(d.evas); | ||
315 | evas_object_image_file_set(d.border, border_img_path, NULL); | ||
316 | evas_object_image_border_set(d.border, 3, 3, 3, 3); | ||
317 | evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE); | ||
318 | |||
319 | evas_object_move(d.border, 0, 0); | ||
320 | evas_object_resize(d.border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6); | ||
321 | evas_object_show(d.border); | ||
322 | |||
323 | /* image loading will fail for this one -- unless one cheats and | ||
324 | * puts a valid image on that path */ | ||
325 | d.img2 = evas_object_image_add(d.evas); | ||
326 | evas_object_image_file_set(d.img2, bogus_path, NULL); | ||
327 | err = evas_object_image_load_error_get(d.img2); | ||
328 | if (err != EVAS_LOAD_ERROR_NONE) | ||
329 | { | ||
330 | fprintf(stderr, "could not load image '%s': error string is \"%s\"\n", | ||
331 | bogus_path, evas_load_error_str(err)); | ||
332 | } | ||
333 | else | ||
334 | { | ||
335 | evas_object_move(d.img2, WIDTH / 2, HEIGHT / 2); | ||
336 | evas_object_image_fill_set(d.img2, 0, 0, WIDTH / 2, HEIGHT / 2); | ||
337 | evas_object_resize(d.img2, WIDTH / 2, HEIGHT / 2); | ||
338 | evas_object_show(d.img2); | ||
339 | } | ||
340 | |||
341 | fprintf(stdout, commands); | ||
342 | ecore_main_loop_begin(); | ||
343 | |||
344 | ecore_evas_free(d.ee); | ||
345 | ecore_evas_shutdown(); | ||
346 | return 0; | ||
347 | |||
348 | error: | ||
349 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
350 | " up to ecore-evas for this example to run properly.\n"); | ||
351 | ecore_evas_shutdown(); | ||
352 | return -1; | ||
353 | } | ||
diff --git a/libraries/evas/src/examples/evas-images2.c b/libraries/evas/src/examples/evas-images2.c deleted file mode 100644 index ba7766c..0000000 --- a/libraries/evas/src/examples/evas-images2.c +++ /dev/null | |||
@@ -1,204 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating some image objects functions | ||
3 | * | ||
4 | * You'll need at least one engine built for it (excluding the buffer | ||
5 | * one) and the png image loader/saver also built. See stdout/stderr | ||
6 | * for output. | ||
7 | * | ||
8 | * @verbatim | ||
9 | * gcc -o evas-images2 evas-images2.c `pkg-config --libs --cflags evas ecore ecore-evas` | ||
10 | * @endverbatim | ||
11 | */ | ||
12 | |||
13 | #ifdef HAVE_CONFIG_H | ||
14 | |||
15 | #include "config.h" | ||
16 | #else | ||
17 | |||
18 | #define PACKAGE_EXAMPLES_DIR "." | ||
19 | #define __UNUSED__ | ||
20 | |||
21 | #endif | ||
22 | |||
23 | #include <Ecore.h> | ||
24 | #include <Ecore_Evas.h> | ||
25 | #include <stdio.h> | ||
26 | #include <errno.h> | ||
27 | |||
28 | #define WIDTH (320) | ||
29 | #define HEIGHT (240) | ||
30 | |||
31 | static const char *img_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png"; | ||
32 | static const char *commands = \ | ||
33 | "commands are:\n" | ||
34 | "\tp - change proxy image's source\n" | ||
35 | "\ts - print noise image's stride value\n" | ||
36 | "\ta - save noise image to disk (/tmp dir)\n" | ||
37 | "\th - print help\n"; | ||
38 | |||
39 | const char *file_path = "/tmp/evas-images2-example.png"; | ||
40 | const char *quality_str = "quality=100"; | ||
41 | |||
42 | struct test_data | ||
43 | { | ||
44 | Ecore_Evas *ee; | ||
45 | Evas *evas; | ||
46 | Evas_Object *logo, *noise_img, *proxy_img, *bg; | ||
47 | }; | ||
48 | |||
49 | static struct test_data d = {0}; | ||
50 | |||
51 | static void | ||
52 | _on_preloaded(void *data __UNUSED__, | ||
53 | Evas *e __UNUSED__, | ||
54 | Evas_Object *obj __UNUSED__, | ||
55 | void *event_info __UNUSED__) | ||
56 | { | ||
57 | fprintf(stdout, "Image has been pre-loaded!\n"); | ||
58 | } | ||
59 | |||
60 | static void | ||
61 | _on_destroy(Ecore_Evas *ee __UNUSED__) | ||
62 | { | ||
63 | ecore_main_loop_quit(); | ||
64 | } | ||
65 | |||
66 | /* here just to keep our example's window size and background image's | ||
67 | * size in synchrony */ | ||
68 | static void | ||
69 | _canvas_resize_cb(Ecore_Evas *ee) | ||
70 | { | ||
71 | int w, h; | ||
72 | |||
73 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
74 | evas_object_resize(d.bg, w, h); | ||
75 | } | ||
76 | |||
77 | static void | ||
78 | _on_keydown(void *data __UNUSED__, | ||
79 | Evas *evas __UNUSED__, | ||
80 | Evas_Object *o __UNUSED__, | ||
81 | void *einfo) | ||
82 | { | ||
83 | Evas_Event_Key_Down *ev = einfo; | ||
84 | |||
85 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
86 | { | ||
87 | fprintf(stdout, commands); | ||
88 | return; | ||
89 | } | ||
90 | |||
91 | if (strcmp(ev->keyname, "s") == 0) /* print proxy image' stride value */ | ||
92 | { | ||
93 | int stride = evas_object_image_stride_get(d.noise_img); | ||
94 | |||
95 | fprintf(stdout, "Image has row stride value of %d, which accounts" | ||
96 | " for %d pixels\n", stride, stride / 4); | ||
97 | |||
98 | return; | ||
99 | } | ||
100 | |||
101 | if (strcmp(ev->keyname, "p") == 0) /* change proxy's source */ | ||
102 | { | ||
103 | Evas_Object *source = evas_object_image_source_get(d.proxy_img); | ||
104 | |||
105 | if (source == d.logo) source = d.noise_img; | ||
106 | else source = d.logo; | ||
107 | |||
108 | evas_object_image_source_set(d.proxy_img, source); | ||
109 | |||
110 | fprintf(stdout, "Proxy image's source changed\n"); | ||
111 | |||
112 | return; | ||
113 | } | ||
114 | |||
115 | if (strcmp(ev->keyname, "a") == 0) /* save noise image to disk */ | ||
116 | { | ||
117 | if (!evas_object_image_save(d.noise_img, file_path, NULL, quality_str)) | ||
118 | fprintf(stderr, "Cannot save image to '%s' (flags '%s')\n", | ||
119 | file_path, quality_str); | ||
120 | else | ||
121 | fprintf(stdout, "Image saved to '%s' (flags '%s'), check it out with " | ||
122 | "an image viewer\n", file_path, quality_str); | ||
123 | |||
124 | return; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | int | ||
129 | main(void) | ||
130 | { | ||
131 | unsigned int i; | ||
132 | unsigned int pixels[(WIDTH / 4) * (HEIGHT / 4)]; | ||
133 | |||
134 | srand(time(NULL)); | ||
135 | |||
136 | if (!ecore_evas_init()) | ||
137 | return EXIT_FAILURE; | ||
138 | |||
139 | /* this will give you a window with an Evas canvas under the first | ||
140 | * engine available */ | ||
141 | d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); | ||
142 | if (!d.ee) | ||
143 | goto error; | ||
144 | |||
145 | ecore_evas_callback_destroy_set(d.ee, _on_destroy); | ||
146 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
147 | ecore_evas_show(d.ee); | ||
148 | |||
149 | /* the canvas pointer, de facto */ | ||
150 | d.evas = ecore_evas_get(d.ee); | ||
151 | |||
152 | d.bg = evas_object_rectangle_add(d.evas); | ||
153 | evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */ | ||
154 | evas_object_move(d.bg, 0, 0); /* at canvas' origin */ | ||
155 | evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
156 | evas_object_show(d.bg); | ||
157 | |||
158 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
159 | evas_object_event_callback_add( | ||
160 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
161 | |||
162 | d.logo = evas_object_image_filled_add(d.evas); | ||
163 | |||
164 | evas_object_event_callback_add( | ||
165 | d.logo, EVAS_CALLBACK_IMAGE_PRELOADED, _on_preloaded, NULL); | ||
166 | evas_object_image_preload(d.logo, EINA_TRUE); | ||
167 | |||
168 | evas_object_image_file_set(d.logo, img_path, NULL); | ||
169 | evas_object_resize(d.logo, WIDTH / 2, HEIGHT / 2); | ||
170 | evas_object_show(d.logo); | ||
171 | |||
172 | /* creating noise image */ | ||
173 | for (i = 0; i < sizeof(pixels) / sizeof(pixels[0]); i++) | ||
174 | pixels[i] = rand(); | ||
175 | |||
176 | d.noise_img = evas_object_image_add(d.evas); | ||
177 | evas_object_image_size_set(d.noise_img, WIDTH / 4, HEIGHT / 4); | ||
178 | evas_object_image_data_set(d.noise_img, pixels); | ||
179 | evas_object_image_filled_set(d.noise_img, EINA_TRUE); | ||
180 | evas_object_move(d.noise_img, (WIDTH * 3) / 4, 0); | ||
181 | evas_object_resize(d.noise_img, WIDTH / 4, HEIGHT / 4); | ||
182 | evas_object_show(d.noise_img); | ||
183 | fprintf(stdout, "Creating noise image with size %d, %d\n", | ||
184 | WIDTH / 4, HEIGHT / 4); | ||
185 | |||
186 | d.proxy_img = evas_object_image_filled_add(d.evas); | ||
187 | evas_object_image_source_set(d.proxy_img, d.logo); | ||
188 | evas_object_move(d.proxy_img, WIDTH / 4, HEIGHT / 2); | ||
189 | evas_object_resize(d.proxy_img, WIDTH / 2, HEIGHT / 2); | ||
190 | evas_object_show(d.proxy_img); | ||
191 | |||
192 | fprintf(stdout, commands); | ||
193 | ecore_main_loop_begin(); | ||
194 | |||
195 | ecore_evas_free(d.ee); | ||
196 | ecore_evas_shutdown(); | ||
197 | return 0; | ||
198 | |||
199 | error: | ||
200 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
201 | " up to ecore-evas for this example to run properly.\n"); | ||
202 | ecore_evas_shutdown(); | ||
203 | return -1; | ||
204 | } | ||
diff --git a/libraries/evas/src/examples/evas-init-shutdown.c b/libraries/evas/src/examples/evas-init-shutdown.c deleted file mode 100644 index a7508d8..0000000 --- a/libraries/evas/src/examples/evas-init-shutdown.c +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /** | ||
2 | * Simple example illustrating usage of evas_init() and | ||
3 | * evas_shutdown(). Usually one would instantiate a canvas to have | ||
4 | * something useful out of Evas. For an example of this kind, see the | ||
5 | * @ref Example_Evas_Buffer_Simple. | ||
6 | * | ||
7 | * Here, we are just listing the engine Evas was compiled with support | ||
8 | * to. | ||
9 | * | ||
10 | * @verbatim | ||
11 | * gcc -o evas-init-shutdown evas-init-shutdown.c `pkg-config --libs \ | ||
12 | * --cflags evas` | ||
13 | * @endverbatim | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <Evas.h> | ||
18 | #include <stdio.h> | ||
19 | #include <errno.h> | ||
20 | |||
21 | /* | ||
22 | * Simple example illustrating usage of evas_init() and | ||
23 | * evas_shutdown(). Usually one would instantiate a canvas to have | ||
24 | * something useful out of Evas. For an example of this kind, see the | ||
25 | * evas-buffer-simple.c, which requires the buffer engine module | ||
26 | * compiled in Evas. | ||
27 | * | ||
28 | * Here, we are just listing the engine Evas was compiled with support | ||
29 | * to. | ||
30 | */ | ||
31 | |||
32 | int | ||
33 | main(void) | ||
34 | { | ||
35 | Eina_List *engine_list, *l; | ||
36 | char *engine_name; | ||
37 | |||
38 | evas_init(); | ||
39 | |||
40 | engine_list = evas_render_method_list(); | ||
41 | if (!engine_list) | ||
42 | { | ||
43 | fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n"); | ||
44 | exit(-1); | ||
45 | } | ||
46 | |||
47 | printf("Available Evas Engines:\n"); | ||
48 | EINA_LIST_FOREACH(engine_list, l, engine_name) | ||
49 | printf("%s\n", engine_name); | ||
50 | |||
51 | evas_render_method_list_free(engine_list); | ||
52 | |||
53 | evas_shutdown(); | ||
54 | return 0; | ||
55 | } | ||
56 | |||
diff --git a/libraries/evas/src/examples/evas-map-utils.c b/libraries/evas/src/examples/evas-map-utils.c deleted file mode 100644 index 2d15882..0000000 --- a/libraries/evas/src/examples/evas-map-utils.c +++ /dev/null | |||
@@ -1,321 +0,0 @@ | |||
1 | /* | ||
2 | * gcc -o evas-map-utils evas-map-utils.c `pkg-config --cflags --libs evas ecore ecore-evas` | ||
3 | */ | ||
4 | #ifdef HAVE_CONFIG_H | ||
5 | #include "config.h" | ||
6 | #else | ||
7 | #define __UNUSED__ | ||
8 | #endif | ||
9 | |||
10 | #include <Ecore.h> | ||
11 | #include <Ecore_Evas.h> | ||
12 | |||
13 | #include <stdlib.h> | ||
14 | #include <stdio.h> | ||
15 | #include <string.h> | ||
16 | #include <math.h> | ||
17 | |||
18 | #define WIDTH 480 | ||
19 | #define HEIGHT 480 | ||
20 | |||
21 | typedef struct | ||
22 | { | ||
23 | Ecore_Evas *ee; | ||
24 | Evas *canvas; | ||
25 | struct { | ||
26 | int r, g, b, a; | ||
27 | } colors[6]; | ||
28 | int colors_index; | ||
29 | int frame; | ||
30 | Eina_Bool alpha : 1; | ||
31 | Eina_Bool smooth : 1; | ||
32 | Eina_Bool backface_culling : 1; | ||
33 | Eina_Bool apply_perspective : 1; | ||
34 | Eina_Bool apply_lighting : 1; | ||
35 | } App_Data; | ||
36 | |||
37 | static const char *help_string = | ||
38 | "Valid commands:\n" | ||
39 | "\ta - toggle alpha for maps\n" | ||
40 | "\ts - toggle smooth for maps\n" | ||
41 | "\tc - switch map color\n" | ||
42 | "\tb - toggle backface culling\n" | ||
43 | "\tp - toggle perspective\n" | ||
44 | "\tl - toggle lighting\n" | ||
45 | "\th - prints this help\n"; | ||
46 | |||
47 | static Eina_Bool | ||
48 | _anim_cb(void *data) | ||
49 | { | ||
50 | App_Data *ad = data; | ||
51 | Evas_Map *m; | ||
52 | const Evas_Map *old_map; | ||
53 | Evas_Object *o; | ||
54 | int r, g, b, a; | ||
55 | int win_w, win_h, img_w, img_h; | ||
56 | Evas_Coord x, y, w, h; | ||
57 | |||
58 | evas_output_size_get(ad->canvas, &win_w, &win_h); | ||
59 | |||
60 | m = evas_map_new(4); | ||
61 | evas_map_smooth_set(m, ad->smooth); | ||
62 | evas_map_alpha_set(m, ad->alpha); | ||
63 | |||
64 | r = ad->colors[ad->colors_index].r; | ||
65 | g = ad->colors[ad->colors_index].g; | ||
66 | b = ad->colors[ad->colors_index].b; | ||
67 | a = ad->colors[ad->colors_index].a; | ||
68 | evas_map_util_points_color_set(m, r, g, b, a); | ||
69 | |||
70 | o = evas_object_name_find(ad->canvas, "obj1"); | ||
71 | evas_object_geometry_get(o, &x, &y, &w, &h); | ||
72 | |||
73 | evas_map_util_points_populate_from_object(m, o); | ||
74 | evas_map_util_rotate(m, 3 * ad->frame, x + (w / 2), y + (h / 2)); | ||
75 | evas_object_map_set(o, m); | ||
76 | evas_object_map_enable_set(o, EINA_TRUE); | ||
77 | |||
78 | o = evas_object_name_find(ad->canvas, "obj2"); | ||
79 | evas_object_geometry_get(o, &x, &y, &w, &h); | ||
80 | evas_object_image_size_get(o, &img_w, &img_h); | ||
81 | |||
82 | evas_map_util_points_populate_from_object_full(m, o, 100); | ||
83 | evas_map_point_image_uv_set(m, 0, 0, 0); | ||
84 | evas_map_point_image_uv_set(m, 1, img_w, 0); | ||
85 | evas_map_point_image_uv_set(m, 2, img_w, img_h); | ||
86 | evas_map_point_image_uv_set(m, 3, 0, img_h); | ||
87 | evas_map_util_3d_rotate(m, ad->frame * 6, ad->frame * 6, ad->frame * 6, | ||
88 | x + (w / 3), y + 10, 0); | ||
89 | if (ad->apply_lighting) | ||
90 | evas_map_util_3d_lighting(m, win_w / 2, win_h / 2, -100, | ||
91 | 255, 255, 255, 0, 0, 0); | ||
92 | evas_object_map_set(o, m); | ||
93 | evas_object_map_enable_set(o, EINA_TRUE); | ||
94 | |||
95 | o = evas_object_name_find(ad->canvas, "obj3"); | ||
96 | evas_object_geometry_get(o, &x, &y, &w, &h); | ||
97 | evas_object_image_size_get(o, &img_w, &img_h); | ||
98 | |||
99 | evas_map_util_points_populate_from_geometry(m, x, y + (h / 2), w, h, -20); | ||
100 | evas_map_point_image_uv_set(m, 0, 0, 0); | ||
101 | evas_map_point_image_uv_set(m, 1, img_w, 0); | ||
102 | evas_map_point_image_uv_set(m, 2, img_w, img_h); | ||
103 | evas_map_point_image_uv_set(m, 3, 0, img_h); | ||
104 | evas_map_util_3d_rotate(m, 20, ad->frame * 6, 0, | ||
105 | x + (w / 2), y + (w / 2), w / 2); | ||
106 | |||
107 | if (ad->apply_perspective) | ||
108 | evas_map_util_3d_perspective(m, x + (w / 2), y + (h / 2), 0, 256); | ||
109 | if (ad->apply_lighting) | ||
110 | { | ||
111 | Evas_Coord mx, my; | ||
112 | evas_pointer_canvas_xy_get(ad->canvas, &mx, &my); | ||
113 | evas_map_util_3d_lighting(m, mx, my, -256, | ||
114 | 255, 255, 255, 0, 0, 0); | ||
115 | } | ||
116 | if (ad->backface_culling) | ||
117 | { | ||
118 | if (evas_map_util_clockwise_get(m)) | ||
119 | evas_object_show(o); | ||
120 | else | ||
121 | evas_object_hide(o); | ||
122 | } | ||
123 | else | ||
124 | evas_object_show(o); | ||
125 | evas_object_map_set(o, m); | ||
126 | evas_object_map_enable_set(o, EINA_TRUE); | ||
127 | |||
128 | evas_map_free(m); | ||
129 | |||
130 | o = evas_object_name_find(ad->canvas, "obj4"); | ||
131 | evas_object_geometry_get(o, &x, &y, &w, &h); | ||
132 | evas_object_image_size_get(evas_object_image_source_get(o), &img_w, &img_h); | ||
133 | |||
134 | m = evas_map_new(4); | ||
135 | evas_map_point_coord_set(m, 0, x, y + h, 0); | ||
136 | evas_map_point_coord_set(m, 1, x + w, y + h, 0); | ||
137 | evas_map_point_coord_set(m, 2, win_w - 10, win_h - 30, 0); | ||
138 | evas_map_point_coord_set(m, 3, (win_w / 2) + 10, win_h - 30, 0); | ||
139 | evas_map_point_image_uv_set(m, 0, 0, img_h); | ||
140 | evas_map_point_image_uv_set(m, 1, img_w, img_h); | ||
141 | evas_map_point_image_uv_set(m, 2, img_w, 2 * (img_h / 3)); | ||
142 | evas_map_point_image_uv_set(m, 3, 0, 2 * (img_h / 3)); | ||
143 | evas_map_point_color_set(m, 0, 200, 200, 200, 150); | ||
144 | evas_map_point_color_set(m, 1, 200, 200, 200, 150); | ||
145 | evas_map_point_color_set(m, 2, 0, 0, 0, 0); | ||
146 | evas_map_point_color_set(m, 3, 0, 0, 0, 0); | ||
147 | evas_object_map_set(o, m); | ||
148 | evas_object_map_enable_set(o, EINA_TRUE); | ||
149 | |||
150 | evas_map_free(m); | ||
151 | |||
152 | ad->frame = (ad->frame + 1) % 60; | ||
153 | |||
154 | return EINA_TRUE; | ||
155 | } | ||
156 | |||
157 | static void | ||
158 | _on_keydown(void *data, Evas *e, Evas_Object *o, void *event) | ||
159 | { | ||
160 | App_Data *ad = data; | ||
161 | Evas_Event_Key_Down *ev = event; | ||
162 | const Evas_Modifier *mods; | ||
163 | |||
164 | mods = evas_key_modifier_get(ad->canvas); | ||
165 | switch (ev->keyname[0]) | ||
166 | { | ||
167 | case 'a': | ||
168 | ad->alpha = !ad->alpha; | ||
169 | break; | ||
170 | case 's': | ||
171 | ad->smooth = !ad->smooth; | ||
172 | break; | ||
173 | case 'c': | ||
174 | ad->colors_index = (ad->colors_index + 1) % 6; | ||
175 | break; | ||
176 | case 'b': | ||
177 | ad->backface_culling = !ad->backface_culling; | ||
178 | break; | ||
179 | case 'p': | ||
180 | ad->apply_perspective = !ad->apply_perspective; | ||
181 | break; | ||
182 | case 'l': | ||
183 | ad->apply_lighting = !ad->apply_lighting; | ||
184 | break; | ||
185 | case 'h': | ||
186 | puts(help_string); | ||
187 | break; | ||
188 | default: | ||
189 | break; | ||
190 | } | ||
191 | } | ||
192 | |||
193 | static void | ||
194 | _objs_fit(Evas *e) | ||
195 | { | ||
196 | Evas_Object *o; | ||
197 | int w, h; | ||
198 | |||
199 | evas_output_size_get(e, &w, &h); | ||
200 | w /= 2; | ||
201 | h /= 2; | ||
202 | |||
203 | o = evas_object_name_find(e, "obj1"); | ||
204 | evas_object_move(o, w / 4, h / 4); | ||
205 | evas_object_resize(o, w / 2, h / 2); | ||
206 | |||
207 | o = evas_object_name_find(e, "obj2"); | ||
208 | evas_object_move(o, 5 * w / 4, h / 4); | ||
209 | evas_object_resize(o, w / 2, h / 2); | ||
210 | |||
211 | o = evas_object_name_find(e, "obj3"); | ||
212 | evas_object_move(o, w / 4, 5 * h / 4); | ||
213 | evas_object_resize(o, w / 2, h / 2); | ||
214 | |||
215 | o = evas_object_name_find(e, "obj4_source"); | ||
216 | evas_object_move(o, 5 * w / 4, 5 * h / 4); | ||
217 | evas_object_resize(o, w / 2, h / 2); | ||
218 | |||
219 | o = evas_object_name_find(e, "obj4"); | ||
220 | evas_object_move(o, 5 * w / 4, 5 * h / 4); | ||
221 | evas_object_resize(o, w / 2, h / 2); | ||
222 | } | ||
223 | |||
224 | static void | ||
225 | _on_resize(void *data __UNUSED__, Evas *e, Evas_Object *o __UNUSED__, void *event __UNUSED__) | ||
226 | { | ||
227 | _objs_fit(e); | ||
228 | } | ||
229 | |||
230 | static void | ||
231 | _on_free(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event __UNUSED__) | ||
232 | { | ||
233 | ecore_main_loop_quit(); | ||
234 | } | ||
235 | |||
236 | int | ||
237 | main(void) | ||
238 | { | ||
239 | Evas_Object *bg, *o, *osrc; | ||
240 | static App_Data d = { | ||
241 | .ee = NULL, | ||
242 | .canvas = NULL, | ||
243 | .colors = { | ||
244 | { 255, 255, 255, 255 }, | ||
245 | { 128, 128, 0, 128 }, | ||
246 | { 255, 0, 0, 255 }, | ||
247 | { 64, 128, 255, 255 }, | ||
248 | { 11, 23, 58, 132 }, | ||
249 | { 0, 0, 0, 255 } | ||
250 | }, | ||
251 | .colors_index = 0, | ||
252 | .frame = 0, | ||
253 | .alpha = EINA_FALSE, | ||
254 | .smooth = EINA_FALSE, | ||
255 | .backface_culling = EINA_FALSE, | ||
256 | .apply_perspective = EINA_TRUE, | ||
257 | .apply_lighting = EINA_TRUE | ||
258 | }; | ||
259 | |||
260 | if (!ecore_evas_init()) | ||
261 | return EXIT_FAILURE; | ||
262 | |||
263 | d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
264 | if (!d.ee) | ||
265 | goto error; | ||
266 | |||
267 | d.canvas = ecore_evas_get(d.ee); | ||
268 | |||
269 | bg = evas_object_image_filled_add(d.canvas); | ||
270 | evas_object_image_file_set(bg, "cube1.png", NULL); | ||
271 | ecore_evas_object_associate(d.ee, bg, 0); | ||
272 | evas_object_focus_set(bg, EINA_TRUE); | ||
273 | evas_object_move(bg, 0, 0); | ||
274 | evas_object_resize(bg, WIDTH, HEIGHT); | ||
275 | evas_object_show(bg); | ||
276 | |||
277 | o = evas_object_rectangle_add(d.canvas); | ||
278 | evas_object_name_set(o, "obj1"); | ||
279 | evas_object_color_set(o, 128, 0, 200, 200); | ||
280 | evas_object_show(o); | ||
281 | |||
282 | o = evas_object_image_filled_add(d.canvas); | ||
283 | evas_object_name_set(o, "obj2"); | ||
284 | evas_object_image_file_set(o, "enlightenment.png", NULL); | ||
285 | evas_object_show(o); | ||
286 | |||
287 | o = evas_object_image_filled_add(d.canvas); | ||
288 | evas_object_name_set(o, "obj3"); | ||
289 | evas_object_image_file_set(o, "enlightenment.png", NULL); | ||
290 | evas_object_show(o); | ||
291 | |||
292 | osrc = evas_object_image_filled_add(d.canvas); | ||
293 | evas_object_image_file_set(osrc, "im1.png", NULL); | ||
294 | evas_object_name_set(osrc, "obj4_source"); | ||
295 | evas_object_show(osrc); | ||
296 | |||
297 | o = evas_object_image_filled_add(d.canvas); | ||
298 | evas_object_image_source_set(o, osrc); | ||
299 | evas_object_name_set(o, "obj4"); | ||
300 | evas_object_show(o); | ||
301 | |||
302 | _objs_fit(d.canvas); | ||
303 | |||
304 | evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, &d); | ||
305 | evas_object_event_callback_add(bg, EVAS_CALLBACK_RESIZE, _on_resize, NULL); | ||
306 | evas_object_event_callback_add(bg, EVAS_CALLBACK_FREE, _on_free, NULL); | ||
307 | |||
308 | ecore_animator_add(_anim_cb, &d); | ||
309 | |||
310 | ecore_main_loop_begin(); | ||
311 | |||
312 | ecore_evas_shutdown(); | ||
313 | return 0; | ||
314 | |||
315 | error: | ||
316 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
317 | " up to ecore-evas for this example to run properly.\n"); | ||
318 | panic: | ||
319 | ecore_evas_shutdown(); | ||
320 | return -1; | ||
321 | } | ||
diff --git a/libraries/evas/src/examples/evas-object-manipulation.c b/libraries/evas/src/examples/evas-object-manipulation.c deleted file mode 100644 index e9c9442..0000000 --- a/libraries/evas/src/examples/evas-object-manipulation.c +++ /dev/null | |||
@@ -1,235 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating basic objects manipulation. | ||
3 | * | ||
4 | * You'll need at least one engine built for it (excluding the buffer | ||
5 | * one) and the png image loader also built. See stdout/stderr for | ||
6 | * output. | ||
7 | * | ||
8 | * @verbatim | ||
9 | * gcc -o evas-object-manipulation evas-object-manipulation.c `pkg-config --libs --cflags ecore evas ecore-evas` | ||
10 | * @endverbatim | ||
11 | */ | ||
12 | |||
13 | #ifdef HAVE_CONFIG_H | ||
14 | |||
15 | #include "config.h" | ||
16 | #else | ||
17 | |||
18 | #define PACKAGE_EXAMPLES_DIR "." | ||
19 | #define __UNUSED__ | ||
20 | |||
21 | #endif | ||
22 | |||
23 | #include <Ecore.h> | ||
24 | #include <Ecore_Evas.h> | ||
25 | #include <stdio.h> | ||
26 | #include <errno.h> | ||
27 | |||
28 | #define WIDTH (320) | ||
29 | #define HEIGHT (240) | ||
30 | |||
31 | static const char *img_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png"; | ||
32 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
33 | |||
34 | struct test_data | ||
35 | { | ||
36 | Ecore_Evas *ee; | ||
37 | Evas *canvas; | ||
38 | Evas_Object *img, *bg, *clipper, *clipper_border, *text; | ||
39 | }; | ||
40 | |||
41 | static struct test_data d = {0}; | ||
42 | |||
43 | /* here just to keep our example's window size and background image's | ||
44 | * size in synchrony */ | ||
45 | static void | ||
46 | _canvas_resize_cb(Ecore_Evas *ee) | ||
47 | { | ||
48 | int w, h; | ||
49 | |||
50 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
51 | evas_object_resize(d.bg, w, h); | ||
52 | } | ||
53 | |||
54 | static void | ||
55 | _on_keydown(void *data __UNUSED__, | ||
56 | Evas *evas __UNUSED__, | ||
57 | Evas_Object *o __UNUSED__, | ||
58 | void *einfo) | ||
59 | { | ||
60 | Evas_Event_Key_Down *ev = einfo; | ||
61 | |||
62 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
63 | { | ||
64 | fprintf(stdout, "commands are:\n" | ||
65 | "\to - change clipper's opacity\n" | ||
66 | "\tr - toggle clipper's color between red and white\n" | ||
67 | "\tc - toggle clipper's clipping function\n" | ||
68 | "\tv - toggle clipper's visibility\n"); | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | if (strcmp(ev->keyname, "o") == 0) /* change clipper's opacity */ | ||
73 | { | ||
74 | int alpha, r, g, b; | ||
75 | |||
76 | evas_object_color_get(d.clipper, &r, &g, &b, &alpha); | ||
77 | alpha -= 20; | ||
78 | if (alpha < 0) | ||
79 | alpha = 255; | ||
80 | |||
81 | evas_object_color_set(d.clipper, r, g, b, alpha); | ||
82 | |||
83 | fprintf(stdout, "Changing clipper's opacity: %d%%\n", | ||
84 | (int)((alpha / 255.0) * 100)); | ||
85 | return; | ||
86 | } | ||
87 | |||
88 | if (strcmp(ev->keyname, "r") == 0) /* toggle clipper's color | ||
89 | * between red and white */ | ||
90 | { | ||
91 | int alpha, r, g, b; | ||
92 | |||
93 | fprintf(stdout, "Changing clipper's color to"); | ||
94 | |||
95 | evas_object_color_get(d.clipper, &r, &g, &b, &alpha); | ||
96 | if (g > 0) | ||
97 | { | ||
98 | fprintf(stdout, "red\n"); | ||
99 | g = b = 0; | ||
100 | } | ||
101 | else | ||
102 | { | ||
103 | fprintf(stdout, "white\n"); | ||
104 | g = b = 255; | ||
105 | } | ||
106 | |||
107 | evas_object_color_set(d.clipper, r, g, b, alpha); | ||
108 | return; | ||
109 | } | ||
110 | |||
111 | if (strcmp(ev->keyname, "c") == 0) /* toggle clipper's clipping function */ | ||
112 | { | ||
113 | fprintf(stdout, "Toggling clipping "); | ||
114 | |||
115 | if (evas_object_clip_get(d.img) == d.clipper) | ||
116 | { | ||
117 | evas_object_clip_unset(d.img); | ||
118 | fprintf(stdout, "off\n"); | ||
119 | } | ||
120 | else | ||
121 | { | ||
122 | evas_object_clip_set(d.img, d.clipper); | ||
123 | fprintf(stdout, "on\n"); | ||
124 | } | ||
125 | return; | ||
126 | } | ||
127 | |||
128 | if (strcmp(ev->keyname, "v") == 0) /* toggle clipper's visibility */ | ||
129 | { | ||
130 | fprintf(stdout, "Clipper is now "); | ||
131 | |||
132 | if (evas_object_visible_get(d.clipper)) | ||
133 | { | ||
134 | evas_object_hide(d.clipper); | ||
135 | fprintf(stdout, "hidden\n"); | ||
136 | } | ||
137 | else | ||
138 | { | ||
139 | evas_object_show(d.clipper); | ||
140 | fprintf(stdout, "visible\n"); | ||
141 | } | ||
142 | return; | ||
143 | } | ||
144 | } | ||
145 | |||
146 | int | ||
147 | main(void) | ||
148 | { | ||
149 | int err; | ||
150 | |||
151 | if (!ecore_evas_init()) | ||
152 | return EXIT_FAILURE; | ||
153 | |||
154 | /* this will give you a window with an Evas canvas under the first | ||
155 | * engine available */ | ||
156 | d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); | ||
157 | if (!d.ee) | ||
158 | goto error; | ||
159 | |||
160 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
161 | ecore_evas_show(d.ee); | ||
162 | |||
163 | /* the canvas pointer, de facto */ | ||
164 | d.canvas = ecore_evas_get(d.ee); | ||
165 | |||
166 | d.bg = evas_object_rectangle_add(d.canvas); | ||
167 | evas_object_name_set(d.bg, "background rectangle"); | ||
168 | evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */ | ||
169 | evas_object_move(d.bg, 0, 0); /* at canvas' origin */ | ||
170 | evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
171 | evas_object_show(d.bg); | ||
172 | |||
173 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
174 | evas_object_event_callback_add( | ||
175 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
176 | |||
177 | d.img = evas_object_image_filled_add(d.canvas); | ||
178 | evas_object_image_file_set(d.img, img_path, NULL); | ||
179 | err = evas_object_image_load_error_get(d.img); | ||
180 | if (err != EVAS_LOAD_ERROR_NONE) | ||
181 | { | ||
182 | goto panic; | ||
183 | } | ||
184 | else | ||
185 | { | ||
186 | evas_object_move(d.img, 0, 0); | ||
187 | evas_object_resize(d.img, WIDTH, HEIGHT); | ||
188 | evas_object_show(d.img); | ||
189 | |||
190 | fprintf(stdout, "Image object added, type is: %s\n", | ||
191 | evas_object_type_get(d.img)); | ||
192 | } | ||
193 | |||
194 | /* border on the image's clipper, here just to emphasize its position */ | ||
195 | d.clipper_border = evas_object_image_filled_add(d.canvas); | ||
196 | evas_object_image_file_set(d.clipper_border, border_img_path, NULL); | ||
197 | err = evas_object_image_load_error_get(d.clipper_border); | ||
198 | if (err != EVAS_LOAD_ERROR_NONE) | ||
199 | { | ||
200 | goto panic; | ||
201 | } | ||
202 | else | ||
203 | { | ||
204 | evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3); | ||
205 | evas_object_image_border_center_fill_set( | ||
206 | d.clipper_border, EVAS_BORDER_FILL_NONE); | ||
207 | evas_object_move(d.clipper_border, (WIDTH / 4) - 3, (HEIGHT / 4) - 3); | ||
208 | evas_object_resize( | ||
209 | d.clipper_border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6); | ||
210 | evas_object_show(d.clipper_border); | ||
211 | } | ||
212 | |||
213 | /* solid white clipper (note that it's the default color for a | ||
214 | * rectangle) - it won't change clippees' colors, then (multiplying | ||
215 | * by 255) */ | ||
216 | d.clipper = evas_object_rectangle_add(d.canvas); | ||
217 | evas_object_move(d.clipper, WIDTH / 4, HEIGHT / 4); | ||
218 | evas_object_resize(d.clipper, WIDTH / 2, HEIGHT / 2); | ||
219 | evas_object_clip_set(d.img, d.clipper); | ||
220 | evas_object_show(d.clipper); | ||
221 | |||
222 | ecore_main_loop_begin(); | ||
223 | |||
224 | ecore_evas_free(d.ee); | ||
225 | ecore_evas_shutdown(); | ||
226 | return 0; | ||
227 | |||
228 | error: | ||
229 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
230 | " up to ecore-evas for this example to run properly.\n"); | ||
231 | panic: | ||
232 | ecore_evas_free(d.ee); | ||
233 | ecore_evas_shutdown(); | ||
234 | return -1; | ||
235 | } | ||
diff --git a/libraries/evas/src/examples/evas-smart-object.c b/libraries/evas/src/examples/evas-smart-object.c deleted file mode 100644 index 8a36b62..0000000 --- a/libraries/evas/src/examples/evas-smart-object.c +++ /dev/null | |||
@@ -1,708 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating a custom Evas smart object | ||
3 | * | ||
4 | * You'll need at least one engine built for it (excluding the buffer | ||
5 | * one). See stdout/stderr for output. | ||
6 | * | ||
7 | * @verbatim | ||
8 | * gcc -o evas-smart-object evas-smart-object.c `pkg-config --libs --cflags evas ecore ecore-evas` | ||
9 | * @endverbatim | ||
10 | */ | ||
11 | |||
12 | #ifdef HAVE_CONFIG_H | ||
13 | |||
14 | #include "config.h" | ||
15 | #else | ||
16 | |||
17 | #define PACKAGE_EXAMPLES_DIR "." | ||
18 | #define __UNUSED__ | ||
19 | |||
20 | #endif | ||
21 | |||
22 | #include <Ecore.h> | ||
23 | #include <Ecore_Evas.h> | ||
24 | #include <stdio.h> | ||
25 | #include <errno.h> | ||
26 | |||
27 | #define WIDTH (320) | ||
28 | #define HEIGHT (240) | ||
29 | |||
30 | static const char *commands = \ | ||
31 | "commands are:\n" | ||
32 | "\tl - insert child rectangle on the left\n" | ||
33 | "\tr - insert child rectangle on the right\n" | ||
34 | "\tw - remove and delete all members from the smart object\n" | ||
35 | "\tright arrow - move smart object to the right\n" | ||
36 | "\tleft arrow - move smart object to the left\n" | ||
37 | "\tup arrow - move smart object up\n" | ||
38 | "\tdown arrow - move smart object down\n" | ||
39 | "\td - decrease smart object's size\n" | ||
40 | "\ti - increase smart object's size\n" | ||
41 | "\tc - change smart object's clipper color\n" | ||
42 | "\th - print help\n"; | ||
43 | |||
44 | #define WHITE {255, 255, 255, 255} | ||
45 | #define RED {255, 0, 0, 255} | ||
46 | #define GREEN {0, 255, 0, 255} | ||
47 | #define BLUE {0, 0, 255, 255} | ||
48 | |||
49 | struct test_data | ||
50 | { | ||
51 | Ecore_Evas *ee; | ||
52 | Evas *evas; | ||
53 | Evas_Object *smt, *bg, *clipper, *rects[2]; | ||
54 | }; | ||
55 | |||
56 | struct color_tuple | ||
57 | { | ||
58 | int r, g, b, a; | ||
59 | } clipper_colors[4] = {WHITE, RED, GREEN, BLUE}; | ||
60 | int cur_color = 0; | ||
61 | |||
62 | static const char * | ||
63 | _index_to_color(int i) | ||
64 | { | ||
65 | switch (i) | ||
66 | { | ||
67 | case 0: | ||
68 | return "WHITE (default)"; | ||
69 | |||
70 | case 1: | ||
71 | return "RED"; | ||
72 | |||
73 | case 2: | ||
74 | return "GREEN"; | ||
75 | |||
76 | case 3: | ||
77 | return "BLUE"; | ||
78 | |||
79 | default: | ||
80 | return "other"; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | static struct test_data d = {0}; | ||
85 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
86 | |||
87 | #define _evas_smart_example_type "Evas_Smart_Example" | ||
88 | #define EVT_CHILDREN_NUMBER_CHANGED "children,changed" | ||
89 | |||
90 | static const Evas_Smart_Cb_Description _smart_callbacks[] = | ||
91 | { | ||
92 | {EVT_CHILDREN_NUMBER_CHANGED, "i"}, | ||
93 | {NULL, NULL} | ||
94 | }; | ||
95 | |||
96 | typedef struct _Evas_Smart_Example_Data Evas_Smart_Example_Data; | ||
97 | /* | ||
98 | * This structure augments clipped smart object's instance data, | ||
99 | * providing extra members required by our example smart object's | ||
100 | * implementation. | ||
101 | */ | ||
102 | struct _Evas_Smart_Example_Data | ||
103 | { | ||
104 | Evas_Object_Smart_Clipped_Data base; | ||
105 | Evas_Object *children[2], *border; | ||
106 | int child_count; | ||
107 | }; | ||
108 | |||
109 | #define EVAS_SMART_EXAMPLE_DATA_GET(o, ptr) \ | ||
110 | Evas_Smart_Example_Data * ptr = evas_object_smart_data_get(o) | ||
111 | |||
112 | #define EVAS_SMART_EXAMPLE_DATA_GET_OR_RETURN(o, ptr) \ | ||
113 | EVAS_SMART_EXAMPLE_DATA_GET(o, ptr); \ | ||
114 | if (!ptr) \ | ||
115 | { \ | ||
116 | fprintf(stderr, "No widget data for object %p (%s)!", \ | ||
117 | o, evas_object_type_get(o)); \ | ||
118 | fflush(stderr); \ | ||
119 | abort(); \ | ||
120 | return; \ | ||
121 | } | ||
122 | |||
123 | #define EVAS_SMART_EXAMPLE_DATA_GET_OR_RETURN_VAL(o, ptr, val) \ | ||
124 | EVAS_SMART_EXAMPLE_DATA_GET(o, ptr); \ | ||
125 | if (!ptr) \ | ||
126 | { \ | ||
127 | fprintf(stderr, "No widget data for object %p (%s)!", \ | ||
128 | o, evas_object_type_get(o)); \ | ||
129 | fflush(stderr); \ | ||
130 | abort(); \ | ||
131 | return val; \ | ||
132 | } | ||
133 | |||
134 | EVAS_SMART_SUBCLASS_NEW(_evas_smart_example_type, _evas_smart_example, | ||
135 | Evas_Smart_Class, Evas_Smart_Class, | ||
136 | evas_object_smart_clipped_class_get, _smart_callbacks); | ||
137 | |||
138 | static void | ||
139 | _on_destroy(Ecore_Evas *ee __UNUSED__) | ||
140 | { | ||
141 | ecore_main_loop_quit(); | ||
142 | } | ||
143 | |||
144 | /* here just to keep our example's window size and background image's | ||
145 | * size in synchrony */ | ||
146 | static void | ||
147 | _canvas_resize_cb(Ecore_Evas *ee) | ||
148 | { | ||
149 | int w, h; | ||
150 | |||
151 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
152 | evas_object_resize(d.bg, w, h); | ||
153 | } | ||
154 | |||
155 | static void | ||
156 | _on_child_del(void *data, | ||
157 | Evas *evas __UNUSED__, | ||
158 | Evas_Object *o, | ||
159 | void *einfo __UNUSED__) | ||
160 | { | ||
161 | Evas_Object *example_smart = data; | ||
162 | int index; | ||
163 | |||
164 | EVAS_SMART_EXAMPLE_DATA_GET(example_smart, priv); | ||
165 | |||
166 | index = (int)evas_object_data_get(o, "index"); | ||
167 | index--; | ||
168 | |||
169 | priv->children[index] = NULL; | ||
170 | |||
171 | evas_object_smart_member_del(o); | ||
172 | evas_object_smart_changed(example_smart); | ||
173 | } | ||
174 | |||
175 | static void | ||
176 | _evas_smart_example_child_callbacks_unregister(Evas_Object *obj) | ||
177 | { | ||
178 | evas_object_data_set(obj, "index", NULL); | ||
179 | evas_object_event_callback_del(obj, EVAS_CALLBACK_FREE, _on_child_del); | ||
180 | } | ||
181 | |||
182 | static void | ||
183 | _evas_smart_example_child_callbacks_register(Evas_Object *o, | ||
184 | Evas_Object *child, | ||
185 | int index) | ||
186 | { | ||
187 | evas_object_event_callback_add(child, EVAS_CALLBACK_FREE, _on_child_del, o); | ||
188 | evas_object_data_set(child, "index", (void *)(++index)); | ||
189 | } | ||
190 | |||
191 | /* create and setup a new example smart object's internals */ | ||
192 | static void | ||
193 | _evas_smart_example_smart_add(Evas_Object *o) | ||
194 | { | ||
195 | EVAS_SMART_DATA_ALLOC(o, Evas_Smart_Example_Data); | ||
196 | |||
197 | /* this is a border around the smart object's area, delimiting it */ | ||
198 | priv->border = evas_object_image_filled_add(evas_object_evas_get(o)); | ||
199 | evas_object_image_file_set(priv->border, border_img_path, NULL); | ||
200 | evas_object_image_border_set(priv->border, 3, 3, 3, 3); | ||
201 | evas_object_image_border_center_fill_set( | ||
202 | priv->border, EVAS_BORDER_FILL_NONE); | ||
203 | evas_object_smart_member_add(priv->border, o); | ||
204 | |||
205 | _evas_smart_example_parent_sc->add(o); | ||
206 | } | ||
207 | |||
208 | static void | ||
209 | _evas_smart_example_smart_del(Evas_Object *o) | ||
210 | { | ||
211 | EVAS_SMART_EXAMPLE_DATA_GET(o, priv); | ||
212 | |||
213 | if (priv->children[0]) | ||
214 | { | ||
215 | _evas_smart_example_child_callbacks_unregister(priv->children[0]); | ||
216 | priv->children[0] = NULL; | ||
217 | } | ||
218 | |||
219 | if (priv->children[1]) | ||
220 | { | ||
221 | _evas_smart_example_child_callbacks_unregister(priv->children[1]); | ||
222 | priv->children[1] = NULL; | ||
223 | } | ||
224 | |||
225 | _evas_smart_example_parent_sc->del(o); | ||
226 | } | ||
227 | |||
228 | static void | ||
229 | _evas_smart_example_smart_show(Evas_Object *o) | ||
230 | { | ||
231 | EVAS_SMART_EXAMPLE_DATA_GET(o, priv); | ||
232 | |||
233 | if (priv->children[0]) evas_object_show(priv->children[0]); | ||
234 | if (priv->children[1]) evas_object_show(priv->children[1]); | ||
235 | evas_object_show(priv->border); | ||
236 | |||
237 | _evas_smart_example_parent_sc->show(o); | ||
238 | } | ||
239 | |||
240 | static void | ||
241 | _evas_smart_example_smart_hide(Evas_Object *o) | ||
242 | { | ||
243 | EVAS_SMART_EXAMPLE_DATA_GET(o, priv); | ||
244 | |||
245 | if (priv->children[0]) evas_object_hide(priv->children[0]); | ||
246 | if (priv->children[1]) evas_object_hide(priv->children[1]); | ||
247 | evas_object_hide(priv->border); | ||
248 | |||
249 | _evas_smart_example_parent_sc->hide(o); | ||
250 | } | ||
251 | |||
252 | static void | ||
253 | _evas_smart_example_smart_resize(Evas_Object *o, | ||
254 | Evas_Coord w, | ||
255 | Evas_Coord h) | ||
256 | { | ||
257 | Evas_Coord ow, oh; | ||
258 | evas_object_geometry_get(o, NULL, NULL, &ow, &oh); | ||
259 | if ((ow == w) && (oh == h)) return; | ||
260 | |||
261 | /* this will trigger recalculation */ | ||
262 | evas_object_smart_changed(o); | ||
263 | } | ||
264 | |||
265 | /* act on child objects' properties, before rendering */ | ||
266 | static void | ||
267 | _evas_smart_example_smart_calculate(Evas_Object *o) | ||
268 | { | ||
269 | Evas_Coord x, y, w, h; | ||
270 | |||
271 | EVAS_SMART_EXAMPLE_DATA_GET_OR_RETURN(o, priv); | ||
272 | evas_object_geometry_get(o, &x, &y, &w, &h); | ||
273 | |||
274 | evas_object_resize(priv->border, w, h); | ||
275 | evas_object_move(priv->border, x, y); | ||
276 | |||
277 | if (priv->children[0]) | ||
278 | { | ||
279 | evas_object_move(priv->children[0], x + 3, y + 3); | ||
280 | evas_object_resize(priv->children[0], (w / 2) - 3, (h / 2) - 3); | ||
281 | } | ||
282 | |||
283 | if (priv->children[1]) | ||
284 | { | ||
285 | evas_object_move(priv->children[1], x + (w / 2), y + (h / 2)); | ||
286 | evas_object_resize(priv->children[1], (w / 2) - 3, (h / 2) - 3); | ||
287 | } | ||
288 | } | ||
289 | |||
290 | /* setting our smart interface */ | ||
291 | static void | ||
292 | _evas_smart_example_smart_set_user(Evas_Smart_Class *sc) | ||
293 | { | ||
294 | /* specializing these two */ | ||
295 | sc->add = _evas_smart_example_smart_add; | ||
296 | sc->del = _evas_smart_example_smart_del; | ||
297 | sc->show = _evas_smart_example_smart_show; | ||
298 | sc->hide = _evas_smart_example_smart_hide; | ||
299 | |||
300 | /* clipped smart object has no hook on resizes or calculations */ | ||
301 | sc->resize = _evas_smart_example_smart_resize; | ||
302 | sc->calculate = _evas_smart_example_smart_calculate; | ||
303 | } | ||
304 | |||
305 | /* BEGINS example smart object's own interface */ | ||
306 | |||
307 | /* add a new example smart object to a canvas */ | ||
308 | Evas_Object * | ||
309 | evas_smart_example_add(Evas *evas) | ||
310 | { | ||
311 | return evas_object_smart_add(evas, _evas_smart_example_smart_class_new()); | ||
312 | } | ||
313 | |||
314 | static void | ||
315 | _evas_smart_example_remove_do(Evas_Smart_Example_Data *priv, | ||
316 | Evas_Object *child, | ||
317 | int index) | ||
318 | { | ||
319 | priv->children[index] = NULL; | ||
320 | priv->child_count--; | ||
321 | _evas_smart_example_child_callbacks_unregister(child); | ||
322 | evas_object_smart_member_del(child); | ||
323 | } | ||
324 | |||
325 | /* remove a child element, return its pointer (or NULL on errors) */ | ||
326 | Evas_Object * | ||
327 | evas_smart_example_remove(Evas_Object *o, | ||
328 | Evas_Object *child) | ||
329 | { | ||
330 | int index; | ||
331 | |||
332 | EVAS_SMART_EXAMPLE_DATA_GET_OR_RETURN_VAL(o, priv, NULL); | ||
333 | |||
334 | if (priv->children[0] != child && priv->children[1] != child) | ||
335 | { | ||
336 | fprintf(stderr, "You are trying to remove something not belonging to" | ||
337 | " the example smart object!\n"); | ||
338 | return NULL; | ||
339 | } | ||
340 | |||
341 | index = (int)evas_object_data_get(child, "index"); | ||
342 | index--; | ||
343 | |||
344 | _evas_smart_example_remove_do(priv, child, index); | ||
345 | |||
346 | evas_object_smart_callback_call( | ||
347 | o, EVT_CHILDREN_NUMBER_CHANGED, (void *)priv->child_count); | ||
348 | evas_object_smart_changed(o); | ||
349 | |||
350 | return child; | ||
351 | } | ||
352 | |||
353 | /* set to return any previous object set to the left position of the | ||
354 | * smart object or NULL, if any (or on errors) */ | ||
355 | Evas_Object * | ||
356 | evas_smart_example_set_left(Evas_Object *o, | ||
357 | Evas_Object *child) | ||
358 | { | ||
359 | Evas_Object *ret = NULL; | ||
360 | |||
361 | EVAS_SMART_EXAMPLE_DATA_GET_OR_RETURN_VAL(o, priv, NULL); | ||
362 | if (!child) | ||
363 | return NULL; | ||
364 | |||
365 | if (priv->children[1] == child) | ||
366 | { | ||
367 | fprintf(stderr, "You mustn't place a child on both slots of" | ||
368 | " the example smart object!\n"); | ||
369 | return NULL; | ||
370 | } | ||
371 | |||
372 | if (priv->children[0]) | ||
373 | { | ||
374 | if (priv->children[0] != child) | ||
375 | { | ||
376 | ret = priv->children[0]; | ||
377 | _evas_smart_example_remove_do(priv, priv->children[0], 0); | ||
378 | } | ||
379 | else return child; | ||
380 | } | ||
381 | |||
382 | priv->children[0] = child; | ||
383 | _evas_smart_example_child_callbacks_register(o, child, 0); | ||
384 | evas_object_smart_member_add(child, o); | ||
385 | evas_object_smart_changed(o); | ||
386 | |||
387 | priv->child_count++; | ||
388 | if (!ret) | ||
389 | { | ||
390 | evas_object_smart_callback_call( | ||
391 | o, EVT_CHILDREN_NUMBER_CHANGED, (void *)priv->child_count); | ||
392 | } | ||
393 | |||
394 | return ret; | ||
395 | } | ||
396 | |||
397 | /* set to return any previous object set to the right position of the | ||
398 | * smart object or NULL, if any (or on errors) */ | ||
399 | Evas_Object * | ||
400 | evas_smart_example_set_right(Evas_Object *o, | ||
401 | Evas_Object *child) | ||
402 | { | ||
403 | Evas_Object *ret = NULL; | ||
404 | |||
405 | EVAS_SMART_EXAMPLE_DATA_GET_OR_RETURN_VAL(o, priv, NULL); | ||
406 | if (!child) | ||
407 | return NULL; | ||
408 | |||
409 | if (priv->children[0] == child) | ||
410 | { | ||
411 | fprintf(stderr, "You mustn't place a child on both slots of" | ||
412 | " the example smart object!\n"); | ||
413 | return NULL; | ||
414 | } | ||
415 | |||
416 | if (priv->children[1]) | ||
417 | { | ||
418 | if (priv->children[1] != child) | ||
419 | { | ||
420 | ret = priv->children[1]; | ||
421 | _evas_smart_example_remove_do(priv, priv->children[1], 1); | ||
422 | } | ||
423 | else return child; | ||
424 | } | ||
425 | |||
426 | priv->children[1] = child; | ||
427 | _evas_smart_example_child_callbacks_register(o, child, 1); | ||
428 | evas_object_smart_member_add(child, o); | ||
429 | evas_object_smart_changed(o); | ||
430 | |||
431 | priv->child_count++; | ||
432 | if (!ret) | ||
433 | { | ||
434 | evas_object_smart_callback_call( | ||
435 | o, EVT_CHILDREN_NUMBER_CHANGED, (void *)priv->child_count); | ||
436 | } | ||
437 | |||
438 | return ret; | ||
439 | } | ||
440 | |||
441 | /* END OF example smart object's own interface */ | ||
442 | |||
443 | static void | ||
444 | _on_keydown(void *data __UNUSED__, | ||
445 | Evas *evas __UNUSED__, | ||
446 | Evas_Object *o __UNUSED__, | ||
447 | void *einfo) | ||
448 | { | ||
449 | Evas_Event_Key_Down *ev = einfo; | ||
450 | |||
451 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
452 | { | ||
453 | fprintf(stdout, commands); | ||
454 | return; | ||
455 | } | ||
456 | |||
457 | if (strcmp(ev->keyname, "w") == 0) /* clear out smart object (WRT members) */ | ||
458 | { | ||
459 | if (d.rects[0]) | ||
460 | { | ||
461 | evas_smart_example_remove(d.smt, d.rects[0]); | ||
462 | evas_object_del(d.rects[0]); | ||
463 | } | ||
464 | if (d.rects[1]) | ||
465 | { | ||
466 | evas_smart_example_remove(d.smt, d.rects[1]); | ||
467 | evas_object_del(d.rects[1]); | ||
468 | } | ||
469 | |||
470 | memset(d.rects, 0, sizeof(d.rects)); | ||
471 | |||
472 | fprintf(stdout, "Deleting all members of the smart object.\n"); | ||
473 | |||
474 | return; | ||
475 | } | ||
476 | |||
477 | if (strcmp(ev->keyname, "l") == 0) /* insert random colored | ||
478 | * rectangle on the left */ | ||
479 | { | ||
480 | Evas_Object *rect = evas_object_rectangle_add(d.evas), *prev; | ||
481 | evas_object_color_set( | ||
482 | rect, rand() % 255, rand() % 255, rand() % 255, 255); | ||
483 | evas_object_show(rect); | ||
484 | |||
485 | prev = evas_smart_example_set_left(d.smt, rect); | ||
486 | d.rects[0] = rect; | ||
487 | |||
488 | fprintf(stdout, "Setting smart object's left spot with a new" | ||
489 | " rectangle.\n"); | ||
490 | fprintf(stdout, "Checking its new smart object parent: %s\n", | ||
491 | evas_object_smart_parent_get(rect) == d.smt ? "OK!" : | ||
492 | "Failure!"); | ||
493 | if (prev) | ||
494 | { | ||
495 | int r, g, b; | ||
496 | |||
497 | evas_object_color_get(prev, &r, &g, &b, NULL); | ||
498 | fprintf(stdout, "Deleting previous left child," | ||
499 | " which had colors (%d, %d, %d)\n", r, g, b); | ||
500 | evas_object_del(prev); | ||
501 | } | ||
502 | |||
503 | return; | ||
504 | } | ||
505 | |||
506 | if (strcmp(ev->keyname, "r") == 0) /* insert random colored | ||
507 | * rectangle on the right */ | ||
508 | { | ||
509 | Evas_Object *rect = evas_object_rectangle_add(d.evas), *prev; | ||
510 | evas_object_color_set( | ||
511 | rect, rand() % 255, rand() % 255, rand() % 255, 255); | ||
512 | evas_object_show(rect); | ||
513 | |||
514 | prev = evas_smart_example_set_right(d.smt, rect); | ||
515 | d.rects[1] = rect; | ||
516 | |||
517 | fprintf(stdout, "Setting smart object's right spot with a new" | ||
518 | " rectangle.\n"); | ||
519 | fprintf(stdout, "Checking its new smart object parent: %s\n", | ||
520 | evas_object_smart_parent_get(rect) == d.smt ? "OK!" : | ||
521 | "Failure!"); | ||
522 | if (prev) | ||
523 | { | ||
524 | int r, g, b; | ||
525 | |||
526 | evas_object_color_get(prev, &r, &g, &b, NULL); | ||
527 | fprintf(stdout, "Deleting previous right child," | ||
528 | " which had colors (%d, %d, %d)\n", r, g, b); | ||
529 | evas_object_del(prev); | ||
530 | } | ||
531 | |||
532 | return; | ||
533 | } | ||
534 | |||
535 | /* move smart object along the canvas */ | ||
536 | if (strcmp(ev->keyname, "Right") == 0 || strcmp(ev->keyname, "Left") == 0 || | ||
537 | strcmp(ev->keyname, "Up") == 0 || strcmp(ev->keyname, "Down") == 0) | ||
538 | { | ||
539 | Evas_Coord x, y; | ||
540 | |||
541 | evas_object_geometry_get(d.smt, &x, &y, NULL, NULL); | ||
542 | |||
543 | switch (ev->keyname[0]) | ||
544 | { | ||
545 | case 'R': | ||
546 | x += 20; | ||
547 | break; | ||
548 | |||
549 | case 'L': | ||
550 | x -= 20; | ||
551 | break; | ||
552 | |||
553 | case 'U': | ||
554 | y -= 20; | ||
555 | break; | ||
556 | |||
557 | case 'D': | ||
558 | y += 20; | ||
559 | break; | ||
560 | } | ||
561 | |||
562 | evas_object_move(d.smt, x, y); | ||
563 | |||
564 | return; | ||
565 | } | ||
566 | |||
567 | /* increase smart object's size */ | ||
568 | if (strcmp(ev->keyname, "i") == 0) | ||
569 | { | ||
570 | Evas_Coord w, h; | ||
571 | |||
572 | evas_object_geometry_get(d.smt, NULL, NULL, &w, &h); | ||
573 | |||
574 | w *= 1.1; | ||
575 | h *= 1.1; | ||
576 | |||
577 | evas_object_resize(d.smt, w, h); | ||
578 | |||
579 | return; | ||
580 | } | ||
581 | |||
582 | /* decrease smart object's size */ | ||
583 | if (strcmp(ev->keyname, "d") == 0) | ||
584 | { | ||
585 | Evas_Coord w, h; | ||
586 | |||
587 | evas_object_geometry_get(d.smt, NULL, NULL, &w, &h); | ||
588 | |||
589 | w *= 0.9; | ||
590 | h *= 0.9; | ||
591 | |||
592 | evas_object_resize(d.smt, w, h); | ||
593 | |||
594 | return; | ||
595 | } | ||
596 | |||
597 | /* change smart object's clipper color */ | ||
598 | if (strcmp(ev->keyname, "c") == 0) | ||
599 | { | ||
600 | cur_color = (cur_color + 1) % 4; | ||
601 | |||
602 | evas_object_color_set( | ||
603 | d.clipper, clipper_colors[cur_color].r, clipper_colors[cur_color].g, | ||
604 | clipper_colors[cur_color].b, clipper_colors[cur_color].a); | ||
605 | |||
606 | fprintf (stderr, "Changing clipper's color to %s\n", | ||
607 | _index_to_color(cur_color)); | ||
608 | |||
609 | return; | ||
610 | } | ||
611 | } | ||
612 | |||
613 | static void /* callback on number of member objects changed */ | ||
614 | _on_example_smart_object_child_num_change(void *data __UNUSED__, | ||
615 | Evas_Object *obj __UNUSED__, | ||
616 | void *event_info) | ||
617 | { | ||
618 | fprintf(stdout, "Number of child members on our example smart" | ||
619 | " object changed to %d\n", (int)event_info); | ||
620 | } | ||
621 | |||
622 | int | ||
623 | main(void) | ||
624 | { | ||
625 | const Evas_Smart_Cb_Description **descriptions; | ||
626 | unsigned int count; | ||
627 | Eina_Bool ret; | ||
628 | |||
629 | srand(time(NULL)); | ||
630 | |||
631 | if (!ecore_evas_init()) | ||
632 | return EXIT_FAILURE; | ||
633 | |||
634 | /* this will give you a window with an Evas canvas under the first | ||
635 | * engine available */ | ||
636 | d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); | ||
637 | if (!d.ee) | ||
638 | goto error; | ||
639 | |||
640 | ecore_evas_callback_destroy_set(d.ee, _on_destroy); | ||
641 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
642 | ecore_evas_show(d.ee); | ||
643 | |||
644 | /* the canvas pointer, de facto */ | ||
645 | d.evas = ecore_evas_get(d.ee); | ||
646 | |||
647 | d.bg = evas_object_rectangle_add(d.evas); | ||
648 | evas_object_color_set(d.bg, 255, 255, 255, 255); | ||
649 | evas_object_move(d.bg, 0, 0); | ||
650 | evas_object_resize(d.bg, WIDTH, HEIGHT); | ||
651 | evas_object_show(d.bg); | ||
652 | |||
653 | d.smt = evas_smart_example_add(d.evas); | ||
654 | evas_object_move(d.smt, WIDTH / 4, HEIGHT / 4); | ||
655 | evas_object_resize(d.smt, WIDTH / 2, HEIGHT / 2); | ||
656 | evas_object_show(d.smt); | ||
657 | |||
658 | ret = evas_object_smart_type_check(d.smt, _evas_smart_example_type); | ||
659 | fprintf(stdout, "Adding smart object of type \"%s\" to the canvas: %s.\n", | ||
660 | _evas_smart_example_type, ret ? "success" : "failure"); | ||
661 | |||
662 | d.clipper = evas_object_smart_clipped_clipper_get(d.smt); | ||
663 | fprintf(stdout, "Checking if clipped smart object's clipper is a " | ||
664 | "\"static\" one: %s\n", evas_object_static_clip_get( | ||
665 | d.clipper) ? "yes" : "no"); | ||
666 | |||
667 | evas_object_color_set( | ||
668 | d.clipper, clipper_colors[cur_color].r, clipper_colors[cur_color].g, | ||
669 | clipper_colors[cur_color].b, clipper_colors[cur_color].a); | ||
670 | |||
671 | evas_object_smart_callbacks_descriptions_get( | ||
672 | d.smt, &descriptions, &count, NULL, NULL); | ||
673 | |||
674 | for (; *descriptions; descriptions++) | ||
675 | { | ||
676 | fprintf(stdout, "We've found a smart callback on the smart object!" | ||
677 | "\n\tname: %s\n\ttype: %s\n", (*descriptions)->name, | ||
678 | (*descriptions)->type); | ||
679 | |||
680 | if (strcmp((*descriptions)->type, "i")) continue; | ||
681 | /* we know we don't have other types of smart callbacks | ||
682 | * here, just playing with it */ | ||
683 | |||
684 | /* for now, we know the only one callback is the one | ||
685 | * reporting number of member objects changed on the | ||
686 | * example smart object */ | ||
687 | evas_object_smart_callback_add( | ||
688 | d.smt, (*descriptions)->name, | ||
689 | _on_example_smart_object_child_num_change, NULL); | ||
690 | } | ||
691 | |||
692 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
693 | evas_object_event_callback_add( | ||
694 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
695 | |||
696 | fprintf(stdout, commands); | ||
697 | ecore_main_loop_begin(); | ||
698 | |||
699 | ecore_evas_free(d.ee); | ||
700 | ecore_evas_shutdown(); | ||
701 | return 0; | ||
702 | |||
703 | error: | ||
704 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
705 | " up to ecore-evas for this example to run properly.\n"); | ||
706 | ecore_evas_shutdown(); | ||
707 | return -1; | ||
708 | } | ||
diff --git a/libraries/evas/src/examples/evas-stacking.c b/libraries/evas/src/examples/evas-stacking.c deleted file mode 100644 index 49fc819..0000000 --- a/libraries/evas/src/examples/evas-stacking.c +++ /dev/null | |||
@@ -1,329 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating <b>objects stacking</b> and | ||
3 | * <b>canvas layers</b>. | ||
4 | * | ||
5 | * You'll need at least one engine built for it (excluding the buffer | ||
6 | * one) and the png image loader also built. See stdout/stderr for | ||
7 | * output. | ||
8 | * | ||
9 | * @verbatim | ||
10 | * gcc -o evas-stacking evas-stacking.c `pkg-config --libs --cflags evas ecore ecore-evas edje` | ||
11 | * @endverbatim | ||
12 | */ | ||
13 | |||
14 | #ifdef HAVE_CONFIG_H | ||
15 | #include "config.h" | ||
16 | #else | ||
17 | |||
18 | #define __UNUSED__ | ||
19 | |||
20 | #endif | ||
21 | |||
22 | #include <Ecore.h> | ||
23 | #include <Ecore_Evas.h> | ||
24 | |||
25 | #include <stdlib.h> | ||
26 | #include <stdio.h> | ||
27 | #include <string.h> | ||
28 | |||
29 | #define WIDTH 320 | ||
30 | #define HEIGHT 320 | ||
31 | |||
32 | struct test_data | ||
33 | { | ||
34 | Ecore_Evas *ee; | ||
35 | Evas *canvas; | ||
36 | Evas_Object *bg; | ||
37 | Evas_Object *rects[3]; /* red, green, blue */ | ||
38 | int layers[3]; /* default, below it, above it */ | ||
39 | int cur_rect, cur_layer; | ||
40 | }; | ||
41 | |||
42 | static struct test_data d = {0}; | ||
43 | |||
44 | static const char *commands = \ | ||
45 | "commands are:\n" | ||
46 | "\tc - change the target rectangle to operate on\n" | ||
47 | "\ta - stack target rectangle one level above\n" | ||
48 | "\tb - stack target rectangle one level below\n" | ||
49 | "\tt - stack target rectangle up to the top of its layer\n" | ||
50 | "\tm - stack target rectangle down to the bottom of its layer\n" | ||
51 | "\tp - toggle target rectangle's 'pass events' property\n" | ||
52 | "\tr - toggle target rectangle's 'repeat events' property\n" | ||
53 | "\ts - print current stacking information\n" | ||
54 | "\tl - change background rectangle's layer\n" | ||
55 | "\th - print help\n"; | ||
56 | |||
57 | static void | ||
58 | _on_mouse_down(void *data __UNUSED__, | ||
59 | Evas *evas __UNUSED__, | ||
60 | Evas_Object *o, | ||
61 | void *einfo __UNUSED__) | ||
62 | { | ||
63 | fprintf(stdout, "Mouse down on rectangle %s!\n", evas_object_name_get(o)); | ||
64 | } | ||
65 | |||
66 | /* here just to keep our example's window size and background image's | ||
67 | * size in synchrony */ | ||
68 | static void | ||
69 | _canvas_resize_cb(Ecore_Evas *ee) | ||
70 | { | ||
71 | int w, h; | ||
72 | |||
73 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
74 | evas_object_resize(d.bg, w, h); | ||
75 | } | ||
76 | |||
77 | /* use the following commands to interact with this example - 'h' is | ||
78 | * the key for help */ | ||
79 | static void | ||
80 | _on_keydown(void *data __UNUSED__, | ||
81 | Evas *evas __UNUSED__, | ||
82 | Evas_Object *o __UNUSED__, | ||
83 | void *einfo) | ||
84 | { | ||
85 | Evas_Event_Key_Down *ev = einfo; | ||
86 | const char *name = evas_object_name_get(d.rects[d.cur_rect]); | ||
87 | |||
88 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
89 | { | ||
90 | fprintf(stdout, commands); | ||
91 | return; | ||
92 | } | ||
93 | |||
94 | if (strcmp(ev->keyname, "s") == 0) /* get status of the | ||
95 | * rectangles WRT size | ||
96 | * hints */ | ||
97 | { | ||
98 | Evas_Object *rect; | ||
99 | |||
100 | fprintf(stdout, "Order of stacking, from top to bottom, is: "); | ||
101 | |||
102 | rect = evas_object_top_get(evas); | ||
103 | fprintf(stdout, "%s", evas_object_name_get(rect)); | ||
104 | |||
105 | rect = evas_object_below_get(rect); | ||
106 | while (rect) | ||
107 | { | ||
108 | fprintf(stdout, ", %s", evas_object_name_get(rect)); | ||
109 | rect = evas_object_below_get(rect); | ||
110 | } | ||
111 | |||
112 | fprintf(stdout, ".\n"); | ||
113 | |||
114 | fprintf(stdout, "Current target rectangle is %s\n", | ||
115 | evas_object_name_get(d.rects[d.cur_rect])); | ||
116 | |||
117 | fprintf(stdout, "Background rectangle's layer is %d\n", | ||
118 | evas_object_layer_get(d.bg)); | ||
119 | |||
120 | return; | ||
121 | } | ||
122 | |||
123 | if (strcmp(ev->keyname, "l") == 0) /* change background rectangle's layer */ | ||
124 | { | ||
125 | d.cur_layer = (d.cur_layer + 1) % 3; | ||
126 | evas_object_layer_set(d.bg, d.layers[d.cur_layer]); | ||
127 | |||
128 | fprintf(stdout, "Changing background rectangle's layer to %d\n", | ||
129 | d.layers[d.cur_layer]); | ||
130 | return; | ||
131 | } | ||
132 | |||
133 | if (strcmp(ev->keyname, "c") == 0) /* change rectangle to operate on */ | ||
134 | { | ||
135 | d.cur_rect = (d.cur_rect + 1) % 3; | ||
136 | |||
137 | fprintf(stdout, "Changing target rectangle to the %s one\n", | ||
138 | evas_object_name_get(d.rects[d.cur_rect])); | ||
139 | return; | ||
140 | } | ||
141 | |||
142 | if (strcmp(ev->keyname, "t") == 0) /* bring target to top */ | ||
143 | { | ||
144 | Evas_Object *neighbour; | ||
145 | |||
146 | evas_object_raise(d.rects[d.cur_rect]); | ||
147 | |||
148 | fprintf(stdout, "%s rectangle was re-stacked to the top if its layer\n", | ||
149 | name); | ||
150 | |||
151 | neighbour = evas_object_below_get(d.rects[d.cur_rect]); | ||
152 | fprintf(stdout, "Below of %s rect is %s\n", name, | ||
153 | neighbour ? evas_object_name_get(neighbour) : "no object"); | ||
154 | return; | ||
155 | } | ||
156 | |||
157 | if (strcmp(ev->keyname, "m") == 0) /* bring target to bottom */ | ||
158 | { | ||
159 | Evas_Object *neighbour; | ||
160 | |||
161 | evas_object_lower(d.rects[d.cur_rect]); | ||
162 | |||
163 | fprintf(stdout, | ||
164 | "%s rectangle was re-stacked to the bottom if its layer\n", | ||
165 | name); | ||
166 | |||
167 | neighbour = evas_object_below_get(d.rects[d.cur_rect]); | ||
168 | fprintf(stdout, "Below of %s rect is %s\n", name, | ||
169 | neighbour ? evas_object_name_get(neighbour) : "no object"); | ||
170 | return; | ||
171 | } | ||
172 | |||
173 | if (strcmp(ev->keyname, "p") == 0) /* toggle pass events */ | ||
174 | { | ||
175 | Eina_Bool pass = evas_object_pass_events_get(d.rects[d.cur_rect]); | ||
176 | |||
177 | evas_object_pass_events_set(d.rects[d.cur_rect], !pass); | ||
178 | |||
179 | fprintf(stdout, "%s rectangle is now set to%s pass (ignore) events\n", | ||
180 | name, pass ? " NOT" : ""); | ||
181 | |||
182 | return; | ||
183 | } | ||
184 | |||
185 | if (strcmp(ev->keyname, "r") == 0) /* toggle repeat events */ | ||
186 | { | ||
187 | Eina_Bool repeat = evas_object_repeat_events_get(d.rects[d.cur_rect]); | ||
188 | |||
189 | evas_object_repeat_events_set(d.rects[d.cur_rect], !repeat); | ||
190 | |||
191 | fprintf(stdout, "%s rectangle is now set to%s repeat events\n", | ||
192 | name, repeat ? " NOT" : ""); | ||
193 | |||
194 | return; | ||
195 | } | ||
196 | |||
197 | if (strcmp(ev->keyname, "a") == 0) /* stack target above */ | ||
198 | { | ||
199 | Evas_Object *neighbour = evas_object_above_get(d.rects[d.cur_rect]); | ||
200 | |||
201 | if (!neighbour || (evas_object_layer_get(d.rects[d.cur_rect]) != | ||
202 | evas_object_layer_get(neighbour))) | ||
203 | return; | ||
204 | |||
205 | evas_object_stack_above(d.rects[d.cur_rect], neighbour); | ||
206 | |||
207 | fprintf(stdout, "%s rectangle was re-stacked one level above\n", name); | ||
208 | |||
209 | neighbour = evas_object_above_get(d.rects[d.cur_rect]); | ||
210 | fprintf(stdout, "Above of %s rect is %s\n", name, | ||
211 | neighbour ? evas_object_name_get(neighbour) : "no object"); | ||
212 | |||
213 | neighbour = evas_object_below_get(d.rects[d.cur_rect]); | ||
214 | fprintf(stdout, "Below of %s rect is %s\n", name, | ||
215 | neighbour ? evas_object_name_get(neighbour) : "no object"); | ||
216 | return; | ||
217 | } | ||
218 | |||
219 | if (strcmp(ev->keyname, "b") == 0) /* stack target below */ | ||
220 | { | ||
221 | Evas_Object *neighbour = evas_object_below_get(d.rects[d.cur_rect]); | ||
222 | |||
223 | if (!neighbour || (evas_object_layer_get(d.rects[d.cur_rect]) != | ||
224 | evas_object_layer_get(neighbour))) | ||
225 | return; | ||
226 | |||
227 | evas_object_stack_below(d.rects[d.cur_rect], neighbour); | ||
228 | |||
229 | fprintf(stdout, "%s rectangle was re-stacked one level below\n", name); | ||
230 | |||
231 | neighbour = evas_object_above_get(d.rects[d.cur_rect]); | ||
232 | fprintf(stdout, "Above of %s rect is %s\n", name, | ||
233 | neighbour ? evas_object_name_get(neighbour) : "no object"); | ||
234 | |||
235 | neighbour = evas_object_below_get(d.rects[d.cur_rect]); | ||
236 | |||
237 | fprintf(stdout, "Below of %s rect is %s\n", name, | ||
238 | neighbour ? evas_object_name_get(neighbour) : "no object"); | ||
239 | return; | ||
240 | } | ||
241 | } | ||
242 | |||
243 | static void | ||
244 | _on_destroy(Ecore_Evas *ee __UNUSED__) | ||
245 | { | ||
246 | ecore_main_loop_quit(); | ||
247 | } | ||
248 | |||
249 | int | ||
250 | main(void) | ||
251 | { | ||
252 | if (!ecore_evas_init()) | ||
253 | return EXIT_FAILURE; | ||
254 | |||
255 | /* this will give you a window with an Evas canvas under the first | ||
256 | * engine available */ | ||
257 | d.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
258 | if (!d.ee) | ||
259 | goto error; | ||
260 | |||
261 | ecore_evas_callback_destroy_set(d.ee, _on_destroy); | ||
262 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
263 | ecore_evas_show(d.ee); | ||
264 | |||
265 | /* the canvas pointer, de facto */ | ||
266 | d.canvas = ecore_evas_get(d.ee); | ||
267 | |||
268 | d.bg = evas_object_rectangle_add(d.canvas); | ||
269 | evas_object_name_set(d.bg, "background"); /* white bg */ | ||
270 | evas_object_color_set(d.bg, 255, 255, 255, 255); | ||
271 | evas_object_move(d.bg, 0, 0); | ||
272 | evas_object_resize(d.bg, WIDTH, HEIGHT); | ||
273 | |||
274 | d.layers[0] = evas_object_layer_get(d.bg); | ||
275 | d.layers[1] = d.layers[0] - 1; | ||
276 | d.layers[2] = d.layers[0] + 1; | ||
277 | |||
278 | d.cur_layer = 1; | ||
279 | evas_object_layer_set(d.bg, d.layers[d.cur_layer]); /* let's start with it | ||
280 | * below the default | ||
281 | * layer */ | ||
282 | |||
283 | evas_object_show(d.bg); | ||
284 | |||
285 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
286 | evas_object_event_callback_add( | ||
287 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
288 | |||
289 | d.rects[2] = evas_object_rectangle_add(d.canvas); | ||
290 | evas_object_name_set(d.rects[2], "blue"); | ||
291 | evas_object_color_set(d.rects[2], 0, 0, 255, 255); | ||
292 | |||
293 | evas_object_resize(d.rects[2], WIDTH / 2.2, WIDTH / 2.2); | ||
294 | evas_object_move(d.rects[2], WIDTH / 6, WIDTH / 4.5); | ||
295 | evas_object_show(d.rects[2]); | ||
296 | evas_object_event_callback_add( | ||
297 | d.rects[2], EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, NULL); | ||
298 | |||
299 | d.rects[1] = evas_object_rectangle_add(d.canvas); | ||
300 | evas_object_name_set(d.rects[1], "green"); | ||
301 | evas_object_color_set(d.rects[1], 0, 255, 0, 255); | ||
302 | |||
303 | evas_object_resize(d.rects[1], WIDTH / 2.2, WIDTH / 2.2); | ||
304 | evas_object_move(d.rects[1], WIDTH / 2.5, WIDTH / 7); | ||
305 | evas_object_show(d.rects[1]); | ||
306 | evas_object_event_callback_add( | ||
307 | d.rects[1], EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, NULL); | ||
308 | |||
309 | d.rects[0] = evas_object_rectangle_add(d.canvas); | ||
310 | evas_object_name_set(d.rects[0], "red"); | ||
311 | evas_object_color_set(d.rects[0], 255, 0, 0, 255); | ||
312 | |||
313 | evas_object_resize(d.rects[0], WIDTH / 2.2, WIDTH / 2.2); | ||
314 | evas_object_move(d.rects[0], WIDTH / 3, WIDTH / 2.5); | ||
315 | evas_object_show(d.rects[0]); | ||
316 | evas_object_event_callback_add( | ||
317 | d.rects[0], EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, NULL); | ||
318 | |||
319 | fprintf(stdout, commands); | ||
320 | ecore_main_loop_begin(); | ||
321 | |||
322 | ecore_evas_shutdown(); | ||
323 | return 0; | ||
324 | |||
325 | error: | ||
326 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
327 | " up to ecore-evas for this example to run properly.\n"); | ||
328 | return -1; | ||
329 | } | ||
diff --git a/libraries/evas/src/examples/evas-text.c b/libraries/evas/src/examples/evas-text.c deleted file mode 100644 index ba55662..0000000 --- a/libraries/evas/src/examples/evas-text.c +++ /dev/null | |||
@@ -1,411 +0,0 @@ | |||
1 | /** | ||
2 | * Simple Evas example illustrating text objects | ||
3 | * | ||
4 | * You'll need at least one engine built for it (excluding the buffer | ||
5 | * one). See stdout/stderr for output. | ||
6 | * | ||
7 | * @verbatim | ||
8 | * gcc -o evas-text evas-text.c `pkg-config --libs --cflags evas ecore ecore-evas` | ||
9 | * @endverbatim | ||
10 | */ | ||
11 | |||
12 | #ifdef HAVE_CONFIG_H | ||
13 | |||
14 | #include "config.h" | ||
15 | #else | ||
16 | |||
17 | #define PACKAGE_EXAMPLES_DIR "." | ||
18 | #define __UNUSED__ | ||
19 | |||
20 | #endif | ||
21 | |||
22 | #include <Ecore.h> | ||
23 | #include <Ecore_Evas.h> | ||
24 | #include <stdio.h> | ||
25 | #include <errno.h> | ||
26 | |||
27 | #define WIDTH (320) | ||
28 | #define HEIGHT (240) | ||
29 | |||
30 | #define GREY {190, 190, 190, 255} | ||
31 | #define BLACK {0, 0, 0, 255} | ||
32 | #define WHITE {255, 255, 255, 255} | ||
33 | #define RED {255, 0, 0, 255} | ||
34 | #define GREEN {0, 255, 0, 255} | ||
35 | #define BLUE {0, 0, 255, 255} | ||
36 | |||
37 | #define POINTER_CYCLE(_ptr, _array) \ | ||
38 | do \ | ||
39 | { \ | ||
40 | if ((unsigned)(((void *)(_ptr)) - ((void *)(_array))) >= \ | ||
41 | sizeof(_array)) \ | ||
42 | _ptr = _array; \ | ||
43 | } \ | ||
44 | while(0) | ||
45 | |||
46 | static const char *commands = \ | ||
47 | "commands are:\n" | ||
48 | "\tt - change text's current style\n" | ||
49 | "\tz - change text's font size\n" | ||
50 | "\tf - change text's font family\n" | ||
51 | "\tb - change text's base color\n" | ||
52 | "\ts - change text's \'shadow\' color\n" | ||
53 | "\to - change text's \'outline\' color\n" | ||
54 | "\tw - change text's \'glow\' color\n" | ||
55 | "\tg - change text's \'glow 2\' color\n" | ||
56 | "\th - print help\n"; | ||
57 | |||
58 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
59 | |||
60 | struct color_tuple | ||
61 | { | ||
62 | int r, g, b, a; | ||
63 | }; | ||
64 | |||
65 | struct text_preset_data | ||
66 | { | ||
67 | const char **font_ptr; | ||
68 | const char *font[3]; | ||
69 | |||
70 | struct color_tuple *text_ptr; | ||
71 | struct color_tuple text[6]; | ||
72 | |||
73 | struct color_tuple *shadow_ptr; | ||
74 | struct color_tuple shadow[4]; | ||
75 | |||
76 | struct color_tuple *outline_ptr; | ||
77 | struct color_tuple outline[4]; | ||
78 | |||
79 | struct color_tuple *glow_ptr; | ||
80 | struct color_tuple glow[4]; | ||
81 | |||
82 | struct color_tuple *glow2_ptr; | ||
83 | struct color_tuple glow2[4]; | ||
84 | }; | ||
85 | |||
86 | struct test_data | ||
87 | { | ||
88 | Ecore_Evas *ee; | ||
89 | Evas *evas; | ||
90 | struct text_preset_data t_data; | ||
91 | Evas_Object *text, *bg, *border; | ||
92 | }; | ||
93 | |||
94 | static struct test_data d = {0}; | ||
95 | |||
96 | static void | ||
97 | _on_destroy(Ecore_Evas *ee __UNUSED__) | ||
98 | { | ||
99 | ecore_main_loop_quit(); | ||
100 | } | ||
101 | |||
102 | /* here just to keep our example's window size and background image's | ||
103 | * size in synchrony */ | ||
104 | static void | ||
105 | _canvas_resize_cb(Ecore_Evas *ee) | ||
106 | { | ||
107 | int w, h; | ||
108 | |||
109 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
110 | evas_object_resize(d.bg, w, h); | ||
111 | } | ||
112 | |||
113 | static const char * | ||
114 | _text_style_type_to_str(Evas_Text_Style_Type mode) | ||
115 | { | ||
116 | switch (mode) | ||
117 | { | ||
118 | case EVAS_TEXT_STYLE_PLAIN: | ||
119 | return "plain"; | ||
120 | |||
121 | case EVAS_TEXT_STYLE_SHADOW: | ||
122 | return "shadow"; | ||
123 | |||
124 | case EVAS_TEXT_STYLE_OUTLINE: | ||
125 | return "outline"; | ||
126 | |||
127 | case EVAS_TEXT_STYLE_SOFT_OUTLINE: | ||
128 | return "soft outline"; | ||
129 | |||
130 | case EVAS_TEXT_STYLE_GLOW: | ||
131 | return "glow"; | ||
132 | |||
133 | case EVAS_TEXT_STYLE_OUTLINE_SHADOW: | ||
134 | return "outline shadow"; | ||
135 | |||
136 | case EVAS_TEXT_STYLE_FAR_SHADOW: | ||
137 | return "far shadow"; | ||
138 | |||
139 | case EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW: | ||
140 | return "outline soft shadow"; | ||
141 | |||
142 | case EVAS_TEXT_STYLE_SOFT_SHADOW: | ||
143 | return "soft shadow"; | ||
144 | |||
145 | case EVAS_TEXT_STYLE_FAR_SOFT_SHADOW: | ||
146 | return "far soft shadow"; | ||
147 | |||
148 | default: | ||
149 | return "invalid"; | ||
150 | } | ||
151 | } | ||
152 | |||
153 | static void | ||
154 | _on_keydown(void *data __UNUSED__, | ||
155 | Evas *evas __UNUSED__, | ||
156 | Evas_Object *o __UNUSED__, | ||
157 | void *einfo) | ||
158 | { | ||
159 | Evas_Event_Key_Down *ev = einfo; | ||
160 | |||
161 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
162 | { | ||
163 | fprintf(stdout, commands); | ||
164 | return; | ||
165 | } | ||
166 | |||
167 | if (strcmp(ev->keyname, "t") == 0) /* change text's current style */ | ||
168 | { | ||
169 | Evas_Text_Style_Type type = evas_object_text_style_get(d.text); | ||
170 | |||
171 | type = (type + 1) % 10; | ||
172 | |||
173 | evas_object_text_style_set(d.text, type); | ||
174 | |||
175 | fprintf(stdout, "Changing text's style to \'%s\'\n", | ||
176 | _text_style_type_to_str(type)); | ||
177 | |||
178 | return; | ||
179 | } | ||
180 | |||
181 | if (strcmp(ev->keyname, "f") == 0) /* change text's font */ | ||
182 | { | ||
183 | int sz; | ||
184 | |||
185 | (d.t_data.font_ptr)++; | ||
186 | |||
187 | evas_object_text_font_get(d.text, NULL, &sz); | ||
188 | |||
189 | POINTER_CYCLE(d.t_data.font_ptr, d.t_data.font); | ||
190 | |||
191 | evas_object_text_font_set(d.text, *d.t_data.font_ptr, sz); | ||
192 | |||
193 | fprintf(stdout, "Changing text's font to %s\n", *d.t_data.font_ptr); | ||
194 | |||
195 | return; | ||
196 | } | ||
197 | |||
198 | if (strcmp(ev->keyname, "b") == 0) /* change text's base color */ | ||
199 | { | ||
200 | (d.t_data.text_ptr)++; | ||
201 | |||
202 | POINTER_CYCLE(d.t_data.text_ptr, d.t_data.text); | ||
203 | |||
204 | evas_object_color_set( | ||
205 | d.text, d.t_data.text_ptr->r, d.t_data.text_ptr->g, | ||
206 | d.t_data.text_ptr->b, d.t_data.text_ptr->a); | ||
207 | |||
208 | fprintf(stdout, "Changing base color for text to (%d, %d, %d, %d)\n", | ||
209 | d.t_data.text_ptr->r, d.t_data.text_ptr->g, | ||
210 | d.t_data.text_ptr->b, d.t_data.text_ptr->a); | ||
211 | |||
212 | return; | ||
213 | } | ||
214 | |||
215 | if (strcmp(ev->keyname, "g") == 0) /* change text's glow 2 color */ | ||
216 | { | ||
217 | (d.t_data.glow2_ptr)++; | ||
218 | |||
219 | POINTER_CYCLE(d.t_data.glow2_ptr, d.t_data.glow2); | ||
220 | |||
221 | evas_object_text_glow2_color_set( | ||
222 | d.text, d.t_data.glow2_ptr->r, d.t_data.glow2_ptr->g, | ||
223 | d.t_data.glow2_ptr->b, d.t_data.glow2_ptr->a); | ||
224 | |||
225 | fprintf(stdout, "Changing glow 2 color for text to (%d, %d, %d, %d)\n", | ||
226 | d.t_data.glow2_ptr->r, d.t_data.glow2_ptr->g, | ||
227 | d.t_data.glow2_ptr->b, d.t_data.glow2_ptr->a); | ||
228 | |||
229 | return; | ||
230 | } | ||
231 | |||
232 | if (strcmp(ev->keyname, "w") == 0) /* change text's glow color */ | ||
233 | { | ||
234 | (d.t_data.glow_ptr)++; | ||
235 | |||
236 | POINTER_CYCLE(d.t_data.glow_ptr, d.t_data.glow); | ||
237 | |||
238 | evas_object_text_glow_color_set( | ||
239 | d.text, d.t_data.glow_ptr->r, d.t_data.glow_ptr->g, | ||
240 | d.t_data.glow_ptr->b, d.t_data.glow_ptr->a); | ||
241 | |||
242 | fprintf(stdout, "Changing glow color for text to (%d, %d, %d, %d)\n", | ||
243 | d.t_data.glow_ptr->r, d.t_data.glow_ptr->g, | ||
244 | d.t_data.glow_ptr->b, d.t_data.glow_ptr->a); | ||
245 | |||
246 | return; | ||
247 | } | ||
248 | |||
249 | if (strcmp(ev->keyname, "o") == 0) /* change text's outline color */ | ||
250 | { | ||
251 | (d.t_data.outline_ptr)++; | ||
252 | |||
253 | POINTER_CYCLE(d.t_data.outline_ptr, d.t_data.outline); | ||
254 | |||
255 | evas_object_text_outline_color_set( | ||
256 | d.text, d.t_data.outline_ptr->r, d.t_data.outline_ptr->g, | ||
257 | d.t_data.outline_ptr->b, d.t_data.outline_ptr->a); | ||
258 | |||
259 | fprintf(stdout, "Changing outline color for text to (%d, %d, %d, %d)\n", | ||
260 | d.t_data.outline_ptr->r, d.t_data.outline_ptr->g, | ||
261 | d.t_data.outline_ptr->b, d.t_data.outline_ptr->a); | ||
262 | |||
263 | return; | ||
264 | } | ||
265 | |||
266 | if (strcmp(ev->keyname, "s") == 0) /* change text's shadow color */ | ||
267 | { | ||
268 | (d.t_data.shadow_ptr)++; | ||
269 | |||
270 | POINTER_CYCLE(d.t_data.shadow_ptr, d.t_data.shadow); | ||
271 | |||
272 | evas_object_text_shadow_color_set( | ||
273 | d.text, d.t_data.shadow_ptr->r, d.t_data.shadow_ptr->g, | ||
274 | d.t_data.shadow_ptr->b, d.t_data.shadow_ptr->a); | ||
275 | |||
276 | fprintf(stdout, "Changing shadow color for text to (%d, %d, %d, %d)\n", | ||
277 | d.t_data.shadow_ptr->r, d.t_data.shadow_ptr->g, | ||
278 | d.t_data.shadow_ptr->b, d.t_data.shadow_ptr->a); | ||
279 | |||
280 | return; | ||
281 | } | ||
282 | |||
283 | if (strcmp(ev->keyname, "z") == 0) /* change text's font size */ | ||
284 | { | ||
285 | const char *font; | ||
286 | int size; | ||
287 | |||
288 | evas_object_text_font_get(d.text, &font, &size); | ||
289 | |||
290 | size = (size + 10) % 50; | ||
291 | if (!size) size = 10; | ||
292 | |||
293 | evas_object_text_font_set(d.text, font, size); | ||
294 | |||
295 | fprintf(stdout, "Changing text's font size to %d\n", size); | ||
296 | |||
297 | return; | ||
298 | } | ||
299 | } | ||
300 | |||
301 | int | ||
302 | main(void) | ||
303 | { | ||
304 | int size; | ||
305 | const char *font; | ||
306 | |||
307 | if (!ecore_evas_init()) | ||
308 | return EXIT_FAILURE; | ||
309 | |||
310 | /* init values one is going to cycle through while running this | ||
311 | * example */ | ||
312 | struct text_preset_data init_data = | ||
313 | { | ||
314 | .font = {"DejaVu", "Courier", "Utopia"}, | ||
315 | .text = {BLACK, WHITE, GREY, RED, GREEN, BLUE}, | ||
316 | .shadow = {WHITE, BLUE, GREEN, RED}, | ||
317 | .outline = {WHITE, RED, GREEN, BLUE}, | ||
318 | .glow = {WHITE, BLUE, GREEN, RED}, | ||
319 | .glow2 = {WHITE, RED, BLUE, GREEN} | ||
320 | }; | ||
321 | |||
322 | d.t_data = init_data; | ||
323 | d.t_data.font_ptr = d.t_data.font; | ||
324 | d.t_data.text_ptr = d.t_data.text; | ||
325 | d.t_data.glow_ptr = d.t_data.glow; | ||
326 | d.t_data.glow2_ptr = d.t_data.glow2; | ||
327 | d.t_data.outline_ptr = d.t_data.outline; | ||
328 | d.t_data.shadow_ptr = d.t_data.shadow; | ||
329 | |||
330 | /* this will give you a window with an Evas canvas under the first | ||
331 | * engine available */ | ||
332 | d.ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); | ||
333 | if (!d.ee) | ||
334 | goto error; | ||
335 | |||
336 | ecore_evas_callback_destroy_set(d.ee, _on_destroy); | ||
337 | ecore_evas_callback_resize_set(d.ee, _canvas_resize_cb); | ||
338 | ecore_evas_show(d.ee); | ||
339 | |||
340 | /* the canvas pointer, de facto */ | ||
341 | d.evas = ecore_evas_get(d.ee); | ||
342 | |||
343 | d.bg = evas_object_rectangle_add(d.evas); | ||
344 | evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */ | ||
345 | evas_object_move(d.bg, 0, 0); /* at canvas' origin */ | ||
346 | evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
347 | evas_object_show(d.bg); | ||
348 | |||
349 | evas_object_focus_set(d.bg, EINA_TRUE); | ||
350 | evas_object_event_callback_add( | ||
351 | d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
352 | |||
353 | d.text = evas_object_text_add(d.evas); | ||
354 | evas_object_text_style_set(d.text, EVAS_TEXT_STYLE_PLAIN); | ||
355 | |||
356 | /* let the pre-set thingies be enforced */ | ||
357 | evas_object_color_set( | ||
358 | d.text, d.t_data.text_ptr->r, d.t_data.text_ptr->g, | ||
359 | d.t_data.text_ptr->b, d.t_data.text_ptr->a); | ||
360 | |||
361 | evas_object_text_glow_color_set( | ||
362 | d.text, d.t_data.glow_ptr->r, d.t_data.glow_ptr->g, | ||
363 | d.t_data.glow_ptr->b, d.t_data.glow_ptr->a); | ||
364 | |||
365 | evas_object_text_glow2_color_set( | ||
366 | d.text, d.t_data.glow2_ptr->r, d.t_data.glow2_ptr->g, | ||
367 | d.t_data.glow2_ptr->b, d.t_data.glow2_ptr->a); | ||
368 | |||
369 | evas_object_text_outline_color_set( | ||
370 | d.text, d.t_data.outline_ptr->r, d.t_data.outline_ptr->g, | ||
371 | d.t_data.outline_ptr->b, d.t_data.outline_ptr->a); | ||
372 | |||
373 | evas_object_text_shadow_color_set( | ||
374 | d.text, d.t_data.shadow_ptr->r, d.t_data.shadow_ptr->g, | ||
375 | d.t_data.shadow_ptr->b, d.t_data.shadow_ptr->a); | ||
376 | |||
377 | evas_object_text_font_set(d.text, *d.t_data.font_ptr, 30); | ||
378 | evas_object_text_text_set(d.text, "sample text"); | ||
379 | |||
380 | evas_object_resize(d.text, (3 * WIDTH) / 4, HEIGHT / 4); | ||
381 | evas_object_move(d.text, WIDTH / 8, (3 * HEIGHT) / 8); | ||
382 | evas_object_show(d.text); | ||
383 | |||
384 | evas_object_text_font_get(d.text, &font, &size); | ||
385 | fprintf(stdout, "Adding text object with font %s, size %d\n", font, size); | ||
386 | |||
387 | /* this is a border around the text object above, here just to | ||
388 | * emphasize its geometry */ | ||
389 | d.border = evas_object_image_filled_add(d.evas); | ||
390 | evas_object_image_file_set(d.border, border_img_path, NULL); | ||
391 | evas_object_image_border_set(d.border, 3, 3, 3, 3); | ||
392 | evas_object_image_border_center_fill_set(d.border, EVAS_BORDER_FILL_NONE); | ||
393 | |||
394 | evas_object_resize(d.border, ((3 * WIDTH) / 4) + 3, (HEIGHT / 4) + 3); | ||
395 | evas_object_move(d.border, (WIDTH / 8) - 3, ((3 * HEIGHT) / 8) - 3); | ||
396 | evas_object_show(d.border); | ||
397 | |||
398 | fprintf(stdout, commands); | ||
399 | ecore_main_loop_begin(); | ||
400 | |||
401 | ecore_evas_free(d.ee); | ||
402 | ecore_evas_shutdown(); | ||
403 | return 0; | ||
404 | |||
405 | error: | ||
406 | fprintf(stderr, "you got to have at least one evas engine built and linked" | ||
407 | " up to ecore-evas for this example to run properly.\n"); | ||
408 | ecore_evas_shutdown(); | ||
409 | return -1; | ||
410 | } | ||
411 | |||
diff --git a/libraries/evas/src/examples/im1.png b/libraries/evas/src/examples/im1.png deleted file mode 100644 index aa37869..0000000 --- a/libraries/evas/src/examples/im1.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/libraries/evas/src/examples/red.png b/libraries/evas/src/examples/red.png deleted file mode 100644 index dd03528..0000000 --- a/libraries/evas/src/examples/red.png +++ /dev/null | |||
Binary files differ | |||