Commit Graph

175 Commits

Author SHA1 Message Date
Carsten Haitzler a08e3d18dc formatting.
SVN revision: 48354
2010-04-27 04:30:55 +00:00
Vincent Torri 898768c963 various fixes for vc++. I'll add the Visual Studio projects later
SVN revision: 47758
2010-04-05 08:26:48 +00:00
Gustavo Sverzut Barbieri e54bd066ec Convert everything to EINA_(TRUE|FALSE)
make it consistent.

By: Lucas de Marchi.



SVN revision: 46539
2010-02-27 00:01:10 +00:00
Gustavo Sverzut Barbieri 2d60db1c2b Fix fd_handlers when using recursive main loops.
If an fd_handler created a recursive main loop (just called
ecore_main_loop_begin()), then this recursive main loop should
continue to process fd_handlers from there and on, thus
fd_handler_current (and win32_handler_current) was added. When going
back from recursion, the current iterator should be updated properly.

This patch also fixes the deletion of fd_handler from recursive main
loops by reference counting them. This way, the node will not be
free()d inside inner loop cleanups and then crash when going back to
outer loop.

PS: win32 code is untested (or even compiled).

The following test case used to crash but not anymore:

#include <Ecore.h>
#include <Eina.h>
#include <unistd.h>

static int _log_dom;
#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)

static Ecore_Fd_Handler *handle;
static int a[2], b[2];

static int cb2(void *data, Ecore_Fd_Handler *h)
{
    INF("cb2 - delete cb1 handle");
    ecore_main_fd_handler_del(handle);
    ecore_main_loop_quit(); /* quits inner main loop */
    return 0;
}

static int cb1(void *data, Ecore_Fd_Handler *h)
{
    unsigned char ch = 222;

    INF("cb1: begin");
    INF("    add cb2");
    ecore_main_fd_handler_add(b[0], ECORE_FD_READ, cb2, NULL, NULL, NULL);
    INF("    wake up pipe b");
    if (write(b[1], &ch, 1) != 1)
        ERR("could not write to pipe b");
    INF("    inner main loop begin (recurse)");
    ecore_main_loop_begin(); /* will it crash due
                              * ecore_main_fd_handler_del(handle)
                              * inside cb2()? It used to!
                              */
    INF("cb1: end");

    ecore_main_loop_quit(); /* quits outer main loop */

    return 0;
}

int main(void)
{
    unsigned char ch = 111;

    ecore_init();

    _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);
    pipe(a);
    pipe(b);

    /*
     * Creating a new main loop from inside an fd_handler callback,
     * and inside this new (inner) main loop deleting the caller
     * callback used to crash since the handle would be effectively
     * free()d, but when the recursion is over the pointer would be
     * used.
     */

    INF("main: begin");
    handle = ecore_main_fd_handler_add
        (a[0], ECORE_FD_READ, cb1, NULL, NULL, NULL);
    INF("main: wake up pipe a");
    if (write(a[1], &ch, 1) != 1)
        ERR("could not write to pipe a");
    ecore_main_loop_begin();
    INF("main: end");
    return 0;
}



SVN revision: 46443
2010-02-24 20:59:44 +00:00
Gustavo Sverzut Barbieri 18b1bf46d7 move bitfield booleans to Eina_Bool.
using one bit with integers will just have room for 0 and -1, not 0 and 1.



SVN revision: 46412
2010-02-23 22:49:15 +00:00
Gustavo Sverzut Barbieri dbc4a40265 Fix the bug of the first timer being added from idler.
We should start doing unit-test for ecore, accumulating these
problems. Follows the test case:

#include <Ecore.h>
#include <Eina.h>

static int _log_dom;
#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)

static int quiter(void *data)
{
    INF("quit!");
    ecore_main_loop_quit();
    return 1;
}

static int idler(void *data)
{
    INF("idler");
    return 1;
}

static int cb1(void *data)
{
    INF("cb1");
    ecore_timer_add(0.0, quiter, NULL);

    return 0;
}

int main(void)
{
    ecore_init();

    _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);

    /*
     * Create a main loop with just idlers, there is a special case
     * for just idlers without timers in ecore.
     *
     * From idler, add a timer that quits the application. It should
     * always quit.
     *
     * If it does not quit, then there is a bug of new timers not
     * being immediately detected and system never exits idle.
     */

    INF("main: begin");
    ecore_idler_add(cb1, NULL);
    ecore_idler_add(idler, NULL);
    ecore_main_loop_begin();
    INF("main: end");
    return 0;
}




SVN revision: 46405
2010-02-23 21:04:38 +00:00
Carsten Haitzler e70759878c rfiddling wiht lop to try and get rid of pauses. i think i found it... plus a
bit of streamlining. need to test more widely now.



