Commit Graph

2731 Commits

Author SHA1 Message Date
Jean-Philippe Andre 68be4f49ed evas events: Fix mistake in multi_move
I guess (can't test) that multi touch was broken, as the
position of the event was set to the position of the pointer
on the canvas. Which means all fingers would be in the same
spot, no matter what the real input. Copy & paste error.
2016-08-30 15:13:40 +09:00
Jean Guyomarc'h 9a82b17eff evas: don't redefine PAGE_SIZE if already defined
On OSX, we include mach.h (via the inlined locks API), which
already defines PAGE_SIZE.
2016-08-29 20:03:52 +02:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Jean-Philippe Andre 9123e5add2 evas events: Add efl_isa safety checks in legacy EAPI
This removes useless magic checks (only check whether the
arg is not null) that were not even present in every function.
The cost should be similar or lower than an eo function call.
2016-08-26 11:28:34 +09:00
Jean-Philippe Andre d504284dd2 efl: Rename Efl.Event.XX to Efl.Input.XX
This removes:
 Efl.Event interface

And renames:
 Efl.Event.Input -> Efl.Input.Event
 Efl.Event -> Efl.Input.Event (merged)
 Efl.Event.Pointer -> Efl.Input.Pointer
 Efl.Event.Key -> Efl.Input.Key
 Efl.Event.Hold -> Efl.Input.Hold

This also moves some interfaces from efl/ to evas/ where they
belong better.

This allows renaming Eo_Event to Efl_Event.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 60526528a6 evas: Add normalized and window coordinates to axis events
This is for Wacom graphics tablets (with a pen).

The raw data sent by ecore to evas (and then to apps) is pretty
useless as it's not normalized, and apps have no way of knowing the
dimensions of the tablet, without themselves opening the device
(we don't know nor expose the path to the device).

This is for Xi2 only for now, as Wayland support hasn't been done
yet.

The intent is to deprecate LABEL_X and LABEL_Y. I'm not sure yet
if the normalized value is useful or not (it would seem we may not
be able to provide this info in Wayland).

The new WINDOW_X, WINDOW_Y labels will be used in the new event
type (Efl.Event.Pointer). Normalized values are not exposed yet,
let's decide if we want them or not first (based on what can be
done in Wayland space).

@feature
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 443aa91d53 evas: Simplify internal evas_object_event_callback_call
This removes the distinction between legacy and new eo style
event info, since all those types have now been ported to eo.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 925878e931 evas events: Switch axis events to the new eo type
This converts Evas_Axis or Ecore_Axis info arrays into basic
pointer data. Also marks those fields as set. All events need
to properly implement the value_has property (mark all bits
whenever a value is known).
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 8938d8d557 evas events: Rename properties and introduce generic value
This paves the way to a merge of pointer and axis events into
the class Efl.Event.Pointer.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre ef4859d5bd evas: Optimize out most callback call events
This sets a bit whenever a callback listener is added.
I couldn't get any profiling data easily (too small for
valgrind).

Note: This removes the proper refcounting on the "move"
event listeners. I believe this is not a problem as most times
the move_ref goes to 0, it is because the object is deleted.
Worst case, we just trigger a callback_call with no listeners.

This adds 32 bits to each evas object private data.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 57f0c850ec evas: Move event catcher to evas_callbacks.c
No functional change.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 4746627fcf evas: Remove deprecated events from public EO class
del and free eo events don't need to be exposed, even as beta
API. They are still required for legacy callbacks.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre b325097e71 elm,evas: Remove use of EFL_CANVAS_OBJECT_EVENT_DEL
This event should not be exposed at all, it's not necessary
anymore, EFL_EVENT_DEL already exists and should be good enough.

This does move the callback call a little bit ealier in the del
process, but at first glance, this shouldn't have any impact.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 834794ed84 evas events: Add new "finger,move/down/up" events for multi touch
This moves MULTI events to those new finger event types,
and also sends a finger event for finger 0 (aka the pointer).

NOTE: This may require a separation between a mouse input and
      an actual finger touch. To be defined, ie: do we let the app
      check the input device info to decide whether the event is
      actually the first finger of a multi touch device, or do
      we want to send only actual finger events from multi touch
      devices only?

@feature
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 608da26634 evas events: Simplify event counter
Simplify code:
 _evas_object_event_new()
 event_id = _evas_event_counter

Into:
  event_id = _evas_object_event_new()
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 049a5ddb44 evas events: Remove now unused code 2016-08-26 10:18:01 +09:00
Jean-Philippe Andre ab7f281c34 evas events: Fix crash when translating legacy events
An obvious crash happened when reusing a legacy struct
from another type.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre ac26c7d4f3 evas events: Switch mouse move events to the new type
This is the last commit for this crazy input transformation
series. The following commits will be cleaning up now
unused code, and fixing bugs.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 46c85b87fd evas events: Switch multi move to new event type
Now only the single move remains. Almost done!
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 2857d7c2cf evas events: Switch multi up/down to the new event type 2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 328151f999 evas events: Switch mouse in/out events to the new event type 2016-08-26 10:18:01 +09:00
Jean-Philippe Andre edd88292a4 evas events: Switch mouse move event to the new event type (1)
This only modifies the proxy source handling code.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 56c682452c evas events: Switch mouse up/down to the new event type
This is getting trickier, as those events have a lot more
side effects and complexity than a simple wheel event...

