files detection. It should work with and without an
Objective C compiler. The problem is a bug in the
AC_PROG_OBJC macro.
Patch by Ralf Wildenhues
SVN revision: 46890
We have orig_path, it is set by rp. Only problem is that it was set
after efreet_desktop_read so the error handler would work as it should.
Wrong solution. So now we set orig_path to NULL, so we always can free
rp.
SVN revision: 46880
evas_object_textblock.c: In function ‘_nodes_next_merge’:
evas_object_textblock.c:380: error: ‘Evas_Object_Textblock_Node’ has no member named ‘len’
SVN revision: 46874
They are used in single function, so don't keep them in structure.
As a side-effect rework _layout_line_advance for better readability.
SVN revision: 46872
Previously, due to propagation to parent, an event could have
been received more than once by an object. This triggered
strange behaviour in edje for example where you could receive
mouse,down,1 signal many time for one swallowed object.
This patch is a fix for that problem, I hope it doesn't break
anything (e17 and elementary_test run fine here, but report
any break related to events please).
SVN revision: 46869
EINA_LOG_ERR(), EINA_LOG_DBG() and other macros.
This will help us to avoid the cumbersome work of having to define the
local macros. I still find the 3-letter macros handy, but we are not
forced to use them now.
I did a small modification to keep the EINA_LOG_DOMAIN_GLOBAL and use
a different symbol for the define, it is EINA_LOG_DOMAIN_DEFAULT. The
documentation was updated to highlight the 2 usage scenario and care
that must be used.
By: Peter Johnson <tam@hiddenrock.com>
SVN revision: 46700
Increment in steps linearly instead of doubling them, otherwise it
will get to maximum limit of 4096 too soon.
Also replace the loop with simple math.
SVN revision: 46585
Some of them were working because they were inline, so the compiler
would know an just ignore the flag.
For lists and rbtree there is no problem as after each operation we
must change the pointer to the new head, thus the compiler will
consider it changed.
SVN revision: 46583
I forgot that EINA_CONST refer to the pointer itself, not to its
contents, as such the pointer did not changed, so gcc was optimizing
subsequent fetches of the value.
There should be another optimization to check for this... but then I
guess it's just c++
SVN revision: 46580
If file changed on disc (mtime), then make the reference dangling so
it is not reused anymore on subsequent open. If it is in cache, just
free it as it is not useful anymore.
This solves the following problem:
edje_object_file_set(ed, path, group);
ecore_file_cp(new_gen_file, path);
edje_object_file_set(ed, path, group); /* still uses the old one! */
By: Bruno Dilly <bdilly@profusion.mobi>
SVN revision: 46548
* eina_str_split() now does the minimum number of passes and
allocations. The first pass figures out the string size (strlen())
and number of delimiters, so we can allocate the exact number of
elements in array. The second repeats the loop copying elements to
string and also setting them to the result array.
* eina_str_split_full() is a variation of eina_str_split() that
returns also the number of elements in array, in the case you need
to pre-allocate another array to copy.
* eina_strlen_bounded() is introduced to limit strlen() results, this
is used in has_prefix and has_suffix, but possibly other use cases
where string must be of a maximum size as we don't do useless
iterations;
SVN revision: 46547
Use strtod() and avoid couple of walks. Of course the walks were quite
small and it will not bring noticeable improvements, but code is
smaller and easier to read, so why not?
SVN revision: 46530
keep tag and replacement size, compare it before doing strcmp() and
return the size so further calculations use it (eina_strbuf_append()
-> eina_strbuf_append_length())
SVN revision: 46529
These are deprecated and will be killed in short time, stop using them!
Recommendations:
* ecore-txt: use eina_str_convert, drop in replacement, just sed.
* ecore-config: convert your code to use eet + Eet_Data_Descriptors
directly, it is simpler and faster, but requires you to change your
code. Consider using eet_data_descriptor_file_new() and
eet_eina_file_data_descriptor_class_set() or
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(). Then describe your type
with EET_DATA_DESCRIPTOR_ADD_*().
SVN revision: 46494
this will have compilers to completely compile out log statements
using levels greater than the given number.
this is defined in config.h, thus C files should include this before
including Eina.h, as should be the case for all files (IOW: if it does
not work for some file, that file already have a bug).
SVN revision: 46482
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
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
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
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
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
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
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
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
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
Subject: [E-devel] [PATCH] evas: compile out unused dither tables
Don't include the rather large dither tables if small dithering code
is enabled during ./configure stage.
SVN revision: 46353
* OpenGL ES : 2.0
* OpenGL desktop : >= 1.4
If OpenGL ES 3.* is out, this code must be fixed
If there are problems with the minimal version on desktop,
we will have to increase the minimal version.
Question: should we check GLSL version on desktop ?
SVN revision: 46309