forked from enlightenment/efl
Timers' list is and *ordered list*. Therefore, timers can be added before timer_current in an inner mainloop. Reschedule timer_current in this case before looping through timers' list. Thanks to Barbieri for the insight. The following test didn't work before and it's ok now (I'm adding it to ecore_suite too). static int _timer3(void *data) { printf("timer 3, do nothing\n"); return 0; } static int _timer2(void *data) { printf("timer 2, quit inner\n"); ecore_main_loop_quit(); return 0; } static int _timer1(void *data) { int *times = data; (*times)++; printf("BEGIN: inner\n"); ecore_timer_add(0.3, _timer2, NULL); ecore_timer_add(0.1, _timer3, NULL); ecore_main_loop_begin(); printf("END: inner\n"); ecore_main_loop_quit(); return 0; } int main(void) { int times = 0; ecore_init(); ecore_timer_add(1.0, _timer1, ×); printf("BEGIN: main\n"); ecore_main_loop_begin(); assert(times == 1); printf("timer1 called %d times \n", times); printf("END: main\n"); return 0; } By: Lucas De Marchi <lucas.demarchi@profusion.mobi> SVN revision: 49245 |
||
---|---|---|
.. | ||
debian | ||
doc | ||
m4 | ||
po | ||
src | ||
.cvsignore | ||
AUTHORS | ||
COPYING | ||
COPYING-PLAIN | ||
ChangeLog | ||
INSTALL | ||
Makefile.am | ||
NEWS | ||
README.in | ||
autogen.sh | ||
configure.ac | ||
ecore-cocoa.pc.in | ||
ecore-con.pc.in | ||
ecore-config.pc.in | ||
ecore-directfb.pc.in | ||
ecore-evas.pc.in | ||
ecore-fb.pc.in | ||
ecore-file.pc.in | ||
ecore-imf-evas.pc.in | ||
ecore-imf.pc.in | ||
ecore-input-evas.pc.in | ||
ecore-input.pc.in | ||
ecore-ipc.pc.in | ||
ecore-job.pc.in | ||
ecore-sdl.pc.in | ||
ecore-win32.pc.in | ||
ecore-wince.pc.in | ||
ecore-x.pc.in | ||
ecore.pc.in | ||
ecore.spec.in | ||
ecore.supp |
README.in
Ecore @VERSION@ Requirements: ------------- Must: libc libm Recommended: libX11 libXext libXcursor libXprint libXinerama libXrandr libXss libXrender libXcomposite libXfixes libXdamage libXdpms libXtest OpenSSL CURL Optional: XCB SDL DirectFB Ecore is a clean and tiny event loop library with many modules to do lots of convenient things for a programmer, to save time and effort. It's small and lean, designed to work on embedded systems all the way to large and powerful multi-cpu workstations. It serialises all system signals, events etc. into a single event queue, that is easily processed without needing to worry about concurrency. A properly written, event-driven program using this kind of programming doesn't need threads, nor has to worry about concurrency. It turns a program into a state machine, and makes it very robust and easy to follow. Ecore gives you other handy primitives, such as timers to tick over for you and call specified functions at particular times so the programmer can use this to do things, like animate, or time out on connections or tasks that take too long etc. Idle handlers are provided too, as well as calls on entering an idle state (often a very good time to update the state of the program). All events that enter the system are passed to specific callback functions that the program sets up to handle those events. Handling them is simple and other Ecore modules produce more events on the queue, coming from other sources such as file descriptors etc. Ecore also lets you have functions called when file descriptors become active for reading or writing, allowing for streamlined, non-blocking IO. ------------------------------------------------------------------------------ COMPILING AND INSTALLING: ./configure make (as root unless youa re installing in your users directories): make install ------------------------------------------------------------------------------ BUILDING PACKAGES: RPM: To build rpm packages: sudo rpm -ta @PACKAGE@-@VERSION@.tar.gz You will find rpm packages in your system /usr/src/redhat/* dirs (note you may not need to use sudo or root if you have your own ~/.rpmrc. see rpm documents for more details) DEB: To build deb packages: tar zvf @PACKAGE@-@VERSION@.tar.gz cd @PACKAGE@-@VERSION@ dpkg-buildpackage -us -uc -rfakeroot cd .. rm -rf @PACKAGE@-@VERSION@ You will find all the debian source, binary etc. packages put in the directory where you first untarred the source tarball.