Some code has been added that should be fixed in the following
commits.
2016-08-26 10:18:00 +09:00
Jean-Philippe Andre c1e7589c14 evas events: Switch key up/down event to new eo type 2016-08-26 10:18:00 +09:00
Jean-Philippe Andre 405680e836 evas events: Switch hold event to new eo type
Evas_Event_Hold is now barely used anywhere.
This also adds support for event_flags to this type.
2016-08-26 10:18:00 +09:00
Jean-Philippe Andre 290413543d evas events: Switch wheel event to the new type
For now this covers only the wheel event.

Note: This patch also modifies evas map to use double in an
internal function, rather than ints.
2016-08-26 10:18:00 +09:00
Derek Foreman e0c1f4a2a7 evas: Try harder to create the render thread
It's entirely possible that a system doesn't have a cpu 0, so
when we try to pin all our render threads onto processor 0 we
may fail.

This results in some very connfusing build breakage when
edje_cc hangs up because its render thread didn't start.

So, if starting the thread with affinity fails, let's try without
affinity.

(This is trivial to reproduce - just use sysfs to turn off cpu0
after boot.)

@fix
2016-08-24 14:34:36 -05:00
Jean-Philippe Andre 44cff879a1 evas: Fix includes when enabling BETA but not EO API
This fixes the build for older versions of E.
2016-08-24 14:42:19 +09:00
Jean Guyomarc'h 469cf26873 evas: handle thread queue creation failure
eina_thread_queue_create() might fail.
Actually it does fail on Mac OS X under
some circumstances.
2016-08-23 21:15:24 +02:00
Carsten Haitzler a739d4d7da evas software downscaler - get about 1.8x to 3x speedups for cases
this speeds up downscaling of images by somewhere between 1.8 to 3x
dpeending on case and cpu etc. - this is ONLY for downscaling of an
image buffer betweeb 50% width and/or height up to 100% of width and
height. it's a special case optimization that cuts down the complexity
of the full super sampling filter to just do a bilinear interpolation
which is actually strictly correct for this size range and shouldn't
drop quality. it uses fixed point (16.16) to do the sup pixel sampling.

no mmx/asse or neon, but we could actually easily use it as we do use
mmx/ee and neon in the bilinear upscaler to do interpolation so this
would work here too. it just requires time and effort to make yet 2x
more special cases and use the ASM to do the hard slog here.

@optimize
2016-08-19 11:08:55 +09:00
Youngbok Shin 36d086ec42 Evas text: fix RTL text ellipsis issues
Summary:
Visual position of ellipsis item should be set according to
its bidi direction. But, by setting visual position in same way
as logical position, the end ellipsis could be put opposite side.
Also, start ellipsis must placed on left side of RTL text.
@fix T3187

Test Plan: Test an sample on T3187

Reviewers: tasn, woohyun, herdsman

Subscribers: raster, Blackmole, z-wony, cedric, jpeg, minudf

Maniphest Tasks: T3187

Differential Revision: https://phab.enlightenment.org/D3769
2016-08-18 14:39:41 +03:00
Youngbok Shin 167d41e7b2 Evas Text: parse font string everytime for updating lang properly
Summary:
We can't assume the given font is same with current fdesc by comparing string.
Since Evas starts to supporting "auto" for language,
the given font string should be parsed once before comparing it.
@fix

Test Plan: N/A

Reviewers: tasn, raster, cedric, herdsman

Subscribers: jpeg, minudf, z-wony, Blackmole, woohyun

Differential Revision: https://phab.enlightenment.org/D4227
2016-08-18 13:33:08 +03:00
Minkyoung Kim 042e94f10d evas/gl_x11 : Add multiple_buffer member in native surface x11 type union.
Summary:
If native surface is multiple buffer pixmap such as named pixmap, Evas should recreate eglImage everyframe.
Because DDK get the buffer ID once at eglImageCreate time.
So if internal buffer ID is changed, should recreate eglImage.

Test Plan: Wearable Tizen.

Reviewers: wonsik, raster, cedric, jpeg

Reviewed By: jpeg

Subscribers: spacegrapher, dkdk, cedric

Differential Revision: https://phab.enlightenment.org/D4211
2016-08-17 17:56:17 +09:00
Stefan Schmidt dc0416fade evas: mark unused function parameter as such 2016-08-17 09:57:08 +02:00
Jean-Philippe Andre 49037bc7e9 evas: Fix hold events
This fixes a crash with thumbscroll.

Fixes https://phab.enlightenment.org/T4378
2016-08-17 14:37:50 +09:00
Jean-Philippe Andre 6d6e41c5c9 evas: Fix mouse inputs when also listening to multi
Since the new event type is the same for multi and single
touch (finger id is the only difference), multi touch listeners
would get triggered even for single mouse events.

Fixes https://phab.enlightenment.org/T4345
Fixes https://phab.enlightenment.org/T4378

This raises a question though: How do we want to differentiate
between single & multi touch events in the eo interfaces?
2016-08-17 13:13:23 +09:00
Jean-Philippe Andre 6d52d1db2b evas: Fix ordering of input event
The previous patch 1185c40e50 shows how having
two event types for the same thing (key or mouse input events)
was a bad idea. The only guaranteed order of callbacks is the
priority but even that was not enforced (since legacy or eo
style event had to come first).

Fixes T4310
2016-08-16 20:22:57 +09:00
Jean-Philippe Andre ae3ac0cd25 edje: Allow no_render in description
Previously, it was limited to the part block. It was a mistake
and should have been put in the description instead, as this
allows it to change during state transition (like visible, or
proxy_src_visible).

