Commit Graph

2469 Commits

Author SHA1 Message Date
Lucas De Marchi 7051feb04e Fix callback signatures
The change from returning int to Eina_Bool left several call sites with
warnings because they were not updated. Here they are fixed by using
Coccinelle, a tool that allows us to automate tasks like that. This
commit was generated from the following semantic patch:

virtual org

@r1@
identifier fn!=NULL, fn2;
expression E1, E2, E3;
@@
(
ecore_event_handler_add(E1, fn, ...)
|
ecore_event_filter_add(E1, fn, ...)
|
ecore_idler_add(fn, ...)
|
ecore_idle_enterer_add(E1, fn, ...)
|
ecore_idle_enterer_before_add(E1, fn, ...)
|
ecore_idle_exiter_add(E1, fn, ...)
|
ecore_main_fd_handler_add(E1, E2, fn, E3, fn2, ...)
|
ecore_main_win32_handler_add(E1, fn, ...)
|
ecore_timer_add(E1, fn, ...)
|
ecore_timer_loop_add(E1, fn, ...)
|
ecore_animator_add(fn, ...)
|
ecore_poller_add(E1, E2, fn, ...)
)

@r2@
identifier r1.fn;
identifier ret;
typedef Eina_Bool;
position p;
@@
- int
+ Eina_Bool
fn@p(...) {
<...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...>
}

@r3@
identifier r1.fn2;
identifier ret;
position p;
@@
- int
+ Eina_Bool
fn2@p(...) {
...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...
}

@r4@
identifier r1.fn;
@@
- int
+ Eina_Bool
fn(...);

@r5@
identifier r1.fn2;
@@
- int
+ Eina_Bool
fn2(...);

@script:python depends on org@
p << r2.p;
f << r1.fn;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg

@script:python depends on org@
p << r3.p;
f << r1.fn2;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg



SVN revision: 49985
2010-07-02 01:38:05 +00:00
Brett Nash bb4c28dbb1 Commit ecore_evas_ecore_evases get
Coming soon:
	ecore_ecore_evas_evas_get
	evas_ecore_ecore_evas_get
	get_ecore_evas_ecore_evas_name_gen()


SVN revision: 49983
2010-07-02 00:32:56 +00:00
Cedric BAIL d1fcb71f84 * ecore: add ecore_long_run facility with notify to main loop.
SVN revision: 49948
2010-06-30 13:25:28 +00:00
Vincent Torri eeddb1f399 fix returned type of callbacks
SVN revision: 49878
2010-06-26 15:38:50 +00:00
Vincent Torri ed3725ddcd fix returned type of callbacks
SVN revision: 49877
2010-06-26 15:35:30 +00:00
Cedric BAIL fbe9064310 * ecore: Ecore callback really should return Eina_Bool.
SVN revision: 49829
2010-06-24 16:15:56 +00:00
Brett Nash 5779ea8a4c Pass original data to targest selections
Users of targets may well want the atoms anyway.


SVN revision: 49811
2010-06-23 08:01:43 +00:00
Vincent Torri a90bb64143 fix icccm
Patch by Alexander Kerner


SVN revision: 49691
2010-06-15 23:45:45 +00:00
Vincent Torri eb4c9979f2 fix for double free, occured while processing a buffered event twice.
patch by Alexander Kerner


SVN revision: 49690
2010-06-15 22:37:07 +00:00
Vincent Torri af955f4767 wrong symbol
SVN revision: 49674
2010-06-14 20:44:44 +00:00
Vincent Torri 698ac34608 formatting
SVN revision: 49672
2010-06-14 19:34:14 +00:00
Vincent Torri de14ee6ecf fix compilation
SVN revision: 49671
2010-06-14 19:32:24 +00:00
Vincent Torri b1a203f57b fix selection compilation
SVN revision: 49670
2010-06-14 19:22:45 +00:00
Vincent Torri 635ac723f6 add the missing functions
ecore_x_sync_counter_new()
ecore_x_sync_counter_free()
ecore_x_sync_counter_inc()
ecore_x_sync_counter_val_wait()


SVN revision: 49669
2010-06-14 19:21:11 +00:00
Vincent Torri 5d148e55b1 fix code.
Patch by Mikhail Gusarov


SVN revision: 49668
2010-06-14 19:19:30 +00:00
Vincent Torri 7c4ab89bc9 XCB used to provide iterators for requests returning
list of values. Recent versions dropped it and return
arrays instead. Adapt code to use arrays unconditionally
(arrays were present in earlier libxcb versions).

