diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/ecore/src/examples | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/ecore/src/examples')
34 files changed, 4980 insertions, 0 deletions
diff --git a/libraries/ecore/src/examples/Makefile.am b/libraries/ecore/src/examples/Makefile.am new file mode 100644 index 0000000..63748a5 --- /dev/null +++ b/libraries/ecore/src/examples/Makefile.am | |||
@@ -0,0 +1,111 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | ||
2 | |||
3 | pkglibdir = $(datadir)/$(PACKAGE)/examples | ||
4 | |||
5 | filesdir = $(datadir)/$(PACKAGE)/examples | ||
6 | files_DATA = | ||
7 | |||
8 | AM_CPPFLAGS = \ | ||
9 | -I. \ | ||
10 | -I$(top_srcdir)/src/lib/ecore \ | ||
11 | -I$(top_srcdir)/src/lib/ecore_evas \ | ||
12 | -I$(top_srcdir)/src/lib/ecore_input \ | ||
13 | -I$(top_srcdir)/src/lib/ecore_con \ | ||
14 | -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ | ||
15 | @GLIB_CFLAGS@ @EVIL_CFLAGS@ @EVAS_CFLAGS@ @EINA_CFLAGS@ @WIN32_CPPFLAGS@ @EFL_ECORE_BUILD@ | ||
16 | |||
17 | ECOREBASELDADD = \ | ||
18 | $(top_builddir)/src/lib/ecore/libecore.la \ | ||
19 | $(top_builddir)/src/lib/ecore_evas/libecore_evas.la \ | ||
20 | @dlopen_libs@ @EINA_LIBS@ @EVIL_LIBS@ @EVAS_LIBS@ @GLIB_LIBS@ @WIN32_LIBS@ @LTLIBINTL@ @EFL_PTHREAD_LIBS@ @rt_libs@ -lm | ||
21 | |||
22 | |||
23 | LDADD = \ | ||
24 | $(ECOREBASELDADD) | ||
25 | |||
26 | SRCS = \ | ||
27 | ecore_animator_example.c \ | ||
28 | ecore_fd_handler_example.c \ | ||
29 | ecore_poller_example.c \ | ||
30 | ecore_event_example.c \ | ||
31 | ecore_idler_example.c \ | ||
32 | ecore_timer_example.c \ | ||
33 | ecore_time_functions_example.c \ | ||
34 | ecore_job_example.c \ | ||
35 | ecore_con_lookup_example.c \ | ||
36 | ecore_con_url_headers_example.c \ | ||
37 | ecore_con_url_download_example.c \ | ||
38 | ecore_con_url_cookies_example.c \ | ||
39 | ecore_con_server_simple_example.c \ | ||
40 | ecore_con_server_http_example.c \ | ||
41 | ecore_con_client_simple_example.c \ | ||
42 | ecore_client_bench.c \ | ||
43 | ecore_server_bench.c \ | ||
44 | ecore_con_client_example.c \ | ||
45 | ecore_con_server_example.c \ | ||
46 | ecore_fd_handler_gnutls_example.c \ | ||
47 | ecore_file_download_example.c \ | ||
48 | ecore_pipe_simple_example.c \ | ||
49 | ecore_pipe_gstreamer_example.c \ | ||
50 | ecore_thread_example.c \ | ||
51 | ecore_evas_callbacks.c \ | ||
52 | ecore_evas_window_sizes_example.c \ | ||
53 | ecore_evas_object_example.c \ | ||
54 | ecore_evas_basics_example.c \ | ||
55 | ecore_evas_buffer_example_01.c \ | ||
56 | ecore_evas_buffer_example_02.c \ | ||
57 | ecore_evas_ews_example.c | ||
58 | |||
59 | EXTRA_DIST = $(SRCS) \ | ||
60 | $(srcdir)/red.png | ||
61 | |||
62 | pkglib_PROGRAMS = | ||
63 | |||
64 | if EFL_INSTALL_EXAMPLES | ||
65 | files_DATA += $(SRCS) \ | ||
66 | $(srcdir)/red.png | ||
67 | endif | ||
68 | |||
69 | if EFL_BUILD_EXAMPLES | ||
70 | pkglib_PROGRAMS += \ | ||
71 | ecore_animator_example \ | ||
72 | ecore_fd_handler_example \ | ||
73 | ecore_poller_example \ | ||
74 | ecore_event_example \ | ||
75 | ecore_idler_example \ | ||
76 | ecore_job_example \ | ||
77 | ecore_timer_example \ | ||
78 | ecore_time_functions_example \ | ||
79 | ecore_pipe_simple_example \ | ||
80 | ecore_con_lookup_example \ | ||
81 | ecore_con_url_headers_example \ | ||
82 | ecore_con_url_download_example \ | ||
83 | ecore_con_url_cookies_example \ | ||
84 | ecore_con_server_simple_example \ | ||
85 | ecore_con_server_http_example \ | ||
86 | ecore_con_client_simple_example \ | ||
87 | ecore_thread_example \ | ||
88 | ecore_evas_callbacks \ | ||
89 | ecore_evas_window_sizes_example \ | ||
90 | ecore_evas_object_example \ | ||
91 | ecore_evas_basics_example \ | ||
92 | ecore_evas_buffer_example_01 \ | ||
93 | ecore_evas_buffer_example_02 \ | ||
94 | ecore_evas_ews_example \ | ||
95 | ecore_client_bench \ | ||
96 | ecore_server_bench | ||
97 | |||
98 | ecore_con_lookup_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
99 | ecore_con_url_headers_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
100 | ecore_con_url_download_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
101 | ecore_con_url_cookies_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
102 | ecore_con_server_simple_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
103 | ecore_con_server_http_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
104 | ecore_con_client_simple_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
105 | ecore_evas_window_sizes_example_LDADD = $(ECOREBASELDADD) @EVAS_LIBS@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
106 | ecore_evas_buffer_example_01_LDADD = $(ECOREBASELDADD) @EVAS_LIBS@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
107 | ecore_evas_buffer_example_02_LDADD = $(ECOREBASELDADD) @EVAS_LIBS@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
108 | ecore_client_bench_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
109 | ecore_server_bench_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
110 | |||
111 | endif | ||
diff --git a/libraries/ecore/src/examples/Makefile.in b/libraries/ecore/src/examples/Makefile.in new file mode 100644 index 0000000..dc38e0d --- /dev/null +++ b/libraries/ecore/src/examples/Makefile.in | |||
@@ -0,0 +1,1192 @@ | |||
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 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
24 | install_sh_DATA = $(install_sh) -c -m 644 | ||
25 | install_sh_PROGRAM = $(install_sh) -c | ||
26 | install_sh_SCRIPT = $(install_sh) -c | ||
27 | INSTALL_HEADER = $(INSTALL_DATA) | ||
28 | transform = $(program_transform_name) | ||
29 | NORMAL_INSTALL = : | ||
30 | PRE_INSTALL = : | ||
31 | POST_INSTALL = : | ||
32 | NORMAL_UNINSTALL = : | ||
33 | PRE_UNINSTALL = : | ||
34 | POST_UNINSTALL = : | ||
35 | build_triplet = @build@ | ||
36 | host_triplet = @host@ | ||
37 | pkglib_PROGRAMS = $(am__EXEEXT_1) | ||
38 | @EFL_INSTALL_EXAMPLES_TRUE@am__append_1 = $(SRCS) \ | ||
39 | @EFL_INSTALL_EXAMPLES_TRUE@ $(srcdir)/red.png | ||
40 | |||
41 | @EFL_BUILD_EXAMPLES_TRUE@am__append_2 = \ | ||
42 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_animator_example \ | ||
43 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_fd_handler_example \ | ||
44 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_poller_example \ | ||
45 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_event_example \ | ||
46 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_idler_example \ | ||
47 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_job_example \ | ||
48 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_timer_example \ | ||
49 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_time_functions_example \ | ||
50 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_pipe_simple_example \ | ||
51 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_lookup_example \ | ||
52 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_url_headers_example \ | ||
53 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_url_download_example \ | ||
54 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_url_cookies_example \ | ||
55 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_server_simple_example \ | ||
56 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_server_http_example \ | ||
57 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_client_simple_example \ | ||
58 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_thread_example \ | ||
59 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_callbacks \ | ||
60 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_window_sizes_example \ | ||
61 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_object_example \ | ||
62 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_basics_example \ | ||
63 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_buffer_example_01 \ | ||
64 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_buffer_example_02 \ | ||
65 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_ews_example \ | ||
66 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_client_bench \ | ||
67 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_server_bench | ||
68 | |||
69 | subdir = src/examples | ||
70 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
71 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
72 | am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \ | ||
73 | $(top_srcdir)/m4/ac_path_generic.m4 \ | ||
74 | $(top_srcdir)/m4/check_x_extension.m4 \ | ||
75 | $(top_srcdir)/m4/ecore_check_module.m4 \ | ||
76 | $(top_srcdir)/m4/ecore_check_options.m4 \ | ||
77 | $(top_srcdir)/m4/efl_compiler_flag.m4 \ | ||
78 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
79 | $(top_srcdir)/m4/efl_examples.m4 \ | ||
80 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
81 | $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \ | ||
82 | $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ | ||
83 | $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ | ||
84 | $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ | ||
85 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | ||
86 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | ||
87 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ | ||
88 | $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ | ||
89 | $(top_srcdir)/configure.ac | ||
90 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
91 | $(ACLOCAL_M4) | ||
92 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs | ||
93 | CONFIG_HEADER = $(top_builddir)/config.h | ||
94 | CONFIG_CLEAN_FILES = | ||
95 | CONFIG_CLEAN_VPATH_FILES = | ||
96 | @EFL_BUILD_EXAMPLES_TRUE@am__EXEEXT_1 = \ | ||
97 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_animator_example$(EXEEXT) \ | ||
98 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_fd_handler_example$(EXEEXT) \ | ||
99 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_poller_example$(EXEEXT) \ | ||
100 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_event_example$(EXEEXT) \ | ||
101 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_idler_example$(EXEEXT) \ | ||
102 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_job_example$(EXEEXT) \ | ||
103 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_timer_example$(EXEEXT) \ | ||
104 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_time_functions_example$(EXEEXT) \ | ||
105 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_pipe_simple_example$(EXEEXT) \ | ||
106 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_lookup_example$(EXEEXT) \ | ||
107 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_url_headers_example$(EXEEXT) \ | ||
108 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_url_download_example$(EXEEXT) \ | ||
109 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_url_cookies_example$(EXEEXT) \ | ||
110 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_server_simple_example$(EXEEXT) \ | ||
111 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_server_http_example$(EXEEXT) \ | ||
112 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_con_client_simple_example$(EXEEXT) \ | ||
113 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_thread_example$(EXEEXT) \ | ||
114 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_callbacks$(EXEEXT) \ | ||
115 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_window_sizes_example$(EXEEXT) \ | ||
116 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_object_example$(EXEEXT) \ | ||
117 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_basics_example$(EXEEXT) \ | ||
118 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_buffer_example_01$(EXEEXT) \ | ||
119 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_buffer_example_02$(EXEEXT) \ | ||
120 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_evas_ews_example$(EXEEXT) \ | ||
121 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_client_bench$(EXEEXT) \ | ||
122 | @EFL_BUILD_EXAMPLES_TRUE@ ecore_server_bench$(EXEEXT) | ||
123 | am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)" | ||
124 | PROGRAMS = $(pkglib_PROGRAMS) | ||
125 | ecore_animator_example_SOURCES = ecore_animator_example.c | ||
126 | ecore_animator_example_OBJECTS = ecore_animator_example.$(OBJEXT) | ||
127 | ecore_animator_example_LDADD = $(LDADD) | ||
128 | am__DEPENDENCIES_1 = $(top_builddir)/src/lib/ecore/libecore.la \ | ||
129 | $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
130 | ecore_animator_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
131 | AM_V_lt = $(am__v_lt_$(V)) | ||
132 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
133 | am__v_lt_0 = --silent | ||
134 | ecore_client_bench_SOURCES = ecore_client_bench.c | ||
135 | ecore_client_bench_OBJECTS = ecore_client_bench.$(OBJEXT) | ||
136 | @EFL_BUILD_EXAMPLES_TRUE@ecore_client_bench_DEPENDENCIES = \ | ||
137 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
138 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
139 | ecore_con_client_simple_example_SOURCES = \ | ||
140 | ecore_con_client_simple_example.c | ||
141 | ecore_con_client_simple_example_OBJECTS = \ | ||
142 | ecore_con_client_simple_example.$(OBJEXT) | ||
143 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_client_simple_example_DEPENDENCIES = \ | ||
144 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
145 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
146 | ecore_con_lookup_example_SOURCES = ecore_con_lookup_example.c | ||
147 | ecore_con_lookup_example_OBJECTS = ecore_con_lookup_example.$(OBJEXT) | ||
148 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_lookup_example_DEPENDENCIES = \ | ||
149 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
150 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
151 | ecore_con_server_http_example_SOURCES = \ | ||
152 | ecore_con_server_http_example.c | ||
153 | ecore_con_server_http_example_OBJECTS = \ | ||
154 | ecore_con_server_http_example.$(OBJEXT) | ||
155 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_server_http_example_DEPENDENCIES = \ | ||
156 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
157 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
158 | ecore_con_server_simple_example_SOURCES = \ | ||
159 | ecore_con_server_simple_example.c | ||
160 | ecore_con_server_simple_example_OBJECTS = \ | ||
161 | ecore_con_server_simple_example.$(OBJEXT) | ||
162 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_server_simple_example_DEPENDENCIES = \ | ||
163 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
164 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
165 | ecore_con_url_cookies_example_SOURCES = \ | ||
166 | ecore_con_url_cookies_example.c | ||
167 | ecore_con_url_cookies_example_OBJECTS = \ | ||
168 | ecore_con_url_cookies_example.$(OBJEXT) | ||
169 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_url_cookies_example_DEPENDENCIES = \ | ||
170 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
171 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
172 | ecore_con_url_download_example_SOURCES = \ | ||
173 | ecore_con_url_download_example.c | ||
174 | ecore_con_url_download_example_OBJECTS = \ | ||
175 | ecore_con_url_download_example.$(OBJEXT) | ||
176 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_url_download_example_DEPENDENCIES = \ | ||
177 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
178 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
179 | ecore_con_url_headers_example_SOURCES = \ | ||
180 | ecore_con_url_headers_example.c | ||
181 | ecore_con_url_headers_example_OBJECTS = \ | ||
182 | ecore_con_url_headers_example.$(OBJEXT) | ||
183 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_url_headers_example_DEPENDENCIES = \ | ||
184 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
185 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
186 | ecore_evas_basics_example_SOURCES = ecore_evas_basics_example.c | ||
187 | ecore_evas_basics_example_OBJECTS = \ | ||
188 | ecore_evas_basics_example.$(OBJEXT) | ||
189 | ecore_evas_basics_example_LDADD = $(LDADD) | ||
190 | ecore_evas_basics_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
191 | ecore_evas_buffer_example_01_SOURCES = ecore_evas_buffer_example_01.c | ||
192 | ecore_evas_buffer_example_01_OBJECTS = \ | ||
193 | ecore_evas_buffer_example_01.$(OBJEXT) | ||
194 | @EFL_BUILD_EXAMPLES_TRUE@ecore_evas_buffer_example_01_DEPENDENCIES = \ | ||
195 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
196 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
197 | ecore_evas_buffer_example_02_SOURCES = ecore_evas_buffer_example_02.c | ||
198 | ecore_evas_buffer_example_02_OBJECTS = \ | ||
199 | ecore_evas_buffer_example_02.$(OBJEXT) | ||
200 | @EFL_BUILD_EXAMPLES_TRUE@ecore_evas_buffer_example_02_DEPENDENCIES = \ | ||
201 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
202 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
203 | ecore_evas_callbacks_SOURCES = ecore_evas_callbacks.c | ||
204 | ecore_evas_callbacks_OBJECTS = ecore_evas_callbacks.$(OBJEXT) | ||
205 | ecore_evas_callbacks_LDADD = $(LDADD) | ||
206 | ecore_evas_callbacks_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
207 | ecore_evas_ews_example_SOURCES = ecore_evas_ews_example.c | ||
208 | ecore_evas_ews_example_OBJECTS = ecore_evas_ews_example.$(OBJEXT) | ||
209 | ecore_evas_ews_example_LDADD = $(LDADD) | ||
210 | ecore_evas_ews_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
211 | ecore_evas_object_example_SOURCES = ecore_evas_object_example.c | ||
212 | ecore_evas_object_example_OBJECTS = \ | ||
213 | ecore_evas_object_example.$(OBJEXT) | ||
214 | ecore_evas_object_example_LDADD = $(LDADD) | ||
215 | ecore_evas_object_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
216 | ecore_evas_window_sizes_example_SOURCES = \ | ||
217 | ecore_evas_window_sizes_example.c | ||
218 | ecore_evas_window_sizes_example_OBJECTS = \ | ||
219 | ecore_evas_window_sizes_example.$(OBJEXT) | ||
220 | @EFL_BUILD_EXAMPLES_TRUE@ecore_evas_window_sizes_example_DEPENDENCIES = \ | ||
221 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
222 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
223 | ecore_event_example_SOURCES = ecore_event_example.c | ||
224 | ecore_event_example_OBJECTS = ecore_event_example.$(OBJEXT) | ||
225 | ecore_event_example_LDADD = $(LDADD) | ||
226 | ecore_event_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
227 | ecore_fd_handler_example_SOURCES = ecore_fd_handler_example.c | ||
228 | ecore_fd_handler_example_OBJECTS = ecore_fd_handler_example.$(OBJEXT) | ||
229 | ecore_fd_handler_example_LDADD = $(LDADD) | ||
230 | ecore_fd_handler_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
231 | ecore_idler_example_SOURCES = ecore_idler_example.c | ||
232 | ecore_idler_example_OBJECTS = ecore_idler_example.$(OBJEXT) | ||
233 | ecore_idler_example_LDADD = $(LDADD) | ||
234 | ecore_idler_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
235 | ecore_job_example_SOURCES = ecore_job_example.c | ||
236 | ecore_job_example_OBJECTS = ecore_job_example.$(OBJEXT) | ||
237 | ecore_job_example_LDADD = $(LDADD) | ||
238 | ecore_job_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
239 | ecore_pipe_simple_example_SOURCES = ecore_pipe_simple_example.c | ||
240 | ecore_pipe_simple_example_OBJECTS = \ | ||
241 | ecore_pipe_simple_example.$(OBJEXT) | ||
242 | ecore_pipe_simple_example_LDADD = $(LDADD) | ||
243 | ecore_pipe_simple_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
244 | ecore_poller_example_SOURCES = ecore_poller_example.c | ||
245 | ecore_poller_example_OBJECTS = ecore_poller_example.$(OBJEXT) | ||
246 | ecore_poller_example_LDADD = $(LDADD) | ||
247 | ecore_poller_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
248 | ecore_server_bench_SOURCES = ecore_server_bench.c | ||
249 | ecore_server_bench_OBJECTS = ecore_server_bench.$(OBJEXT) | ||
250 | @EFL_BUILD_EXAMPLES_TRUE@ecore_server_bench_DEPENDENCIES = \ | ||
251 | @EFL_BUILD_EXAMPLES_TRUE@ $(am__DEPENDENCIES_1) \ | ||
252 | @EFL_BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
253 | ecore_thread_example_SOURCES = ecore_thread_example.c | ||
254 | ecore_thread_example_OBJECTS = ecore_thread_example.$(OBJEXT) | ||
255 | ecore_thread_example_LDADD = $(LDADD) | ||
256 | ecore_thread_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
257 | ecore_time_functions_example_SOURCES = ecore_time_functions_example.c | ||
258 | ecore_time_functions_example_OBJECTS = \ | ||
259 | ecore_time_functions_example.$(OBJEXT) | ||
260 | ecore_time_functions_example_LDADD = $(LDADD) | ||
261 | ecore_time_functions_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
262 | ecore_timer_example_SOURCES = ecore_timer_example.c | ||
263 | ecore_timer_example_OBJECTS = ecore_timer_example.$(OBJEXT) | ||
264 | ecore_timer_example_LDADD = $(LDADD) | ||
265 | ecore_timer_example_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
266 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
267 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
268 | am__depfiles_maybe = depfiles | ||
269 | am__mv = mv -f | ||
270 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
271 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
272 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
273 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
274 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
275 | $(AM_CFLAGS) $(CFLAGS) | ||
276 | AM_V_CC = $(am__v_CC_$(V)) | ||
277 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
278 | am__v_CC_0 = @echo " CC " $@; | ||
279 | AM_V_at = $(am__v_at_$(V)) | ||
280 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
281 | am__v_at_0 = @ | ||
282 | CCLD = $(CC) | ||
283 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
284 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
285 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
286 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
287 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
288 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
289 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
290 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
291 | am__v_GEN_0 = @echo " GEN " $@; | ||
292 | SOURCES = ecore_animator_example.c ecore_client_bench.c \ | ||
293 | ecore_con_client_simple_example.c ecore_con_lookup_example.c \ | ||
294 | ecore_con_server_http_example.c \ | ||
295 | ecore_con_server_simple_example.c \ | ||
296 | ecore_con_url_cookies_example.c \ | ||
297 | ecore_con_url_download_example.c \ | ||
298 | ecore_con_url_headers_example.c ecore_evas_basics_example.c \ | ||
299 | ecore_evas_buffer_example_01.c ecore_evas_buffer_example_02.c \ | ||
300 | ecore_evas_callbacks.c ecore_evas_ews_example.c \ | ||
301 | ecore_evas_object_example.c ecore_evas_window_sizes_example.c \ | ||
302 | ecore_event_example.c ecore_fd_handler_example.c \ | ||
303 | ecore_idler_example.c ecore_job_example.c \ | ||
304 | ecore_pipe_simple_example.c ecore_poller_example.c \ | ||
305 | ecore_server_bench.c ecore_thread_example.c \ | ||
306 | ecore_time_functions_example.c ecore_timer_example.c | ||
307 | DIST_SOURCES = ecore_animator_example.c ecore_client_bench.c \ | ||
308 | ecore_con_client_simple_example.c ecore_con_lookup_example.c \ | ||
309 | ecore_con_server_http_example.c \ | ||
310 | ecore_con_server_simple_example.c \ | ||
311 | ecore_con_url_cookies_example.c \ | ||
312 | ecore_con_url_download_example.c \ | ||
313 | ecore_con_url_headers_example.c ecore_evas_basics_example.c \ | ||
314 | ecore_evas_buffer_example_01.c ecore_evas_buffer_example_02.c \ | ||
315 | ecore_evas_callbacks.c ecore_evas_ews_example.c \ | ||
316 | ecore_evas_object_example.c ecore_evas_window_sizes_example.c \ | ||
317 | ecore_event_example.c ecore_fd_handler_example.c \ | ||
318 | ecore_idler_example.c ecore_job_example.c \ | ||
319 | ecore_pipe_simple_example.c ecore_poller_example.c \ | ||
320 | ecore_server_bench.c ecore_thread_example.c \ | ||
321 | ecore_time_functions_example.c ecore_timer_example.c | ||
322 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
323 | am__vpath_adj = case $$p in \ | ||
324 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
325 | *) f=$$p;; \ | ||
326 | esac; | ||
327 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
328 | am__install_max = 40 | ||
329 | am__nobase_strip_setup = \ | ||
330 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
331 | am__nobase_strip = \ | ||
332 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
333 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
334 | for p in $$list; do echo "$$p $$p"; done | \ | ||
335 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
336 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
337 | if (++n[$$2] == $(am__install_max)) \ | ||
338 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
339 | END { for (dir in files) print dir, files[dir] }' | ||
340 | am__base_list = \ | ||
341 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
342 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
343 | DATA = $(files_DATA) | ||
344 | ETAGS = etags | ||
345 | CTAGS = ctags | ||
346 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
347 | pkglibdir = $(datadir)/$(PACKAGE)/examples | ||
348 | ACLOCAL = @ACLOCAL@ | ||
349 | ALLOCA = @ALLOCA@ | ||
350 | AMTAR = @AMTAR@ | ||
351 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
352 | AR = @AR@ | ||
353 | AS = @AS@ | ||
354 | AUTOCONF = @AUTOCONF@ | ||
355 | AUTOHEADER = @AUTOHEADER@ | ||
356 | AUTOMAKE = @AUTOMAKE@ | ||
357 | AWK = @AWK@ | ||
358 | CARES_CFLAGS = @CARES_CFLAGS@ | ||
359 | CARES_LIBS = @CARES_LIBS@ | ||
360 | CC = @CC@ | ||
361 | CCDEPMODE = @CCDEPMODE@ | ||
362 | CFLAGS = @CFLAGS@ | ||
363 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
364 | CHECK_LIBS = @CHECK_LIBS@ | ||
365 | CPP = @CPP@ | ||
366 | CPPFLAGS = @CPPFLAGS@ | ||
367 | CURL_CFLAGS = @CURL_CFLAGS@ | ||
368 | CURL_LIBS = @CURL_LIBS@ | ||
369 | CXX = @CXX@ | ||
370 | CXXCPP = @CXXCPP@ | ||
371 | CXXDEPMODE = @CXXDEPMODE@ | ||
372 | CXXFLAGS = @CXXFLAGS@ | ||
373 | CYGPATH_W = @CYGPATH_W@ | ||
374 | DEFS = @DEFS@ | ||
375 | DEPDIR = @DEPDIR@ | ||
376 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
377 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
378 | DLLTOOL = @DLLTOOL@ | ||
379 | DSYMUTIL = @DSYMUTIL@ | ||
380 | DUMPBIN = @DUMPBIN@ | ||
381 | ECHO_C = @ECHO_C@ | ||
382 | ECHO_N = @ECHO_N@ | ||
383 | ECHO_T = @ECHO_T@ | ||
384 | ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@ | ||
385 | ECORE_XCB_LIBS = @ECORE_XCB_LIBS@ | ||
386 | EFL_ECORE_BUILD = @EFL_ECORE_BUILD@ | ||
387 | EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@ | ||
388 | EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@ | ||
389 | EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@ | ||
390 | EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@ | ||
391 | EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@ | ||
392 | EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@ | ||
393 | EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@ | ||
394 | EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@ | ||
395 | EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@ | ||
396 | EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@ | ||
397 | EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@ | ||
398 | EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@ | ||
399 | EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@ | ||
400 | EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@ | ||
401 | EGREP = @EGREP@ | ||
402 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
403 | EINA_LIBS = @EINA_LIBS@ | ||
404 | ESCAPE_CFLAGS = @ESCAPE_CFLAGS@ | ||
405 | ESCAPE_LIBS = @ESCAPE_LIBS@ | ||
406 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
407 | EVAS_LIBS = @EVAS_LIBS@ | ||
408 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
409 | EVIL_LIBS = @EVIL_LIBS@ | ||
410 | EXEEXT = @EXEEXT@ | ||
411 | FGREP = @FGREP@ | ||
412 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ | ||
413 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
414 | GLIB_LIBS = @GLIB_LIBS@ | ||
415 | GMSGFMT = @GMSGFMT@ | ||
416 | GMSGFMT_015 = @GMSGFMT_015@ | ||
417 | GREP = @GREP@ | ||
418 | INSTALL = @INSTALL@ | ||
419 | INSTALL_DATA = @INSTALL_DATA@ | ||
420 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
421 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
422 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
423 | INTLLIBS = @INTLLIBS@ | ||
424 | INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ | ||
425 | KEYSYMDEFS = @KEYSYMDEFS@ | ||
426 | LD = @LD@ | ||
427 | LDFLAGS = @LDFLAGS@ | ||
428 | LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ | ||
429 | LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ | ||
430 | LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ | ||
431 | LIBICONV = @LIBICONV@ | ||
432 | LIBINTL = @LIBINTL@ | ||
433 | LIBOBJS = @LIBOBJS@ | ||
434 | LIBS = @LIBS@ | ||
435 | LIBTOOL = @LIBTOOL@ | ||
436 | LIPO = @LIPO@ | ||
437 | LN_S = @LN_S@ | ||
438 | LTLIBICONV = @LTLIBICONV@ | ||
439 | LTLIBINTL = @LTLIBINTL@ | ||
440 | LTLIBOBJS = @LTLIBOBJS@ | ||
441 | MAKEINFO = @MAKEINFO@ | ||
442 | MKDIR_P = @MKDIR_P@ | ||
443 | MSGFMT = @MSGFMT@ | ||
444 | MSGFMT_015 = @MSGFMT_015@ | ||
445 | MSGMERGE = @MSGMERGE@ | ||
446 | NM = @NM@ | ||
447 | NMEDIT = @NMEDIT@ | ||
448 | OBJC = @OBJC@ | ||
449 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
450 | OBJCFLAGS = @OBJCFLAGS@ | ||
451 | OBJDUMP = @OBJDUMP@ | ||
452 | OBJEXT = @OBJEXT@ | ||
453 | OTOOL = @OTOOL@ | ||
454 | OTOOL64 = @OTOOL64@ | ||
455 | PACKAGE = @PACKAGE@ | ||
456 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
457 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
458 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
459 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
460 | PACKAGE_URL = @PACKAGE_URL@ | ||
461 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
462 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
463 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
464 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
465 | PKG_CONFIG = @PKG_CONFIG@ | ||
466 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
467 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
468 | POSUB = @POSUB@ | ||
469 | RANLIB = @RANLIB@ | ||
470 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
471 | SDL_CONFIG = @SDL_CONFIG@ | ||
472 | SDL_LIBS = @SDL_LIBS@ | ||
473 | SED = @SED@ | ||
474 | SET_MAKE = @SET_MAKE@ | ||
475 | SHELL = @SHELL@ | ||
476 | SSL_CFLAGS = @SSL_CFLAGS@ | ||
477 | SSL_LIBS = @SSL_LIBS@ | ||
478 | STRIP = @STRIP@ | ||
479 | TLS2_CFLAGS = @TLS2_CFLAGS@ | ||
480 | TLS2_LIBS = @TLS2_LIBS@ | ||
481 | TLS_CFLAGS = @TLS_CFLAGS@ | ||
482 | TLS_LIBS = @TLS_LIBS@ | ||
483 | TSLIB_CFLAGS = @TSLIB_CFLAGS@ | ||
484 | TSLIB_LIBS = @TSLIB_LIBS@ | ||
485 | USE_NLS = @USE_NLS@ | ||
486 | VERSION = @VERSION@ | ||
487 | VMAJ = @VMAJ@ | ||
488 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
489 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
490 | WIN32_LIBS = @WIN32_LIBS@ | ||
491 | XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@ | ||
492 | XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@ | ||
493 | XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@ | ||
494 | XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@ | ||
495 | XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@ | ||
496 | XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@ | ||
497 | XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@ | ||
498 | XCB_DPMS_LIBS = @XCB_DPMS_LIBS@ | ||
499 | XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@ | ||
500 | XCB_RANDR_LIBS = @XCB_RANDR_LIBS@ | ||
501 | XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@ | ||
502 | XCB_RENDER_LIBS = @XCB_RENDER_LIBS@ | ||
503 | XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@ | ||
504 | XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@ | ||
505 | XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@ | ||
506 | XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@ | ||
507 | XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@ | ||
508 | XCB_SYNC_LIBS = @XCB_SYNC_LIBS@ | ||
509 | XCB_X11_CFLAGS = @XCB_X11_CFLAGS@ | ||
510 | XCB_X11_LIBS = @XCB_X11_LIBS@ | ||
511 | XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@ | ||
512 | XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@ | ||
513 | XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@ | ||
514 | XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@ | ||
515 | XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@ | ||
516 | XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@ | ||
517 | XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@ | ||
518 | XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@ | ||
519 | XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@ | ||
520 | XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@ | ||
521 | XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@ | ||
522 | XCB_XTEST_LIBS = @XCB_XTEST_LIBS@ | ||
523 | XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@ | ||
524 | XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ | ||
525 | XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@ | ||
526 | XDAMAGE_LIBS = @XDAMAGE_LIBS@ | ||
527 | XDPMS_CFLAGS = @XDPMS_CFLAGS@ | ||
528 | XDPMS_LIBS = @XDPMS_LIBS@ | ||
529 | XFIXES_CFLAGS = @XFIXES_CFLAGS@ | ||
530 | XFIXES_LIBS = @XFIXES_LIBS@ | ||
531 | XGESTURE_CFLAGS = @XGESTURE_CFLAGS@ | ||
532 | XGESTURE_LIBS = @XGESTURE_LIBS@ | ||
533 | XGETTEXT = @XGETTEXT@ | ||
534 | XGETTEXT_015 = @XGETTEXT_015@ | ||
535 | XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ | ||
536 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
537 | XI2_LIBS = @XI2_LIBS@ | ||
538 | XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ | ||
539 | XINERAMA_LIBS = @XINERAMA_LIBS@ | ||
540 | XKB_CFLAGS = @XKB_CFLAGS@ | ||
541 | XKB_LIBS = @XKB_LIBS@ | ||
542 | XMKMF = @XMKMF@ | ||
543 | XPRINT_CFLAGS = @XPRINT_CFLAGS@ | ||
544 | XPRINT_LIBS = @XPRINT_LIBS@ | ||
545 | XRANDR_CFLAGS = @XRANDR_CFLAGS@ | ||
546 | XRANDR_LIBS = @XRANDR_LIBS@ | ||
547 | XRENDER_CFLAGS = @XRENDER_CFLAGS@ | ||
548 | XRENDER_LIBS = @XRENDER_LIBS@ | ||
549 | XSS_CFLAGS = @XSS_CFLAGS@ | ||
550 | XSS_LIBS = @XSS_LIBS@ | ||
551 | XTEST_CFLAGS = @XTEST_CFLAGS@ | ||
552 | XTEST_LIBS = @XTEST_LIBS@ | ||
553 | X_CFLAGS = @X_CFLAGS@ | ||
554 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
555 | X_LIBS = @X_LIBS@ | ||
556 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
557 | Xcursor_cflags = @Xcursor_cflags@ | ||
558 | Xcursor_libs = @Xcursor_libs@ | ||
559 | abs_builddir = @abs_builddir@ | ||
560 | abs_srcdir = @abs_srcdir@ | ||
561 | abs_top_builddir = @abs_top_builddir@ | ||
562 | abs_top_srcdir = @abs_top_srcdir@ | ||
563 | ac_ct_CC = @ac_ct_CC@ | ||
564 | ac_ct_CXX = @ac_ct_CXX@ | ||
565 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
566 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
567 | am__include = @am__include@ | ||
568 | am__leading_dot = @am__leading_dot@ | ||
569 | am__quote = @am__quote@ | ||
570 | am__tar = @am__tar@ | ||
571 | am__untar = @am__untar@ | ||
572 | bindir = @bindir@ | ||
573 | build = @build@ | ||
574 | build_alias = @build_alias@ | ||
575 | build_cpu = @build_cpu@ | ||
576 | build_os = @build_os@ | ||
577 | build_vendor = @build_vendor@ | ||
578 | builddir = @builddir@ | ||
579 | cocoa_ldflags = @cocoa_ldflags@ | ||
580 | datadir = @datadir@ | ||
581 | datarootdir = @datarootdir@ | ||
582 | dlopen_libs = @dlopen_libs@ | ||
583 | docdir = @docdir@ | ||
584 | dvidir = @dvidir@ | ||
585 | ecore_cocoa_cflags = @ecore_cocoa_cflags@ | ||
586 | ecore_cocoa_libs = @ecore_cocoa_libs@ | ||
587 | ecore_con_cflags = @ecore_con_cflags@ | ||
588 | ecore_con_libs = @ecore_con_libs@ | ||
589 | ecore_directfb_cflags = @ecore_directfb_cflags@ | ||
590 | ecore_directfb_libs = @ecore_directfb_libs@ | ||
591 | ecore_evas_cflags = @ecore_evas_cflags@ | ||
592 | ecore_evas_libs = @ecore_evas_libs@ | ||
593 | ecore_fb_cflags = @ecore_fb_cflags@ | ||
594 | ecore_fb_libs = @ecore_fb_libs@ | ||
595 | ecore_file_cflags = @ecore_file_cflags@ | ||
596 | ecore_file_libs = @ecore_file_libs@ | ||
597 | ecore_imf_cflags = @ecore_imf_cflags@ | ||
598 | ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ | ||
599 | ecore_imf_evas_libs = @ecore_imf_evas_libs@ | ||
600 | ecore_imf_libs = @ecore_imf_libs@ | ||
601 | ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ | ||
602 | ecore_imf_xim_libs = @ecore_imf_xim_libs@ | ||
603 | ecore_input_cflags = @ecore_input_cflags@ | ||
604 | ecore_input_evas_cflags = @ecore_input_evas_cflags@ | ||
605 | ecore_input_evas_libs = @ecore_input_evas_libs@ | ||
606 | ecore_input_libs = @ecore_input_libs@ | ||
607 | ecore_ipc_cflags = @ecore_ipc_cflags@ | ||
608 | ecore_ipc_libs = @ecore_ipc_libs@ | ||
609 | ecore_psl1ght_cflags = @ecore_psl1ght_cflags@ | ||
610 | ecore_psl1ght_libs = @ecore_psl1ght_libs@ | ||
611 | ecore_sdl_cflags = @ecore_sdl_cflags@ | ||
612 | ecore_sdl_libs = @ecore_sdl_libs@ | ||
613 | ecore_win32_cflags = @ecore_win32_cflags@ | ||
614 | ecore_win32_libs = @ecore_win32_libs@ | ||
615 | ecore_wince_cflags = @ecore_wince_cflags@ | ||
616 | ecore_wince_libs = @ecore_wince_libs@ | ||
617 | ecore_x_cflags = @ecore_x_cflags@ | ||
618 | ecore_x_libs = @ecore_x_libs@ | ||
619 | ecore_x_libs_private = @ecore_x_libs_private@ | ||
620 | efl_doxygen = @efl_doxygen@ | ||
621 | efl_have_doxygen = @efl_have_doxygen@ | ||
622 | exec_prefix = @exec_prefix@ | ||
623 | have_ecore_x_xcb_define = @have_ecore_x_xcb_define@ | ||
624 | host = @host@ | ||
625 | host_alias = @host_alias@ | ||
626 | host_cpu = @host_cpu@ | ||
627 | host_os = @host_os@ | ||
628 | host_vendor = @host_vendor@ | ||
629 | htmldir = @htmldir@ | ||
630 | includedir = @includedir@ | ||
631 | infodir = @infodir@ | ||
632 | install_sh = @install_sh@ | ||
633 | libdir = @libdir@ | ||
634 | libexecdir = @libexecdir@ | ||
635 | localedir = @localedir@ | ||
636 | localstatedir = @localstatedir@ | ||
637 | lt_ECHO = @lt_ECHO@ | ||
638 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
639 | mandir = @mandir@ | ||
640 | mkdir_p = @mkdir_p@ | ||
641 | oldincludedir = @oldincludedir@ | ||
642 | pdfdir = @pdfdir@ | ||
643 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
644 | prefix = @prefix@ | ||
645 | program_transform_name = @program_transform_name@ | ||
646 | psdir = @psdir@ | ||
647 | release_info = @release_info@ | ||
648 | requirements_ecore = @requirements_ecore@ | ||
649 | requirements_ecore_cocoa = @requirements_ecore_cocoa@ | ||
650 | requirements_ecore_con = @requirements_ecore_con@ | ||
651 | requirements_ecore_directfb = @requirements_ecore_directfb@ | ||
652 | requirements_ecore_evas = @requirements_ecore_evas@ | ||
653 | requirements_ecore_fb = @requirements_ecore_fb@ | ||
654 | requirements_ecore_file = @requirements_ecore_file@ | ||
655 | requirements_ecore_imf = @requirements_ecore_imf@ | ||
656 | requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ | ||
657 | requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ | ||
658 | requirements_ecore_input = @requirements_ecore_input@ | ||
659 | requirements_ecore_input_evas = @requirements_ecore_input_evas@ | ||
660 | requirements_ecore_ipc = @requirements_ecore_ipc@ | ||
661 | requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ | ||
662 | requirements_ecore_sdl = @requirements_ecore_sdl@ | ||
663 | requirements_ecore_win32 = @requirements_ecore_win32@ | ||
664 | requirements_ecore_wince = @requirements_ecore_wince@ | ||
665 | requirements_ecore_x = @requirements_ecore_x@ | ||
666 | rt_libs = @rt_libs@ | ||
667 | sbindir = @sbindir@ | ||
668 | sharedstatedir = @sharedstatedir@ | ||
669 | srcdir = @srcdir@ | ||
670 | sysconfdir = @sysconfdir@ | ||
671 | target_alias = @target_alias@ | ||
672 | top_build_prefix = @top_build_prefix@ | ||
673 | top_builddir = @top_builddir@ | ||
674 | top_srcdir = @top_srcdir@ | ||
675 | version_info = @version_info@ | ||
676 | x_cflags = @x_cflags@ | ||
677 | x_includes = @x_includes@ | ||
678 | x_libs = @x_libs@ | ||
679 | MAINTAINERCLEANFILES = Makefile.in | ||
680 | filesdir = $(datadir)/$(PACKAGE)/examples | ||
681 | files_DATA = $(am__append_1) | ||
682 | AM_CPPFLAGS = \ | ||
683 | -I. \ | ||
684 | -I$(top_srcdir)/src/lib/ecore \ | ||
685 | -I$(top_srcdir)/src/lib/ecore_evas \ | ||
686 | -I$(top_srcdir)/src/lib/ecore_input \ | ||
687 | -I$(top_srcdir)/src/lib/ecore_con \ | ||
688 | -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ | ||
689 | @GLIB_CFLAGS@ @EVIL_CFLAGS@ @EVAS_CFLAGS@ @EINA_CFLAGS@ @WIN32_CPPFLAGS@ @EFL_ECORE_BUILD@ | ||
690 | |||
691 | ECOREBASELDADD = \ | ||
692 | $(top_builddir)/src/lib/ecore/libecore.la \ | ||
693 | $(top_builddir)/src/lib/ecore_evas/libecore_evas.la \ | ||
694 | @dlopen_libs@ @EINA_LIBS@ @EVIL_LIBS@ @EVAS_LIBS@ @GLIB_LIBS@ @WIN32_LIBS@ @LTLIBINTL@ @EFL_PTHREAD_LIBS@ @rt_libs@ -lm | ||
695 | |||
696 | LDADD = \ | ||
697 | $(ECOREBASELDADD) | ||
698 | |||
699 | SRCS = \ | ||
700 | ecore_animator_example.c \ | ||
701 | ecore_fd_handler_example.c \ | ||
702 | ecore_poller_example.c \ | ||
703 | ecore_event_example.c \ | ||
704 | ecore_idler_example.c \ | ||
705 | ecore_timer_example.c \ | ||
706 | ecore_time_functions_example.c \ | ||
707 | ecore_job_example.c \ | ||
708 | ecore_con_lookup_example.c \ | ||
709 | ecore_con_url_headers_example.c \ | ||
710 | ecore_con_url_download_example.c \ | ||
711 | ecore_con_url_cookies_example.c \ | ||
712 | ecore_con_server_simple_example.c \ | ||
713 | ecore_con_server_http_example.c \ | ||
714 | ecore_con_client_simple_example.c \ | ||
715 | ecore_client_bench.c \ | ||
716 | ecore_server_bench.c \ | ||
717 | ecore_con_client_example.c \ | ||
718 | ecore_con_server_example.c \ | ||
719 | ecore_fd_handler_gnutls_example.c \ | ||
720 | ecore_file_download_example.c \ | ||
721 | ecore_pipe_simple_example.c \ | ||
722 | ecore_pipe_gstreamer_example.c \ | ||
723 | ecore_thread_example.c \ | ||
724 | ecore_evas_callbacks.c \ | ||
725 | ecore_evas_window_sizes_example.c \ | ||
726 | ecore_evas_object_example.c \ | ||
727 | ecore_evas_basics_example.c \ | ||
728 | ecore_evas_buffer_example_01.c \ | ||
729 | ecore_evas_buffer_example_02.c \ | ||
730 | ecore_evas_ews_example.c | ||
731 | |||
732 | EXTRA_DIST = $(SRCS) \ | ||
733 | $(srcdir)/red.png | ||
734 | |||
735 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_lookup_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
736 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_url_headers_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
737 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_url_download_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
738 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_url_cookies_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
739 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_server_simple_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
740 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_server_http_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
741 | @EFL_BUILD_EXAMPLES_TRUE@ecore_con_client_simple_example_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
742 | @EFL_BUILD_EXAMPLES_TRUE@ecore_evas_window_sizes_example_LDADD = $(ECOREBASELDADD) @EVAS_LIBS@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
743 | @EFL_BUILD_EXAMPLES_TRUE@ecore_evas_buffer_example_01_LDADD = $(ECOREBASELDADD) @EVAS_LIBS@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
744 | @EFL_BUILD_EXAMPLES_TRUE@ecore_evas_buffer_example_02_LDADD = $(ECOREBASELDADD) @EVAS_LIBS@ $(top_builddir)/src/lib/ecore_evas/libecore_evas.la | ||
745 | @EFL_BUILD_EXAMPLES_TRUE@ecore_client_bench_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
746 | @EFL_BUILD_EXAMPLES_TRUE@ecore_server_bench_LDADD = $(ECOREBASELDADD) $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
747 | all: all-am | ||
748 | |||
749 | .SUFFIXES: | ||
750 | .SUFFIXES: .c .lo .o .obj | ||
751 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
752 | @for dep in $?; do \ | ||
753 | case '$(am__configure_deps)' in \ | ||
754 | *$$dep*) \ | ||
755 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
756 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
757 | exit 1;; \ | ||
758 | esac; \ | ||
759 | done; \ | ||
760 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/examples/Makefile'; \ | ||
761 | $(am__cd) $(top_srcdir) && \ | ||
762 | $(AUTOMAKE) --gnu src/examples/Makefile | ||
763 | .PRECIOUS: Makefile | ||
764 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
765 | @case '$?' in \ | ||
766 | *config.status*) \ | ||
767 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
768 | *) \ | ||
769 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
770 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
771 | esac; | ||
772 | |||
773 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
774 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
775 | |||
776 | $(top_srcdir)/configure: $(am__configure_deps) | ||
777 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
778 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
779 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
780 | $(am__aclocal_m4_deps): | ||
781 | install-pkglibPROGRAMS: $(pkglib_PROGRAMS) | ||
782 | @$(NORMAL_INSTALL) | ||
783 | test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" | ||
784 | @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \ | ||
785 | for p in $$list; do echo "$$p $$p"; done | \ | ||
786 | sed 's/$(EXEEXT)$$//' | \ | ||
787 | while read p p1; do if test -f $$p || test -f $$p1; \ | ||
788 | then echo "$$p"; echo "$$p"; else :; fi; \ | ||
789 | done | \ | ||
790 | sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ | ||
791 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ | ||
792 | sed 'N;N;N;s,\n, ,g' | \ | ||
793 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ | ||
794 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ | ||
795 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ | ||
796 | else { print "f", $$3 "/" $$4, $$1; } } \ | ||
797 | END { for (d in files) print "f", d, files[d] }' | \ | ||
798 | while read type dir files; do \ | ||
799 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ | ||
800 | test -z "$$files" || { \ | ||
801 | echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibdir)$$dir'"; \ | ||
802 | $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibdir)$$dir" || exit $$?; \ | ||
803 | } \ | ||
804 | ; done | ||
805 | |||
806 | uninstall-pkglibPROGRAMS: | ||
807 | @$(NORMAL_UNINSTALL) | ||
808 | @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \ | ||
809 | files=`for p in $$list; do echo "$$p"; done | \ | ||
810 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ | ||
811 | -e 's/$$/$(EXEEXT)/' `; \ | ||
812 | test -n "$$list" || exit 0; \ | ||
813 | echo " ( cd '$(DESTDIR)$(pkglibdir)' && rm -f" $$files ")"; \ | ||
814 | cd "$(DESTDIR)$(pkglibdir)" && rm -f $$files | ||
815 | |||
816 | clean-pkglibPROGRAMS: | ||
817 | @list='$(pkglib_PROGRAMS)'; test -n "$$list" || exit 0; \ | ||
818 | echo " rm -f" $$list; \ | ||
819 | rm -f $$list || exit $$?; \ | ||
820 | test -n "$(EXEEXT)" || exit 0; \ | ||
821 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ | ||
822 | echo " rm -f" $$list; \ | ||
823 | rm -f $$list | ||
824 | ecore_animator_example$(EXEEXT): $(ecore_animator_example_OBJECTS) $(ecore_animator_example_DEPENDENCIES) | ||
825 | @rm -f ecore_animator_example$(EXEEXT) | ||
826 | $(AM_V_CCLD)$(LINK) $(ecore_animator_example_OBJECTS) $(ecore_animator_example_LDADD) $(LIBS) | ||
827 | ecore_client_bench$(EXEEXT): $(ecore_client_bench_OBJECTS) $(ecore_client_bench_DEPENDENCIES) | ||
828 | @rm -f ecore_client_bench$(EXEEXT) | ||
829 | $(AM_V_CCLD)$(LINK) $(ecore_client_bench_OBJECTS) $(ecore_client_bench_LDADD) $(LIBS) | ||
830 | ecore_con_client_simple_example$(EXEEXT): $(ecore_con_client_simple_example_OBJECTS) $(ecore_con_client_simple_example_DEPENDENCIES) | ||
831 | @rm -f ecore_con_client_simple_example$(EXEEXT) | ||
832 | $(AM_V_CCLD)$(LINK) $(ecore_con_client_simple_example_OBJECTS) $(ecore_con_client_simple_example_LDADD) $(LIBS) | ||
833 | ecore_con_lookup_example$(EXEEXT): $(ecore_con_lookup_example_OBJECTS) $(ecore_con_lookup_example_DEPENDENCIES) | ||
834 | @rm -f ecore_con_lookup_example$(EXEEXT) | ||
835 | $(AM_V_CCLD)$(LINK) $(ecore_con_lookup_example_OBJECTS) $(ecore_con_lookup_example_LDADD) $(LIBS) | ||
836 | ecore_con_server_http_example$(EXEEXT): $(ecore_con_server_http_example_OBJECTS) $(ecore_con_server_http_example_DEPENDENCIES) | ||
837 | @rm -f ecore_con_server_http_example$(EXEEXT) | ||
838 | $(AM_V_CCLD)$(LINK) $(ecore_con_server_http_example_OBJECTS) $(ecore_con_server_http_example_LDADD) $(LIBS) | ||
839 | ecore_con_server_simple_example$(EXEEXT): $(ecore_con_server_simple_example_OBJECTS) $(ecore_con_server_simple_example_DEPENDENCIES) | ||
840 | @rm -f ecore_con_server_simple_example$(EXEEXT) | ||
841 | $(AM_V_CCLD)$(LINK) $(ecore_con_server_simple_example_OBJECTS) $(ecore_con_server_simple_example_LDADD) $(LIBS) | ||
842 | ecore_con_url_cookies_example$(EXEEXT): $(ecore_con_url_cookies_example_OBJECTS) $(ecore_con_url_cookies_example_DEPENDENCIES) | ||
843 | @rm -f ecore_con_url_cookies_example$(EXEEXT) | ||
844 | $(AM_V_CCLD)$(LINK) $(ecore_con_url_cookies_example_OBJECTS) $(ecore_con_url_cookies_example_LDADD) $(LIBS) | ||
845 | ecore_con_url_download_example$(EXEEXT): $(ecore_con_url_download_example_OBJECTS) $(ecore_con_url_download_example_DEPENDENCIES) | ||
846 | @rm -f ecore_con_url_download_example$(EXEEXT) | ||
847 | $(AM_V_CCLD)$(LINK) $(ecore_con_url_download_example_OBJECTS) $(ecore_con_url_download_example_LDADD) $(LIBS) | ||
848 | ecore_con_url_headers_example$(EXEEXT): $(ecore_con_url_headers_example_OBJECTS) $(ecore_con_url_headers_example_DEPENDENCIES) | ||
849 | @rm -f ecore_con_url_headers_example$(EXEEXT) | ||
850 | $(AM_V_CCLD)$(LINK) $(ecore_con_url_headers_example_OBJECTS) $(ecore_con_url_headers_example_LDADD) $(LIBS) | ||
851 | ecore_evas_basics_example$(EXEEXT): $(ecore_evas_basics_example_OBJECTS) $(ecore_evas_basics_example_DEPENDENCIES) | ||
852 | @rm -f ecore_evas_basics_example$(EXEEXT) | ||
853 | $(AM_V_CCLD)$(LINK) $(ecore_evas_basics_example_OBJECTS) $(ecore_evas_basics_example_LDADD) $(LIBS) | ||
854 | ecore_evas_buffer_example_01$(EXEEXT): $(ecore_evas_buffer_example_01_OBJECTS) $(ecore_evas_buffer_example_01_DEPENDENCIES) | ||
855 | @rm -f ecore_evas_buffer_example_01$(EXEEXT) | ||
856 | $(AM_V_CCLD)$(LINK) $(ecore_evas_buffer_example_01_OBJECTS) $(ecore_evas_buffer_example_01_LDADD) $(LIBS) | ||
857 | ecore_evas_buffer_example_02$(EXEEXT): $(ecore_evas_buffer_example_02_OBJECTS) $(ecore_evas_buffer_example_02_DEPENDENCIES) | ||
858 | @rm -f ecore_evas_buffer_example_02$(EXEEXT) | ||
859 | $(AM_V_CCLD)$(LINK) $(ecore_evas_buffer_example_02_OBJECTS) $(ecore_evas_buffer_example_02_LDADD) $(LIBS) | ||
860 | ecore_evas_callbacks$(EXEEXT): $(ecore_evas_callbacks_OBJECTS) $(ecore_evas_callbacks_DEPENDENCIES) | ||
861 | @rm -f ecore_evas_callbacks$(EXEEXT) | ||
862 | $(AM_V_CCLD)$(LINK) $(ecore_evas_callbacks_OBJECTS) $(ecore_evas_callbacks_LDADD) $(LIBS) | ||
863 | ecore_evas_ews_example$(EXEEXT): $(ecore_evas_ews_example_OBJECTS) $(ecore_evas_ews_example_DEPENDENCIES) | ||
864 | @rm -f ecore_evas_ews_example$(EXEEXT) | ||
865 | $(AM_V_CCLD)$(LINK) $(ecore_evas_ews_example_OBJECTS) $(ecore_evas_ews_example_LDADD) $(LIBS) | ||
866 | ecore_evas_object_example$(EXEEXT): $(ecore_evas_object_example_OBJECTS) $(ecore_evas_object_example_DEPENDENCIES) | ||
867 | @rm -f ecore_evas_object_example$(EXEEXT) | ||
868 | $(AM_V_CCLD)$(LINK) $(ecore_evas_object_example_OBJECTS) $(ecore_evas_object_example_LDADD) $(LIBS) | ||
869 | ecore_evas_window_sizes_example$(EXEEXT): $(ecore_evas_window_sizes_example_OBJECTS) $(ecore_evas_window_sizes_example_DEPENDENCIES) | ||
870 | @rm -f ecore_evas_window_sizes_example$(EXEEXT) | ||
871 | $(AM_V_CCLD)$(LINK) $(ecore_evas_window_sizes_example_OBJECTS) $(ecore_evas_window_sizes_example_LDADD) $(LIBS) | ||
872 | ecore_event_example$(EXEEXT): $(ecore_event_example_OBJECTS) $(ecore_event_example_DEPENDENCIES) | ||
873 | @rm -f ecore_event_example$(EXEEXT) | ||
874 | $(AM_V_CCLD)$(LINK) $(ecore_event_example_OBJECTS) $(ecore_event_example_LDADD) $(LIBS) | ||
875 | ecore_fd_handler_example$(EXEEXT): $(ecore_fd_handler_example_OBJECTS) $(ecore_fd_handler_example_DEPENDENCIES) | ||
876 | @rm -f ecore_fd_handler_example$(EXEEXT) | ||
877 | $(AM_V_CCLD)$(LINK) $(ecore_fd_handler_example_OBJECTS) $(ecore_fd_handler_example_LDADD) $(LIBS) | ||
878 | ecore_idler_example$(EXEEXT): $(ecore_idler_example_OBJECTS) $(ecore_idler_example_DEPENDENCIES) | ||
879 | @rm -f ecore_idler_example$(EXEEXT) | ||
880 | $(AM_V_CCLD)$(LINK) $(ecore_idler_example_OBJECTS) $(ecore_idler_example_LDADD) $(LIBS) | ||
881 | ecore_job_example$(EXEEXT): $(ecore_job_example_OBJECTS) $(ecore_job_example_DEPENDENCIES) | ||
882 | @rm -f ecore_job_example$(EXEEXT) | ||
883 | $(AM_V_CCLD)$(LINK) $(ecore_job_example_OBJECTS) $(ecore_job_example_LDADD) $(LIBS) | ||
884 | ecore_pipe_simple_example$(EXEEXT): $(ecore_pipe_simple_example_OBJECTS) $(ecore_pipe_simple_example_DEPENDENCIES) | ||
885 | @rm -f ecore_pipe_simple_example$(EXEEXT) | ||
886 | $(AM_V_CCLD)$(LINK) $(ecore_pipe_simple_example_OBJECTS) $(ecore_pipe_simple_example_LDADD) $(LIBS) | ||
887 | ecore_poller_example$(EXEEXT): $(ecore_poller_example_OBJECTS) $(ecore_poller_example_DEPENDENCIES) | ||
888 | @rm -f ecore_poller_example$(EXEEXT) | ||
889 | $(AM_V_CCLD)$(LINK) $(ecore_poller_example_OBJECTS) $(ecore_poller_example_LDADD) $(LIBS) | ||
890 | ecore_server_bench$(EXEEXT): $(ecore_server_bench_OBJECTS) $(ecore_server_bench_DEPENDENCIES) | ||
891 | @rm -f ecore_server_bench$(EXEEXT) | ||
892 | $(AM_V_CCLD)$(LINK) $(ecore_server_bench_OBJECTS) $(ecore_server_bench_LDADD) $(LIBS) | ||
893 | ecore_thread_example$(EXEEXT): $(ecore_thread_example_OBJECTS) $(ecore_thread_example_DEPENDENCIES) | ||
894 | @rm -f ecore_thread_example$(EXEEXT) | ||
895 | $(AM_V_CCLD)$(LINK) $(ecore_thread_example_OBJECTS) $(ecore_thread_example_LDADD) $(LIBS) | ||
896 | ecore_time_functions_example$(EXEEXT): $(ecore_time_functions_example_OBJECTS) $(ecore_time_functions_example_DEPENDENCIES) | ||
897 | @rm -f ecore_time_functions_example$(EXEEXT) | ||
898 | $(AM_V_CCLD)$(LINK) $(ecore_time_functions_example_OBJECTS) $(ecore_time_functions_example_LDADD) $(LIBS) | ||
899 | ecore_timer_example$(EXEEXT): $(ecore_timer_example_OBJECTS) $(ecore_timer_example_DEPENDENCIES) | ||
900 | @rm -f ecore_timer_example$(EXEEXT) | ||
901 | $(AM_V_CCLD)$(LINK) $(ecore_timer_example_OBJECTS) $(ecore_timer_example_LDADD) $(LIBS) | ||
902 | |||
903 | mostlyclean-compile: | ||
904 | -rm -f *.$(OBJEXT) | ||
905 | |||
906 | distclean-compile: | ||
907 | -rm -f *.tab.c | ||
908 | |||
909 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_animator_example.Po@am__quote@ | ||
910 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_client_bench.Po@am__quote@ | ||
911 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_con_client_simple_example.Po@am__quote@ | ||
912 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_con_lookup_example.Po@am__quote@ | ||
913 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_con_server_http_example.Po@am__quote@ | ||
914 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_con_server_simple_example.Po@am__quote@ | ||
915 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_con_url_cookies_example.Po@am__quote@ | ||
916 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_con_url_download_example.Po@am__quote@ | ||
917 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_con_url_headers_example.Po@am__quote@ | ||
918 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_basics_example.Po@am__quote@ | ||
919 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_buffer_example_01.Po@am__quote@ | ||
920 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_buffer_example_02.Po@am__quote@ | ||
921 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_callbacks.Po@am__quote@ | ||
922 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_ews_example.Po@am__quote@ | ||
923 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_object_example.Po@am__quote@ | ||
924 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_evas_window_sizes_example.Po@am__quote@ | ||
925 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_event_example.Po@am__quote@ | ||
926 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_fd_handler_example.Po@am__quote@ | ||
927 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_idler_example.Po@am__quote@ | ||
928 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_job_example.Po@am__quote@ | ||
929 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_pipe_simple_example.Po@am__quote@ | ||
930 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_poller_example.Po@am__quote@ | ||
931 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_server_bench.Po@am__quote@ | ||
932 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_thread_example.Po@am__quote@ | ||
933 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_time_functions_example.Po@am__quote@ | ||
934 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_timer_example.Po@am__quote@ | ||
935 | |||
936 | .c.o: | ||
937 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
938 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
939 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
940 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
941 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
942 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
943 | |||
944 | .c.obj: | ||
945 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
946 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
947 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
948 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
949 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
950 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
951 | |||
952 | .c.lo: | ||
953 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
954 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
955 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
956 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
957 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
958 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
959 | |||
960 | mostlyclean-libtool: | ||
961 | -rm -f *.lo | ||
962 | |||
963 | clean-libtool: | ||
964 | -rm -rf .libs _libs | ||
965 | install-filesDATA: $(files_DATA) | ||
966 | @$(NORMAL_INSTALL) | ||
967 | test -z "$(filesdir)" || $(MKDIR_P) "$(DESTDIR)$(filesdir)" | ||
968 | @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \ | ||
969 | for p in $$list; do \ | ||
970 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
971 | echo "$$d$$p"; \ | ||
972 | done | $(am__base_list) | \ | ||
973 | while read files; do \ | ||
974 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filesdir)'"; \ | ||
975 | $(INSTALL_DATA) $$files "$(DESTDIR)$(filesdir)" || exit $$?; \ | ||
976 | done | ||
977 | |||
978 | uninstall-filesDATA: | ||
979 | @$(NORMAL_UNINSTALL) | ||
980 | @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \ | ||
981 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | ||
982 | test -n "$$files" || exit 0; \ | ||
983 | echo " ( cd '$(DESTDIR)$(filesdir)' && rm -f" $$files ")"; \ | ||
984 | cd "$(DESTDIR)$(filesdir)" && rm -f $$files | ||
985 | |||
986 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
987 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
988 | unique=`for i in $$list; do \ | ||
989 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
990 | done | \ | ||
991 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
992 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
993 | mkid -fID $$unique | ||
994 | tags: TAGS | ||
995 | |||
996 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
997 | $(TAGS_FILES) $(LISP) | ||
998 | set x; \ | ||
999 | here=`pwd`; \ | ||
1000 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
1001 | unique=`for i in $$list; do \ | ||
1002 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
1003 | done | \ | ||
1004 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
1005 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
1006 | shift; \ | ||
1007 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
1008 | test -n "$$unique" || unique=$$empty_fix; \ | ||
1009 | if test $$# -gt 0; then \ | ||
1010 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
1011 | "$$@" $$unique; \ | ||
1012 | else \ | ||
1013 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
1014 | $$unique; \ | ||
1015 | fi; \ | ||
1016 | fi | ||
1017 | ctags: CTAGS | ||
1018 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
1019 | $(TAGS_FILES) $(LISP) | ||
1020 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
1021 | unique=`for i in $$list; do \ | ||
1022 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
1023 | done | \ | ||
1024 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
1025 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
1026 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
1027 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
1028 | $$unique | ||
1029 | |||
1030 | GTAGS: | ||
1031 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
1032 | && $(am__cd) $(top_srcdir) \ | ||
1033 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
1034 | |||
1035 | distclean-tags: | ||
1036 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
1037 | |||
1038 | distdir: $(DISTFILES) | ||
1039 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
1040 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
1041 | list='$(DISTFILES)'; \ | ||
1042 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
1043 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
1044 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
1045 | case $$dist_files in \ | ||
1046 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
1047 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
1048 | sort -u` ;; \ | ||
1049 | esac; \ | ||
1050 | for file in $$dist_files; do \ | ||
1051 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
1052 | if test -d $$d/$$file; then \ | ||
1053 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
1054 | if test -d "$(distdir)/$$file"; then \ | ||
1055 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
1056 | fi; \ | ||
1057 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
1058 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
1059 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
1060 | fi; \ | ||
1061 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
1062 | else \ | ||
1063 | test -f "$(distdir)/$$file" \ | ||
1064 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
1065 | || exit 1; \ | ||
1066 | fi; \ | ||
1067 | done | ||
1068 | check-am: all-am | ||
1069 | check: check-am | ||
1070 | all-am: Makefile $(PROGRAMS) $(DATA) | ||
1071 | installdirs: | ||
1072 | for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)"; do \ | ||
1073 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
1074 | done | ||
1075 | install: install-am | ||
1076 | install-exec: install-exec-am | ||
1077 | install-data: install-data-am | ||
1078 | uninstall: uninstall-am | ||
1079 | |||
1080 | install-am: all-am | ||
1081 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
1082 | |||
1083 | installcheck: installcheck-am | ||
1084 | install-strip: | ||
1085 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
1086 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
1087 | `test -z '$(STRIP)' || \ | ||
1088 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
1089 | mostlyclean-generic: | ||
1090 | |||
1091 | clean-generic: | ||
1092 | |||
1093 | distclean-generic: | ||
1094 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
1095 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
1096 | |||
1097 | maintainer-clean-generic: | ||
1098 | @echo "This command is intended for maintainers to use" | ||
1099 | @echo "it deletes files that may require special tools to rebuild." | ||
1100 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
1101 | clean: clean-am | ||
1102 | |||
1103 | clean-am: clean-generic clean-libtool clean-pkglibPROGRAMS \ | ||
1104 | mostlyclean-am | ||
1105 | |||
1106 | distclean: distclean-am | ||
1107 | -rm -rf ./$(DEPDIR) | ||
1108 | -rm -f Makefile | ||
1109 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
1110 | distclean-tags | ||
1111 | |||
1112 | dvi: dvi-am | ||
1113 | |||
1114 | dvi-am: | ||
1115 | |||
1116 | html: html-am | ||
1117 | |||
1118 | html-am: | ||
1119 | |||
1120 | info: info-am | ||
1121 | |||
1122 | info-am: | ||
1123 | |||
1124 | install-data-am: install-filesDATA | ||
1125 | |||
1126 | install-dvi: install-dvi-am | ||
1127 | |||
1128 | install-dvi-am: | ||
1129 | |||
1130 | install-exec-am: install-pkglibPROGRAMS | ||
1131 | |||
1132 | install-html: install-html-am | ||
1133 | |||
1134 | install-html-am: | ||
1135 | |||
1136 | install-info: install-info-am | ||
1137 | |||
1138 | install-info-am: | ||
1139 | |||
1140 | install-man: | ||
1141 | |||
1142 | install-pdf: install-pdf-am | ||
1143 | |||
1144 | install-pdf-am: | ||
1145 | |||
1146 | install-ps: install-ps-am | ||
1147 | |||
1148 | install-ps-am: | ||
1149 | |||
1150 | installcheck-am: | ||
1151 | |||
1152 | maintainer-clean: maintainer-clean-am | ||
1153 | -rm -rf ./$(DEPDIR) | ||
1154 | -rm -f Makefile | ||
1155 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
1156 | |||
1157 | mostlyclean: mostlyclean-am | ||
1158 | |||
1159 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
1160 | mostlyclean-libtool | ||
1161 | |||
1162 | pdf: pdf-am | ||
1163 | |||
1164 | pdf-am: | ||
1165 | |||
1166 | ps: ps-am | ||
1167 | |||
1168 | ps-am: | ||
1169 | |||
1170 | uninstall-am: uninstall-filesDATA uninstall-pkglibPROGRAMS | ||
1171 | |||
1172 | .MAKE: install-am install-strip | ||
1173 | |||
1174 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
1175 | clean-libtool clean-pkglibPROGRAMS ctags distclean \ | ||
1176 | distclean-compile distclean-generic distclean-libtool \ | ||
1177 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
1178 | install install-am install-data install-data-am install-dvi \ | ||
1179 | install-dvi-am install-exec install-exec-am install-filesDATA \ | ||
1180 | install-html install-html-am install-info install-info-am \ | ||
1181 | install-man install-pdf install-pdf-am install-pkglibPROGRAMS \ | ||
1182 | install-ps install-ps-am install-strip installcheck \ | ||
1183 | installcheck-am installdirs maintainer-clean \ | ||
1184 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
1185 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
1186 | tags uninstall uninstall-am uninstall-filesDATA \ | ||
1187 | uninstall-pkglibPROGRAMS | ||
1188 | |||
1189 | |||
1190 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
1191 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
1192 | .NOEXPORT: | ||
diff --git a/libraries/ecore/src/examples/ecore_animator_example.c b/libraries/ecore/src/examples/ecore_animator_example.c new file mode 100644 index 0000000..6352f20 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_animator_example.c | |||
@@ -0,0 +1,116 @@ | |||
1 | //Compile with: | ||
2 | //gcc -g -Wall `pkg-config --cflags --libs ecore-evas` -o ecore_animator_example ecore_animator_example.c | ||
3 | |||
4 | #include <Ecore.h> | ||
5 | #include <Ecore_Evas.h> | ||
6 | |||
7 | static Eina_Bool _advance_frame(void *data, double pos); | ||
8 | static Eina_Bool _advance_frame2(void *data, double pos); | ||
9 | static Eina_Bool _advance_frame3(void *data); | ||
10 | static Eina_Bool _start_second_anim(void *data); | ||
11 | static Eina_Bool _freeze_third_anim(void *data); | ||
12 | static Eina_Bool _thaw_third_anim(void *data); | ||
13 | |||
14 | int | ||
15 | main (int argc, char *argv[]) | ||
16 | { | ||
17 | Evas_Object *rect, *bg, *rect2; | ||
18 | Ecore_Evas *ee; | ||
19 | Evas *evas; | ||
20 | Ecore_Animator *anim; | ||
21 | |||
22 | ecore_evas_init(); | ||
23 | |||
24 | ee = ecore_evas_new(NULL, 0, 0, 300, 400, NULL); | ||
25 | ecore_evas_show(ee); | ||
26 | evas = ecore_evas_get(ee); | ||
27 | |||
28 | bg = evas_object_rectangle_add(evas); | ||
29 | evas_object_resize(bg, 300, 400); | ||
30 | evas_object_show(bg); | ||
31 | |||
32 | rect = evas_object_rectangle_add(evas); | ||
33 | evas_object_color_set(rect, 0, 0, 255, 255); | ||
34 | evas_object_resize(rect, 50, 50); | ||
35 | evas_object_show(rect); | ||
36 | |||
37 | rect2 = evas_object_rectangle_add(evas); | ||
38 | evas_object_color_set(rect2, 0, 55, 0, 255); | ||
39 | evas_object_resize(rect2, 50, 50); | ||
40 | evas_object_show(rect2); | ||
41 | |||
42 | ecore_animator_frametime_set(1./50); | ||
43 | ecore_animator_timeline_add(5, _advance_frame, rect); | ||
44 | |||
45 | anim = ecore_animator_add(_advance_frame3, rect2); | ||
46 | |||
47 | ecore_timer_add(10, _start_second_anim, rect); | ||
48 | ecore_timer_add(5, _freeze_third_anim, anim); | ||
49 | ecore_timer_add(10, _thaw_third_anim, anim); | ||
50 | ecore_main_loop_begin(); | ||
51 | |||
52 | evas_object_del(rect); | ||
53 | ecore_evas_free(ee); | ||
54 | ecore_animator_del(anim); | ||
55 | ecore_evas_shutdown(); | ||
56 | |||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | static Eina_Bool | ||
61 | _advance_frame(void *data, double pos) | ||
62 | { | ||
63 | double frame = pos; | ||
64 | frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_SPRING, 1.2, 15); | ||
65 | |||
66 | evas_object_resize(data, 50 * (1 + frame), 50 * (1 + frame)); | ||
67 | evas_object_move(data, 100 * frame, 100 * frame); | ||
68 | evas_object_color_set(data, 255 * frame, 0, 255 * (1 - frame), 255); | ||
69 | return EINA_TRUE; | ||
70 | } | ||
71 | |||
72 | static Eina_Bool | ||
73 | _start_second_anim(void *data) | ||
74 | { | ||
75 | ecore_animator_frametime_set(1./10); | ||
76 | ecore_animator_timeline_add(20, _advance_frame2, data); | ||
77 | return EINA_FALSE; | ||
78 | } | ||
79 | |||
80 | static Eina_Bool | ||
81 | _advance_frame2(void *data, double pos) | ||
82 | { | ||
83 | double frame = pos; | ||
84 | frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.2, 50); | ||
85 | |||
86 | evas_object_resize(data, 100 - (50 * frame), 100 - (50 * frame)); | ||
87 | evas_object_move(data, 100 * (1 - frame), 100 * (1 - frame)); | ||
88 | evas_object_color_set(data, 255 * (1 - frame), 0, 255 * frame, 255); | ||
89 | return EINA_TRUE; | ||
90 | } | ||
91 | |||
92 | static Eina_Bool | ||
93 | _advance_frame3(void *data) | ||
94 | { | ||
95 | static int x = 0; | ||
96 | |||
97 | if(x >= 250) | ||
98 | x = 0; | ||
99 | evas_object_move(data, ++x, 350); | ||
100 | |||
101 | return EINA_TRUE; | ||
102 | } | ||
103 | |||
104 | static Eina_Bool | ||
105 | _freeze_third_anim(void *data) | ||
106 | { | ||
107 | ecore_animator_freeze(data); | ||
108 | return EINA_FALSE; | ||
109 | } | ||
110 | |||
111 | static Eina_Bool | ||
112 | _thaw_third_anim(void *data) | ||
113 | { | ||
114 | ecore_animator_thaw(data); | ||
115 | return EINA_FALSE; | ||
116 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_client_bench.c b/libraries/ecore/src/examples/ecore_client_bench.c new file mode 100644 index 0000000..2a58dcf --- /dev/null +++ b/libraries/ecore/src/examples/ecore_client_bench.c | |||
@@ -0,0 +1,77 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Ecore.h> | ||
3 | #include <Ecore_Con.h> | ||
4 | |||
5 | /* Ecore_Con client example | ||
6 | * 2010 Mike Blumenkrantz | ||
7 | */ | ||
8 | |||
9 | #define NUM_CLIENTS 30000 | ||
10 | |||
11 | static Eina_Counter *counter; | ||
12 | static int add = 0; | ||
13 | static int del = 0; | ||
14 | |||
15 | Eina_Bool | ||
16 | _add(void *data, int type, Ecore_Con_Event_Server_Add *ev) | ||
17 | { | ||
18 | ++add; | ||
19 | printf("Connection #%i!\n", add); | ||
20 | if (add == NUM_CLIENTS) | ||
21 | ecore_main_loop_quit(); | ||
22 | |||
23 | return ECORE_CALLBACK_RENEW; | ||
24 | } | ||
25 | |||
26 | Eina_Bool | ||
27 | _del(void *data, int type, Ecore_Con_Event_Server_Add *ev) | ||
28 | { | ||
29 | ++del; | ||
30 | printf("Connection lost! #%i!\n", del); | ||
31 | |||
32 | return ECORE_CALLBACK_RENEW; | ||
33 | } | ||
34 | |||
35 | static void | ||
36 | _spawn(void *data) | ||
37 | { | ||
38 | int x; | ||
39 | |||
40 | for (x = 0; x < NUM_CLIENTS; x++) | ||
41 | { | ||
42 | // printf("Creating connection %i\n", x); | ||
43 | if (!ecore_con_server_connect(ECORE_CON_REMOTE_NODELAY, "127.0.0.1", 8080, NULL)) | ||
44 | { | ||
45 | printf("CRITICAL ERROR!\n" | ||
46 | "Could not create connection #%i!\n", x); | ||
47 | exit(1); | ||
48 | } | ||
49 | } | ||
50 | printf("***Job done***\n"); | ||
51 | } | ||
52 | |||
53 | int main(void) | ||
54 | { | ||
55 | double done; | ||
56 | eina_init(); | ||
57 | ecore_init(); | ||
58 | ecore_con_init(); | ||
59 | |||
60 | eina_log_domain_level_set("ecore_con", EINA_LOG_LEVEL_ERR); | ||
61 | eina_log_domain_level_set("eina", EINA_LOG_LEVEL_ERR); | ||
62 | counter = eina_counter_new("client"); | ||
63 | eina_counter_start(counter); | ||
64 | done = ecore_time_get(); | ||
65 | |||
66 | ecore_job_add(_spawn, NULL); | ||
67 | |||
68 | /* set event handler for server connect */ | ||
69 | ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_add, NULL); | ||
70 | ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_del, NULL); | ||
71 | |||
72 | /* start client */ | ||
73 | ecore_main_loop_begin(); | ||
74 | eina_counter_stop(counter, 1); | ||
75 | printf("\nTime elapsed for %i connections: %f seconds\n%s", NUM_CLIENTS, ecore_time_get() - done, eina_counter_dump(counter)); | ||
76 | return 0; | ||
77 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_client_example.c b/libraries/ecore/src/examples/ecore_con_client_example.c new file mode 100644 index 0000000..2f656c7 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_client_example.c | |||
@@ -0,0 +1,90 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Ecore.h> | ||
3 | #include <Ecore_Con.h> | ||
4 | |||
5 | /* Ecore_Con client example | ||
6 | * 2010 Mike Blumenkrantz | ||
7 | */ | ||
8 | |||
9 | /* comment if not using gnutls */ | ||
10 | static void | ||
11 | tls_log_func(int level, const char *str) | ||
12 | { | ||
13 | fprintf(stderr, "|<%d>| %s", level, str); | ||
14 | } | ||
15 | |||
16 | Eina_Bool | ||
17 | _add(void *data, int type, Ecore_Con_Event_Server_Add *ev) | ||
18 | { | ||
19 | printf("Server with ip %s connected!\n", ecore_con_server_ip_get(ev->server)); | ||
20 | ecore_con_server_send(ev->server, "hello!", 6); | ||
21 | ecore_con_server_flush(ev->server); | ||
22 | |||
23 | return ECORE_CALLBACK_RENEW; | ||
24 | } | ||
25 | |||
26 | |||
27 | Eina_Bool | ||
28 | _del(void *data, int type, Ecore_Con_Event_Server_Del *ev) | ||
29 | { | ||
30 | printf("Lost server with ip %s!\n", ecore_con_server_ip_get(ev->server)); | ||
31 | ecore_main_loop_quit(); | ||
32 | return ECORE_CALLBACK_RENEW; | ||
33 | } | ||
34 | |||
35 | Eina_Bool | ||
36 | _data(void *data, int type, Ecore_Con_Event_Server_Data *ev) | ||
37 | { | ||
38 | char fmt[128]; | ||
39 | |||
40 | snprintf(fmt, sizeof(fmt), | ||
41 | "Received %i bytes from server:\n" | ||
42 | ">>>>>\n" | ||
43 | "%%.%is\n" | ||
44 | ">>>>>\n", | ||
45 | ev->size, ev->size); | ||
46 | |||
47 | printf(fmt, ev->data); | ||
48 | return ECORE_CALLBACK_RENEW; | ||
49 | } | ||
50 | int main() | ||
51 | { | ||
52 | Ecore_Con_Server *svr; | ||
53 | Eina_Iterator *it; | ||
54 | const char *ca; | ||
55 | |||
56 | eina_init(); | ||
57 | ecore_init(); | ||
58 | ecore_con_init(); | ||
59 | |||
60 | /* comment if not using gnutls */ | ||
61 | gnutls_global_set_log_level(9); | ||
62 | gnutls_global_set_log_function(tls_log_func); | ||
63 | |||
64 | if (!(it = eina_file_ls("/etc/ssl/certs"))) | ||
65 | exit(1); | ||
66 | |||
67 | if (!(svr = ecore_con_server_connect(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_MIXED, "www.verisign.com", 443, NULL))) | ||
68 | exit(1); | ||
69 | |||
70 | /* add all the CAs */ | ||
71 | EINA_ITERATOR_FOREACH(it, ca) | ||
72 | { | ||
73 | if (!ecore_con_ssl_server_cafile_add(svr, ca)) | ||
74 | printf("Could not load CA: %s!\n", ca); | ||
75 | eina_stringshare_del(ca); | ||
76 | } | ||
77 | |||
78 | eina_iterator_free(it); | ||
79 | ecore_con_ssl_server_verify(svr); | ||
80 | |||
81 | /* set event handler for server connect */ | ||
82 | ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_add, NULL); | ||
83 | /* set event handler for server disconnect */ | ||
84 | ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL, (Ecore_Event_Handler_Cb)_del, NULL); | ||
85 | /* set event handler for receiving server data */ | ||
86 | ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA, (Ecore_Event_Handler_Cb)_data, NULL); | ||
87 | |||
88 | /* start client */ | ||
89 | ecore_main_loop_begin(); | ||
90 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_client_simple_example.c b/libraries/ecore/src/examples/ecore_con_client_simple_example.c new file mode 100644 index 0000000..f6eb257 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_client_simple_example.c | |||
@@ -0,0 +1,124 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Ecore.h> | ||
3 | #include <Ecore_Con.h> | ||
4 | |||
5 | #ifdef HAVE_CONFIG_H | ||
6 | # include "config.h" | ||
7 | #else | ||
8 | # define __UNUSED__ | ||
9 | #endif | ||
10 | |||
11 | struct _Server { | ||
12 | int sdata; | ||
13 | }; | ||
14 | |||
15 | Eina_Bool | ||
16 | _add(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Server_Add *ev) | ||
17 | { | ||
18 | char welcome[] = "hello! - sent from the client"; | ||
19 | struct _Server *server = malloc(sizeof(*server)); | ||
20 | server->sdata = 0; | ||
21 | |||
22 | ecore_con_server_data_set(ev->server, server); | ||
23 | printf("Server with ip %s, name %s, port %d, connected = %d!\n", | ||
24 | ecore_con_server_ip_get(ev->server), | ||
25 | ecore_con_server_name_get(ev->server), | ||
26 | ecore_con_server_port_get(ev->server), | ||
27 | ecore_con_server_connected_get(ev->server)); | ||
28 | ecore_con_server_send(ev->server, welcome, sizeof(welcome)); | ||
29 | ecore_con_server_flush(ev->server); | ||
30 | |||
31 | return ECORE_CALLBACK_RENEW; | ||
32 | } | ||
33 | |||
34 | |||
35 | Eina_Bool | ||
36 | _del(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Server_Del *ev) | ||
37 | { | ||
38 | if (!ev->server) | ||
39 | { | ||
40 | printf("Failed to establish connection to the server.\nExiting.\n"); | ||
41 | ecore_main_loop_quit(); | ||
42 | return ECORE_CALLBACK_RENEW; | ||
43 | } | ||
44 | |||
45 | struct _Server *server = ecore_con_server_data_get(ev->server); | ||
46 | |||
47 | printf("Lost server with ip %s!\n", ecore_con_server_ip_get(ev->server)); | ||
48 | |||
49 | if (server) | ||
50 | { | ||
51 | printf("Total data received from this server: %d\n", server->sdata); | ||
52 | free(server); | ||
53 | } | ||
54 | |||
55 | ecore_con_server_del(ev->server); | ||
56 | |||
57 | ecore_main_loop_quit(); | ||
58 | return ECORE_CALLBACK_RENEW; | ||
59 | } | ||
60 | |||
61 | Eina_Bool | ||
62 | _data(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Server_Data *ev) | ||
63 | { | ||
64 | char fmt[128]; | ||
65 | struct _Server *server = ecore_con_server_data_get(ev->server); | ||
66 | |||
67 | snprintf(fmt, sizeof(fmt), | ||
68 | "Received %i bytes from server:\n" | ||
69 | ">>>>>\n" | ||
70 | "%%.%is\n" | ||
71 | ">>>>>\n", | ||
72 | ev->size, ev->size); | ||
73 | |||
74 | printf(fmt, ev->data); | ||
75 | |||
76 | server->sdata += ev->size; | ||
77 | return ECORE_CALLBACK_RENEW; | ||
78 | } | ||
79 | |||
80 | int main(int argc, const char *argv[]) | ||
81 | { | ||
82 | Ecore_Con_Server *svr; | ||
83 | const char *address; | ||
84 | int port = 8080; | ||
85 | |||
86 | if (argc < 2) | ||
87 | { | ||
88 | printf("wrong usage. Command syntax is:\n"); | ||
89 | printf("\tecore_con_client_simple_example <address> [port]\n"); | ||
90 | exit (1); | ||
91 | } | ||
92 | |||
93 | address = argv[1]; | ||
94 | |||
95 | if (argc > 2) | ||
96 | port = atoi(argv[2]); | ||
97 | |||
98 | eina_init(); | ||
99 | ecore_init(); | ||
100 | ecore_con_init(); | ||
101 | |||
102 | if (!(svr = ecore_con_server_connect(ECORE_CON_REMOTE_TCP, address, port, NULL))) | ||
103 | { | ||
104 | printf("could not connect to the server: %s, port %d.\n", | ||
105 | address, port); | ||
106 | exit(2); | ||
107 | } | ||
108 | |||
109 | /* set event handler for server connect */ | ||
110 | ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_add, NULL); | ||
111 | /* set event handler for server disconnect */ | ||
112 | ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL, (Ecore_Event_Handler_Cb)_del, NULL); | ||
113 | /* set event handler for receiving server data */ | ||
114 | ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA, (Ecore_Event_Handler_Cb)_data, NULL); | ||
115 | |||
116 | /* start client */ | ||
117 | ecore_main_loop_begin(); | ||
118 | |||
119 | ecore_con_init(); | ||
120 | ecore_init(); | ||
121 | eina_init(); | ||
122 | |||
123 | return 0; | ||
124 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_lookup_example.c b/libraries/ecore/src/examples/ecore_con_lookup_example.c new file mode 100644 index 0000000..3a3d024 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_lookup_example.c | |||
@@ -0,0 +1,38 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Ecore.h> | ||
3 | #include <Ecore_Con.h> | ||
4 | |||
5 | static void | ||
6 | _lookup_done_cb(const char *canonname, const char *ip, struct sockaddr *addr, int addrlen, void *data) | ||
7 | { | ||
8 | printf("canonname = %s\n", canonname); | ||
9 | printf("ip = %s\n", ip); | ||
10 | printf("addr = %p\n", addr); | ||
11 | printf("addrlen = %d\n", addrlen); | ||
12 | } | ||
13 | |||
14 | int main(int argc, const char *argv[]) | ||
15 | { | ||
16 | if (argc < 2) | ||
17 | { | ||
18 | printf("need one parameter: <address>\n"); | ||
19 | return -1; | ||
20 | } | ||
21 | |||
22 | ecore_init(); | ||
23 | ecore_con_init(); | ||
24 | |||
25 | if (!ecore_con_lookup(argv[1], _lookup_done_cb, NULL)) | ||
26 | { | ||
27 | printf("error when trying to start lookup for %s\n", argv[1]); | ||
28 | goto end; | ||
29 | } | ||
30 | |||
31 | ecore_main_loop_begin(); | ||
32 | |||
33 | end: | ||
34 | ecore_con_shutdown(); | ||
35 | ecore_shutdown(); | ||
36 | |||
37 | return 0; | ||
38 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_server_example.c b/libraries/ecore/src/examples/ecore_con_server_example.c new file mode 100644 index 0000000..5423eb1 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_server_example.c | |||
@@ -0,0 +1,81 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Ecore.h> | ||
3 | #include <Ecore_Con.h> | ||
4 | |||
5 | /* Ecore_Con server example | ||
6 | * 2010 Mike Blumenkrantz | ||
7 | */ | ||
8 | |||
9 | /* comment if not using gnutls */ | ||
10 | static void | ||
11 | tls_log_func(int level, const char *str) | ||
12 | { | ||
13 | fprintf(stderr, "|<%d>| %s", level, str); | ||
14 | } | ||
15 | |||
16 | Eina_Bool | ||
17 | _add(void *data, int type, Ecore_Con_Event_Client_Add *ev) | ||
18 | { | ||
19 | printf("Client with ip %s connected!\n", ecore_con_client_ip_get(ev->client)); | ||
20 | ecore_con_client_send(ev->client, "hello!", 6); | ||
21 | // ecore_con_client_flush(ev->client); | ||
22 | ecore_con_client_timeout_set(ev->client, 5); | ||
23 | |||
24 | return ECORE_CALLBACK_RENEW; | ||
25 | } | ||
26 | |||
27 | |||
28 | Eina_Bool | ||
29 | _del(void *data, int type, Ecore_Con_Event_Client_Del *ev) | ||
30 | { | ||
31 | printf("Lost client with ip %s!\n", ecore_con_client_ip_get(ev->client)); | ||
32 | ecore_main_loop_quit(); | ||
33 | return ECORE_CALLBACK_RENEW; | ||
34 | } | ||
35 | |||
36 | Eina_Bool | ||
37 | _data(void *data, int type, Ecore_Con_Event_Client_Data *ev) | ||
38 | { | ||
39 | char fmt[128]; | ||
40 | |||
41 | snprintf(fmt, sizeof(fmt), | ||
42 | "Received %i bytes from client:\n" | ||
43 | ">>>>>\n" | ||
44 | "%%.%is\n" | ||
45 | ">>>>>\n", | ||
46 | ev->size, ev->size); | ||
47 | |||
48 | printf(fmt, ev->data); | ||
49 | return ECORE_CALLBACK_RENEW; | ||
50 | } | ||
51 | int main() | ||
52 | { | ||
53 | Ecore_Con_Server *svr; | ||
54 | eina_init(); | ||
55 | ecore_init(); | ||
56 | ecore_con_init(); | ||
57 | |||
58 | /* comment if not using gnutls */ | ||
59 | gnutls_global_set_log_level(9); | ||
60 | gnutls_global_set_log_function(tls_log_func); | ||
61 | |||
62 | |||
63 | /* to use a PEM certificate with TLS and SSL3, uncomment the lines below */ | ||
64 | if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_USE_SSL3 | ECORE_CON_LOAD_CERT, "127.0.0.1", 8080, NULL))) | ||
65 | |||
66 | /* to use simple tcp with ssl/tls, use this line */ | ||
67 | // if (!ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_SSL3, "127.0.0.1", 8080, NULL)) | ||
68 | exit(1); | ||
69 | |||
70 | ecore_con_ssl_server_cert_add(svr, "server.pem"); | ||
71 | ecore_con_ssl_server_privkey_add(svr, "server.pem"); | ||
72 | /* set event handler for client connect */ | ||
73 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_add, NULL); | ||
74 | /* set event handler for client disconnect */ | ||
75 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb)_del, NULL); | ||
76 | /* set event handler for receiving client data */ | ||
77 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb)_data, NULL); | ||
78 | |||
79 | /* start server */ | ||
80 | ecore_main_loop_begin(); | ||
81 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_server_http_example.c b/libraries/ecore/src/examples/ecore_con_server_http_example.c new file mode 100644 index 0000000..d3fdeee --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_server_http_example.c | |||
@@ -0,0 +1,135 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <sys/time.h> | ||
3 | #include <Ecore.h> | ||
4 | #include <Ecore_Con.h> | ||
5 | |||
6 | #ifdef HAVE_CONFIG_H | ||
7 | # include "config.h" | ||
8 | #else | ||
9 | # define __UNUSED__ | ||
10 | #endif | ||
11 | |||
12 | static const char response_template[] = | ||
13 | "HTTP/1.0 200 OK\r\n" | ||
14 | "Server: Ecore_Con custom server\r\n" | ||
15 | "Content-Length: %zd\r\n" | ||
16 | "Content-Type: text/html; charset=UTF-8\r\n" | ||
17 | "Set-Cookie: MYCOOKIE=1; path=/; expires=%s\r\n" | ||
18 | "Set-Cookie: SESSIONCOOKIE=1; path=/\r\n" | ||
19 | "\r\n" | ||
20 | "%s"; | ||
21 | |||
22 | struct _Client { | ||
23 | int sdata; | ||
24 | }; | ||
25 | |||
26 | Eina_Bool | ||
27 | _add(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev) | ||
28 | { | ||
29 | struct _Client *client = malloc(sizeof(*client)); | ||
30 | client->sdata = 0; | ||
31 | static char buf[4096]; | ||
32 | char welcome[] = "Welcome to Ecore_Con server!"; | ||
33 | time_t t; | ||
34 | |||
35 | printf("Client with ip %s, port %d, connected = %d!\n", | ||
36 | ecore_con_client_ip_get(ev->client), | ||
37 | ecore_con_client_port_get(ev->client), | ||
38 | ecore_con_client_connected_get(ev->client)); | ||
39 | |||
40 | ecore_con_client_data_set(ev->client, client); | ||
41 | |||
42 | t = time(NULL); | ||
43 | t += 60 * 60 * 24; | ||
44 | snprintf(buf, sizeof(buf), response_template, sizeof(welcome) - 1, ctime(&t), welcome); | ||
45 | |||
46 | ecore_con_client_send(ev->client, buf, strlen(buf)); | ||
47 | ecore_con_client_flush(ev->client); | ||
48 | |||
49 | |||
50 | return ECORE_CALLBACK_RENEW; | ||
51 | } | ||
52 | |||
53 | |||
54 | Eina_Bool | ||
55 | _del(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Del *ev) | ||
56 | { | ||
57 | struct _Client *client; | ||
58 | |||
59 | if (!ev->client) | ||
60 | return ECORE_CALLBACK_RENEW; | ||
61 | |||
62 | client = ecore_con_client_data_get(ev->client); | ||
63 | |||
64 | printf("Lost client with ip %s!\n", ecore_con_client_ip_get(ev->client)); | ||
65 | printf("Total data received from this client: %d\n", client->sdata); | ||
66 | printf("Client was connected for %0.3f seconds.\n", | ||
67 | ecore_con_client_uptime_get(ev->client)); | ||
68 | |||
69 | if (client) | ||
70 | free(client); | ||
71 | |||
72 | ecore_con_client_del(ev->client); | ||
73 | |||
74 | return ECORE_CALLBACK_RENEW; | ||
75 | } | ||
76 | |||
77 | Eina_Bool | ||
78 | _data(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Data *ev) | ||
79 | { | ||
80 | char fmt[128]; | ||
81 | struct _Client *client = ecore_con_client_data_get(ev->client); | ||
82 | |||
83 | snprintf(fmt, sizeof(fmt), | ||
84 | "\nReceived %i bytes from client %s port %d:\n" | ||
85 | ">>>>>\n" | ||
86 | "%%.%is\n" | ||
87 | ">>>>>\n\n", | ||
88 | ev->size, ecore_con_client_ip_get(ev->client), | ||
89 | ecore_con_client_port_get(ev->client), ev->size); | ||
90 | |||
91 | printf(fmt, ev->data); | ||
92 | |||
93 | client->sdata += ev->size; | ||
94 | |||
95 | return ECORE_CALLBACK_RENEW; | ||
96 | } | ||
97 | |||
98 | int main(void) | ||
99 | { | ||
100 | Ecore_Con_Server *svr; | ||
101 | Ecore_Con_Client *cl; | ||
102 | const Eina_List *clients, *l; | ||
103 | |||
104 | eina_init(); | ||
105 | ecore_init(); | ||
106 | ecore_con_init(); | ||
107 | |||
108 | if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 8080, NULL))) | ||
109 | exit(1); | ||
110 | |||
111 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_add, NULL); | ||
112 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb)_del, NULL); | ||
113 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb)_data, NULL); | ||
114 | ecore_con_server_client_limit_set(svr, 3, 0); | ||
115 | |||
116 | ecore_main_loop_begin(); | ||
117 | |||
118 | clients = ecore_con_server_clients_get(svr); | ||
119 | printf("Clients still connected to this server when exiting: %d\n", | ||
120 | eina_list_count(clients)); | ||
121 | EINA_LIST_FOREACH(clients, l, cl) | ||
122 | { | ||
123 | printf("%s\n", ecore_con_client_ip_get(cl)); | ||
124 | free(ecore_con_client_data_get(cl)); | ||
125 | } | ||
126 | |||
127 | printf("Server was up for %0.3f seconds\n", | ||
128 | ecore_con_server_uptime_get(svr)); | ||
129 | |||
130 | ecore_con_shutdown(); | ||
131 | ecore_shutdown(); | ||
132 | eina_shutdown(); | ||
133 | |||
134 | return 0; | ||
135 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_server_simple_example.c b/libraries/ecore/src/examples/ecore_con_server_simple_example.c new file mode 100644 index 0000000..e466ed4 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_server_simple_example.c | |||
@@ -0,0 +1,131 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Ecore.h> | ||
3 | #include <Ecore_Con.h> | ||
4 | |||
5 | #ifdef HAVE_CONFIG_H | ||
6 | # include "config.h" | ||
7 | #else | ||
8 | # define __UNUSED__ | ||
9 | #endif | ||
10 | |||
11 | struct _Client { | ||
12 | int sdata; | ||
13 | }; | ||
14 | |||
15 | Eina_Bool | ||
16 | _add(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev) | ||
17 | { | ||
18 | char welcome[] = "hello! - sent from the server"; | ||
19 | Ecore_Con_Server *srv; | ||
20 | Ecore_Con_Client *cl; | ||
21 | const Eina_List *clients, *l; | ||
22 | |||
23 | struct _Client *client = malloc(sizeof(*client)); | ||
24 | client->sdata = 0; | ||
25 | |||
26 | printf("Client with ip %s, port %d, connected = %d!\n", | ||
27 | ecore_con_client_ip_get(ev->client), | ||
28 | ecore_con_client_port_get(ev->client), | ||
29 | ecore_con_client_connected_get(ev->client)); | ||
30 | |||
31 | ecore_con_client_send(ev->client, welcome, sizeof(welcome)); | ||
32 | ecore_con_client_flush(ev->client); | ||
33 | |||
34 | ecore_con_client_timeout_set(ev->client, 6); | ||
35 | |||
36 | ecore_con_client_data_set(ev->client, client); | ||
37 | |||
38 | srv = ecore_con_client_server_get(ev->client); | ||
39 | printf("Clients connected to this server:\n"); | ||
40 | clients = ecore_con_server_clients_get(srv); | ||
41 | EINA_LIST_FOREACH(clients, l, cl) | ||
42 | printf("%s\n", ecore_con_client_ip_get(cl)); | ||
43 | |||
44 | return ECORE_CALLBACK_RENEW; | ||
45 | } | ||
46 | |||
47 | |||
48 | Eina_Bool | ||
49 | _del(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Del *ev) | ||
50 | { | ||
51 | struct _Client *client; | ||
52 | |||
53 | if (!ev->client) | ||
54 | return ECORE_CALLBACK_RENEW; | ||
55 | |||
56 | client = ecore_con_client_data_get(ev->client); | ||
57 | |||
58 | printf("Lost client with ip %s!\n", ecore_con_client_ip_get(ev->client)); | ||
59 | printf("Total data received from this client: %d\n", client->sdata); | ||
60 | printf("Client was connected for %0.3f seconds.\n", | ||
61 | ecore_con_client_uptime_get(ev->client)); | ||
62 | |||
63 | if (client) | ||
64 | free(client); | ||
65 | |||
66 | ecore_con_client_del(ev->client); | ||
67 | |||
68 | return ECORE_CALLBACK_RENEW; | ||
69 | } | ||
70 | |||
71 | Eina_Bool | ||
72 | _data(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Data *ev) | ||
73 | { | ||
74 | char fmt[128]; | ||
75 | struct _Client *client = ecore_con_client_data_get(ev->client); | ||
76 | |||
77 | snprintf(fmt, sizeof(fmt), | ||
78 | "Received %i bytes from client %s port %d:\n" | ||
79 | ">>>>>\n" | ||
80 | "%%.%is\n" | ||
81 | ">>>>>\n", | ||
82 | ev->size, ecore_con_client_ip_get(ev->client), | ||
83 | ecore_con_client_port_get(ev->client), ev->size); | ||
84 | |||
85 | printf(fmt, ev->data); | ||
86 | |||
87 | client->sdata += ev->size; | ||
88 | |||
89 | return ECORE_CALLBACK_RENEW; | ||
90 | } | ||
91 | |||
92 | int main(void) | ||
93 | { | ||
94 | Ecore_Con_Server *svr; | ||
95 | Ecore_Con_Client *cl; | ||
96 | const Eina_List *clients, *l; | ||
97 | |||
98 | eina_init(); | ||
99 | ecore_init(); | ||
100 | ecore_con_init(); | ||
101 | |||
102 | if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 8080, NULL))) | ||
103 | exit(1); | ||
104 | |||
105 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_add, NULL); | ||
106 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb)_del, NULL); | ||
107 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb)_data, NULL); | ||
108 | |||
109 | ecore_con_server_timeout_set(svr, 10); | ||
110 | ecore_con_server_client_limit_set(svr, 3, 0); | ||
111 | |||
112 | ecore_main_loop_begin(); | ||
113 | |||
114 | clients = ecore_con_server_clients_get(svr); | ||
115 | printf("Clients connected to this server when exiting: %d\n", | ||
116 | eina_list_count(clients)); | ||
117 | EINA_LIST_FOREACH(clients, l, cl) | ||
118 | { | ||
119 | printf("%s\n", ecore_con_client_ip_get(cl)); | ||
120 | free(ecore_con_client_data_get(cl)); | ||
121 | } | ||
122 | |||
123 | printf("Server was up for %0.3f seconds\n", | ||
124 | ecore_con_server_uptime_get(svr)); | ||
125 | |||
126 | ecore_con_shutdown(); | ||
127 | ecore_shutdown(); | ||
128 | eina_shutdown(); | ||
129 | |||
130 | return 0; | ||
131 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_url_cookies_example.c b/libraries/ecore/src/examples/ecore_con_url_cookies_example.c new file mode 100644 index 0000000..64f37d2 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_url_cookies_example.c | |||
@@ -0,0 +1,119 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Eina.h> | ||
3 | #include <Ecore.h> | ||
4 | #include <Ecore_Con.h> | ||
5 | |||
6 | #ifdef HAVE_CONFIG_H | ||
7 | # include "config.h" | ||
8 | #else | ||
9 | # define __UNUSED__ | ||
10 | #endif | ||
11 | |||
12 | #define COOKIEJAR "cookies.jar" | ||
13 | |||
14 | static Eina_Bool | ||
15 | _url_data_cb(void *data __UNUSED__, int type __UNUSED__, void *event_info) | ||
16 | { | ||
17 | Ecore_Con_Event_Url_Data *url_data = event_info; | ||
18 | int i; | ||
19 | |||
20 | printf("\nData received from server:\n>>>>>\n"); | ||
21 | for (i = 0; i < url_data->size; i++) | ||
22 | printf("%c", url_data->data[i]); | ||
23 | printf("\n>>>>>>\n\n"); | ||
24 | |||
25 | return EINA_TRUE; | ||
26 | } | ||
27 | |||
28 | static Eina_Bool | ||
29 | _url_complete_cb(void *data __UNUSED__, int type __UNUSED__, void *event_info) | ||
30 | { | ||
31 | Ecore_Con_Event_Url_Complete *url_complete = event_info; | ||
32 | const Eina_List *headers, *l; | ||
33 | char *str; | ||
34 | |||
35 | printf("\n"); | ||
36 | printf("download completed with status code: %d\n", url_complete->status); | ||
37 | |||
38 | headers = ecore_con_url_response_headers_get(url_complete->url_con); | ||
39 | |||
40 | printf("response headers:\n"); | ||
41 | EINA_LIST_FOREACH(headers, l, str) | ||
42 | printf("header: %s", str); | ||
43 | |||
44 | ecore_con_url_cookies_jar_write(url_complete->url_con); | ||
45 | |||
46 | ecore_main_loop_quit(); | ||
47 | |||
48 | return EINA_TRUE; | ||
49 | } | ||
50 | |||
51 | int main(int argc, const char *argv[]) | ||
52 | { | ||
53 | Ecore_Con_Url *ec_url = NULL; | ||
54 | char cmd = '\0'; | ||
55 | Eina_Bool r; | ||
56 | |||
57 | if (argc < 2) | ||
58 | { | ||
59 | printf("need at least one parameter: <url> [command]\n"); | ||
60 | return -1; | ||
61 | } | ||
62 | |||
63 | if (argc > 2) | ||
64 | cmd = argv[2][0]; | ||
65 | |||
66 | ecore_init(); | ||
67 | ecore_con_init(); | ||
68 | ecore_con_url_init(); | ||
69 | |||
70 | ec_url = ecore_con_url_new(argv[1]); | ||
71 | if (!ec_url) | ||
72 | { | ||
73 | printf("error when creating ecore con url object.\n"); | ||
74 | goto end; | ||
75 | } | ||
76 | |||
77 | ecore_event_handler_add(ECORE_CON_EVENT_URL_DATA, _url_data_cb, NULL); | ||
78 | ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _url_complete_cb, NULL); | ||
79 | |||
80 | ecore_con_url_additional_header_add(ec_url, "User-Agent", "Ecore_Con client"); | ||
81 | |||
82 | ecore_con_url_cookies_init(ec_url); | ||
83 | if (cmd != 'c' && cmd != 's') | ||
84 | ecore_con_url_cookies_file_add(ec_url, COOKIEJAR); | ||
85 | ecore_con_url_cookies_jar_file_set(ec_url, COOKIEJAR); | ||
86 | |||
87 | switch (cmd) | ||
88 | { | ||
89 | case 'c': // clear | ||
90 | printf("Cleaning previously set cookies.\n"); | ||
91 | ecore_con_url_cookies_clear(ec_url); | ||
92 | break; | ||
93 | case 's': // clear session | ||
94 | printf("Cleaning previously set session cookies.\n"); | ||
95 | ecore_con_url_cookies_session_clear(ec_url); | ||
96 | break; | ||
97 | case 'i': // ignore session | ||
98 | printf("Ignoring old session cookies.\n"); | ||
99 | ecore_con_url_cookies_ignore_old_session_set(ec_url, EINA_TRUE); | ||
100 | } | ||
101 | |||
102 | r = ecore_con_url_get(ec_url); | ||
103 | if (!r) | ||
104 | { | ||
105 | printf("could not realize request.\n"); | ||
106 | goto free_ec_url; | ||
107 | } | ||
108 | |||
109 | ecore_main_loop_begin(); | ||
110 | |||
111 | free_ec_url: | ||
112 | ecore_con_url_free(ec_url); | ||
113 | end: | ||
114 | ecore_con_url_shutdown(); | ||
115 | ecore_con_shutdown(); | ||
116 | ecore_shutdown(); | ||
117 | |||
118 | return 0; | ||
119 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_url_download_example.c b/libraries/ecore/src/examples/ecore_con_url_download_example.c new file mode 100644 index 0000000..0cb81e1 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_url_download_example.c | |||
@@ -0,0 +1,110 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <sys/types.h> | ||
3 | #include <sys/stat.h> | ||
4 | #include <fcntl.h> | ||
5 | #include <Ecore.h> | ||
6 | #include <Ecore_Con.h> | ||
7 | |||
8 | struct _request { | ||
9 | long size; | ||
10 | }; | ||
11 | |||
12 | static Eina_Bool | ||
13 | _url_progress_cb(void *data, int type, void *event_info) | ||
14 | { | ||
15 | Ecore_Con_Event_Url_Progress *url_progress = event_info; | ||
16 | float percent; | ||
17 | |||
18 | if (url_progress->down.total > 0) | ||
19 | { | ||
20 | struct _request *req = ecore_con_url_data_get(url_progress->url_con); | ||
21 | req->size = url_progress->down.now; | ||
22 | |||
23 | percent = (url_progress->down.now / url_progress->down.total) * 100; | ||
24 | printf("Total of download complete: %0.1f (%0.0f)%%\n", | ||
25 | percent, url_progress->down.now); | ||
26 | } | ||
27 | |||
28 | return EINA_TRUE; | ||
29 | } | ||
30 | |||
31 | static Eina_Bool | ||
32 | _url_complete_cb(void *data, int type, void *event_info) | ||
33 | { | ||
34 | Ecore_Con_Event_Url_Complete *url_complete = event_info; | ||
35 | |||
36 | struct _request *req = ecore_con_url_data_get(url_complete->url_con); | ||
37 | int nbytes = ecore_con_url_received_bytes_get(url_complete->url_con); | ||
38 | |||
39 | printf("\n"); | ||
40 | printf("download completed with status code: %d\n", url_complete->status); | ||
41 | printf("Total size of downloaded file: %ld bytes\n", req->size); | ||
42 | printf("Total size of downloaded file: %ld bytes " | ||
43 | "(from received_bytes_get)\n", nbytes); | ||
44 | ecore_main_loop_quit(); | ||
45 | |||
46 | return EINA_TRUE; | ||
47 | } | ||
48 | |||
49 | int main(int argc, const char *argv[]) | ||
50 | { | ||
51 | Ecore_Con_Url *ec_url = NULL; | ||
52 | struct _request *req; | ||
53 | int fd; | ||
54 | const char *filename = "downloadedfile.dat"; | ||
55 | |||
56 | if (argc < 2) | ||
57 | { | ||
58 | printf("need one parameter: <url>\n"); | ||
59 | return -1; | ||
60 | } | ||
61 | |||
62 | fd = open(filename, O_CREAT|O_WRONLY|O_TRUNC, 0644); | ||
63 | |||
64 | if (fd == -1) | ||
65 | { | ||
66 | printf("error: could not open file for writing: \"%s\"\n", | ||
67 | filename); | ||
68 | return -1; | ||
69 | } | ||
70 | |||
71 | ecore_init(); | ||
72 | ecore_con_init(); | ||
73 | ecore_con_url_init(); | ||
74 | |||
75 | ec_url = ecore_con_url_new(argv[1]); | ||
76 | if (!ec_url) | ||
77 | { | ||
78 | printf("error when creating ecore con url object.\n"); | ||
79 | goto end; | ||
80 | } | ||
81 | |||
82 | req = malloc(sizeof(*req)); | ||
83 | req->size = 0; | ||
84 | ecore_con_url_data_set(ec_url, req); | ||
85 | |||
86 | ecore_con_url_fd_set(ec_url, fd); | ||
87 | |||
88 | ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _url_progress_cb, NULL); | ||
89 | ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _url_complete_cb, NULL); | ||
90 | |||
91 | if (!ecore_con_url_get(ec_url)) | ||
92 | { | ||
93 | printf("could not realize request.\n"); | ||
94 | goto free_ec_url; | ||
95 | } | ||
96 | |||
97 | ecore_main_loop_begin(); | ||
98 | |||
99 | free_ec_url: | ||
100 | free(req); | ||
101 | ecore_con_url_free(ec_url); | ||
102 | end: | ||
103 | |||
104 | close(fd); | ||
105 | ecore_con_url_shutdown(); | ||
106 | ecore_con_shutdown(); | ||
107 | ecore_shutdown(); | ||
108 | |||
109 | return 0; | ||
110 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_con_url_headers_example.c b/libraries/ecore/src/examples/ecore_con_url_headers_example.c new file mode 100644 index 0000000..262823b --- /dev/null +++ b/libraries/ecore/src/examples/ecore_con_url_headers_example.c | |||
@@ -0,0 +1,104 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Eina.h> | ||
3 | #include <Ecore.h> | ||
4 | #include <Ecore_Con.h> | ||
5 | |||
6 | static Eina_Bool | ||
7 | _url_data_cb(void *data, int type, void *event_info) | ||
8 | { | ||
9 | Ecore_Con_Event_Url_Data *url_data = event_info; | ||
10 | int i; | ||
11 | |||
12 | for (i = 0; i < url_data->size; i++) | ||
13 | printf("%c", url_data->data[i]); | ||
14 | |||
15 | return EINA_TRUE; | ||
16 | } | ||
17 | |||
18 | static Eina_Bool | ||
19 | _url_complete_cb(void *data, int type, void *event_info) | ||
20 | { | ||
21 | Ecore_Con_Event_Url_Complete *url_complete = event_info; | ||
22 | const Eina_List *headers, *l; | ||
23 | char *str; | ||
24 | |||
25 | printf("\n"); | ||
26 | printf("download completed with status code: %d\n", url_complete->status); | ||
27 | |||
28 | headers = ecore_con_url_response_headers_get(url_complete->url_con); | ||
29 | |||
30 | EINA_LIST_FOREACH(headers, l, str) | ||
31 | printf("header: %s\n", str); | ||
32 | |||
33 | ecore_main_loop_quit(); | ||
34 | |||
35 | return EINA_TRUE; | ||
36 | } | ||
37 | |||
38 | int main(int argc, const char *argv[]) | ||
39 | { | ||
40 | Ecore_Con_Url *ec_url = NULL; | ||
41 | const char *type; | ||
42 | Eina_Bool r; | ||
43 | |||
44 | if (argc < 3) | ||
45 | { | ||
46 | printf("need at least two parameters: < POST|GET > <url1>\n"); | ||
47 | return -1; | ||
48 | } | ||
49 | |||
50 | type = argv[1]; | ||
51 | |||
52 | if (strcmp(type, "POST") && (strcmp(type, "GET"))) | ||
53 | { | ||
54 | printf("only POST or GET are supported by this example.\n"); | ||
55 | return -1; | ||
56 | } | ||
57 | |||
58 | ecore_init(); | ||
59 | ecore_con_init(); | ||
60 | ecore_con_url_init(); | ||
61 | |||
62 | // check if requests are being pipelined, and set them if not: | ||
63 | if (!ecore_con_url_pipeline_get()) | ||
64 | ecore_con_url_pipeline_set(EINA_TRUE); | ||
65 | |||
66 | ec_url = ecore_con_url_custom_new(argv[2], type); | ||
67 | if (!ec_url) | ||
68 | { | ||
69 | printf("error when creating ecore con url object.\n"); | ||
70 | goto end; | ||
71 | } | ||
72 | |||
73 | ecore_event_handler_add(ECORE_CON_EVENT_URL_DATA, _url_data_cb, NULL); | ||
74 | ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _url_complete_cb, NULL); | ||
75 | |||
76 | ecore_con_url_additional_header_add(ec_url, "User-Agent", "blablabla"); | ||
77 | ecore_con_url_verbose_set(ec_url, EINA_TRUE); | ||
78 | |||
79 | ecore_con_url_httpauth_set(ec_url, "user", "password", EINA_FALSE); | ||
80 | |||
81 | ecore_con_url_time(ec_url, ECORE_CON_URL_TIME_IFMODSINCE, 0); | ||
82 | |||
83 | if (!strcmp(type, "GET")) | ||
84 | r = ecore_con_url_get(ec_url); | ||
85 | else | ||
86 | r = ecore_con_url_post(ec_url, NULL, 0, NULL); | ||
87 | |||
88 | if (!r) | ||
89 | { | ||
90 | printf("could not realize request.\n"); | ||
91 | goto free_ec_url; | ||
92 | } | ||
93 | |||
94 | ecore_main_loop_begin(); | ||
95 | |||
96 | free_ec_url: | ||
97 | ecore_con_url_free(ec_url); | ||
98 | end: | ||
99 | ecore_con_url_shutdown(); | ||
100 | ecore_con_shutdown(); | ||
101 | ecore_shutdown(); | ||
102 | |||
103 | return 0; | ||
104 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_evas_basics_example.c b/libraries/ecore/src/examples/ecore_evas_basics_example.c new file mode 100644 index 0000000..5f0231f --- /dev/null +++ b/libraries/ecore/src/examples/ecore_evas_basics_example.c | |||
@@ -0,0 +1,91 @@ | |||
1 | /** | ||
2 | * Ecore example illustrating the basics of ecore evas usage. | ||
3 | * | ||
4 | * You'll need at least one Evas engine built for it (excluding the | ||
5 | * buffer one). See stdout/stderr for output. | ||
6 | * | ||
7 | * @verbatim | ||
8 | * gcc -o ecore_evas_basics_example ecore_evas_basics_example.c `pkg-config --libs --cflags ecore-evas` | ||
9 | * @endverbatim | ||
10 | */ | ||
11 | |||
12 | #include <Ecore.h> | ||
13 | #include <Ecore_Evas.h> | ||
14 | #include <unistd.h> | ||
15 | |||
16 | static Eina_Bool | ||
17 | _stdin_cb(void *data, Ecore_Fd_Handler *handler) | ||
18 | { | ||
19 | Eina_List *l; | ||
20 | Ecore_Evas *ee; | ||
21 | char c; | ||
22 | |||
23 | scanf("%c", &c); | ||
24 | if (c == 'h') | ||
25 | EINA_LIST_FOREACH(ecore_evas_ecore_evas_list_get(), l, ee) | ||
26 | ecore_evas_hide(ee); | ||
27 | else if (c == 's') | ||
28 | EINA_LIST_FOREACH(ecore_evas_ecore_evas_list_get(), l, ee) | ||
29 | ecore_evas_show(ee); | ||
30 | |||
31 | return ECORE_CALLBACK_RENEW; | ||
32 | } | ||
33 | |||
34 | static void | ||
35 | _on_delete(Ecore_Evas *ee) | ||
36 | { | ||
37 | free(ecore_evas_data_get(ee, "key")); | ||
38 | ecore_main_loop_quit(); | ||
39 | } | ||
40 | |||
41 | int | ||
42 | main(void) | ||
43 | { | ||
44 | Ecore_Evas *ee; | ||
45 | Evas *canvas; | ||
46 | Evas_Object *bg; | ||
47 | Eina_List *engines, *l; | ||
48 | char *data; | ||
49 | |||
50 | if(ecore_evas_init() <= 0) | ||
51 | return 1; | ||
52 | |||
53 | engines = ecore_evas_engines_get(); | ||
54 | printf("Available engines:\n"); | ||
55 | EINA_LIST_FOREACH(engines, l, data) | ||
56 | printf("%s\n", data); | ||
57 | ecore_evas_engines_free(engines); | ||
58 | |||
59 | ee = ecore_evas_new(NULL, 0, 0, 200, 200, NULL); | ||
60 | ecore_evas_title_set(ee, "Ecore Evas basics Example"); | ||
61 | ecore_evas_show(ee); | ||
62 | |||
63 | data = malloc(sizeof(char) * 6); | ||
64 | sprintf(data, "%s", "hello"); | ||
65 | ecore_evas_data_set(ee, "key", data); | ||
66 | ecore_evas_callback_delete_request_set(ee, _on_delete); | ||
67 | |||
68 | printf("Using %s engine!\n", ecore_evas_engine_name_get(ee)); | ||
69 | |||
70 | canvas = ecore_evas_get(ee); | ||
71 | if(ecore_evas_ecore_evas_get(canvas) == ee) | ||
72 | printf("Everything is sane!\n"); | ||
73 | |||
74 | bg = evas_object_rectangle_add(canvas); | ||
75 | evas_object_color_set(bg, 0, 0, 255, 255); | ||
76 | evas_object_resize(bg, 200, 200); | ||
77 | evas_object_show(bg); | ||
78 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); | ||
79 | |||
80 | ecore_main_fd_handler_add(STDIN_FILENO, | ||
81 | ECORE_FD_READ | ECORE_FD_ERROR, | ||
82 | _stdin_cb, | ||
83 | NULL, NULL, NULL); | ||
84 | |||
85 | ecore_main_loop_begin(); | ||
86 | |||
87 | ecore_evas_free(ee); | ||
88 | ecore_evas_shutdown(); | ||
89 | |||
90 | return 0; | ||
91 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_evas_buffer_example_01.c b/libraries/ecore/src/examples/ecore_evas_buffer_example_01.c new file mode 100644 index 0000000..af05530 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_evas_buffer_example_01.c | |||
@@ -0,0 +1,121 @@ | |||
1 | /** | ||
2 | * Simple Ecore_Evas example on the Evas buffer engine wrapper | ||
3 | * functions. | ||
4 | * | ||
5 | * You must have Evas compiled with the buffer engine. | ||
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 | |||
15 | #ifdef HAVE_CONFIG_H | ||
16 | |||
17 | #include "config.h" | ||
18 | #else | ||
19 | #define __UNUSED__ | ||
20 | #endif | ||
21 | |||
22 | #include <Ecore_Evas.h> | ||
23 | #include <stdio.h> | ||
24 | |||
25 | #define WIDTH (320) | ||
26 | #define HEIGHT (240) | ||
27 | |||
28 | static Ecore_Evas *ee; | ||
29 | |||
30 | /* support function to save scene as PPM image */ | ||
31 | static void | ||
32 | _scene_save(Evas *canvas, | ||
33 | const char *dest) | ||
34 | { | ||
35 | const unsigned int *pixels, *pixels_end; | ||
36 | int width, height; | ||
37 | FILE *f; | ||
38 | |||
39 | evas_output_size_get(canvas, &width, &height); | ||
40 | |||
41 | f = fopen(dest, "wb+"); | ||
42 | if (!f) | ||
43 | { | ||
44 | fprintf(stderr, "ERROR: could not open for writing '%s': %s\n", | ||
45 | dest, strerror(errno)); | ||
46 | return; | ||
47 | } | ||
48 | |||
49 | pixels = ecore_evas_buffer_pixels_get(ee); | ||
50 | pixels_end = pixels + (width * height); | ||
51 | |||
52 | /* PPM P6 format is dead simple to write: */ | ||
53 | fprintf(f, "P6\n%d %d\n255\n", width, height); | ||
54 | for (; pixels < pixels_end; pixels++) | ||
55 | { | ||
56 | int r, g, b; | ||
57 | |||
58 | r = ((*pixels) & 0xff0000) >> 16; | ||
59 | g = ((*pixels) & 0x00ff00) >> 8; | ||
60 | b = (*pixels) & 0x0000ff; | ||
61 | |||
62 | fprintf(f, "%c%c%c", r, g, b); | ||
63 | } | ||
64 | |||
65 | fclose(f); | ||
66 | printf("Saved scene as '%s'\n", dest); | ||
67 | } | ||
68 | |||
69 | int | ||
70 | main(void) | ||
71 | { | ||
72 | Evas *canvas; | ||
73 | Evas_Object *bg, *r1, *r2, *r3; | ||
74 | |||
75 | ecore_evas_init(); | ||
76 | |||
77 | ee = ecore_evas_buffer_new(WIDTH, HEIGHT); | ||
78 | if (!ee) goto error; | ||
79 | |||
80 | canvas = ecore_evas_get(ee); | ||
81 | |||
82 | bg = evas_object_rectangle_add(canvas); | ||
83 | evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ | ||
84 | evas_object_move(bg, 0, 0); /* at origin */ | ||
85 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
86 | evas_object_show(bg); | ||
87 | |||
88 | r1 = evas_object_rectangle_add(canvas); | ||
89 | evas_object_color_set(r1, 255, 0, 0, 255); /* 100% opaque red */ | ||
90 | evas_object_move(r1, 10, 10); | ||
91 | evas_object_resize(r1, 100, 100); | ||
92 | evas_object_show(r1); | ||
93 | |||
94 | r2 = evas_object_rectangle_add(canvas); | ||
95 | evas_object_color_set(r2, 0, 128, 0, 128); /* 50% opaque green */ | ||
96 | evas_object_move(r2, 10, 10); | ||
97 | evas_object_resize(r2, 50, 50); | ||
98 | evas_object_show(r2); | ||
99 | |||
100 | r3 = evas_object_rectangle_add(canvas); | ||
101 | evas_object_color_set(r3, 0, 128, 0, 255); /* 100% opaque dark green */ | ||
102 | evas_object_move(r3, 60, 60); | ||
103 | evas_object_resize(r3, 50, 50); | ||
104 | evas_object_show(r3); | ||
105 | |||
106 | ecore_evas_manual_render(ee); | ||
107 | _scene_save(canvas, "/tmp/evas-buffer-simple-render.ppm"); | ||
108 | |||
109 | ecore_evas_free(ee); | ||
110 | ecore_evas_shutdown(); | ||
111 | |||
112 | return 0; | ||
113 | |||
114 | error: | ||
115 | fprintf(stderr, "You got to have at least one Evas engine built" | ||
116 | " and linked up to ecore-evas for this example to run" | ||
117 | " properly.\n"); | ||
118 | ecore_evas_shutdown(); | ||
119 | return -1; | ||
120 | } | ||
121 | |||
diff --git a/libraries/ecore/src/examples/ecore_evas_buffer_example_02.c b/libraries/ecore/src/examples/ecore_evas_buffer_example_02.c new file mode 100644 index 0000000..29b7b3d --- /dev/null +++ b/libraries/ecore/src/examples/ecore_evas_buffer_example_02.c | |||
@@ -0,0 +1,126 @@ | |||
1 | /** | ||
2 | * Simple Ecore_Evas example on the Evas buffer engine wrapper | ||
3 | * functions. | ||
4 | * | ||
5 | * You must have Evas compiled with the buffer engine. | ||
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 | |||
15 | #ifdef HAVE_CONFIG_H | ||
16 | |||
17 | #include "config.h" | ||
18 | #else | ||
19 | #define __UNUSED__ | ||
20 | #define PACKAGE_EXAMPLES_DIR "." | ||
21 | #endif | ||
22 | |||
23 | #include <Ecore.h> | ||
24 | #include <Ecore_Evas.h> | ||
25 | #include <stdio.h> | ||
26 | |||
27 | #define WIDTH (320) | ||
28 | #define HEIGHT (240) | ||
29 | |||
30 | static Ecore_Evas *ee; | ||
31 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
32 | |||
33 | static void | ||
34 | _on_destroy(Ecore_Evas *ee __UNUSED__) | ||
35 | { | ||
36 | ecore_main_loop_quit(); | ||
37 | } | ||
38 | |||
39 | int | ||
40 | main(void) | ||
41 | { | ||
42 | Evas *canvas, *sub_canvas; | ||
43 | Evas_Object *bg, *r1, *r2, *r3; /* "sub" canvas objects */ | ||
44 | Evas_Object *border, *img; /* canvas objects */ | ||
45 | Ecore_Evas *sub_ee; | ||
46 | |||
47 | ecore_evas_init(); | ||
48 | |||
49 | /* this will give you a window with an Evas canvas under the first | ||
50 | * engine available */ | ||
51 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
52 | if (!ee) goto error; | ||
53 | |||
54 | ecore_evas_size_min_set(ee, WIDTH, HEIGHT); | ||
55 | ecore_evas_size_max_set(ee, WIDTH, HEIGHT); | ||
56 | |||
57 | ecore_evas_callback_delete_request_set(ee, _on_destroy); | ||
58 | ecore_evas_title_set(ee, "Ecore_Evas buffer (image) example"); | ||
59 | ecore_evas_show(ee); | ||
60 | |||
61 | canvas = ecore_evas_get(ee); | ||
62 | |||
63 | bg = evas_object_rectangle_add(canvas); | ||
64 | evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ | ||
65 | evas_object_move(bg, 0, 0); /* at origin */ | ||
66 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
67 | evas_object_show(bg); | ||
68 | |||
69 | /* this is a border around the image containing a scene of another | ||
70 | * canvas */ | ||
71 | border = evas_object_image_filled_add(canvas); | ||
72 | evas_object_image_file_set(border, border_img_path, NULL); | ||
73 | evas_object_image_border_set(border, 3, 3, 3, 3); | ||
74 | evas_object_image_border_center_fill_set(border, EVAS_BORDER_FILL_NONE); | ||
75 | |||
76 | evas_object_move(border, WIDTH / 6, HEIGHT / 6); | ||
77 | evas_object_resize(border, (2 * WIDTH) / 3, (2 * HEIGHT) / 3); | ||
78 | evas_object_show(border); | ||
79 | |||
80 | img = ecore_evas_object_image_new(ee); | ||
81 | evas_object_image_filled_set(img, EINA_TRUE); | ||
82 | evas_object_image_size_set( | ||
83 | img, ((2 * WIDTH) / 3) - 6, ((2 * HEIGHT) / 3) - 6); | ||
84 | sub_ee = ecore_evas_object_ecore_evas_get(img); | ||
85 | sub_canvas = ecore_evas_object_evas_get(img); | ||
86 | |||
87 | evas_object_move(img, (WIDTH / 6) + 3, (HEIGHT / 6) + 3); | ||
88 | |||
89 | /* apply the same size on both! */ | ||
90 | evas_object_resize(img, ((2 * WIDTH) / 3) - 6, ((2 * HEIGHT) / 3) - 6); | ||
91 | ecore_evas_resize(sub_ee, ((2 * WIDTH) / 3) - 6, ((2 * HEIGHT) / 3) - 6); | ||
92 | |||
93 | r1 = evas_object_rectangle_add(sub_canvas); | ||
94 | evas_object_color_set(r1, 255, 0, 0, 255); /* 100% opaque red */ | ||
95 | evas_object_move(r1, 10, 10); | ||
96 | evas_object_resize(r1, 100, 100); | ||
97 | evas_object_show(r1); | ||
98 | |||
99 | r2 = evas_object_rectangle_add(sub_canvas); | ||
100 | evas_object_color_set(r2, 0, 128, 0, 128); /* 50% opaque green */ | ||
101 | evas_object_move(r2, 10, 10); | ||
102 | evas_object_resize(r2, 50, 50); | ||
103 | evas_object_show(r2); | ||
104 | |||
105 | r3 = evas_object_rectangle_add(sub_canvas); | ||
106 | evas_object_color_set(r3, 0, 128, 0, 255); /* 100% opaque dark green */ | ||
107 | evas_object_move(r3, 60, 60); | ||
108 | evas_object_resize(r3, 50, 50); | ||
109 | evas_object_show(r3); | ||
110 | |||
111 | evas_object_show(img); | ||
112 | ecore_main_loop_begin(); | ||
113 | |||
114 | ecore_evas_free(ee); | ||
115 | ecore_evas_shutdown(); | ||
116 | |||
117 | return 0; | ||
118 | |||
119 | error: | ||
120 | fprintf(stderr, "You got to have at least one Evas engine built" | ||
121 | " and linked up to ecore-evas for this example to run" | ||
122 | " properly.\n"); | ||
123 | ecore_evas_shutdown(); | ||
124 | return -1; | ||
125 | } | ||
126 | |||
diff --git a/libraries/ecore/src/examples/ecore_evas_callbacks.c b/libraries/ecore/src/examples/ecore_evas_callbacks.c new file mode 100644 index 0000000..31b724d --- /dev/null +++ b/libraries/ecore/src/examples/ecore_evas_callbacks.c | |||
@@ -0,0 +1,127 @@ | |||
1 | /** | ||
2 | * Ecore example illustrating ecore evas callbacks. | ||
3 | * | ||
4 | * You'll need at least one Evas engine built for it (excluding the | ||
5 | * buffer one). See stdout/stderr for output. | ||
6 | * | ||
7 | * @verbatim | ||
8 | * gcc -o ecore_evas_callbacks ecore_evas_callbacks.c `pkg-config --libs --cflags ecore-evas` | ||
9 | * @endverbatim | ||
10 | */ | ||
11 | |||
12 | #include <Ecore.h> | ||
13 | #include <Ecore_Evas.h> | ||
14 | |||
15 | static void | ||
16 | _destroy(Ecore_Evas *ee) | ||
17 | { | ||
18 | printf("destroy\n"); | ||
19 | ecore_main_loop_quit(); | ||
20 | } | ||
21 | |||
22 | static void | ||
23 | _delete(Ecore_Evas *ee) | ||
24 | { | ||
25 | printf("delete\n"); | ||
26 | ecore_main_loop_quit(); | ||
27 | } | ||
28 | |||
29 | static void | ||
30 | _focus_in(Ecore_Evas *ee) | ||
31 | { | ||
32 | printf("focus_in\n"); | ||
33 | } | ||
34 | |||
35 | static void | ||
36 | _focus_out(Ecore_Evas *ee) | ||
37 | { | ||
38 | printf("focus_out\n"); | ||
39 | } | ||
40 | |||
41 | static void | ||
42 | _hide(Ecore_Evas *ee) | ||
43 | { | ||
44 | printf("hide\n"); | ||
45 | } | ||
46 | |||
47 | static void | ||
48 | _mouse_in(Ecore_Evas *ee) | ||
49 | { | ||
50 | printf("mouse_in\n"); | ||
51 | } | ||
52 | |||
53 | static void | ||
54 | _show(Ecore_Evas *ee) | ||
55 | { | ||
56 | printf("show\n"); | ||
57 | } | ||
58 | |||
59 | static void | ||
60 | _mouse_out(Ecore_Evas *ee) | ||
61 | { | ||
62 | printf("mouse_out\n"); | ||
63 | } | ||
64 | |||
65 | static void | ||
66 | _move(Ecore_Evas *ee) | ||
67 | { | ||
68 | printf("move\n"); | ||
69 | } | ||
70 | |||
71 | static void | ||
72 | _post_render(Ecore_Evas *ee) | ||
73 | { | ||
74 | printf("post_render\n"); | ||
75 | } | ||
76 | |||
77 | static void | ||
78 | _pre_free(Ecore_Evas *ee) | ||
79 | { | ||
80 | printf("pre_free\n"); | ||
81 | } | ||
82 | |||
83 | static void | ||
84 | _pre_render(Ecore_Evas *ee) | ||
85 | { | ||
86 | printf("pre_render\n"); | ||
87 | } | ||
88 | |||
89 | static void | ||
90 | _resize(Ecore_Evas *ee) | ||
91 | { | ||
92 | printf("resize\n"); | ||
93 | } | ||
94 | |||
95 | int | ||
96 | main(void) | ||
97 | { | ||
98 | Ecore_Evas *ee; | ||
99 | |||
100 | ecore_evas_init(); | ||
101 | |||
102 | ee = ecore_evas_new(NULL, 0, 0, 200, 100, NULL); | ||
103 | ecore_evas_title_set(ee, "Ecore Evas Callbacks Example"); | ||
104 | ecore_evas_show(ee); | ||
105 | |||
106 | //callbacks | ||
107 | ecore_evas_callback_delete_request_set(ee, _delete); | ||
108 | ecore_evas_callback_destroy_set(ee, _destroy); | ||
109 | ecore_evas_callback_focus_in_set(ee, _focus_in); | ||
110 | ecore_evas_callback_focus_out_set(ee, _focus_out); | ||
111 | ecore_evas_callback_hide_set(ee, _hide); | ||
112 | ecore_evas_callback_mouse_in_set(ee, _mouse_in); | ||
113 | ecore_evas_callback_mouse_out_set(ee, _mouse_out); | ||
114 | ecore_evas_callback_move_set(ee, _move); | ||
115 | ecore_evas_callback_post_render_set(ee, _post_render); | ||
116 | ecore_evas_callback_pre_free_set(ee, _pre_free); | ||
117 | ecore_evas_callback_pre_render_set(ee, _pre_render); | ||
118 | ecore_evas_callback_resize_set(ee, _resize); | ||
119 | ecore_evas_callback_show_set (ee, _show); | ||
120 | |||
121 | ecore_main_loop_begin(); | ||
122 | |||
123 | ecore_evas_free(ee); | ||
124 | ecore_evas_shutdown(); | ||
125 | |||
126 | return 0; | ||
127 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_evas_ews_example.c b/libraries/ecore/src/examples/ecore_evas_ews_example.c new file mode 100644 index 0000000..9be725a --- /dev/null +++ b/libraries/ecore/src/examples/ecore_evas_ews_example.c | |||
@@ -0,0 +1,253 @@ | |||
1 | /** | ||
2 | * Ecore example illustrating the ews of ecore evas usage. | ||
3 | * | ||
4 | * You'll need at least one Evas engine built for it (excluding the | ||
5 | * buffer one). See stdout/stderr for output. | ||
6 | * | ||
7 | * @verbatim | ||
8 | * gcc -o ecore_evas_ews_example ecore_evas_ews_example.c `pkg-config --libs --cflags ecore-evas` | ||
9 | * @endverbatim | ||
10 | */ | ||
11 | |||
12 | #include <Ecore.h> | ||
13 | #include <Ecore_Evas.h> | ||
14 | #include <unistd.h> | ||
15 | #include <stdio.h> | ||
16 | #include <ctype.h> | ||
17 | |||
18 | static Eina_Bool | ||
19 | _wm_win_add(void *data, int type, void *event_info) | ||
20 | { | ||
21 | Ecore_Evas *ee = event_info; | ||
22 | printf("WM: new window=%p\n", ee); | ||
23 | return EINA_TRUE; | ||
24 | } | ||
25 | |||
26 | static Eina_Bool | ||
27 | _wm_win_move(void *data, int type, void *event_info) | ||
28 | { | ||
29 | Ecore_Evas *ee = event_info; | ||
30 | int x, y; | ||
31 | ecore_evas_geometry_get(ee, &x, &y, NULL, NULL); | ||
32 | printf("WM: window=%p moved to %d,%d\n", ee, x, y); | ||
33 | return EINA_TRUE; | ||
34 | } | ||
35 | |||
36 | static Eina_Bool | ||
37 | _wm_win_resize(void *data, int type, void *event_info) | ||
38 | { | ||
39 | Ecore_Evas *ee = event_info; | ||
40 | int w, h; | ||
41 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
42 | printf("WM: window=%p resized to %dx%d\n", ee, w, h); | ||
43 | return EINA_TRUE; | ||
44 | } | ||
45 | |||
46 | static Eina_Bool | ||
47 | _wm_win_show(void *data, int type, void *event_info) | ||
48 | { | ||
49 | Ecore_Evas *ee = event_info; | ||
50 | printf("WM: show window=%p\n", ee); | ||
51 | return EINA_TRUE; | ||
52 | } | ||
53 | |||
54 | static void | ||
55 | optional_ews_window_manager_setup(void) | ||
56 | { | ||
57 | ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_ADD, _wm_win_add, NULL); | ||
58 | ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_MOVE, _wm_win_move, NULL); | ||
59 | ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_RESIZE, _wm_win_resize, NULL); | ||
60 | ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_SHOW, _wm_win_show, NULL); | ||
61 | |||
62 | /* one may use any known unique identifier, like an app function pointer */ | ||
63 | ecore_evas_ews_manager_set(optional_ews_window_manager_setup); | ||
64 | } | ||
65 | |||
66 | static void | ||
67 | optional_ews_setup(void) | ||
68 | { | ||
69 | Evas_Object *bg; | ||
70 | Evas *e; | ||
71 | |||
72 | ecore_evas_ews_setup(0, 0, 800, 600); /* "screen" size */ | ||
73 | e = ecore_evas_ews_evas_get(); /* forces "screen" to be allocated */ | ||
74 | |||
75 | bg = evas_object_rectangle_add(e); | ||
76 | evas_object_color_set(bg, 128, 32, 32, 255); | ||
77 | ecore_evas_ews_background_set(bg); | ||
78 | } | ||
79 | |||
80 | static Eina_Bool | ||
81 | _stdin_cb(void *data, Ecore_Fd_Handler *handler) | ||
82 | { | ||
83 | const Eina_List *l; | ||
84 | Ecore_Evas *ee; | ||
85 | char c = getchar(); | ||
86 | |||
87 | if (c == EOF) | ||
88 | { | ||
89 | ecore_main_loop_quit(); | ||
90 | return EINA_FALSE; | ||
91 | } | ||
92 | |||
93 | switch (c) { | ||
94 | case 'h': | ||
95 | printf("hide all windows\n"); | ||
96 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
97 | ecore_evas_hide(ee); | ||
98 | break; | ||
99 | case 's': | ||
100 | printf("show all windows\n"); | ||
101 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
102 | ecore_evas_show(ee); | ||
103 | break; | ||
104 | case 'l': | ||
105 | printf("move all windows left\n"); | ||
106 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
107 | { | ||
108 | int x, y; | ||
109 | ecore_evas_geometry_get(ee, &x, &y, NULL, NULL); | ||
110 | ecore_evas_move(ee, x - 10, y); | ||
111 | } | ||
112 | break; | ||
113 | case 'r': | ||
114 | printf("move all windows right\n"); | ||
115 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
116 | { | ||
117 | int x, y; | ||
118 | ecore_evas_geometry_get(ee, &x, &y, NULL, NULL); | ||
119 | ecore_evas_move(ee, x + 10, y); | ||
120 | } | ||
121 | break; | ||
122 | case 't': | ||
123 | printf("move all windows top\n"); | ||
124 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
125 | { | ||
126 | int x, y; | ||
127 | ecore_evas_geometry_get(ee, &x, &y, NULL, NULL); | ||
128 | ecore_evas_move(ee, x, y - 10); | ||
129 | } | ||
130 | break; | ||
131 | case 'b': | ||
132 | printf("move all windows bottom\n"); | ||
133 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
134 | { | ||
135 | int x, y; | ||
136 | ecore_evas_geometry_get(ee, &x, &y, NULL, NULL); | ||
137 | ecore_evas_move(ee, x, y + 10); | ||
138 | } | ||
139 | break; | ||
140 | case 'S': | ||
141 | printf("make all windows smaller\n"); | ||
142 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
143 | { | ||
144 | int w, h; | ||
145 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
146 | ecore_evas_resize(ee, w - 10, h - 10); | ||
147 | } | ||
148 | break; | ||
149 | case 'B': | ||
150 | printf("make all windows bigger\n"); | ||
151 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
152 | { | ||
153 | int w, h; | ||
154 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
155 | ecore_evas_resize(ee, w + 10, h + 10); | ||
156 | } | ||
157 | break; | ||
158 | case 'm': | ||
159 | printf("make all windows unmaximized\n"); | ||
160 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
161 | ecore_evas_maximized_set(ee, EINA_FALSE); | ||
162 | break; | ||
163 | case 'M': | ||
164 | printf("make all windows maximized\n"); | ||
165 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
166 | ecore_evas_maximized_set(ee, EINA_TRUE); | ||
167 | break; | ||
168 | case 'i': | ||
169 | printf("make all windows uniconified\n"); | ||
170 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
171 | ecore_evas_iconified_set(ee, EINA_FALSE); | ||
172 | break; | ||
173 | case 'I': | ||
174 | printf("make all windows iconified\n"); | ||
175 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
176 | ecore_evas_iconified_set(ee, EINA_TRUE); | ||
177 | break; | ||
178 | case 'f': | ||
179 | printf("make all windows unfullscreen\n"); | ||
180 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
181 | ecore_evas_fullscreen_set(ee, EINA_FALSE); | ||
182 | break; | ||
183 | case 'F': | ||
184 | printf("make all windows fullscreen\n"); | ||
185 | EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee) | ||
186 | ecore_evas_fullscreen_set(ee, EINA_TRUE); | ||
187 | break; | ||
188 | case 'q': | ||
189 | printf("quit\n"); | ||
190 | ecore_main_loop_quit(); | ||
191 | break; | ||
192 | default: | ||
193 | if (!isspace(c)) | ||
194 | printf("Unknown command: %c\n", c); | ||
195 | } | ||
196 | return ECORE_CALLBACK_RENEW; | ||
197 | } | ||
198 | |||
199 | static void | ||
200 | _on_delete(Ecore_Evas *ee) | ||
201 | { | ||
202 | free(ecore_evas_data_get(ee, "key")); | ||
203 | ecore_main_loop_quit(); | ||
204 | } | ||
205 | |||
206 | int | ||
207 | main(void) | ||
208 | { | ||
209 | Ecore_Evas *ee; | ||
210 | Evas *canvas; | ||
211 | Evas_Object *bg; | ||
212 | |||
213 | if (ecore_evas_init() <= 0) | ||
214 | return 1; | ||
215 | |||
216 | optional_ews_setup(); | ||
217 | optional_ews_window_manager_setup(); | ||
218 | |||
219 | /* everything should look similar to ecore_evas_basic_example */ | ||
220 | ee = ecore_evas_ews_new(0, 0, 200, 200); | ||
221 | ecore_evas_title_set(ee, "Ecore Evas EWS Example"); | ||
222 | ecore_evas_show(ee); | ||
223 | |||
224 | ecore_evas_data_set(ee, "key", strdup("hello")); | ||
225 | ecore_evas_callback_delete_request_set(ee, _on_delete); | ||
226 | |||
227 | printf("Using %s engine!\n", ecore_evas_engine_name_get(ee)); | ||
228 | |||
229 | canvas = ecore_evas_get(ee); | ||
230 | if(ecore_evas_ecore_evas_get(canvas) == ee) | ||
231 | printf("Everything is sane!\n"); | ||
232 | |||
233 | bg = evas_object_rectangle_add(canvas); | ||
234 | evas_object_color_set(bg, 0, 0, 255, 255); | ||
235 | evas_object_resize(bg, 200, 200); | ||
236 | evas_object_show(bg); | ||
237 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); | ||
238 | |||
239 | /* moving the window should move it in the screen */ | ||
240 | ecore_evas_move(ee, 50, 50); | ||
241 | |||
242 | ecore_main_fd_handler_add(STDIN_FILENO, | ||
243 | ECORE_FD_READ | ECORE_FD_ERROR, | ||
244 | _stdin_cb, | ||
245 | NULL, NULL, NULL); | ||
246 | |||
247 | ecore_main_loop_begin(); | ||
248 | |||
249 | ecore_evas_free(ee); | ||
250 | ecore_evas_shutdown(); | ||
251 | |||
252 | return 0; | ||
253 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_evas_object_example.c b/libraries/ecore/src/examples/ecore_evas_object_example.c new file mode 100644 index 0000000..33da234 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_evas_object_example.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /** | ||
2 | * Ecore example illustrating ecore evas object usage. | ||
3 | * | ||
4 | * You'll need at least one Evas engine built for it (excluding the | ||
5 | * buffer one). See stdout/stderr for output. | ||
6 | * | ||
7 | * @verbatim | ||
8 | * gcc -o ecore_evas_object_example ecore_evas_object_example.c `pkg-config --libs --cflags ecore-evas` | ||
9 | * @endverbatim | ||
10 | */ | ||
11 | |||
12 | #include <Ecore.h> | ||
13 | #include <Ecore_Evas.h> | ||
14 | |||
15 | int | ||
16 | main(void) | ||
17 | { | ||
18 | Ecore_Evas *ee; | ||
19 | Evas_Object *bg, *cursor, *obj; | ||
20 | int layer, x, y; | ||
21 | |||
22 | ecore_evas_init(); | ||
23 | |||
24 | ee = ecore_evas_new(NULL, 0, 0, 200, 200, NULL); | ||
25 | ecore_evas_title_set(ee, "Ecore Evas Object Example"); | ||
26 | ecore_evas_show(ee); | ||
27 | |||
28 | bg = evas_object_rectangle_add(ecore_evas_get(ee)); | ||
29 | evas_object_color_set(bg, 0, 0, 255, 255); | ||
30 | evas_object_resize(bg, 200, 200); | ||
31 | evas_object_show(bg); | ||
32 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); | ||
33 | |||
34 | if(bg == ecore_evas_object_associate_get(ee)) | ||
35 | printf("Association worked!\n"); | ||
36 | |||
37 | cursor = evas_object_rectangle_add(ecore_evas_get(ee)); | ||
38 | evas_object_color_set(cursor, 0, 255, 0, 255); | ||
39 | evas_object_resize(cursor, 5, 10); | ||
40 | ecore_evas_object_cursor_set(ee, cursor, 0, 1, 1); | ||
41 | |||
42 | ecore_evas_cursor_get(ee, &obj, &layer, &x, &y); | ||
43 | if(obj == cursor && layer == 0 && x == 1 && y == 1) | ||
44 | printf("Set cursor worked!\n"); | ||
45 | |||
46 | ecore_main_loop_begin(); | ||
47 | |||
48 | ecore_evas_free(ee); | ||
49 | ecore_evas_shutdown(); | ||
50 | |||
51 | return 0; | ||
52 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_evas_window_sizes_example.c b/libraries/ecore/src/examples/ecore_evas_window_sizes_example.c new file mode 100644 index 0000000..badfb16 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_evas_window_sizes_example.c | |||
@@ -0,0 +1,204 @@ | |||
1 | /** | ||
2 | * Simple @c Ecore_Evas example illustrating how to deal with window | ||
3 | * sizes | ||
4 | * | ||
5 | * You'll need at least one engine built for it (excluding the buffer | ||
6 | * one). See stdout/stderr for output. | ||
7 | * | ||
8 | * @verbatim | ||
9 | * gcc -o evas-smart-object evas-smart-object.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 | #define __UNUSED__ | ||
18 | #endif | ||
19 | |||
20 | #include <Ecore.h> | ||
21 | #include <Ecore_Evas.h> | ||
22 | |||
23 | #define WIDTH (300) | ||
24 | #define HEIGHT (300) | ||
25 | |||
26 | static Ecore_Evas *ee; | ||
27 | static Evas_Object *text, *bg; | ||
28 | static Eina_Bool min_set = EINA_FALSE; | ||
29 | static Eina_Bool max_set = EINA_FALSE; | ||
30 | static Eina_Bool base_set = EINA_FALSE; | ||
31 | static Eina_Bool step_set = EINA_FALSE; | ||
32 | |||
33 | static const char commands[] = \ | ||
34 | "commands are:\n" | ||
35 | "\tm - impose a minumum size to the window\n" | ||
36 | "\tx - impose a maximum size to the window\n" | ||
37 | "\tb - impose a base size to the window\n" | ||
38 | "\ts - impose a step size (different than 1 px) to the window\n" | ||
39 | "\th - print help\n"; | ||
40 | |||
41 | /* to inform current window's size */ | ||
42 | static void | ||
43 | _canvas_resize_cb(Ecore_Evas *ee) | ||
44 | { | ||
45 | int w, h; | ||
46 | char buf[1024]; | ||
47 | |||
48 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
49 | snprintf(buf, sizeof(buf), "%d x %d", w, h); | ||
50 | evas_object_text_text_set(text, buf); | ||
51 | evas_object_move(text, (w - 150) / 2, (h - 50) / 2); | ||
52 | |||
53 | evas_object_resize(bg, w, h); | ||
54 | } | ||
55 | |||
56 | static void | ||
57 | _on_destroy(Ecore_Evas *ee __UNUSED__) | ||
58 | { | ||
59 | ecore_main_loop_quit(); | ||
60 | } | ||
61 | |||
62 | static void | ||
63 | _on_keydown(void *data __UNUSED__, | ||
64 | Evas *evas __UNUSED__, | ||
65 | Evas_Object *o __UNUSED__, | ||
66 | void *einfo) | ||
67 | { | ||
68 | Evas_Event_Key_Down *ev = einfo; | ||
69 | |||
70 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | ||
71 | { | ||
72 | fprintf(stdout, commands); | ||
73 | return; | ||
74 | } | ||
75 | |||
76 | if (strcmp(ev->keyname, "m") == 0) /* impose a minimum size on the window */ | ||
77 | { | ||
78 | min_set = !min_set; | ||
79 | |||
80 | if (min_set) | ||
81 | { | ||
82 | ecore_evas_size_min_set(ee, WIDTH / 2, HEIGHT / 2); | ||
83 | fprintf(stdout, "Imposing a minimum size of %d x %d\n", | ||
84 | WIDTH / 2, HEIGHT / 2); | ||
85 | } | ||
86 | else | ||
87 | { | ||
88 | ecore_evas_size_min_set(ee, 0, 0); | ||
89 | fprintf(stdout, "Taking off minimum size restriction from the" | ||
90 | " window\n"); | ||
91 | } | ||
92 | return; | ||
93 | } | ||
94 | |||
95 | if (strcmp(ev->keyname, "x") == 0) /* impose a maximum size on the window */ | ||
96 | { | ||
97 | max_set = !max_set; | ||
98 | |||
99 | if (max_set) | ||
100 | { | ||
101 | ecore_evas_size_max_set(ee, WIDTH * 2, HEIGHT * 2); | ||
102 | fprintf(stdout, "Imposing a maximum size of %d x %d\n", | ||
103 | WIDTH * 2, HEIGHT * 2); | ||
104 | } | ||
105 | else | ||
106 | { | ||
107 | ecore_evas_size_max_set(ee, 0, 0); | ||
108 | fprintf(stdout, "Taking off maximum size restriction from the" | ||
109 | " window\n"); | ||
110 | } | ||
111 | return; | ||
112 | } | ||
113 | |||
114 | if (strcmp(ev->keyname, "b") == 0) /* impose a base size on the window */ | ||
115 | { | ||
116 | base_set = !base_set; | ||
117 | |||
118 | if (base_set) | ||
119 | { | ||
120 | ecore_evas_size_base_set(ee, WIDTH * 2, HEIGHT * 2); | ||
121 | fprintf(stdout, "Imposing a base size of %d x %d\n", | ||
122 | WIDTH * 2, HEIGHT * 2); | ||
123 | } | ||
124 | else | ||
125 | { | ||
126 | ecore_evas_size_base_set(ee, 0, 0); | ||
127 | fprintf(stdout, "Taking off base size restriction from the" | ||
128 | " window\n"); | ||
129 | } | ||
130 | return; | ||
131 | } | ||
132 | |||
133 | if (strcmp(ev->keyname, "s") == 0) /* impose a step size on the window */ | ||
134 | { | ||
135 | step_set = !step_set; | ||
136 | |||
137 | if (step_set) | ||
138 | { | ||
139 | ecore_evas_size_step_set(ee, 40, 40); | ||
140 | fprintf(stdout, "Imposing a step size of %d x %d\n", 40, 40); | ||
141 | } | ||
142 | else | ||
143 | { | ||
144 | ecore_evas_size_step_set(ee, 0, 0); | ||
145 | fprintf(stdout, "Taking off step size restriction from the" | ||
146 | " window\n"); | ||
147 | } | ||
148 | return; | ||
149 | } | ||
150 | } | ||
151 | |||
152 | int | ||
153 | main(void) | ||
154 | { | ||
155 | Evas *evas; | ||
156 | |||
157 | if (!ecore_evas_init()) | ||
158 | return EXIT_FAILURE; | ||
159 | |||
160 | /* this will give you a window with an Evas canvas under the first | ||
161 | * engine available */ | ||
162 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
163 | if (!ee) goto error; | ||
164 | |||
165 | ecore_evas_callback_delete_request_set(ee, _on_destroy); | ||
166 | ecore_evas_title_set(ee, "Ecore_Evas window sizes example"); | ||
167 | ecore_evas_callback_resize_set(ee, _canvas_resize_cb); | ||
168 | ecore_evas_show(ee); | ||
169 | |||
170 | evas = ecore_evas_get(ee); | ||
171 | |||
172 | bg = evas_object_rectangle_add(evas); | ||
173 | evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ | ||
174 | evas_object_move(bg, 0, 0); /* at canvas' origin */ | ||
175 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ | ||
176 | evas_object_show(bg); | ||
177 | |||
178 | evas_object_focus_set(bg, EINA_TRUE); | ||
179 | evas_object_event_callback_add( | ||
180 | bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
181 | |||
182 | text = evas_object_text_add(evas); | ||
183 | evas_object_color_set(text, 0, 0, 0, 255); | ||
184 | evas_object_resize(text, 150, 50); | ||
185 | evas_object_text_font_set(text, "Sans", 20); | ||
186 | evas_object_show(text); | ||
187 | |||
188 | _canvas_resize_cb(ee); | ||
189 | fprintf(stdout, commands); | ||
190 | ecore_main_loop_begin(); | ||
191 | |||
192 | ecore_evas_free(ee); | ||
193 | ecore_evas_shutdown(); | ||
194 | |||
195 | return 0; | ||
196 | |||
197 | error: | ||
198 | fprintf(stderr, "You got to have at least one Evas engine built" | ||
199 | " and linked up to ecore-evas for this example to run" | ||
200 | " properly.\n"); | ||
201 | ecore_evas_shutdown(); | ||
202 | return -1; | ||
203 | } | ||
204 | |||
diff --git a/libraries/ecore/src/examples/ecore_event_example.c b/libraries/ecore/src/examples/ecore_event_example.c new file mode 100644 index 0000000..ef3f187 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_event_example.c | |||
@@ -0,0 +1,86 @@ | |||
1 | #include <Ecore.h> | ||
2 | #include <unistd.h> | ||
3 | |||
4 | struct context { // helper struct to give some context to the callbacks | ||
5 | const char *str1, *str2; | ||
6 | Ecore_Event_Handler *handler1; | ||
7 | Ecore_Event_Handler *handler2; | ||
8 | }; | ||
9 | |||
10 | static _event_type = 0; // a new type of event will be defined and stored here | ||
11 | |||
12 | static Eina_Bool | ||
13 | _event_handler1_cb(void *data, int type, void *event) | ||
14 | { | ||
15 | int *number = event; | ||
16 | const char *str = data; | ||
17 | |||
18 | printf("event_handler1: number=%d, data=\"%s\".\n", *number, str); | ||
19 | |||
20 | if ((*number % 2) == 0) | ||
21 | return ECORE_CALLBACK_DONE; | ||
22 | |||
23 | return ECORE_CALLBACK_PASS_ON; | ||
24 | } | ||
25 | |||
26 | static Eina_Bool | ||
27 | _event_handler2_cb(void *data, int type, void *event) // event callback | ||
28 | { | ||
29 | struct context *ctxt = data; | ||
30 | int *number = event; | ||
31 | |||
32 | printf("event_handler2: number=%d.\n", *number); | ||
33 | |||
34 | if (*number == 5) | ||
35 | { | ||
36 | const char *old = NULL; | ||
37 | old = ecore_event_handler_data_set(ctxt->handler1, (void *)ctxt->str2); | ||
38 | printf("changed handler1 data from \"%s\" to \"%s\".\n", | ||
39 | old, ctxt->str2); | ||
40 | } | ||
41 | else if (*number >= 10) | ||
42 | { | ||
43 | printf("finish main loop.\n"); | ||
44 | ecore_main_loop_quit(); | ||
45 | } | ||
46 | |||
47 | return ECORE_CALLBACK_DONE; // same as EINA_FALSE | ||
48 | } | ||
49 | |||
50 | int main(int argc, char **argv) | ||
51 | { | ||
52 | struct context ctxt = {0}; | ||
53 | int i; | ||
54 | ctxt.str1 = "dataone"; | ||
55 | ctxt.str2 = "datatwo"; | ||
56 | |||
57 | if (!ecore_init()) | ||
58 | { | ||
59 | printf("ERROR: Cannot init Ecore!\n"); | ||
60 | return -1; | ||
61 | } | ||
62 | |||
63 | _event_type = ecore_event_type_new(); | ||
64 | |||
65 | ctxt.handler1 = ecore_event_handler_add(_event_type, | ||
66 | _event_handler1_cb, | ||
67 | ctxt.str1); | ||
68 | ctxt.handler2 = ecore_event_handler_add(_event_type, | ||
69 | _event_handler2_cb, | ||
70 | &ctxt); | ||
71 | |||
72 | for (i = 0; i <= 15; i++) | ||
73 | { | ||
74 | int *event_data = malloc(sizeof(*event_data)); | ||
75 | *event_data = i; | ||
76 | ecore_event_add(_event_type, event_data, NULL, NULL); | ||
77 | } | ||
78 | |||
79 | printf("start the main loop.\n"); | ||
80 | |||
81 | ecore_main_loop_begin(); | ||
82 | |||
83 | ecore_shutdown(); | ||
84 | |||
85 | return 0; | ||
86 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_fd_handler_example.c b/libraries/ecore/src/examples/ecore_fd_handler_example.c new file mode 100644 index 0000000..d80b290 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_fd_handler_example.c | |||
@@ -0,0 +1,86 @@ | |||
1 | #include <Ecore.h> | ||
2 | #include <unistd.h> | ||
3 | |||
4 | struct context { | ||
5 | Ecore_Fd_Handler *handler; | ||
6 | Ecore_Timer *timer; | ||
7 | }; | ||
8 | |||
9 | static void | ||
10 | _fd_prepare_cb(void *data, Ecore_Fd_Handler *handler) | ||
11 | { | ||
12 | printf("prepare_cb called.\n"); | ||
13 | } | ||
14 | |||
15 | static Eina_Bool | ||
16 | _fd_handler_cb(void *data, Ecore_Fd_Handler *handler) | ||
17 | { | ||
18 | struct context *ctxt = data; | ||
19 | char buf[1024]; | ||
20 | size_t nbytes; | ||
21 | int fd; | ||
22 | |||
23 | if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR)) | ||
24 | { | ||
25 | printf("An error has occurred. Stop watching this fd and quit.\n"); | ||
26 | ecore_main_loop_quit(); | ||
27 | ctxt->handler = NULL; | ||
28 | return ECORE_CALLBACK_CANCEL; | ||
29 | } | ||
30 | |||
31 | fd = ecore_main_fd_handler_fd_get(handler); | ||
32 | nbytes = read(fd, buf, sizeof(buf)); | ||
33 | if (nbytes == 0) | ||
34 | { | ||
35 | printf("Nothing to read, exiting...\n"); | ||
36 | ecore_main_loop_quit(); | ||
37 | ctxt->handler = NULL; | ||
38 | return ECORE_CALLBACK_CANCEL; | ||
39 | } | ||
40 | buf[nbytes - 1] = '\0'; | ||
41 | |||
42 | printf("Read %zd bytes from input: \"%s\"\n", nbytes - 1, buf); | ||
43 | |||
44 | return ECORE_CALLBACK_RENEW; | ||
45 | } | ||
46 | |||
47 | static Eina_Bool | ||
48 | _timer_cb(void *data) | ||
49 | { | ||
50 | printf("Timer expired after 5 seconds...\n"); | ||
51 | |||
52 | return ECORE_CALLBACK_RENEW; | ||
53 | } | ||
54 | |||
55 | int main(int argc, char **argv) | ||
56 | { | ||
57 | struct context ctxt = {0}; | ||
58 | |||
59 | if (!ecore_init()) | ||
60 | { | ||
61 | printf("ERROR: Cannot init Ecore!\n"); | ||
62 | return -1; | ||
63 | } | ||
64 | |||
65 | ctxt.handler = ecore_main_fd_handler_add(STDIN_FILENO, | ||
66 | ECORE_FD_READ | ECORE_FD_ERROR, | ||
67 | _fd_handler_cb, | ||
68 | &ctxt, NULL, NULL); | ||
69 | ecore_main_fd_handler_prepare_callback_set(ctxt.handler, _fd_prepare_cb, &ctxt); | ||
70 | ctxt.timer = ecore_timer_add(5, _timer_cb, &ctxt); | ||
71 | |||
72 | printf("Starting the main loop. Type anything and hit <enter> to " | ||
73 | "activate the fd_handler callback, or CTRL+d to shutdown.\n"); | ||
74 | |||
75 | ecore_main_loop_begin(); | ||
76 | |||
77 | if (ctxt.handler) | ||
78 | ecore_main_fd_handler_del(ctxt.handler); | ||
79 | |||
80 | if (ctxt.timer) | ||
81 | ecore_timer_del(ctxt.timer); | ||
82 | |||
83 | ecore_shutdown(); | ||
84 | |||
85 | return 0; | ||
86 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_fd_handler_gnutls_example.c b/libraries/ecore/src/examples/ecore_fd_handler_gnutls_example.c new file mode 100644 index 0000000..b67e04e --- /dev/null +++ b/libraries/ecore/src/examples/ecore_fd_handler_gnutls_example.c | |||
@@ -0,0 +1,195 @@ | |||
1 | #include <Ecore.h> | ||
2 | #include <fcntl.h> | ||
3 | #include <netinet/tcp.h> | ||
4 | #include <netinet/in.h> | ||
5 | #include <sys/socket.h> | ||
6 | #include <arpa/inet.h> | ||
7 | #include <errno.h> | ||
8 | #include <unistd.h> | ||
9 | #include <gnutls/gnutls.h> | ||
10 | |||
11 | /* Ecore_Fd_Handler example | ||
12 | * 2010 Mike Blumenkrantz | ||
13 | * compile with gcc $(pkgconfig --cflags --libs gnutls ecore) | ||
14 | */ | ||
15 | |||
16 | |||
17 | #define print(...) fprintf(stderr, "line %i: ", __LINE__); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n") | ||
18 | |||
19 | static int done = 0; | ||
20 | |||
21 | static void | ||
22 | tls_log_func (int level, const char *str) | ||
23 | { | ||
24 | fprintf(stderr, "|<%d>| %s", level, str); | ||
25 | } | ||
26 | |||
27 | static const char* | ||
28 | SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_description_t status) | ||
29 | { | ||
30 | switch (status) | ||
31 | { | ||
32 | case GNUTLS_HANDSHAKE_HELLO_REQUEST: | ||
33 | return "Hello request"; | ||
34 | case GNUTLS_HANDSHAKE_CLIENT_HELLO: | ||
35 | return "Client hello"; | ||
36 | case GNUTLS_HANDSHAKE_SERVER_HELLO: | ||
37 | return "Server hello"; | ||
38 | case GNUTLS_HANDSHAKE_CERTIFICATE_PKT: | ||
39 | return "Certificate packet"; | ||
40 | case GNUTLS_HANDSHAKE_SERVER_KEY_EXCHANGE: | ||
41 | return "Server key exchange"; | ||
42 | case GNUTLS_HANDSHAKE_CERTIFICATE_REQUEST: | ||
43 | return "Certificate request"; | ||
44 | case GNUTLS_HANDSHAKE_SERVER_HELLO_DONE: | ||
45 | return "Server hello done"; | ||
46 | case GNUTLS_HANDSHAKE_CERTIFICATE_VERIFY: | ||
47 | return "Certificate verify"; | ||
48 | case GNUTLS_HANDSHAKE_CLIENT_KEY_EXCHANGE: | ||
49 | return "Client key exchange"; | ||
50 | case GNUTLS_HANDSHAKE_FINISHED: | ||
51 | return "Finished"; | ||
52 | case GNUTLS_HANDSHAKE_SUPPLEMENTAL: | ||
53 | return "Supplemental"; | ||
54 | } | ||
55 | return NULL; | ||
56 | } | ||
57 | |||
58 | /* Connects to the peer and returns a socket | ||
59 | * descriptor. | ||
60 | */ | ||
61 | static int | ||
62 | tcp_connect (void) | ||
63 | { | ||
64 | const char *PORT = "443"; | ||
65 | const char *SERVER = "69.58.181.89"; //verisign.com | ||
66 | int err, sd; | ||
67 | int flag = 1, curstate = 0; | ||
68 | struct sockaddr_in sa; | ||
69 | |||
70 | /* sets some fd options such as nonblock */ | ||
71 | sd = socket (AF_INET, SOCK_STREAM, 0); | ||
72 | fcntl(sd, F_SETFL, O_NONBLOCK); | ||
73 | fcntl(sd, F_SETFD, FD_CLOEXEC); | ||
74 | setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate, sizeof(curstate)); | ||
75 | |||
76 | setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)); | ||
77 | |||
78 | memset (&sa, '\0', sizeof (sa)); | ||
79 | sa.sin_family = AF_INET; | ||
80 | sa.sin_port = htons (atoi (PORT)); | ||
81 | inet_pton (AF_INET, SERVER, &sa.sin_addr); | ||
82 | |||
83 | /* connects to server | ||
84 | */ | ||
85 | err = connect (sd, (struct sockaddr *) &sa, sizeof (sa)); | ||
86 | if ((err < 0) && (errno != EINPROGRESS)) | ||
87 | { | ||
88 | print("Connect error\n"); | ||
89 | exit (1); | ||
90 | } | ||
91 | |||
92 | return sd; | ||
93 | } | ||
94 | |||
95 | /* closes the given socket descriptor. | ||
96 | */ | ||
97 | static void | ||
98 | tcp_close (int sd) | ||
99 | { | ||
100 | shutdown (sd, SHUT_RDWR); /* no more receptions */ | ||
101 | close (sd); | ||
102 | } | ||
103 | |||
104 | static Eina_Bool | ||
105 | _process_data(gnutls_session_t client, Ecore_Fd_Handler *fd_handler) | ||
106 | { | ||
107 | static int ret, lastret; | ||
108 | static unsigned int count = 0; | ||
109 | |||
110 | if (!done) | ||
111 | { | ||
112 | lastret = ret; | ||
113 | ret = gnutls_handshake (client); | ||
114 | count++; | ||
115 | if (gnutls_record_get_direction(client)) | ||
116 | ecore_main_fd_handler_active_set(fd_handler, ECORE_FD_WRITE); | ||
117 | else | ||
118 | ecore_main_fd_handler_active_set(fd_handler, ECORE_FD_READ); | ||
119 | /* avoid printing messages infinity times */ | ||
120 | if (lastret != ret) | ||
121 | { | ||
122 | print("gnutls returned with: %s - %s", gnutls_strerror_name(ret), gnutls_strerror(ret)); | ||
123 | if ((ret == GNUTLS_E_WARNING_ALERT_RECEIVED) || (ret == GNUTLS_E_FATAL_ALERT_RECEIVED)) | ||
124 | print("Also received alert: %s", gnutls_alert_get_name(gnutls_alert_get(client))); | ||
125 | print("last out: %s", SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_get_last_out(client))); | ||
126 | print("last in: %s", SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_get_last_in(client))); | ||
127 | } | ||
128 | |||
129 | if (gnutls_error_is_fatal(ret)) | ||
130 | { | ||
131 | print("yarrr this be an error!"); | ||
132 | exit(1); | ||
133 | } | ||
134 | |||
135 | } | ||
136 | if (ret == GNUTLS_E_SUCCESS) | ||
137 | { | ||
138 | done = 1; | ||
139 | print("Handshake successful in %u handshake calls!", count); | ||
140 | ecore_main_loop_quit(); | ||
141 | } | ||
142 | |||
143 | return ECORE_CALLBACK_RENEW; | ||
144 | } | ||
145 | |||
146 | int | ||
147 | main (void) | ||
148 | { | ||
149 | /* credentials */ | ||
150 | gnutls_anon_client_credentials_t c_anoncred; | ||
151 | gnutls_certificate_credentials_t c_certcred; | ||
152 | |||
153 | gnutls_session_t client; | ||
154 | int sd; | ||
155 | |||
156 | /* General init. */ | ||
157 | gnutls_global_init (); | ||
158 | ecore_init(); | ||
159 | gnutls_global_set_log_function (tls_log_func); | ||
160 | gnutls_global_set_log_level (6); | ||
161 | |||
162 | /* Init client */ | ||
163 | gnutls_anon_allocate_client_credentials (&c_anoncred); | ||
164 | gnutls_certificate_allocate_credentials (&c_certcred); | ||
165 | gnutls_init (&client, GNUTLS_CLIENT); | ||
166 | /* set very specific priorities */ | ||
167 | gnutls_priority_set_direct(client, "NONE:%VERIFY_ALLOW_X509_V1_CA_CRT:+RSA:+DHE-RSA:+DHE-DSS:+ANON-DH:+COMP-DEFLATE:+COMP-NULL:+CTYPE-X509:+SHA1:+SHA256:+SHA384:+SHA512:+AES-256-CBC:+AES-128-CBC:+3DES-CBC:+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0:+VERS-SSL3.0", NULL); | ||
168 | gnutls_credentials_set (client, GNUTLS_CRD_ANON, c_anoncred); | ||
169 | gnutls_credentials_set (client, GNUTLS_CRD_CERTIFICATE, c_certcred); | ||
170 | gnutls_server_name_set(client, GNUTLS_NAME_DNS, "www.verisign.com", strlen("www.verisign.com")); | ||
171 | |||
172 | |||
173 | /* connect to the peer | ||
174 | */ | ||
175 | sd = tcp_connect (); | ||
176 | |||
177 | /* associate gnutls with socket */ | ||
178 | gnutls_transport_set_ptr (client, (gnutls_transport_ptr_t) sd); | ||
179 | /* add a callback for data being available for send/receive on socket */ | ||
180 | if (!ecore_main_fd_handler_add(sd, ECORE_FD_READ | ECORE_FD_WRITE, (Ecore_Fd_Cb)_process_data, client, NULL, NULL)) | ||
181 | { | ||
182 | print("could not create fd handler!"); | ||
183 | exit(1); | ||
184 | } | ||
185 | /* begin main loop */ | ||
186 | ecore_main_loop_begin(); | ||
187 | |||
188 | gnutls_bye (client, GNUTLS_SHUT_RDWR); | ||
189 | |||
190 | gnutls_deinit (client); | ||
191 | |||
192 | tcp_close (sd); | ||
193 | |||
194 | return 0; | ||
195 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_file_download_example.c b/libraries/ecore/src/examples/ecore_file_download_example.c new file mode 100644 index 0000000..c03940b --- /dev/null +++ b/libraries/ecore/src/examples/ecore_file_download_example.c | |||
@@ -0,0 +1,86 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Eina.h> | ||
3 | #include <Ecore.h> | ||
4 | #include <Ecore_File.h> | ||
5 | |||
6 | /* | ||
7 | * ecore_file_download() example | ||
8 | * | ||
9 | * compile with: | ||
10 | * gcc ecore_file_download_example.c `pkg-config --libs --cflags ecore-file` \ | ||
11 | * -o ecore_file_download_example | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #define URL "http://www.kernel.org/pub/linux/kernel/v1.0/linux-1.0.tar.gz" | ||
16 | #define DST "linux-1.0.tar.gz" | ||
17 | #define DST_MIME "[x-gzip]linux-1.0.tar.gz" | ||
18 | |||
19 | |||
20 | void | ||
21 | completion_cb(void *data, const char *file, int status) | ||
22 | { | ||
23 | printf("Done (status: %d)\n", status); | ||
24 | ecore_main_loop_quit(); | ||
25 | } | ||
26 | |||
27 | int | ||
28 | progress_cb(void *data, const char *file, | ||
29 | long int dltotal, long int dlnow, | ||
30 | long int ultotal, long int ulnow) | ||
31 | { | ||
32 | printf("Progress: %ld/%ld\n", dlnow, dltotal); | ||
33 | return ECORE_FILE_PROGRESS_CONTINUE; // continue the download | ||
34 | } | ||
35 | |||
36 | |||
37 | int main(void) | ||
38 | { | ||
39 | double start; | ||
40 | Eina_Hash *headers; | ||
41 | |||
42 | eina_init(); | ||
43 | ecore_init(); | ||
44 | ecore_file_init(); | ||
45 | |||
46 | if (ecore_file_exists(DST)) | ||
47 | ecore_file_unlink(DST); | ||
48 | |||
49 | start = ecore_time_get(); | ||
50 | |||
51 | if (ecore_file_download(URL, DST, completion_cb, progress_cb, NULL, NULL)) | ||
52 | { | ||
53 | printf("Download started successfully:\n URL: %s\n DEST: %s\n", URL, DST); | ||
54 | ecore_main_loop_begin(); | ||
55 | printf("\nTime elapsed: %f seconds\n", ecore_time_get() - start); | ||
56 | printf("Downloaded %lld bytes\n", ecore_file_size(DST)); | ||
57 | } | ||
58 | else | ||
59 | { | ||
60 | printf("Error, can't start download\n"); | ||
61 | goto done; | ||
62 | } | ||
63 | |||
64 | headers = eina_hash_string_small_new(NULL); | ||
65 | eina_hash_add(headers, "Content-type", "application/x-gzip"); | ||
66 | |||
67 | if (ecore_file_download_full(URL, DST_MIME, completion_cb, progress_cb, NULL, NULL, headers)) | ||
68 | { | ||
69 | printf("Download started successfully:\n URL: %s\n DEST: %s\n", URL, DST_MIME); | ||
70 | ecore_main_loop_begin(); | ||
71 | printf("\nTime elapsed: %f seconds\n", ecore_time_get() - start); | ||
72 | printf("Downloaded %lld bytes\n", ecore_file_size(DST)); | ||
73 | } | ||
74 | else | ||
75 | { | ||
76 | printf("Error, can't start download\n"); | ||
77 | goto done; | ||
78 | } | ||
79 | |||
80 | done: | ||
81 | if (headers) eina_hash_free(headers); | ||
82 | ecore_file_shutdown(); | ||
83 | ecore_shutdown(); | ||
84 | eina_shutdown(); | ||
85 | return 0; | ||
86 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_idler_example.c b/libraries/ecore/src/examples/ecore_idler_example.c new file mode 100644 index 0000000..d19fce3 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_idler_example.c | |||
@@ -0,0 +1,112 @@ | |||
1 | #include <Ecore.h> | ||
2 | #include <unistd.h> | ||
3 | |||
4 | struct context { // helper struct to give some context to the callbacks | ||
5 | int count; | ||
6 | Ecore_Idle_Enterer *enterer; | ||
7 | Ecore_Idler *idler; | ||
8 | Ecore_Idle_Exiter *exiter; | ||
9 | Ecore_Event_Handler *handler; | ||
10 | Ecore_Timer *timer; | ||
11 | }; | ||
12 | |||
13 | static _event_type = 0; // a new type of event will be defined and stored here | ||
14 | |||
15 | static Eina_Bool | ||
16 | _enterer_cb(void *data) // the idle enterer callback | ||
17 | { | ||
18 | printf("IDLE ENTERER: Ecore entering in idle state.\n"); | ||
19 | |||
20 | return ECORE_CALLBACK_RENEW; // same as EINA_TRUE | ||
21 | } | ||
22 | |||
23 | static Eina_Bool | ||
24 | _exiter_cb(void *data) // the idle exiter callback | ||
25 | { | ||
26 | printf("IDLE EXITER: Ecore exiting idle state.\n"); | ||
27 | |||
28 | return ECORE_CALLBACK_RENEW; // same as EINA_TRUE | ||
29 | } | ||
30 | |||
31 | static Eina_Bool | ||
32 | _idler_cb(void *data) // the idler callback - ran while the mainloop is idle | ||
33 | { | ||
34 | struct context *ctxt = data; | ||
35 | printf("IDLER: executing idler callback while in idle state.\n"); | ||
36 | |||
37 | ctxt->count++; | ||
38 | |||
39 | /* each 10 times that the callback gets called, generate an event that | ||
40 | * will wake up the main loop, triggering idle enterers, exiters, etc. */ | ||
41 | if ((ctxt->count % 10) == 0) | ||
42 | ecore_event_add(_event_type, NULL, NULL, NULL); | ||
43 | |||
44 | return ECORE_CALLBACK_RENEW; // same as EINA_TRUE | ||
45 | } | ||
46 | |||
47 | static Eina_Bool | ||
48 | _event_handler_cb(void *data, int type, void *event) // event callback | ||
49 | { | ||
50 | struct context *ctxt = data; | ||
51 | |||
52 | printf("EVENT: processing callback for the event received.\n"); | ||
53 | |||
54 | if (ctxt->count > 100) | ||
55 | { | ||
56 | ecore_idle_enterer_del(ctxt->enterer); | ||
57 | ecore_idle_exiter_del(ctxt->exiter); | ||
58 | ecore_idler_del(ctxt->idler); | ||
59 | |||
60 | ctxt->enterer = NULL; | ||
61 | ctxt->exiter = NULL; | ||
62 | ctxt->idler = NULL; | ||
63 | |||
64 | if (ctxt->timer) | ||
65 | { | ||
66 | ecore_timer_del(ctxt->timer); | ||
67 | ctxt->timer = NULL; | ||
68 | } | ||
69 | |||
70 | ecore_main_loop_quit(); | ||
71 | } | ||
72 | |||
73 | return ECORE_CALLBACK_DONE; // same as EINA_FALSE | ||
74 | } | ||
75 | |||
76 | static Eina_Bool | ||
77 | _timer_cb(void *data) | ||
78 | { | ||
79 | struct context *ctxt = data; | ||
80 | printf("TIMER: timer callback called.\n"); | ||
81 | |||
82 | if (ctxt->timer) | ||
83 | ctxt->timer = NULL; | ||
84 | |||
85 | return ECORE_CALLBACK_CANCEL; // same as EINA_TRUE | ||
86 | } | ||
87 | |||
88 | int main(int argc, char **argv) | ||
89 | { | ||
90 | struct context ctxt = {0}; | ||
91 | |||
92 | if (!ecore_init()) | ||
93 | { | ||
94 | printf("ERROR: Cannot init Ecore!\n"); | ||
95 | return -1; | ||
96 | } | ||
97 | |||
98 | _event_type = ecore_event_type_new(); | ||
99 | |||
100 | ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt); | ||
101 | ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt); | ||
102 | ctxt.idler = ecore_idler_add(_idler_cb, &ctxt); | ||
103 | ctxt.handler = ecore_event_handler_add(_event_type, | ||
104 | _event_handler_cb, | ||
105 | &ctxt); | ||
106 | ctxt.timer = ecore_timer_add(0.0005, _timer_cb, &ctxt); | ||
107 | |||
108 | ecore_main_loop_begin(); | ||
109 | ecore_shutdown(); | ||
110 | |||
111 | return 0; | ||
112 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_job_example.c b/libraries/ecore/src/examples/ecore_job_example.c new file mode 100644 index 0000000..1d28b7b --- /dev/null +++ b/libraries/ecore/src/examples/ecore_job_example.c | |||
@@ -0,0 +1,48 @@ | |||
1 | #include <Ecore.h> | ||
2 | #include <unistd.h> | ||
3 | |||
4 | static void | ||
5 | _job_print_cb(void *data) | ||
6 | { | ||
7 | char *str = data; | ||
8 | |||
9 | printf("%s\n", str); | ||
10 | } | ||
11 | |||
12 | static void | ||
13 | _job_quit_cb(void *data) | ||
14 | { | ||
15 | ecore_main_loop_quit(); | ||
16 | } | ||
17 | |||
18 | int main(int argc, char **argv) | ||
19 | { | ||
20 | Ecore_Job *job1, *job2, *job3, *job_quit; | ||
21 | char *str1 = "Job 1 started."; | ||
22 | char *str2 = "Job 2 started."; | ||
23 | char *str3 = "Job 3 started."; | ||
24 | |||
25 | if (!ecore_init()) | ||
26 | { | ||
27 | printf("ERROR: Cannot init Ecore!\n"); | ||
28 | return -1; | ||
29 | } | ||
30 | |||
31 | job1 = ecore_job_add(_job_print_cb, str1); | ||
32 | job2 = ecore_job_add(_job_print_cb, str2); | ||
33 | job3 = ecore_job_add(_job_print_cb, str3); | ||
34 | |||
35 | job_quit = ecore_job_add(_job_quit_cb, NULL); | ||
36 | printf("Created jobs 1, 2, 3 and quit.\n"); | ||
37 | |||
38 | if (job2) | ||
39 | { | ||
40 | char *str; | ||
41 | str = ecore_job_del(job2); | ||
42 | job2 = NULL; | ||
43 | printf("Deleted job 2. Its data was: \"%s\"\n", str); | ||
44 | } | ||
45 | |||
46 | ecore_main_loop_begin(); | ||
47 | ecore_shutdown(); | ||
48 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_pipe_gstreamer_example.c b/libraries/ecore/src/examples/ecore_pipe_gstreamer_example.c new file mode 100644 index 0000000..590d957 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_pipe_gstreamer_example.c | |||
@@ -0,0 +1,180 @@ | |||
1 | #include <gst/gst.h> | ||
2 | #include <Ecore.h> | ||
3 | |||
4 | static int nbr = 0; | ||
5 | |||
6 | static GstElement *_buid_pipeline (gchar *filename, Ecore_Pipe *pipe); | ||
7 | |||
8 | static void new_decoded_pad_cb (GstElement *demuxer, | ||
9 | GstPad *new_pad, | ||
10 | gpointer user_data); | ||
11 | |||
12 | static void handler(void *data, void *buf, unsigned int len) | ||
13 | { | ||
14 | GstBuffer *buffer = *((GstBuffer **)buf); | ||
15 | |||
16 | printf ("handler : %p\n", buffer); | ||
17 | printf ("frame : %d %p %lld %p\n", nbr++, data, (long long)GST_BUFFER_DURATION(buffer), buffer); | ||
18 | gst_buffer_unref (buffer); | ||
19 | } | ||
20 | |||
21 | |||
22 | static void handoff (GstElement* object, | ||
23 | GstBuffer* arg0, | ||
24 | GstPad* arg1, | ||
25 | gpointer user_data) | ||
26 | { | ||
27 | Ecore_Pipe *pipe; | ||
28 | |||
29 | pipe = (Ecore_Pipe *)user_data; | ||
30 | printf ("handoff : %p\n", arg0); | ||
31 | gst_buffer_ref (arg0); | ||
32 | ecore_pipe_write(pipe, &arg0, sizeof(arg0)); | ||
33 | } | ||
34 | |||
35 | int | ||
36 | main (int argc, char *argv[]) | ||
37 | { | ||
38 | GstElement *pipeline; | ||
39 | char *filename; | ||
40 | Ecore_Pipe *pipe; | ||
41 | |||
42 | gst_init (&argc, &argv); | ||
43 | |||
44 | if (!ecore_init ()) | ||
45 | { | ||
46 | gst_deinit (); | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | pipe = ecore_pipe_add (handler); | ||
51 | if (!pipe) | ||
52 | { | ||
53 | ecore_shutdown (); | ||
54 | gst_deinit (); | ||
55 | return 0; | ||
56 | } | ||
57 | |||
58 | if (argc < 2) { | ||
59 | g_print ("usage: %s file.avi\n", argv[0]); | ||
60 | ecore_pipe_del (pipe); | ||
61 | ecore_shutdown (); | ||
62 | gst_deinit (); | ||
63 | return 0; | ||
64 | } | ||
65 | filename = argv[1]; | ||
66 | |||
67 | pipeline = _buid_pipeline (filename, pipe); | ||
68 | if (!pipeline) { | ||
69 | g_print ("Error during the pipeline building\n"); | ||
70 | ecore_pipe_del (pipe); | ||
71 | ecore_shutdown (); | ||
72 | gst_deinit (); | ||
73 | return -1; | ||
74 | } | ||
75 | |||
76 | gst_element_set_state (pipeline, GST_STATE_PLAYING); | ||
77 | |||
78 | ecore_main_loop_begin(); | ||
79 | |||
80 | ecore_pipe_del (pipe); | ||
81 | ecore_shutdown (); | ||
82 | gst_deinit (); | ||
83 | |||
84 | return 0; | ||
85 | } | ||
86 | |||
87 | static void | ||
88 | new_decoded_pad_cb (GstElement *demuxer, | ||
89 | GstPad *new_pad, | ||
90 | gpointer user_data) | ||
91 | { | ||
92 | GstElement *decoder; | ||
93 | GstPad *pad; | ||
94 | GstCaps *caps; | ||
95 | gchar *str; | ||
96 | |||
97 | caps = gst_pad_get_caps (new_pad); | ||
98 | str = gst_caps_to_string (caps); | ||
99 | |||
100 | if (g_str_has_prefix (str, "video/")) { | ||
101 | decoder = GST_ELEMENT (user_data); | ||
102 | |||
103 | pad = gst_element_get_pad (decoder, "sink"); | ||
104 | if (GST_PAD_LINK_FAILED (gst_pad_link (new_pad, pad))) { | ||
105 | g_warning ("Failed to link %s:%s to %s:%s", GST_DEBUG_PAD_NAME (new_pad), | ||
106 | GST_DEBUG_PAD_NAME (pad)); | ||
107 | } | ||
108 | } | ||
109 | g_free (str); | ||
110 | gst_caps_unref (caps); | ||
111 | } | ||
112 | |||
113 | static GstElement | ||
114 | _buid_pipeline (gchar *filename, Ecore_Pipe *pipe) | ||
115 | { | ||
116 | GstElement *pipeline; | ||
117 | GstElement *filesrc; | ||
118 | GstElement *demuxer; | ||
119 | GstElement *decoder; | ||
120 | GstElement *sink; | ||
121 | GstStateChangeReturn res; | ||
122 | |||
123 | pipeline = gst_pipeline_new ("pipeline"); | ||
124 | if (!pipeline) | ||
125 | return NULL; | ||
126 | |||
127 | filesrc = gst_element_factory_make ("filesrc", "filesrc"); | ||
128 | if (!filesrc) { | ||
129 | printf ("no filesrc"); | ||
130 | goto failure; | ||
131 | } | ||
132 | g_object_set (G_OBJECT (filesrc), "location", filename, NULL); | ||
133 | |||
134 | demuxer = gst_element_factory_make ("oggdemux", "demuxer"); | ||
135 | if (!demuxer) { | ||
136 | printf ("no demux"); | ||
137 | goto failure; | ||
138 | } | ||
139 | |||
140 | decoder = gst_element_factory_make ("theoradec", "decoder"); | ||
141 | if (!decoder) { | ||
142 | printf ("no dec"); | ||
143 | goto failure; | ||
144 | } | ||
145 | |||
146 | g_signal_connect (demuxer, "pad-added", | ||
147 | G_CALLBACK (new_decoded_pad_cb), decoder); | ||
148 | |||
149 | sink = gst_element_factory_make ("fakesink", "sink"); | ||
150 | if (!sink) { | ||
151 | printf ("no sink"); | ||
152 | goto failure; | ||
153 | } | ||
154 | g_object_set (G_OBJECT (sink), "sync", EINA_TRUE, NULL); | ||
155 | g_object_set (G_OBJECT (sink), "signal-handoffs", EINA_TRUE, NULL); | ||
156 | g_signal_connect (sink, "handoff", | ||
157 | G_CALLBACK (handoff), pipe); | ||
158 | |||
159 | gst_bin_add_many (GST_BIN (pipeline), | ||
160 | filesrc, demuxer, decoder, sink, NULL); | ||
161 | |||
162 | if (!gst_element_link (filesrc, demuxer)) | ||
163 | goto failure; | ||
164 | if (!gst_element_link (decoder, sink)) | ||
165 | goto failure; | ||
166 | |||
167 | res = gst_element_set_state (pipeline, GST_STATE_PAUSED); | ||
168 | if (res == GST_STATE_CHANGE_FAILURE) | ||
169 | goto failure; | ||
170 | |||
171 | res = gst_element_get_state( pipeline, NULL, NULL, GST_CLOCK_TIME_NONE ); | ||
172 | if (res != GST_STATE_CHANGE_SUCCESS) | ||
173 | goto failure; | ||
174 | |||
175 | return pipeline; | ||
176 | |||
177 | failure: | ||
178 | gst_object_unref (GST_OBJECT (pipeline)); | ||
179 | return NULL; | ||
180 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_pipe_simple_example.c b/libraries/ecore/src/examples/ecore_pipe_simple_example.c new file mode 100644 index 0000000..02e8bcd --- /dev/null +++ b/libraries/ecore/src/examples/ecore_pipe_simple_example.c | |||
@@ -0,0 +1,66 @@ | |||
1 | //Compile with: | ||
2 | //gcc -g -Wall `pkg-config --cflags --libs ecore` -o ecore_pipe_simple_example ecore_pipe_simple_example.c | ||
3 | |||
4 | #include <unistd.h> | ||
5 | #include <Ecore.h> | ||
6 | |||
7 | static void | ||
8 | do_lengthy_task(Ecore_Pipe *pipe) | ||
9 | { | ||
10 | int i, j; | ||
11 | char *buffer; | ||
12 | for (i = 0; i < 20; i++) | ||
13 | { | ||
14 | sleep(1); | ||
15 | buffer = malloc(sizeof(char) * i); | ||
16 | for (j = 0; j < i; j++) | ||
17 | buffer[j] = 'a' + j; | ||
18 | ecore_pipe_write(pipe, buffer, i); | ||
19 | free(buffer); | ||
20 | } | ||
21 | ecore_pipe_write(pipe, "close", 5); | ||
22 | } | ||
23 | |||
24 | static void | ||
25 | handler(void *data, void *buf, unsigned int len) | ||
26 | { | ||
27 | char *str = malloc(sizeof(char) * len + 1); | ||
28 | memcpy(str, buf, len); | ||
29 | str[len] = '\0'; | ||
30 | printf("received %d bytes\n", len); | ||
31 | printf("content: %s\n", (const char*)str); | ||
32 | free(str); | ||
33 | if (len && !strncmp(buf, "close", len < 5 ? len : 5)) | ||
34 | { | ||
35 | printf("close requested\n"); | ||
36 | ecore_main_loop_quit(); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | int | ||
41 | main (int argc, char *argv[]) | ||
42 | { | ||
43 | Ecore_Pipe *pipe; | ||
44 | pid_t child_pid; | ||
45 | |||
46 | ecore_init(); | ||
47 | |||
48 | pipe = ecore_pipe_add(handler, NULL); | ||
49 | |||
50 | child_pid = fork(); | ||
51 | if(!child_pid) | ||
52 | { | ||
53 | ecore_pipe_read_close(pipe); | ||
54 | do_lengthy_task(pipe); | ||
55 | } | ||
56 | else | ||
57 | { | ||
58 | ecore_pipe_write_close(pipe); | ||
59 | ecore_main_loop_begin(); | ||
60 | } | ||
61 | |||
62 | ecore_pipe_del(pipe); | ||
63 | ecore_shutdown(); | ||
64 | |||
65 | return 0; | ||
66 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_poller_example.c b/libraries/ecore/src/examples/ecore_poller_example.c new file mode 100644 index 0000000..a66c069 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_poller_example.c | |||
@@ -0,0 +1,47 @@ | |||
1 | #include <Ecore.h> | ||
2 | #include <unistd.h> | ||
3 | |||
4 | static double _initial_time = 0; | ||
5 | |||
6 | static Eina_Bool | ||
7 | _poller_print_cb(void *data) | ||
8 | { | ||
9 | char *str = data; | ||
10 | printf("Ecore Poller '%s' callback called after %0.3f seconds.\n", | ||
11 | str, ecore_time_get() - _initial_time); | ||
12 | |||
13 | return ECORE_CALLBACK_RENEW; | ||
14 | } | ||
15 | |||
16 | int main(int argc, char **argv) | ||
17 | { | ||
18 | double interval = 0.3; // tick each 0.3 seconds | ||
19 | Ecore_Poller *poller1, *poller2; | ||
20 | char *str1 = "poller1"; | ||
21 | char *str2 = "poller2"; | ||
22 | |||
23 | if (!ecore_init()) | ||
24 | { | ||
25 | printf("ERROR: Cannot init Ecore!\n"); | ||
26 | return -1; | ||
27 | } | ||
28 | |||
29 | _initial_time = ecore_time_get(); | ||
30 | |||
31 | ecore_poller_poll_interval_set(ECORE_POLLER_CORE, interval); | ||
32 | |||
33 | poller1 = ecore_poller_add(ECORE_POLLER_CORE, 4, _poller_print_cb, str1); | ||
34 | poller2 = ecore_poller_add(ECORE_POLLER_CORE, 8, _poller_print_cb, str2); | ||
35 | |||
36 | ecore_main_loop_begin(); | ||
37 | |||
38 | printf("changing poller2 interval to 16\n"); | ||
39 | |||
40 | ecore_poller_poller_interval_set(poller2, 16); | ||
41 | ecore_main_loop_begin(); | ||
42 | |||
43 | ecore_poller_del(poller1); | ||
44 | ecore_poller_del(poller2); | ||
45 | |||
46 | ecore_shutdown(); | ||
47 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_server_bench.c b/libraries/ecore/src/examples/ecore_server_bench.c new file mode 100644 index 0000000..db0020c --- /dev/null +++ b/libraries/ecore/src/examples/ecore_server_bench.c | |||
@@ -0,0 +1,62 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <Ecore.h> | ||
3 | #include <Ecore_Con.h> | ||
4 | |||
5 | /* Ecore_Con server example | ||
6 | * 2010 Mike Blumenkrantz | ||
7 | */ | ||
8 | |||
9 | static Ecore_Con_Server *svr; | ||
10 | static int add; | ||
11 | static int del; | ||
12 | |||
13 | Eina_Bool | ||
14 | _add(void *data, int type, Ecore_Con_Event_Client_Add *ev) | ||
15 | { | ||
16 | ++add; | ||
17 | // printf ("%s ", ecore_con_client_ip_get(ev->client)); | ||
18 | printf("Client #%i!\n", add); | ||
19 | return ECORE_CALLBACK_RENEW; | ||
20 | } | ||
21 | |||
22 | Eina_Bool | ||
23 | _del(void *data, int type, Ecore_Con_Event_Client_Del *ev) | ||
24 | { | ||
25 | ++del; | ||
26 | printf("Disconnected #%i!\n", del); | ||
27 | if (add == del) | ||
28 | ecore_main_loop_quit(); | ||
29 | return ECORE_CALLBACK_RENEW; | ||
30 | } | ||
31 | |||
32 | int main(int argc, const char *argv[]) | ||
33 | { | ||
34 | ecore_init(); | ||
35 | ecore_con_init(); | ||
36 | ecore_app_args_set(argc, argv); | ||
37 | eina_log_domain_level_set("ecore_con", EINA_LOG_LEVEL_ERR); | ||
38 | eina_log_domain_level_set("eina", EINA_LOG_LEVEL_ERR); | ||
39 | |||
40 | |||
41 | /* to use a PEM certificate with TLS and SSL3, uncomment the lines below */ | ||
42 | // if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_NODELAY | ECORE_CON_USE_MIXED | ECORE_CON_LOAD_CERT, "127.0.0.1", 8080, NULL))) | ||
43 | |||
44 | /* to use simple tcp with ssl/tls, use this line */ | ||
45 | svr = ecore_con_server_add(ECORE_CON_REMOTE_NODELAY , "127.0.0.1", 8080, NULL); | ||
46 | if (!svr) | ||
47 | exit(1); | ||
48 | |||
49 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_add, NULL); | ||
50 | ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb)_del, NULL); | ||
51 | |||
52 | /* start server */ | ||
53 | ecore_main_loop_begin(); | ||
54 | if (add && del) | ||
55 | { | ||
56 | printf("Restarting server after %i connections\n", add); | ||
57 | add = del = 0; | ||
58 | ecore_con_server_del(svr); | ||
59 | ecore_app_restart(); | ||
60 | } | ||
61 | return 0; | ||
62 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_thread_example.c b/libraries/ecore/src/examples/ecore_thread_example.c new file mode 100644 index 0000000..7028b25 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_thread_example.c | |||
@@ -0,0 +1,394 @@ | |||
1 | /* | ||
2 | * gcc -o ecore_thread_example ecore_thread_example.c `pkg-config --cflags --libs ecore` | ||
3 | */ | ||
4 | #include <stdio.h> | ||
5 | #include <stdlib.h> | ||
6 | #include <dirent.h> | ||
7 | #include <Ecore.h> | ||
8 | #include <Ecore_Getopt.h> | ||
9 | |||
10 | typedef struct | ||
11 | { | ||
12 | Ecore_Thread *thread_3; | ||
13 | int msgs_received; | ||
14 | int max_msgs; | ||
15 | Eina_Lock mutex; | ||
16 | Eina_Condition condition; | ||
17 | } App_Data; | ||
18 | |||
19 | typedef struct | ||
20 | { | ||
21 | Eina_List *list; | ||
22 | } Thread_Data; | ||
23 | |||
24 | typedef struct | ||
25 | { | ||
26 | char *name; | ||
27 | char *base; | ||
28 | Eina_Lock mutex; | ||
29 | } Feedback_Thread_Data; | ||
30 | |||
31 | typedef struct | ||
32 | { | ||
33 | int all_done; | ||
34 | Eina_List *list; | ||
35 | } App_Msg; | ||
36 | |||
37 | static void | ||
38 | _local_data_free(void *data) | ||
39 | { | ||
40 | Thread_Data *td = data; | ||
41 | char *str; | ||
42 | |||
43 | EINA_LIST_FREE(td->list, str) | ||
44 | { | ||
45 | printf("Freeing string: %s\n", str); | ||
46 | free(str); | ||
47 | } | ||
48 | free(td); | ||
49 | } | ||
50 | |||
51 | static void | ||
52 | _short_job(void *data, Ecore_Thread *th) | ||
53 | { | ||
54 | Thread_Data *td; | ||
55 | int i; | ||
56 | |||
57 | td = ecore_thread_local_data_find(th, "data"); | ||
58 | if (!td) | ||
59 | { | ||
60 | td = calloc(1, sizeof(Thread_Data)); | ||
61 | if (!td) | ||
62 | { | ||
63 | ecore_thread_cancel(th); | ||
64 | return; | ||
65 | } | ||
66 | ecore_thread_local_data_add(th, "data", td, _local_data_free, | ||
67 | EINA_FALSE); | ||
68 | } | ||
69 | |||
70 | for (i = 0; i < 10; i++) | ||
71 | { | ||
72 | char buf[200]; | ||
73 | |||
74 | if (ecore_thread_check(th)) | ||
75 | { | ||
76 | ecore_thread_local_data_del(th, "data"); | ||
77 | break; | ||
78 | } | ||
79 | |||
80 | snprintf(buf, sizeof(buf), "Thread %p: String number %d", th, i); | ||
81 | td->list = eina_list_append(td->list, strdup(buf)); | ||
82 | sleep(1); | ||
83 | } | ||
84 | } | ||
85 | |||
86 | static void | ||
87 | _feedback_job(void *data, Ecore_Thread *th) | ||
88 | { | ||
89 | time_t t; | ||
90 | int i, count; | ||
91 | Feedback_Thread_Data *ftd = NULL; | ||
92 | DIR *dir; | ||
93 | App_Msg *msg; | ||
94 | |||
95 | count = (int)ecore_thread_global_data_find("count"); | ||
96 | for (i = 0; i < count; i++) | ||
97 | { | ||
98 | char buf[32]; | ||
99 | snprintf(buf, sizeof(buf), "data%d", i); | ||
100 | ftd = ecore_thread_global_data_find(buf); | ||
101 | if (!ftd) | ||
102 | continue; | ||
103 | if (eina_lock_take_try(&ftd->mutex)) | ||
104 | break; | ||
105 | else | ||
106 | ftd = NULL; | ||
107 | } | ||
108 | if (!ftd) | ||
109 | return; | ||
110 | |||
111 | dir = opendir(ftd->base); | ||
112 | if (!dir) | ||
113 | goto the_end; | ||
114 | |||
115 | msg = calloc(1, sizeof(App_Msg)); | ||
116 | |||
117 | t = time(NULL); | ||
118 | while (time(NULL) < t + 2) | ||
119 | { | ||
120 | struct dirent entry, *result; | ||
121 | |||
122 | if (readdir_r(dir, &entry, &result)) | ||
123 | break; | ||
124 | if (!result) | ||
125 | break; | ||
126 | |||
127 | if (strlen(result->d_name) >= 10) | ||
128 | msg->list = eina_list_append(msg->list, | ||
129 | strdup(result->d_name)); | ||
130 | } | ||
131 | |||
132 | closedir(dir); | ||
133 | ecore_thread_feedback(th, msg); | ||
134 | |||
135 | the_end: | ||
136 | ecore_thread_global_data_del(ftd->name); | ||
137 | free(ftd->name); | ||
138 | free(ftd->base); | ||
139 | eina_lock_release(&ftd->mutex); | ||
140 | eina_lock_free(&ftd->mutex); | ||
141 | free(ftd); | ||
142 | ecore_thread_reschedule(th); | ||
143 | } | ||
144 | |||
145 | static void | ||
146 | _out_of_pool_job(void *data, Ecore_Thread *th) | ||
147 | { | ||
148 | App_Data *ad = data; | ||
149 | App_Msg *msg; | ||
150 | |||
151 | while (1) | ||
152 | { | ||
153 | int msgs; | ||
154 | eina_condition_wait(&ad->condition); | ||
155 | msgs = ad->msgs_received; | ||
156 | eina_lock_release(&ad->mutex); | ||
157 | if (msgs == ad->max_msgs) | ||
158 | { | ||
159 | msg = calloc(1, sizeof(App_Msg)); | ||
160 | msg->all_done = 1; | ||
161 | ecore_thread_feedback(th, msg); | ||
162 | return; | ||
163 | } | ||
164 | } | ||
165 | } | ||
166 | |||
167 | static void | ||
168 | _print_status(void) | ||
169 | { | ||
170 | int active, pending_total, pending_feedback, pending_short, available; | ||
171 | |||
172 | active = ecore_thread_active_get(); | ||
173 | pending_total = ecore_thread_pending_total_get(); | ||
174 | pending_feedback = ecore_thread_pending_feedback_get(); | ||
175 | pending_short = ecore_thread_pending_get(); | ||
176 | available = ecore_thread_available_get(); | ||
177 | |||
178 | printf("Status:\n\t* Active threads: %d\n" | ||
179 | "\t* Available threads: %d\n" | ||
180 | "\t* Pending short jobs: %d\n" | ||
181 | "\t* Pending feedback jobs: %d\n" | ||
182 | "\t* Pending total: %d\n", active, available, pending_short, | ||
183 | pending_feedback, pending_total); | ||
184 | } | ||
185 | |||
186 | static void | ||
187 | _feedback_job_msg_cb(void *data, Ecore_Thread *th, void *msg_data) | ||
188 | { | ||
189 | App_Data *ad = data; | ||
190 | App_Msg *msg = msg_data; | ||
191 | char *str; | ||
192 | |||
193 | if (msg->all_done) | ||
194 | { | ||
195 | ecore_main_loop_quit(); | ||
196 | free(msg); | ||
197 | return; | ||
198 | } | ||
199 | |||
200 | _print_status(); | ||
201 | |||
202 | if (!msg->list) | ||
203 | printf("Received an empty list from thread %p\n", th); | ||
204 | else | ||
205 | { | ||
206 | int i = 0; | ||
207 | printf("Received %d elements from threads %p (printing first 5):\n", | ||
208 | eina_list_count(msg->list), th); | ||
209 | EINA_LIST_FREE(msg->list, str) | ||
210 | { | ||
211 | if (i <= 5) | ||
212 | printf("\t%s\n", str); | ||
213 | free(str); | ||
214 | i++; | ||
215 | } | ||
216 | } | ||
217 | |||
218 | eina_lock_take(&ad->mutex); | ||
219 | ad->msgs_received++; | ||
220 | eina_condition_signal(&ad->condition); | ||
221 | eina_lock_release(&ad->mutex); | ||
222 | |||
223 | free(msg); | ||
224 | } | ||
225 | |||
226 | static void | ||
227 | _thread_end_cb(void *data, Ecore_Thread *th) | ||
228 | { | ||
229 | App_Data *ad = data; | ||
230 | |||
231 | printf("Normal termination for thread %p.\n", th); | ||
232 | if (th == ad->thread_3) | ||
233 | ad->thread_3 = NULL; | ||
234 | } | ||
235 | |||
236 | static void | ||
237 | _thread_cancel_cb(void *data, Ecore_Thread *th) | ||
238 | { | ||
239 | App_Data *ad = data; | ||
240 | |||
241 | printf("Thread %p got cancelled.\n", th); | ||
242 | if (th == ad->thread_3) | ||
243 | ad->thread_3 = NULL; | ||
244 | } | ||
245 | |||
246 | static Eina_Bool | ||
247 | _cancel_timer_cb(void *data) | ||
248 | { | ||
249 | App_Data *ad = data; | ||
250 | |||
251 | if (ad->thread_3 && !ecore_thread_check(ad->thread_3)) | ||
252 | ecore_thread_cancel(ad->thread_3); | ||
253 | |||
254 | return EINA_FALSE; | ||
255 | } | ||
256 | |||
257 | static Eina_Bool | ||
258 | _status_timer_cb(void *data) | ||
259 | { | ||
260 | _print_status(); | ||
261 | |||
262 | return EINA_TRUE; | ||
263 | } | ||
264 | |||
265 | static const Ecore_Getopt optdesc = { | ||
266 | "ecore_thread_example", | ||
267 | NULL, | ||
268 | "0.0", | ||
269 | "(C) 2011 Enlightenment", | ||
270 | "Public domain?", | ||
271 | "Example program for Ecore_Thread", | ||
272 | 0, | ||
273 | { | ||
274 | ECORE_GETOPT_STORE_INT('t', "threads", "Max number of threads to run"), | ||
275 | ECORE_GETOPT_STORE_INT('m', "msgs", "Max number of messages to receive"), | ||
276 | ECORE_GETOPT_APPEND_METAVAR('p', "path", "Add path for feedback job", | ||
277 | "STRING", ECORE_GETOPT_TYPE_STR), | ||
278 | ECORE_GETOPT_HELP('h', "help"), | ||
279 | ECORE_GETOPT_SENTINEL | ||
280 | } | ||
281 | }; | ||
282 | |||
283 | int | ||
284 | main(int argc, char *argv[]) | ||
285 | { | ||
286 | int i, max_threads = 0, max_msgs = 0; | ||
287 | Eina_Bool opt_quit = EINA_FALSE; | ||
288 | Eina_List *path_list = NULL; | ||
289 | App_Data appdata; | ||
290 | Ecore_Getopt_Value values[] = { | ||
291 | ECORE_GETOPT_VALUE_INT(max_threads), | ||
292 | ECORE_GETOPT_VALUE_INT(max_msgs), | ||
293 | ECORE_GETOPT_VALUE_LIST(path_list), | ||
294 | ECORE_GETOPT_VALUE_BOOL(opt_quit), | ||
295 | ECORE_GETOPT_VALUE_NONE | ||
296 | }; | ||
297 | |||
298 | ecore_init(); | ||
299 | |||
300 | i = ecore_thread_max_get(); | ||
301 | printf("Initial max threads: %d\n", i); | ||
302 | |||
303 | memset(&appdata, 0, sizeof(App_Data)); | ||
304 | appdata.max_msgs = 1; | ||
305 | |||
306 | if (ecore_getopt_parse(&optdesc, values, argc, argv) < 0) | ||
307 | { | ||
308 | printf("Argument parsing failed\n"); | ||
309 | return 1; | ||
310 | } | ||
311 | |||
312 | if (opt_quit) | ||
313 | return 0; | ||
314 | |||
315 | if (max_threads) | ||
316 | { | ||
317 | ecore_thread_max_set(max_threads); | ||
318 | printf("Max threads: %d\n", ecore_thread_max_get()); | ||
319 | } | ||
320 | if (max_msgs) | ||
321 | appdata.max_msgs = max_msgs; | ||
322 | |||
323 | if (!path_list) | ||
324 | { | ||
325 | Feedback_Thread_Data *ftd; | ||
326 | ecore_thread_global_data_add("count", (void *)3, NULL, EINA_FALSE); | ||
327 | ftd = calloc(1, sizeof(Feedback_Thread_Data)); | ||
328 | ftd->name = strdup("data0"); | ||
329 | ftd->base = strdup("/usr/bin"); | ||
330 | eina_lock_new(&ftd->mutex); | ||
331 | ecore_thread_global_data_add(ftd->name, ftd, NULL, EINA_TRUE); | ||
332 | ftd = calloc(1, sizeof(Feedback_Thread_Data)); | ||
333 | ftd->name = strdup("data1"); | ||
334 | ftd->base = strdup("/usr/lib"); | ||
335 | eina_lock_new(&ftd->mutex); | ||
336 | ecore_thread_global_data_add(ftd->name, ftd, NULL, EINA_TRUE); | ||
337 | ftd = calloc(1, sizeof(Feedback_Thread_Data)); | ||
338 | ftd->name = strdup("data2"); | ||
339 | ftd->base = strdup("/usr/share"); | ||
340 | eina_lock_new(&ftd->mutex); | ||
341 | ecore_thread_global_data_add(ftd->name, ftd, NULL, EINA_TRUE); | ||
342 | } | ||
343 | else | ||
344 | { | ||
345 | Feedback_Thread_Data *ftd; | ||
346 | char *str; | ||
347 | ecore_thread_global_data_add("count", | ||
348 | (void *)eina_list_count(path_list), NULL, | ||
349 | EINA_FALSE); | ||
350 | i = 0; | ||
351 | EINA_LIST_FREE(path_list, str) | ||
352 | { | ||
353 | char buf[32]; | ||
354 | snprintf(buf, sizeof(buf), "data%d", i); | ||
355 | ftd = calloc(1, sizeof(Feedback_Thread_Data)); | ||
356 | ftd->name = strdup(buf); | ||
357 | ftd->base = strdup(str); | ||
358 | eina_lock_new(&ftd->mutex); | ||
359 | ecore_thread_global_data_add(ftd->name, ftd, NULL, EINA_TRUE); | ||
360 | free(str); | ||
361 | i++; | ||
362 | } | ||
363 | } | ||
364 | |||
365 | eina_lock_new(&appdata.mutex); | ||
366 | eina_condition_new(&appdata.condition, &appdata.mutex); | ||
367 | |||
368 | ecore_thread_feedback_run(_out_of_pool_job, _feedback_job_msg_cb, NULL, | ||
369 | NULL, &appdata, EINA_TRUE); | ||
370 | |||
371 | ecore_thread_run(_short_job, _thread_end_cb, _thread_cancel_cb, &appdata); | ||
372 | ecore_thread_feedback_run(_feedback_job, _feedback_job_msg_cb, | ||
373 | _thread_end_cb, _thread_cancel_cb, &appdata, | ||
374 | EINA_FALSE); | ||
375 | appdata.thread_3 = ecore_thread_run(_short_job, _thread_end_cb, | ||
376 | _thread_cancel_cb, &appdata); | ||
377 | ecore_thread_feedback_run(_feedback_job, _feedback_job_msg_cb, | ||
378 | _thread_end_cb, _thread_cancel_cb, &appdata, | ||
379 | EINA_FALSE); | ||
380 | |||
381 | ecore_timer_add(1.0, _cancel_timer_cb, &appdata); | ||
382 | ecore_timer_add(2.0, _status_timer_cb, NULL); | ||
383 | |||
384 | _print_status(); | ||
385 | |||
386 | ecore_main_loop_begin(); | ||
387 | |||
388 | eina_condition_free(&appdata.condition); | ||
389 | eina_lock_free(&appdata.mutex); | ||
390 | |||
391 | ecore_shutdown(); | ||
392 | |||
393 | return 0; | ||
394 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_time_functions_example.c b/libraries/ecore/src/examples/ecore_time_functions_example.c new file mode 100644 index 0000000..5fa5d60 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_time_functions_example.c | |||
@@ -0,0 +1,32 @@ | |||
1 | #include <Ecore.h> | ||
2 | #include <unistd.h> | ||
3 | |||
4 | static Eina_Bool | ||
5 | _timer_cb(void *data) | ||
6 | { | ||
7 | printf("ecore time: %0.3f\n", ecore_time_get()); | ||
8 | printf("loop time: %0.3f\n", ecore_loop_time_get()); | ||
9 | printf("unix time: %0.3f\n", ecore_time_unix_get()); | ||
10 | printf("\nSleep for 1 second...\n\n"); | ||
11 | sleep(1); | ||
12 | printf("ecore time: %0.3f\n", ecore_time_get()); | ||
13 | printf("loop time: %0.3f\n", ecore_loop_time_get()); | ||
14 | printf("unix time: %0.3f\n", ecore_time_unix_get()); | ||
15 | |||
16 | ecore_main_loop_quit(); | ||
17 | |||
18 | return EINA_FALSE; | ||
19 | } | ||
20 | |||
21 | int main(int argc, char **argv) | ||
22 | { | ||
23 | if (!ecore_init()) | ||
24 | { | ||
25 | printf("ERROR: Cannot init Ecore!\n"); | ||
26 | return -1; | ||
27 | } | ||
28 | |||
29 | ecore_timer_add(0.1, _timer_cb, NULL); | ||
30 | ecore_main_loop_begin(); | ||
31 | ecore_shutdown(); | ||
32 | } | ||
diff --git a/libraries/ecore/src/examples/ecore_timer_example.c b/libraries/ecore/src/examples/ecore_timer_example.c new file mode 100644 index 0000000..2d5d368 --- /dev/null +++ b/libraries/ecore/src/examples/ecore_timer_example.c | |||
@@ -0,0 +1,184 @@ | |||
1 | #include <Ecore.h> | ||
2 | #include <unistd.h> | ||
3 | |||
4 | #define TIMEOUT_1 1.0 // interval for timer1 | ||
5 | #define TIMEOUT_2 3.0 // timer2 - delay timer1 | ||
6 | #define TIMEOUT_3 8.2 // timer3 - pause timer1 | ||
7 | #define TIMEOUT_4 11.0 // timer4 - resume timer1 | ||
8 | #define TIMEOUT_5 14.0 // timer5 - change interval of timer1 | ||
9 | #define TIMEOUT_6 18.0 // top timer1 and start timer7 and timer8 with changed precision | ||
10 | #define TIMEOUT_7 1.1 // interval for timer7 | ||
11 | #define TIMEOUT_8 1.2 // interval for timer8 | ||
12 | #define DELAY_1 3.0 // delay time for timer1 - used by timer2 | ||
13 | #define INTERVAL1 2.0 // new interval for timer1 - used by timer5 | ||
14 | |||
15 | static double _initial_time = 0; | ||
16 | |||
17 | struct context { // helper struct to give some context to the callbacks | ||
18 | Ecore_Timer *timer1; | ||
19 | Ecore_Timer *timer2; | ||
20 | Ecore_Timer *timer3; | ||
21 | Ecore_Timer *timer4; | ||
22 | Ecore_Timer *timer5; | ||
23 | Ecore_Timer *timer6; | ||
24 | Ecore_Timer *timer7; | ||
25 | Ecore_Timer *timer8; | ||
26 | }; | ||
27 | |||
28 | static double | ||
29 | _get_current_time(void) | ||
30 | { | ||
31 | return ecore_time_get() - _initial_time; | ||
32 | } | ||
33 | |||
34 | static Eina_Bool | ||
35 | _timer1_cb(void *data) | ||
36 | { | ||
37 | printf("Timer1 expired after %0.3f seconds.\n", _get_current_time()); | ||
38 | return ECORE_CALLBACK_RENEW; | ||
39 | } | ||
40 | |||
41 | static Eina_Bool | ||
42 | _timer2_cb(void *data) | ||
43 | { | ||
44 | struct context *ctxt = data; | ||
45 | printf("Timer2 expired after %0.3f seconds. " | ||
46 | "Adding delay of %0.3f seconds to timer1.\n", | ||
47 | _get_current_time(), DELAY_1); | ||
48 | |||
49 | ecore_timer_delay(ctxt->timer1, DELAY_1); | ||
50 | |||
51 | ctxt->timer2 = NULL; | ||
52 | return ECORE_CALLBACK_CANCEL; | ||
53 | } | ||
54 | |||
55 | static Eina_Bool | ||
56 | _timer3_cb(void *data) | ||
57 | { | ||
58 | struct context *ctxt = data; | ||
59 | printf("Timer3 expired after %0.3f seconds. " | ||
60 | "Freezing timer1.\n", _get_current_time()); | ||
61 | |||
62 | ecore_timer_freeze(ctxt->timer1); | ||
63 | |||
64 | ctxt->timer3 = NULL; | ||
65 | return ECORE_CALLBACK_CANCEL; | ||
66 | } | ||
67 | |||
68 | static Eina_Bool | ||
69 | _timer4_cb(void *data) | ||
70 | { | ||
71 | struct context *ctxt = data; | ||
72 | printf("Timer4 expired after %0.3f seconds. " | ||
73 | "Resuming timer1, which has %0.3f seconds left to expire.\n", | ||
74 | _get_current_time(), ecore_timer_pending_get(ctxt->timer1)); | ||
75 | |||
76 | ecore_timer_thaw(ctxt->timer1); | ||
77 | |||
78 | ctxt->timer4 = NULL; | ||
79 | return ECORE_CALLBACK_CANCEL; | ||
80 | } | ||
81 | |||
82 | static Eina_Bool | ||
83 | _timer5_cb(void *data) | ||
84 | { | ||
85 | struct context *ctxt = data; | ||
86 | double interval = ecore_timer_interval_get(ctxt->timer1); | ||
87 | |||
88 | printf("Timer5 expired after %0.3f seconds. " | ||
89 | "Changing interval of timer1 from %0.3f to %0.3f seconds.\n", | ||
90 | _get_current_time(), interval, INTERVAL1); | ||
91 | |||
92 | ecore_timer_interval_set(ctxt->timer1, INTERVAL1); | ||
93 | |||
94 | ctxt->timer5 = NULL; | ||
95 | return ECORE_CALLBACK_CANCEL; | ||
96 | } | ||
97 | |||
98 | static Eina_Bool | ||
99 | _timer7_cb(void *data) | ||
100 | { | ||
101 | struct context *ctxt = data; | ||
102 | printf("Timer7 expired after %0.3f seconds.\n", _get_current_time()); | ||
103 | |||
104 | ctxt->timer7 = NULL; | ||
105 | return ECORE_CALLBACK_CANCEL; | ||
106 | } | ||
107 | |||
108 | static Eina_Bool | ||
109 | _timer8_cb(void *data) | ||
110 | { | ||
111 | struct context *ctxt = data; | ||
112 | printf("Timer8 expired after %0.3f seconds.\n", _get_current_time()); | ||
113 | |||
114 | ctxt->timer8 = NULL; | ||
115 | return ECORE_CALLBACK_CANCEL; | ||
116 | } | ||
117 | |||
118 | static Eina_Bool | ||
119 | _timer6_cb(void *data) | ||
120 | { | ||
121 | struct context *ctxt = data; | ||
122 | printf("Timer6 expired after %0.3f seconds.\n", _get_current_time()); | ||
123 | |||
124 | printf("Stopping timer1.\n"); | ||
125 | |||
126 | ecore_timer_del(ctxt->timer1); | ||
127 | ctxt->timer1 = NULL; | ||
128 | |||
129 | printf("Starting timer7 (%0.3fs) and timer8 (%0.3fs).\n", | ||
130 | TIMEOUT_7, TIMEOUT_8); | ||
131 | |||
132 | ctxt->timer7 = ecore_timer_add(TIMEOUT_7, _timer7_cb, ctxt); | ||
133 | ctxt->timer8 = ecore_timer_add(TIMEOUT_8, _timer8_cb, ctxt); | ||
134 | |||
135 | ecore_timer_precision_set(0.2); | ||
136 | |||
137 | ctxt->timer6 = NULL; | ||
138 | return ECORE_CALLBACK_CANCEL; | ||
139 | } | ||
140 | |||
141 | int main(int argc, char **argv) | ||
142 | { | ||
143 | struct context ctxt = {0}; | ||
144 | |||
145 | if (!ecore_init()) | ||
146 | { | ||
147 | printf("ERROR: Cannot init Ecore!\n"); | ||
148 | return -1; | ||
149 | } | ||
150 | |||
151 | _initial_time = ecore_time_get(); | ||
152 | |||
153 | ctxt.timer1 = ecore_timer_add(TIMEOUT_1, _timer1_cb, &ctxt); | ||
154 | ctxt.timer2 = ecore_timer_add(TIMEOUT_2, _timer2_cb, &ctxt); | ||
155 | ctxt.timer3 = ecore_timer_add(TIMEOUT_3, _timer3_cb, &ctxt); | ||
156 | ctxt.timer4 = ecore_timer_add(TIMEOUT_4, _timer4_cb, &ctxt); | ||
157 | ctxt.timer5 = ecore_timer_add(TIMEOUT_5, _timer5_cb, &ctxt); | ||
158 | ctxt.timer6 = ecore_timer_add(TIMEOUT_6, _timer6_cb, &ctxt); | ||
159 | |||
160 | printf("start the main loop.\n"); | ||
161 | |||
162 | ecore_main_loop_begin(); | ||
163 | |||
164 | if (ctxt.timer1) | ||
165 | ecore_timer_del(ctxt.timer1); | ||
166 | if (ctxt.timer2) | ||
167 | ecore_timer_del(ctxt.timer2); | ||
168 | if (ctxt.timer3) | ||
169 | ecore_timer_del(ctxt.timer3); | ||
170 | if (ctxt.timer4) | ||
171 | ecore_timer_del(ctxt.timer4); | ||
172 | if (ctxt.timer5) | ||
173 | ecore_timer_del(ctxt.timer5); | ||
174 | if (ctxt.timer6) | ||
175 | ecore_timer_del(ctxt.timer6); | ||
176 | if (ctxt.timer7) | ||
177 | ecore_timer_del(ctxt.timer7); | ||
178 | if (ctxt.timer8) | ||
179 | ecore_timer_del(ctxt.timer8); | ||
180 | |||
181 | ecore_shutdown(); | ||
182 | |||
183 | return 0; | ||
184 | } | ||
diff --git a/libraries/ecore/src/examples/red.png b/libraries/ecore/src/examples/red.png new file mode 100644 index 0000000..dd03528 --- /dev/null +++ b/libraries/ecore/src/examples/red.png | |||
Binary files differ | |||