@feature
2016-08-16 20:08:32 +09:00
Jean-Philippe Andre 9fbb5e0e5d evas: Fix potential memleak in event info objects
The new event info being an eo object, it needs to be properly
cleaned. I believe this memleak would not show up much in massif
or other checking tools, as it's a stringshare leak. Also, most
of those event objects will in fact be reused and never deleted.

@fix (backported as c58e293d34)
2016-08-16 15:34:33 +09:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Carsten Haitzler 6728822e91 evas smart obj - handle invalid object id's when scop data get is NULL
handle smart member add if the object is invalid withotu crashing.
also don't abort and crash with other invalid states like of smart
object or child is to be deleted, has no layer etc. - continue on
safely without a crash.

@fix
2016-08-15 11:40:31 +09:00
Carsten Haitzler e7d56e9ece evas table - handle recursive access to cols/rows where child frees
thsi fixes invalid memory access to already freed memory in a parent
call where a child freed it by reference counting the struct to
ensuire it stays alive in the parent func using it.

@fix
2016-08-15 11:30:23 +09:00
Carsten Haitzler 2358417277 efl api release - fix @since for evas test filter program/source set api 2016-08-13 12:15:19 +09:00
Carsten Haitzler 80e8e69ce4 efl api release - fix @since for textblock added legacy cursor eq api 2016-08-13 12:14:59 +09:00
Carsten Haitzler d7c5c5f91b efl api release - fix @since for textblock added legacy api 2016-08-13 12:14:52 +09:00
Boris Faure 4c07f52de6 evas textgrid: unset style when trying to load bold/italic
Ref T4323

@fix
2016-08-13 00:29:05 +02:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Carsten Haitzler aaf29b4dc4 evas image update calculation - account for clipped color changes
if clipped color changed and not object color on image objects, then
the updates could be missed. this also fixes some corner cases where
opaqueness should not count for update deletion too. this bug seems to
have been here a while unnoticed.

fixes T4246

@fix
2016-08-11 23:21:27 +09:00
Jean-Philippe Andre 1185c40e50 evas: Call legacy events before new key/pointer eo events
This affects pointer & key events.

Here's the scenario: in Enventor, an elm_button object
grabs the up & down keys for the autocompletion feature.
But the entry will also listen to up & down to move the
cursor. Moreover, the scroller listens to up & down arrow
keys to scroll around.

So, when calling the new eo event first, the scroller
or the entry would catch it and do some action. In
Enventor, this triggered a hide on the magic anchor
object. Bad, bad.

I fear something will be wrong with this order as well.
Both events (legacy & eo) should be called simultaneously,
following the order & priorities that were set.