Patch by Mikhail Gusarov


SVN revision: 49667
2010-06-14 19:17:49 +00:00
Cedric BAIL 238b9836ca * ecore: return Eina_Bool instead of int when it make sense.
Patch from Nicolas Aguirre.


SVN revision: 49611
2010-06-10 11:57:12 +00:00
Brett Nash 08bee8f6b7 Ecore_x_selection convert is now a little richer.
Allows implementation of proper X cut & paste by an applicaiton, exisitng code
should not be affected (may need an recompile).


SVN revision: 49586
2010-06-09 09:40:37 +00:00
Carsten Haitzler 194fc4c4ac fix cedric b0rk
SVN revision: 49569
2010-06-08 11:31:15 +00:00
Cedric BAIL f3457b3bdf * ecore_con: close connection when other side end it.
SVN revision: 49567
2010-06-08 11:08:43 +00:00
Carsten Haitzler bba7aaba2a quick - limit # of tries for reading... this means 1000% cpu usage...
but at least things dont hang.



SVN revision: 49566
2010-06-08 11:02:57 +00:00
Carsten Haitzler d36320a7de off! shhh!
SVN revision: 49565
2010-06-08 08:05:30 +00:00
Brett Nash d186808783 Minor tweak: Include stdio if logging enabled (ugly, but it is for debug)
SVN revision: 49564
2010-06-08 07:20:12 +00:00
Cedric BAIL 6aac60a150 * ecore_con: with AF_UNSPEC, c-ares will prefer IPv4 address
when IPv4 and IPv6 exist, if you ask AF_INET6, it will first
	try IPv6 before falling back to IPv4 address.

	So now ecore_con_ares will prefer IPv6 if available.


SVN revision: 49552
2010-06-07 13:08:19 +00:00
Cedric BAIL d76f881898 * ecore_con: improve error detection.
SVN revision: 49551
2010-06-07 13:05:49 +00:00
Carsten Haitzler eb886add0e be mroe explicit on keeping im handle.
SVN revision: 49444
2010-06-04 06:36:54 +00:00
Carsten Haitzler 6e1b5c42fa formatting.
SVN revision: 49441
2010-06-04 04:53:10 +00:00
Carsten Haitzler 8fba7a4476 formatting.
SVN revision: 49440
2010-06-04 04:45:53 +00:00
Carsten Haitzler f8cc974e07 didnt set right ptr to null
SVN revision: 49439
2010-06-04 04:18:50 +00:00
Lucas De Marchi 4ce0e74d63 housekeeping++
* process filters in their own function
* remove commented printf
* remove trailing white space
* lower indentation needed by breaking loop instead of a big if



SVN revision: 49436
2010-06-04 02:47:00 +00:00
Lucas De Marchi bda2b1d0af Fix current event pointer when walking filters
When walking the filters' list, using event_current might screw a
recursive main loop that had to process filters *and* events on the
first iteration. Thus, use a new pointer to mark the current event being
treated when walking filters' list.

Tests for this one is difficult. I'll try to think about a test later.



SVN revision: 49435
2010-06-04 02:45:47 +00:00
Lucas De Marchi 0fa2ca5721 Fix semantics of event->delete_me
* _ecore_event_purge_deleted() purges only events marked with
delete_me
* _ecore_events_exist() walks the events list to control that
at least one event with delete_me == 0 exists

Tests coming in a separate patch.



SVN revision: 49434
2010-06-04 02:45:20 +00:00
Carsten Haitzler eb4b780754 set magic to none later - and set props to null after freeing each -
in case del callbacks on objects access ee.



SVN revision: 49410
2010-06-03 12:33:27 +00:00
Lucas De Marchi c3dd8fa055 Fix ecore_events for recursive main loops
This fixes the following scenario:
1) An event handler starts another main loop
2) The new main loop processes all the remaining event_handlers of this
event and the remaining events
3) New events are added to the events list
4) A new iteration occurs

Prior behavior was that on (4) the events already processed were
triggered again. The code added to ecore_suite shows a test case,
similar to the one that is fixed now for modal dialogs on WebKit-EFL. I
preferred to let the INF() messages in order to be easy to copy, paste
and debug outside of the suite if anyone wants to. When the number of
tests grows more, we might want to separate them in different files.

