Commit Graph

11017 Commits

Author SHA1 Message Date
Cedric BAIL e01c8dacc2 * edje: prevent segv due to dead relative part.
SVN revision: 52347
2010-09-16 15:49:56 +00:00
Lucas De Marchi 251a60ab09 Add function to check if point is inside an object
Add evas_object_inside_get() to check if a certain (x,y) point is inside
an evas_object. This is needed because there's no simple way to
determine it outside of evas when map transformations are used.

For instance, edje uses evas_object_geometry_get() and checks if point is
whithin the rectangle. This is wrong because the object might be
rotated, scaled. Below is a test program:

/**
 * Simple Evas test
 *
 * Compile with: gcc -O0 -g  -o evas_hello_world evas_hello_world.c $(pkg-config --cflags --libs eina evas ecore ecore-evas)
 */
 #include <Eina.h>
 #include <Evas.h>
 #include <Ecore_Evas.h>
 #include <Ecore.h>
 #include <stdio.h>

 #define WIDTH (320)
 #define HEIGHT (240)

Eina_Bool main_signal_exit(void *data, int ev_type, void *ev)
{
    ecore_main_loop_quit();
    return EINA_FALSE;
}

static void
_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
    Evas_Event_Mouse_Up *ev = event_info;
    Eina_Bool b;

    b = evas_object_inside_get(obj, ev->canvas.x, ev->canvas.y);
    fprintf(stderr, "mouse_up: x=%d, y=%d inside=%d\n", ev->canvas.x,
            ev->canvas.y, b);
}

static void
_cb_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
    Evas_Event_Mouse_Move *ev = event_info;
    const char *id = data;
    Eina_Bool b;

    b = evas_object_inside_get(obj, ev->cur.canvas.x, ev->cur.canvas.y);
    fprintf(stderr, "[%s] mouse_move: x=%d, y=%d inside=%d\n", id,
            ev->cur.canvas.x, ev->cur.canvas.y, b);
}

int main(void)
{
   Evas *evas;
   Ecore_Evas *window;
   Evas_Object *bg, *r1, *r2;
   Evas_Map *m;

   evas_init();
   ecore_init();
   ecore_evas_init();

   window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
   if (!evas)
     return -1;

   evas = ecore_evas_get(window);

   bg = evas_object_rectangle_add(evas);
   evas_object_color_set(bg, 255, 255, 255, 255); // white bg
   evas_object_move(bg, 0, 0);                    // at origin
   evas_object_resize(bg, WIDTH, HEIGHT);         // covers full evas
   evas_object_show(bg);

   r1 = evas_object_rectangle_add(evas);
   evas_object_color_set(r1, 255, 0, 0, 255); // 100% opaque red
   evas_object_move(r1, 50, 50);
   evas_object_resize(r1, 100, 100);

   m = evas_map_new(4);
   evas_map_util_points_populate_from_object(m, r1);
   evas_map_util_rotate(m, 45.0, 100, 100);
   evas_map_alpha_set(m, 0);
   evas_map_smooth_set(m, 1);

   evas_object_map_set(r1, m);
   evas_object_map_enable_set(r1, 1);
   evas_map_free(m);
   evas_object_show(r1);
   evas_object_event_callback_add(r1, EVAS_CALLBACK_MOUSE_UP, _cb, NULL);
   evas_object_event_callback_add(r1, EVAS_CALLBACK_MOUSE_MOVE, _cb_move, "r1");

   r2 = evas_object_rectangle_add(evas);
   evas_object_color_set(r2, 0, 255, 0, 255);
   evas_object_move(r2, 210, 150);
   evas_object_resize(r2, 50, 50);
   evas_object_show(r2);
   evas_object_event_callback_add(r2, EVAS_CALLBACK_MOUSE_MOVE, _cb_move, "r2");

   ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, evas);

   ecore_evas_show(window);
   ecore_main_loop_begin();

   ecore_evas_free(window);

   ecore_evas_shutdown();
   ecore_shutdown();
   evas_shutdown();

   return 0;
}