This being said, in real life most of EFL internals will
move to the new eo events (right now elm relies on the
new events, but edje doesn't, yet), so any app grabbing a
key probably wants to handle the event before elm. Same
for an app using focus manually.

Fixes T4310
2016-08-10 16:56:06 +09:00
Jean-Philippe Andre 0889444449 Revert "evas: Optimize out a function call if not required"
This reverts commit 8cb3b79a82.
I shouldn't have pushed this. So wrong. Sorry about the noise.
2016-08-10 15:31:48 +09:00
Jean-Philippe Andre 8cb3b79a82 evas: Optimize out a function call if not required
Same as the previous patch in elm_widget: don't call
flags_set() if the flags have not changed.
2016-08-10 15:26:05 +09:00
Jean-Philippe Andre 5130ce98db evas: Fix evas_objects_at_xy_get() for smart objects
Due to the way the clip geometry calculation changed
(see 25d77bc1d2) to be
based on the bounding box rather than the raw geometry
of smart objects, the internal function
evas_object_is_in_output_rect() now returns true if the
rectangle intersects with that bounding box, even if
it's outside the raw geometry.

This breaks the drop area in E's pager, as it relies on
evas_objects_at_xy_get() to find which objects are at
this point. What I saw on my desktop was that only the
lower 10 or 20 pixels were droppable in the pager,
as maximized windows would have shadows covering the
upper 20 pixels or so.

Arguably objects_at_xy_get could also return all objects
at (x,y) including smart objects that extend beyong their
geometry. This can be added as a flag in the EO API, but
not in the legacy API.
2016-08-10 13:58:30 +09:00
Carsten Haitzler 606e865823 evas smart obj delete on shutdown - fix weird child with null parent
while removing children from a parent smart object, the destruction of
the smart obj encountered childrne with NULL parents. they were in the
child list but had no parent. This was totally odd and unexpected,
thus caused an infinite loop trying to dlete a child that won't be
removed from the list because parent is NULL thus it cna't find the
parent list to remove it from. This works around that and then
complains with an error. The workaround also seems to have encountered
what might be a compiler bug so I prepended to the layer object list
rather than appended. this at leats stops the hang.

@fix
2016-08-10 00:33:56 +09:00
Jean-Philippe Andre d6817f4d6e evas filters: Fix minor issue with print
If the call to tostring() fails, replace the string by (invalid)
rather than ignore the error.

Fixes CID 1308612
2016-08-09 11:43:52 +09:00
Daniel Hirt be461b8f1b Canvas.text: fix segfault with ellipsis cases
The specific handling for (0.0 <= ellip < 1) doesn't support multi-line cases.
One of the main reasons is that we haven't had the chance to define the wanted
behavior for multi-line.
This is a temporary hack to fix a segfault. The behavior is still undefined,
though.

Fixes T3885.
2016-08-08 15:18:30 +03:00
Daniel Hirt 24ccd475b8 Evas font: fix size query again
Some wrong variables were used in the rewrite at
8c6effae8e, basically reverting the original fix.
2016-08-07 11:26:53 +03:00
Stefan Schmidt bb984760cd evas: add missing since tag for new evas_object_type_get() API 2016-08-05 23:14:56 +02:00
Jean-Philippe Andre 917f34587b evas: Make safety check more lenient
This is to avoid ERR messages such as "object is not an image!"
that can happen when a legacy image function is called on an
eo image (proxy, 3d, ...) object.

Note: This does not fix any known issue, but it's probably a safer
solution.
2016-08-05 11:01:55 +09:00
Jean-Philippe Andre 28c917836c efl: Cleanup some code (return values)
This removes some useless code in various places, where the
switch from eo_do() to standard function call was not properly
refactored.

This changes:

type ret = 0;
ret = my_eo_function();
return ret;

To:

return my_eo_function();
2016-08-05 10:32:30 +09:00
Jean-Philippe Andre 26ee77ff67 evas image: Lower ERR message to WRN and fix it
In elm_image, efl_file_get() was called on a legacy Evas Image
object, which generated an ERR message. This was way too much
noise for something that actually works.

It's best not to call efl_file_get/set API on a legacy
object, but it can be convenient for smooth code transitions
from legacy to pure eo.

Also, add safety to those APIs.

Test case: elm_test genlist dnd, start dragging anything.
2016-08-05 10:32:30 +09:00
Jean-Philippe Andre 12fbaacc97 evas: Mark image fill_spread as deprecated
It was never implemented.
2016-08-05 10:32:30 +09:00
Jean-Philippe Andre 4d67ee2478 evas: Add safety checks to evas image legacy APIs
This checks for NULL and ensures the type is evas image.
2016-08-05 10:32:30 +09:00
Tom Hacohen bf772125e8 Eo: Move Eo back into beta.
Eo should now be considered beta again. This commit puts it back in beta
and makes it necessary to define EFL_BETA_API_SUPPORT before including
Eo.h.
2016-08-02 16:34:35 +01:00
Daniel Hirt 0d9ddc4514 Canvas text: fix range geometry calculation for RTL
Fixes T3627.

@fix
2016-07-31 10:33:30 +03:00
Carsten Haitzler 742fbc5717 evas canvas destruction - detect zombie objs and hack at them with axes
ok. so here's the issue at least now. we have eo objects in the canvas
and they have a refcount of 2 user_refcount is 0. the calls stack does
NOT show we are calling callbacks at that time on these objects. they
are not in the backtrace (the canvas is, the objects themselves are
not).

SOMETHING is keeping 2 eo "internal" refs on these objects and i have
no idea what/how/who. it's a royal pain in the butt to find out as the
only way is lots and lots of logging and you get drowned in the
logging...

so what I have now done is a super ugly workaround that detects these
zombie objects that refuse to die and just FORCES them to die when the
evas canvas frees and clears out layers.
ac10a00acc doesn't really cause the
issue, it just brings it out in the open for all to see far more
easily. but something is deeply wrong SOMEWHERE with SOME objects and
our refcounts.

this fixes T4187
2016-07-29 00:02:03 +09:00
Jean-Philippe Andre b2b980a737 evas: Fix inefficient updates with no_render
is_visible returns 0 if no_render is true, so should
was_visible as well. Yeah, there will be problems if
no_render changes on the fly. Don't do that.

Fixes T4193
2016-07-26 10:25:14 +09:00
Stefan Schmidt d922a556b4 evas: filters: add return value in all cases
Function with non-void return value so we need to add a return in all cases.
Thanks to gcc for complaining here.
2016-07-25 18:00:42 +02:00
Carsten Haitzler 10f7641dda evas cache2 - fix coverity CID 1357754
@fix
2016-07-24 18:44:15 +09:00
Carsten Haitzler 1c6bb48c11 evas image updates - optimize by over-rendering less with hidden content
so if an img obj had some update regions and was opaque, it didnt del
an update region first before adding the updates, thus possibly
letting update regions pass through the opaque image area

@fix
2016-07-24 18:44:15 +09:00
Chris Michael 3bc6e30d63 evas: Fix missing breaks in switch
Coverity reports that we are missing breaks in the switch blocks here,
so add missing breaks.

Fixes Coverity CID1347413 and CID1347414

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-21 12:25:02 -04:00
Carsten Haitzler 0e5d9980b2 evas image updates - reduce overhead with bordered images not scaled
this fixes over-rendering (where we render the whole image) if it has
a border set. do proper region updates if the image has a border but
is not scaled and the fill is at 0 0 and sams size as the object etc.
etc. so this is simple and doable.

this fixes T4123
2016-07-20 13:13:41 +09:00
Carsten Haitzler ba5e3ec2fb evas objkect image - make opaque rect getting code more readable
this just makes it more obvious where its handling the opaque middle
fill case.  see T4123 - i was just reding the code and this seemingly
does the right thing.
2016-07-20 11:34:01 +09:00
Jean-Philippe Andre 2c7f9481ed textblock: Prevent crash in evas_object_textblock_cursor_new(NULL)
This happened in expedite
2016-07-19 18:32:32 +09:00
Jean-Philippe Andre d5166657e2 efl: Add support for efl_event_flags() to hold events
This fixes the following ERR message:
ERR<30400>:eo /home/jpeg/e/core/efl/src/lib/eo/eo.c:462 _eo_call_resolve()
 in ../src/lib/evas/canvas/efl_event_input.eo.c:3: func 'efl_event_flags_get'
 (1483) could not be resolved for class 'Efl_Event_Hold'.

This is an EO-API only fix.
2016-07-19 16:12:05 +09:00
Jean-Philippe Andre 0e6b6c4828 efl: Hold event (EO API) should implement instance_get
This fixes the following ERR:

ERR<23969>:eo /home/jpeg/e/core/efl/src/lib/eo/eo.c:462
  _eo_call_resolve() in ../src/lib/efl/interfaces/efl_event.eo.c:5:
  func 'efl_event_instance_get' (1479) could not be resolved for class 'Efl_Event_Hold'.
2016-07-19 16:12:05 +09:00
Carsten Haitzler ac10a00acc evas - on shutdown avoid potential invalid memory access
i don't know for sure if this fixes T4103 but in theory i think it
might given a reading of the backtrace and a guess at what might
happen, so try this fix. it doesn't hurt and can only help.

@fix
2016-07-19 15:43:22 +09:00
Jean-Philippe Andre 38a32e98fb evas: Avoid proxy subrender if size is 0
See also D4159. This is an alternative to the proposed patch.

Fixes T3949 (I hope!)
2016-07-19 14:43:33 +09:00
Jean-Philippe Andre f18747e6dd Evas GL: Use [u]int64_t directly in all APIs
This removes the need for khronos_[u]int64_t as well as the special
typdef EvasGL[u]int64.

Hopefully this should work on all platforms (note: [u]int64_t is
used in Eina APIs, so it is already required for EFL apps).

Fixes T3200
2016-07-18 15:09:19 +09:00
Jean-Philippe Andre 5faf536f51 evas: Also fix was_opaque for rect & image
I believe the function is not used, so it doesn't really
matter.
2016-07-18 13:54:27 +09:00
Jean-Philippe Andre e1ff000704 evas: Some more opacity check fixes
This should fix T3309

Snapshot objects are image objects, so the function is_opaque
exists. No need to bypass it. Also, alpha rectangles are not
opaque. Assume that anything with a filter is not opaque.

All of this fixes T3309 but the main point was on snapshot
objects (probably because the only point of a snapshot is
to apply a filter on it).
2016-07-18 13:38:05 +09:00
Jean-Philippe Andre 9248d3a5ac evas: Fix cutout regions with transparent images
This should fix rendering issues with E theme and
transparent borders.

Fixes T3309
2016-07-18 11:57:38 +09:00
Tom Hacohen 8c6effae8e Evas font: Fix width query for OpenType fonts. (rewrite)
This is essentially a cleaner redo of ef817f15f0.
Logic should be exactly the same as there, the different is that this
one shares the code between OT and non OT.

Please refer to that commit for more information.
2016-07-14 17:32:01 +01:00
Tom Hacohen 281043e357 Revert "Evas font: fix width query for OT"
This was not done correctly. This split the code, which is essentially
the same for both OT and non OT. It's the same logic with some minor
additions for OT, so most of the code should be together.

This reverts commit ef817f15f0.
2016-07-14 17:24:38 +01:00
Daniel Hirt ef817f15f0 Evas font: fix width query for OT
Fixes T4068.
Simply querying the last glyph to determine the width of the glyph sequence
won't always work, as OT can have negative offsets (adjusts the placement of a
specific glyph better).