By: Lucas De Marchi <lucas.demarchi@profusion.mobi>



SVN revision: 49390
2010-06-02 06:20:18 +00:00
Carsten Haitzler e232fcd42b make other defines in ecore the same.
SVN revision: 49300
2010-05-29 13:59:42 +00:00
Carsten Haitzler b28f662869 bah. VMIN conflicts with system header defines ... termin.h
SVN revision: 49299
2010-05-29 13:56:21 +00:00
Carsten Haitzler 427b678d44 proto wrong. fix.
SVN revision: 49298
2010-05-29 13:49:43 +00:00
Carsten Haitzler d639576e8e wanring: shadddaaap
SVN revision: 49297
2010-05-29 13:43:48 +00:00
Carsten Haitzler 78fd14d116 more extern c outside typedefs etc.
SVN revision: 49273
2010-05-29 06:37:02 +00:00
Carsten Haitzler 17263ea263 add ecore versioning
SVN revision: 49271
2010-05-29 06:28:25 +00:00
Lucas De Marchi 98d843e91b Reschedule timer_current in case of inner mainloop
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, &times);
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
2010-05-28 02:31:02 +00:00
Carsten Haitzler 17873647fc ooh someone somewhere made the main event loop not work quite right.
fix if event purge happens to generate events.



SVN revision: 49203
2010-05-26 11:40:22 +00:00
Carsten Haitzler eaad0eb095 big patch from Samsung SAIT (Advanced research group) for async multi-frame
rendering. to turn on:

1.
configure with --enable-async-render
2.
export EVAS_RENDER_MODE=non-blocking
  
presto. necessitates some api swizzling (thus the expedite. ecore etc. changes)

the kind of results you get on a desktop:

http://www.rasterman.com/files/evas-async-vs-none.html



SVN revision: 49087
2010-05-21 07:10:45 +00:00
Carsten Haitzler 1ea1a6d3cc oops typo.
SVN revision: 49050
2010-05-20 04:47:53 +00:00
Lukasz Wrzosek 4957dd16fe From: Lukasz Wrzosek <l.wrzosek@samsung.com>
I’ve prepared basic patch to add support for custom malloc/free functions for
buffer management. (with changes to api from raster to addd void *data param
to alloc/free callbacks and naming and ordering changes).



SVN revision: 49044
2010-05-20 03:53:54 +00:00
Mike Blumenkrantz d55e116a4e added functions for changing/getting a poller's poll interval: ecore_poller_poller_interval_(set|get) along with dox for them
surprisingly enough they seem to work!


SVN revision: 49002
2010-05-19 09:16:37 +00:00
Davide Andreoli ee29a2423d ecore_file_download(): Call the completion_cb (with error status) when a download is aborted
SVN revision: 48988
2010-05-18 23:06:07 +00:00
Carsten Haitzler 9b50145007 formatting cleanups.
SVN revision: 48970
2010-05-18 08:01:06 +00:00
Carsten Haitzler cbebd8f00b data passed in wrong order! fix.
SVN revision: 48964
2010-05-18 06:59:59 +00:00
Christopher Michael 0cad792cb6 Fix typos ;)
SVN revision: 48958
2010-05-18 04:13:13 +00:00
Carsten Haitzler 194aa90d0c handle info_set failures.
SVN revision: 48957
2010-05-18 03:50:17 +00:00
Carsten Haitzler 79f1448682 CEEEEEEEEEEEEEEEEEEEEEEEEDRIC! *spank*
SVN revision: 48907
2010-05-16 03:04:18 +00:00
Vincent Torri 3185c6d8a0 * redirection of stdout and stderr (with libc or win32 apps) is working
* there is though a problem in the win32 select function: the _del
   callback is always sent before _data or _error callback


SVN revision: 48897
2010-05-15 18:38:01 +00:00
Carsten Haitzler 67060c70ee more netwm window types - they were missed!
SVN revision: 48884
2010-05-15 05:38:21 +00:00
Sebastian Dransfeld 0f4eb30d82 ecore_con: remove unused variable
SVN revision: 48821
2010-05-13 20:24:16 +00:00
Vincent Torri 141a2bb9a8 fix the Windows select function:
* On Windows, the values returned by pipe() are sockets.
   Hence they can be huge. Iterate over the list of "fds"
   instead of the max value
 * In the loop which iterates over the win32 handlers,
   we never go to the next element, so infinite loop...