SVN revision: 46303
2010-02-19 08:00:44 +00:00
Vincent Torri d1bdb785b1 fix warnings on opensolaris
SVN revision: 45219
2010-01-16 13:44:25 +00:00
Vincent Torri a4b0afb1e4 * move structures from ecore_private.h to the corresponding source files
* add 2 internal ecore_exe functions as ecore_signak.c uses Ecore_Exe members
   no test is done in those 2 functions
 * remove standard headers from ecore_private.h



SVN revision: 44862
2010-01-03 21:55:50 +00:00
Sebastian Dransfeld 0a9456ccf7 Remove duplication from ecore headers
Clean up Ecore.h and ecore_private.h

SVN revision: 44664
2009-12-22 21:15:12 +00:00
Cedric BAIL d8e1895350 * ecore: Use eina_log.
Patch from Mathieu Taillefumier.


SVN revision: 44637
2009-12-21 17:32:19 +00:00
Cedric BAIL 42f896caf2 * ecore: Don't select on deleted fd handler.
SVN revision: 44627
2009-12-21 13:27:58 +00:00
Sebastian Dransfeld 73cde2ffa2 Make clang happy
SVN revision: 44257
2009-12-07 21:01:26 +00:00
Vincent Torri ed3ac88827 Add data and error events in ecore_exe_win32.c.
There are still some problems with the win32 select loop, though

SVN revision: 44229
2009-12-06 19:25:48 +00:00
Vincent Torri f4e1c3a9b9 * add a _del function for win32 HANDLEs
* delete HANDLES when asked
 * minor fixes in the win32 code

SVN revision: 43939
2009-11-23 23:09:48 +00:00
Gustavo Sverzut Barbieri 85111dfe87 do not run cleanup all the time and avoid bug of walking list from
inside list.