The solution is to calculate the "max width" of some sequence that will
guarantee us proper width results. The worst solution would be to iterate on all
the glyphs and sum up the max width. This is a bit impractical. Instead, we will
inspect just the "cluster" of the last glyph, if one exists.

This should have no performance impact on trivial cases, and very little impact
on the others.

@fix
2016-07-14 12:22:44 +00:00
Carsten Haitzler b1f2c335e6 evas headers - remove duplicate declarations of the same function
this should fix T3027
2016-07-14 13:32:13 +09:00
Daniel Hirt f9deaa9be9 Canvas text: add "changed" event
We need to keep track on changes of content.
2016-07-12 11:01:45 +00:00
Daniel Hirt 0c38846e33 Canvas text: fix annotation set
The cursor position was not set correctly to the respective fnode, causing
annotation to not be applied correctly with text that has more than one
paragraph.
2016-07-12 11:01:45 +00:00
Daniel Hirt 7ff05af885 Ui text: don't null-check for free() 2016-07-12 11:01:45 +00:00
Daniel Hirt 0c23985626 Canvas text: fix corner case in range geometry calc
The trivial case of [pos,pos] (i.e. range of length 0) didn't work if there is a
format item in 'pos'.
The condition was fixed to not include such items. The reason it was not
apparent for text items is that these have further handling in the rest of the
code and would've been disposed of.