SVN revision: 48807
2010-05-13 08:10:17 +00:00
Christopher Michael 54a9f1023d Fix 'return' with a value in function returning void.
SVN revision: 48754
2010-05-11 14:01:42 +00:00
Carsten Haitzler 8abda5cb05 only do auth stuff if there in curl.
SVN revision: 48749
2010-05-11 12:10:29 +00:00
Rui Seabra b923e09da0 This commit implements http auth support; in order to avoid exposing too much of curl's internal workings, I opted to have a safety parameter in order to choose between CURLAUTH_ANY and CURLAUTH_ANYSAFE.
SVN revision: 48715
2010-05-09 15:06:06 +00:00
Vincent Torri 798e88594f * fix comment
* do consistent test (though it is useless)


SVN revision: 48708
2010-05-09 06:03:46 +00:00
Carsten Haitzler 9c96f2b98e try right #ifdef
SVN revision: 48707
2010-05-09 05:51:10 +00:00
Carsten Haitzler e2279c66c4 support new gl enigne rotate ability from ecore-evas
SVN revision: 48705
2010-05-09 05:15:55 +00:00
Hannes Janetzek 9dc6c78922 added fuction to send httposts created with curl formadd.
SVN revision: 48651
2010-05-06 20:18:39 +00:00
Cedric BAIL 9522f7ab27 * ecore: make it possible to easily freeze/thaw animator.
NOTE: logic could be optimised as in some case we could just stop
	the timer also.


SVN revision: 48580
2010-05-03 16:21:39 +00:00
Carsten Haitzler 0dc8a3d0b7 \n--
SVN revision: 48371
2010-04-28 00:05:56 +00:00
Carsten Haitzler 9941fd4f8e better debug/error output for foreign fd issues.
SVN revision: 48370
2010-04-27 23:53:08 +00:00
Carsten Haitzler ea3dace944 handle url set better
SVN revision: 48358
2010-04-27 10:53:25 +00:00
Carsten Haitzler a08e3d18dc formatting.
SVN revision: 48354
2010-04-27 04:30:55 +00:00
Vincent Torri 5f6f8cbc48 fix vc++ compilation
SVN revision: 48064
2010-04-17 05:35:13 +00:00
Vincent Torri 65525e9412 fix warning with vc++
SVN revision: 48063
2010-04-17 05:34:55 +00:00
Iván Briano e0dedc5eb9 Release lock before returning
SVN revision: 47980
2010-04-12 21:51:35 +00:00
Carsten Haitzler c2da1184b6 dump and flush protocol added.
SVN revision: 47948
2010-04-12 08:24:19 +00:00
Christopher Michael 02c4cbac7d New function/atoms for Toggle of Quickpanel (for cases where we do not know
the current quickpanel state).



SVN revision: 47935
2010-04-11 20:37:11 +00:00
Hannes Janetzek 5fd3adcc68 make ecore thread cancel work. someone knowing the internals should check this again.
SVN revision: 47866
2010-04-09 04:52:04 +00:00
Iván Briano d6f36ae575 'tis an array of pointers, not just a string
SVN revision: 47824
2010-04-07 22:09:26 +00:00
Vincent Torri 62b6d186cd revert. does not work
SVN revision: 47771
2010-04-05 18:20:49 +00:00
Vincent Torri ac2824d126 remove C99 features and use beautiful C89/BSD code
makes vc++ and win32 gcc/g++ happy


SVN revision: 47766
2010-04-05 17:48:08 +00:00
Vincent Torri 5751012d30 include process.h for vc++
SVN revision: 47760
2010-04-05 08:38:11 +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
Vincent Torri 88882132c3 remove unused files
SVN revision: 47507
2010-03-27 18:32:03 +00:00
Vincent Torri c77c8c6cb3 more quartz -> cocoa renaming
SVN revision: 47506
2010-03-27 18:28:50 +00:00
Gustavo Sverzut Barbieri 9bf201e26e add debugs and warnings to ecore_evas_new().
Sometimes it might be useful for the tester to detect the engine that
is being used.



SVN revision: 47391
2010-03-23 17:35:22 +00:00
Carsten Haitzler a0bd0a91b8 formatting.
SVN revision: 47369
2010-03-22 09:37:27 +00:00
Carsten Haitzler a7b8c813a9 formatting.... fix.
SVN revision: 47368
2010-03-22 09:20:33 +00:00
Carsten Haitzler e8d5b972b4 --enable-glib-integration-always <- option. can be disabled by
ecore_main_loop_glib_always_integrate_disable() before ecore_init()