if l->next was also deleted by _ecore_main_fd_handlers_cleanup(), then
we had a crash :-(




SVN revision: 43676
2009-11-13 20:34:51 +00:00
Vincent Torri a6713c7af1 Fixes for the Win32 port:
* if ecore_events are in the queue, timeout 0 is passed and
   MsgWaitForMultipleObjects returns immediately, which can
   lead to problems. If timeout is 0, we do nothing (that is,
   we wait for the ecore_events to finish first)
 * manage the case when MsgWaitForMultipleObjects returns WAIT_FAILED

SVN revision: 43547
2009-11-08 22:14:48 +00:00
Vincent Torri f5fec31eb9 wait on HANDLES in the select loop on Windows.
SVN revision: 43253
2009-10-25 07:07:48 +00:00
Vincent Torri 64d7bf0c71 events is an array of HANDLE's, not an array of pointers of HANDLE's
SVN revision: 43162
2009-10-20 10:46:05 +00:00
Vincent Torri 654330e183 warnings--
SVN revision: 42018
2009-08-26 15:43:45 +00:00
Gustavo Sverzut Barbieri 6103d8db01 oops, fix case of timers never being fired while we have idlers.
To reach this case, have a timer that would not be fired on
_ecore_main_loop_iterate_internal(), for example it's not ready yet
(just_added==1), system would get into this inner loop and would never
stop, since there is timer expired now (next_time == 0.0), if we go to
start_loop it would just get into the same loop, not dispatching and
timers.

Python test 04-idler.py triggered that problem.




SVN revision: 41342
2009-07-15 00:11:04 +00:00
Vincent Torri 88e6e10da1 Rework the Windows message loop and the managing of sockets
sent by ecore_pipe. The programs based on Ecore on Windows
do not take 100% of the cpu power anymore.

Patch by Lars Munch, modified by me (formatting + guards)


SVN revision: 41179
2009-06-24 06:14:07 +00:00
Gustavo Sverzut Barbieri 369a502a28 fix nasty bug of timers not being re-evaluated on rare case.
If there are no other main loop activity than a idlers and one idler
adds a timer, the new (and unique) timer would be ignored since it's
flagged as "just_added" and thus next iteration will not consider it,
possible entering an infinite wait as it could be the only thing to do
in main loop.

Antognolli found this nasty bug while handling timeout-and-die in
Ethumb, where the "disconnect" event is dispatched by EDBus from idler
and it was adding a timer to shutdown the daemon after a while without
clients.

By: Rafael Antognolli <antognolli@profusion.mobi>



SVN revision: 40923
2009-06-06 22:31:34 +00:00
Christopher Michael a807d836e6 Remove annoying printf messages when downloading something via ecore.
SVN revision: 40175
2009-04-18 17:16:03 +00:00
Gustavo Sverzut Barbieri 852c598be4 Be able to change select() function used by main loop.
Patch by Kenneth Christiansen, used to integrate with GLib and other
main loops.



SVN revision: 40110
2009-04-16 15:44:26 +00:00
Vincent Torri 99b44984bd fix compilation on Windows
SVN revision: 39984
2009-04-11 13:46:09 +00:00
Carsten Haitzler aa740325f6 andre dieb: patch to fix ebadf handling.
SVN revision: 39932
2009-04-10 12:48:25 +00:00
Gustavo Sverzut Barbieri 56516f66e2 remove more debug code left by cedric.
SVN revision: 39913
2009-04-09 21:31:29 +00:00
Cedric BAIL 140a357fe6 * ecore: Remove debug code.
SVN revision: 39364
2009-03-04 12:40:50 +00:00
Cedric BAIL 775ecc6a05 * Move Ecore_Fd_Handler to Eina_Inlist.
SVN revision: 39360
2009-03-04 10:50:14 +00:00
Vincent Torri 79b536dce8 initialize next_time to -1.0 by default.
this fix a problem on Windows: the ecore main loop
hanged because of GetMessage() if next_time had a
random value.

patch by Lars Munch



SVN revision: 39178
2009-02-24 17:26:26 +00:00
Carsten Haitzler a56a138a2c eek. loop time is wrong when using idlers heavily... leads to jerkybobos. fix!
SVN revision: 39087
2009-02-19 06:02:35 +00:00
Vincent Torri e18508b701 remove a bit the mess n ecore. It's just the first patch...
* add vim header
 * include config.h when necessary
 * fix the order of some include
 * move the standard header in ecore_private.h to the source files

I have recompiled all the efl and e17, and e17 seems to work fine with these changes.
If you encounter problems with that commit, let me know.


SVN revision: 38864
2009-01-31 18:33:39 +00:00
Vincent Torri b1f46fb7e8 remove trailing spaces
SVN revision: 37851
2008-11-29 11:23:17 +00:00
Vincent Torri e3dd190240 remove the problem of the main loop taking 100% of the cpu
consumption on Windows


SVN revision: 37699
2008-11-18 06:56:31 +00:00
Carsten Haitzler 41ac47244f remove more useless ecore_time_get's
SVN revision: 37392
2008-11-02 02:19:18 +00:00
Carsten Haitzler b2edd2d7d6 new ecore_loop_time_get() call. also priority setting for spawning sub-procs
SVN revision: 37389
2008-11-02 01:29:08 +00:00
Peter Wehrfritz 19106de2a1 warnings--
SVN revision: 36457
2008-10-05 18:33:35 +00:00
doursse f372541271 minor header inclusion fixes for vc++
SVN revision: 34800
2008-06-11 20:36:35 +00:00
Carsten Haitzler 28bb3a6a08 ok - see comments with idle-enter.
SVN revision: 34779
2008-06-09 12:15:34 +00:00
doursse cc0ca9325e integration of evil in ecore. It's compiling on windows and my ubuntu. The commit is big, please report any problem
SVN revision: 34671
2008-05-26 05:16:34 +00:00
Carsten Haitzler 9d31648720 revert pselect - breaks e init and entrance
SVN revision: 33829
2008-02-24 08:42:39 +00:00
Carsten Haitzler c31c2c50c3 use pselect - from lars. testing now in a wider audience.
SVN revision: 33827
2008-02-24 04:56:28 +00:00
Mike Frysinger 4c62111e44 relegate _WIN32 ifdef mess to ecore_private.h
SVN revision: 33620
2008-01-26 10:11:48 +00:00
Mike Frysinger 184812f289 replace a lot of win32 ifdef hacks with autoconf checks
SVN revision: 33616
2008-01-26 05:40:53 +00:00
Peter Wehrfritz 6a586399c2 typo and formating
SVN revision: 33611
2008-01-25 18:22:51 +00:00
doursse 4a6cc12b9c remove printf's. Sorry for the big commit, it was not intended to be done now, but it would have been in cvs anyway
SVN revision: 32810
2007-11-21 12:28:00 +00:00
doursse f5cc49bd44 forgot to add glew support in configure.in
SVN revision: 32809
2007-11-21 12:16:16 +00:00
doursse a8ebdc324c * port ecore_plugin to windows
* add comments after some #endif
 * speed up the compilation on windows
 * remove some trailing spaces in ecore_path.c


SVN revision: 31890
2007-09-30 15:24:51 +00:00
doursse 50432552c8 add windows support to ecore. ecore_evas is ported too (directdraw and direct3d. No opengl yet). It needs to be tested a lot, though. Remove some trailing spaces here and there. Replace WIN32 with _WIN32
SVN revision: 31513
2007-08-26 11:17:21 +00:00
David Walter Seikel 20a8865152 * fork'n'pipe now has stderr support.
* both exe run functions now use the same code.
* don't allocate pipes that wan't be used.  This made the code much cleaner.
* track and free the exe timers as needed.

E still reports a naughty null timer free at shutdown time, but I don't
think its in ecore_exe.  I'll valgrind it later.

The error fd handler is curently an identical copy of the read fd handler,
with only the names changed.  That's a big slab of code that is duplicated.
I'll merge the two into something generic next.

raster also mentioned that say the first ten lines or so of stderr should
be thrown into a dialog and shown to the user.  I don't know if there is a
way to do that from ecore, or if the user of ecore_exe has to do that
themselves.  The stderr support does line buffered mode just like the read
support, but has not been tested yet.  I'll test properly after the merge.


SVN revision: 19700
2006-01-10 16:46:07 +00:00
Carsten Haitzler cb2dc9c0d7 headers before setting up symbol hiding
SVN revision: 19588
2006-01-07 06:48:56 +00:00
Carsten Haitzler 12aa35dd99 fix up some warnings
SVN revision: 19563
2006-01-06 17:58:12 +00:00
Carsten Haitzler 5ba10bb385 symbol hiding fixes
SVN revision: 19556
2006-01-06 13:56:47 +00:00
David Walter Seikel f26fc9014e Just to be paranoid, and coz devilhorns caught it doing this, check for
various naughty timeout values.


SVN revision: 19476
2006-01-01 20:29:34 +00:00
David Walter Seikel a119e26657 More documentation for fd_handler return values as per the mailing list discussion.
SVN revision: 19129
2005-12-19 01:36:55 +00:00
tsauerbeck dff4dba310 don't call the prepare callback if the fd_handler is about to be deleted
SVN revision: 16819
2005-09-20 19:15:49 +00:00
sebastid 19d9aa1452 Move Ecore_Oldlist to Ecore_List2 and rename the funcs from _list_
to _list2_


SVN revision: 16425
2005-08-30 10:05:27 +00:00
tsauerbeck ba12acb93d fixed a warning
SVN revision: 13958
2005-03-28 09:00:08 +00:00
tsauerbeck 421719f1d2 Ecore_Fd_Handler: added a 'prepare' callback, that is called just before the main loop does its select() run for the FD handlers
SVN revision: 13957
2005-03-28 08:55:59 +00:00
Carsten Haitzler de28192bda kwo's ecore cleanup patch
SVN revision: 13559
2005-03-02 07:06:44 +00:00
Carsten Haitzler db82afca3b some defines, a fix for ecores main loop so if an idle enterer generates
events we dont sit and wait on timers or fd's before processing them.


SVN revision: 12145
2004-11-08 00:08:26 +00:00
tsauerbeck f83c81433d mingw portability
SVN revision: 11926
2004-10-20 17:51:29 +00:00
ncn 0d31f7f17b Cleaned up the FD Handler stuff, grouped it, linked it to the Ecore.h file description.
SVN revision: 11703
2004-09-23 04:05:13 +00:00
ncn 4dc39d4dfa Some restructuring, clean up, grouping, explaining, etc. Getting there...
SVN revision: 11696
2004-09-22 08:17:15 +00:00
Carsten Haitzler 249e1f882d and check other fd's if our buffers have events too - just in case... :)
SVN revision: 10480
2004-06-09 10:35:01 +00:00
Carsten Haitzler 85c1125116 more agressive quit...
SVN revision: 10189
2004-05-13 03:20:13 +00:00
Carsten Haitzler 093bd1d9c2 nathan's docs :)
SVN revision: 10113
2004-05-08 04:44:04 +00:00
xcomputerman 1034f13443 Merge Ewd code into Ecore.
The new functions (Ecore_Data.h) have not been tested yet, be warned! :)