@fix
2016-07-11 16:39:51 +00:00
Carsten Haitzler 52f752f73d evas render2 region - handle if src region is empty correctly on add
fix coverity CID 1313542
2016-07-11 22:16:06 +09:00
Carsten Haitzler 485074df3a evas engine cache - drop useless iff that assert already checked
CID 1267465 pointed this out - assert(eim) already checked this so no
need to do it again - looks confusing
2016-07-11 22:09:12 +09:00
Carsten Haitzler 2b413d3f87 evas cache - avoid possible deref of null pointer
this fixes CID 1267472
2016-07-11 22:06:16 +09:00
Carsten Haitzler 98a02fc17c evas scale cache - address possible coverity deadlock
this should fix CID 1106338  where we don't lock and unlock caches in
the same order.
2016-07-11 21:45:39 +09:00
Carsten Haitzler aa11fef218 evas object freeing - fix missing null check for layer
fix CID 1039409
2016-07-11 21:14:51 +09:00
Youngbok Shin 64e0dc341d Evas textblock: Apply scale factor to <linesize>, <linegap> formats
Summary:
Font size is scaled according to scale factor.
The linesize, linegap formats also have to be scaled properly.
@fix

Test Plan:
Test cases are included.
Run "make check"

Reviewers: woohyun, Jieun, tasn, herdsman

Reviewed By: tasn

Subscribers: raster, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3688
2016-07-11 17:57:40 +09:00
Minwoo, Lee d22850848d Evas Text: Fix width of BiDi text
Summary:
BiDi text is truncated because the way we find the last visual item in text object is wrong.
This patch is similar with _line_native_last_visual_get function in textblock.

Reviewers: cedric, tasn, herdsman

Subscribers: id213sin, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3947
2016-07-11 16:26:19 +09:00
Carsten Haitzler 3990032330 evas textblock - fix deref before null check shown by coverity
fixes CID 1356927
2016-07-09 12:07:10 +09:00
Carsten Haitzler 46b97aba78 evas module load - make coverity happy but not a bug
silence CID 1357364
2016-07-08 18:59:21 +09:00
Jean-Philippe Andre 86dc7e0c87 evas: Fix warning about unused function
I kept it here for the record. It was useful, could be useful
again.
2016-07-08 12:27:29 +09:00
Carsten Haitzler 1e4b63e885 evas regions in render2 - work around coverity complaints
CID 1352392 is a false positive as the ptr is not dereferenced, but
not making coverity confused it good.
2016-07-08 12:05:08 +09:00
Carsten Haitzler e57084d5c5 evas event handling4- fix more corner cases where bounding is bad
so smart object bounding box wasnt updated properly in several other
cases. fix those other cases too by dirtying bounding box region.

this continues on from:

f6b3c31561
25d77bc1d2
9f0fd66ab8

this fixes T4017

@fix
2016-07-08 10:17:56 +09:00
Carsten Haitzler f6b3c31561 evas event handling3 - fix yet more corner cases for clipped objects
this is a continuation fix from
25d77bc1d2 and
9f0fd66ab8

this fixes yet more corner cases after the above 2 fixes. our clip
cache tracking code seems to be broken somewhere and not updating - at
least when events are processed so i did ti the slightly slower way
and recursed through clippers to figure it out in this path. it all
works now it seems but it's got a small speed hit. better be right
than a little faster.

@fix
2016-07-07 14:12:22 +09:00
Cedric BAIL 005375176d evas: fix initialisation and shutdown of eet and eina by mesh loader and saver. 2016-07-06 13:26:15 -07:00
Jean-Philippe Andre edccf44150 efl: Rename "pointer" device class to "wand"
Because I like magic. And to avoid confusion with mouse pointer.
Suggested by @zmike in D3858 (Ecore_Device).
2016-07-06 11:27:06 +09:00
Carsten Haitzler 25d77bc1d2 evas event handling2 - fix incorrect object reporting
this fixes a new bug brought up by
9f0fd66ab8 which fixes event reporting
etc. etc. .. this fixes T4017

@fix
2016-07-05 22:40:51 +09:00
Jean-Philippe Andre 5bd437fe27 evas: Fix crash (?) in evas events
Reported by Shuhrat Dehkanov on the ML.
See f0fd66ab818d212fa88faef316ac17625f1a2f5.

Note: I didn't have a crash myself.
2016-07-05 19:53:13 +09:00
Jean-Philippe Andre aaec7d940f efl: Remove del_intercept before calling eo_del
In class destructor. Still not sure if we should do this
or just set the pointer to NULL.

Ping @TAsn
2016-07-05 19:43:06 +09:00
Carsten Haitzler 9f0fd66ab8 evas event handling - fix incorrect object reporting
this fixes event reporting for mouse in/out/move/down/up due to evas
just totally getting tese objects wrong.

this fixes T3718

@fix
2016-07-05 15:42:52 +09:00
Carsten Haitzler 9527240d74 efl - fix lots of little init/shutdown pairs that are wrong
i've fixed almost all the eina init/shutdown pairs to do the right
thing now... except one (ecore_shutdown) with comment inline where
eo_shutdown is not called. if this is called we are in crash land.
this needs further inspection.
2016-07-04 21:30:34 +09:00
DaeKwang Ryu 8b5d5a5a8d EvasGL: Add support for Evas GL 3.1
Summary:
2 wrapper functions are added.
(glFramebufferParameteri, glGetFramebufferParameteriv)

update gl2ext.h(generated 20160209) in evas_gl.h

Test Plan: OpenGL ES Conformance Test

Reviewers: jpeg

Subscribers: spacegrapher, wonsik, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3782
2016-07-04 20:47:57 +09:00
Jean-Philippe Andre 07ea964e9f evas: Fix rare issue with recursive proxy src invisible
Scenario:
  smart {
    text
    proxy -> text, src_invisible
  }
  proxy -> smart