SVN revision: 47360
2010-03-22 03:30:40 +00:00
Vincent Torri 43f88cb30d Second part of the renaming 'quartz' -> 'cocoa'
API break. Not really important for now as that port
is in a very bad shape anyway



SVN revision: 47340
2010-03-19 06:57:47 +00:00
Vincent Torri 0b168c9813 First part of the renaming 'quartz' -> 'cocoa'
Quartz is the name of the graphic library
Cocoa is the Objective C API to build applications

I can't test this so maybe I have forgotten some
modifications to do. Please report any problem in
that thread


SVN revision: 47339
2010-03-19 06:48:08 +00:00
Cedric BAIL d1ce34964b * ecore: Add memory statistic support. Set ECORE_MEM_STAT environment
variable to get them.


SVN revision: 47319
2010-03-18 14:43:39 +00:00
Carsten Haitzler bf9b51d12b only send rend done if syncing.
SVN revision: 47288
2010-03-16 12:31:09 +00:00
Davide Andreoli d2f31bbf04 More doxy for ecore_file_download() and ecore_file_download_abort()
SVN revision: 47200
2010-03-14 10:53:14 +00:00
Vincent Torri f7b7217437 remove ecore_con_dns
SVN revision: 47077
2010-03-09 12:57:38 +00:00
Carsten Haitzler 755e44a6d9 no more ecore-data - as warned before. going going oging... gone!
SVN revision: 46994
2010-03-08 12:03:50 +00:00
Vincent Torri f447e95940 update to latest scb-util version (xcb icccm api changed)
SVN revision: 46987
2010-03-08 08:12:45 +00:00
Vincent Torri 4c776308fb remove ecore_txt
SVN revision: 46985
2010-03-08 08:08:04 +00:00
Carsten Haitzler 44b2b3fb46 init values with null.
SVN revision: 46973
2010-03-08 01:14:12 +00:00
Vincent Torri 9328392a28 include Ecore.h before ecore_private.h
SVN revision: 46879
2010-03-04 21:39:21 +00:00
Carsten Haitzler e5d2bea7ec oops! screen 0 not 1!
SVN revision: 46779
2010-03-02 08:06:37 +00:00
Carsten Haitzler 07a9e63cb4 missing call if gl enigne not built.
SVN revision: 46763
2010-03-02 01:43:45 +00:00
Carsten Haitzler 4d33962b8c set win to 0 - in case
SVN revision: 46684
2010-03-01 12:01:57 +00:00
Carsten Haitzler 2a70e8701c allow alpha ee windows.
SVN revision: 46678
2010-03-01 04:44:36 +00:00
Gustavo Sverzut Barbieri dba2a95572 warnings--
Ecore now goes clean on -Wall -Wextra :-)



SVN revision: 46672
2010-02-28 23:27:47 +00:00
Vincent Torri e9b5f89824 F_SETFL and O_NONBLOCK are supported by evil
SVN revision: 46658
2010-02-28 17:38:24 +00:00
Gustavo Sverzut Barbieri 336e1aac6c Revert EINA_(TRUE|FALSE) as requested by vincent.
windows have TRUE/FALSE and he wants it to be like that, if required
he will replace the efl-specific places later.



SVN revision: 46586
2010-02-27 16:45:20 +00:00
Carsten Haitzler 498dec5154 hmm fix resize before change alpha...
SVN revision: 46579
2010-02-27 14:40:10 +00:00
Gustavo Sverzut Barbieri b2816b08e9 ecore_txt is also a thin and picky wrapper around eina_str_convert()
this remove explicit dependency on iconv, so no checks are required
anymore.



SVN revision: 46546
2010-02-27 01:10:26 +00:00
Gustavo Sverzut Barbieri 064cea0516 be picky about ecore_data even during runtime.
let's try to remove ecore_data from code asap, so we can remove it
from svn as well.

If you need help ask mail list or #edevelop.



SVN revision: 46545
2010-02-27 01:01:03 +00:00
Gustavo Sverzut Barbieri 1f03f022fb be picky even during runtime, let's try to spot and remove these ASAP.
SVN revision: 46544
2010-02-27 00:56:36 +00:00
Gustavo Sverzut Barbieri f838e162b3 ecore_data is deprecated, flag everything as such.
those functions with drop-in replacement are just calls to the eina version.