SVN revision: 52345
2010-09-16 13:59:46 +00:00
Tom Hacohen 12b55be8af Evas textblock: Added a lot of fixes to evas_textblock_cursor_geometry_get in the case where ctype = EVAS_TEXTBLOCK_CURSOR_BEFORE
SVN revision: 52341
2010-09-16 09:59:39 +00:00
Tom Hacohen 9fb94f209b Evas textblock: Fixed evas_textblock_range_text_get that didn't work on textblocks with no formats at all (not even newlines or tabs).
SVN revision: 52339
2010-09-16 07:12:23 +00:00
Lucas De Marchi 08055d63b9 trivial: spelling in documentation
Some misspellings found in doxy.



SVN revision: 52326
2010-09-15 20:40:51 +00:00
Iván Briano 20ea0eef4e Check there are callbacks before trying to copy them.
Patch by Otávio Pontes


SVN revision: 52323
2010-09-15 19:51:08 +00:00
Cedric BAIL fdc15d4495 * evas: we don't need all the stuff from pthreads to do preload.
SVN revision: 52311
2010-09-15 17:20:37 +00:00
Cedric BAIL 8102552b7a * edje: cleanup aspect code and reduce memory presure.
SVN revision: 52304
2010-09-15 14:15:23 +00:00
Cedric BAIL 10356b8e50 * edje: turn it on again and go fix your theme :-)
SVN revision: 52303
2010-09-15 14:09:58 +00:00
Tom Hacohen 612b3eda81 Evas textblock: fix deleting the first tab in 'a<TAB><TAB>a' that caused weird behavior.
The solution is that we only delete invisible standalones now, not visible ones, this is correct intuitively and of course fixes the bug.

SVN revision: 52302
2010-09-15 14:07:09 +00:00
Tom Hacohen b59743febd Evas textblock: we should also take width of tabs into account when calculating line width.
SVN revision: 52297
2010-09-15 12:45:06 +00:00
Tom Hacohen 8b6083ec26 Evas textblock: Fix and simplify _find_layout_item_line_match which is an helper function used in many parts of textblock.
SVN revision: 52295
2010-09-15 10:24:07 +00:00
Tom Hacohen 108bdeeadd Evas font: removed old (already removed a long time ago) functions from evas_font.h.
SVN revision: 52293
2010-09-15 09:11:19 +00:00
Vincent Torri 56fa2461ed warning--
SVN revision: 52292
2010-09-15 08:41:41 +00:00
Rafael Antognolli 94540f3b5b Changing Ethumb license from LGPL3 to LGPL2.
Making this change to be in agreement with some other EFL libraries
under LGPL.



SVN revision: 52275
2010-09-14 23:02:45 +00:00
Carsten Haitzler c1c7e901f5 CEEEEEEEEEDRICCCCCCCCCCCCCCCC!
borked e conf panel. unbork. disable aspect.



SVN revision: 52273
2010-09-14 22:32:34 +00:00
Bruno Dilly d0eb6e4054 Add missing bogosity X cursor
SVN revision: 52270
2010-09-14 21:43:44 +00:00
Vincent Torri 93f58106a6 ecore_win32 does not depend on Evas.
SVN revision: 52264
2010-09-14 21:25:31 +00:00
Vincent Torri 70622ee748 * src/lib/Makefile.am:
* src/lib/Evil.h:
* src/lib/evil_time.c:
* src/lib/evil_time.h:
add locatime_r() for calendar in Elementary.


SVN revision: 52263
2010-09-14 21:24:25 +00:00
Eduardo de Barros Lima 2216c53641 Eina_List: Avoid Segfault
Some inputs in which tmp - cur is greater than the number of previous nodes
in list, were causing ct to be null at end of loop.

Patch by Jonas M. Gastal <jgastal@profusion.mobi>



