summaryrefslogtreecommitdiff
path: root/src/examples/ecore
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 23:51:53 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 23:51:53 +0000
commit4a358617914f80232d6b7d0bfbdec6c018207e08 (patch)
tree68b1a7f54b29cc918c3b38cfa113de336b2fbcad /src/examples/ecore
parent49152f6982bbe427d1430bb3ed108effc7f73757 (diff)
efl/ecore: hopefully fix all examples.
SVN revision: 82243
Diffstat (limited to 'src/examples/ecore')
-rw-r--r--src/examples/ecore/Makefile.am23
-rw-r--r--src/examples/ecore/ecore_con_client_example.c12
-rw-r--r--src/examples/ecore/ecore_con_server_example.c12
-rw-r--r--src/examples/ecore/ecore_pipe_gstreamer_example.c10
4 files changed, 43 insertions, 14 deletions
diff --git a/src/examples/ecore/Makefile.am b/src/examples/ecore/Makefile.am
index 45c6e4dba7..4d876a07a4 100644
--- a/src/examples/ecore/Makefile.am
+++ b/src/examples/ecore/Makefile.am
@@ -13,7 +13,9 @@ AM_CPPFLAGS = \
13-I$(top_builddir)/src/lib/eo \ 13-I$(top_builddir)/src/lib/eo \
14-I$(top_builddir)/src/lib/evas \ 14-I$(top_builddir)/src/lib/evas \
15-I$(top_builddir)/src/lib/ecore \ 15-I$(top_builddir)/src/lib/ecore \
16-I$(top_builddir)/src/lib/ecore_file \
16-I$(top_builddir)/src/lib/ecore_input \ 17-I$(top_builddir)/src/lib/ecore_input \
18-I$(top_builddir)/src/lib/ecore_imf \
17-I$(top_builddir)/src/lib/ecore_con \ 19-I$(top_builddir)/src/lib/ecore_con \
18-I$(top_builddir)/src/lib/ecore_evas \ 20-I$(top_builddir)/src/lib/ecore_evas \
19-I$(top_builddir)/src/lib/ecore_audio \ 21-I$(top_builddir)/src/lib/ecore_audio \
@@ -44,7 +46,6 @@ ecore_event_example_02 \
44ecore_exe_example \ 46ecore_exe_example \
45ecore_exe_example_child \ 47ecore_exe_example_child \
46ecore_fd_handler_example \ 48ecore_fd_handler_example \
47ecore_fd_handler_gnutls_example \
48ecore_file_download_example \ 49ecore_file_download_example \
49ecore_idler_example \ 50ecore_idler_example \
50ecore_imf_example \ 51ecore_imf_example \
@@ -161,23 +162,35 @@ ecore_exe_example_child_LDADD = $(ECORE_COMMON_LDADD)
161ecore_fd_handler_example_SOURCES = ecore_fd_handler_example.c 162ecore_fd_handler_example_SOURCES = ecore_fd_handler_example.c
162ecore_fd_handler_example_LDADD = $(ECORE_COMMON_LDADD) 163ecore_fd_handler_example_LDADD = $(ECORE_COMMON_LDADD)
163 164
165if HAVE_CRYPTO_GNUTLS
166EXTRA_PROGRAMS += ecore_fd_handler_gnutls_example
164ecore_fd_handler_gnutls_example_SOURCES = ecore_fd_handler_gnutls_example.c 167ecore_fd_handler_gnutls_example_SOURCES = ecore_fd_handler_gnutls_example.c
165ecore_fd_handler_gnutls_example_LDADD = $(ECORE_COMMON_LDADD) 168ecore_fd_handler_gnutls_example_LDADD = $(ECORE_COMMON_LDADD) @ECORE_CON_LIBS@
169ecore_fd_handler_gnutls_example_CFLAGS = @ECORE_CON_CFLAGS@
170endif
166 171
167ecore_file_download_example_SOURCES = ecore_file_download_example.c 172ecore_file_download_example_SOURCES = ecore_file_download_example.c
168ecore_file_download_example_LDADD = $(ECORE_COMMON_LDADD) 173ecore_file_download_example_LDADD = $(ECORE_COMMON_LDADD) \
174$(top_builddir)/src/lib/ecore_file/libecore_file.la
169 175
170ecore_idler_example_SOURCES = ecore_idler_example.c 176ecore_idler_example_SOURCES = ecore_idler_example.c
171ecore_idler_example_LDADD = $(ECORE_COMMON_LDADD) 177ecore_idler_example_LDADD = $(ECORE_COMMON_LDADD)
172 178
173ecore_imf_example_SOURCES = ecore_imf_example.c 179ecore_imf_example_SOURCES = ecore_imf_example.c
174ecore_imf_example_LDADD = $(ECORE_COMMON_LDADD) 180ecore_imf_example_LDADD = $(ECORE_COMMON_LDADD) \
181$(top_builddir)/src/lib/ecore_imf/libecore_imf.la \
182$(top_builddir)/src/lib/ecore_imf/libecore_imf_evas.la \
183$(top_builddir)/src/lib/ecore_evas/libecore_evas.la
184
175 185
176ecore_job_example_SOURCES = ecore_job_example.c 186ecore_job_example_SOURCES = ecore_job_example.c
177ecore_job_example_LDADD = $(ECORE_COMMON_LDADD) 187ecore_job_example_LDADD = $(ECORE_COMMON_LDADD)
178 188
189if HAVE_GSTREAMER
179ecore_pipe_gstreamer_example_SOURCES = ecore_pipe_gstreamer_example.c 190ecore_pipe_gstreamer_example_SOURCES = ecore_pipe_gstreamer_example.c
180ecore_pipe_gstreamer_example_LDADD = $(ECORE_COMMON_LDADD) 191ecore_pipe_gstreamer_example_LDADD = $(ECORE_COMMON_LDADD) @GSTREAMER_LIBS@
192ecore_pipe_gstreamer_example_CFLAGS = @GSTREAMER_CFLAGS@
193endif
181 194
182ecore_pipe_simple_example_SOURCES = ecore_pipe_simple_example.c 195ecore_pipe_simple_example_SOURCES = ecore_pipe_simple_example.c
183ecore_pipe_simple_example_LDADD = $(ECORE_COMMON_LDADD) 196ecore_pipe_simple_example_LDADD = $(ECORE_COMMON_LDADD)
diff --git a/src/examples/ecore/ecore_con_client_example.c b/src/examples/ecore/ecore_con_client_example.c
index c6ab50d6ca..ae4bd84353 100644
--- a/src/examples/ecore/ecore_con_client_example.c
+++ b/src/examples/ecore/ecore_con_client_example.c
@@ -1,3 +1,7 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
4
1#include <stdio.h> 5#include <stdio.h>
2#include <Ecore.h> 6#include <Ecore.h>
3#include <Ecore_Con.h> 7#include <Ecore_Con.h>
@@ -6,12 +10,15 @@
6 * 2010 Mike Blumenkrantz 10 * 2010 Mike Blumenkrantz
7 */ 11 */
8 12
9/* comment if not using gnutls */ 13#ifdef HAVE_GNUTLS
14#include <gnutls/gnutls.h>
15
10static void 16static void
11tls_log_func(int level, const char *str) 17tls_log_func(int level, const char *str)
12{ 18{
13 fprintf(stderr, "|<%d>| %s", level, str); 19 fprintf(stderr, "|<%d>| %s", level, str);
14} 20}
21#endif
15 22
16Eina_Bool 23Eina_Bool
17_add(void *data, int type, Ecore_Con_Event_Server_Add *ev) 24_add(void *data, int type, Ecore_Con_Event_Server_Add *ev)
@@ -58,9 +65,10 @@ main()
58 ecore_init(); 65 ecore_init();
59 ecore_con_init(); 66 ecore_con_init();
60 67
61/* comment if not using gnutls */ 68#ifdef HAVE_GNUTLS
62 gnutls_global_set_log_level(9); 69 gnutls_global_set_log_level(9);
63 gnutls_global_set_log_function(tls_log_func); 70 gnutls_global_set_log_function(tls_log_func);
71#endif
64 72
65 if (!(it = eina_file_ls("/etc/ssl/certs"))) 73 if (!(it = eina_file_ls("/etc/ssl/certs")))
66 exit(1); 74 exit(1);
diff --git a/src/examples/ecore/ecore_con_server_example.c b/src/examples/ecore/ecore_con_server_example.c
index 73335216f5..9b929e46e4 100644
--- a/src/examples/ecore/ecore_con_server_example.c
+++ b/src/examples/ecore/ecore_con_server_example.c
@@ -1,3 +1,7 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
4
1#include <stdio.h> 5#include <stdio.h>
2#include <Ecore.h> 6#include <Ecore.h>
3#include <Ecore_Con.h> 7#include <Ecore_Con.h>
@@ -6,12 +10,15 @@
6 * 2010 Mike Blumenkrantz 10 * 2010 Mike Blumenkrantz
7 */ 11 */
8 12
9/* comment if not using gnutls */ 13#ifdef HAVE_GNUTLS
14#include <gnutls/gnutls.h>
15
10static void 16static void
11tls_log_func(int level, const char *str) 17tls_log_func(int level, const char *str)
12{ 18{
13 fprintf(stderr, "|<%d>| %s", level, str); 19 fprintf(stderr, "|<%d>| %s", level, str);
14} 20}
21#endif
15 22
16Eina_Bool 23Eina_Bool
17_add(void *data, int type, Ecore_Con_Event_Client_Add *ev) 24_add(void *data, int type, Ecore_Con_Event_Client_Add *ev)
@@ -56,9 +63,10 @@ main()
56 ecore_init(); 63 ecore_init();
57 ecore_con_init(); 64 ecore_con_init();
58 65
59/* comment if not using gnutls */ 66#ifdef HAVE_GNUTLS
60 gnutls_global_set_log_level(9); 67 gnutls_global_set_log_level(9);
61 gnutls_global_set_log_function(tls_log_func); 68 gnutls_global_set_log_function(tls_log_func);
69#endif
62 70
63/* to use a PEM certificate with TLS and SSL3, uncomment the lines below */ 71/* 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))) 72 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)))
diff --git a/src/examples/ecore/ecore_pipe_gstreamer_example.c b/src/examples/ecore/ecore_pipe_gstreamer_example.c
index 072aade813..7eb537045a 100644
--- a/src/examples/ecore/ecore_pipe_gstreamer_example.c
+++ b/src/examples/ecore/ecore_pipe_gstreamer_example.c
@@ -3,7 +3,7 @@
3 3
4static int nbr = 0; 4static int nbr = 0;
5 5
6static GstElement *_buid_pipeline(gchar *filename, Ecore_Pipe *pipe); 6static GstElement *_build_pipeline(gchar *filename, Ecore_Pipe *pipe);
7 7
8static void new_decoded_pad_cb(GstElement *demuxer, 8static void new_decoded_pad_cb(GstElement *demuxer,
9 GstPad *new_pad, 9 GstPad *new_pad,
@@ -48,7 +48,7 @@ main(int argc, char *argv[])
48 return 0; 48 return 0;
49 } 49 }
50 50
51 pipe = ecore_pipe_add(handler); 51 pipe = ecore_pipe_add(handler, NULL);
52 if (!pipe) 52 if (!pipe)
53 { 53 {
54 ecore_shutdown(); 54 ecore_shutdown();
@@ -66,7 +66,7 @@ main(int argc, char *argv[])
66 } 66 }
67 filename = argv[1]; 67 filename = argv[1];
68 68
69 pipeline = _buid_pipeline(filename, pipe); 69 pipeline = _build_pipeline(filename, pipe);
70 if (!pipeline) 70 if (!pipeline)
71 { 71 {
72 g_print("Error during the pipeline building\n"); 72 g_print("Error during the pipeline building\n");
@@ -115,8 +115,8 @@ new_decoded_pad_cb(GstElement *demuxer,
115 gst_caps_unref(caps); 115 gst_caps_unref(caps);
116} 116}
117 117
118static GstElement 118static GstElement *
119_buid_pipeline(gchar *filename, Ecore_Pipe *pipe) 119_build_pipeline(gchar *filename, Ecore_Pipe *pipe)
120{ 120{
121 GstElement *pipeline; 121 GstElement *pipeline;
122 GstElement *filesrc; 122 GstElement *filesrc;