SVN revision: 46543
2010-02-27 00:53:58 +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
Christopher Michael 300d53a4f4 Patch from Brian Wang to fix the TRUE/FALSE --> EINA_TRUE/EINA_FALSE mess.
(NB: Win32/CE people may need to fix some TRUE/FALSE parts...couldn't test
those).

Thanks Brian :)



SVN revision: 46503
2010-02-26 05:56:49 +00:00
Cedric BAIL 816974ff0b * ecore: Match what doc when disabling thread support in ecore.
SVN revision: 46467
2010-02-25 15:26:38 +00:00
Carsten Haitzler 02d8dc445f why do a round trip for local info like.. root window # 0...
SVN revision: 46460
2010-02-25 12:26:25 +00:00
Carsten Haitzler b0045cb9b7 add lots of logging functions - for trackign x overhead when u cant get
symbols... booo! - disabled of course.



SVN revision: 46458
2010-02-25 12:19:02 +00:00
Ulisses Furquim f316516b1c Checking init count before actually freeing ecore evases.
SVN revision: 46447
2010-02-24 22:48:55 +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
Vincent Torri 89594ec456 fix declaration of struct addrinfo
SVN revision: 46434
2010-02-24 17:52:54 +00:00
Carsten Haitzler eb650a7300 some roundtrips--
SVN revision: 46420
2010-02-24 04:36:22 +00:00
Gustavo Sverzut Barbieri 50d0af9d5e Fix events when using recursive main loops.
If an event handler/filter created a recursive main loop (just called
ecore_main_loop_begin()), then this recursive main loop should
continue to process events/handlers/filters from there and on, thus
event_current/event_filter_current/event_handler_current were
added. When going back from recursion, the current iterator should be
updated properly.

The following test case used to crash but not anymore:

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

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

static Ecore_Event_Handler *handle;

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

static int cb1(void *data, int type, void *event)
{
    Ecore_Event *e;

    INF("cb1: begin");
    INF("    add cb2");

    type = ecore_event_type_new();
    ecore_event_handler_add(type, cb2, NULL);
    e = ecore_event_add(type, NULL, NULL, NULL);
    INF("    add event to trigger cb2: event=%p", e);
    INF("    inner main loop begin (recurse)");
    ecore_main_loop_begin(); /* will it crash due
                              * ecore_event_handler_del(handle) inside
                              * cb2()? It used to!
                              */
    INF("cb1: end");

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

    return 0;
}

int main(void)
{
    Ecore_Event *e;
    int type;

    ecore_init();

    _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);

    /*
     * Creating a new main loop from inside an event 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.
     */

    type = ecore_event_type_new();

    INF("main: begin");
    handle = ecore_event_handler_add(type, cb1, NULL);
    e = ecore_event_add(type, NULL, NULL, NULL);
    INF("    add event to trigger cb1: event=%p", e);
    INF("    main loop begin");
    ecore_main_loop_begin();
    INF("main: end");
    return 0;
}




SVN revision: 46419
2010-02-24 02:30:27 +00:00
Gustavo Sverzut Barbieri b9c3b58561 events (also filters and handlers) now have reference counting.
Add reference counting to events, event filters and event handlers so
they can recurse main loops.

Note that the required "continuation" when entering main loops is not
there, thus recursion will restart and this will fail badly in lots of
cases. This should be fixed in future commits.



SVN revision: 46417
2010-02-24 01:16:00 +00:00
Gustavo Sverzut Barbieri 0bdbf9d147 rewrite ecore_timer internals to make it simpler and do better with
recursive main loops.

Unlike idlers, timers seems to work reasonably well with main loops, I
*think* they might fail since it used a boolean to flag running as
opposed to a reference count with incremental increments/decrements. I
could not write a test case to demonstrate so.

The now code should be simpler, particularly the
_ecore_timer_call(). It will also consider the previous position when
entering recursive main loops, preserving the order.

Deletion of timers are delegated to ecore_main.c, that was already
calling _ecore_timer_cleanup() after timers were executed.



SVN revision: 46416
2010-02-24 00:27:04 +00:00
Christopher Michael 34f6da920a Actually send the events wrt randr changes.
SVN revision: 46414
2010-02-23 23:32:30 +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 0c24c76c5a Fix idle_exiters when using recursive main loops.
If an idle_exiter created a recursive main loop (just called
ecore_main_loop_begin()), then this recursive main loop should
continue to process idle_exiters from there and on, thus
idle_exiter_current was added. When going back from recursion, the
current iterator should be updated properly.