What we should see:
  smart {
    (blank)
    proxy -> text
  }
  proxy -> {
    (blank)
    proxy -> text
  }

What we saw:
  smart {
    (blank)
    proxy -> text
  }
  proxy -> {
    text
    proxy -> text
  }

Solution:
Check in evas render, when we're inside a proxy render, and the
proxy src_invisible flag is on (evas_object_source_visible_set(0),
that we're rendering the object itself to its proxy surface. If not,
it means we're rendering another proxy surface, ie. a parent smart
object's proxy surface.

Still loving evas render.

Fixes T4006.

@fix
2016-07-04 16:09:39 +09:00
Daniel Juyung Seo bc7f223754 evas/textblock: Mark unused variable. 2016-07-04 07:31:15 +09:00
Daniel Hirt fed2b75780 Canvas text: simplify efl_text_get 2016-07-03 17:10:57 +00:00
Daniel Hirt 2be6c6b817 Canvas text: fix leak in annotation_insert 2016-07-03 17:10:56 +00:00
Daniel Hirt f7509bbb52 Canvas text: fix leak in efl_text_set 2016-07-03 17:10:56 +00:00
Daniel Hirt 06fd1566ea Canvas text cursor: fix bug after code port
Fixes T4005.
Also, unified repeated code and added a test for multiple cursors.
2016-07-03 14:39:45 +00:00
Carsten Haitzler 5fa3815e01 evas update buf - dont ref and unref outbug as an evas image - it's not
we need calls to ref/unref them from engines, but atm it's ok because
they dont get deleted until the flush is done and not used after that...

@fix
2016-07-03 15:45:46 +09:00
Jean-Philippe Andre d04ff8d69b evas object: Move display_mode to Efl.Gfx.Size.Hint 2016-06-30 14:34:59 +09:00
Jean-Philippe Andre 136a6b4464 evas: Add & fix legacy APIs for text filters
Those are marked as EINA_DEPRECATED since they are for legacy only,
and EDC is the preferred method.
Note: these are new in EFL 1.18.

I would rather have not added them as legacy APIs. This patch is
here to align to Tizen which added them by mistake. Also, remove
the "name" argument from filter_program_set as it's not required,
and also not there in Tizen's code base.

Sorry for the mess.
2016-06-29 11:02:41 +09:00
Jean-Philippe Andre b13ae2fb82 evas: Implement evas map support in eo as a mixin
It relies a bit on evas legacy APIs and will only work on
evas objects (Efl.Canvas.Object) for now.

The main difference with Evas_Map is that there is no
separate map object, as the functions apply directly to
any canvas object.

For convenience, most functions will automatically populate
the map if there was no previous map info. While this may
be convenient, the object's size changes still need to
be tracked to update the map info.
2016-06-29 09:57:58 +09:00
Jean-Philippe Andre a49bddd124 evas: Move evas_map APIs from common to legacy header
+ define Evas_Map struct in Evas_Legacy.h (not eo)

Otherwise, just a simple cut & paste
2016-06-29 09:12:26 +09:00
Jean-Philippe Andre 6b8228ffbd evas: Move map to a separate mixin
Evas map is not translated to proper eo apis yet.
Efl.Canvas.Map will be a mixin implementing the evas map
API in a bindable API.
2016-06-29 09:12:26 +09:00
Jean-Philippe Andre 2078b74e28 evas: Use proper type for stringshares 2016-06-28 19:21:46 +09:00
Jean-Philippe Andre d4b9328dcd evas: Fix double stringshare_del
A stringshare for font "style" was not properly duplicated,
resulting in lots of invalid stringshare pointers.

Ping @id213sin (commit 2ce33e73a7).
2016-06-28 19:21:46 +09:00
Youngbok Shin 2ce33e73a7 evas: add pattern "style" when evas query fonts via fontconfig
Summary:
Some fonts can have weird style and weight value.
If a font has a style name as "medium" and a weight value as "semi-bold",
Evas can't load the font using "font=Somefont:style=Medium".
It only can be load with "font=Somefont:style=SemiBold" or
"font=Somefont:weight=SemiBold".
On the other hand, it could be loaded when I tested the following commands.
fc-match -s ":family=Somefont:style=Medium" or
fc-match -s ":family=Somefont:weight=SemiBold"

Evas also should load font based on font's style name.
@fix

Test Plan: N/A

Reviewers: tasn, herdsman, cedric, woohyun, raster

Reviewed By: raster

Subscribers: Blackmole, z-wony, jpeg

Differential Revision: https://phab.enlightenment.org/D4108
2016-06-28 13:32:49 +09:00
Daniel Hirt 2b3bba1f7e Canvas text: fix format annotations deletion 2016-06-27 15:18:08 +00:00
Jean-Philippe Andre d3d655bedf evas: Fix bad clipping with proxy
evas-images2 example was broken due to excessive clipping.
This is one more issue with the cached clip geometry.

By default proxy_src_clip is true. The doc (that I wrote)
mentions that it means both objects (image proxy & source)
share the same clipper. So, this does not mean that the proxy
is clipped to the geometry of the source (this can be useful
in some cases, when replacing an object with a proxy to apply
some kind of effect on it... but this could be rare).

Thanks Amitesh for the report.

@fix
2016-06-27 21:04:49 +09:00
Jean-Philippe Andre 9f5d279722 Evas events: Implement support for hold event 2016-06-27 16:38:46 +09:00
Jean-Philippe Andre b48726989d evas object: Hide "del" event
In EO world, we should stick to EO_EVENT_DEL.
2016-06-27 14:08:55 +09:00
Marcel Hollerbach aadea46b35 evas: do not unref if there is no clipper
check if there is a clipper set before accessing it. This fixes crashes
of the drm engine.
2016-06-24 14:44:50 +02:00
Hermet Park 56074fd579 evas canvas: fix a proxy+map rendering issue.
This fix is wrt the non-updation of the proxy object.
If a source of a proxy object has mapped objects among its children,
Rendering frame won't be correct while they were keeping changing.

The reason is, evas_object_smart_changed_get() couldn't figure those changes
out correctly because of cached-clip visibility.

Cached-clip of smart member can't be used for map surface updation,
because cached-clip includes the visiblity status out of the smart object.

So, loose the criteria to make it rendering smart members in map.
2016-06-24 18:51:38 +09:00
Subhransu Mohanty 6e6c85293e evas vg: don't apply transformation to the origin point
Summary: Which will apply translate property twice once to shape and once to origin.

Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4086
2016-06-24 15:15:43 +09:00
Hermet Park 05d81d3c63 evas/canvas: rewrite a previous patch, ed444b698b
Reviwed further, I found out the origin shouldn't be accumulated with
previous clippers origin. I forgot this function is recursive
function.
2016-06-24 11:33:04 +09:00
Subhransu Mohanty e73533ebbc canvas/vg: fix the reference issue in evas_vg objects.
Reviewers: jpeg, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4079

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-06-23 10:15:44 -07:00
Oleksandr Shcherbina 71c1481e57 evas: avoid calculation bounding for camera and light objects
Summary:
Including camera and light to calculation aabb can lead to confusing in detemination
bounding of the whole scene (root node).
@fix

Reviewers: cedric, Hermet, raster

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4060

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-06-23 10:05:09 -07:00
Hermet Park ed444b698b evas canvas: fix broken proxy clipping.
Origin of clipper's clipper won't be transformed to derivative space.
So it needs to transform the coordinate additionally.
2016-06-24 00:48:34 +09:00
Hermet Park 48a64d827f evas canvas: code refactoring.
Compare integers clearly.
2016-06-24 00:27:45 +09:00
Tom Hacohen 56562b1643 Canvas text: Add missing cursor changed callbacks.
In some cases we were changing the cursors but not emitting callbacks.
This should fix that.
2016-06-22 14:03:06 +01:00
Tom Hacohen 3dc4490a99 Canvas text: Don't call callbacks while cursors are in inconsistent states.
The issue is that in some cases we were calling user code (callbacks)
when some of the nodes were referencing already deleted text nodes. This
caused invalid memory access. This commit delays the callback calling
until after all of the cursors got into a consistent legal state.
2016-06-22 14:03:06 +01:00
Jean-Philippe Andre f067bc6f71 evas: Fix crash in Efl.Ui.Box
This goes back to a stupid comment I made in 93fad2a19f2507a:
  No idea why evas_box was overwriting smart_data.get
  (esp. since it was returning a private struct).
Well, it turns out the struct is NOT private and the smart
data pointer can be used by any user of evas box (including
Efl.Ui.Box).

Fixes T3926
2016-06-22 10:53:37 +09:00
Daniel Hirt dbbb4bf8ad Canvas text: revert new behavior on text append
This was discussed and still wasn't decided whether this is required to be
supported internally.
The reason for this revert is that the behavior still needs tweaking to work
just right along with the legacy behavior.
2016-06-21 10:40:48 +00:00
Daniel Hirt 2651ab54a3 Canvas text cursor: fix text insertion
The cursor update hasn't considered when the pararaph is broken. The reason the
code path is different from legacy is because that it was originally intended to
support append and prepend operations in the new API. Since we don't anymore
(only supporting append operations in the new cursor with 'text_insert'), we can
simplify the insertion implementation and fix this.
2016-06-21 10:34:19 +00:00
Daniel Hirt e920b47d2b Canvas text cursor: remove redefinition, already in legacy. 2016-06-21 10:34:19 +00:00
Jean-Philippe Andre e445e1bb08 evas: Fix redefinition of Efl_Canvas_Object type 2016-06-21 16:28:41 +09:00
Jean-Philippe Andre 269fc4f7a6 evas: Remove common interface and use provider_find
Evas.Common_Interface not only had a bad name, it also
wasn't in line with how we can get a loop object, for
instance.

Use eo_provider_find in each implementing class.
2016-06-21 16:13:04 +09:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Jean-Philippe Andre 0ffa16d9cf evas: Fix usage of fill_set
efl.gfx.fill will reset the filled flag, so the internal function
needs to be called instead of the gfx api.

This test error was added in a very recent commit: ccaf12e1b6.
2016-06-20 15:48:46 +09:00
Jean-Philippe Andre ccaf12e1b6 evas: Use efl_gfx APIs where appropriate
This is a better fix than the previous patch, as it keeps
the legacy API check. The point of that check is: if the object
has been created with legacy API (evas_object_image_[filled_]add,
then legacy APIs are allowed, otherwise they are disallowed. This
means only EO APIs should be used on an eo_add() image object.
2016-06-20 14:11:32 +09:00
Jean-Philippe Andre 17a51cffd3 evas: Fix type checking for legacy APIs
This should fix canvas 3d examples (that were calling fill_set
and evas would reject with "object is not an image").
2016-06-20 14:04:09 +09:00