SVN revision: 52253
2010-09-14 18:29:30 +00:00
Vincent Torri 47b00392a7 useless define (already defined in command line)
SVN revision: 52247
2010-09-14 16:47:01 +00:00
Vincent Torri f7b1362905 add braces to remove ambiguous condition warning
SVN revision: 52246
2010-09-14 15:57:20 +00:00
Cedric BAIL 2e87895f67 * edje: remove use of flags as it was always set to FLAG_XY
in _edje_part_recalc_single.


SVN revision: 52245
2010-09-14 15:53:47 +00:00
Cedric BAIL d1203fc0ca * edje: fix edje use of aspect when constrained by min or max.
NOTE: If you have swallow or parts that where constrained by min and
	max, and you used aspect on them, expect change on your layout.


SVN revision: 52244
2010-09-14 15:36:16 +00:00
Tom Hacohen 78deeca6ba Evas textblock: Fixed the bug with disappearing text with many tabs and text.
I removed a function that caused the issue and made no sense at all, honestly, it didn't make any sense.
I did a lot of testing trying to see if there are any new bugs after the fix, and nothing, so I guess my instincts were correct.
Please if you can, check out the removed function (_layout_walk_back_to_item_word_redo) and see if it makes any sense to you, if it does, please let me know.

SVN revision: 52243
2010-09-14 13:57:26 +00:00
Carsten Haitzler f200c483b4 epoll - bad. disable default support. u have to --enable it. don't
--enable it if u want elm quicklaunch to work.



SVN revision: 52240
2010-09-14 10:38:28 +00:00
Carsten Haitzler 4081d86c6c better cleanup of poll fd's on shutdown
SVN revision: 52229
2010-09-14 00:53:57 +00:00
Carsten Haitzler 4f823dab67 fix first map bug handling to handle more than first window map.
SVN revision: 52200
2010-09-13 22:16:26 +00:00
Lucas De Marchi e46b64199f Don't check return value of alloca
alloca() doesn't return NULL on error, so do not check its return value.



SVN revision: 52199
2010-09-13 18:40:32 +00:00
Iván Briano 2bd045dd1f Pending patch from glima, who's on vacations.
Add two new canvas level callbacks: OBJECT_FOCUS_IN/OUT
As we already had callbacks for objects gaining or losing focus, then
two more for the Canvas, now we can have the entire Evas be notified when
any object changes its focused status. The object in question is passed
as the event_info for the callback.


SVN revision: 52196
2010-09-13 18:04:23 +00:00
Lucas De Marchi 9c091e1714 Assert cache->usage never becomes negative
Assert cache->usage never becomes negative as was occurring before the
fix in r52149.

Just in time, the fix in r52149 was made by Ulisses, not me.



SVN revision: 52190
2010-09-13 13:58:34 +00:00
Cedric BAIL d287f127fd * eio: callback are allowed to modify their own data.
Don't know how I wrote this non sense.


SVN revision: 52189
2010-09-13 13:44:24 +00:00
Carsten Haitzler 2303255182 dont get item anchors so often!
SVN revision: 52187
2010-09-13 12:08:19 +00:00
Brett Nash ee8881634b Add a semicolon. GCC: This ones for you.
SVN revision: 52184
2010-09-13 09:16:01 +00:00
Brett Nash 5ea066ec74 Deniggle and rename the exore_x_dndn_callback_pos_update_set call.
SVN revision: 52183
2010-09-13 09:15:57 +00:00
Brett Nash ba4ae189ea Use -1.
SVN revision: 52182
2010-09-13 09:15:53 +00:00
Brett Nash e36847a0ab Xdnd callback (API Addition): Rationale below.
Essentially the problem is this: For drag and drop Ecore currently handles the
position update calls.  But usually the application wants to display some user
feedback - a window to display the drag selection for instance.

Now the way e17 does it is grab the mouse cursor movements and track them
itself.  However ecore is already doing this, it's already walking window
trees, calculating real positions, _and_ sending them in an X client message.
So it seems rather silly to duplicate the code in the user app to get the same
info.

We could possibly have added a new event, but then we need to deal the fact
the position update may arrive _After_ the item has been dropped.  Hilarity
ensures[1].

This callback is meant for purely the selection owner of the drag to use, so
it is a callback set, not an add.