This patch also fixes the deletion of idle_exiters 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.

The following test case used to crash but not anymore:

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

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

static Ecore_Idle_Exiter *handle;

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

static int timer(void *data)
{
    INF("timer (exited idle!)");
    return 0;
}

static int exit_idle(void *data)
{
    INF("add request (timer) to exit idle");
    ecore_timer_add(0.0, timer, NULL);
    return 0;
}

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

static int cb1(void *data)
{
    INF("cb1: begin");
    INF("    add cb2");
    ecore_idle_exiter_add(cb2, NULL);
    INF("    add exit idler");
    ecore_idler_add(exit_idle, NULL);
    INF("    inner main loop begin (recurse)");
    ecore_main_loop_begin(); /* will it crash due ecore_idle_exiter_del(handle)
                              * inside cb2()? It used to!
                              */
    INF("cb1: end");

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

    return 0;
}

int main(void)
{
    ecore_init();

    _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);

    /*
     * Creating a new main loop from inside an idle_exiter 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_idle_exiter_add(cb1, NULL);
    ecore_idler_add(idler, NULL);
    ecore_idler_add(exit_idle, NULL);
    ecore_main_loop_begin();
    INF("main: end");
    return 0;
}



SVN revision: 46410
2010-02-23 22:25:35 +00:00
Gustavo Sverzut Barbieri 1c3348513a Fix idle_enterers when using recursive main loops.
If an idle_enterer created a recursive main loop (just called
ecore_main_loop_begin()), then this recursive main loop should
continue to process idle_enterers from there and on, thus
idle_enterer_current was added. When going back from recursion, the
current iterator should be updated properly.

This patch also fixes the deletion of idle_enterers 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.

The following test case used to crash but not anymore:

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

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

static Ecore_Idle_Enterer *handle;

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

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

static int cb1(void *data)
{
    INF("cb1: begin");
    INF("    add cb2");
    ecore_idle_enterer_add(cb2, NULL);
    INF("    inner main loop begin (recurse)");
    ecore_main_loop_begin(); /* will it crash due ecore_idle_enterer_del(handle)
                              * inside cb2()? It used to!
                              */
    INF("cb1: end");

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

    return 0;
}

int main(void)
{
    ecore_init();

    _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);

    /*
     * Creating a new main loop from inside an idle_enterer 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_idle_enterer_add(cb1, NULL);
    ecore_idler_add(idler, NULL);
    ecore_main_loop_begin();
    INF("main: end");
    return 0;
}




SVN revision: 46408
2010-02-23 22:13:42 +00:00
Gustavo Sverzut Barbieri 2bf063a77b Fix idlers when using recursive main loops.
If an idler created a recursive main loop (just called
ecore_main_loop_begin()), then this recursive main loop should
continue to process idlers from there and on, thus idler_current was
added. When going back from recursion, the current iterator should be
updated properly.

This patch also fixes the deletion of idlers 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.

The following test case used to crash but not anymore:


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

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

static Ecore_Idler *handle;

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

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

static int cb1(void *data)
{
    INF("cb1: begin");
    INF("    add cb2");
    ecore_idler_add(cb2, NULL);
    INF("    inner main loop begin (recurse)");
    ecore_main_loop_begin(); /* will it crash due ecore_idler_del(handle)
                              * inside cb2()? It used to!
                              */
    INF("cb1: end");

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

    return 0;
}

