| Ecore.h | | Ecore.h | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| @brief Ecore Library Public API Calls | | @brief Ecore Library Public API Calls | |
| | | | |
| These routines are used for Ecore Library interaction | | These routines are used for Ecore Library interaction | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| | | | |
| @mainpage Ecore | | @mainpage Ecore | |
| | | | |
| @version 1.1 | | @version 1.1 | |
|
| @date 2000-2011 | | @date 2000-2012 | |
| | | | |
| Please see the @ref authors page for contact details. | | Please see the @ref authors page for contact details. | |
| | | | |
| @section intro Introduction | | @section intro Introduction | |
| | | | |
| Ecore is a library of convenience functions. A brief explanation of how
to use | | Ecore is a library of convenience functions. A brief explanation of how
to use | |
| it can be found in @ref Ecore_Main_Loop_Page. | | it can be found in @ref Ecore_Main_Loop_Page. | |
| | | | |
| The Ecore library provides the following modules: | | The Ecore library provides the following modules: | |
| @li @ref Ecore_Main_Loop_Group | | @li @ref Ecore_Main_Loop_Group | |
| @li @ref Ecore_File_Group | | @li @ref Ecore_File_Group | |
| @li @ref Ecore_Con_Group | | @li @ref Ecore_Con_Group | |
|
| @li @link Ecore_Evas.h Ecore_Evas - Evas convenience functions. @endli
nk | | @li @ref Ecore_Evas_Group | |
| @li @ref Ecore_FB_Group | | @li @ref Ecore_FB_Group | |
| @li @link Ecore_Ipc.h Ecore_IPC - Inter Process Communication functio
ns. @endlink | | @li @link Ecore_Ipc.h Ecore_IPC - Inter Process Communication functio
ns. @endlink | |
| @li @link Ecore_X.h Ecore_X - X Windows System wrapper. @endlink | | @li @link Ecore_X.h Ecore_X - X Windows System wrapper. @endlink | |
| @li @ref Ecore_Win32_Group | | @li @ref Ecore_Win32_Group | |
| @li @ref Ecore_WinCE_Group | | @li @ref Ecore_WinCE_Group | |
| | | | |
| For more info on Ecore usage, there are these @ref Examples. | | For more info on Ecore usage, there are these @ref Examples. | |
| | | | |
| @section compiling How to compile using Ecore? | | @section compiling How to compile using Ecore? | |
| pkgconfig (.pc) files are installed for every ecore module. | | pkgconfig (.pc) files are installed for every ecore module. | |
| Thus, to compile using any of them, you can use something like the follo
wing: | | Thus, to compile using any of them, you can use something like the follo
wing: | |
| | | | |
|
| @verbatim | | @verbatim | |
| gcc *.c $(pkg-config ecore ecore-$x ecore-$y [...] --cflags --libs) | | gcc *.c $(pkg-config ecore ecore-$x ecore-$y [...] --cflags --libs) | |
| @endverbatim | | @endverbatim | |
| | | | |
| @section install How is it installed? | | @section install How is it installed? | |
| | | | |
|
| Suggested configure options for evas for a Linux desktop X display: | | Suggested configure options for ecore for a Linux desktop X display | |
| | | with OpenGL and Software support, communication (networking) and | |
| @verbatim | | IPC (inter process communication): | |
| ./configure \ | | | |
| make | | @verbatim | |
| su - | | ./configure \ | |
| ... | | --enable-ecore-con \ | |
| make install | | --enable-ecore-ipc \ | |
| @endverbatim | | --enable-ecore-file \ | |
| | | --enable-ecore-input \ | |
| | | --enable-ecore-input-evas \ | |
| | | --enable-ecore-x \ | |
| | | --enable-ecore-evas \ | |
| | | --enable-ecore-evas-software-buffer \ | |
| | | --enable-ecore-evas-software-x11 \ | |
| | | --enable-ecore-evas-opengl-x11 | |
| | | make | |
| | | sudo make install | |
| | | @endverbatim | |
| | | | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| @page authors Authors | | @page authors Authors | |
| @author Carsten Haitzler <raster@rasterman.com> | | @author Carsten Haitzler <raster@rasterman.com> | |
| @author Tom Gilbert <tom@linuxbrit.co.uk> | | @author Tom Gilbert <tom@linuxbrit.co.uk> | |
| @author Burra <burra@colorado.edu> | | @author Burra <burra@colorado.edu> | |
| @author Chris Ross <chris@darkrock.co.uk> | | @author Chris Ross <chris@darkrock.co.uk> | |
| @author Term <term@twistedpath.org> | | @author Term <term@twistedpath.org> | |
| | | | |
| skipping to change at line 98 | | skipping to change at line 108 | |
| @author Rui Miguel Silva Seabra <rms@1407.org> | | @author Rui Miguel Silva Seabra <rms@1407.org> | |
| @author Samsung Electronics | | @author Samsung Electronics | |
| @author Samsung SAIT | | @author Samsung SAIT | |
| @author Nicolas Aguirre <aguirre.nicolas@gmail.com> | | @author Nicolas Aguirre <aguirre.nicolas@gmail.com> | |
| @author Brett Nash <nash@nash.id.au> | | @author Brett Nash <nash@nash.id.au> | |
| @author Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | | @author Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | |
| @author Leif Middelschulte <leif.middelschulte@gmail.com> | | @author Leif Middelschulte <leif.middelschulte@gmail.com> | |
| @author Mike McCormack <mj.mccormack@samsung.com> | | @author Mike McCormack <mj.mccormack@samsung.com> | |
| @author Sangho Park <gouache95@gmail.com> | | @author Sangho Park <gouache95@gmail.com> | |
| @author Jihoon Kim <jihoon48.kim@samsung.com> <imfine98@gmail.com> | | @author Jihoon Kim <jihoon48.kim@samsung.com> <imfine98@gmail.com> | |
|
| | | @author PnB <Poor.NewBie@gmail.com> | |
| @author Daniel Juyung Seo <seojuyung2@gmail.com> <juyung.seo@samsung.com
> | | @author Daniel Juyung Seo <seojuyung2@gmail.com> <juyung.seo@samsung.com
> | |
|
| | | @author Christopher 'devilhorns' Michael <cpmichael1@comcast.net> | |
| | | @author ChunEon Park <hermet@hermet.pe.kr> | |
| | | @author xlopez@igalia.com | |
| | | @author Rafael Antognolli <antognolli@profusion.mobi> | |
| | | @author Kim Yunhan <spbear@gmail.com> | |
| | | @author Youness Alaoui <kakaroto@kakaroto.homelinux.net> | |
| | | @author Bluezery <ohpowel@gmail.com> | |
| | | @author Doyoun Kang <wayofmine@gmail.com> <doyoun.kang@samsung.com> | |
| | | @author Haifeng Deng <haifeng.deng@samsung.com> | |
| | | | |
| Please contact <enlightenment-devel@lists.sourceforge.net> to get in | | Please contact <enlightenment-devel@lists.sourceforge.net> to get in | |
| contact with the developers and maintainers. | | contact with the developers and maintainers. | |
| */ | | */ | |
| | | | |
|
| /* | | /** | |
| @page Ecore_Main_Loop_Page The Ecore Main Loop | | * @page Ecore_Main_Loop_Page The Ecore Main Loop | |
| | | * | |
| @section intro What is Ecore? | | * @section intro What is Ecore? | |
| | | * | |
| Ecore is a clean and tiny event loop library with many modules to do lot | | * Ecore is a clean and tiny event loop library with many modules to do lot | |
| s of | | s of | |
| convenient things for a programmer, to save time and effort. | | * convenient things for a programmer, to save time and effort. It's small | |
| | | and | |
| It's small and lean, designed to work on embedded systems all the way to | | * lean, designed to work from embedded systems all the way up to large and | |
| large and powerful multi-cpu workstations. It serialises all system sign | | * powerful multi-cpu workstations. The main loop has a number of primitive | |
| als, | | s to | |
| events etc. into a single event queue, that is easily processed without | | * be used with its main loop. It serializes all the primitives and allows | |
| needing to worry about concurrency. A properly written, event-driven pro | | for | |
| gram | | * great responsiveness without the need for threads(or any other concurren | |
| using this kind of programming doesn't need threads, nor has to worry ab | | cy). | |
| out | | * | |
| concurrency. It turns a program into a state machine, and makes it very | | * @subsection timers Timers | |
| robust and easy to follow. | | * | |
| | | * Timers serve two main purposes: doing something at a specified time and | |
| Ecore gives you other handy primitives, such as timers to tick over for | | * repeatedly doing something with a set interval. | |
| you | | * @see Ecore_Timer_Group | |
| and call specified functions at particular times so the programmer can u | | * | |
| se | | * @subsection poolers Poolers | |
| this to do things, like animate, or time out on connections or tasks tha | | * | |
| t take | | * Poolers allow for pooling to be centralized into a single place therefor | |
| too long etc. | | e | |
| | | * alleviating the need for different parts of the program to wake up at | |
| Idle handlers are provided too, as well as calls on entering an idle sta | | * different times to do pooling, thereby making the code simpler and more | |
| te | | * efficient. | |
| (often a very good time to update the state of the program). All events | | * @see Ecore_Poller_Group | |
| that | | * | |
| enter the system are passed to specific callback functions that the prog | | * @subsection idler Idlers | |
| ram | | * | |
| sets up to handle those events. Handling them is simple and other Ecore | | * There are three types of idlers, enterers, idlers(proper) and exiters, t | |
| modules produce more events on the queue, coming from other sources such | | hey | |
| as | | * are called, respectively, when the program is about to enter an idle sta | |
| file descriptors etc. | | te, | |
| | | * when the program is idle and when the program is leaving an idle state. | |
| Ecore also lets you have functions called when file descriptors become a | | Idler | |
| ctive | | * enterers are usually a good place to update the program state. Proper id | |
| for reading or writing, allowing for streamlined, non-blocking IO. | | lers | |
| | | * are the appropriate place to do heavy computational tasks thereby using | |
| Here is an example of a simple program and its basic event loop flow: | | what | |
| | | * would otherwise be wasted CPU cycles. Exiters are the perfect place to d | |
| @image html prog_flow.png | | o | |
| @image latex prog_flow.eps width=\textwidth | | * anything your program should do just before processing events(also timer | |
| | | s, | |
| @section work How does Ecore work? | | * poolers, file descriptor handlers and animators) | |
| | | * @see Ecore_Idle_Group | |
| Ecore is very easy to learn and use. All the function calls are designed | | * | |
| to | | * @subsection fd_handler File descriptor handlers | |
| be easy to remember, explicit in describing what they do, and heavily | | * | |
| name-spaced. Ecore programs can start and be very simple. | | * File descriptor handlers allow you to monitor when there is data availab | |
| | | le to | |
| For example: | | * read on file descriptors, when writing will not block or if there was an | |
| | | * error. Any valid file descriptor can be used with this API, regardless o | |
| @code | | f if | |
| #include <Ecore.h> | | * was gotten with an OS specific API or from ecore. | |
| | | * @see Ecore_FD_Handler_Group | |
| int | | * | |
| main(int argc, const char **argv) | | * @subsection animators Animators | |
| { | | * | |
| ecore_init(); | | * Ecore provides a facility called animators, so named since the intended | |
| ecore_app_args_set(argc, argv); | | use | |
| ecore_main_loop_begin(); | | * was in animations, that facilitates knowing what percentage of a given | |
| ecore_shutdown(); | | * interval has elapsed. This is perfect for performing animations, but is | |
| return 0; | | not | |
| } | | * limited to that use, it can, for example, also be used to create a progr | |
| @endcode | | ess | |
| | | * bar. | |
| This program is very simple and doesn't check for errors, but it does st | | * @see Ecore_Animator_Group | |
| art up | | * | |
| and begin a main loop waiting for events or timers to tick off. This pro | | * @subsection ev_handlers Event handlers | |
| gram | | * | |
| doesn't set up any, but now we can expand on this simple program a littl | | * Event handlers are, arguably, the most important feature of the ecore ma | |
| e | | in | |
| more by adding some event handlers and timers. | | * loop, they are what allows the programmer to easily handle user interact | |
| | | ion. | |
| @code | | * Events however are not only things the user does, events can represent | |
| #include <Ecore.h> | | * anything for which a type is created. | |
| | | * @see Ecore_Event_Group | |
| Ecore_Timer *timer1 = NULL; | | * | |
| Ecore_Event_Handler *handler1 = NULL; | | * All of these primitives are discussed in more detail in their respective | |
| double start_time = 0.0; | | * pages linked above. | |
| | | * | |
| int | | * Here is a diagram of the main loop flow of a simple program: | |
| timer_func(void *data) | | * | |
| { | | * @image html prog_flow.png | |
| printf("Tick timer. Sec: %3.2f\n", ecore_time_get() - start_time); | | * @image latex prog_flow.eps width=\textwidth | |
| return 1; | | * | |
| } | | * | |
| | | * | |
| int | | * @section work How does Ecore work? | |
| exit_func(void *data, int ev_type, void *ev) | | * | |
| { | | * Ecore is very easy to learn and use. All the function calls are designed | |
| Ecore_Event_Signal_Exit *e; | | to | |
| | | * be easy to remember, explicit in describing what they do, and heavily | |
| e = (Ecore_Event_Signal_Exit *)ev; | | * name-spaced. Ecore programs can start and be very simple. | |
| if (e->interrupt) printf("Exit: interrupt\n"); | | * | |
| else if (e->quit) printf("Exit: quit\n"); | | * For example: | |
| else if (e->terminate) printf("Exit: terminate\n"); | | * | |
| ecore_main_loop_quit(); | | * @code | |
| return 1; | | * #include <Ecore.h> | |
| } | | * | |
| | | * int | |
| int | | * main(int argc, const char **argv) | |
| main(int argc, const char **argv) | | * { | |
| { | | * ecore_init(); | |
| ecore_init(); | | * ecore_app_args_set(argc, argv); | |
| ecore_app_args_set(argc, argv); | | * ecore_main_loop_begin(); | |
| start_time = ecore_time_get(); | | * ecore_shutdown(); | |
| handler1 = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, N | | * return 0; | |
| ULL); | | * } | |
| timer1 = ecore_timer_add(0.5, timer_func, NULL); | | * @endcode | |
| ecore_main_loop_begin(); | | * | |
| ecore_shutdown(); | | * This program is very simple and doesn't check for errors, but it does st | |
| return 0; | | art up | |
| } | | * and begin a main loop waiting for events or timers to tick off. This pro | |
| @endcode | | gram | |
| | | * doesn't set up any, but now we can expand on this simple program a littl | |
| In the previous example, we initialize our application and get the time | | e | |
| at | | * more by adding some event handlers and timers. | |
| which our program has started so we can calculate an offset. We set | | * | |
| up a timer to tick off in 0.5 seconds, and since it returns 1, will | | * @code | |
| keep ticking off every 0.5 seconds until it returns 0, or is deleted | | * #include <Ecore.h> | |
| by hand. An event handler is set up to call a function - | | * | |
| exit_func(), | | * Ecore_Timer *timer1 = NULL; | |
| whenever an event of type ECORE_EVENT_SIGNAL_EXIT is received (CTRL-C | | * Ecore_Event_Handler *handler1 = NULL; | |
| on the command line will cause such an event to happen). If this event | | * double start_time = 0.0; | |
| occurs it tells you what kind of exit signal was received, and asks | | * | |
| the main loop to quit when it is finished by calling | | * int | |
| ecore_main_loop_quit(). | | * timer_func(void *data) | |
| | | * { | |
| The handles returned by ecore_timer_add() and | | * printf("Tick timer. Sec: %3.2f\n", ecore_time_get() - start_time); | |
| ecore_event_handler_add() are | | * return 1; | |
| only stored here as an example. If you don't need to address the timer o | | * } | |
| r | | * | |
| event handler again you don't need to store the result, so just call the | | * int | |
| function, and don't assign the result to any variable. | | * exit_func(void *data, int ev_type, void *ev) | |
| | | * { | |
| This program looks slightly more complex than needed to do these simple | | * Ecore_Event_Signal_Exit *e; | |
| things, but in principle, programs don't get any more complex. You add m | | * | |
| ore | | * e = (Ecore_Event_Signal_Exit *)ev; | |
| event handlers, for more events, will have more timers and such, BUT it | | * if (e->interrupt) printf("Exit: interrupt\n"); | |
| all | | * else if (e->quit) printf("Exit: quit\n"); | |
| follows the same principles as shown in this example. | | * else if (e->terminate) printf("Exit: terminate\n"); | |
| | | * ecore_main_loop_quit(); | |
| | | * return 1; | |
| | | * } | |
| | | * | |
| | | * int | |
| | | * main(int argc, const char **argv) | |
| | | * { | |
| | | * ecore_init(); | |
| | | * ecore_app_args_set(argc, argv); | |
| | | * start_time = ecore_time_get(); | |
| | | * handler1 = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func | |
| | | , NULL); | |
| | | * timer1 = ecore_timer_add(0.5, timer_func, NULL); | |
| | | * ecore_main_loop_begin(); | |
| | | * ecore_shutdown(); | |
| | | * return 0; | |
| | | * } | |
| | | * @endcode | |
| | | * | |
| | | * In the previous example, we initialize our application and get the time | |
| | | at | |
| | | * which our program has started so we can calculate an offset. We set | |
| | | * up a timer to tick off in 0.5 seconds, and since it returns 1, will | |
| | | * keep ticking off every 0.5 seconds until it returns 0, or is deleted | |
| | | * by hand. An event handler is set up to call a function - | |
| | | * exit_func(), | |
| | | * whenever an event of type ECORE_EVENT_SIGNAL_EXIT is received (CTRL-C | |
| | | * on the command line will cause such an event to happen). If this event | |
| | | * occurs it tells you what kind of exit signal was received, and asks | |
| | | * the main loop to quit when it is finished by calling | |
| | | * ecore_main_loop_quit(). | |
| | | * | |
| | | * The handles returned by ecore_timer_add() and | |
| | | * ecore_event_handler_add() are | |
| | | * only stored here as an example. If you don't need to address the timer o | |
| | | r | |
| | | * event handler again you don't need to store the result, so just call the | |
| | | * function, and don't assign the result to any variable. | |
| | | * | |
| | | * This program looks slightly more complex than needed to do these simple | |
| | | * things, but in principle, programs don't get any more complex. You add m | |
| | | ore | |
| | | * event handlers, for more events, will have more timers and such, BUT it | |
| | | all | |
| | | * follows the same principles as shown in this example. | |
| | | * | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| @page Ecore_Config_Page The Enlightened Property Library | | @page Ecore_Config_Page The Enlightened Property Library | |
| | | | |
|
| The Enlightened Property Library (Ecore_Config) is an adbstraction | | The Enlightened Property Library (Ecore_Config) is an abstraction | |
| from the complexities of writing your own configuration. It provides | | from the complexities of writing your own configuration. It provides | |
| many features using the Enlightenment 17 development libraries. | | many features using the Enlightenment 17 development libraries. | |
| | | | |
| To use the library, you: | | To use the library, you: | |
| @li Set the default values of your properties. | | @li Set the default values of your properties. | |
| @li Load the configuration from a file. You must set the default values | | @li Load the configuration from a file. You must set the default values | |
| first, so that the library knows the correct type of each argument. | | first, so that the library knows the correct type of each argument. | |
| | | | |
| The following examples show how to use the Enlightened Property Library: | | The following examples show how to use the Enlightened Property Library: | |
| @li @link config_basic_example.c config_basic_example.c @endlink | | @li @link config_basic_example.c config_basic_example.c @endlink | |
| | | | |
| skipping to change at line 301 | | skipping to change at line 358 | |
| # endif | | # endif | |
| #endif /* ! _WIN32 */ | | #endif /* ! _WIN32 */ | |
| | | | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| # include <winsock2.h> | | # include <winsock2.h> | |
| #elif (defined (__FreeBSD__) && (__FreeBSD_version >= 420001)) || defined (
__OpenBSD__) | | #elif (defined (__FreeBSD__) && (__FreeBSD_version >= 420001)) || defined (
__OpenBSD__) | |
| # include <sys/select.h> | | # include <sys/select.h> | |
| # include <signal.h> | | # include <signal.h> | |
| #else | | #else | |
| # include <sys/time.h> | | # include <sys/time.h> | |
|
| # include <signal.h> | | # if !defined (EXOTIC_NO_SIGNAL) | |
| | | # include <signal.h> | |
| | | # endif | |
| #endif | | #endif | |
| | | | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Init_Group Ecore initialization and shutdown functions. | | * @defgroup Ecore_Init_Group Ecore initialization and shutdown functions. | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
|
| EAPI int | | EAPI int ecore_init(void); | |
| ecore_init(void); | | EAPI int ecore_shutdown(void); | |
| EAPI int | | | |
| ecore_shutdown(void); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
|
| | | * @defgroup Ecore_Main_Loop_Group Ecore main loop | |
| * | | * | |
|
| * @defgroup Ecore_Main_Loop_Group Ecore main loop functions | | * This group discusses functions that are acting on Ecore's main loop itse | |
| | | lf or | |
| | | * on events and infrastructure directly linked to it. Most programs only n | |
| | | eed | |
| | | * to start and end the main loop, the rest of the function discussed here | |
| | | are | |
| | | * meant to be used in special situations, and with great care. | |
| * | | * | |
|
| * These are functions acting on Ecore's main loop itself or on | | * For details on the usage of ecore's main loop and how it interacts with | |
| * events and infrastructure directly linked to it. This loop is | | other | |
| * designed to work on embedded systems all the way to large and | | * ecore facilities see: @ref Ecore_Main_Loop_Page. | |
| * powerful multi-cpu workstations. | | | |
| * | | | |
| * It serialises all system signals and events into a single event | | | |
| * queue, that can be easily processed without needing to worry | | | |
| * about concurrency. A properly written, event-driven program | | | |
| * using this kind of programming does not need threads. It makes | | | |
| * the program very robust and easy to follow. | | | |
| * | | | |
| * For example, for the main loop to be of any use, you need to be | | | |
| * able to add @b events and event handlers on it. Events for file | | | |
| * descriptor events are covered in @ref Ecore_FD_Handler_Group. | | | |
| * | | | |
| * Timer functions are covered in @ref Ecore_Time_Group. | | | |
| * | | | |
| * There is also provision for callbacks for when the loop enters or | | | |
| * exits an @b idle state. See @ref Ecore_Idle_Group for more | | | |
| * information on it. | | | |
| * | | | |
| * Functions are also provided for spawning child processes using | | | |
| * @c fork(). See @ref Ecore_Exe_Group for more details on it. | | | |
| * | | | |
| * Here is an example of simple program and its basic event loop | | | |
| * flow: | | | |
| * | | | |
| * @image html prog_flow.png | | | |
| * @image latex prog_flow.eps width=\textwidth | | | |
| * | | | |
| * For examples of setting up and using a main loop, see | | | |
| * @ref Ecore_Main_Loop_Page. | | | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| #define ECORE_VERSION_MAJOR 1 | | #define ECORE_VERSION_MAJOR 1 | |
|
| #define ECORE_VERSION_MINOR 0 | | #define ECORE_VERSION_MINOR 2 | |
| | | | |
| typedef struct _Ecore_Version | | typedef struct _Ecore_Version | |
| { | | { | |
| int major; | | int major; | |
| int minor; | | int minor; | |
| int micro; | | int micro; | |
| int revision; | | int revision; | |
| } Ecore_Version; | | } Ecore_Version; | |
| | | | |
| EAPI extern Ecore_Version *ecore_version; | | EAPI extern Ecore_Version *ecore_version; | |
| | | | |
| skipping to change at line 391 | | skipping to change at line 422 | |
| #define ECORE_CALLBACK_PASS_ON EINA_TRUE /**< Return value to pass event to
next handler */ | | #define ECORE_CALLBACK_PASS_ON EINA_TRUE /**< Return value to pass event to
next handler */ | |
| #define ECORE_CALLBACK_DONE EINA_FALSE /**< Return value to stop event h
andling */ | | #define ECORE_CALLBACK_DONE EINA_FALSE /**< Return value to stop event h
andling */ | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Task_Cb Ecore_Task_Cb | | * @typedef Ecore_Task_Cb Ecore_Task_Cb | |
| * A callback run for a task (timer, idler, poller, animator, etc) | | * A callback run for a task (timer, idler, poller, animator, etc) | |
| */ | | */ | |
| typedef Eina_Bool (*Ecore_Task_Cb)(void *data); | | typedef Eina_Bool (*Ecore_Task_Cb)(void *data); | |
| | | | |
| /** | | /** | |
|
| * @typedef Ecore_Eselect_Function Ecore_Eselect_Function | | * @typedef Ecore_Select_Function | |
| * A function which can be used to replace select() in the main loop | | * A function which can be used to replace select() in the main loop | |
| */ | | */ | |
| typedef int (*Ecore_Select_Function)(int nfds, fd_set *readfds, fd_set *wri
tefds, fd_set *exceptfds, struct timeval *timeout); | | typedef int (*Ecore_Select_Function)(int nfds, fd_set *readfds, fd_set *wri
tefds, fd_set *exceptfds, struct timeval *timeout); | |
| | | | |
|
| EAPI void | | EAPI void ecore_main_loop_iterate(void); | |
| ecore_main_loop_iterate(void); | | | |
| | | EAPI void ecore_main_loop_select_func_set(Ecore_Select_Function func); | |
| | | EAPI Ecore_Select_Function ecore_main_loop_select_func_get(void); | |
| | | | |
|
| EAPI void | | EAPI Eina_Bool ecore_main_loop_glib_integrate(void); | |
| ecore_main_loop_select_func_set(Ecore_Select_Function func); | | EAPI void ecore_main_loop_glib_always_integrate_disable(void); | |
| EAPI Ecore_Select_Function | | | |
| ecore_main_loop_select_func_get(void); | | EAPI void ecore_main_loop_begin(void); | |
| | | EAPI void ecore_main_loop_quit(void); | |
| EAPI Eina_Bool | | | |
| ecore_main_loop_glib_integrate(void); | | | |
| EAPI void | | | |
| ecore_main_loop_glib_always_integrate_disable(void); | | | |
| | | | |
| EAPI void | | | |
| ecore_main_loop_begin(void); | | | |
| EAPI void | | | |
| ecore_main_loop_quit(void); | | | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Cb Ecore_Cb | | * @typedef Ecore_Cb Ecore_Cb | |
| * A generic callback called as a hook when a certain point in | | * A generic callback called as a hook when a certain point in | |
| * execution is reached. | | * execution is reached. | |
| */ | | */ | |
| typedef void (*Ecore_Cb)(void *data); | | typedef void (*Ecore_Cb)(void *data); | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Data_Cb Ecore_Data_Cb | | * @typedef Ecore_Data_Cb Ecore_Data_Cb | |
| | | | |
| skipping to change at line 442 | | skipping to change at line 466 | |
| * @param data The data to give to that call back | | * @param data The data to give to that call back | |
| * | | * | |
| * For all calls that need to happen in the main loop (most EFL functions d
o), | | * For all calls that need to happen in the main loop (most EFL functions d
o), | |
| * this helper function provides the infrastructure needed to do it safely | | * this helper function provides the infrastructure needed to do it safely | |
| * by avoiding dead lock, race condition and properly wake up the main loop
. | | * by avoiding dead lock, race condition and properly wake up the main loop
. | |
| * | | * | |
| * Remember after that function call, you should never touch again the @p d
ata | | * Remember after that function call, you should never touch again the @p d
ata | |
| * in the thread, it is owned by the main loop and your callback should tak
e | | * in the thread, it is owned by the main loop and your callback should tak
e | |
| * care of freeing it if necessary. | | * care of freeing it if necessary. | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_main_loop_thread_safe_call_async(Ecore_Cb callback, void *d | |
| ecore_main_loop_thread_safe_call_async(Ecore_Cb callback, | | ata); | |
| void *data); | | | |
| | | | |
| /** | | /** | |
| * @brief Call callback synchronously in the main loop. | | * @brief Call callback synchronously in the main loop. | |
| * @since 1.1.0 | | * @since 1.1.0 | |
| * | | * | |
| * @param callback The callback to call in the main loop | | * @param callback The callback to call in the main loop | |
| * @param data The data to give to that call back | | * @param data The data to give to that call back | |
| * @return the value returned by the callback in the main loop | | * @return the value returned by the callback in the main loop | |
| * | | * | |
| * For all calls that need to happen in the main loop (most EFL functions d
o), | | * For all calls that need to happen in the main loop (most EFL functions d
o), | |
| * this helper function provides the infrastructure needed to do it safely | | * this helper function provides the infrastructure needed to do it safely | |
| * by avoiding dead lock, race condition and properly wake up the main loop
. | | * by avoiding dead lock, race condition and properly wake up the main loop
. | |
| * | | * | |
| * Remember this function will block until the callback is executed in the | | * Remember this function will block until the callback is executed in the | |
| * main loop. It can take time and you have no guaranty about the timeline. | | * main loop. It can take time and you have no guaranty about the timeline. | |
| */ | | */ | |
|
| EAPI void * | | EAPI void *ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback, vo | |
| ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback, | | id *data); | |
| void *data); | | | |
| | | | |
| /** | | /** | |
| * @brief This function suspend the main loop in a know state | | * @brief This function suspend the main loop in a know state | |
| * @since 1.1.0 | | * @since 1.1.0 | |
| * | | * | |
| * @result the number of time ecore_thread_main_loop_begin() has been calle
d | | * @result the number of time ecore_thread_main_loop_begin() has been calle
d | |
| * in this thread, if the main loop was suspended correctly. If not, it ret
urn @c -1. | | * in this thread, if the main loop was suspended correctly. If not, it ret
urn @c -1. | |
| * | | * | |
| * This function suspend the main loop in a know state, this let you | | * This function suspend the main loop in a know state, this let you | |
|
| * use any EFL call you want after it return. Be carefull, the main loop | | * use any EFL call you want after it return. Be carefully, the main loop | |
| * is blocked until you call ecore_thread_main_loop_end(). This is | | * is blocked until you call ecore_thread_main_loop_end(). This is | |
| * the only sane way to achieve pseudo thread safety. | | * the only sane way to achieve pseudo thread safety. | |
| * | | * | |
| * Notice that until the main loop is blocked, the thread is blocked | | * Notice that until the main loop is blocked, the thread is blocked | |
| * and their is noway around that. | | * and their is noway around that. | |
| * | | * | |
| * We still advise you, when possible, to use ecore_main_loop_thread_safe_c
all_async() | | * We still advise you, when possible, to use ecore_main_loop_thread_safe_c
all_async() | |
| * as it will not block the thread nor the main loop. | | * as it will not block the thread nor the main loop. | |
| */ | | */ | |
|
| EAPI int | | EAPI int ecore_thread_main_loop_begin(void); | |
| ecore_thread_main_loop_begin(void); | | | |
| | | | |
| /** | | /** | |
| * @brief Unlock the main loop. | | * @brief Unlock the main loop. | |
| * @since 1.1.0 | | * @since 1.1.0 | |
| * | | * | |
| * @result the number of time ecore_thread_main_loop_end() need to be calle
d before | | * @result the number of time ecore_thread_main_loop_end() need to be calle
d before | |
| * the main loop is unlocked again. @c -1 will be returned if you are tryin
g to unlock | | * the main loop is unlocked again. @c -1 will be returned if you are tryin
g to unlock | |
| * when there wasn't enough call to ecore_thread_main_loop_begin(). | | * when there wasn't enough call to ecore_thread_main_loop_begin(). | |
| * | | * | |
|
| * After a call to ecore_thread_main_loop_begin(), you need to absolutly | | * After a call to ecore_thread_main_loop_begin(), you need to absolutely | |
| * call ecore_thread_main_loop_end(), or you application will stay frozen. | | * call ecore_thread_main_loop_end(), or you application will stay frozen. | |
| */ | | */ | |
|
| EAPI int | | EAPI int ecore_thread_main_loop_end(void); | |
| ecore_thread_main_loop_end(void); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Event_Group Ecore Event functions | | * @defgroup Ecore_Event_Group Ecore Event functions | |
| * | | * | |
|
| * Ecore events are used to wake up the Ecore main loop to warn | | * Ecore events provide two main features that are of use to those using ec | |
| * about state changes, tasks completed, data available for reading | | ore: | |
| * or writing, etc. They are the base of the event oriented | | * creating events and being notified of events. Those two will usually be | |
| * programming. | | used | |
| * | | * in different contexts, creating events is mainly done by libraries wrapp | |
| * The idea is to write many functions (callbacks) that will be | | ing | |
| * registered to specific events, and called when these events | | * some system functionality while being notified of events is mainly a | |
| * happen. This way, when the system state changes (a mouse click is | | * necessity of applications. | |
| * detected, a key is pressed, or the content of a file changes, for | | * | |
| * example), the respective callbacks will be called with some | | * For a program to be notified of events it's interested in it needs to ha | |
| * information about that event. Usually the function/callback will | | ve a | |
| * have a data pointer to the event info (the position in the screen | | * function to process the event and to register that function as the callb | |
| * where the mouse was clicked, the name of the key that was | | ack | |
| * pressed, or the name of the file that has changed). | | * to the event, that's all: | |
| * | | * @code | |
| * The basic usage, when one needs to watch for an existing event, | | * ecore_event_handler_add(EVENT_TYPE, _my_event_handler, some_data); | |
| * is to register a callback to it using ecore_event_add(). Of | | * ... | |
| * course it's necessary to know beforehand what are the types of | | * static Eina_Bool | |
| * events that the system/library will emmit. This should be | | * _my_event_handler(void *data, int type, void *event) | |
| * available with the documentation from that system/library. | | * { | |
| * | | * //data is some_data | |
| * When writing a library or group of functions that need to inform | | * //event is provided by whoever created the event | |
| * about something, and you already are running on top of a main | | * //Do really cool stuff with event | |
| * loop, it is usually a good approach to use events. This way you | | * } | |
| * allow others to register as many callbacks as necessary to this | | * @endcode | |
| * event, and don't have to care about who is registering to it. The | | * | |
| * functions ecore_event_type_new() and ecore_event_add() are | | * One very important thing to note here is the @c EVENT_TYPE, to register | |
| * available for this purpose. | | a | |
| | | * handler for an event you must know its type before hand. Ecore provides | |
| | | * the following events which are emitted in response to POSIX | |
| | | * signals(https://en.wikipedia.org/wiki/Signal_%28computing%29): | |
| | | * @li @b ECORE_EVENT_SIGNAL_USER | |
| | | * @li @b ECORE_EVENT_SIGNAL_HUP | |
| | | * @li @b ECORE_EVENT_SIGNAL_POWER | |
| | | * @li @b ECORE_EVENT_SIGNAL_EXIT | |
| | | * | |
| | | * @warning Don't override these using the @c signal or @c sigaction calls. | |
| | | * These, however, aren't the only signals one can handle. Many | |
| | | * libraries(including ecore modules) have their own signals that can be | |
| | | * listened for and handled, to do that one only needs to know the type of | |
| | | the | |
| | | * event. This information can be found on the documentation of the library | |
| | | * emitting the signal, so, for example, for events related to windowing on | |
| | | e | |
| | | * would look in @ref Ecore_Evas_Group. | |
| | | * | |
| | | * Examples of libraries that integrate into ecore's main loop by providing | |
| | | * events are @ref Ecore_Con_Group, @ref Ecore_Evas_Group and @ref | |
| | | * Ecore_Exe_Group, amongst others. This usage can be divided into two part | |
| | | s, | |
| | | * setup and adding events. The setup is very simple, all that needs doing | |
| | | is | |
| | | * getting a type id for the event: | |
| | | * @code | |
| | | * int MY_EV_TYPE = ecore_event_type_new(); | |
| | | * @endcode | |
| | | * @note This variable should be declared in the header since it'll be need | |
| | | ed by | |
| | | * anyone wishing to register a handler to your event. | |
| * | | * | |
|
| * Example that deals with events: | | * The complexity of adding of an event to the queue depends on whether tha | |
| | | t | |
| | | * event sends uses @c event, if it doesn't it a one-liner: | |
| | | * @code | |
| | | * ecore_event_add(MY_EV_TYPE, NULL, NULL, NULL); | |
| | | * @endcode | |
| | | * The usage when an @c event is needed is not that much more complex and c | |
| | | an be | |
| | | * seen in @ref ecore_event_add. | |
| * | | * | |
|
| * @li @ref ecore_event_example_c | | * Examples that deals with events: | |
| | | * @li @ref ecore_event_example_01_c | |
| | | * @li @ref ecore_event_example_02_c | |
| * | | * | |
| * @ingroup Ecore_Main_Loop_Group | | * @ingroup Ecore_Main_Loop_Group | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| #define ECORE_EVENT_NONE 0 | | #define ECORE_EVENT_NONE 0 | |
| #define ECORE_EVENT_SIGNAL_USER 1 /**< User signal event */ | | #define ECORE_EVENT_SIGNAL_USER 1 /**< User signal event */ | |
| #define ECORE_EVENT_SIGNAL_HUP 2 /**< Hup signal event */ | | #define ECORE_EVENT_SIGNAL_HUP 2 /**< Hup signal event */ | |
| #define ECORE_EVENT_SIGNAL_EXIT 3 /**< Exit signal event */ | | #define ECORE_EVENT_SIGNAL_EXIT 3 /**< Exit signal event */ | |
| | | | |
| skipping to change at line 588 | | skipping to change at line 634 | |
| * A callback used by the main loop to handle events of a specified | | * A callback used by the main loop to handle events of a specified | |
| * type. | | * type. | |
| */ | | */ | |
| typedef Eina_Bool (*Ecore_Event_Handler_Cb)(void *data, int type, void *eve
nt); | | typedef Eina_Bool (*Ecore_Event_Handler_Cb)(void *data, int type, void *eve
nt); | |
| | | | |
| struct _Ecore_Event_Signal_User /** User signal event */ | | struct _Ecore_Event_Signal_User /** User signal event */ | |
| { | | { | |
| int number; /**< The signal number. Either 1 or 2 */ | | int number; /**< The signal number. Either 1 or 2 */ | |
| void *ext_data; /**< Extension data - not used */ | | void *ext_data; /**< Extension data - not used */ | |
| | | | |
|
| #if !defined (_WIN32) && !defined (__lv2ppu__) | | #if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNA
L) | |
| siginfo_t data; /**< Signal info */ | | siginfo_t data; /**< Signal info */ | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct _Ecore_Event_Signal_Hup /** Hup signal event */ | | struct _Ecore_Event_Signal_Hup /** Hup signal event */ | |
| { | | { | |
| void *ext_data; /**< Extension data - not used */ | | void *ext_data; /**< Extension data - not used */ | |
| | | | |
|
| #if !defined (_WIN32) && !defined (__lv2ppu__) | | #if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNA
L) | |
| siginfo_t data; /**< Signal info */ | | siginfo_t data; /**< Signal info */ | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct _Ecore_Event_Signal_Exit /** Exit request event */ | | struct _Ecore_Event_Signal_Exit /** Exit request event */ | |
| { | | { | |
| Eina_Bool interrupt : 1; /**< Set if the exit request was an interrupt
signal*/ | | Eina_Bool interrupt : 1; /**< Set if the exit request was an interrupt
signal*/ | |
| Eina_Bool quit : 1; /**< set if the exit request was a quit signal
*/ | | Eina_Bool quit : 1; /**< set if the exit request was a quit signal
*/ | |
|
| Eina_Bool terminate : 1; /**< Set if the exit request was a terminate si
ngal */ | | Eina_Bool terminate : 1; /**< Set if the exit request was a terminate si
gnal */ | |
| void *ext_data; /**< Extension data - not used */ | | void *ext_data; /**< Extension data - not used */ | |
| | | | |
|
| #if !defined (_WIN32) && !defined (__lv2ppu__) | | #if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNA
L) | |
| siginfo_t data; /**< Signal info */ | | siginfo_t data; /**< Signal info */ | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct _Ecore_Event_Signal_Power /** Power event */ | | struct _Ecore_Event_Signal_Power /** Power event */ | |
| { | | { | |
| void *ext_data; /**< Extension data - not used */ | | void *ext_data; /**< Extension data - not used */ | |
| | | | |
|
| #if !defined (_WIN32) && !defined (__lv2ppu__) | | #if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNA
L) | |
| siginfo_t data; /**< Signal info */ | | siginfo_t data; /**< Signal info */ | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct _Ecore_Event_Signal_Realtime /** Realtime event */ | | struct _Ecore_Event_Signal_Realtime /** Realtime event */ | |
| { | | { | |
| int num; /**< The realtime signal's number */ | | int num; /**< The realtime signal's number */ | |
| | | | |
|
| #if !defined (_WIN32) && !defined (__lv2ppu__) | | #if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNA
L) | |
| siginfo_t data; /**< Signal info */ | | siginfo_t data; /**< Signal info */ | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
|
| EAPI Ecore_Event_Handler * | | /** | |
| ecore_event_handler_add(int type, | | * @brief Add an event handler. | |
| Ecore_Event_Handler_Cb func, | | * @param type The type of the event this handler will get called for | |
| const void *data); | | * @param func The function to call when the event is found in the queue | |
| EAPI void * | | * @param data A data pointer to pass to the called function @p func | |
| ecore_event_handler_del(Ecore_Event_Handler *event_handler); | | * @return A new Event handler, or @c NULL on failure. | |
| EAPI Ecore_Event * | | * | |
| ecore_event_add(int type, | | * Add an event handler to the list of handlers. This will, on success, ret | |
| void *ev, | | urn | |
| Ecore_End_Cb func_free, | | * a handle to the event handler object that was created, that can be used | |
| void *data); | | * later to remove the handler using ecore_event_handler_del(). The @p type | |
| EAPI void * | | * parameter is the integer of the event type that will trigger this callba | |
| ecore_event_del(Ecore_Event *event); | | ck | |
| EAPI void * | | * to be called. The callback @p func is called when this event is processe | |
| ecore_event_handler_data_get(Ecore_Event_Handler *eh); | | d | |
| EAPI void * | | * and will be passed the event type, a pointer to the private event | |
| ecore_event_handler_data_set(Ecore_Event_Handler *eh, | | * structure that is specific to that event type, and a data pointer that i | |
| const void *data); | | s | |
| EAPI int | | * provided in this call as the @p data parameter. | |
| ecore_event_type_new(void); | | * | |
| EAPI Ecore_Event_Filter * | | * When the callback @p func is called, it must return 1 or 0. If it return | |
| ecore_event_filter_add(Ecore_Data_Cb func_start, | | s | |
| Ecore_Filter_Cb func_filter, | | * 1 (or ECORE_CALLBACK_PASS_ON), It will keep being called as per normal, | |
| Ecore_End_Cb func_end, | | for | |
| const void *data); | | * each handler set up for that event type. If it returns 0 (or | |
| EAPI void * | | * ECORE_CALLBACK_DONE), it will cease processing handlers for that particu | |
| ecore_event_filter_del(Ecore_Event_Filter *ef); | | lar | |
| EAPI int | | * event, so all handler set to handle that event type that have not alread | |
| ecore_event_current_type_get(void); | | y | |
| EAPI void * | | * been called, will not be. | |
| ecore_event_current_event_get(void); | | */ | |
| | | EAPI Ecore_Event_Handler *ecore_event_handler_add(int type, Ecore_Event_Han | |
| | | dler_Cb func, const void *data); | |
| | | /** | |
| | | * @brief Delete an event handler. | |
| | | * @param event_handler Event handler handle to delete | |
| | | * @return Data passed to handler | |
| | | * | |
| | | * Delete a specified event handler from the handler list. On success this | |
| | | will | |
| | | * delete the event handler and return the pointer passed as @p data when t | |
| | | he | |
| | | * handler was added by ecore_event_handler_add(). On failure @c NULL will | |
| | | be | |
| | | * returned. Once a handler is deleted it will no longer be called. | |
| | | */ | |
| | | EAPI void *ecore_event_handler_del(Ecore_Event_Handler *event_handler); | |
| | | /** | |
| | | * @brief Add an event to the event queue. | |
| | | * @param type The event type to add to the end of the event queue | |
| | | * @param ev The data structure passed as @c event to event handlers | |
| | | * @param func_free The function to be called to free @a ev | |
| | | * @param data The data pointer to be passed to the free function | |
| | | * @return A Handle for that event on success, otherwise NULL | |
| | | * | |
| | | * If it succeeds, an event of type @a type will be added to the queue for | |
| | | * processing by event handlers added by ecore_event_handler_add(). The @a | |
| | | ev | |
| | | * parameter will be passed as the @c event parameter of the handler. When | |
| | | the | |
| | | * event is no longer needed, @a func_free will be called and passed @a ev | |
| | | for | |
| | | * cleaning up. If @p func_free is NULL, free() will be called with the pri | |
| | | vate | |
| | | * structure pointer. | |
| | | */ | |
| | | EAPI Ecore_Event *ecore_event_add(int type, void *ev, Ecore_End_Cb func_fre | |
| | | e, void *data); | |
| | | /** | |
| | | * @brief Delete an event from the queue. | |
| | | * @param event The event handle to delete | |
| | | * @return The data pointer originally set for the event free function | |
| | | * | |
| | | * This deletes the event @p event from the event queue, and returns the | |
| | | * @p data parameter originally set when adding it with ecore_event_add(). | |
| | | This | |
| | | * does not immediately call the free function, and it may be called later | |
| | | on | |
| | | * cleanup, and so if the free function depends on the data pointer to work | |
| | | , | |
| | | * you should defer cleaning of this till the free function is called later | |
| | | . | |
| | | */ | |
| | | EAPI void *ecore_event_del(Ecore_Event *event); | |
| | | /** | |
| | | * @brief Get the data associated with an #Ecore_Event_Handler | |
| | | * @param eh The event handler | |
| | | * @return The data | |
| | | * | |
| | | * This function returns the data previously associated with @p eh by | |
| | | * ecore_event_handler_add(). | |
| | | */ | |
| | | EAPI void *ecore_event_handler_data_get(Ecore_Event_Handler *eh); | |
| | | /** | |
| | | * @brief Set the data associated with an #Ecore_Event_Handler | |
| | | * @param eh The event handler | |
| | | * @param data The data to associate | |
| | | * @return The previous data | |
| | | * | |
| | | * This function sets @p data to @p eh and returns the old data pointer | |
| | | * which was previously associated with @p eh by ecore_event_handler_add(). | |
| | | */ | |
| | | EAPI void *ecore_event_handler_data_set(Ecore_Event_Handler *eh, const void | |
| | | *data); | |
| | | /** | |
| | | * @brief Allocate a new event type id sensibly and return the new id. | |
| | | * @return A new event type id. | |
| | | * | |
| | | * This function allocates a new event type id and returns it. Once an even | |
| | | t | |
| | | * type has been allocated it can never be de-allocated during the life of | |
| | | * the program. There is no guarantee of the contents of this event ID, or | |
| | | how | |
| | | * it is calculated, except that the ID will be unique to the current insta | |
| | | nce | |
| | | * of the process. | |
| | | */ | |
| | | EAPI int ecore_event_type_new(void); | |
| | | /** | |
| | | * @brief Add a filter the current event queue. | |
| | | * | |
| | | * @param func_start Function to call just before filtering and return data | |
| | | * @param func_filter Function to call on each event | |
| | | * @param func_end Function to call after the queue has been filtered | |
| | | * @param data Data to pass to the filter functions | |
| | | * @return A filter handle on success, @c NULL otherwise. | |
| | | * | |
| | | * Adds a callback to filter events from the event queue. Filters are calle | |
| | | d on | |
| | | * the queue just before Event handler processing to try and remove redunda | |
| | | nt | |
| | | * events. Just as processing is about to start @a func_start is called and | |
| | | * passed the @a data pointer, the return value of this functions is passed | |
| | | to | |
| | | * @a func_filter as loop_data. @a func_filter is also passed @a data and t | |
| | | he | |
| | | * event type and event structure. If this @a func_filter returns | |
| | | * @c EINA_FALSE, the event is removed from the queue, if it returns | |
| | | * @c EINA_TRUE, the event is kept. When processing is finished @p func_end | |
| | | is | |
| | | * called and is passed the loop_data(returned by @c func_start) and @p dat | |
| | | a | |
| | | * pointer to clean up. | |
| | | */ | |
| | | EAPI Ecore_Event_Filter *ecore_event_filter_add(Ecore_Data_Cb func_start, E | |
| | | core_Filter_Cb func_filter, Ecore_End_Cb func_end, const void *data); | |
| | | /** | |
| | | * @brief Delete an event filter. | |
| | | * @param ef The event filter handle | |
| | | * @return The data set for the filter on success, @c NULL otherwise. | |
| | | * | |
| | | * Delete a filter that has been added by its @p ef handle. | |
| | | */ | |
| | | EAPI void *ecore_event_filter_del(Ecore_Event_Filter *ef); | |
| | | /** | |
| | | * @brief Return the current event type being handled. | |
| | | * @return The current event type being handled if inside a handler callbac | |
| | | k, | |
| | | * ECORE_EVENT_NONE otherwise | |
| | | * | |
| | | * If the program is currently inside an Ecore event handler callback this | |
| | | * will return the type of the current event being processed. | |
| | | * | |
| | | * This is useful when certain Ecore modules such as Ecore_Evas "swallow" | |
| | | * events and not all the original information is passed on. In special cas | |
| | | es | |
| | | * this extra information may be useful or needed and using this call can l | |
| | | et | |
| | | * the program know if the event type being handled is one it wants to get | |
| | | more | |
| | | * information about. | |
| | | */ | |
| | | EAPI int ecore_event_current_type_get(void); | |
| | | /** | |
| | | * @brief Return the current event type pointer handled. | |
| | | * @return The current event pointer being handled if inside a handler call | |
| | | back, | |
| | | * @c NULL otherwise. | |
| | | * | |
| | | * If the program is currently inside an Ecore event handler callback this | |
| | | * will return the pointer of the current event being processed. | |
| | | * | |
| | | * This is useful when certain Ecore modules such as Ecore_Evas "swallow" | |
| | | * events and not all the original information is passed on. In special cas | |
| | | es | |
| | | * this extra information may be useful or needed and using this call can l | |
| | | et | |
| | | * the program access the event data if the type of the event is handled by | |
| | | * the program. | |
| | | */ | |
| | | EAPI void *ecore_event_current_event_get(void); | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Exe_Group Process Spawning Functions | | * @defgroup Ecore_Exe_Group Process Spawning Functions | |
| * | | * | |
| * Functions that deal with and send signals to spawned processes. | | * Functions that deal with and send signals to spawned processes. | |
| * | | * | |
| * @ingroup Ecore_Main_Loop_Group | | * @ingroup Ecore_Main_Loop_Group | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
|
| #define ECORE_EXE_PRIORITY_INHERIT 9999 | | /** Inherit priority from parent process */ | |
| | | #define ECORE_EXE_PRIORITY_INHERIT 9999 | |
| | | | |
| EAPI extern int ECORE_EXE_EVENT_ADD; /**< A child process has been adde
d */ | | EAPI extern int ECORE_EXE_EVENT_ADD; /**< A child process has been adde
d */ | |
| EAPI extern int ECORE_EXE_EVENT_DEL; /**< A child process has been dele
ted (it exited, naming consistent with the rest of ecore). */ | | EAPI extern int ECORE_EXE_EVENT_DEL; /**< A child process has been dele
ted (it exited, naming consistent with the rest of ecore). */ | |
| EAPI extern int ECORE_EXE_EVENT_DATA; /**< Data from a child process. */ | | EAPI extern int ECORE_EXE_EVENT_DATA; /**< Data from a child process. */ | |
| EAPI extern int ECORE_EXE_EVENT_ERROR; /**< Errors from a child process.
*/ | | EAPI extern int ECORE_EXE_EVENT_ERROR; /**< Errors from a child process.
*/ | |
| | | | |
|
| | | /** | |
| | | * @enum _Ecore_Exe_Flags | |
| | | * Flags for executing a child with its stdin and/or stdout piped back. | |
| | | */ | |
| enum _Ecore_Exe_Flags /* flags for executing a child with its stdin and/
or stdout piped back */ | | enum _Ecore_Exe_Flags /* flags for executing a child with its stdin and/
or stdout piped back */ | |
| { | | { | |
| ECORE_EXE_NONE = 0, /**< No exe flags at all */ | | ECORE_EXE_NONE = 0, /**< No exe flags at all */ | |
| ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */ | | ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */ | |
| ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */ | | ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */ | |
| ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */ | | ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */ | |
| ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a n
ewline and split 1 line per Ecore_Exe_Event_Data_Line */ | | ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a n
ewline and split 1 line per Ecore_Exe_Event_Data_Line */ | |
| ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until
a newline and split 1 line per Ecore_Exe_Event_Data_Line */ | | ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until
a newline and split 1 line per Ecore_Exe_Event_Data_Line */ | |
| ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatica
lly */ | | ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatica
lly */ | |
| ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */ | | ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */ | |
| ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */ | | ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */ | |
| ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to have the execute
d process be its own session leader */ | | ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to have the execute
d process be its own session leader */ | |
| ECORE_EXE_TERM_WITH_PARENT = 512 /**< Makes child receive SIGTERM when p
arent dies. */ | | ECORE_EXE_TERM_WITH_PARENT = 512 /**< Makes child receive SIGTERM when p
arent dies. */ | |
| }; | | }; | |
| typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags; | | typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags; | |
| | | | |
|
| | | /** | |
| | | * @enum _Ecore_Exe_Win32_Priority | |
| | | * Defines the priority of the proccess. | |
| | | */ | |
| enum _Ecore_Exe_Win32_Priority | | enum _Ecore_Exe_Win32_Priority | |
| { | | { | |
|
| ECORE_EXE_WIN32_PRIORITY_IDLE, /**< Idle priority, for monitoring th | | ECORE_EXE_WIN32_PRIORITY_IDLE, /**< Idle priority, for monitoring the sy | |
| e system */ | | stem */ | |
| ECORE_EXE_WIN32_PRIORITY_BELOW_NORMAL, /**< Below default priority * | | ECORE_EXE_WIN32_PRIORITY_BELOW_NORMAL, /**< Below default priority */ | |
| / | | ECORE_EXE_WIN32_PRIORITY_NORMAL, /**< Default priority */ | |
| ECORE_EXE_WIN32_PRIORITY_NORMAL, /**< Default priority */ | | ECORE_EXE_WIN32_PRIORITY_ABOVE_NORMAL, /**< Above default priority */ | |
| ECORE_EXE_WIN32_PRIORITY_ABOVE_NORMAL, /**< Above default priority * | | ECORE_EXE_WIN32_PRIORITY_HIGH, /**< High priority, use with care as othe | |
| / | | r threads in the system will not get processor time */ | |
| ECORE_EXE_WIN32_PRIORITY_HIGH, /**< High priority, use with care as | | | |
| other threads in the system will not get processor time */ | | | |
| ECORE_EXE_WIN32_PRIORITY_REALTIME /**< Realtime priority, should be
almost never used as it can interrupt system threads that manage mouse inpu
t, keyboard input, and background disk flushing */ | | ECORE_EXE_WIN32_PRIORITY_REALTIME /**< Realtime priority, should be
almost never used as it can interrupt system threads that manage mouse inpu
t, keyboard input, and background disk flushing */ | |
| }; | | }; | |
| typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority; | | typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority; | |
| | | | |
| typedef struct _Ecore_Exe Ecore_Exe; /**< A handle for spawned
processes */ | | typedef struct _Ecore_Exe Ecore_Exe; /**< A handle for spawned
processes */ | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Exe_Cb Ecore_Exe_Cb | | * @typedef Ecore_Exe_Cb Ecore_Exe_Cb | |
| * A callback to run with the associated @ref Ecore_Exe, usually | | * A callback to run with the associated @ref Ecore_Exe, usually | |
| * for cleanup purposes. | | * for cleanup purposes. | |
| | | | |
| skipping to change at line 736 | | skipping to change at line 912 | |
| struct _Ecore_Exe_Event_Add /** Process add event */ | | struct _Ecore_Exe_Event_Add /** Process add event */ | |
| { | | { | |
| Ecore_Exe *exe; /**< The handle to the added process */ | | Ecore_Exe *exe; /**< The handle to the added process */ | |
| void *ext_data; /**< Extension data - not used */ | | void *ext_data; /**< Extension data - not used */ | |
| }; | | }; | |
| | | | |
| struct _Ecore_Exe_Event_Del /** Process exit event */ | | struct _Ecore_Exe_Event_Del /** Process exit event */ | |
| { | | { | |
| pid_t pid; /**< The process ID of the process that exited */ | | pid_t pid; /**< The process ID of the process that exited */ | |
| int exit_code; /**< The exit code of the process */ | | int exit_code; /**< The exit code of the process */ | |
|
| Ecore_Exe *exe; /**< The handle to the exited process, or NULL if not fo
und */ | | Ecore_Exe *exe; /**< The handle to the exited process, or @c NULL if not
found */ | |
| int exit_signal; /** < The signal that caused the process to exit
*/ | | int exit_signal; /** < The signal that caused the process to exit
*/ | |
| Eina_Bool exited : 1; /** < set to 1 if the process exited of its ow
n accord */ | | Eina_Bool exited : 1; /** < set to 1 if the process exited of its ow
n accord */ | |
| Eina_Bool signalled : 1; /** < set to 1 id the process exited due to un
caught signal */ | | Eina_Bool signalled : 1; /** < set to 1 id the process exited due to un
caught signal */ | |
| void *ext_data; /**< Extension data - not used */ | | void *ext_data; /**< Extension data - not used */ | |
|
| #if !defined (_WIN32) && !defined (__lv2ppu__) | | #if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNA
L) | |
| siginfo_t data; /**< Signal info */ | | siginfo_t data; /**< Signal info */ | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct _Ecore_Exe_Event_Data_Line /**< Lines from a child process */ | | struct _Ecore_Exe_Event_Data_Line /**< Lines from a child process */ | |
| { | | { | |
| char *line; | | char *line; | |
| int size; | | int size; | |
| }; | | }; | |
| | | | |
| struct _Ecore_Exe_Event_Data /** Data from a child process event */ | | struct _Ecore_Exe_Event_Data /** Data from a child process event */ | |
| { | | { | |
| Ecore_Exe *exe; /**< The handle to the process */ | | Ecore_Exe *exe; /**< The handle to the process */ | |
| void *data; /**< the raw binary data from the child
process that was received */ | | void *data; /**< the raw binary data from the child
process that was received */ | |
| int size; /**< the size of this data in bytes */ | | int size; /**< the size of this data in bytes */ | |
|
| Ecore_Exe_Event_Data_Line *lines; /**< an array of line data if line buf
fered, the last one has it's line member set to NULL */ | | Ecore_Exe_Event_Data_Line *lines; /**< an array of line data if line buf
fered, the last one has it's line member set to @c NULL */ | |
| }; | | }; | |
| | | | |
|
| EAPI void | | EAPI void ecore_exe_run_priority_set(int pri); | |
| ecore_exe_run_priority_set(int pri); | | EAPI int ecore_exe_run_priority_get(void); | |
| EAPI int | | EAPI Ecore_Exe *ecore_exe_run(const char *exe_cmd, const void *data); | |
| ecore_exe_run_priority_get(void); | | EAPI Ecore_Exe *ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags fla | |
| EAPI Ecore_Exe * | | gs, const void *data); | |
| ecore_exe_run(const char *exe_cmd, | | EAPI void ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func | |
| const void *data); | | ); | |
| EAPI Ecore_Exe * | | EAPI Eina_Bool ecore_exe_send(Ecore_Exe *exe, const void *data, int size); | |
| ecore_exe_pipe_run(const char *exe_cmd, | | EAPI void ecore_exe_close_stdin(Ecore_Exe *exe); | |
| Ecore_Exe_Flags flags, | | EAPI void ecore_exe_auto_limits_set(Ecore_Exe *exe, int start_bytes, int en | |
| const void *data); | | d_bytes, int start_lines, int end_lines); | |
| EAPI void | | EAPI Ecore_Exe_Event_Data *ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_E | |
| ecore_exe_callback_pre_free_set(Ecore_Exe *exe, | | xe_Flags flags); | |
| Ecore_Exe_Cb func); | | EAPI void ecore_exe_event_data_free(Ecore_Exe_Event_Data *data); | |
| EAPI Eina_Bool | | EAPI void *ecore_exe_free(Ecore_Exe *exe); | |
| ecore_exe_send(Ecore_Exe *exe, | | EAPI pid_t ecore_exe_pid_get(const Ecore_Exe *exe); | |
| const void *data, | | EAPI void ecore_exe_tag_set(Ecore_Exe *exe, const char *tag); | |
| int size); | | EAPI const char *ecore_exe_tag_get(const Ecore_Exe *exe); | |
| EAPI void | | EAPI const char *ecore_exe_cmd_get(const Ecore_Exe *exe); | |
| ecore_exe_close_stdin(Ecore_Exe *exe); | | EAPI void *ecore_exe_data_get(const Ecore_Exe *exe); | |
| EAPI void | | EAPI void *ecore_exe_data_set(Ecore_Exe *exe, void *data); | |
| ecore_exe_auto_limits_set(Ecore_Exe *exe, | | EAPI Ecore_Exe_Flags ecore_exe_flags_get(const Ecore_Exe *exe); | |
| int start_bytes, | | EAPI void ecore_exe_pause(Ecore_Exe *exe); | |
| int end_bytes, | | EAPI void ecore_exe_continue(Ecore_Exe *exe); | |
| int start_lines, | | EAPI void ecore_exe_interrupt(Ecore_Exe *exe); | |
| int end_lines); | | EAPI void ecore_exe_quit(Ecore_Exe *exe); | |
| EAPI Ecore_Exe_Event_Data * | | EAPI void ecore_exe_terminate(Ecore_Exe *exe); | |
| ecore_exe_event_data_get(Ecore_Exe *exe, | | EAPI void ecore_exe_kill(Ecore_Exe *exe); | |
| Ecore_Exe_Flags flags); | | EAPI void ecore_exe_signal(Ecore_Exe *exe, int num); | |
| EAPI void | | EAPI void ecore_exe_hup(Ecore_Exe *exe); | |
| ecore_exe_event_data_free(Ecore_Exe_Event_Data *data); | | | |
| EAPI void * | | | |
| ecore_exe_free(Ecore_Exe *exe); | | | |
| EAPI pid_t | | | |
| ecore_exe_pid_get(const Ecore_Exe *exe); | | | |
| EAPI void | | | |
| ecore_exe_tag_set(Ecore_Exe *exe, | | | |
| const char *tag); | | | |
| EAPI const char * | | | |
| ecore_exe_tag_get(const Ecore_Exe *exe); | | | |
| EAPI const char * | | | |
| ecore_exe_cmd_get(const Ecore_Exe *exe); | | | |
| EAPI void * | | | |
| ecore_exe_data_get(const Ecore_Exe *exe); | | | |
| EAPI void * | | | |
| ecore_exe_data_set(Ecore_Exe *exe, | | | |
| void *data); | | | |
| EAPI Ecore_Exe_Flags | | | |
| ecore_exe_flags_get(const Ecore_Exe *exe); | | | |
| EAPI void | | | |
| ecore_exe_pause(Ecore_Exe *exe); | | | |
| EAPI void | | | |
| ecore_exe_continue(Ecore_Exe *exe); | | | |
| EAPI void | | | |
| ecore_exe_interrupt(Ecore_Exe *exe); | | | |
| EAPI void | | | |
| ecore_exe_quit(Ecore_Exe *exe); | | | |
| EAPI void | | | |
| ecore_exe_terminate(Ecore_Exe *exe); | | | |
| EAPI void | | | |
| ecore_exe_kill(Ecore_Exe *exe); | | | |
| EAPI void | | | |
| ecore_exe_signal(Ecore_Exe *exe, | | | |
| int num); | | | |
| EAPI void | | | |
| ecore_exe_hup(Ecore_Exe *exe); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
|
| * @defgroup Ecore_FD_Handler_Group File Event Handling Functions | | * @defgroup Ecore_FD_Handler_Group File Descriptor Handling Functions | |
| | | * | |
| | | * @brief Functions that deal with file descriptor handlers. | |
| * | | * | |
|
| * Functions that deal with file descriptor handlers. | | * File descriptor handlers facilitate reading, writing and checking for er | |
| | | rors | |
| | | * without blocking the program or doing expensive pooling. This can be use | |
| | | d to | |
| | | * monitor a socket, pipe, or other stream for which an FD can be had. | |
| * | | * | |
|
| * The @ref Ecore_Fd_Handler can be used to watch a file descriptor | | * @warning File descriptor handlers can't be used to monitor for file crea | |
| * for data available for reading, for the availability to write | | tion, | |
| * without blocking, and for errors on the file descriptor. | | * modification or deletion, see @ref Ecore_File_Group for this. | |
| * | | * | |
| * ecore_main_fd_handler_add() is used to setup a handler for a | | * One common FD to be monitored is the standard input(stdin), monitoring i | |
| * given file descriptor. This file descriptor can be the standard | | t for | |
| * input, a network socket, a stream received through some driver | | * reading requires a single call: | |
| * of a hardware decoder, etc. Thus it can contain errors, like a | | * @code | |
| * disconnection, a broken pipe, and so, and that's why it's | | * static Eina_Bool | |
| * possible to check for these errors with the @ref ECORE_FD_ERROR | | * _my_cb_func(void *data, Ecore_Fd_Handler *handler) | |
| * flag. | | * { | |
| * | | * char c; | |
| * An @ref Ecore_Fd_Handler can be used to watch on a file | | * scanf("%c", &c); //Guaranteed not to block | |
| * descriptor without blocking, still being able to receive events, | | * ... do stuff with c ... | |
| * expire timers, and other watch for other things that happen in | | * } | |
| * the Ecore main loop. | | * ecore_main_fd_handler_add(STDIN_FILENO, ECORE_FD_READ, _my_cb_func, NULL | |
| | | , NULL, NULL); | |
| | | * @endcode | |
| | | * | |
| | | * When using a socket, pipe or other stream it's important to remember tha | |
| | | t | |
| | | * errors may occur and as such to monitor not only for reading/writing but | |
| | | also | |
| | | * for errors using the @ref ECORE_FD_ERROR flag. | |
| * | | * | |
| * Example of use of a file descriptor handler: | | * Example of use of a file descriptor handler: | |
| * @li @ref ecore_fd_handler_example_c | | * @li @ref ecore_fd_handler_example_c | |
| * | | * | |
| * @ingroup Ecore_Main_Loop_Group | | * @ingroup Ecore_Main_Loop_Group | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| typedef struct _Ecore_Fd_Handler Ecore_Fd_Handler; /**< A handle for Fd han
dlers */ | | typedef struct _Ecore_Fd_Handler Ecore_Fd_Handler; /**< A handle for Fd han
dlers */ | |
| | | | |
|
| | | /** | |
| | | * @enum _Ecore_Fd_Handler_Flags | |
| | | * What to monitor the file descriptor for: reading, writing or error. | |
| | | */ | |
| enum _Ecore_Fd_Handler_Flags | | enum _Ecore_Fd_Handler_Flags | |
| { | | { | |
| ECORE_FD_READ = 1, /**< Fd Read mask */ | | ECORE_FD_READ = 1, /**< Fd Read mask */ | |
| ECORE_FD_WRITE = 2, /**< Fd Write mask */ | | ECORE_FD_WRITE = 2, /**< Fd Write mask */ | |
| ECORE_FD_ERROR = 4 /**< Fd Error mask */ | | ECORE_FD_ERROR = 4 /**< Fd Error mask */ | |
| }; | | }; | |
| typedef enum _Ecore_Fd_Handler_Flags Ecore_Fd_Handler_Flags; | | typedef enum _Ecore_Fd_Handler_Flags Ecore_Fd_Handler_Flags; | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Fd_Cb Ecore_Fd_Cb | | * @typedef Ecore_Fd_Cb Ecore_Fd_Cb | |
| | | | |
| skipping to change at line 889 | | skipping to change at line 1036 | |
| * A callback used by an @ref Ecore_Fd_Handler. | | * A callback used by an @ref Ecore_Fd_Handler. | |
| */ | | */ | |
| typedef void (*Ecore_Fd_Prep_Cb)(void *data, Ecore_Fd_Handler *fd_handler); | | typedef void (*Ecore_Fd_Prep_Cb)(void *data, Ecore_Fd_Handler *fd_handler); | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Win32_Handle_Cb Ecore_Win32_Handle_Cb | | * @typedef Ecore_Win32_Handle_Cb Ecore_Win32_Handle_Cb | |
| * A callback used by an @ref Ecore_Win32_Handler. | | * A callback used by an @ref Ecore_Win32_Handler. | |
| */ | | */ | |
| typedef Eina_Bool (*Ecore_Win32_Handle_Cb)(void *data, Ecore_Win32_Handler
*wh); | | typedef Eina_Bool (*Ecore_Win32_Handle_Cb)(void *data, Ecore_Win32_Handler
*wh); | |
| | | | |
|
| EAPI Ecore_Fd_Handler * | | /** | |
| ecore_main_fd_handler_add(int fd, | | * @brief Adds a callback for activity on the given file descriptor. | |
| Ecore_Fd_Handler_Flags flags, | | * | |
| Ecore_Fd_Cb func, | | * @param fd The file descriptor to watch. | |
| const void *data, | | * @param flags To monitor it for reading use @c ECORE_FD_READ, for writing | |
| Ecore_Fd_Cb buf_func, | | @c | |
| const void *buf_data); | | * ECORE_FD_WRITE, and for error @c ECORE_FD_ERROR. Values bay |(ored). | |
| EAPI void | | * @param func The callback function. | |
| ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, | | * @param data The data to pass to the callback. | |
| Ecore_Fd_Prep_Cb func, | | * @param buf_func The function to call to check if any data has been buffe | |
| const void *data); | | red | |
| EAPI void * | | * and already read from the fd. May be @c NULL. | |
| ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler); | | * @param buf_data The data to pass to the @p buf_func function. | |
| EAPI int | | * @return A fd handler handle on success, @c NULL otherwise. | |
| ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler); | | * | |
| EAPI Eina_Bool | | * @a func will be called during the execution of @ref Ecore_Main_Loop_Page | |
| ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, | | * when the file descriptor is available for reading, writing, or there has | |
| Ecore_Fd_Handler_Flags flags); | | been | |
| EAPI void | | * an error(depending on the given @a flags). | |
| ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, | | * | |
| Ecore_Fd_Handler_Flags flags); | | * When @a func returns ECORE_CALLBACK_CANCEL, it indicates that the | |
| | | * handler should be marked for deletion (identical to calling @ref | |
| EAPI Ecore_Win32_Handler * | | * ecore_main_fd_handler_del). | |
| ecore_main_win32_handler_add(void *h, | | * | |
| Ecore_Win32_Handle_Cb func, | | * @warning @a buf_func is meant for @b internal use only and should be @b | |
| const void *data); | | * avoided. | |
| EAPI void * | | * | |
| ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler); | | * The return value of @a buf_func has a different meaning, when it returns | |
| | | * ECORE_CALLBACK_CANCEL, it indicates that @a func @b shouldn't be called, | |
| | | and | |
| | | * when it returns ECORE_CALLBACK_RENEW it indicates @a func should be call | |
| | | ed. | |
| | | * The return value of @a buf_func will not cause the FD handler to be dele | |
| | | ted. | |
| | | * | |
| | | * @a buf_func is called during event loop handling to check if data that h | |
| | | as | |
| | | * been read from the file descriptor is in a buffer and is available to re | |
| | | ad. | |
| | | * Some systems, notably xlib, handle their own buffering, and would otherw | |
| | | ise | |
| | | * not work with select(). These systems should use a @a buf_func. This is | |
| | | a | |
| | | * most annoying hack, only ecore_x uses it, so refer to that for an exampl | |
| | | e. | |
| | | */ | |
| | | EAPI Ecore_Fd_Handler *ecore_main_fd_handler_add(int fd, Ecore_Fd_Handler_F | |
| | | lags flags, Ecore_Fd_Cb func, const void *data, Ecore_Fd_Cb buf_func, const | |
| | | void *buf_data); | |
| | | /** | |
| | | * @brief Set the prepare callback with data for a given #Ecore_Fd_Handler | |
| | | * | |
| | | * @param fd_handler The fd handler | |
| | | * @param func The prep function | |
| | | * @param data The data to pass to the prep function | |
| | | * | |
| | | * This function will be called prior to any fd handler's callback function | |
| | | * (even the other fd handlers), before entering the main loop select funct | |
| | | ion. | |
| | | * | |
| | | * @note Once a prepare callback is set for a fd handler, it cannot be chan | |
| | | ged. | |
| | | * You need to delete the fd handler and create a new one, to set another | |
| | | * callback. | |
| | | * @note You probably don't need this function. It is only necessary for ve | |
| | | ry | |
| | | * uncommon cases that need special behavior. | |
| | | */ | |
| | | EAPI void ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_h | |
| | | andler, Ecore_Fd_Prep_Cb func, const void *data); | |
| | | /** | |
| | | * @brief Marks an FD handler for deletion. | |
| | | * @param fd_handler The FD handler. | |
| | | * @return The data pointer set using @ref ecore_main_fd_handler_add, for | |
| | | * @a fd_handler on success, @c NULL otherwise. | |
| | | * This function marks an fd handler to be deleted during an iteration of t | |
| | | he | |
| | | * main loop. It does NOT close the associated fd! | |
| | | * | |
| | | * @warning If the underlying fd is already closed ecore may complain if th | |
| | | e | |
| | | * main loop is using epoll internally, and also in some rare cases this ma | |
| | | y | |
| | | * cause crashes and instability. Remember to delete your fd handlers befor | |
| | | e the | |
| | | * fds they listen to are closed. | |
| | | */ | |
| | | EAPI void *ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler); | |
| | | /** | |
| | | * @brief Retrieves the file descriptor that the given handler is handling. | |
| | | * @param fd_handler The given FD handler. | |
| | | * @return The file descriptor the handler is watching. | |
| | | */ | |
| | | EAPI int ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler); | |
| | | /** | |
| | | * @brief Gets which flags are active on an FD handler. | |
| | | * @param fd_handler The given FD handler. | |
| | | * @param flags The flags, @c ECORE_FD_READ, @c ECORE_FD_WRITE or | |
| | | * @c ECORE_FD_ERROR to query. | |
| | | * @return @c EINA_TRUE if any of the given flags are active, @c EINA_FALSE | |
| | | * otherwise. | |
| | | */ | |
| | | EAPI Eina_Bool ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handle | |
| | | r, Ecore_Fd_Handler_Flags flags); | |
| | | /** | |
| | | * @brief Set what active streams the given FD handler should be monitoring | |
| | | . | |
| | | * @param fd_handler The given FD handler. | |
| | | * @param flags The flags to be watching. | |
| | | */ | |
| | | EAPI void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ec | |
| | | ore_Fd_Handler_Flags flags); | |
| | | | |
| | | EAPI Ecore_Win32_Handler *ecore_main_win32_handler_add(void *h, Ecore_Win32 | |
| | | _Handle_Cb func, const void *data); | |
| | | EAPI void *ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler) | |
| | | ; | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Poller_Group Ecore Poll functions | | * @defgroup Ecore_Poller_Group Ecore Poll functions | |
| * | | * | |
|
| * These functions are for the need to poll information, but provide | | * Ecore poller provides infrastructure for the creation of pollers. Poller | |
| * a shared abstracted API to pool such polling to minimise wakeup | | s | |
| * and ensure all the polling happens in as few spots as possible | | * are, in essence, callbacks that share a single timer per type. Because n | |
| * areound a core poll interval. For now only 1 core poller type is | | ot | |
| * supprted: ECORE_POLLER_CORE | | * all pollers need to be called at the same frequency the user may specify | |
| | | the | |
| | | * frequency in ticks(each expiration of the shared timer is called a tick, | |
| | | in | |
| | | * ecore poller parlance) for each added poller. Ecore pollers should only | |
| | | be | |
| | | * used when the poller doesn't have specific requirements on the exact tim | |
| | | es | |
| | | * to poll. | |
| | | * | |
| | | * This architecture means that the main loop is only woken up once to hand | |
| | | le | |
| | | * all pollers of that type, this will save power as the CPU has more of a | |
| | | * chance to go into a low power state the longer it is asleep for, so this | |
| | | * should be used in situations where power usage is a concern. | |
| | | * | |
| | | * For now only 1 core poller type is supported: ECORE_POLLER_CORE, the def | |
| | | ault | |
| | | * interval for ECORE_POLLER_CORE is 0.125(or 1/8th) second. | |
| | | * | |
| | | * The creation of a poller is extremely simple and only requires one line: | |
| | | * @code | |
| | | * ecore_poller_add(ECORE_POLLER_CORE, 1, my_poller_function, NULL); | |
| | | * @endcode | |
| | | * This sample creates a poller to call @c my_poller_function at every tick | |
| | | with | |
| | | * @c NULL as data. | |
| * | | * | |
|
| * Example of @ref Ecore_Poller: | | * Example: | |
| * @li @ref ecore_poller_example_c | | * @li @ref ecore_poller_example_c | |
| * | | * | |
| * @ingroup Ecore_Main_Loop_Group | | * @ingroup Ecore_Main_Loop_Group | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
|
| | | /** | |
| | | * @enum _Ecore_Poller_Type | |
| | | * Defines the frequency of ticks for the poller. | |
| | | */ | |
| enum _Ecore_Poller_Type /* Poller types */ | | enum _Ecore_Poller_Type /* Poller types */ | |
| { | | { | |
| ECORE_POLLER_CORE = 0 /**< The core poller interval */ | | ECORE_POLLER_CORE = 0 /**< The core poller interval */ | |
| }; | | }; | |
| typedef enum _Ecore_Poller_Type Ecore_Poller_Type; | | typedef enum _Ecore_Poller_Type Ecore_Poller_Type; | |
| | | | |
| typedef struct _Ecore_Poller Ecore_Poller; /**< A handle for pollers */ | | typedef struct _Ecore_Poller Ecore_Poller; /**< A handle for pollers */ | |
| | | | |
|
| EAPI void | | /** | |
| ecore_poller_poll_interval_set(Ecore_Poller_Type type, | | * @brief Sets the time(in seconds) between ticks for the given poller type | |
| double poll_time); | | . | |
| EAPI double | | * @param type The poller type to adjust. | |
| ecore_poller_poll_interval_get(Ecore_Poller_Type type); | | * @param poll_time The time(in seconds) between ticks of the timer. | |
| EAPI Eina_Bool | | * | |
| ecore_poller_poller_interval_set(Ecore_Poller *poller, | | * This will adjust the time between ticks of the given timer type defined | |
| int interval); | | by | |
| EAPI int | | * @p type to the time period defined by @p poll_time. | |
| ecore_poller_poller_interval_get(Ecore_Poller *poller); | | */ | |
| EAPI Ecore_Poller * | | EAPI void ecore_poller_poll_interval_set(Ecore_Poller_Type type, double pol | |
| ecore_poller_add(Ecore_Poller_Type type, | | l_time); | |
| int interval, | | /** | |
| Ecore_Task_Cb func, | | * @brief Gets the time(in seconds) between ticks for the given poller type | |
| const void *data); | | . | |
| | | * @param type The poller type to query. | |
| | | * @return The time in seconds between ticks of the poller timer. | |
| | | * | |
| | | * This will get the time between ticks of the specified poller timer. | |
| | | */ | |
| | | EAPI double ecore_poller_poll_interval_get(Ecore_Poller_Type type); | |
| | | /** | |
| | | * @brief Changes the polling interval rate of @p poller. | |
| | | * @param poller The Ecore_Poller to change the interval of. | |
| | | * @param interval The tick interval to set; must be a power of 2 and <= 32 | |
| | | 768. | |
| | | * @return Returns true on success, false on failure. | |
| | | * | |
| | | * This allows the changing of a poller's polling interval. It is useful wh | |
| | | en | |
| | | * you want to alter a poll rate without deleting and re-creating a poller. | |
| | | */ | |
| | | EAPI Eina_Bool ecore_poller_poller_interval_set(Ecore_Poller *poller, int i | |
| | | nterval); | |
| | | /** | |
| | | * @brief Gets the polling interval rate of @p poller. | |
| | | * @param poller The Ecore_Poller to change the interval of. | |
| | | * @return Returns the interval, in ticks, that @p poller polls at. | |
| | | * | |
| | | * This returns a poller's polling interval, or 0 on error. | |
| | | */ | |
| | | EAPI int ecore_poller_poller_interval_get(Ecore_Poller *poller); | |
| | | /** | |
| | | * @brief Creates a poller to call the given function at a particular tick | |
| | | interval. | |
| | | * @param type The ticker type to attach the poller to. Must be ECORE_POLLE | |
| | | R_CORE. | |
| | | * @param interval The poll interval. | |
| | | * @param func The poller function. | |
| | | * @param data Data to pass to @a func when it is called. | |
| | | * @return A poller object on success, @c NULL otherwise. | |
| | | * | |
| | | * This function adds @a func as a poller callback that will be called ever | |
| | | y @a | |
| | | * interval ticks together with other pollers of type @a type. @a func will | |
| | | be | |
| | | * passed the @p data pointer as a parameter. | |
| | | * | |
| | | * The @p interval must be between 1 and 32768 inclusive, and must be a pow | |
| | | er of | |
| | | * 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768). The exact tick in which @a fu | |
| | | nc | |
| | | * will be called is undefined, as only the interval between calls can be | |
| | | * defined. Ecore will endeavor to keep pollers synchronized and to call as | |
| | | * many in 1 wakeup event as possible. If @a interval is not a power of two | |
| | | , the | |
| | | * closest power of 2 greater than @a interval will be used. | |
| | | * | |
| | | * When the poller @p func is called, it must return a value of either | |
| | | * ECORE_CALLBACK_RENEW(or 1) or ECORE_CALLBACK_CANCEL(or 0). If it | |
| | | * returns 1, it will be called again at the next tick, or if it returns | |
| | | * 0 it will be deleted automatically making any references/handles for it | |
| | | * invalid. | |
| | | */ | |
| | | EAPI Ecore_Poller *ecore_poller_add(Ecore_Poller_Type type, int interval, E | |
| | | core_Task_Cb func, const void *data); | |
| | | /** | |
| | | * @brief Delete the specified poller from the timer list. | |
| | | * @param poller The poller to delete. | |
| | | * @return The data pointer set for the timer when @ref ecore_poller_add wa | |
| | | s | |
| | | * called on success, @c NULL otherwise. | |
| | | * | |
| | | * @note @a poller must be a valid handle. If the poller function has alrea | |
| | | dy | |
| | | * returned 0, the handle is no longer valid (and does not need to be delet | |
| | | ed). | |
| | | */ | |
| EAPI void *ecore_poller_del(Ecore_Poller *poller); | | EAPI void *ecore_poller_del(Ecore_Poller *poller); | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Animator_Group Ecore Animator functions | | * @defgroup Ecore_Animator_Group Ecore Animator functions | |
| * | | * | |
| * @brief Ecore animators are a helper to simplify creating | | * @brief Ecore animators are a helper to simplify creating | |
| | | | |
| skipping to change at line 985 | | skipping to change at line 1271 | |
| * should be run and having a callback that does the animation, | | * should be run and having a callback that does the animation, | |
| * something like this: | | * something like this: | |
| * @code | | * @code | |
| * static Eina_Bool | | * static Eina_Bool | |
| * _do_animation(void *data, double pos) | | * _do_animation(void *data, double pos) | |
| * { | | * { | |
| * evas_object_move(data, 100 * pos, 100 * pos); | | * evas_object_move(data, 100 * pos, 100 * pos); | |
| * ... do some more animating ... | | * ... do some more animating ... | |
| * } | | * } | |
| * ... | | * ... | |
|
| * ecore_animator_timeline_add(2, _do_animation, my_evas_object); | | *ecore_animator_timeline_add(2, _do_animation, my_evas_object); | |
| * @endcode | | * @endcode | |
| * In the sample above we create an animation to move | | * In the sample above we create an animation to move | |
| * @c my_evas_object from position (0,0) to (100,100) in 2 seconds. | | * @c my_evas_object from position (0,0) to (100,100) in 2 seconds. | |
| * | | * | |
| * If your animation will run for an unspecified amount of time you | | * If your animation will run for an unspecified amount of time you | |
| * can use ecore_animator_add(), which is like using | | * can use ecore_animator_add(), which is like using | |
|
| * ecore_timer_add() with the interval being the | | *ecore_timer_add() with the interval being the | |
| * @ref ecore_animator_frametime_set "framerate". Note that this has | | * @ref ecore_animator_frametime_set "framerate". Note that this has | |
| * tangible benefits to creating a timer for each animation in terms | | * tangible benefits to creating a timer for each animation in terms | |
| * of performance. | | * of performance. | |
| * | | * | |
| * For a more detailed example that show several animation see | | * For a more detailed example that show several animation see | |
| * @ref tutorial_ecore_animator. | | * @ref tutorial_ecore_animator. | |
| * | | * | |
| * @ingroup Ecore_Main_Loop_Group | | * @ingroup Ecore_Main_Loop_Group | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| typedef struct _Ecore_Animator Ecore_Animator; /**< A handle for animators
*/ | | typedef struct _Ecore_Animator Ecore_Animator; /**< A handle for animators
*/ | |
| | | | |
|
| | | /** | |
| | | * @enum _Ecore_Pos_Map | |
| | | * Defines the position mappings for the animation. | |
| | | */ | |
| enum _Ecore_Pos_Map /* Position mappings */ | | enum _Ecore_Pos_Map /* Position mappings */ | |
| { | | { | |
| ECORE_POS_MAP_LINEAR, /**< Linear 0.0 -> 1.0 */ | | ECORE_POS_MAP_LINEAR, /**< Linear 0.0 -> 1.0 */ | |
| ECORE_POS_MAP_ACCELERATE, /**< Start slow then speed up */ | | ECORE_POS_MAP_ACCELERATE, /**< Start slow then speed up */ | |
| ECORE_POS_MAP_DECELERATE, /**< Start fast then slow down */ | | ECORE_POS_MAP_DECELERATE, /**< Start fast then slow down */ | |
| ECORE_POS_MAP_SINUSOIDAL, /**< Start slow, speed up then slow down at en
d */ | | ECORE_POS_MAP_SINUSOIDAL, /**< Start slow, speed up then slow down at en
d */ | |
| ECORE_POS_MAP_ACCELERATE_FACTOR, /**< Start slow then speed up, v1 being
a power factor, 0.0 being linear, 1.0 being normal accelerate, 2.0 being m
uch more pronounced accelerate (squared), 3.0 being cubed, etc. */ | | ECORE_POS_MAP_ACCELERATE_FACTOR, /**< Start slow then speed up, v1 being
a power factor, 0.0 being linear, 1.0 being normal accelerate, 2.0 being m
uch more pronounced accelerate (squared), 3.0 being cubed, etc. */ | |
| ECORE_POS_MAP_DECELERATE_FACTOR, /**< Start fast then slow down, v1 bein
g a power factor, 0.0 being linear, 1.0 being normal decelerate, 2.0 being
much more pronounced decelerate (squared), 3.0 being cubed, etc. */ | | ECORE_POS_MAP_DECELERATE_FACTOR, /**< Start fast then slow down, v1 bein
g a power factor, 0.0 being linear, 1.0 being normal decelerate, 2.0 being
much more pronounced decelerate (squared), 3.0 being cubed, etc. */ | |
| ECORE_POS_MAP_SINUSOIDAL_FACTOR, /**< Start slow, speed up then slow dow
n at end, v1 being a power factor, 0.0 being linear, 1.0 being normal sinus
oidal, 2.0 being much more pronounced sinusoidal (squared), 3.0 being cubed
, etc. */ | | ECORE_POS_MAP_SINUSOIDAL_FACTOR, /**< Start slow, speed up then slow dow
n at end, v1 being a power factor, 0.0 being linear, 1.0 being normal sinus
oidal, 2.0 being much more pronounced sinusoidal (squared), 3.0 being cubed
, etc. */ | |
| ECORE_POS_MAP_DIVISOR_INTERP, /**< Start at gradient * v1, interpolated
via power of v2 curve */ | | ECORE_POS_MAP_DIVISOR_INTERP, /**< Start at gradient * v1, interpolated
via power of v2 curve */ | |
| ECORE_POS_MAP_BOUNCE, /**< Start at 0.0 then "drop" like a ball bouncing
to the ground at 1.0, and bounce v2 times, with decay factor of v1 */ | | ECORE_POS_MAP_BOUNCE, /**< Start at 0.0 then "drop" like a ball bouncing
to the ground at 1.0, and bounce v2 times, with decay factor of v1 */ | |
| ECORE_POS_MAP_SPRING /**< Start at 0.0 then "wobble" like a spring rest
position 1.0, and wobble v2 times, with decay factor of v1 */ | | ECORE_POS_MAP_SPRING /**< Start at 0.0 then "wobble" like a spring rest
position 1.0, and wobble v2 times, with decay factor of v1 */ | |
| }; | | }; | |
| typedef enum _Ecore_Pos_Map Ecore_Pos_Map; | | typedef enum _Ecore_Pos_Map Ecore_Pos_Map; | |
| | | | |
|
| | | /** | |
| | | * @enum _Ecore_Animator_Source | |
| | | * Defines the timing sources for animators. | |
| | | */ | |
| enum _Ecore_Animator_Source /* Timing sources for animators */ | | enum _Ecore_Animator_Source /* Timing sources for animators */ | |
| { | | { | |
| ECORE_ANIMATOR_SOURCE_TIMER, /**< The default system clock/timer based a
nimator that ticks every "frametime" seconds */ | | ECORE_ANIMATOR_SOURCE_TIMER, /**< The default system clock/timer based a
nimator that ticks every "frametime" seconds */ | |
| ECORE_ANIMATOR_SOURCE_CUSTOM /**< A custom animator trigger that you nee
d to call ecore_animator_trigger() to make it tick */ | | ECORE_ANIMATOR_SOURCE_CUSTOM /**< A custom animator trigger that you nee
d to call ecore_animator_trigger() to make it tick */ | |
| }; | | }; | |
| typedef enum _Ecore_Animator_Source Ecore_Animator_Source; | | typedef enum _Ecore_Animator_Source Ecore_Animator_Source; | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Timeline_Cb Ecore_Timeline_Cb | | * @typedef Ecore_Timeline_Cb Ecore_Timeline_Cb | |
| * A callback run for a task (animators with runtimes) | | * A callback run for a task (animators with runtimes) | |
| */ | | */ | |
| typedef Eina_Bool (*Ecore_Timeline_Cb)(void *data, double pos); | | typedef Eina_Bool (*Ecore_Timeline_Cb)(void *data, double pos); | |
| | | | |
| /** | | /** | |
|
| * @brief Add an animator to call @p func at every animaton tick during mai
n | | * @brief Add an animator to call @p func at every animation tick during ma
in | |
| * loop execution. | | * loop execution. | |
| * | | * | |
| * @param func The function to call when it ticks off | | * @param func The function to call when it ticks off | |
| * @param data The data to pass to the function | | * @param data The data to pass to the function | |
| * @return A handle to the new animator | | * @return A handle to the new animator | |
| * | | * | |
|
| * This function adds a animator and returns its handle on success and NULL | | * This function adds a animator and returns its handle on success and @c N | |
| on | | ULL | |
| * failure. The function @p func will be called every N seconds where N is | | * on failure. The function @p func will be called every N seconds where N | |
| the | | is | |
| * @p frametime interval set by ecore_animator_frametime_set(). The functio | | * the @p frametime interval set by ecore_animator_frametime_set(). The | |
| n | | * function will be passed the @p data pointer as its parameter. | |
| * will be passed the @p data pointer as its parameter. | | | |
| * | | * | |
| * When the animator @p func is called, it must return a value of either 1
or | | * When the animator @p func is called, it must return a value of either 1
or | |
| * 0. If it returns 1 (or ECORE_CALLBACK_RENEW), it will be called again at | | * 0. If it returns 1 (or ECORE_CALLBACK_RENEW), it will be called again at | |
| * the next tick, or if it returns 0 (or ECORE_CALLBACK_CANCEL) it will be | | * the next tick, or if it returns 0 (or ECORE_CALLBACK_CANCEL) it will be | |
| * deleted automatically making any references/handles for it invalid. | | * deleted automatically making any references/handles for it invalid. | |
| * | | * | |
| * @note The default @p frametime value is 1/30th of a second. | | * @note The default @p frametime value is 1/30th of a second. | |
| * | | * | |
| * @see ecore_animator_timeline_add() | | * @see ecore_animator_timeline_add() | |
| * @see ecore_animator_frametime_set() | | * @see ecore_animator_frametime_set() | |
| */ | | */ | |
|
| EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, | | EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, const void *dat | |
| const void *data); | | a); | |
| /** | | /** | |
| * @brief Add a animator that runs for a limited time | | * @brief Add a animator that runs for a limited time | |
| * | | * | |
| * @param runtime The time to run in seconds | | * @param runtime The time to run in seconds | |
| * @param func The function to call when it ticks off | | * @param func The function to call when it ticks off | |
| * @param data The data to pass to the function | | * @param data The data to pass to the function | |
| * @return A handle to the new animator | | * @return A handle to the new animator | |
| * | | * | |
| * This function is just like ecore_animator_add() except the animator only | | * This function is just like ecore_animator_add() except the animator only | |
| * runs for a limited time specified in seconds by @p runtime. Once the | | * runs for a limited time specified in seconds by @p runtime. Once the | |
| | | | |
| skipping to change at line 1087 | | skipping to change at line 1380 | |
| * the animator run is at. If the callback wishes not to have a linear | | * the animator run is at. If the callback wishes not to have a linear | |
| * transition it can "map" this value to one of several curves and mappings | | * transition it can "map" this value to one of several curves and mappings | |
| * via ecore_animator_pos_map(). | | * via ecore_animator_pos_map(). | |
| * | | * | |
| * @note The default @p frametime value is 1/30th of a second. | | * @note The default @p frametime value is 1/30th of a second. | |
| * | | * | |
| * @see ecore_animator_add() | | * @see ecore_animator_add() | |
| * @see ecore_animator_pos_map() | | * @see ecore_animator_pos_map() | |
| * @since 1.1.0 | | * @since 1.1.0 | |
| */ | | */ | |
|
| EAPI Ecore_Animator * | | EAPI Ecore_Animator *ecore_animator_timeline_add(double runtime, Ecore_Time | |
| ecore_animator_timeline_add(double runtime, | | line_Cb func, const void *data); | |
| Ecore_Timeline_Cb func, | | | |
| const void *data); | | | |
| /** | | /** | |
| * @brief Delete the specified animator from the animator list. | | * @brief Delete the specified animator from the animator list. | |
| * | | * | |
| * @param animator The animator to delete | | * @param animator The animator to delete | |
| * @return The data pointer set for the animator on add | | * @return The data pointer set for the animator on add | |
| * | | * | |
| * Delete the specified @p animator from the set of animators that are | | * Delete the specified @p animator from the set of animators that are | |
| * executed during main loop execution. This function returns the data | | * executed during main loop execution. This function returns the data | |
|
| * parameter that was being passed to the callback on success, or NULL on | | * parameter that was being passed to the callback on success, or @c NULL o
n | |
| * failure. After this call returns the specified animator object @p animat
or | | * failure. After this call returns the specified animator object @p animat
or | |
| * is invalid and should not be used again. It will not get called again af
ter | | * is invalid and should not be used again. It will not get called again af
ter | |
| * deletion. | | * deletion. | |
| */ | | */ | |
|
| EAPI void * | | EAPI void *ecore_animator_del(Ecore_Animator *animator); | |
| ecore_animator_del(Ecore_Animator *animator); | | | |
| /** | | /** | |
| * @brief Suspend the specified animator. | | * @brief Suspend the specified animator. | |
| * | | * | |
| * @param animator The animator to delete | | * @param animator The animator to delete | |
| * | | * | |
|
| * The specified @p animator will be temporarly removed from the set of | | * The specified @p animator will be temporarily removed from the set of | |
| * animators that are executed during main loop. | | * animators that are executed during main loop. | |
| * | | * | |
| * @warning Freezing an animator doesn't freeze accounting of how long that | | * @warning Freezing an animator doesn't freeze accounting of how long that | |
| * animator has been running. Therefore if the animator was created with | | * animator has been running. Therefore if the animator was created with | |
|
| * ecore_animator_timeline_add() the @p pos argument given to the callback | | *ecore_animator_timeline_add() the @p pos argument given to the callback | |
| * will increase as if the animator hadn't been frozen and the animator may | | * will increase as if the animator hadn't been frozen and the animator may | |
| * have it's execution halted if @p runtime elapsed. | | * have it's execution halted if @p runtime elapsed. | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_animator_freeze(Ecore_Animator *animator); | |
| ecore_animator_freeze(Ecore_Animator *animator); | | | |
| /** | | /** | |
| * @brief Restore execution of the specified animator. | | * @brief Restore execution of the specified animator. | |
| * | | * | |
| * @param animator The animator to delete | | * @param animator The animator to delete | |
| * | | * | |
| * The specified @p animator will be put back in the set of animators that
are | | * The specified @p animator will be put back in the set of animators that
are | |
| * executed during main loop. | | * executed during main loop. | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_animator_thaw(Ecore_Animator *animator); | |
| ecore_animator_thaw(Ecore_Animator *animator); | | | |
| /** | | /** | |
| * @brief Set the animator call interval in seconds. | | * @brief Set the animator call interval in seconds. | |
| * | | * | |
| * @param frametime The time in seconds in between animator ticks. | | * @param frametime The time in seconds in between animator ticks. | |
| * | | * | |
| * This function sets the time interval (in seconds) between animator ticks
. | | * This function sets the time interval (in seconds) between animator ticks
. | |
| * At every tick the callback of every existing animator will be called. | | * At every tick the callback of every existing animator will be called. | |
| * | | * | |
| * @warning Too small a value may cause performance issues and too high a | | * @warning Too small a value may cause performance issues and too high a | |
| * value may cause your animation to seem "jerky". | | * value may cause your animation to seem "jerky". | |
| * | | * | |
| * @note The default @p frametime value is 1/30th of a second. | | * @note The default @p frametime value is 1/30th of a second. | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_animator_frametime_set(double frametime); | |
| ecore_animator_frametime_set(double frametime); | | | |
| /** | | /** | |
| * @brief Get the animator call interval in seconds. | | * @brief Get the animator call interval in seconds. | |
| * | | * | |
| * @return The time in second in between animator ticks. | | * @return The time in second in between animator ticks. | |
| * | | * | |
| * This function retrieves the time in seconds between animator ticks. | | * This function retrieves the time in seconds between animator ticks. | |
| * | | * | |
| * @see ecore_animator_frametime_set() | | * @see ecore_animator_frametime_set() | |
| */ | | */ | |
|
| EAPI double | | EAPI double ecore_animator_frametime_get(void); | |
| ecore_animator_frametime_get(void); | | | |
| /** | | /** | |
| * @brief Maps an input position from 0.0 to 1.0 along a timeline to a | | * @brief Maps an input position from 0.0 to 1.0 along a timeline to a | |
| * position in a different curve. | | * position in a different curve. | |
| * | | * | |
| * @param pos The input position to map | | * @param pos The input position to map | |
| * @param map The mapping to use | | * @param map The mapping to use | |
| * @param v1 A parameter use by the mapping (pass 0.0 if not used) | | * @param v1 A parameter use by the mapping (pass 0.0 if not used) | |
| * @param v2 A parameter use by the mapping (pass 0.0 if not used) | | * @param v2 A parameter use by the mapping (pass 0.0 if not used) | |
| * @return The mapped value | | * @return The mapped value | |
| * | | * | |
| * Takes an input position (0.0 to 1.0) and maps to a new position (normall
y | | * Takes an input position (0.0 to 1.0) and maps to a new position (normall
y | |
| * between 0.0 and 1.0, but it may go above/below 0.0 or 1.0 to show that i
t | | * between 0.0 and 1.0, but it may go above/below 0.0 or 1.0 to show that i
t | |
| * has "overshot" the mark) using some interpolation (mapping) algorithm. | | * has "overshot" the mark) using some interpolation (mapping) algorithm. | |
| * | | * | |
| * This function useful to create non-linear animations. It offers a variet
y | | * This function useful to create non-linear animations. It offers a variet
y | |
|
| * of possible animaton curves to be used: | | * of possible animation curves to be used: | |
| * @li ECORE_POS_MAP_LINEAR - Linear, returns @p pos | | * @li ECORE_POS_MAP_LINEAR - Linear, returns @p pos | |
| * @li ECORE_POS_MAP_ACCELERATE - Start slow then speed up | | * @li ECORE_POS_MAP_ACCELERATE - Start slow then speed up | |
| * @li ECORE_POS_MAP_DECELERATE - Start fast then slow down | | * @li ECORE_POS_MAP_DECELERATE - Start fast then slow down | |
| * @li ECORE_POS_MAP_SINUSOIDAL - Start slow, speed up then slow down at en
d | | * @li ECORE_POS_MAP_SINUSOIDAL - Start slow, speed up then slow down at en
d | |
| * @li ECORE_POS_MAP_ACCELERATE_FACTOR - Start slow then speed up, v1 being
a | | * @li ECORE_POS_MAP_ACCELERATE_FACTOR - Start slow then speed up, v1 being
a | |
| * power factor, 0.0 being linear, 1.0 being ECORE_POS_MAP_ACCELERATE, 2.0 | | * power factor, 0.0 being linear, 1.0 being ECORE_POS_MAP_ACCELERATE, 2.0 | |
| * being much more pronounced accelerate (squared), 3.0 being cubed, etc. | | * being much more pronounced accelerate (squared), 3.0 being cubed, etc. | |
| * @li ECORE_POS_MAP_DECELERATE_FACTOR - Start fast then slow down, v1 bein
g a | | * @li ECORE_POS_MAP_DECELERATE_FACTOR - Start fast then slow down, v1 bein
g a | |
| * power factor, 0.0 being linear, 1.0 being ECORE_POS_MAP_DECELERATE, 2.0 | | * power factor, 0.0 being linear, 1.0 being ECORE_POS_MAP_DECELERATE, 2.0 | |
| * being much more pronounced decelerate (squared), 3.0 being cubed, etc. | | * being much more pronounced decelerate (squared), 3.0 being cubed, etc. | |
| | | | |
| skipping to change at line 1211 | | skipping to change at line 1496 | |
| * double pos; // input position in a timeline from 0.0 to 1.0 | | * double pos; // input position in a timeline from 0.0 to 1.0 | |
| * double out; // output position after mapping | | * double out; // output position after mapping | |
| * int x1, y1, x2, y2; // x1 & y1 are start position, x2 & y2 are end posit
ion | | * int x1, y1, x2, y2; // x1 & y1 are start position, x2 & y2 are end posit
ion | |
| * int x, y; // x & y are the calculated position | | * int x, y; // x & y are the calculated position | |
| * | | * | |
| * out = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.8, 7); | | * out = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.8, 7); | |
| * x = (x1 * out) + (x2 * (1.0 - out)); | | * x = (x1 * out) + (x2 * (1.0 - out)); | |
| * y = (y1 * out) + (y2 * (1.0 - out)); | | * y = (y1 * out) + (y2 * (1.0 - out)); | |
| * move_my_object_to(myobject, x, y); | | * move_my_object_to(myobject, x, y); | |
| * @endcode | | * @endcode | |
|
| * This will make an animaton that bounces 7 each times diminishing by a | | * This will make an animation that bounces 7 each times diminishing by a | |
| * factor of 1.8. | | * factor of 1.8. | |
| * | | * | |
| * @see _Ecore_Pos_Map | | * @see _Ecore_Pos_Map | |
| * | | * | |
| * @since 1.1.0 | | * @since 1.1.0 | |
| */ | | */ | |
|
| EAPI double | | EAPI double ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1 | |
| ecore_animator_pos_map(double pos, | | , double v2); | |
| Ecore_Pos_Map map, | | | |
| double v1, | | | |
| double v2); | | | |
| /** | | /** | |
| * @brief Set the source of animator ticks for the mainloop | | * @brief Set the source of animator ticks for the mainloop | |
| * | | * | |
| * @param source The source of animator ticks to use | | * @param source The source of animator ticks to use | |
| * | | * | |
| * This sets the source of animator ticks. When an animator is active the | | * This sets the source of animator ticks. When an animator is active the | |
| * mainloop will "tick" over frame by frame calling all animators that are | | * mainloop will "tick" over frame by frame calling all animators that are | |
| * registered until none are. The mainloop will tick at a given rate based | | * registered until none are. The mainloop will tick at a given rate based | |
| * on the animator source. The default source is the system clock timer | | * on the animator source. The default source is the system clock timer | |
| * source - ECORE_ANIMATOR_SOURCE_TIMER. This source uses the system clock | | * source - ECORE_ANIMATOR_SOURCE_TIMER. This source uses the system clock | |
| * to tick over every N seconds (specified by ecore_animator_frametime_set(
), | | * to tick over every N seconds (specified by ecore_animator_frametime_set(
), | |
| * with the default being 1/30th of a second unless set otherwise). You can | | * with the default being 1/30th of a second unless set otherwise). You can | |
| * set a custom tick source by setting the source to | | * set a custom tick source by setting the source to | |
| * ECORE_ANIMATOR_SOURCE_CUSTOM and then drive it yourself based on some in
put | | * ECORE_ANIMATOR_SOURCE_CUSTOM and then drive it yourself based on some in
put | |
| * tick source (like another application via ipc, some vertical blanking | | * tick source (like another application via ipc, some vertical blanking | |
| * interrupt interrupt etc.) using | | * interrupt interrupt etc.) using | |
|
| * ecore_animator_custom_source_tick_begin_callback_set() and | | *ecore_animator_custom_source_tick_begin_callback_set() and | |
| * ecore_animator_custom_source_tick_end_callback_set() to set the function | | *ecore_animator_custom_source_tick_end_callback_set() to set the functions | |
| s | | | |
| * that will be called to start and stop the ticking source, which when it | | * that will be called to start and stop the ticking source, which when it | |
| * gets a "tick" should call ecore_animator_custom_tick() to make the "tick
" over 1 | | * gets a "tick" should call ecore_animator_custom_tick() to make the "tick
" over 1 | |
| * frame. | | * frame. | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_animator_source_set(Ecore_Animator_Source source); | |
| ecore_animator_source_set(Ecore_Animator_Source source); | | | |
| /** | | /** | |
| * @brief Get the animator source currently set. | | * @brief Get the animator source currently set. | |
| * | | * | |
| * @return The current animator source | | * @return The current animator source | |
| * | | * | |
| * This gets the current animator source. | | * This gets the current animator source. | |
| * | | * | |
| * @see ecore_animator_source_set() | | * @see ecore_animator_source_set() | |
| */ | | */ | |
|
| EAPI Ecore_Animator_Source | | EAPI Ecore_Animator_Source ecore_animator_source_get(void); | |
| ecore_animator_source_get(void); | | | |
| /** | | /** | |
| * @brief Set the function that begins a custom animator tick source | | * @brief Set the function that begins a custom animator tick source | |
| * | | * | |
| * @param func The function to call when ticking is to begin | | * @param func The function to call when ticking is to begin | |
| * @param data The data passed to the tick begin function as its parameter | | * @param data The data passed to the tick begin function as its parameter | |
| * | | * | |
| * The Ecore Animator infrastructure handles tracking if animators are need
ed | | * The Ecore Animator infrastructure handles tracking if animators are need
ed | |
| * or not and which ones need to be called and when, but when the tick sour
ce | | * or not and which ones need to be called and when, but when the tick sour
ce | |
| * is custom, you have to provide a tick source by calling | | * is custom, you have to provide a tick source by calling | |
|
| * ecore_animator_custom_tick() to indicate a frame tick happened. In order | | *ecore_animator_custom_tick() to indicate a frame tick happened. In order | |
| * to allow the source of ticks to be dynamically enabled or disabled as | | * to allow the source of ticks to be dynamically enabled or disabled as | |
| * needed, the @p func when set is called to enable the tick source to | | * needed, the @p func when set is called to enable the tick source to | |
| * produce tick events that call ecore_animator_custom_tick(). If @p func | | * produce tick events that call ecore_animator_custom_tick(). If @p func | |
|
| * is NULL then no function is called to begin custom ticking. | | * is @c NULL then no function is called to begin custom ticking. | |
| * | | * | |
| * @see ecore_animator_source_set() | | * @see ecore_animator_source_set() | |
| * @see ecore_animator_custom_source_tick_end_callback_set() | | * @see ecore_animator_custom_source_tick_end_callback_set() | |
| * @see ecore_animator_custom_tick() | | * @see ecore_animator_custom_tick() | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb fun | |
| ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, | | c, const void *data); | |
| const void *data); | | | |
| /** | | /** | |
| * @brief Set the function that ends a custom animator tick source | | * @brief Set the function that ends a custom animator tick source | |
| * | | * | |
| * @param func The function to call when ticking is to end | | * @param func The function to call when ticking is to end | |
| * @param data The data passed to the tick end function as its parameter | | * @param data The data passed to the tick end function as its parameter | |
| * | | * | |
| * This function is a matching pair to the function set by | | * This function is a matching pair to the function set by | |
| * ecore_animator_custom_source_tick_begin_callback_set() and is called | | * ecore_animator_custom_source_tick_begin_callback_set() and is called | |
|
| * when ticking is to stop. If @p func is NULL then no function will be | | * when ticking is to stop. If @p func is @c NULL then no function will be | |
| * called to stop ticking. For more information please see | | * called to stop ticking. For more information please see | |
| * ecore_animator_custom_source_tick_begin_callback_set(). | | * ecore_animator_custom_source_tick_begin_callback_set(). | |
| * | | * | |
| * @see ecore_animator_source_set() | | * @see ecore_animator_source_set() | |
| * @see ecore_animator_custom_source_tick_begin_callback_set() | | * @see ecore_animator_custom_source_tick_begin_callback_set() | |
| * @see ecore_animator_custom_tick() | | * @see ecore_animator_custom_tick() | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, | |
| ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, | | const void *data); | |
| const void *data); | | | |
| /** | | /** | |
| * @brief Trigger a custom animator tick | | * @brief Trigger a custom animator tick | |
| * | | * | |
| * When animator source is set to ECORE_ANIMATOR_SOURCE_CUSTOM, then callin
g | | * When animator source is set to ECORE_ANIMATOR_SOURCE_CUSTOM, then callin
g | |
| * this function triggers a run of all animators currently registered with | | * this function triggers a run of all animators currently registered with | |
| * Ecore as this indicates a "frame tick" happened. This will do nothing if | | * Ecore as this indicates a "frame tick" happened. This will do nothing if | |
| * the animator source(set by ecore_animator_source_set()) is not set to | | * the animator source(set by ecore_animator_source_set()) is not set to | |
| * ECORE_ANIMATOR_SOURCE_CUSTOM. | | * ECORE_ANIMATOR_SOURCE_CUSTOM. | |
| * | | * | |
| * @see ecore_animator_source_set() | | * @see ecore_animator_source_set() | |
| * @see ecore_animator_custom_source_tick_begin_callback_set | | * @see ecore_animator_custom_source_tick_begin_callback_set | |
| * @see ecore_animator_custom_source_tick_end_callback_set()() | | * @see ecore_animator_custom_source_tick_end_callback_set()() | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_animator_custom_tick(void); | |
| ecore_animator_custom_tick(void); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
|
| * @defgroup Ecore_Time_Group Ecore Time functions | | * @defgroup Ecore_Time_Group Ecore time functions | |
| * | | * | |
|
| * Functions that deal with time. These functions include those | | * These are function to retrieve time in a given format. | |
| * that simply retrieve it in a given format, and those that create | | | |
| * events based on it. | | | |
| * | | * | |
|
| * The timer allows callbacks to be called at specific intervals. | | * Examples: | |
| * | | | |
| * Examples with functions that deal with time: | | | |
| * @li @ref ecore_time_functions_example_c | | * @li @ref ecore_time_functions_example_c | |
|
| | | * @{ | |
| | | */ | |
| | | EAPI double ecore_time_get(void); | |
| | | EAPI double ecore_time_unix_get(void); | |
| | | EAPI double ecore_loop_time_get(void); | |
| | | | |
| | | /** | |
| | | * @} | |
| | | */ | |
| | | | |
| | | /** | |
| | | * @defgroup Ecore_Timer_Group Ecore Timer functions | |
| | | * | |
| | | * Ecore provides very flexible timer functionality. The basic usage of tim | |
| | | ers, | |
| | | * to call a certain function at a certain interval can be achieved with a | |
| | | * single line: | |
| | | * @code | |
| | | * Eina_Bool my_func(void *data) { | |
| | | * do_funky_stuff_with_data(data); | |
| | | * return EINA_TRUE; | |
| | | * } | |
| | | * ecore_timer_add(interval_in_seconds, my_func, data_given_to_function); | |
| | | * @endcode | |
| | | * @note If the function was to be executed only once simply return | |
| | | * @c EINA_FALSE instead. | |
| | | * | |
| | | * An example that shows the usage of a lot of these: | |
| * @li @ref ecore_timer_example_c | | * @li @ref ecore_timer_example_c | |
| * | | * | |
| * @ingroup Ecore_Main_Loop_Group | | * @ingroup Ecore_Main_Loop_Group | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| typedef struct _Ecore_Timer Ecore_Timer; /**< A handle for timers */ | | typedef struct _Ecore_Timer Ecore_Timer; /**< A handle for timers */ | |
| | | | |
|
| EAPI double | | EAPI Ecore_Timer *ecore_timer_add(double in, Ecore_Task_Cb func, const void | |
| ecore_time_get(void); | | *data); | |
| EAPI double | | EAPI Ecore_Timer *ecore_timer_loop_add(double in, Ecore_Task_Cb func, const | |
| ecore_time_unix_get(void); | | void *data); | |
| EAPI double | | EAPI void *ecore_timer_del(Ecore_Timer *timer); | |
| ecore_loop_time_get(void); | | EAPI void ecore_timer_interval_set(Ecore_Timer *timer, double in); | |
| | | EAPI double ecore_timer_interval_get(Ecore_Timer *timer); | |
| EAPI Ecore_Timer * | | EAPI void ecore_timer_freeze(Ecore_Timer *timer); | |
| ecore_timer_add(double in, | | EAPI void ecore_timer_thaw(Ecore_Timer *timer); | |
| Ecore_Task_Cb func, | | EAPI void ecore_timer_delay(Ecore_Timer *timer, double add); | |
| const void *data); | | EAPI void ecore_timer_reset(Ecore_Timer *timer); | |
| EAPI Ecore_Timer * | | EAPI double ecore_timer_pending_get(Ecore_Timer *timer); | |
| ecore_timer_loop_add(double in, | | EAPI double ecore_timer_precision_get(void); | |
| Ecore_Task_Cb func, | | EAPI void ecore_timer_precision_set(double precision); | |
| const void *data); | | EAPI char *ecore_timer_dump(void); | |
| EAPI void * | | | |
| ecore_timer_del(Ecore_Timer *timer); | | | |
| EAPI void | | | |
| ecore_timer_interval_set(Ecore_Timer *timer, | | | |
| double in); | | | |
| EAPI double | | | |
| ecore_timer_interval_get(Ecore_Timer *timer); | | | |
| EAPI void | | | |
| ecore_timer_freeze(Ecore_Timer *timer); | | | |
| EAPI void | | | |
| ecore_timer_thaw(Ecore_Timer *timer); | | | |
| EAPI void | | | |
| ecore_timer_delay(Ecore_Timer *timer, | | | |
| double add); | | | |
| EAPI double | | | |
| ecore_timer_pending_get(Ecore_Timer *timer); | | | |
| EAPI double | | | |
| ecore_timer_precision_get(void); | | | |
| EAPI void | | | |
| ecore_timer_precision_set(double precision); | | | |
| EAPI char * | | | |
| ecore_timer_dump(void); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Idle_Group Ecore Idle functions | | * @defgroup Ecore_Idle_Group Ecore Idle functions | |
| * | | * | |
|
| * Callbacks that are called when the program enters or exits an | | * The idler functionality in Ecore allows for callbacks to be called when | |
| * idle state. | | the | |
| * | | * program isn't handling @ref Ecore_Event_Group "events", @ref Ecore_Timer | |
| * The ecore main loop enters an idle state when it is waiting for | | _Group | |
| * timers to time out, data to come in on a file descriptor or any | | * "timers" or @ref Ecore_FD_Handler_Group "fd handlers". | |
| * other event to occur. You can set callbacks to be called when | | * | |
| * the main loop enters an idle state, during an idle state or just | | * There are three types of idlers: Enterers, Idlers(proper) and Exiters. T | |
| * after the program wakes up. | | hey | |
| | | * are called, respectively, when the program is about to enter an idle sta | |
| | | te, | |
| | | * when the program is in an idle state and when the program has just left | |
| | | an | |
| | | * idle state and will begin processing @ref Ecore_Event_Group "events", @r | |
| | | ef | |
| | | * Ecore_Timer_Group "timers" or @ref Ecore_FD_Handler_Group "fd handlers". | |
| * | | * | |
| * Enterer callbacks are good for updating your program's state, if | | * Enterer callbacks are good for updating your program's state, if | |
| * it has a state engine. Once all of the enterer handlers are | | * it has a state engine. Once all of the enterer handlers are | |
| * called, the program will enter a "sleeping" state. | | * called, the program will enter a "sleeping" state. | |
| * | | * | |
| * Idler callbacks are called when the main loop has called all | | * Idler callbacks are called when the main loop has called all | |
| * enterer handlers. They are useful for interfaces that require | | * enterer handlers. They are useful for interfaces that require | |
| * polling and timers would be too slow to use. | | * polling and timers would be too slow to use. | |
| * | | * | |
|
| | | * Exiter callbacks are called when the main loop wakes up from an idle sta | |
| | | te. | |
| | | * | |
| * If no idler callbacks are specified, then the process literally | | * If no idler callbacks are specified, then the process literally | |
| * goes to sleep. Otherwise, the idler callbacks are called | | * goes to sleep. Otherwise, the idler callbacks are called | |
| * continuously while the loop is "idle", using as much CPU as is | | * continuously while the loop is "idle", using as much CPU as is | |
| * available to the process. | | * available to the process. | |
| * | | * | |
|
| * Exiter callbacks are called when the main loop wakes up from an | | | |
| * idle state. | | | |
| * | | | |
| * @note Idle state doesn't mean that the @b program is idle, but | | * @note Idle state doesn't mean that the @b program is idle, but | |
| * that the <b>main loop</b> is idle. It doesn't have any timers, | | * that the <b>main loop</b> is idle. It doesn't have any timers, | |
| * events, fd handlers or anything else to process (which in most | | * events, fd handlers or anything else to process (which in most | |
| * <em>event driven</em> programs also means that the @b program is | | * <em>event driven</em> programs also means that the @b program is | |
| * idle too, but it's not a rule). The program itself may be doing | | * idle too, but it's not a rule). The program itself may be doing | |
| * a lot of processing in the idler, or in another thread, for | | * a lot of processing in the idler, or in another thread, for | |
| * example. | | * example. | |
| * | | * | |
| * Example with functions that deal with idle state: | | * Example with functions that deal with idle state: | |
| * | | * | |
| | | | |
| skipping to change at line 1434 | | skipping to change at line 1707 | |
| */ | | */ | |
| | | | |
| typedef struct _Ecore_Idler Ecore_Idler; /**< A handle for idlers */ | | typedef struct _Ecore_Idler Ecore_Idler; /**< A handle for idlers */ | |
| typedef struct _Ecore_Idle_Enterer Ecore_Idle_Enterer; /**< A handle for id
le enterers */ | | typedef struct _Ecore_Idle_Enterer Ecore_Idle_Enterer; /**< A handle for id
le enterers */ | |
| typedef struct _Ecore_Idle_Exiter Ecore_Idle_Exiter; /**< A handle for idl
e exiters */ | | typedef struct _Ecore_Idle_Exiter Ecore_Idle_Exiter; /**< A handle for idl
e exiters */ | |
| | | | |
| /** | | /** | |
| * Add an idler handler. | | * Add an idler handler. | |
| * @param func The function to call when idling. | | * @param func The function to call when idling. | |
| * @param data The data to be passed to this @p func call. | | * @param data The data to be passed to this @p func call. | |
|
| * @return A idler handle if successfully added. NULL otherwise. | | * @return A idler handle if successfully added, @c NULL otherwise. | |
| * | | * | |
| * Add an idler handle to the event loop, returning a handle on | | * Add an idler handle to the event loop, returning a handle on | |
|
| * success and NULL otherwise. The function @p func will be called | | * success and @c NULL otherwise. The function @p func will be called | |
| * repeatedly while no other events are ready to be processed, as | | * repeatedly while no other events are ready to be processed, as | |
|
| * long as it returns 1 (or ECORE_CALLBACK_RENEW). A return of 0 | | * long as it returns @c 1 (or ECORE_CALLBACK_RENEW). A return of @c 0 | |
| * (or ECORE_CALLBACK_CANCEL) deletes the idler. | | * (or ECORE_CALLBACK_CANCEL) deletes the idler. | |
| * | | * | |
| * Idlers are useful for progressively prossessing data without blocking. | | * Idlers are useful for progressively prossessing data without blocking. | |
| */ | | */ | |
|
| EAPI Ecore_Idler * | | EAPI Ecore_Idler *ecore_idler_add(Ecore_Task_Cb func, const void *data); | |
| ecore_idler_add(Ecore_Task_Cb func, | | | |
| const void *data); | | | |
| | | | |
| /** | | /** | |
| * Delete an idler callback from the list to be executed. | | * Delete an idler callback from the list to be executed. | |
| * @param idler The handle of the idler callback to delete | | * @param idler The handle of the idler callback to delete | |
|
| * @return The data pointer passed to the idler callback on success. NULL | | * @return The data pointer passed to the idler callback on success, @c NUL
L | |
| * otherwise. | | * otherwise. | |
| */ | | */ | |
|
| EAPI void * | | EAPI void *ecore_idler_del(Ecore_Idler *idler); | |
| ecore_idler_del(Ecore_Idler *idler); | | | |
| | | EAPI Ecore_Idle_Enterer *ecore_idle_enterer_add(Ecore_Task_Cb func, const v | |
| | | oid *data); | |
| | | EAPI Ecore_Idle_Enterer *ecore_idle_enterer_before_add(Ecore_Task_Cb func, | |
| | | const void *data); | |
| | | EAPI void *ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer); | |
| | | | |
|
| EAPI Ecore_Idle_Enterer * | | EAPI Ecore_Idle_Exiter *ecore_idle_exiter_add(Ecore_Task_Cb func, const voi | |
| ecore_idle_enterer_add(Ecore_Task_Cb func, | | d *data); | |
| const void *data); | | EAPI void *ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter); | |
| EAPI Ecore_Idle_Enterer * | | | |
| ecore_idle_enterer_before_add(Ecore_Task_Cb func, | | | |
| const void *data); | | | |
| EAPI void * | | | |
| ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer); | | | |
| | | | |
| EAPI Ecore_Idle_Exiter * | | | |
| ecore_idle_exiter_add(Ecore_Task_Cb func, | | | |
| const void *data); | | | |
| EAPI void * | | | |
| ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Thread_Group Ecore Thread functions | | * @defgroup Ecore_Thread_Group Ecore Thread functions | |
| * | | * | |
| * Facilities to run heavy tasks in different threads to avoid blocking | | * Facilities to run heavy tasks in different threads to avoid blocking | |
| * the main loop. | | * the main loop. | |
| * | | * | |
| * The EFL is, for the most part, not thread safe. This means that if you | | * The EFL is, for the most part, not thread safe. This means that if you | |
| * have some task running in another thread and you have, for example, an | | * have some task running in another thread and you have, for example, an | |
| * Evas object to show the status progress of this task, you cannot update | | * Evas object to show the status progress of this task, you cannot update | |
| * the object from within the thread. This can only be done from the main | | * the object from within the thread. This can only be done from the main | |
| * thread, the one running the main loop. This problem can be solved | | * thread, the one running the main loop. This problem can be solved | |
| * by running a thread that sends messages to the main one using an | | * by running a thread that sends messages to the main one using an | |
| * @ref Ecore_Pipe_Group "Ecore_Pipe", but when you need to handle other | | * @ref Ecore_Pipe_Group "Ecore_Pipe", but when you need to handle other | |
|
| * things like cancelling the thread, your code grows in coplexity and gets | | * things like cancelling the thread, your code grows in complexity and get
s | |
| * much harder to maintain. | | * much harder to maintain. | |
| * | | * | |
| * Ecore Thread is here to solve that problem. It is @b not a simple wrappe
r | | * Ecore Thread is here to solve that problem. It is @b not a simple wrappe
r | |
| * around standard POSIX threads (or the equivalent in other systems) and | | * around standard POSIX threads (or the equivalent in other systems) and | |
| * it's not meant to be used to run parallel tasks throughout the entire | | * it's not meant to be used to run parallel tasks throughout the entire | |
| * duration of the program, especially when these tasks are performance | | * duration of the program, especially when these tasks are performance | |
| * critical, as Ecore manages these tasks using a pool of threads based on | | * critical, as Ecore manages these tasks using a pool of threads based on | |
| * system configuration. | | * system configuration. | |
| * | | * | |
| * What Ecore Thread does, is make it a lot easier to dispatch a worker | | * What Ecore Thread does, is make it a lot easier to dispatch a worker | |
| | | | |
| skipping to change at line 1526 | | skipping to change at line 1788 | |
| * it is on. The one returned when starting a worker with any of the | | * it is on. The one returned when starting a worker with any of the | |
| * functions ecore_thread_run() or ecore_thread_feedback_run() is an | | * functions ecore_thread_run() or ecore_thread_feedback_run() is an | |
| * identifier of that specific instance of the function and can be used fro
m | | * identifier of that specific instance of the function and can be used fro
m | |
| * the main loop with the ecore_thread_cancel() and ecore_thread_check() | | * the main loop with the ecore_thread_cancel() and ecore_thread_check() | |
| * functions. This handler must not be shared with the worker function | | * functions. This handler must not be shared with the worker function | |
| * function running in the thread. This same handler will be the one receiv
ed | | * function running in the thread. This same handler will be the one receiv
ed | |
| * on the @c end, @c cancel and @c feedback callbacks. | | * on the @c end, @c cancel and @c feedback callbacks. | |
| * | | * | |
| * The worker function, that's the one running in the thread, also receives | | * The worker function, that's the one running in the thread, also receives | |
| * an ::Ecore_Thread handler that can be used with ecore_thread_cancel() an
d | | * an ::Ecore_Thread handler that can be used with ecore_thread_cancel() an
d | |
|
| * ecore_thread_check(), sharing the flag with the main loop. But this | | *ecore_thread_check(), sharing the flag with the main loop. But this | |
| * handler is also associated with the thread where the function is running
. | | * handler is also associated with the thread where the function is running
. | |
| * This has strong implications when working with thread local data. | | * This has strong implications when working with thread local data. | |
| * | | * | |
| * There are two kinds of worker threads Ecore handles: simple, or short, | | * There are two kinds of worker threads Ecore handles: simple, or short, | |
| * workers and feedback workers. | | * workers and feedback workers. | |
| * | | * | |
| * The first kind is for simple functions that perform a | | * The first kind is for simple functions that perform a | |
| * usually small but time consuming task. Ecore will run this function in | | * usually small but time consuming task. Ecore will run this function in | |
| * a thread as soon as one becomes available and notify the calling user of | | * a thread as soon as one becomes available and notify the calling user of | |
| * its completion once the task is done. | | * its completion once the task is done. | |
| | | | |
| skipping to change at line 1589 | | skipping to change at line 1851 | |
| | | | |
| /** | | /** | |
| * Schedule a task to run in a parallel thread to avoid locking the main lo
op | | * Schedule a task to run in a parallel thread to avoid locking the main lo
op | |
| * | | * | |
| * @param func_blocking The function that should run in another thread. | | * @param func_blocking The function that should run in another thread. | |
| * @param func_end Function to call from main loop when @p func_blocking | | * @param func_end Function to call from main loop when @p func_blocking | |
| * completes its task successfully (may be NULL) | | * completes its task successfully (may be NULL) | |
| * @param func_cancel Function to call from main loop if the thread running | | * @param func_cancel Function to call from main loop if the thread running | |
| * @p func_blocking is cancelled or fails to start (may be NULL) | | * @p func_blocking is cancelled or fails to start (may be NULL) | |
| * @param data User context data to pass to all callbacks. | | * @param data User context data to pass to all callbacks. | |
|
| * @return A new thread handler, or NULL on failure | | * @return A new thread handler, or @c NULL on failure. | |
| * | | * | |
| * This function will try to create a new thread to run @p func_blocking in
, | | * This function will try to create a new thread to run @p func_blocking in
, | |
| * or if the maximum number of concurrent threads has been reached, will | | * or if the maximum number of concurrent threads has been reached, will | |
| * add it to the pending list, where it will wait until a thread becomes | | * add it to the pending list, where it will wait until a thread becomes | |
| * available. The return value will be an ::Ecore_Thread handle that can | | * available. The return value will be an ::Ecore_Thread handle that can | |
| * be used to cancel the thread before its completion. | | * be used to cancel the thread before its completion. | |
| * | | * | |
| * @note This function should always return immediately, but in the rare | | * @note This function should always return immediately, but in the rare | |
| * case that Ecore is built with no thread support, @p func_blocking will | | * case that Ecore is built with no thread support, @p func_blocking will | |
| * be called here, actually blocking the main loop. | | * be called here, actually blocking the main loop. | |
| | | | |
| skipping to change at line 1612 | | skipping to change at line 1874 | |
| * it finishes, then @p func_end is called from the thread containing the | | * it finishes, then @p func_end is called from the thread containing the | |
| * main loop to inform the user of its completion. While in @p func_blockin
g, | | * main loop to inform the user of its completion. While in @p func_blockin
g, | |
| * no functions from the EFL can be used, except for those from Eina that a
re | | * no functions from the EFL can be used, except for those from Eina that a
re | |
| * marked to be thread-safe. Even for the latter, caution needs to be taken | | * marked to be thread-safe. Even for the latter, caution needs to be taken | |
| * if the data is shared across several threads. | | * if the data is shared across several threads. | |
| * | | * | |
| * @p func_end will be called from the main thread when @p func_blocking en
ds, | | * @p func_end will be called from the main thread when @p func_blocking en
ds, | |
| * so here it's safe to use anything from the EFL freely. | | * so here it's safe to use anything from the EFL freely. | |
| * | | * | |
| * The thread can also be cancelled before its completion calling | | * The thread can also be cancelled before its completion calling | |
|
| * ecore_thread_cancel(), either from the main thread or @p func_blocking. | | *ecore_thread_cancel(), either from the main thread or @p func_blocking. | |
| * In this case, @p func_cancel will be called, also from the main thread | | * In this case, @p func_cancel will be called, also from the main thread | |
| * to inform of this happening. If the thread could not be created, this | | * to inform of this happening. If the thread could not be created, this | |
| * function will be called and it's @c thread parameter will be NULL. It's | | * function will be called and it's @c thread parameter will be NULL. It's | |
| * also safe to call any EFL function here, as it will be running in the | | * also safe to call any EFL function here, as it will be running in the | |
| * main thread. | | * main thread. | |
| * | | * | |
| * Inside @p func_blocking, it's possible to call ecore_thread_reschedule() | | * Inside @p func_blocking, it's possible to call ecore_thread_reschedule() | |
| * to tell Ecore that this function should be called again. | | * to tell Ecore that this function should be called again. | |
| * | | * | |
| * Be aware that no assumptions can be made about the order in which the | | * Be aware that no assumptions can be made about the order in which the | |
| | | | |
| skipping to change at line 1637 | | skipping to change at line 1899 | |
| * will be running at the same time. Ecore will schedule them based on the | | * will be running at the same time. Ecore will schedule them based on the | |
| * number of threads available for the particular system it's running in, | | * number of threads available for the particular system it's running in, | |
| * so some of the jobs started may be waiting until another one finishes | | * so some of the jobs started may be waiting until another one finishes | |
| * before it can execute its own @p func_blocking. | | * before it can execute its own @p func_blocking. | |
| * | | * | |
| * @see ecore_thread_feedback_run() | | * @see ecore_thread_feedback_run() | |
| * @see ecore_thread_cancel() | | * @see ecore_thread_cancel() | |
| * @see ecore_thread_reschedule() | | * @see ecore_thread_reschedule() | |
| * @see ecore_thread_max_set() | | * @see ecore_thread_max_set() | |
| */ | | */ | |
|
| EAPI Ecore_Thread * | | EAPI Ecore_Thread *ecore_thread_run(Ecore_Thread_Cb func_blocking, Ecore_Th | |
| ecore_thread_run(Ecore_Thread_Cb func_blocking, | | read_Cb func_end, Ecore_Thread_Cb func_cancel, const void *data); | |
| Ecore_Thread_Cb func_end, | | | |
| Ecore_Thread_Cb func_cancel, | | | |
| const void *data); | | | |
| /** | | /** | |
|
| * Launch a thread to run a task than can talk back to the main thread | | * Launch a thread to run a task that can talk back to the main thread | |
| * | | * | |
| * @param func_heavy The function that should run in another thread. | | * @param func_heavy The function that should run in another thread. | |
| * @param func_notify Function that receives the data sent from the thread | | * @param func_notify Function that receives the data sent from the thread | |
| * @param func_end Function to call from main loop when @p func_heavy | | * @param func_end Function to call from main loop when @p func_heavy | |
| * completes its task successfully | | * completes its task successfully | |
| * @param func_cancel Function to call from main loop if the thread running | | * @param func_cancel Function to call from main loop if the thread running | |
| * @p func_heavy is cancelled or fails to start | | * @p func_heavy is cancelled or fails to start | |
| * @param data User context data to pass to all callback. | | * @param data User context data to pass to all callback. | |
| * @param try_no_queue If you want to run outside of the thread pool. | | * @param try_no_queue If you want to run outside of the thread pool. | |
|
| * @return A new thread handler, or NULL on failure | | * @return A new thread handler, or @c NULL on failure. | |
| * | | * | |
| * See ecore_thread_run() for a general description of this function. | | * See ecore_thread_run() for a general description of this function. | |
| * | | * | |
| * The difference with the above is that ecore_thread_run() is meant for | | * The difference with the above is that ecore_thread_run() is meant for | |
| * tasks that don't need to communicate anything until they finish, while | | * tasks that don't need to communicate anything until they finish, while | |
| * this function is provided with a new callback, @p func_notify, that will | | * this function is provided with a new callback, @p func_notify, that will | |
| * be called from the main thread for every message sent from @p func_heavy | | * be called from the main thread for every message sent from @p func_heavy | |
| * with ecore_thread_feedback(). | | * with ecore_thread_feedback(). | |
| * | | * | |
| * Like with ecore_thread_run(), a new thread will be launched to run | | * Like with ecore_thread_run(), a new thread will be launched to run | |
|
| * @p func_heavy unless the maximum number of simultaneous threadas has bee
n | | * @p func_heavy unless the maximum number of simultaneous threads has been | |
| * reached, in which case the function will be scheduled to run whenever a | | * reached, in which case the function will be scheduled to run whenever a | |
| * running task ends and a thread becomes free. But if @p try_no_queue is | | * running task ends and a thread becomes free. But if @p try_no_queue is | |
| * set, Ecore will first try to launch a thread outside of the pool to run | | * set, Ecore will first try to launch a thread outside of the pool to run | |
| * the task. If it fails, it will revert to the normal behaviour of using a | | * the task. If it fails, it will revert to the normal behaviour of using a | |
| * thread from the pool as if @p try_no_queue had not been set. | | * thread from the pool as if @p try_no_queue had not been set. | |
| * | | * | |
| * Keep in mind that Ecore handles the thread pool based on the number of | | * Keep in mind that Ecore handles the thread pool based on the number of | |
| * CPUs available, but running a thread outside of the pool doesn't count f
or | | * CPUs available, but running a thread outside of the pool doesn't count f
or | |
| * this, so having too many of them may have drastic effects over the | | * this, so having too many of them may have drastic effects over the | |
| * program's performance. | | * program's performance. | |
| * | | * | |
| * @see ecore_thread_feedback() | | * @see ecore_thread_feedback() | |
| * @see ecore_thread_run() | | * @see ecore_thread_run() | |
| * @see ecore_thread_cancel() | | * @see ecore_thread_cancel() | |
| * @see ecore_thread_reschedule() | | * @see ecore_thread_reschedule() | |
| * @see ecore_thread_max_set() | | * @see ecore_thread_max_set() | |
| */ | | */ | |
|
| EAPI Ecore_Thread * | | EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy, Ec | |
| ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy, | | ore_Thread_Notify_Cb func_notify, | |
| Ecore_Thread_Notify_Cb func_notify, | | Ecore_Thread_Cb func_end, Ecor | |
| Ecore_Thread_Cb func_end, | | e_Thread_Cb func_cancel, | |
| Ecore_Thread_Cb func_cancel, | | const void *data, Eina_Bool tr | |
| const void *data, | | y_no_queue); | |
| Eina_Bool try_no_queue); | | | |
| /** | | /** | |
| * Cancel a running thread. | | * Cancel a running thread. | |
| * | | * | |
| * @param thread The thread to cancel. | | * @param thread The thread to cancel. | |
|
| * @return Will return EINA_TRUE if the thread has been cancelled, | | * @return Will return @c EINA_TRUE if the thread has been cancelled, | |
| * EINA_FALSE if it is pending. | | * @c EINA_FALSE if it is pending. | |
| * | | * | |
| * This function can be called both in the main loop or in the running thre
ad. | | * This function can be called both in the main loop or in the running thre
ad. | |
| * | | * | |
| * This function cancels a running thread. If @p thread can be immediately | | * This function cancels a running thread. If @p thread can be immediately | |
| * cancelled (it's still pending execution after creation or rescheduling), | | * cancelled (it's still pending execution after creation or rescheduling), | |
| * then the @c cancel callback will be called, @p thread will be freed and | | * then the @c cancel callback will be called, @p thread will be freed and | |
|
| * the function will return EINA_TRUE. | | * the function will return @c EINA_TRUE. | |
| * | | * | |
|
| * If the thread is already running, then this function returns EINA_FALSE | | * If the thread is already running, then this function returns @c EINA_FAL
SE | |
| * after marking the @p thread as pending cancellation. For the thread to | | * after marking the @p thread as pending cancellation. For the thread to | |
| * actually be terminated, it needs to return from the user function back | | * actually be terminated, it needs to return from the user function back | |
| * into Ecore control. This can happen in several ways: | | * into Ecore control. This can happen in several ways: | |
| * @li The function ends and returns normally. If it hadn't been cancelled, | | * @li The function ends and returns normally. If it hadn't been cancelled, | |
| * @c func_end would be called here, but instead @c func_cancel will happen
. | | * @c func_end would be called here, but instead @c func_cancel will happen
. | |
| * @li The function returns after requesting to be rescheduled with | | * @li The function returns after requesting to be rescheduled with | |
| * ecore_thread_reschedule(). | | * ecore_thread_reschedule(). | |
| * @li The function is prepared to leave early by checking if | | * @li The function is prepared to leave early by checking if | |
|
| * ecore_thread_check() returns EINA_TRUE. | | * ecore_thread_check() returns @c EINA_TRUE. | |
| * | | * | |
| * The user function can cancel itself by calling ecore_thread_cancel(), bu
t | | * The user function can cancel itself by calling ecore_thread_cancel(), bu
t | |
| * it should always use the ::Ecore_Thread handle passed to it and never | | * it should always use the ::Ecore_Thread handle passed to it and never | |
| * share it with the main loop thread by means of shared user data or any | | * share it with the main loop thread by means of shared user data or any | |
| * other way. | | * other way. | |
| * | | * | |
| * @p thread will be freed and should not be used again if this function | | * @p thread will be freed and should not be used again if this function | |
|
| * returns EINA_TRUE or after the @c func_cancel callback returns. | | * returns @c EINA_TRUE or after the @c func_cancel callback returns. | |
| * | | * | |
| * @see ecore_thread_check() | | * @see ecore_thread_check() | |
| */ | | */ | |
|
| EAPI Eina_Bool | | EAPI Eina_Bool ecore_thread_cancel(Ecore_Thread *thread); | |
| ecore_thread_cancel(Ecore_Thread *thread); | | | |
| /** | | /** | |
| * Checks if a thread is pending cancellation | | * Checks if a thread is pending cancellation | |
| * | | * | |
| * @param thread The thread to test. | | * @param thread The thread to test. | |
|
| * @return EINA_TRUE if the thread is pending cancellation, | | * @return @c EINA_TRUE if the thread is pending cancellation, | |
| * EINA_FALSE if it is not. | | * @c EINA_FALSE if it is not. | |
| * | | * | |
| * This function can be called both in the main loop or in the running thre
ad. | | * This function can be called both in the main loop or in the running thre
ad. | |
| * | | * | |
| * When ecore_thread_cancel() is called on an already running task, the | | * When ecore_thread_cancel() is called on an already running task, the | |
|
| * thread is marked as pending cancellation. This function returns EINA_TRU
E | | * thread is marked as pending cancellation. This function returns @c EINA_
TRUE | |
| * if this mark is set for the given @p thread and can be used from the | | * if this mark is set for the given @p thread and can be used from the | |
| * main loop thread to check if a still active thread has been cancelled, | | * main loop thread to check if a still active thread has been cancelled, | |
| * or from the user function running in the thread to check if it should | | * or from the user function running in the thread to check if it should | |
| * stop doing what it's doing and return early, effectively cancelling the | | * stop doing what it's doing and return early, effectively cancelling the | |
| * task. | | * task. | |
| * | | * | |
| * @see ecore_thread_cancel() | | * @see ecore_thread_cancel() | |
| */ | | */ | |
|
| EAPI Eina_Bool | | EAPI Eina_Bool ecore_thread_check(Ecore_Thread *thread); | |
| ecore_thread_check(Ecore_Thread *thread); | | | |
| /** | | /** | |
| * Sends data from the worker thread to the main loop | | * Sends data from the worker thread to the main loop | |
| * | | * | |
| * @param thread The current ::Ecore_Thread context to send data from | | * @param thread The current ::Ecore_Thread context to send data from | |
| * @param msg_data Data to be transmitted to the main loop | | * @param msg_data Data to be transmitted to the main loop | |
|
| * @return EINA_TRUE if @p msg_data was successfully sent to main loop, | | * @return @c EINA_TRUE if @p msg_data was successfully sent to main loop, | |
| * EINA_FALSE if anything goes wrong. | | * @c EINA_FALSE if anything goes wrong. | |
| * | | * | |
| * You should use this function only in the @c func_heavy call. | | * You should use this function only in the @c func_heavy call. | |
| * | | * | |
| * Only the address to @p msg_data will be sent and once this function | | * Only the address to @p msg_data will be sent and once this function | |
|
| * returns EINA_TRUE, the job running in the thread should never touch the | | * returns @c EINA_TRUE, the job running in the thread should never touch t
he | |
| * contents of it again. The data sent should be malloc()'ed or something | | * contents of it again. The data sent should be malloc()'ed or something | |
| * similar, as long as it's not memory local to the thread that risks being | | * similar, as long as it's not memory local to the thread that risks being | |
| * overwritten or deleted once it goes out of scope or the thread finishes. | | * overwritten or deleted once it goes out of scope or the thread finishes. | |
| * | | * | |
| * Care must be taken that @p msg_data is properly freed in the @c func_not
ify | | * Care must be taken that @p msg_data is properly freed in the @c func_not
ify | |
| * callback set when creating the thread. | | * callback set when creating the thread. | |
| * | | * | |
| * @see ecore_thread_feedback_run() | | * @see ecore_thread_feedback_run() | |
| */ | | */ | |
|
| EAPI Eina_Bool | | EAPI Eina_Bool ecore_thread_feedback(Ecore_Thread *thread, const void *msg_ | |
| ecore_thread_feedback(Ecore_Thread *thread, | | data); | |
| const void *msg_data); | | | |
| /** | | /** | |
| * Asks for the function in the thread to be called again at a later time | | * Asks for the function in the thread to be called again at a later time | |
| * | | * | |
| * @param thread The current ::Ecore_Thread context to rescheduled | | * @param thread The current ::Ecore_Thread context to rescheduled | |
|
| * @return EINA_TRUE if the task was successfully rescheduled, | | * @return @c EINA_TRUE if the task was successfully rescheduled, | |
| * EINA_FALSE if anything goes wrong. | | * @c EINA_FALSE if anything goes wrong. | |
| * | | * | |
| * This function should be called only from the same function represented | | * This function should be called only from the same function represented | |
|
| * by @pthread. | | * by @p thread. | |
| * | | * | |
| * Calling this function will mark the thread for a reschedule, so as soon | | * Calling this function will mark the thread for a reschedule, so as soon | |
| * as it returns, it will be added to the end of the list of pending tasks. | | * as it returns, it will be added to the end of the list of pending tasks. | |
| * If no other tasks are waiting or there are sufficient threads available, | | * If no other tasks are waiting or there are sufficient threads available, | |
| * the rescheduled task will be launched again immediately. | | * the rescheduled task will be launched again immediately. | |
| * | | * | |
|
| * This should never return EINA_FALSE, unless it was called from the wrong | | * This should never return @c EINA_FALSE, unless it was called from the wr
ong | |
| * thread or with the wrong arguments. | | * thread or with the wrong arguments. | |
| * | | * | |
| * The @c func_end callback set when the thread is created will not be | | * The @c func_end callback set when the thread is created will not be | |
| * called until the function in the thread returns without being reschedule
d. | | * called until the function in the thread returns without being reschedule
d. | |
| * Similarly, if the @p thread is cancelled, the reschedule will not take | | * Similarly, if the @p thread is cancelled, the reschedule will not take | |
| * effect. | | * effect. | |
| */ | | */ | |
|
| EAPI Eina_Bool | | EAPI Eina_Bool ecore_thread_reschedule(Ecore_Thread *thread); | |
| ecore_thread_reschedule(Ecore_Thread *thread); | | | |
| /** | | /** | |
| * Gets the number of active threads running jobs | | * Gets the number of active threads running jobs | |
| * | | * | |
| * @return Number of active threads running jobs | | * @return Number of active threads running jobs | |
| * | | * | |
| * This returns the number of threads currently running jobs of any type | | * This returns the number of threads currently running jobs of any type | |
| * through the Ecore_Thread API. | | * through the Ecore_Thread API. | |
| * | | * | |
| * @note Jobs started through the ecore_thread_feedback_run() function with | | * @note Jobs started through the ecore_thread_feedback_run() function with | |
|
| * the @c try_no_queue parameter set to EINA_TRUE will not be accounted for | | * the @c try_no_queue parameter set to @c EINA_TRUE will not be accounted
for | |
| * in the return of this function unless the thread creation fails and it | | * in the return of this function unless the thread creation fails and it | |
| * falls back to using one from the pool. | | * falls back to using one from the pool. | |
| */ | | */ | |
|
| EAPI int | | EAPI int ecore_thread_active_get(void); | |
| ecore_thread_active_get(void); | | | |
| /** | | /** | |
| * Gets the number of short jobs waiting for a thread to run | | * Gets the number of short jobs waiting for a thread to run | |
| * | | * | |
| * @return Number of pending threads running "short" jobs | | * @return Number of pending threads running "short" jobs | |
| * | | * | |
| * This returns the number of tasks started with ecore_thread_run() that ar
e | | * This returns the number of tasks started with ecore_thread_run() that ar
e | |
| * pending, waiting for a thread to become available to run them. | | * pending, waiting for a thread to become available to run them. | |
| */ | | */ | |
|
| EAPI int | | EAPI int ecore_thread_pending_get(void); | |
| ecore_thread_pending_get(void); | | | |
| /** | | /** | |
| * Gets the number of feedback jobs waiting for a thread to run | | * Gets the number of feedback jobs waiting for a thread to run | |
| * | | * | |
| * @return Number of pending threads running "feedback" jobs | | * @return Number of pending threads running "feedback" jobs | |
| * | | * | |
| * This returns the number of tasks started with ecore_thread_feedback_run(
) | | * This returns the number of tasks started with ecore_thread_feedback_run(
) | |
| * that are pending, waiting for a thread to become available to run them. | | * that are pending, waiting for a thread to become available to run them. | |
| */ | | */ | |
|
| EAPI int | | EAPI int ecore_thread_pending_feedback_get(void); | |
| ecore_thread_pending_feedback_get(void); | | | |
| /** | | /** | |
| * Gets the total number of pending jobs | | * Gets the total number of pending jobs | |
| * | | * | |
| * @return Number of pending threads running jobs | | * @return Number of pending threads running jobs | |
| * | | * | |
| * Same as the sum of ecore_thread_pending_get() and | | * Same as the sum of ecore_thread_pending_get() and | |
|
| * ecore_thread_pending_feedback_get(). | | *ecore_thread_pending_feedback_get(). | |
| */ | | */ | |
|
| EAPI int | | EAPI int ecore_thread_pending_total_get(void); | |
| ecore_thread_pending_total_get(void); | | | |
| /** | | /** | |
| * Gets the maximum number of threads that can run simultaneously | | * Gets the maximum number of threads that can run simultaneously | |
| * | | * | |
| * @return Max possible number of Ecore_Thread's running concurrently | | * @return Max possible number of Ecore_Thread's running concurrently | |
| * | | * | |
| * This returns the maximum number of Ecore_Thread's that may be running at | | * This returns the maximum number of Ecore_Thread's that may be running at | |
| * the same time. If this number is reached, new jobs started by either | | * the same time. If this number is reached, new jobs started by either | |
|
| * ecore_thread_run() or ecore_thread_feedback_run() will be added to the | | *ecore_thread_run() or ecore_thread_feedback_run() will be added to the | |
| * respective pending queue until one of the running threads finishes its | | * respective pending queue until one of the running threads finishes its | |
| * task and becomes available to run a new one. | | * task and becomes available to run a new one. | |
| * | | * | |
| * By default, this will be the number of available CPUs for the | | * By default, this will be the number of available CPUs for the | |
| * running program (as returned by eina_cpu_count()), or 1 if this value | | * running program (as returned by eina_cpu_count()), or 1 if this value | |
| * could not be fetched. | | * could not be fetched. | |
| * | | * | |
| * @see ecore_thread_max_set() | | * @see ecore_thread_max_set() | |
| * @see ecore_thread_max_reset() | | * @see ecore_thread_max_reset() | |
| */ | | */ | |
|
| EAPI int | | EAPI int ecore_thread_max_get(void); | |
| ecore_thread_max_get(void); | | | |
| /** | | /** | |
| * Sets the maximum number of threads allowed to run simultaneously | | * Sets the maximum number of threads allowed to run simultaneously | |
| * | | * | |
| * @param num The new maximum | | * @param num The new maximum | |
| * | | * | |
| * This sets a new value for the maximum number of concurrently running | | * This sets a new value for the maximum number of concurrently running | |
| * Ecore_Thread's. It @b must an integer between 1 and (2 * @c x), where @c
x | | * Ecore_Thread's. It @b must an integer between 1 and (2 * @c x), where @c
x | |
| * is the number for CPUs available. | | * is the number for CPUs available. | |
| * | | * | |
| * @see ecore_thread_max_get() | | * @see ecore_thread_max_get() | |
| * @see ecore_thread_max_reset() | | * @see ecore_thread_max_reset() | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_thread_max_set(int num); | |
| ecore_thread_max_set(int num); | | | |
| /** | | /** | |
| * Resets the maximum number of concurrently running threads to the default | | * Resets the maximum number of concurrently running threads to the default | |
| * | | * | |
| * This resets the value returned by ecore_thread_max_get() back to its | | * This resets the value returned by ecore_thread_max_get() back to its | |
| * default. | | * default. | |
| * | | * | |
| * @see ecore_thread_max_get() | | * @see ecore_thread_max_get() | |
| * @see ecore_thread_max_set() | | * @see ecore_thread_max_set() | |
| */ | | */ | |
|
| EAPI void | | EAPI void ecore_thread_max_reset(void); | |
| ecore_thread_max_reset(void); | | | |
| /** | | /** | |
| * Gets the number of threads available for running tasks | | * Gets the number of threads available for running tasks | |
| * | | * | |
| * @return The number of available threads | | * @return The number of available threads | |
| * | | * | |
| * Same as doing ecore_thread_max_get() - ecore_thread_active_get(). | | * Same as doing ecore_thread_max_get() - ecore_thread_active_get(). | |
| * | | * | |
| * This function may return a negative number only in the case the user | | * This function may return a negative number only in the case the user | |
| * changed the maximum number of running threads while other tasks are | | * changed the maximum number of running threads while other tasks are | |
| * running. | | * running. | |
| */ | | */ | |
|
| EAPI int | | EAPI int ecore_thread_available_get(void); | |
| ecore_thread_available_get(void); | | | |
| /** | | /** | |
| * Adds some data to a hash local to the thread | | * Adds some data to a hash local to the thread | |
| * | | * | |
| * @param thread The thread context the data belongs to | | * @param thread The thread context the data belongs to | |
| * @param key The name under which the data will be stored | | * @param key The name under which the data will be stored | |
| * @param value The data to add | | * @param value The data to add | |
| * @param cb Function to free the data when removed from the hash | | * @param cb Function to free the data when removed from the hash | |
| * @param direct If true, this will not copy the key string (like | | * @param direct If true, this will not copy the key string (like | |
| * eina_hash_direct_add()) | | * eina_hash_direct_add()) | |
|
| * @return EINA_TRUE on success, EINA_FALSE on failure | | * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. | |
| * | | * | |
| * Ecore Thread has a mechanism to share data across several worker functio
ns | | * Ecore Thread has a mechanism to share data across several worker functio
ns | |
| * that run on the same system thread. That is, the data is stored per | | * that run on the same system thread. That is, the data is stored per | |
| * thread and for a worker function to have access to it, it must be run | | * thread and for a worker function to have access to it, it must be run | |
| * by the same thread that stored the data. | | * by the same thread that stored the data. | |
| * | | * | |
| * When there are no more workers pending, the thread will be destroyed | | * When there are no more workers pending, the thread will be destroyed | |
| * along with the internal hash and any data left in it will be freed with | | * along with the internal hash and any data left in it will be freed with | |
| * the @p cb function given. | | * the @p cb function given. | |
| * | | * | |
| | | | |
| skipping to change at line 1962 | | skipping to change at line 2203 | |
| * new one has been spared. When no more workers exist, the thread is | | * new one has been spared. When no more workers exist, the thread is | |
| * destroyed and the callback used when saving the connection will be calle
d | | * destroyed and the callback used when saving the connection will be calle
d | |
| * to close it. | | * to close it. | |
| * | | * | |
| * This function adds the data @p value to the thread data under the given | | * This function adds the data @p value to the thread data under the given | |
| * @p key. | | * @p key. | |
| * No other value in the hash may have the same @p key. If you need to | | * No other value in the hash may have the same @p key. If you need to | |
| * change the value under a @p key, or you don't know if one exists already
, | | * change the value under a @p key, or you don't know if one exists already
, | |
| * you can use ecore_thread_local_data_set(). | | * you can use ecore_thread_local_data_set(). | |
| * | | * | |
|
| * Neither @p key nor @p value may be NULL and @p key will be copied in the | | * Neither @p key nor @p value may be @c NULL and @p key will be copied in
the | |
| * hash, unless @p direct is set, in which case the string used should not | | * hash, unless @p direct is set, in which case the string used should not | |
| * be freed until the data is removed from the hash. | | * be freed until the data is removed from the hash. | |
| * | | * | |
| * The @p cb function will be called when the data in the hash needs to be | | * The @p cb function will be called when the data in the hash needs to be | |
| * freed, be it because it got deleted with ecore_thread_local_data_del() o
r | | * freed, be it because it got deleted with ecore_thread_local_data_del() o
r | |
| * because @p thread was terminated and the hash destroyed. This parameter | | * because @p thread was terminated and the hash destroyed. This parameter | |
| * may be NULL, in which case @p value needs to be manually freed after | | * may be NULL, in which case @p value needs to be manually freed after | |
| * removing it from the hash with either ecore_thread_local_data_del() or | | * removing it from the hash with either ecore_thread_local_data_del() or | |
| * ecore_thread_local_data_set(), but it's very unlikely that this is what | | * ecore_thread_local_data_set(), but it's very unlikely that this is what | |
| * you want. | | * you want. | |
| * | | * | |
| * This function, and all of the others in the @c ecore_thread_local_data | | * This function, and all of the others in the @c ecore_thread_local_data | |
| * family of functions, can only be called within the worker function runni
ng | | * family of functions, can only be called within the worker function runni
ng | |
| * in the thread. Do not call them from the main loop or from a thread | | * in the thread. Do not call them from the main loop or from a thread | |
| * other than the one represented by @p thread. | | * other than the one represented by @p thread. | |
| * | | * | |
| * @see ecore_thread_local_data_set() | | * @see ecore_thread_local_data_set() | |
| * @see ecore_thread_local_data_find() | | * @see ecore_thread_local_data_find() | |
| * @see ecore_thread_local_data_del() | | * @see ecore_thread_local_data_del() | |
| */ | | */ | |
|
| EAPI Eina_Bool | | EAPI Eina_Bool ecore_thread_local_data_add(Ecore_Thread *thread, const char | |
| ecore_thread_local_data_add(Ecore_Thread *thread, | | *key, void *value, | |
| const char *key, | | Eina_Free_Cb cb, Eina_Bool direc | |
| void *value, | | t); | |
| Eina_Free_Cb cb, | | | |
| Eina_Bool direct); | | | |
| /** | | /** | |
| * Sets some data in the hash local to the given thread | | * Sets some data in the hash local to the given thread | |
| * | | * | |
| * @param thread The thread context the data belongs to | | * @param thread The thread context the data belongs to | |
| * @param key The name under which the data will be stored | | * @param key The name under which the data will be stored | |
| * @param value The data to add | | * @param value The data to add | |
| * @param cb Function to free the data when removed from the hash | | * @param cb Function to free the data when removed from the hash | |
| * | | * | |
| * If no data exists in the hash under the @p key, this function adds | | * If no data exists in the hash under the @p key, this function adds | |
| * @p value in the hash under the given @p key and returns NULL. | | * @p value in the hash under the given @p key and returns NULL. | |
| * The key itself is copied. | | * The key itself is copied. | |
| * | | * | |
| * If the hash already contains something under @p key, the data will be | | * If the hash already contains something under @p key, the data will be | |
| * replaced by @p value and the old value will be returned. | | * replaced by @p value and the old value will be returned. | |
| * | | * | |
|
| * NULL will also be returned if either @p key or @p value are NULL, or if | | * @c NULL will also be returned if either @p key or @p value are @c NULL, | |
| * an error occurred. | | or | |
| | | * if an error occurred. | |
| * | | * | |
| * This function, and all of the others in the @c ecore_thread_local_data | | * This function, and all of the others in the @c ecore_thread_local_data | |
| * family of functions, can only be called within the worker function runni
ng | | * family of functions, can only be called within the worker function runni
ng | |
| * in the thread. Do not call them from the main loop or from a thread | | * in the thread. Do not call them from the main loop or from a thread | |
| * other than the one represented by @p thread. | | * other than the one represented by @p thread. | |
| * | | * | |
| * @see ecore_thread_local_data_add() | | * @see ecore_thread_local_data_add() | |
| * @see ecore_thread_local_data_del() | | * @see ecore_thread_local_data_del() | |
| * @see ecore_thread_local_data_find() | | * @see ecore_thread_local_data_find() | |
| */ | | */ | |
|
| EAPI void * | | EAPI void *ecore_thread_local_data_set(Ecore_Thread *thread, const char *ke | |
| ecore_thread_local_data_set(Ecore_Thread *thread, | | y, void *value, Eina_Free_Cb cb); | |
| const char *key, | | | |
| void *value, | | | |
| Eina_Free_Cb cb); | | | |
| /** | | /** | |
| * Gets data stored in the hash local to the given thread | | * Gets data stored in the hash local to the given thread | |
| * | | * | |
| * @param thread The thread context the data belongs to | | * @param thread The thread context the data belongs to | |
| * @param key The name under which the data is stored | | * @param key The name under which the data is stored | |
|
| * @return The value under the given key, or NULL on error | | * @return The value under the given key, or @c NULL on error. | |
| * | | * | |
| * Finds and return the data stored in the shared hash under the key @p key
. | | * Finds and return the data stored in the shared hash under the key @p key
. | |
| * | | * | |
| * This function, and all of the others in the @c ecore_thread_local_data | | * This function, and all of the others in the @c ecore_thread_local_data | |
| * family of functions, can only be called within the worker function runni
ng | | * family of functions, can only be called within the worker function runni
ng | |
| * in the thread. Do not call them from the main loop or from a thread | | * in the thread. Do not call them from the main loop or from a thread | |
| * other than the one represented by @p thread. | | * other than the one represented by @p thread. | |
| * | | * | |
| * @see ecore_thread_local_data_add() | | * @see ecore_thread_local_data_add() | |
| * @see ecore_thread_local_data_wait() | | * @see ecore_thread_local_data_wait() | |
| */ | | */ | |
|
| EAPI void * | | EAPI void *ecore_thread_local_data_find(Ecore_Thread *thread, const char *k | |
| ecore_thread_local_data_find(Ecore_Thread *thread, | | ey); | |
| const char *key); | | | |
| /** | | /** | |
| * Deletes from the thread's hash the data corresponding to the given key | | * Deletes from the thread's hash the data corresponding to the given key | |
| * | | * | |
| * @param thread The thread context the data belongs to | | * @param thread The thread context the data belongs to | |
| * @param key The name under which the data is stored | | * @param key The name under which the data is stored | |
|
| * @return EINA_TRUE on success, EINA_FALSE on failure | | * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. | |
| * | | * | |
| * If there's any data stored associated with @p key in the global hash, | | * If there's any data stored associated with @p key in the global hash, | |
|
| * this function will remove it from it and return EINA_TRUE. If no data | | * this function will remove it from it and return @c EINA_TRUE. If no data | |
| * exists or an error occurs, it returns EINA_FALSE. | | * exists or an error occurs, it returns @c EINA_FALSE. | |
| * | | * | |
| * If the data was added to the hash with a free function, then it will | | * If the data was added to the hash with a free function, then it will | |
| * also be freed after removing it from the hash, otherwise it requires | | * also be freed after removing it from the hash, otherwise it requires | |
| * to be manually freed by the user, which means that if no other reference | | * to be manually freed by the user, which means that if no other reference | |
| * to it exists before calling this function, it will result in a memory | | * to it exists before calling this function, it will result in a memory | |
| * leak. | | * leak. | |
| * | | * | |
| * This function, and all of the others in the @c ecore_thread_local_data | | * This function, and all of the others in the @c ecore_thread_local_data | |
| * family of functions, can only be called within the worker function runni
ng | | * family of functions, can only be called within the worker function runni
ng | |
| * in the thread. Do not call them from the main loop or from a thread | | * in the thread. Do not call them from the main loop or from a thread | |
| * other than the one represented by @p thread. | | * other than the one represented by @p thread. | |
| * | | * | |
| * @see ecore_thread_local_data_add() | | * @see ecore_thread_local_data_add() | |
| */ | | */ | |
|
| EAPI Eina_Bool | | EAPI Eina_Bool ecore_thread_local_data_del(Ecore_Thread *thread, const char | |
| ecore_thread_local_data_del(Ecore_Thread *thread, | | *key); | |
| const char *key); | | | |
| | | | |
| /** | | /** | |
| * Adds some data to a hash shared by all threads | | * Adds some data to a hash shared by all threads | |
| * | | * | |
| * @param key The name under which the data will be stored | | * @param key The name under which the data will be stored | |
| * @param value The data to add | | * @param value The data to add | |
| * @param cb Function to free the data when removed from the hash | | * @param cb Function to free the data when removed from the hash | |
| * @param direct If true, this will not copy the key string (like | | * @param direct If true, this will not copy the key string (like | |
| * eina_hash_direct_add()) | | * eina_hash_direct_add()) | |
|
| * @return EINA_TRUE on success, EINA_FALSE on failure | | * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. | |
| * | | * | |
| * Ecore Thread keeps a hash that can be used to share data across several | | * Ecore Thread keeps a hash that can be used to share data across several | |
| * threads, including the main loop one, without having to manually handle | | * threads, including the main loop one, without having to manually handle | |
| * mutexes to do so safely. | | * mutexes to do so safely. | |
| * | | * | |
| * This function adds the data @p value to this hash under the given @p key
. | | * This function adds the data @p value to this hash under the given @p key
. | |
| * No other value in the hash may have the same @p key. If you need to | | * No other value in the hash may have the same @p key. If you need to | |
| * change the value under a @p key, or you don't know if one exists already
, | | * change the value under a @p key, or you don't know if one exists already
, | |
| * you can use ecore_thread_global_data_set(). | | * you can use ecore_thread_global_data_set(). | |
| * | | * | |
|
| * Neither @p key nor @p value may be NULL and @p key will be copied in the | | * Neither @p key nor @p value may be @c NULL and @p key will be copied in
the | |
| * hash, unless @p direct is set, in which case the string used should not | | * hash, unless @p direct is set, in which case the string used should not | |
| * be freed until the data is removed from the hash. | | * be freed until the data is removed from the hash. | |
| * | | * | |
| * The @p cb function will be called when the data in the hash needs to be | | * The @p cb function will be called when the data in the hash needs to be | |
| * freed, be it because it got deleted with ecore_thread_global_data_del()
or | | * freed, be it because it got deleted with ecore_thread_global_data_del()
or | |
| * because Ecore Thread was shut down and the hash destroyed. This paramete
r | | * because Ecore Thread was shut down and the hash destroyed. This paramete
r | |
| * may be NULL, in which case @p value needs to be manually freed after | | * may be NULL, in which case @p value needs to be manually freed after | |
| * removing it from the hash with either ecore_thread_global_data_del() or | | * removing it from the hash with either ecore_thread_global_data_del() or | |
|
| * ecore_thread_global_data_set(). | | *ecore_thread_global_data_set(). | |
| * | | * | |
| * Manually freeing any data that was added to the hash with a @p cb functi
on | | * Manually freeing any data that was added to the hash with a @p cb functi
on | |
| * is likely to produce a segmentation fault, or any other strange | | * is likely to produce a segmentation fault, or any other strange | |
| * happenings, later on in the program. | | * happenings, later on in the program. | |
| * | | * | |
| * @see ecore_thread_global_data_del() | | * @see ecore_thread_global_data_del() | |
| * @see ecore_thread_global_data_set() | | * @see ecore_thread_global_data_set() | |
| * @see ecore_thread_global_data_find() | | * @see ecore_thread_global_data_find() | |
| */ | | */ | |
|
| EAPI Eina_Bool | | EAPI Eina_Bool ecore_thread_global_data_add(const char *key, void *value, E | |
| ecore_thread_global_data_add(const char *key, | | ina_Free_Cb cb, Eina_Bool direct); | |
| void *value, | | | |
| Eina_Free_Cb cb, | | | |
| Eina_Bool direct); | | | |
| /** | | /** | |
| * Sets some data in the hash shared by all threads | | * Sets some data in the hash shared by all threads | |
| * | | * | |
| * @param key The name under which the data will be stored | | * @param key The name under which the data will be stored | |
| * @param value The data to add | | * @param value The data to add | |
| * @param cb Function to free the data when removed from the hash | | * @param cb Function to free the data when removed from the hash | |
| * | | * | |
| * If no data exists in the hash under the @p key, this function adds | | * If no data exists in the hash under the @p key, this function adds | |
| * @p value in the hash under the given @p key and returns NULL. | | * @p value in the hash under the given @p key and returns NULL. | |
| * The key itself is copied. | | * The key itself is copied. | |
| * | | * | |
| * If the hash already contains something under @p key, the data will be | | * If the hash already contains something under @p key, the data will be | |
| * replaced by @p value and the old value will be returned. | | * replaced by @p value and the old value will be returned. | |
| * | | * | |
|
| * NULL will also be returned if either @p key or @p value are NULL, or if | | * @c NULL will also be returned if either @p key or @p value are @c NULL, | |
| * an error occurred. | | or | |
| | | * if an error occurred. | |
| * | | * | |
| * @see ecore_thread_global_data_add() | | * @see ecore_thread_global_data_add() | |
| * @see ecore_thread_global_data_del() | | * @see ecore_thread_global_data_del() | |
| * @see ecore_thread_global_data_find() | | * @see ecore_thread_global_data_find() | |
| */ | | */ | |
|
| EAPI void * | | EAPI void *ecore_thread_global_data_set(const char *key, void *value, Eina_ | |
| ecore_thread_global_data_set(const char *key, | | Free_Cb cb); | |
| void *value, | | | |
| Eina_Free_Cb cb); | | | |
| /** | | /** | |
| * Gets data stored in the hash shared by all threads | | * Gets data stored in the hash shared by all threads | |
| * | | * | |
| * @param key The name under which the data is stored | | * @param key The name under which the data is stored | |
|
| * @return The value under the given key, or NULL on error | | * @return The value under the given key, or @c NULL on error. | |
| * | | * | |
| * Finds and return the data stored in the shared hash under the key @p key
. | | * Finds and return the data stored in the shared hash under the key @p key
. | |
| * | | * | |
| * Keep in mind that the data returned may be used by more than one thread | | * Keep in mind that the data returned may be used by more than one thread | |
| * at the same time and no reference counting is done on it by Ecore. | | * at the same time and no reference counting is done on it by Ecore. | |
| * Freeing the data or modifying its contents may require additional | | * Freeing the data or modifying its contents may require additional | |
| * precautions to be considered, depending on the application's design. | | * precautions to be considered, depending on the application's design. | |
| * | | * | |
| * @see ecore_thread_global_data_add() | | * @see ecore_thread_global_data_add() | |
| * @see ecore_thread_global_data_wait() | | * @see ecore_thread_global_data_wait() | |
| */ | | */ | |
|
| EAPI void * | | EAPI void *ecore_thread_global_data_find(const char *key); | |
| ecore_thread_global_data_find(const char *key); | | | |
| /** | | /** | |
| * Deletes from the shared hash the data corresponding to the given key | | * Deletes from the shared hash the data corresponding to the given key | |
| * | | * | |
| * @param key The name under which the data is stored | | * @param key The name under which the data is stored | |
|
| * @return EINA_TRUE on success, EINA_FALSE on failure | | * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. | |
| * | | * | |
| * If there's any data stored associated with @p key in the global hash, | | * If there's any data stored associated with @p key in the global hash, | |
|
| * this function will remove it from it and return EINA_TRUE. If no data | | * this function will remove it from it and return @c EINA_TRUE. If no data | |
| * exists or an error occurs, it returns EINA_FALSE. | | * exists or an error occurs, it returns @c EINA_FALSE. | |
| * | | * | |
| * If the data was added to the hash with a free function, then it will | | * If the data was added to the hash with a free function, then it will | |
| * also be freed after removing it from the hash, otherwise it requires | | * also be freed after removing it from the hash, otherwise it requires | |
| * to be manually freed by the user, which means that if no other reference | | * to be manually freed by the user, which means that if no other reference | |
| * to it exists before calling this function, it will result in a memory | | * to it exists before calling this function, it will result in a memory | |
| * leak. | | * leak. | |
| * | | * | |
| * Note, also, that freeing data that other threads may be using will resul
t | | * Note, also, that freeing data that other threads may be using will resul
t | |
| * in a crash, so appropriate care must be taken by the application when | | * in a crash, so appropriate care must be taken by the application when | |
| * that possibility exists. | | * that possibility exists. | |
| * | | * | |
| * @see ecore_thread_global_data_add() | | * @see ecore_thread_global_data_add() | |
| */ | | */ | |
|
| EAPI Eina_Bool | | EAPI Eina_Bool ecore_thread_global_data_del(const char *key); | |
| ecore_thread_global_data_del(const char *key); | | | |
| /** | | /** | |
| * Gets data stored in the shared hash, or wait for it if it doesn't exist | | * Gets data stored in the shared hash, or wait for it if it doesn't exist | |
| * | | * | |
| * @param key The name under which the data is stored | | * @param key The name under which the data is stored | |
| * @param seconds The amount of time in seconds to wait for the data. | | * @param seconds The amount of time in seconds to wait for the data. | |
|
| * @return The value under the given key, or NULL on error | | * @return The value under the given key, or @c NULL on error. | |
| * | | * | |
| * Finds and return the data stored in the shared hash under the key @p key
. | | * Finds and return the data stored in the shared hash under the key @p key
. | |
| * | | * | |
| * If there's nothing in the hash under the given @p key, the function | | * If there's nothing in the hash under the given @p key, the function | |
| * will block and wait up to @p seconds seconds for some other thread to | | * will block and wait up to @p seconds seconds for some other thread to | |
| * add it with either ecore_thread_global_data_add() or | | * add it with either ecore_thread_global_data_add() or | |
| * ecore_thread_global_data_set(). If after waiting there's still no data | | * ecore_thread_global_data_set(). If after waiting there's still no data | |
|
| * to get, NULL will be returned. | | * to get, @c NULL will be returned. | |
| * | | * | |
| * If @p seconds is 0, then no waiting will happen and this function works | | * If @p seconds is 0, then no waiting will happen and this function works | |
| * like ecore_thread_global_data_find(). If @p seconds is less than 0, then | | * like ecore_thread_global_data_find(). If @p seconds is less than 0, then | |
| * the function will wait indefinitely. | | * the function will wait indefinitely. | |
| * | | * | |
| * Keep in mind that the data returned may be used by more than one thread | | * Keep in mind that the data returned may be used by more than one thread | |
| * at the same time and no reference counting is done on it by Ecore. | | * at the same time and no reference counting is done on it by Ecore. | |
| * Freeing the data or modifying its contents may require additional | | * Freeing the data or modifying its contents may require additional | |
| * precautions to be considered, depending on the application's design. | | * precautions to be considered, depending on the application's design. | |
| * | | * | |
| * @see ecore_thread_global_data_add() | | * @see ecore_thread_global_data_add() | |
| * @see ecore_thread_global_data_find() | | * @see ecore_thread_global_data_find() | |
| */ | | */ | |
|
| EAPI void * | | EAPI void *ecore_thread_global_data_wait(const char *key, double seconds); | |
| ecore_thread_global_data_wait(const char *key, | | | |
| double seconds); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Pipe_Group Pipe wrapper | | * @defgroup Ecore_Pipe_Group Pipe wrapper | |
| * | | * | |
| * These functions wrap the pipe / write / read functions to easily | | * These functions wrap the pipe / write / read functions to easily | |
| * integrate its use into ecore's main loop. | | * integrate its use into ecore's main loop. | |
| | | | |
| skipping to change at line 2243 | | skipping to change at line 2461 | |
| */ | | */ | |
| | | | |
| typedef struct _Ecore_Pipe Ecore_Pipe; /**< A handle for pipes */ | | typedef struct _Ecore_Pipe Ecore_Pipe; /**< A handle for pipes */ | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Pipe_Cb Ecore_Pipe_Cb | | * @typedef Ecore_Pipe_Cb Ecore_Pipe_Cb | |
| * The callback that data written to the pipe is sent to. | | * The callback that data written to the pipe is sent to. | |
| */ | | */ | |
| typedef void (*Ecore_Pipe_Cb)(void *data, void *buffer, unsigned int nbyte)
; | | typedef void (*Ecore_Pipe_Cb)(void *data, void *buffer, unsigned int nbyte)
; | |
| | | | |
|
| EAPI Ecore_Pipe * | | EAPI Ecore_Pipe *ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data); | |
| ecore_pipe_add(Ecore_Pipe_Cb handler, | | EAPI void *ecore_pipe_del(Ecore_Pipe *p); | |
| const void *data); | | EAPI Eina_Bool ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned | |
| EAPI void * | | int nbytes); | |
| ecore_pipe_del(Ecore_Pipe *p); | | EAPI void ecore_pipe_write_close(Ecore_Pipe *p); | |
| EAPI Eina_Bool | | EAPI void ecore_pipe_read_close(Ecore_Pipe *p); | |
| ecore_pipe_write(Ecore_Pipe *p, | | EAPI void ecore_pipe_thaw(Ecore_Pipe *p); | |
| const void *buffer, | | EAPI void ecore_pipe_freeze(Ecore_Pipe *p); | |
| unsigned int nbytes); | | EAPI int ecore_pipe_wait(Ecore_Pipe *p, int message_count, double wait); | |
| EAPI void | | | |
| ecore_pipe_write_close(Ecore_Pipe *p); | | | |
| EAPI void | | | |
| ecore_pipe_read_close(Ecore_Pipe *p); | | | |
| EAPI void | | | |
| ecore_pipe_thaw(Ecore_Pipe *p); | | | |
| EAPI void | | | |
| ecore_pipe_freeze(Ecore_Pipe *p); | | | |
| EAPI int | | | |
| ecore_pipe_wait(Ecore_Pipe *p, | | | |
| int message_count, | | | |
| double wait); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Job_Group Ecore Job functions | | * @defgroup Ecore_Job_Group Ecore Job functions | |
| * | | * | |
| * You can queue jobs that are to be done by the main loop when the | | * You can queue jobs that are to be done by the main loop when the | |
| * current event is dealt with. | | * current event is dealt with. | |
| * | | * | |
| * Jobs are processed by the main loop similarly to events. They | | * Jobs are processed by the main loop similarly to events. They | |
| * also will be executed in the order in which they were added. | | * also will be executed in the order in which they were added. | |
| * | | * | |
| * A good use for them is when you don't want to execute an action | | * A good use for them is when you don't want to execute an action | |
|
| * immeditately, but want to give the control back to the main loop | | * immediately, but want to give the control back to the main loop | |
| * so that it will call your job callback when jobs start being | | * so that it will call your job callback when jobs start being | |
| * processed (and if there are other jobs added before yours, they | | * processed (and if there are other jobs added before yours, they | |
| * will be processed first). This also gives the chance to other | | * will be processed first). This also gives the chance to other | |
| * actions in your program to cancel the job before it is started. | | * actions in your program to cancel the job before it is started. | |
| * | | * | |
|
| * Examples of using @ref Ecore_Job: | | * Examples of using @ref Ecore_Job : | |
| * @li @ref ecore_job_example_c | | * @li @ref ecore_job_example_c | |
| * | | * | |
| * @ingroup Ecore_Main_Loop_Group | | * @ingroup Ecore_Main_Loop_Group | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| typedef struct _Ecore_Job Ecore_Job; /**< A job handle */ | | typedef struct _Ecore_Job Ecore_Job; /**< A job handle */ | |
| | | | |
|
| EAPI Ecore_Job * | | EAPI Ecore_Job *ecore_job_add(Ecore_Cb func, const void *data); | |
| ecore_job_add(Ecore_Cb func, | | EAPI void *ecore_job_del(Ecore_Job *job); | |
| const void *data); | | | |
| EAPI void * | | | |
| ecore_job_del(Ecore_Job *job); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Application_Group Ecore Application functions | | * @defgroup Ecore_Application_Group Ecore Application functions | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
|
| EAPI void | | EAPI void ecore_app_args_set(int argc, const char **argv); | |
| ecore_app_args_set(int argc, | | EAPI void ecore_app_args_get(int *argc, char ***argv); | |
| const char **argv); | | EAPI void ecore_app_restart(void); | |
| EAPI void | | | |
| ecore_app_args_get(int *argc, | | | |
| char ***argv); | | | |
| EAPI void | | | |
| ecore_app_restart(void); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Throttle_Group Ecore Throttle functions | | * @defgroup Ecore_Throttle_Group Ecore Throttle functions | |
| * | | * | |
| * @ingroup Ecore_Main_Loop_Group | | * @ingroup Ecore_Main_Loop_Group | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
|
| EAPI void | | EAPI void ecore_throttle_adjust(double amount); | |
| ecore_throttle_adjust(double amount); | | EAPI double ecore_throttle_get(void); | |
| EAPI double | | | |
| ecore_throttle_get(void); | | | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
End of changes. 159 change blocks. |
| 731 lines changed or deleted | | 1085 lines changed or added | |
|
| Ecore_Con.h | | Ecore_Con.h | |
| | | | |
| skipping to change at line 70 | | skipping to change at line 70 | |
| * Functions are described in the following groupings: | | * Functions are described in the following groupings: | |
| * @li @ref Ecore_Con_Lib_Group | | * @li @ref Ecore_Con_Lib_Group | |
| * @li @ref Ecore_Con_Server_Group | | * @li @ref Ecore_Con_Server_Group | |
| * @li @ref Ecore_Con_Client_Group | | * @li @ref Ecore_Con_Client_Group | |
| * @li @ref Ecore_Con_Url_Group | | * @li @ref Ecore_Con_Url_Group | |
| * | | * | |
| * Events are described in @ref Ecore_Con_Events_Group. | | * Events are described in @ref Ecore_Con_Events_Group. | |
| */ | | */ | |
| | | | |
| /** | | /** | |
|
| * @defgroup Ecore_Con_Events_Group Events | | * @defgroup Ecore_Con_Events_Group Ecore Connection Events Functions | |
| * | | * | |
| * @li ECORE_CON_CLIENT_ADD: Whenever a client connection is made to an | | * @li ECORE_CON_CLIENT_ADD: Whenever a client connection is made to an | |
| * @c Ecore_Con_Server, an event of this type is emitted, allowing the | | * @c Ecore_Con_Server, an event of this type is emitted, allowing the | |
| * retrieval of the client's ip with @ref ecore_con_client_ip_get and | | * retrieval of the client's ip with @ref ecore_con_client_ip_get and | |
| * associating data with the client using ecore_con_client_data_set. | | * associating data with the client using ecore_con_client_data_set. | |
| * @li ECORE_CON_EVENT_CLIENT_DEL: Whenever a client connection to an | | * @li ECORE_CON_EVENT_CLIENT_DEL: Whenever a client connection to an | |
| * @c Ecore_Con_Server, an event of this type is emitted. The contents of | | * @c Ecore_Con_Server, an event of this type is emitted. The contents of | |
| * the data with this event are variable, but if the client object in the d
ata | | * the data with this event are variable, but if the client object in the d
ata | |
| * is non-null, it must be freed with @ref ecore_con_client_del. | | * is non-null, it must be freed with @ref ecore_con_client_del. | |
| * @li ECORE_CON_EVENT_SERVER_ADD: Whenever a server object is created | | * @li ECORE_CON_EVENT_SERVER_ADD: Whenever a server object is created | |
| | | | |
| skipping to change at line 108 | | skipping to change at line 108 | |
| * and receives data, an event of this type is emitted. The data will cont
ain both | | * and receives data, an event of this type is emitted. The data will cont
ain both | |
| * the size and contents of the message sent by the server. It should be n
oted that | | * the size and contents of the message sent by the server. It should be n
oted that | |
| * data within this object is transient, so it must be duplicated in order
to be | | * data within this object is transient, so it must be duplicated in order
to be | |
| * retained. This event will continue to occur until the server has stoppe
d sending its | | * retained. This event will continue to occur until the server has stoppe
d sending its | |
| * message, so a good option for storing this data is an Eina_Strbuf. Once
the message has | | * message, so a good option for storing this data is an Eina_Strbuf. Once
the message has | |
| * been received in full, the server object must be freed with ecore_con_se
rver_free. | | * been received in full, the server object must be freed with ecore_con_se
rver_free. | |
| * | | * | |
| */ | | */ | |
| | | | |
| /** | | /** | |
|
| * @defgroup Ecore_Con_Buffer Buffering | | * @defgroup Ecore_Con_Buffer Ecore Connection Buffering | |
| * | | * | |
| * As Ecore_Con works on an event driven design, as data arrives, events wi
ll | | * As Ecore_Con works on an event driven design, as data arrives, events wi
ll | |
| * be produced containing the data that arrived. It is up to the user of | | * be produced containing the data that arrived. It is up to the user of | |
| * Ecore_Con to either parse as they go, append to a file to later parse th
e | | * Ecore_Con to either parse as they go, append to a file to later parse th
e | |
| * whole file in one go, or append to memory to parse or handle leter. | | * whole file in one go, or append to memory to parse or handle leter. | |
| * | | * | |
| * To help with this Eina has some handy API's. The Eina_Binbuf and | | * To help with this Eina has some handy API's. The Eina_Binbuf and | |
| * Eina_Strbuf APIs, abstract dynamic buffer management and make it trivial | | * Eina_Strbuf APIs, abstract dynamic buffer management and make it trivial | |
| * to handle buffers at runtime, without having to manage them. Eina_Binbuf | | * to handle buffers at runtime, without having to manage them. Eina_Binbuf | |
| * makes it possible to create, expand, reset and slice a blob of memory - | | * makes it possible to create, expand, reset and slice a blob of memory - | |
| | | | |
| skipping to change at line 235 | | skipping to change at line 235 | |
| typedef struct _Ecore_Con_Server Ecore_Con_Server; | | typedef struct _Ecore_Con_Server Ecore_Con_Server; | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Con_Client | | * @typedef Ecore_Con_Client | |
| * A connection handle to a client | | * A connection handle to a client | |
| * @ingroup Ecore_Con_Client_Group | | * @ingroup Ecore_Con_Client_Group | |
| */ | | */ | |
| typedef struct _Ecore_Con_Client Ecore_Con_Client; | | typedef struct _Ecore_Con_Client Ecore_Con_Client; | |
| | | | |
| /** | | /** | |
|
| | | * @typedef Ecore_Con_Socks | |
| | | * An object representing a SOCKS proxy | |
| | | * @ingroup Ecore_Con_Socks_Group | |
| | | * @since 1.2 | |
| | | */ | |
| | | typedef struct Ecore_Con_Socks Ecore_Con_Socks; | |
| | | | |
| | | /** | |
| * @typedef Ecore_Con_Url | | * @typedef Ecore_Con_Url | |
| * A handle to an http upload/download object | | * A handle to an http upload/download object | |
| * @ingroup Ecore_Con_Url_Group | | * @ingroup Ecore_Con_Url_Group | |
| */ | | */ | |
| typedef struct _Ecore_Con_Url Ecore_Con_Url; | | typedef struct _Ecore_Con_Url Ecore_Con_Url; | |
| | | | |
| /** | | /** | |
|
| * @addtogroup Ecore_Con_Events_Group Events | | * @addtogroup Ecore_Con_Events_Group | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Con_Event_Client_Add | | * @typedef Ecore_Con_Event_Client_Add | |
| * Used as the @p data param for the corresponding event | | * Used as the @p data param for the corresponding event | |
| */ | | */ | |
| typedef struct _Ecore_Con_Event_Client_Add Ecore_Con_Event_Client_Add; | | typedef struct _Ecore_Con_Event_Client_Add Ecore_Con_Event_Client_Add; | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 325 | | skipping to change at line 333 | |
| typedef struct _Ecore_Con_Event_Client_Write Ecore_Con_Event_Client_Write; | | typedef struct _Ecore_Con_Event_Client_Write Ecore_Con_Event_Client_Write; | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Con_Event_Server_Write | | * @typedef Ecore_Con_Event_Server_Write | |
| * Used as the @p data param for the corresponding event | | * Used as the @p data param for the corresponding event | |
| * @since 1.1 | | * @since 1.1 | |
| */ | | */ | |
| typedef struct _Ecore_Con_Event_Server_Write Ecore_Con_Event_Server_Write; | | typedef struct _Ecore_Con_Event_Server_Write Ecore_Con_Event_Server_Write; | |
| | | | |
| /** | | /** | |
|
| | | * @typedef Ecore_Con_Event_Proxy_Bind | |
| | | * Used as the @p data param for the corresponding event | |
| | | * @since 1.2 | |
| | | */ | |
| | | typedef struct _Ecore_Con_Event_Proxy_Bind Ecore_Con_Event_Proxy_Bind; | |
| | | | |
| | | /** | |
| * @typedef Ecore_Con_Event_Url_Data | | * @typedef Ecore_Con_Event_Url_Data | |
| * Used as the @p data param for the corresponding event | | * Used as the @p data param for the corresponding event | |
| * @ingroup Ecore_Con_Url_Group | | * @ingroup Ecore_Con_Url_Group | |
| */ | | */ | |
| typedef struct _Ecore_Con_Event_Url_Data Ecore_Con_Event_Url_Data; | | typedef struct _Ecore_Con_Event_Url_Data Ecore_Con_Event_Url_Data; | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Con_Event_Url_Complete | | * @typedef Ecore_Con_Event_Url_Complete | |
| * Used as the @p data param for the corresponding event | | * Used as the @p data param for the corresponding event | |
| * @ingroup Ecore_Con_Url_Group | | * @ingroup Ecore_Con_Url_Group | |
| | | | |
| skipping to change at line 464 | | skipping to change at line 479 | |
| * @struct _Ecore_Con_Event_Server_Write | | * @struct _Ecore_Con_Event_Server_Write | |
| * Used as the @p data param for the @ref ECORE_CON_EVENT_SERVER_WRITE even
t | | * Used as the @p data param for the @ref ECORE_CON_EVENT_SERVER_WRITE even
t | |
| */ | | */ | |
| struct _Ecore_Con_Event_Server_Write | | struct _Ecore_Con_Event_Server_Write | |
| { | | { | |
| Ecore_Con_Server *server; /**< the server that was connected to */ | | Ecore_Con_Server *server; /**< the server that was connected to */ | |
| int size; /**< the length of the data sent */ | | int size; /**< the length of the data sent */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
|
| | | * @struct _Ecore_Con_Event_Proxy_Bind | |
| | | * Used as the @p data param for the @ref ECORE_CON_EVENT_PROXY_BIND event | |
| | | * @ingroup Ecore_Con_Socks_Group | |
| | | * @since 1.2 | |
| | | */ | |
| | | struct _Ecore_Con_Event_Proxy_Bind | |
| | | { | |
| | | Ecore_Con_Server *server; /**< the server object connected to the proxy | |
| | | */ | |
| | | const char *ip; /**< the proxy-bound ip address */ | |
| | | int port; /**< the proxy-bound port */ | |
| | | }; | |
| | | | |
| | | /** | |
| * @struct _Ecore_Con_Event_Url_Data | | * @struct _Ecore_Con_Event_Url_Data | |
| * Used as the @p data param for the @ref ECORE_CON_EVENT_URL_DATA event | | * Used as the @p data param for the @ref ECORE_CON_EVENT_URL_DATA event | |
| * @ingroup Ecore_Con_Url_Group | | * @ingroup Ecore_Con_Url_Group | |
| */ | | */ | |
| struct _Ecore_Con_Event_Url_Data | | struct _Ecore_Con_Event_Url_Data | |
| { | | { | |
| Ecore_Con_Url *url_con; /**< a pointer to the connection object */ | | Ecore_Con_Url *url_con; /**< a pointer to the connection object */ | |
| int size; /**< the size of the current received data (in bytes) */ | | int size; /**< the size of the current received data (in bytes) */ | |
| unsigned char data[1]; /**< the data received on this event */ | | unsigned char data[1]; /**< the data received on this event */ | |
| }; | | }; | |
| | | | |
| skipping to change at line 542 | | skipping to change at line 570 | |
| */ | | */ | |
| EAPI extern int ECORE_CON_EVENT_CLIENT_WRITE; | | EAPI extern int ECORE_CON_EVENT_CLIENT_WRITE; | |
| /** A server connection object has sent data | | /** A server connection object has sent data | |
| * @since 1.1 | | * @since 1.1 | |
| */ | | */ | |
| EAPI extern int ECORE_CON_EVENT_SERVER_WRITE; | | EAPI extern int ECORE_CON_EVENT_SERVER_WRITE; | |
| /** A client connected to the server has sent data */ | | /** A client connected to the server has sent data */ | |
| EAPI extern int ECORE_CON_EVENT_CLIENT_DATA; | | EAPI extern int ECORE_CON_EVENT_CLIENT_DATA; | |
| /** A server connection object has data */ | | /** A server connection object has data */ | |
| EAPI extern int ECORE_CON_EVENT_SERVER_DATA; | | EAPI extern int ECORE_CON_EVENT_SERVER_DATA; | |
|
| | | /** A server connection has successfully negotiated an ip:port binding | |
| | | * @since 1.2 | |
| | | */ | |
| | | EAPI extern int ECORE_CON_EVENT_PROXY_BIND; | |
| /** A URL object has data */ | | /** A URL object has data */ | |
| EAPI extern int ECORE_CON_EVENT_URL_DATA; | | EAPI extern int ECORE_CON_EVENT_URL_DATA; | |
| /** A URL object has completed its transfer to and from the server and can
be reused */ | | /** A URL object has completed its transfer to and from the server and can
be reused */ | |
| EAPI extern int ECORE_CON_EVENT_URL_COMPLETE; | | EAPI extern int ECORE_CON_EVENT_URL_COMPLETE; | |
| /** A URL object has made progress in its transfer */ | | /** A URL object has made progress in its transfer */ | |
| EAPI extern int ECORE_CON_EVENT_URL_PROGRESS; | | EAPI extern int ECORE_CON_EVENT_URL_PROGRESS; | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| skipping to change at line 605 | | skipping to change at line 637 | |
| /** Abstract socket */ | | /** Abstract socket */ | |
| ECORE_CON_LOCAL_ABSTRACT = 2, | | ECORE_CON_LOCAL_ABSTRACT = 2, | |
| /** Remote server using TCP */ | | /** Remote server using TCP */ | |
| ECORE_CON_REMOTE_TCP = 3, | | ECORE_CON_REMOTE_TCP = 3, | |
| /** Remote multicast server */ | | /** Remote multicast server */ | |
| ECORE_CON_REMOTE_MCAST = 4, | | ECORE_CON_REMOTE_MCAST = 4, | |
| /** Remote server using UDP */ | | /** Remote server using UDP */ | |
| ECORE_CON_REMOTE_UDP = 5, | | ECORE_CON_REMOTE_UDP = 5, | |
| /** Remote broadcast using UDP */ | | /** Remote broadcast using UDP */ | |
| ECORE_CON_REMOTE_BROADCAST = 6, | | ECORE_CON_REMOTE_BROADCAST = 6, | |
|
| | | /** Remote connection sending packets immediately */ | |
| ECORE_CON_REMOTE_NODELAY = 7, | | ECORE_CON_REMOTE_NODELAY = 7, | |
|
| | | /** Remote connection sending data in large chunks | |
| | | * @note Only available on Linux | |
| | | * @since 1.2 | |
| | | */ | |
| | | ECORE_CON_REMOTE_CORK = 8, | |
| /** Use SSL2: UNSUPPORTED. **/ | | /** Use SSL2: UNSUPPORTED. **/ | |
| ECORE_CON_USE_SSL2 = (1 << 4), | | ECORE_CON_USE_SSL2 = (1 << 4), | |
| /** Use SSL3 */ | | /** Use SSL3 */ | |
| ECORE_CON_USE_SSL3 = (1 << 5), | | ECORE_CON_USE_SSL3 = (1 << 5), | |
| /** Use TLS */ | | /** Use TLS */ | |
| ECORE_CON_USE_TLS = (1 << 6), | | ECORE_CON_USE_TLS = (1 << 6), | |
| /** Use both TLS and SSL3 */ | | /** Use both TLS and SSL3 */ | |
| ECORE_CON_USE_MIXED = ECORE_CON_USE_SSL3 | ECORE_CON_USE_TLS, | | ECORE_CON_USE_MIXED = ECORE_CON_USE_SSL3 | ECORE_CON_USE_TLS, | |
| /** Attempt to use the loaded certificate */ | | /** Attempt to use the loaded certificate */ | |
| ECORE_CON_LOAD_CERT = (1 << 7) | | ECORE_CON_LOAD_CERT = (1 << 7) | |
| | | | |
| skipping to change at line 643 | | skipping to change at line 681 | |
| * need to call it explicitly unless you called ecore_init() explicitly too
. | | * need to call it explicitly unless you called ecore_init() explicitly too
. | |
| */ | | */ | |
| EAPI int ecore_con_shutdown(void); | | EAPI int ecore_con_shutdown(void); | |
| | | | |
| /** | | /** | |
| * Do an asynchronous DNS lookup. | | * Do an asynchronous DNS lookup. | |
| * | | * | |
| * @param name IP address or server name to translate. | | * @param name IP address or server name to translate. | |
| * @param done_cb Callback to notify when done. | | * @param done_cb Callback to notify when done. | |
| * @param data User data to be given to done_cb. | | * @param data User data to be given to done_cb. | |
|
| * @return EINA_TRUE if the request did not fail to be set up, EINA_FALSE i | | * @return @c EINA_TRUE if the request did not fail to be set up, @c EINA_F | |
| f it | | ALSE | |
| * failed. | | * if it failed. | |
| * | | * | |
| * This function performs a DNS lookup on the hostname specified by @p name
, | | * This function performs a DNS lookup on the hostname specified by @p name
, | |
| * then calls @p done_cb with the result and the @p data given as parameter
. | | * then calls @p done_cb with the result and the @p data given as parameter
. | |
| * The result will be given to the @p done_cb as follows: | | * The result will be given to the @p done_cb as follows: | |
| * @li @c canonname - the canonical name of the address | | * @li @c canonname - the canonical name of the address | |
| * @li @c ip - the resolved ip address | | * @li @c ip - the resolved ip address | |
| * @li @c addr - a pointer to the socket address | | * @li @c addr - a pointer to the socket address | |
| * @li @c addrlen - the length of the socket address, in bytes | | * @li @c addrlen - the length of the socket address, in bytes | |
| * @li @c data - the data pointer given as parameter to ecore_con_lookup() | | * @li @c data - the data pointer given as parameter to ecore_con_lookup() | |
| */ | | */ | |
| | | | |
| skipping to change at line 675 | | skipping to change at line 713 | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| EAPI int ecore_con_ssl_available_get(void); | | EAPI int ecore_con_ssl_available_get(void); | |
| EAPI Eina_Bool ecore_con_ssl_server_cert_add(Ecore_Con_Server *svr,
const char *cert); | | EAPI Eina_Bool ecore_con_ssl_server_cert_add(Ecore_Con_Server *svr,
const char *cert); | |
| EAPI Eina_Bool ecore_con_ssl_server_privkey_add(Ecore_Con_Server *s
vr, const char *key_file); | | EAPI Eina_Bool ecore_con_ssl_server_privkey_add(Ecore_Con_Server *s
vr, const char *key_file); | |
| EAPI Eina_Bool ecore_con_ssl_server_crl_add(Ecore_Con_Server *svr,
const char *crl_file); | | EAPI Eina_Bool ecore_con_ssl_server_crl_add(Ecore_Con_Server *svr,
const char *crl_file); | |
| EAPI Eina_Bool ecore_con_ssl_server_cafile_add(Ecore_Con_Server *sv
r, const char *ca_file); | | EAPI Eina_Bool ecore_con_ssl_server_cafile_add(Ecore_Con_Server *sv
r, const char *ca_file); | |
| EAPI void ecore_con_ssl_server_verify(Ecore_Con_Server *svr); | | EAPI void ecore_con_ssl_server_verify(Ecore_Con_Server *svr); | |
| EAPI void ecore_con_ssl_server_verify_basic(Ecore_Con_Server *
svr); | | EAPI void ecore_con_ssl_server_verify_basic(Ecore_Con_Server *
svr); | |
|
| | | EAPI void ecore_con_ssl_server_verify_name_set(Ecore_Con_Serve | |
| | | r *svr, const char *name); | |
| | | EAPI const char *ecore_con_ssl_server_verify_name_get(Ecore_Con_Serve | |
| | | r *svr); | |
| EAPI Eina_Bool ecore_con_ssl_server_upgrade(Ecore_Con_Server *svr,
Ecore_Con_Type compl_type); | | EAPI Eina_Bool ecore_con_ssl_server_upgrade(Ecore_Con_Server *svr,
Ecore_Con_Type compl_type); | |
| EAPI Eina_Bool ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, E
core_Con_Type compl_type); | | EAPI Eina_Bool ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, E
core_Con_Type compl_type); | |
| | | | |
| /** | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
|
| | | EAPI Ecore_Con_Socks *ecore_con_socks4_remote_add(const char *ip, int port, | |
| | | const char *username); | |
| | | EAPI Eina_Bool ecore_con_socks4_remote_exists(const char *ip, int po | |
| | | rt, const char *username); | |
| | | EAPI void ecore_con_socks4_remote_del(const char *ip, int port, | |
| | | const char *username); | |
| | | EAPI Ecore_Con_Socks *ecore_con_socks5_remote_add(const char *ip, int port, | |
| | | const char *username, const char *password); | |
| | | EAPI Eina_Bool ecore_con_socks5_remote_exists(const char *ip, int po | |
| | | rt, const char *username, const char *password); | |
| | | EAPI void ecore_con_socks5_remote_del(const char *ip, int port, | |
| | | const char *username, const char *password); | |
| | | EAPI void ecore_con_socks_lookup_set(Ecore_Con_Socks *ecs, Eina | |
| | | _Bool enable); | |
| | | EAPI Eina_Bool ecore_con_socks_lookup_get(Ecore_Con_Socks *ecs); | |
| | | EAPI void ecore_con_socks_bind_set(Ecore_Con_Socks *ecs, Eina_B | |
| | | ool is_bind); | |
| | | EAPI Eina_Bool ecore_con_socks_bind_get(Ecore_Con_Socks *ecs); | |
| | | EAPI unsigned int ecore_con_socks_version_get(Ecore_Con_Socks *ecs); | |
| | | EAPI void ecore_con_socks_remote_del(Ecore_Con_Socks *ecs); | |
| | | EAPI void ecore_con_socks_apply_once(Ecore_Con_Socks *ecs); | |
| | | EAPI void ecore_con_socks_apply_always(Ecore_Con_Socks *ecs); | |
| | | | |
| /** | | /** | |
| * @defgroup Ecore_Con_Server_Group Ecore Connection Server Functions | | * @defgroup Ecore_Con_Server_Group Ecore Connection Server Functions | |
| * | | * | |
| * This group of functions is applied to an @ref Ecore_Con_Server object. I
t | | * This group of functions is applied to an @ref Ecore_Con_Server object. I
t | |
| * doesn't mean that they should be used in the server application, but on
the | | * doesn't mean that they should be used in the server application, but on
the | |
| * server object. In fact, most of them should be used in the client | | * server object. In fact, most of them should be used in the client | |
| * application, when retrieving information or sending data. | | * application, when retrieving information or sending data. | |
| * | | * | |
| * Setting up a server is very simple: you just need to start it with | | * Setting up a server is very simple: you just need to start it with | |
| * ecore_con_server_add() and setup some callbacks to the events | | * ecore_con_server_add() and setup some callbacks to the events | |
|
| * #ECORE_CON_EVENT_CLIENT_ADD, #ECORE_CON_EVENT_CLIENT_DEL and | | * @ref ECORE_CON_EVENT_CLIENT_ADD, @ref ECORE_CON_EVENT_CLIENT_DEL and | |
| * #ECORE_CON_EVENT_CLIENT_DATA, that will be called when a client is | | * @ref ECORE_CON_EVENT_CLIENT_DATA, that will be called when a client is | |
| * communicating with the server: | | * communicating with the server: | |
| * | | * | |
| * @code | | * @code | |
| * if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 8080
, NULL))) | | * if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 8080
, NULL))) | |
| * exit(1); | | * exit(1); | |
| * | | * | |
| * ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, _add_cb, NULL); | | * ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, _add_cb, NULL); | |
| * ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, _del_cb, NULL); | | * ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, _del_cb, NULL); | |
| * ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, _data_cb, NULL); | | * ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, _data_cb, NULL); | |
| * | | * | |
| | | | |
| skipping to change at line 815 | | skipping to change at line 870 | |
| * @li If @a type is @c ECORE_CON_REMOTE_TCP, the function will | | * @li If @a type is @c ECORE_CON_REMOTE_TCP, the function will | |
| * connect to the server at the TCP port "[name]:[port]". | | * connect to the server at the TCP port "[name]:[port]". | |
| * | | * | |
| * More information about the @p type can be found at @ref _Ecore_Con_Type. | | * More information about the @p type can be found at @ref _Ecore_Con_Type. | |
| * | | * | |
| * This function won't block. It will either succeed, or fail due to invali
d | | * This function won't block. It will either succeed, or fail due to invali
d | |
| * parameters, failed memory allocation, etc., returning @c NULL on that ca
se. | | * parameters, failed memory allocation, etc., returning @c NULL on that ca
se. | |
| * | | * | |
| * However, even if this call returns a valid @ref Ecore_Con_Server, the | | * However, even if this call returns a valid @ref Ecore_Con_Server, the | |
| * connection will only be successfully completed if an event of type | | * connection will only be successfully completed if an event of type | |
|
| * #ECORE_CON_EVENT_SERVER_ADD is received. If it fails to complete, an | | * @ref ECORE_CON_EVENT_SERVER_ADD is received. If it fails to complete, an | |
| * #ECORE_CON_EVENT_SERVER_DEL will be received. | | * @ref ECORE_CON_EVENT_SERVER_DEL will be received. | |
| * | | * | |
| * The @p data parameter can be fetched later using ecore_con_server_data_g
et() | | * The @p data parameter can be fetched later using ecore_con_server_data_g
et() | |
| * or changed with ecore_con_server_data_set(). | | * or changed with ecore_con_server_data_set(). | |
| */ | | */ | |
| EAPI Ecore_Con_Server *ecore_con_server_connect(Ecore_Con_Type type, | | EAPI Ecore_Con_Server *ecore_con_server_connect(Ecore_Con_Type type, | |
| const char *name, int port, | | const char *name, int port, | |
| const void *data); | | const void *data); | |
| /** | | /** | |
| * Closes the connection and frees the given server. | | * Closes the connection and frees the given server. | |
| * | | * | |
| | | | |
| skipping to change at line 860 | | skipping to change at line 915 | |
| * @return The previously associated data, if any. | | * @return The previously associated data, if any. | |
| * | | * | |
| * @see ecore_con_server_data_get() | | * @see ecore_con_server_data_get() | |
| */ | | */ | |
| EAPI void * ecore_con_server_data_set(Ecore_Con_Server *svr, | | EAPI void * ecore_con_server_data_set(Ecore_Con_Server *svr, | |
| void *data); | | void *data); | |
| /** | | /** | |
| * Retrieves whether the given server is currently connected. | | * Retrieves whether the given server is currently connected. | |
| * | | * | |
| * @param svr The given server. | | * @param svr The given server. | |
|
| * @return #EINA_TRUE if the server is connected. #EINA_FALSE otherwise. | | * @return @c EINA_TRUE if the server is connected, @c EINA_FALSE otherwise
. | |
| */ | | */ | |
| EAPI Eina_Bool ecore_con_server_connected_get(Ecore_Con_Server *svr
); | | EAPI Eina_Bool ecore_con_server_connected_get(Ecore_Con_Server *svr
); | |
| /** | | /** | |
| * Retrieves the current list of clients. | | * Retrieves the current list of clients. | |
| * | | * | |
| * @param svr The given server. | | * @param svr The given server. | |
| * @return The list of clients on this server. | | * @return The list of clients on this server. | |
| * | | * | |
| * Each node in the returned list points to an @ref Ecore_Con_Client. This
list | | * Each node in the returned list points to an @ref Ecore_Con_Client. This
list | |
| * cannot be modified or freed. It can also change if new clients are conne
cted | | * cannot be modified or freed. It can also change if new clients are conne
cted | |
| | | | |
| skipping to change at line 958 | | skipping to change at line 1013 | |
| EAPI void ecore_con_server_client_limit_set(Ecore_Con_Server *
svr, | | EAPI void ecore_con_server_client_limit_set(Ecore_Con_Server *
svr, | |
| int client_limit, | | int client_limit, | |
| char reject_excess
_clients); | | char reject_excess
_clients); | |
| /** | | /** | |
| * Gets the IP address of a server that has been connected to. | | * Gets the IP address of a server that has been connected to. | |
| * | | * | |
| * @param svr The given server. | | * @param svr The given server. | |
| * @return A pointer to an internal string that contains the IP address of | | * @return A pointer to an internal string that contains the IP address of | |
| * the connected server in the form "XXX.YYY.ZZZ.AAA" IP notation. | | * the connected server in the form "XXX.YYY.ZZZ.AAA" IP notation. | |
| * This string should not be modified or trusted to stay valid aft
er | | * This string should not be modified or trusted to stay valid aft
er | |
|
| * deletion for the @p svr object. If no IP is known NULL is retur | | * deletion for the @p svr object. If no IP is known @c NULL is | |
| ned. | | * returned. | |
| */ | | */ | |
| EAPI const char * ecore_con_server_ip_get(Ecore_Con_Server *svr); | | EAPI const char * ecore_con_server_ip_get(Ecore_Con_Server *svr); | |
| /** | | /** | |
| * Flushes all pending data to the given server. | | * Flushes all pending data to the given server. | |
| * | | * | |
| * @param svr The given server. | | * @param svr The given server. | |
| * | | * | |
| * This function will block until all data is sent to the server. | | * This function will block until all data is sent to the server. | |
| * | | * | |
| * @see ecore_con_server_send() | | * @see ecore_con_server_send() | |
| | | | |
| skipping to change at line 1112 | | skipping to change at line 1168 | |
| EAPI void * ecore_con_client_data_get(Ecore_Con_Client *cl); | | EAPI void * ecore_con_client_data_get(Ecore_Con_Client *cl); | |
| | | | |
| /** | | /** | |
| * Gets the IP address of a client that has connected. | | * Gets the IP address of a client that has connected. | |
| * | | * | |
| * @param cl The given client. | | * @param cl The given client. | |
| * @return A pointer to an internal string that contains the IP address of | | * @return A pointer to an internal string that contains the IP address of | |
| * the connected client in the form "XXX.YYY.ZZZ.AAA" IP notation. | | * the connected client in the form "XXX.YYY.ZZZ.AAA" IP notation. | |
| * | | * | |
| * The returned string should not be modified, freed or trusted to stay val
id | | * The returned string should not be modified, freed or trusted to stay val
id | |
|
| * after deletion for the @p cl object. If no IP is known NULL is returned. | | * after deletion for the @p cl object. If no IP is known @c NULL is return
ed. | |
| */ | | */ | |
| EAPI const char * ecore_con_client_ip_get(Ecore_Con_Client *cl); | | EAPI const char * ecore_con_client_ip_get(Ecore_Con_Client *cl); | |
| /** | | /** | |
| * Flushes all pending data to the given client. | | * Flushes all pending data to the given client. | |
| * | | * | |
| * @param cl The given client. | | * @param cl The given client. | |
| * | | * | |
| * This function will block until all data is sent to the server. | | * This function will block until all data is sent to the server. | |
| * | | * | |
| * @see ecore_con_client_send() | | * @see ecore_con_client_send() | |
| | | | |
| skipping to change at line 1173 | | skipping to change at line 1229 | |
| * server. | | * server. | |
| * | | * | |
| * @see ecore_con_client_timeout_get() | | * @see ecore_con_client_timeout_get() | |
| * @see ecore_con_server_timeout_set() | | * @see ecore_con_server_timeout_set() | |
| */ | | */ | |
| EAPI void ecore_con_client_timeout_set(Ecore_Con_Client *cl, d
ouble timeout); | | EAPI void ecore_con_client_timeout_set(Ecore_Con_Client *cl, d
ouble timeout); | |
| /** | | /** | |
| * Returns whether the client is still connected | | * Returns whether the client is still connected | |
| * | | * | |
| * @param cl The given client. | | * @param cl The given client. | |
|
| * @return #EINA_TRUE if connected, else EINA_FALSE | | * @return @c EINA_TRUE if connected, @c EINA_FALSE otherwise. | |
| */ | | */ | |
| EAPI Eina_Bool ecore_con_client_connected_get(Ecore_Con_Client *cl)
; | | EAPI Eina_Bool ecore_con_client_connected_get(Ecore_Con_Client *cl)
; | |
| /** | | /** | |
| * @brief Return the port that the client has connected to | | * @brief Return the port that the client has connected to | |
| * | | * | |
| * @param cl The client | | * @param cl The client | |
| * @return The port that @p cl has connected to, or -1 on error | | * @return The port that @p cl has connected to, or -1 on error | |
| * Use this function to return the port on which a given client has connect
ed. | | * Use this function to return the port on which a given client has connect
ed. | |
| */ | | */ | |
| EAPI int ecore_con_client_port_get(Ecore_Con_Client *cl); | | EAPI int ecore_con_client_port_get(Ecore_Con_Client *cl); | |
| | | | |
| skipping to change at line 1248 | | skipping to change at line 1304 | |
| * @endcode | | * @endcode | |
| * | | * | |
| * Simple Usage 5 (FTP upload as ftp://ftp.example.com/dir/file): | | * Simple Usage 5 (FTP upload as ftp://ftp.example.com/dir/file): | |
| * @code | | * @code | |
| * ecore_con_url_url_set(url_con, "ftp://ftp.example.com"); | | * ecore_con_url_url_set(url_con, "ftp://ftp.example.com"); | |
| * ecore_con_url_ftp_upload(url_con, "/tmp/file", "user", "pass","dir"); | | * ecore_con_url_ftp_upload(url_con, "/tmp/file", "user", "pass","dir"); | |
| * @endcode | | * @endcode | |
| * | | * | |
| * These are complete examples for the API: | | * These are complete examples for the API: | |
| * @li @ref ecore_con_url_download_example.c "Downloading a file" | | * @li @ref ecore_con_url_download_example.c "Downloading a file" | |
|
| * @li @ref ecore_con_url_headers_example.c "Setting many options for the | | * @li @ref ecore_con_url_headers_example.c "Setting many options for the c | |
| * connection" | | onnection" | |
| * | | * | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @typedef Ecore_Con_Url_Time | | * @typedef Ecore_Con_Url_Time | |
| * @enum _Ecore_Con_Url_Time | | * @enum _Ecore_Con_Url_Time | |
| * The type of condition to use when making an HTTP request dependent on ti
me, | | * The type of condition to use when making an HTTP request dependent on ti
me, | |
| * so that headers such as "If-Modified-Since" are used. | | * so that headers such as "If-Modified-Since" are used. | |
| */ | | */ | |
| | | | |
| skipping to change at line 1281 | | skipping to change at line 1336 | |
| ECORE_CON_URL_TIME_IFMODSINCE, | | ECORE_CON_URL_TIME_IFMODSINCE, | |
| /** | | /** | |
| * Add the "If-Unmodified-Since" HTTP header, so that the request is | | * Add the "If-Unmodified-Since" HTTP header, so that the request is | |
| * performed by the server only if the target has NOT been modified sinc
e | | * performed by the server only if the target has NOT been modified sinc
e | |
| * the time value passed to it in the request. | | * the time value passed to it in the request. | |
| */ | | */ | |
| ECORE_CON_URL_TIME_IFUNMODSINCE | | ECORE_CON_URL_TIME_IFUNMODSINCE | |
| } Ecore_Con_Url_Time; | | } Ecore_Con_Url_Time; | |
| | | | |
| /** | | /** | |
|
| | | * @typedef Ecore_Con_Url_Http_Version | |
| | | * @enum _Ecore_Con_Url_Http_Version | |
| | | * The http version to use | |
| | | * @since 1.2 | |
| | | */ | |
| | | typedef enum _Ecore_Con_Url_Http_Version | |
| | | { | |
| | | /** | |
| | | * HTTP version 1.0 | |
| | | * @since 1.2 | |
| | | */ | |
| | | ECORE_CON_URL_HTTP_VERSION_1_0, | |
| | | /** | |
| | | * HTTP version 1.1 (default) | |
| | | * @since 1.2 | |
| | | */ | |
| | | ECORE_CON_URL_HTTP_VERSION_1_1 | |
| | | } Ecore_Con_Url_Http_Version; | |
| | | | |
| | | /** | |
| | | * Change the HTTP version used for the request | |
| | | * @param url_con Connection object through which the request will be sent. | |
| | | * @param version The version to be used | |
| | | * @return @c EINA_TRUE on success, @c EINA_FALSE on failure to change vers | |
| | | ion. | |
| | | * @since 1.2 | |
| | | * @see ecore_con_url_pipeline_get() | |
| | | */ | |
| | | EAPI Eina_Bool ecore_con_url_http_version_set(Ecore_Con_Url *url_co | |
| | | n, Ecore_Con_Url_Http_Version version); | |
| | | | |
| | | /** | |
| * Initialises the Ecore_Con_Url library. | | * Initialises the Ecore_Con_Url library. | |
| * @return Number of times the library has been initialised without being | | * @return Number of times the library has been initialised without being | |
| * shut down. | | * shut down. | |
| * | | * | |
| * @note This function doesn't call ecore_con_init(). You still need to cal
l it | | * @note This function doesn't call ecore_con_init(). You still need to cal
l it | |
| * explicitly before calling this one. | | * explicitly before calling this one. | |
| */ | | */ | |
| EAPI int ecore_con_url_init(void); | | EAPI int ecore_con_url_init(void); | |
| | | | |
| /** | | /** | |
| * Shuts down the Ecore_Con_Url library. | | * Shuts down the Ecore_Con_Url library. | |
| * @return Number of calls that still uses Ecore_Con_Url | | * @return Number of calls that still uses Ecore_Con_Url | |
| * | | * | |
| * @note This function doesn't call ecore_con_shutdown(). You still need to
call | | * @note This function doesn't call ecore_con_shutdown(). You still need to
call | |
| * it explicitly after calling this one. | | * it explicitly after calling this one. | |
| */ | | */ | |
| EAPI int ecore_con_url_shutdown(void); | | EAPI int ecore_con_url_shutdown(void); | |
| | | | |
| /** | | /** | |
| * Enable or disable HTTP 1.1 pipelining. | | * Enable or disable HTTP 1.1 pipelining. | |
|
| * @param enable EINA_TRUE will turn it on, EINA_FALSE will disable it. | | * @param enable @c EINA_TRUE will turn it on, @c EINA_FALSE will disable i
t. | |
| * | | * | |
| * Pipelining allows to send one request after another one, without having
to | | * Pipelining allows to send one request after another one, without having
to | |
| * wait for the reply of the first request. The respective replies are rece
ived | | * wait for the reply of the first request. The respective replies are rece
ived | |
| * in the order that the requests were sent. | | * in the order that the requests were sent. | |
| * | | * | |
| * Enabling this feature will be valid for all requests done using @c | | * Enabling this feature will be valid for all requests done using @c | |
| * ecore_con_url. | | * ecore_con_url. | |
| * | | * | |
| * See http://en.wikipedia.org/wiki/HTTP_pipelining for more info. | | * See http://en.wikipedia.org/wiki/HTTP_pipelining for more info. | |
| * | | * | |
| * @see ecore_con_url_pipeline_get() | | * @see ecore_con_url_pipeline_get() | |
| */ | | */ | |
| EAPI void ecore_con_url_pipeline_set(Eina_Bool enable); | | EAPI void ecore_con_url_pipeline_set(Eina_Bool enable); | |
| /** | | /** | |
| * Is HTTP 1.1 pipelining enable ? | | * Is HTTP 1.1 pipelining enable ? | |
|
| * @return EINA_TRUE if it is enable. | | * @return @c EINA_TRUE if it is enable. | |
| * | | * | |
| * @see ecore_con_url_pipeline_set() | | * @see ecore_con_url_pipeline_set() | |
| */ | | */ | |
| EAPI Eina_Bool ecore_con_url_pipeline_get(void); | | EAPI Eina_Bool ecore_con_url_pipeline_get(void); | |
| | | | |
| /** | | /** | |
| * Creates and initializes a new Ecore_Con_Url connection object. | | * Creates and initializes a new Ecore_Con_Url connection object. | |
| * | | * | |
| * @param url URL that will receive requests. Can be changed using | | * @param url URL that will receive requests. Can be changed using | |
| * ecore_con_url_url_set. | | * ecore_con_url_url_set. | |
| * | | * | |
|
| * @return NULL on error, a new Ecore_Con_Url on success. | | * @return @c NULL on error, a new Ecore_Con_Url on success. | |
| * | | * | |
| * Creates and initializes a new Ecore_Con_Url connection object that can b
e | | * Creates and initializes a new Ecore_Con_Url connection object that can b
e | |
| * used for sending requests. | | * used for sending requests. | |
| * | | * | |
| * @see ecore_con_url_custom_new() | | * @see ecore_con_url_custom_new() | |
| * @see ecore_con_url_url_set() | | * @see ecore_con_url_url_set() | |
| */ | | */ | |
| EAPI Ecore_Con_Url * ecore_con_url_new(const char *url); | | EAPI Ecore_Con_Url * ecore_con_url_new(const char *url); | |
| /** | | /** | |
| * Creates a custom connection object. | | * Creates a custom connection object. | |
| * | | * | |
| * @param url URL that will receive requests | | * @param url URL that will receive requests | |
| * @param custom_request Custom request (e.g. GET, POST, HEAD, PUT, etc) | | * @param custom_request Custom request (e.g. GET, POST, HEAD, PUT, etc) | |
| * | | * | |
|
| * @return NULL on error, a new Ecore_Con_Url on success. | | * @return @c NULL on error, a new Ecore_Con_Url on success. | |
| * | | * | |
| * Creates and initializes a new Ecore_Con_Url for a custom request (e.g. H
EAD, | | * Creates and initializes a new Ecore_Con_Url for a custom request (e.g. H
EAD, | |
| * SUBSCRIBE and other obscure HTTP requests). This object should be used l
ike | | * SUBSCRIBE and other obscure HTTP requests). This object should be used l
ike | |
| * one created with ecore_con_url_new(). | | * one created with ecore_con_url_new(). | |
| * | | * | |
| * @see ecore_con_url_new() | | * @see ecore_con_url_new() | |
| * @see ecore_con_url_url_set() | | * @see ecore_con_url_url_set() | |
| */ | | */ | |
| EAPI Ecore_Con_Url * ecore_con_url_custom_new(const char *url, | | EAPI Ecore_Con_Url * ecore_con_url_custom_new(const char *url, | |
| const char *custom_request)
; | | const char *custom_request)
; | |
| | | | |
| skipping to change at line 1369 | | skipping to change at line 1454 | |
| * | | * | |
| * @see ecore_con_url_new() | | * @see ecore_con_url_new() | |
| */ | | */ | |
| EAPI void ecore_con_url_free(Ecore_Con_Url *url_con); | | EAPI void ecore_con_url_free(Ecore_Con_Url *url_con); | |
| /** | | /** | |
| * Sets the URL to send the request to. | | * Sets the URL to send the request to. | |
| * | | * | |
| * @param url_con Connection object through which the request will be sent. | | * @param url_con Connection object through which the request will be sent. | |
| * @param url URL that will receive the request | | * @param url URL that will receive the request | |
| * | | * | |
|
| * @return EINA_TRUE on success, EINA_FALSE on error. | | * @return @c EINA_TRUE on success, @c EINA_FALSE on error. | |
| * | | | |
| */ | | */ | |
| EAPI Eina_Bool ecore_con_url_url_set(Ecore_Con_Url *url_con, | | EAPI Eina_Bool ecore_con_url_url_set(Ecore_Con_Url *url_con, | |
| const char *url); | | const char *url); | |
| /** | | /** | |
| * Gets the URL to send the request to. | | * Gets the URL to send the request to. | |
| * | | * | |
| * @param url_con Connection object through which the request will be sent. | | * @param url_con Connection object through which the request will be sent. | |
|
| * @return URL that will receive the request, NULL on failure. URL is strin | | * @return URL that will receive the request, @c NULL on failure. URL is | |
| gshared. | | * stringshared. | |
| * @since 1.1 | | * @since 1.1 | |
| */ | | */ | |
| EAPI const char *ecore_con_url_url_get(Ecore_Con_Url *url_con); | | EAPI const char *ecore_con_url_url_get(Ecore_Con_Url *url_con); | |
| /** | | /** | |
| * Associates data with a connection object. | | * Associates data with a connection object. | |
| * | | * | |
| * @param url_con Connection object to associate data. | | * @param url_con Connection object to associate data. | |
| * @param data Data to be set. | | * @param data Data to be set. | |
| * | | * | |
| * Associates data with a connection object, which can be retrieved later w
ith | | * Associates data with a connection object, which can be retrieved later w
ith | |
| | | | |
| skipping to change at line 1491 | | skipping to change at line 1576 | |
| EAPI int ecore_con_url_received_bytes_get(Ecore_Con_Url *url_
con); | | EAPI int ecore_con_url_received_bytes_get(Ecore_Con_Url *url_
con); | |
| /** | | /** | |
| * Sets url_con to use http auth, with given username and password, "safely
" or not. | | * Sets url_con to use http auth, with given username and password, "safely
" or not. | |
| * | | * | |
| * @param url_con Connection object to perform a request on, previously cre
ated | | * @param url_con Connection object to perform a request on, previously cre
ated | |
| * with ecore_con_url_new() or ecore_con_url_custom_new(). | | * with ecore_con_url_new() or ecore_con_url_custom_new(). | |
| * @param username Username to use in authentication | | * @param username Username to use in authentication | |
| * @param password Password to use in authentication | | * @param password Password to use in authentication | |
| * @param safe Whether to use "safer" methods (eg, NOT http basic auth) | | * @param safe Whether to use "safer" methods (eg, NOT http basic auth) | |
| * | | * | |
|
| * @return #EINA_TRUE on success, #EINA_FALSE on error. | | * @return @c EINA_TRUE on success, @c EINA_FALSE on error. | |
| * | | * | |
|
| * ATTENTION: requires libcurl >= 7.19.1 to work, otherwise will always ret | | * @attention Requires libcurl >= 7.19.1 to work, otherwise will always ret | |
| urn 0. | | urn | |
| | | * @c 0. | |
| */ | | */ | |
| EAPI Eina_Bool ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, | | EAPI Eina_Bool ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, | |
| const char *username, | | const char *username, | |
| const char *password, | | const char *password, | |
| Eina_Bool safe); | | Eina_Bool safe); | |
| /** | | /** | |
|
| * Sends a request. | | | |
| * | | | |
| * @param url_con Connection object to perform a request on, previously cre | | | |
| ated | | | |
| * with ecore_con_url_new() or ecore_con_url_custom_new(). | | | |
| * @param data Payload (data sent on the request) | | | |
| * @param length Payload length. If @c -1, rely on automatic length | | | |
| * calculation via @c strlen() on @p data. | | | |
| * @param content_type Content type of the payload (e.g. text/xml) | | | |
| * | | | |
| * @return #EINA_TRUE on success, #EINA_FALSE on error. | | | |
| * | | | |
| * @see ecore_con_url_custom_new() | | | |
| * @see ecore_con_url_additional_headers_clear() | | | |
| * @see ecore_con_url_additional_header_add() | | | |
| * @see ecore_con_url_data_set() | | | |
| * @see ecore_con_url_data_get() | | | |
| * @see ecore_con_url_response_headers_get() | | | |
| * @see ecore_con_url_time() | | | |
| * @see ecore_con_url_get() | | | |
| * @see ecore_con_url_post() | | | |
| * | | | |
| * @deprecated Use ecore_con_url_post() instead of this. | | | |
| */ | | | |
| EINA_DEPRECATED EAPI Eina_Bool ecore_con_url_send(Ecore_Con_Url *ur | | | |
| l_con, | | | |
| const void *data, | | | |
| long length, | | | |
| const char *conte | | | |
| nt_type); | | | |
| /** | | | |
| * Sends a get request. | | * Sends a get request. | |
| * | | * | |
| * @param url_con Connection object to perform a request on, previously cre
ated | | * @param url_con Connection object to perform a request on, previously cre
ated | |
| * | | * | |
|
| * @return #EINA_TRUE on success, #EINA_FALSE on error. | | * @return @c EINA_TRUE on success, @c EINA_FALSE on error. | |
| * | | * | |
| * The request is performed immediately, but you need to setup event handle
rs | | * The request is performed immediately, but you need to setup event handle
rs | |
| * for #ECORE_CON_EVENT_URL_DATA, #ECORE_CON_EVENT_URL_COMPLETE or | | * for #ECORE_CON_EVENT_URL_DATA, #ECORE_CON_EVENT_URL_COMPLETE or | |
| * #ECORE_CON_EVENT_URL_PROGRESS to get more information about its result. | | * #ECORE_CON_EVENT_URL_PROGRESS to get more information about its result. | |
| * | | * | |
| * @see ecore_con_url_custom_new() | | * @see ecore_con_url_custom_new() | |
| * @see ecore_con_url_additional_headers_clear() | | * @see ecore_con_url_additional_headers_clear() | |
| * @see ecore_con_url_additional_header_add() | | * @see ecore_con_url_additional_header_add() | |
| * @see ecore_con_url_data_set() | | * @see ecore_con_url_data_set() | |
| * @see ecore_con_url_data_get() | | * @see ecore_con_url_data_get() | |
| | | | |
| skipping to change at line 1558 | | skipping to change at line 1617 | |
| * Sends a post request. | | * Sends a post request. | |
| * | | * | |
| * @param url_con Connection object to perform a request on, previously cre
ated | | * @param url_con Connection object to perform a request on, previously cre
ated | |
| * with ecore_con_url_new() or ecore_con_url_custom_new(). | | * with ecore_con_url_new() or ecore_con_url_custom_new(). | |
| * @param data Payload (data sent on the request). Can be @c NULL. | | * @param data Payload (data sent on the request). Can be @c NULL. | |
| * @param length Payload length. If @c -1, rely on automatic length | | * @param length Payload length. If @c -1, rely on automatic length | |
| * calculation via @c strlen() on @p data. | | * calculation via @c strlen() on @p data. | |
| * @param content_type Content type of the payload (e.g. text/xml). Can be
@c | | * @param content_type Content type of the payload (e.g. text/xml). Can be
@c | |
| * NULL. | | * NULL. | |
| * | | * | |
|
| * @return #EINA_TRUE on success, #EINA_FALSE on error. | | * @return @c EINA_TRUE on success, @c EINA_FALSE on error. | |
| * | | * | |
| * The request starts immediately, but you need to setup event handlers | | * The request starts immediately, but you need to setup event handlers | |
| * for #ECORE_CON_EVENT_URL_DATA, #ECORE_CON_EVENT_URL_COMPLETE or | | * for #ECORE_CON_EVENT_URL_DATA, #ECORE_CON_EVENT_URL_COMPLETE or | |
| * #ECORE_CON_EVENT_URL_PROGRESS to get more information about its result. | | * #ECORE_CON_EVENT_URL_PROGRESS to get more information about its result. | |
| * | | * | |
| * This call won't block your main loop. | | * This call won't block your main loop. | |
| * | | * | |
| * @see ecore_con_url_custom_new() | | * @see ecore_con_url_custom_new() | |
| * @see ecore_con_url_additional_headers_clear() | | * @see ecore_con_url_additional_headers_clear() | |
| * @see ecore_con_url_additional_header_add() | | * @see ecore_con_url_additional_header_add() | |
| | | | |
| skipping to change at line 1583 | | skipping to change at line 1642 | |
| * @see ecore_con_url_get() | | * @see ecore_con_url_get() | |
| */ | | */ | |
| EAPI Eina_Bool ecore_con_url_post(Ecore_Con_Url *url_con, | | EAPI Eina_Bool ecore_con_url_post(Ecore_Con_Url *url_con, | |
| const void *data, long length, | | const void *data, long length, | |
| const char *content_type); | | const char *content_type); | |
| /** | | /** | |
| * Sets whether HTTP requests should be conditional, dependent on | | * Sets whether HTTP requests should be conditional, dependent on | |
| * modification time. | | * modification time. | |
| * | | * | |
| * @param url_con Ecore_Con_Url to act upon. | | * @param url_con Ecore_Con_Url to act upon. | |
|
| * @param condition Condition to use for HTTP requests. | | * @param time_condition Condition to use for HTTP requests. | |
| * @param timestamp Time since 1 Jan 1970 to use in the condition. | | * @param timestamp Time since 1 Jan 1970 to use in the condition. | |
| * | | * | |
| * This function may set the header "If-Modified-Since" or | | * This function may set the header "If-Modified-Since" or | |
| * "If-Unmodified-Since", depending on the value of @p time_condition, with
the | | * "If-Unmodified-Since", depending on the value of @p time_condition, with
the | |
| * value @p timestamp. | | * value @p timestamp. | |
| * | | * | |
| * @sa ecore_con_url_get() | | * @sa ecore_con_url_get() | |
| * @sa ecore_con_url_post() | | * @sa ecore_con_url_post() | |
| */ | | */ | |
| EAPI void ecore_con_url_time(Ecore_Con_Url *url_con, | | EAPI void ecore_con_url_time(Ecore_Con_Url *url_con, | |
| Ecore_Con_Url_Time time_condition
, | | Ecore_Con_Url_Time time_condition
, | |
| double timestamp); | | double timestamp); | |
| | | | |
| /** | | /** | |
| * @brief Uploads a file to an ftp site. | | * @brief Uploads a file to an ftp site. | |
|
| | | * | |
| * @param url_con The Ecore_Con_Url object to send with | | * @param url_con The Ecore_Con_Url object to send with | |
| * @param filename The path to the file to send | | * @param filename The path to the file to send | |
| * @param user The username to log in with | | * @param user The username to log in with | |
| * @param pass The password to log in with | | * @param pass The password to log in with | |
| * @param upload_dir The directory to which the file should be uploaded | | * @param upload_dir The directory to which the file should be uploaded | |
|
| * @return #EINA_TRUE on success, else #EINA_FALSE. | | * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. | |
| | | * | |
| * Upload @p filename to an ftp server set in @p url_con using @p user | | * Upload @p filename to an ftp server set in @p url_con using @p user | |
| * and @p pass to directory @p upload_dir | | * and @p pass to directory @p upload_dir | |
| */ | | */ | |
| EAPI Eina_Bool ecore_con_url_ftp_upload(Ecore_Con_Url *url_con, | | EAPI Eina_Bool ecore_con_url_ftp_upload(Ecore_Con_Url *url_con, | |
| const char *filename, | | const char *filename, | |
| const char *user, | | const char *user, | |
| const char *pass, | | const char *pass, | |
| const char *upload_dir); | | const char *upload_dir); | |
| /** | | /** | |
| * Toggle libcurl's verbose output. | | * Toggle libcurl's verbose output. | |
| | | | |
| skipping to change at line 1627 | | skipping to change at line 1688 | |
| * @param verbose Whether or not to enable libcurl's verbose output. | | * @param verbose Whether or not to enable libcurl's verbose output. | |
| * | | * | |
| * If @p verbose is @c EINA_TRUE, libcurl will output a lot of verbose | | * If @p verbose is @c EINA_TRUE, libcurl will output a lot of verbose | |
| * information about its operations, which is useful for | | * information about its operations, which is useful for | |
| * debugging. The verbose information will be sent to stderr. | | * debugging. The verbose information will be sent to stderr. | |
| */ | | */ | |
| EAPI void ecore_con_url_verbose_set(Ecore_Con_Url *url_con, | | EAPI void ecore_con_url_verbose_set(Ecore_Con_Url *url_con, | |
| Eina_Bool verbose); | | Eina_Bool verbose); | |
| /** | | /** | |
| * Enable or disable EPSV extension | | * Enable or disable EPSV extension | |
|
| * @return FIXME: To be more documented. | | * @param url_con The Ecore_Con_Url instance which will be acted upon. | |
| | | * @param use_epsv Boolean to enable/disable the EPSV extension. | |
| */ | | */ | |
| EAPI void ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_co
n, | | EAPI void ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_co
n, | |
| Eina_Bool use_epsv); | | Eina_Bool use_epsv); | |
| | | | |
| /** | | /** | |
| * Enables the cookie engine for subsequent HTTP requests. | | * Enables the cookie engine for subsequent HTTP requests. | |
| * | | * | |
| * @param url_con Ecore_Con_Url instance which will be acted upon. | | * @param url_con Ecore_Con_Url instance which will be acted upon. | |
| * | | * | |
| * After this function is called, cookies set by the server in HTTP respons
es | | * After this function is called, cookies set by the server in HTTP respons
es | |
| | | | |
| skipping to change at line 1791 | | skipping to change at line 1853 | |
| * @see ecore_con_url_cookies_jar_file_set() | | * @see ecore_con_url_cookies_jar_file_set() | |
| */ | | */ | |
| EAPI void ecore_con_url_cookies_jar_write(Ecore_Con_Url *url_c
on); | | EAPI void ecore_con_url_cookies_jar_write(Ecore_Con_Url *url_c
on); | |
| | | | |
| EAPI void ecore_con_url_ssl_verify_peer_set(Ecore_Con_Url *url
_con, | | EAPI void ecore_con_url_ssl_verify_peer_set(Ecore_Con_Url *url
_con, | |
| Eina_Bool verify); | | Eina_Bool verify); | |
| EAPI int ecore_con_url_ssl_ca_set(Ecore_Con_Url *url_con, | | EAPI int ecore_con_url_ssl_ca_set(Ecore_Con_Url *url_con, | |
| const char *ca_path); | | const char *ca_path); | |
| | | | |
| /** | | /** | |
|
| | | * Set HTTP proxy to use. | |
| | | * | |
| | | * The parameter should be a char * to a zero terminated string holding | |
| | | * the host name or dotted IP address. To specify port number in this strin | |
| | | g, | |
| | | * append :[port] to the end of the host name. | |
| | | * The proxy string may be prefixed with [protocol]:// since any such prefi | |
| | | x | |
| | | * will be ignored. | |
| | | * The proxy's port number may optionally be specified with the separate op | |
| | | tion. | |
| | | * If not specified, libcurl will default to using port 1080 for proxies. | |
| | | * | |
| | | * @param url_con Connection object that will use the proxy. | |
| | | * @param proxy Porxy string or @c NULL to disable | |
| | | * | |
| | | * @return @c EINA_TRUE on success, @c EINA_FALSE on error. | |
| | | * @since 1.2 | |
| | | */ | |
| | | EAPI Eina_Bool ecore_con_url_proxy_set(Ecore_Con_Url *url_con, const char * | |
| | | proxy); | |
| | | | |
| | | /** | |
| | | * Set zero terminated username to use for proxy. | |
| | | * | |
| | | * if socks protocol is used for proxy, protocol should be socks5 and above | |
| | | . | |
| | | * | |
| | | * @param url_con Connection object that will use the proxy. | |
| | | * @param username Username string. | |
| | | * | |
| | | * @return @c EINA_TRUE on success, @c EINA_FALSE on error. | |
| | | * | |
| | | * @see ecore_con_url_proxy_set() | |
| | | * | |
| | | * @since 1.2 | |
| | | */ | |
| | | EAPI Eina_Bool ecore_con_url_proxy_username_set(Ecore_Con_Url *url_con, con | |
| | | st char *username); | |
| | | | |
| | | /** | |
| | | * Set zero terminated password to use for proxy. | |
| | | * | |
| | | * if socks protocol is used for proxy, protocol should be socks5 and above | |
| | | . | |
| | | * | |
| | | * @param url_con Connection object that will use the proxy. | |
| | | * @param password Password string. | |
| | | * | |
| | | * @return @c EINA_TRUE on success, @c EINA_FALSE on error. | |
| | | * | |
| | | * @see ecore_con_url_proxy_set() | |
| | | * | |
| | | * @since 1.2 | |
| | | */ | |
| | | EAPI Eina_Bool ecore_con_url_proxy_password_set(Ecore_Con_Url *url_con, con | |
| | | st char *password); | |
| | | | |
| | | /** | |
| | | * Set timeout in seconds. | |
| | | * | |
| | | * the maximum time in seconds that you allow the ecore con url transfer | |
| | | * operation to take. Normally, name lookups can take a considerable time | |
| | | * and limiting operations to less than a few minutes risk aborting perfect | |
| | | ly | |
| | | * normal operations. | |
| | | * | |
| | | * @param url_con Connection object that will use the timeout. | |
| | | * @param timeout time in seconds. | |
| | | * | |
| | | * @see ecore_con_url_cookies_jar_file_set() | |
| | | * | |
| | | * @since 1.2 | |
| | | */ | |
| | | EAPI void ecore_con_url_timeout_set(Ecore_Con_Url *url_con, double timeout) | |
| | | ; | |
| | | | |
| | | /** | |
| | | * Get the returned HTTP STATUS code | |
| | | * | |
| | | * This is used to, at any time, try to return the status code for a transm | |
| | | ission. | |
| | | * @param url_con Connection object | |
| | | * @return A valid HTTP STATUS code, or 0 on failure | |
| | | * | |
| | | * @since 1.2 | |
| | | */ | |
| | | EAPI int ecore_con_url_status_code_get(Ecore_Con_Url *url_con); | |
| | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 36 change blocks. |
| 64 lines changed or deleted | | 223 lines changed or added | |
|