[1] Segfaults probably.  Nothing funnier.

SVN revision: 52181
2010-09-13 09:15:50 +00:00
Brett Nash 310ee61355 Always return an x rander version (unset in this case).
SVN revision: 52180
2010-09-13 09:15:45 +00:00
Mike Blumenkrantz 534bd43e9d initial doxy patch for rbtree from vtorri
CEDRIC WRITE DOCS FOR THIS!


SVN revision: 52172
2010-09-12 19:28:18 +00:00
Tom Hacohen 527a3f3579 Edje entry: Fixed a selection bug with IMF enabled and fix a couple of indentation issues, and a saftey check.
Patch by Jihoon Kim.

SVN revision: 52165
2010-09-12 08:15:35 +00:00
Mike Blumenkrantz 1970f8dd6c more doxy from vtorri
SVN revision: 52164
2010-09-12 08:03:21 +00:00
Mike Blumenkrantz eb775222a5 variable name changes for accessor functions
patch by vtorry
compile testing frowned upon by andredieb


SVN revision: 52163
2010-09-12 06:49:57 +00:00
Lucas De Marchi d32c0f99bd Fix accounting of memory usage in image cache
Memory usage was not accounted right because
cache->func.mem_size_get(ie) returns 0 when called after
cache->func.destructor(ie). Thus the total memory used, kept on
cache->usage, is never decremented in _evas_cache_image_remove_activ()

This implies that cache->usage will keep growing and eventually it will
overflow, becoming negative. So evas_cache_image_flush() will not do its
job because cache->limit (assumed to be positive) will not be less than
cache->usage anymore. So the total memory allocated will start to grow
and the limit won't be respected.

Strictly speaking, it's not a leak, since all the memory will be
eventually freed when evas shutdown is called, but the program might be
killed by over allocating memory. This is caught by valgrind with the
massif tool. The graphic below shows that in the end a huge memory amount
is allocated. This is the moment when cache->usage became negative.

MB
26.04^                                                                   #
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
|                                                                   #::::
| :::::::::::::::::@@:::::::::@:::@::::::@::::::::::::::::::::::::::#::::
| : ::: ::: ::: :::@ :: ::: : @:: @:: :::@: :: ::: : : :: :: : ::: :#::::
0 +----------------------------------------------------------------------->Gi
0                                                                   54.83

This patch is a one line fix, which swaps the calls to
_evas_cache_image_remove_activ() and cache->func.destructor() making
cache->limit to be respected.



SVN revision: 52149
2010-09-10 23:00:26 +00:00
Lucas De Marchi c4a0cef6e6 Fix typos in docs
* eina_thread_init doesn't exist. eina_threads_init it is;
* 'mutexes' is a more common spelling, not 'mutexs'



SVN revision: 52136
2010-09-10 12:01:52 +00:00
Lucas De Marchi 77d42e9cca Simplify code by removing unneeded auxiliary variable
SVN revision: 52135
2010-09-10 11:25:26 +00:00
Lucas De Marchi bd12ce52f7 Refactor function to return as early as possible
Instead of a looooooong 'if', return on the contrary.



SVN revision: 52134
2010-09-10 11:25:15 +00:00
Lucas De Marchi fa4e9c4f18 Formatting
SVN revision: 52133
2010-09-10 11:25:05 +00:00
Lucas De Marchi fe7cfb1e16 Refactor jumps
Instead of relying on the value of edf (and having to set it on all
places to NULL) jump to 'open' label on the only possible case of the
control flow.



SVN revision: 52132
2010-09-10 11:24:49 +00:00
Carsten Haitzler fae947f8ea do extra composite checks - need to do the lot to be useful.
SVN revision: 52121
2010-09-10 06:57:21 +00:00
Lucas De Marchi 31c1225bd7 Fix parameter order in help
Calling help in edje_player was showing the wrong order for sending a signal.
The right order is the same of the function edje_object_signal_emit()




SVN revision: 52105
2010-09-09 20:35:44 +00:00