SVN revision: 9384
2004-03-18 05:29:54 +00:00
Carsten Haitzler 5a4428d1b2 debugging stuff to help profile an application using evas/ecore etc. to see
where (rougly) time is spent (as it runs - dynamically). quite useful if your
code is dropping frames to keep animation going - but u'd like to know when
exactly its happening so you can lean down the graphics design or the code in
those situations.


SVN revision: 9379
2004-03-17 05:14:13 +00:00
Carsten Haitzler 2b2c5f4874 indenting cleanliness
SVN revision: 9103
2004-02-25 02:24:59 +00:00
tsauerbeck d245bdc21c Added ECORE_FD_ERROR to go w/ ECORE_FD_READ AND _WRITE. I couldn't trigger the error 'event' though, which makes me wonder whether i missed something
SVN revision: 9096
2004-02-24 19:45:01 +00:00
Carsten Haitzler 75047789ad slight change in doc comments... get rid of htmlisms...
SVN revision: 9037
2004-02-20 07:06:29 +00:00
Carsten Haitzler 532c2ef39b volatile little suckers
SVN revision: 7854
2003-11-10 04:48:28 +00:00
Carsten Haitzler a5c2425084 damn you salizar! damn you!
errr. i mean. ecore moves to HEAD!


SVN revision: 7475
2003-09-23 08:09:32 +00:00