int main(void)
{
    ecore_init();

    _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);

    /*
     * Creating a new main loop from inside an idler 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_idler_add(cb1, NULL);
    ecore_idler_add(idler, NULL);
    ecore_main_loop_begin();
    INF("main: end");
    return 0;
}



SVN revision: 46406
2010-02-23 21:27:04 +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
Christopher Michael fd7ed8786c Add atoms/functions for keyboard geometry. This will be used w/ conformant
apps to notify them of keyboard changes so they can move widgets around,
etc, etc.



SVN revision: 46402
2010-02-23 20:53:34 +00:00
Vincent Torri 366c893967 never use macro defined by configure in an exported header
SVN revision: 46387
2010-02-23 13:11:54 +00:00
Gustavo Sverzut Barbieri 10b90e46c6 fix my coding style errors...
SVN revision: 46362
2010-02-22 20:09:44 +00:00
Gustavo Sverzut Barbieri 054da5beeb fix ecore-glib reentrance
if using ecore_main_loop_begin() multiple times (reentrant/recursive)
with glib doing threads, then it would deadlock since the same thread
would get the lock it already have.

multiple ecore_main_loop_begin() is required to implement WebKit's
alert/confirm/prompt dialogs since there is no async reply with
callbacks, rather one must return the value.

By: Lucas de Marchi



SVN revision: 46361
2010-02-22 20:09:03 +00:00
Christopher Michael 618fe20c58 Readd zone_list functions and atoms. (Needed for some elm apps like
elm_indicator & elm_softkey).



SVN revision: 46357
2010-02-22 17:12:24 +00:00
Carsten Haitzler 59da209fb5 even tho its going to be killed... fix it anyway.
SVN revision: 46352
2010-02-22 08:08:04 +00:00
Vincent Torri 4d11d31e3d * instead of including headers wrt to the OS, include them if
they are available
 * compilation on Windows XP minimum only

SVN revision: 46338
2010-02-20 19:12:52 +00:00
Vincent Torri 3499767ddb First steps towards the Windows port of ecore_con.
ecore_con_dns will be hard to port (fork+exec).

SVN revision: 46337
2010-02-20 18:01:50 +00:00
Vincent Torri f9f9b48c64 On Windows, ecore_exe_auto_limits_set() does nothing
SVN revision: 46331
2010-02-20 09:35:48 +00:00
Vincent Torri 5254d1a02e Windows: Add priority support when a child process is created
and add documentation for that.

SVN revision: 46330
2010-02-20 09:20:04 +00:00
Vincent Torri 7e08e3f23c improvements of the stderr and stdout redirections. There are
still lots of work to be done:

 * allow several redirections (only one for now...)
 * fix stdin redirection
 * fill empty functions

SVN revision: 46319
2010-02-19 19:23:47 +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
Christopher Michael 04b865cdce Ecore_X changes for new illume2 code.
NB: This will break current PROTO/elm_* apps for illume2. They will be fixed
up shortly.



SVN revision: 46284
2010-02-19 02:27:18 +00:00
Carsten Haitzler 698f67609c aaaah bummer. (see comment)
SVN revision: 46243
2010-02-17 08:13:30 +00:00
Carsten Haitzler c13819b98a hmmmm try this. let me know if u see issues.
SVN revision: 46218
2010-02-16 16:52:02 +00:00
Vincent Torri 5c2f696d25 ecore_x does not use ecore_txt functions anymore, so remove the
dependency on ecore_txt. I disable ecore_txt by default too

I can't test it (i'm on Windows). If you experience errors during
the build, please reply in this thread.

SVN revision: 46209
2010-02-16 13:14:07 +00:00
Gustavo Sverzut Barbieri 11ca6cc505 Update to new event callback signature.
SVN revision: 46207
2010-02-16 13:00:11 +00:00
Carsten Haitzler 4e51efd326 1. if software-x11 not enabled.. still build... but.....
2. ecore-txt is a REQUIREMENT FOR ECORE-X! DONT DISABLE!



SVN revision: 46199
2010-02-16 01:27:25 +00:00
Vincent Torri 741e62ab96 Make ecore_data enabled or disabled with configure.
This will help me for the opensolaris port... (btw
inlined functions should not be in ecore_list source
code but in its header, for those who want to fix that)


SVN revision: 46195
2010-02-15 20:29:38 +00:00
Vincent Torri d2993b9b25 don't link ecore_txt against eina
SVN revision: 46193
2010-02-15 19:54:59 +00:00
Christopher Michael 82ce1b5e7b Reorganize code a little here to remove duplication. No function changes
(and no issues found when tested).



SVN revision: 46184
2010-02-15 07:23:58 +00:00
Carsten Haitzler 830a7c89ee be more robust when gtl creation fails - return a null ee.
SVN revision: 46178
2010-02-15 05:26:42 +00:00
Carsten Haitzler 440f6d0d7b change gl engine api a little - fixed in ecore-evas and expedite. expose
indirect option in ecore-evas with a new opt param for gl engines - will add
more opts over time.



SVN revision: 46177
2010-02-15 05:05:05 +00:00
Carsten Haitzler 302e9054c4 dont return unknown!
SVN revision: 46162
2010-02-14 08:15:49 +00:00