path: root/src/examples/ecore/ (follow)
AgeCommit message (Collapse)Author
2018-08-03build: move src/examples/ to a single makefileMike Blumenkrantz
this greatly improves build times by improving parallelizing, though it does introduce more BUILT_SOURCES usage which causes builds with cxx bindings to take significantly longer fix T7157 ref T7154 Differential Revision:
2017-09-04Eina_Promise/Eina_Future: Add example and tests.Guilherme Iscaro
2017-03-29implement efl_net_{socket,dialer,server}_windowsGustavo Sverzut Barbieri
This is the local socket for windows, analogous to AF_UNIX. `Efl_Net_Socket_Windows` is the base class doing `ReadFile()` and `WriteFile()` using overlapped I/O, as well as the close procedure (`FlushFileBuffers()`, `DisconnectNamedPipe()` and `CloseHandle()`). These are done on top of an existing HANDLE that is set by `Efl_Net_Dialer_Windows` (from `CreateFile()`) or `Efl_Net_Server_Windows` (from `CreateNamedPipe()`). The overlapped I/O will return immediately, either with operation completed or `ERROR_IO_PENDING`, which means the kernel will execute that asynchronously and will later `SetEvent(overlapped.hEvent)` which is an event we wait on our main loop. That `overlapped` handle must exist during the call lifetime, thus cannot be bound to `pd`, as we may call `CancelIo()` but there is no guarantee the memory won't be touched, in that case we keep the overlapped around, but without an associated object. Windows provides no notification "can read without blocking" or non-blocking calls that returns partial data. The way to go is to use these overlapped I/O, with an initial `ReadFile()` to an internal buffer, once that operation finishes, we callback the user to says there is something to read (`efl_io_reader_can_read_set()`) and wait until `efl_io_reader_read()` is called to consume the available data, then `ReadFile()` is called again to read more data to the same internal buffer. Likewise, there is no "can write without blocking" or non-blocking calls that sends only partial data. The way to go is to get user bytes in `efl_io_writer_write()` and copy them in an internal buffer, then call `WriteFile()` on that and inform the user nothing else can be written until that operation completes (`efl_io_writer_can_write_set()`). This is cumbersome since we say we "sent" stuff when we actually didn't, it's still in our internal buffer (`pd->send.bytes`), but nonetheless the kernel and the other peer may be adding even more buffers, in this case we need to do a best effort to get it delivery. A particular case is troublesome: `write() -> close()`, this may result in `WriteFile()` pending, in this case we wait using `GetOverlappedResult()`, *this is nasty and may block*, but it's the only way I see to cope with such common use case. Other operations, like ongoing `ReadFile()` or `ConnectNamedPipe()` will be canceled using `CancelIo()`. Q: Why no I/O Completion Port (IOCP) was used? Why no CreateThreadpoolIo()? These perform much better! A: These will call back from secondary threads, but in EFL we must report back to the user in order to process incoming data or get more data to send. That is, we serialize everything to the main thread, making it impossible to use the benefits of IOCP and similar such as CreateThreadpoolIo(). Since we'd need to wakeup the main thread anyways, using `OVERLAPPED.hEvent` with `ecore_main_win32_handler_add()` does the job as we expect. Thanks to Vincent Torri (vtorri) for his help getting this code done with an example on how to do the NamedPipe handling on Windows.
2016-12-20Ecore Evas: Add a new cursor example.Guilherme Iscaro
This example sets the cursor image of each available mouse and report its position every one second.
2016-12-12efl_net: add Efl.Net.Ip_AddressGustavo Sverzut Barbieri
This is a string parser, serializer and asynchronous resolver. It's purpose is to convert to and from the strings we use in our dialers and servers, such as "" or "[::1]:1234", properties allow to check the family, port, address bytes (slice) and even get a struct sockaddr pointer to use with bind()/connect() in outside code. It will also offer some utilities present in netinet/in.h in an easy to use way, after all IN6_IS_ADDR_LOOPBACK() works one way, while there is no IN_LOOPBACK and comparing with INADDR_LOOPBACK will lead to errors since it's in network order. Last but not least, it will do asynchronous resolve of host and port names using an internal thread and getaddrinfo(). The results are delivered using a Future with an array of objects.
2016-11-29examples/ecore: build ecore_con_url_ftp_exampleGustavo Sverzut Barbieri
2016-11-25efl_net_{socket,dialer,server}_simple: easy to use, buffered network sockets.Gustavo Sverzut Barbieri
The low level I/O primitives are powerful but adds some complexity to use, for bi-directional streaming communication one ends creating two Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can operate. Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this will allow the socket, be a dialer or a server client, to be operated as a single handle that internally carries about the buffering for you. As one can see in the examples, compared to their "manual" alternatives they are very easy to use, ressembling Ecore_Con_Server/Ecore_Con_Client, but also offers line-based delimiters and the possibility to let the socket to handle queueing for you in case you received partial messages (just do not read/clear/discard the received data).
2016-11-25efl_io_buffered_stream: wraps an I/O object and make it easy to use.Gustavo Sverzut Barbieri
Since all other objects are low-level, the recommended approach is to use an However when dealing with in-memory, bi-directional comms like talking to a socket, we always end with 2 queues, 2 copiers and the annoying setup that is being replicated in ecore_ipc, efl_debug and so on. This class is the base to make it simpler. Other classes such as Efl.Net.Socket.Simple, Efl.Net.Dialer.Simple and Efl.Net.Server.Simple will use it to provide simpler code to users. I guess we can call EFL+EO Java now?
2016-11-22add ecore_ipc_{client,server}_example.Gustavo Sverzut Barbieri
Ecore_Ipc lacked examples so we can explore its API (and check if it work :-P)
2016-11-08efl_net_session and efl_net_control for ConnManGustavo Sverzut Barbieri
These are objects to allow control of networking devices (efl_net_control) as well as an application to request for connectivity (efl_net_session). They are loosely based on, which we already use in Enlightenment Window Manager via DBus access with Eldbus. However they do not map 1:1 as the goal was to expose a viable subset of controls but in a simple and general way, thus nome strings were converted to enums, some arrays of strings were converted to bitwise flags, some names were made more general, such as "service" was turned into "access point" so it doesn't generate confusion with other "network services" (ie: http server), or "favorite" that was renamed to "remembered". Some behavior are slightly different (yet able to be implemented on top), such as "Service.MoveBefore" and "MoveAfter" were converted to a numeric "priority", calculated from service's list index, changing the priority will reoder the list and thus generate the MoveBefore and MoveAfter DBus commands. ConnMan was chosen not only because we already use it, but because its DBus API is sane and simple, with the server doing almost all that we need. This is visible in the efl_net_session, which is completely done in the server and do not require any extra work on our side -- aside from talking DBus and converting to Eo, which is a major work :-D NOTE: ConnMan doesn't use FreeDesktop.Org DBus interfaces such as Properties and ObjectManager, thus we cannot use eldbus_model_object. There are two examples added: - efl_net_session_example: monitors the connection available for an application and try to connect. You need a connman compiled with session_policy_local and a configuration file explained in to get a connection if nothing is connected. Otherwise it will just monitor the connectivity state. - efl_net_control_example: monitors, plays the agent and configure the network details. It can enable/disable technologies, connect to access points (services) and configure them. It's quite extensive as allows testing all of ConnMan's DBus API except P2P (Peers).
2016-11-01examples/ecore: add example / test for wayland multiseatBruno Dilly
2016-11-01examples/ecore: command to generate OpenSSL PEM files.Gustavo Sverzut Barbieri
it's cumbersome to remember these commands and without them it's hard to test the SSL server examples, so add a make rule for that.
2016-10-31efl_net_socket_ssl: initial SSL wrapper.Gustavo Sverzut Barbieri
This is the first step towards SSL connections on top of sockets, with an example on how to upgrade a dialer and a server client using TCP.
2016-10-26addded efl_net_{socket,dialer,server}_unixGustavo Sverzut Barbieri
This introduces AF_UNIX server and dialer, these are not available on Windows as in that platform we'll create a custom class for native 'local' communication. In the future we can add a wrapper class Efl.Net.Local that will use the class for each platform, but won't expose its details. For instance, if we ever expose 'credentials' (which I didn't because they are not portable), then it doesn't make sense to try to match that on Windows. The 'Efl.Net.Local' would just stick to the basics: Reader, Writer and Closer APIs.
2016-10-18efl_net_dialer_udp: "connect" to an UDP server to send and receive data.Gustavo Sverzut Barbieri
Like existing ecore_con code, this does not use SOCKSv5 UDP proxy. It's kinda cumbersome to add since requires a keep alive TCP connection to the server, a second UDP channel and framing around the original UDP frame. Added UDP_CORK (if present) to match TCP_UDP present in TCP sockets, this allows one to execute multiple write() calls that will result in a single datagram, generated when CORK becomes FALSE again. The efl_io_copier_example.c now accepts this as output. There is no input UDP as there is no way to notify the server of a connection (since such thing doesn't exit), usually servers react after a datagram is received, replying to the source.
2016-09-28examples/ecore: add example suffix to ecore_evas_vncBruno Dilly
Make its name similar to all the other example files on this folder.
2016-09-28examples/ecore: fix vnc example buildBruno Dilly
Fix missing dependency. Get rid of the following error: /usr/bin/ld: ecore_evas_vnc.o: undefined reference to symbol 'ECORE_EVENT_MOUSE_BUTTON_UP' src/lib/ecore_input/.libs/ error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:2306: recipe for target 'ecore_evas_vnc' failed
2016-09-26Examples: Add an Ecore Evas VNC example.Guilherme Iscaro
This commit adds an Ecore_Evas examples that can be used to test the VNC multi-seat support.
2016-09-02efl_net_dialer_websocket: EFL now does WebSocket!Gustavo Sverzut Barbieri
The Efl.Net.Dialer.Websocket is just like other Efl.Net.Dialers: you can dial, you can close, monitor connected/address resolved and so on. And you can use WebSocket primitives and events such as text_send(), binary_send(), ping() and close_request() (since WebSockets use a close process where you should state a close reason). See efl_net_dialer_websocket_example.c Even if WebSocket is a message-based protocol (like "packets" from UDP), you can use efl_net_dialer_websocket_streaming_mode_set() to tell it to handle text or binary messages as a stream. Then all the Efl.Io.Reader and Efl.Io.Writer APIs work as expected, see efl_io_copier_example.c updates.
2016-08-23efl_io_queue: basic class to interact with Efl.Io interfaces.Gustavo Sverzut Barbieri
The use of low-level interfaces such as Efl.Io.Reader and Efl.Io.Writer are not that user-friendly as they can handle partial data. Classes such as Efl.Io.Copier makes them easy to use, but they need a reader (source) or writer (destination) and in our examples we used fixed buffers or some existing streams (stdin/stdout/stderr, networking...). However, if interactively we need to produce some data to be sent, such as implementing some networking protocols, we'd have to write our own Efl.Io.Reader and Efl.Io.Writer classes to handle the buffering. Not anymore! With Efl.Io.Queue you can write stuff to it and it will buffer to memory. Once stuff is read, it will automatically remove those bytes from buffer.
2016-08-23examples: add efl_io_copier_simple_example.cGustavo Sverzut Barbieri
a simpler example to be listed in wiki.
2016-08-22WIP: Introduce Efl.Net.Dialer.HttpGustavo Sverzut Barbieri
This class implements the Efl.Net.Dialer interface using libcurl to perform HTTP requests. That means it's an Efl.Net.Dialer, Efl.Net.Socket, Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus being usable with Efl.Io.Copier as demonstrated in the efl_io_copier_example.c socket, server and dialer for TCP.Gustavo Sverzut Barbieri
Efl.Net.Server defines how to accept new connections, doing the bind(), listen() and accept() for protocols such as TCP. Efl.Net.Dialer defines to to reach a server. Both are based on Efl.Net.Socket as communication interface that is based on Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus being usable with code such as Efl.Io.Copier. The Server will emit an event "client,add" with the established Socket, which is a child and can be closed by both the server or the user. The Dialer extends the Socket and allows for creating one given an address, that will be resolved and connected. TCP is the initial implementation so we an validate the interfaces. UDP, Unix-Local and SSL will come later as derivate classes. The examples are documented and should cover the basic principles: - efl_io_copier_example can accept "tcp://IP:PORT" and will work as a "netcat", can send data from socket, file or stdin to a socket, file, stdout or stderr. - efl_net_server_example listens for connections and can either reply "Hello World!" and take some data or work as an echo-server, looping back all received data to the user. More complex interactions that require a "chat" between client and server will be covered with new classes later, such as a queue that empties itself once data is read. introduce basic interfaces and classes.Gustavo Sverzut Barbieri
These interfaces allows generic operations on objects that can store or provide data, such as a file or a buffer. With well defined interfaces and events we can create code such as Efl.Io.Copier, that will link a source with a destination and progressively copy data as they appear.
2016-06-07examples: ecore: do not try to install files which are not availableStefan Schmidt
The ecore_audio examples have been disabled and now do not compile right now. But as they are disabled they never land in the tarball and thus we error out with files not aviavle for install. Found by the OpenSUSE build service. Thanks Simotek for reporting. [ 2172s] /home/abuild/rpmbuild/BUILD/efl- ecore_audio_custom.c does not exist.
2016-05-18examples: ecore: add all needed files to SOURCES to make sure they are ↵Stefan Schmidt
distributed This worked in-tree but never landed in a distribution tarball and thus the examples build form such a tarball would fail.
2016-04-21Examples: Fix compilation (disable CXX examples!)Jean-Philippe Andre
Warning: This disables CXX examples because they use now-internal APIs that have no EO API binding. Those examples should be updated to use Efl.Ui widgets... once we have them.
2016-04-14examples: add DESTDIR support for install.Cedric BAIL
2015-09-11ecore - let the ecore_con_eet_*.c examples build.David Walter Seikel
When using the --enable-always-build-examples configure option, these two examples need to be linked to eet. @fix
2015-06-24examples: Fix build after ecore_buffer commit.Stefan Schmidt
Since 8b621775619b9959fe952b095b3baaa7aaa99572 make examples fails to build as the examples have been included without checking if ecore_buffer is actually enabled to build. make[2]: *** No rule to make target '../../../src/lib/ecore_buffer/', needed by 'ecore_buffer_example'. Stop. I'm running make examples during the nightlies now in the hope to catch those.
2015-06-22ecore-buffer: Add ecore_buffer library to EFL.Seunghun Lee
Summary: Ecore_Buffer is abstraction of graphic buffer. it supports backend of shm, x11_dri2 and x11_dri3 for now, and this library also provides method to share buffers between processes. Ecore_Buffer_Provider and Ecore_Buffer_Consumer is for this, sharing buffer. provider draws something in to Ecore_Buffer, and consumer receives and displays it. the binary, bq_mgr is a connection maker for buffer provider and consumer. it can be included Enlightenment as a deamon later. @feature Test Plan: 1. Configure with --enable-ecore-buffer and --enable-always-build-examples to build examples. 2. Run bq_mgr, it connects consumer and provider. 3. Run ecore_buffer_provider_example and ecore_buffer_consumer_example Reviewers: lsj119, gwanglim, cedric, zmike, jpeg, raster, devilhorns Subscribers: cedric Differential Revision:
2015-04-23Fix ecore_con_eet_client_example example compilation errorFelipe Magno de Almeida
Added eet to include flags for for ecore examples
2015-04-22ecore: build newly added Ecore_Con examples.Cedric BAIL
2015-03-17emile: build examples after adding emile.Cedric BAIL
2015-02-25build: Unify use of $(MKDIR_P) for creating a dir within the build systemStefan Schmidt
While we used different variation of mkdir -p all over we also had spots where we did not use the option. This is one step in trying to make our build system ready for parallel install. Using something like -j 10 even for the install should help to speed up our jenkins jobs as well as distcheck.
2014-07-29ecore: fix example build fail (ecore_compose_get_example)Wonguk Jeong
2014-07-02autotools: Fixed 'make examples' and 'make examples-install'Savio Sena
It was broken in set-ups with ($(builddir) != $(srcdir)) && ($(builddir) != $(srcdir)/build)
2014-06-30Ecore examples: Add ecore_compose_get() example.Tom Hacohen
Example created by Vincent Torri.
2014-01-10autotools: really don't build Unix specific example on WindowsVincent Torri
Signed-off-by: Cedric BAIL <>
2014-01-09ecore: don't build Unix specific example on Windows.Cedric BAIL
2013-12-17add great ecore_getopt example.Gustavo Sverzut Barbieri
should cover and explain getopt usage and serve as base for applications that want to use it (all efl should!)
2013-10-01examples/ecore: don't use ECORE_CON_LIBSU. Artie Eoff
We can't use ECORE_CON_LIBS at the examples/ "make" context since it defines libraries relative to the src/ directory (e.g. lib/ecore/ Use ECORE_CON_COMMON_LDADD instead. This fixes the following link error with ecore_fd_handler_gnutls_example when the project is configured with --with-crypto=gnutls: libtool: link: cannot find the library `lib/ecore/' Signed-off-by: U. Artie Eoff <>
2013-10-01examples/ecore: ecore_pipe_gstreamer_example must go in HAVE_GSTREAMER guardU. Artie Eoff
Only specify ecore_pipe_gstreamer_example in EXTRA_PROGRAMS inside the HAVE_GSTREAMER makefile guard. Fixes: Signed-off-by: U. Artie Eoff <>
2013-07-24ecore example: Disable ecore_audio examples while Eo is in fluxDaniel Willmann
There is no legacy API we could use here, so just disable building for now.
2013-04-25fix examples makefiles to find Efl_Config.hCarsten Haitzler (Rasterman)
2013-04-18ecore_audio: Make custom input example work with eoDaniel Willmann
Uses VIO to implement a custom read function Signed-off-by: Daniel Willmann <>
2013-04-18ecore_audio: Implement ecore_audio_playback example with eoDaniel Willmann
Signed-off-by: Daniel Willmann <>
2013-04-18ecore_audio: Update transcoding example to work with eoDaniel Willmann
Signed-off-by: Daniel Willmann <>
2013-04-18ecore_audio: Build Eo-based Ecore_Audio and tests nowDaniel Willmann
Signed-off-by: Daniel Willmann <>
2013-02-15Revert "Fix build break"Tom Hacohen
This doesn't really fix build break, it actually breaks it. This reverts commit e655f0b7358765f02ea392971c6ddbf8518c37c8.