Commit Graph

457 Commits

Author SHA1 Message Date
Cedric BAIL 5dcbda3137 efl_ui_win: track the finalize future for del to avoid crash
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-13 15:14:50 -07:00
Carsten Haitzler 1bdd9e4dd1 ecore - a different take on efl.app class as a super class to efl.loop
so the MAIN loop is actually an efl.app object. which inherits from
efl.loop. the idea is that other loops in threads will not be efl.app
objects. thread on the creator side return an efl.thread object.
inside the thread, like the mainloop, there is now an efl.appthread
object that is for all non-main-loop threads.

every thread (main loop or child) when it spawns a thread is the
parent. there are i/o pipes from parnet to child and back. so parents
are generally expected to, if they want to talk to child thread, so
use the efl.io interfaces on efl.thread, and the main loop's elf.app
class allows you to talk to stdio back to the parent process like the
efl.appthread does the same using the efl.io interfaces to talk to its
parent app or appthread. it's symmetrical

no tests here - sure. i have been holding off on tests until things
settle. that's why i haven't done them yet. those will come back in a
subsequent commit

for really quick examples on using this see:

https://phab.enlightenment.org/F2983118
https://phab.enlightenment.org/F2983142

they are just my test code for this.

Please see this design document:

https://phab.enlightenment.org/w/efl-loops-threads/
2018-03-03 13:40:33 +09:00
Carsten Haitzler 1c74aaa7e9 Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303b.

Revert "efl: move signal events from efl.loop to efl.app"
This reverts commit 3dbca39f98.

Revert "efl: add test suite for efl_app"
This reverts commit 3e94be5d73.

Revert "efl: create Efl.App class, the parent of Efl.Loop"
This reverts commit 28fe00b94e.

Go back to before efl.app because I think this should be done with
superclassing here not a parent object. reasons?

1. multiple loops per single thread make no sense. so if multilpe loop
objects they wont be contained in a single app object and then deleted
like this.
2. the app object is not really sharable in this design so it cant be
accessed from other threads
3. it makes it harder to get the main loop or app object (well 2 func
calls one calling the other and more typing. it is longer to type and
more work where it is not necessary, and again it can't work from
other threads unless we go duplicating efl.app per thread and then
what is the point of splittyign out the signal events from efl.loop
then?)

etc.
2018-03-03 13:40:33 +09:00
Mike Blumenkrantz 28fe00b94e efl: create Efl.App class, the parent of Efl.Loop 2018-02-26 14:02:51 -05:00
Mike Blumenkrantz b851afcb13 elm_win: disable handling of auto_norender_withdrawn for fake wins
these wins are not to be trifled with.

fix T6377
2018-02-23 14:18:41 -05:00
Mike Blumenkrantz f8e93775c0 efl.access: remove parent property
most of this is just a reimplementation of efl_provider_find
2018-02-15 13:11:00 -05:00
Mike Blumenkrantz 8b7bbb2398 efl.access: name -> i18n_name 2018-02-15 13:11:00 -05:00
Mike Blumenkrantz 17687f4066 evas: remove Evas_Canvas.objects_in_rectangle_get
also implement Efl_Canvas method
2018-02-15 13:11:00 -05:00
Mike Blumenkrantz 420ba4691d evas: remove Evas_Canvas.objects_at_xy_get
also implement Efl_Canvas.objects_at_xy_get

note that any function which returns an iterator cannot be @const since
it's necessary to wref the object to ensure the iterator's lifetime
2018-02-15 13:10:59 -05:00
Carsten Haitzler 4195242c9b elm focus ... set focus in focus in if focus is not already on something
let's actually set focus in focus_in on window (ecore evas) IF focus
is not set. this seems to make terminology still work...
2018-02-13 18:12:11 +09:00
Carsten Haitzler 4eb5b2d3e8 efl ui win - if job runs after destruction of evas so dont flush pending 2018-02-13 15:28:47 +09:00
Carsten Haitzler 93e833d8cd efl ui win - fix focus break for terminology (at least)
at least terminology was broken by this. perhaps other efl apps. if an
efl app has decided to manually play with focus itself, like set focus
to some obj then leav ie, this line breaks that and interferes with
the object focused whenever the window gets focus set. if there is a
focus manager at least this is a new thing and so let the focus
manager set focus, but dont set old evas focus.

this fixes the break added in 56beb861e8
2018-02-13 13:46:38 +09:00
Marcel Hollerbach 56beb861e8 efl_ui_win: move inital focus set to focus_in handler
it seems that focus changes to FOCUS=FALSE are causing autodel windows
to kill themself, so we only set the focus on the window if the window
manager calls focus in AND we dont have anything to focus and nothing is
focused yet.
2018-02-11 18:04:06 +00:00
Shinwoo Kim 9f2e1d050f elm: Use ERR instead of CRI if *DATA_GET* returns NULL 2018-02-01 12:16:28 +09:00
Jean-Philippe Andre 426ccba6bd win: Fix legacy win type name
Window constructor is hijacked by the finalize method, which messes up
the normal order of operations. As a result, the legacy type name for a
window object was "elm_widget" rather than "elm_win".

This fixes a crash in E (as it checks the legacy type name to verify an
object's type).

See D5748
2018-01-25 11:43:31 +09:00
Sungtaek Hong cb25699dac efl_ui_legacy: add new interface to indicate legacy widget
Summary:
For now, how to check whether a widget is legacy or not
is to check flags in private data or static flag, which is set
during elm_legacy_add.
If Efl.Ui.Legacy interface is added, it can be easilly checked
by efl_isa(obj, EFL_UI_LEGACY_INTERFACE)

Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho

Subscribers: conr2d, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5748
2018-01-24 18:14:26 +09:00
YeongJong Lee f6ba674cd8 efl_ui_win: Avoid a call to NULL
Summary:
parent_get and smart_parent_get are called in parent_widget_get
this also remove the duplicated code

Reviewers: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5757
2018-01-24 15:36:08 +09:00
Jean-Philippe Andre 20570f74d3 widget: Move on_focus_update to Focus.Object
Following @taxi2se's recommendation. This is indeed a focus method, and
Widget already inherits from Focus.Object.

Ping @bu5hm4n who probably wants to adapt this further.

Ref T5363
2018-01-19 17:30:04 +09:00
Jean-Philippe Andre c35f257bf2 widget: Remove item from on_focus_update
It's legacy stuff, and always NULL.
2018-01-19 17:17:01 +09:00
Mike Blumenkrantz 7a3ec89fd2 elm_win: move wayland display flush to after method calls
ref b48781aa6c
2018-01-18 10:47:43 -05:00
Jean-Philippe Andre eb10b6eb25 win: Avoid a warning
I still hate those types.
warning: case value not in enumerated type 'Efl_Ui_Win_Type' [-Wswitch]
2018-01-18 16:20:52 +09:00
Jean-Philippe Andre 50a082cab9 win: Remove "ioerr" event
Unless it's implemented for Wayland as well, AND provides more
information than a NULL event_info, I see no point in this being an EO
event. Keep legacy as-is: a smart callback only.

Also, minor cleanups to the EO file.

Ref T5322
2018-01-18 14:06:45 +09:00
Mike Blumenkrantz b48781aa6c wayland: always flush client display when protocol sends are pending
in the case where a connection was not actively rendering, there was nothing
which would trigger a display flush, leading to applications potentially
deadlocking

@fix
2018-01-17 17:06:13 -05:00
Jean-Philippe Andre 7cef580f11 win: Fix standard window bg with custom themes
Ref T6579
See also D5740
2018-01-17 14:18:25 +09:00
Mike Blumenkrantz ffa276fce3 wayland: add xdg-shell vfinal support for client-side
@feature
2018-01-10 11:39:52 -05:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Carsten Haitzler f8c9b0d71e warning remove - ignoring const (returning obj handle)
cast to fix
2018-01-06 19:01:05 +09:00
Cedric BAIL 526415d903 eo: make efl_provider_find a @const function. 2018-01-04 11:45:10 -08:00
Carsten Haitzler 9bedda14b3 efl loop - rename ecore_main_loop_get to efl_main_loop_get
ecore_main_loop_get() is really a new "eo api" but it's using our old
ecore_* namespace, so move to the new efl namespace.
2018-01-02 16:13:54 +09:00
Amitesh Singh 9db0ec554b interface: add Efl.Gfx.Color interface for color related APIs
This would eventually turn into mixin class later after adding
more color related helper functions.
2017-12-22 13:29:20 +09:00
Jean-Philippe Andre 0f1469280d win: Show windows created by efl_add with a job
This fixes efl_add(WIN) on wayland, using an internal API.
Test scenario:
  ELM_DISPLAY=wl elementary_test -to "Part Shadow"
2017-12-19 20:37:25 +09:00
Sungtaek Hong 25136ddf8c efl_ui_bg: add Efl.Ui.Bg interface
Summary:
- Previous class efl_ui_bg moved to efl_ui_bg_widget.
- Scale_type moved to efl_image from efl_ui_image.
- Previous enum Efl_Ui_Image_Scale_Type moved to Efl_Image_Scale_Type.

Test Plan:
Run elementary_test
1.Image Scale Type
2.Efl.Ui.Bg
3.Efl.Ui.Win
4.Part Background

Reviewers: jpeg, woohyun, cedric

Differential Revision: https://phab.enlightenment.org/D5616
2017-12-18 20:49:45 +09:00
Amitesh Singh 72b96bc4c5 Efl.Canvas: make pointer_iterate a beta API
Gesture framework should implement it.
2017-12-12 15:52:33 +09:00
Hosang Kim 26272bf3a2 win: apply conformant features.
Summary:
- implement indicator enable/disable
- implement indicator type
- add indicator swallow area to border.edc
- add 'test win indicator' sample

Test Plan: elementary_test -> win_indicator

Reviewers: woohyun, cedric, jpeg

Subscribers: taxi2se, jypark, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5418
2017-12-12 10:53:14 +09:00
Amitesh Singh 80463f0e2e interface: add Efl.Canvas.Pointer intf for pointer related functions.
and remove pointer_inside function from Efl.Canvas{}
2017-12-08 20:13:31 +09:00
Sungtaek Hong 751cf2c0d0 efl_ui_widget: make Elm.Widget.theme, Elm.Widget.theme_object internal 2017-12-08 16:02:22 +09:00
Sungtaek Hong f80ab519af efl_ui_widget: use elm_widget_element_update to set subobj edc
affected widget list:
efl_ui_clock: test, ampm
efl_ui_multibuttonentry: guidetext, label, closedbutton
efl_ui_slider: popup(indicator)
efl_ui_text: scroller, handler, magnifier, cursor, selection, anchor
2017-12-08 15:57:26 +09:00
Sungtaek Hong dd4467505e efl_ui_widget: find new edc resource for efl_ui_widgets
new eo widgets(efl_ui_ prefix) finds new edc group in
data/elementary/themes/edc/efl/*.edc.
New group name is "klass/group:style" and "base" group name and
"default" style name can be omitted.

for now, separator for style is ':' but needs to be decided.
2017-12-08 15:57:26 +09:00
Amitesh Singh 54ae9cc18b edje: rename Edje.Object to Efl.Canvas.Layout 2017-12-06 13:12:29 +09:00
Jean-Philippe Andre c372e5e6c7 win: Allow unref until deletion
This is for bindings. I wish I could actually distinguish the use case
more (between efl_add() from C and instantiation from C++).
2017-12-05 10:15:40 +09:00
Amitesh Singh 10103b9b45 efl.gfx: move scale{} from efl.ui.base to efl.gfx 2017-12-04 14:38:39 +09:00
Amitesh Singh 29b47e0a07 focus: remove focus.get{} from widget.eo
This is taking care by focus manager now.
2017-11-29 19:25:14 +09:00
Jaehyun Cho 4b18e754de elm_part_helper: Change macro name for default content part 2017-11-29 13:43:21 +09:00
Marcel Hollerbach 5efe5cd135 efl_ui_win: use new api
we can just call the manager to prepare itself in the direction we have,
this means we dont need this loop here.
2017-11-22 13:24:52 +01:00
Pawel Aksiutowicz b291d25dfc elementary: removed warning from efl_ui_win
Reviewers: stanluk, lukasz.stanislawski

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5503
2017-11-21 11:12:45 +09:00
Derek Foreman f0f02d3386 win: make _elm_win_opaque_update check that it has a wayland window
This function will destroy non-wayland engine data, so it should
make sure it's actually operating on a wayland window.

Originally the sd->wl.win test was sufficient, but now wl.win is
present on non-wl windows to facilitate cut and paste, so we need
to check more thoroughly.
2017-11-20 12:55:48 -06:00
Jean-Philippe Andre 372bf108a7 win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.

I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).

I have not modified the internal code, which still uses an array (as
ecore evas uses that).

Mote: ec464939d9 removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.

Note 2: I couldn't test as desktop E doesn't support WM rotations.

Ref T5322
2017-11-20 19:02:29 +09:00
Jean-Philippe Andre 313eb563b5 win: Rename specific APIs to avoid clashes
This renames 3 basic APIs specific to Win:
 - name
 - type
 - role

Ref T5322
2017-11-16 19:11:51 +09:00
Jean-Philippe Andre e9ebe5c676 elm: Define and rename internal atspi struct in EO
This thing is used by only 2 EO APIs that are marked as @beta. I wonder
if the @beta tag or the ptr() expression made it work for eolian,
because it simply wasn't defined in EO.

I'm renaming it just so that it's more consistent with the new names
used by atspi (and EO API in general).
2017-11-16 12:00:18 +09:00
Lukasz Stanislawski c838e30a24 elm: Rename elm_interface_atspi_widget_action mixin
Reviewers: jpeg

Subscribers: jenkins, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5400
2017-11-16 12:00:18 +09:00
Cedric Bail babcb0f1e4 elementary: do not send a PAUSE event if not iconified. 2017-11-15 16:29:14 -08:00
Marcel Hollerbach 07cb2d2dcd efl_ui_focus_object: document the bahaviour of the manager property 2017-11-15 13:21:22 +01:00
Shilpa Singh 36afcf2af9 efl_ui_win.c: send bounds changed signal on window rotation
Summary:
On window rotation send bounds changed signal to inform ATSPI client
about the orientation of window

Test Plan:
In ATSPI mode, when orientation of efl window is changed, ATSPI client should
get notification

Reviewers: kimcinoo

Subscribers: cedric, govi, rajeshps, jpeg

Differential Revision: https://phab.enlightenment.org/D5469
2017-11-15 14:41:37 +09:00
Jean-Philippe Andre 0c142462a1 win: Move autodel to C only
Note: this is C only, not legacy only.
The problem is that bindings will hold a strong reference to the window,
which will then die "under the rug" if autodel is enabled. This then
leads to at least ERR if not crashes.

Note:
elm_policy needs to support autodel and quit on last del only for C
applications. Bindings will require some other mechanism that doesn't
break all assumptions wrt. references.
2017-11-14 12:18:39 +09:00
Marcel Hollerbach 63ef60402f efl_ui_win: unfocus and focus again the most upper widget
if we unfocus a window we should unfocus also the current focused
widget.

fix T6297
2017-11-13 14:21:06 +01:00
Jean-Philippe Andre c308498a9d win: Fix alpha windows
Fixes T6334
2017-11-08 16:17:29 +09:00
Carsten Haitzler 784411800b elm win - note need for other display system code... 2017-11-07 17:36:57 +09:00
Jean-Philippe Andre d39bbc1491 elm: Create legacy widgets with elm_legacy_add
This will be used to solve issues around style_set:
if the widget is legacy or pure eo we may need to select a different
style. So in the constructor we need to know whether we are legacy or
eo. Note that calling style_set in finalize only is too late as we would
lose information such as efl_text_set() called inside efl_add().
2017-11-07 14:50:31 +09:00
Carsten Haitzler 6a47c2243e efl ui win - make win centering work with multiple screens
this should fix T6323
@fix
2017-11-07 13:53:27 +09:00
Jean-Philippe Andre 9cec14918c evas: Move evas_canvas.eo to legacy-only
This isn't meant to be installed. The canvas API in EO is based around
the interfaces Efl.Canvas and the widget Efl.Ui.Win. Anything else is
not EO (eg: ecore_evas, evas, ...)

Note: evas_canvas3d is the last remaining thing that is installed along
EO files, but those are all beta APIs.
2017-11-01 11:22:33 +09:00
Jean-Philippe Andre b8ca1272ae evas: Add seat argument to 'pointer_inside' (EO)
This merges pointer_inside and pointer_inside_by_device.
Affects only EO.
2017-11-01 11:22:33 +09:00
Mike Blumenkrantz ed30f41de8 wayland: add support for efl weight hint propagation from elm_win to efl_wl
@feature
2017-10-25 10:44:16 -04:00
Mike Blumenkrantz ffac7fc539 wayland: fix window stack implementation
ref T5350
2017-10-25 10:44:16 -04:00
Jean-Philippe Andre 006546a042 elm: Use auto_unref for parts
This avoids leaks.
2017-10-24 14:49:12 +09:00
Jean-Philippe Andre 2f465e1fbb widget: Rename EO APIs to efl_ui_widget_xxx
This only changes the eo_prefix for APIs.

Ref T5363
2017-10-24 14:30:21 +09:00
Lukasz Stanislawski 57aefc53c1 elm: rename Elm_Interface_Atspi_Accessible interface
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5341
2017-10-19 10:13:54 +09:00
Jean-Philippe Andre dfd98b3e48 win: Do not forward all key events on win (legacy)
OMG... I do not like this patch.

See T6148, two key down events are received when a key grab is installed
on a Win object. This is because all input events are propagated from
ecore all the way up to win and can be listened on. Unfortunately this
breaks existing applications that use the key grab API properly to
listen to key events.

Another side effect is that ALL key events are received by the window,
which means it's not limited to what the application expected (from its
list of grabs).

Solution (ugly): block propagation of key down/up events if the window
is a legacy window. This means that no key grab is required for EO
windows, but key grabs are still required for legacy windows.

Fixes T6148

@fix
2017-10-18 21:01:56 +09:00
Jean-Philippe Andre b5c241ca08 frame: Implement content set/get/unset
Not a huge fan of my macro as it uses efl_part() where a direct call
could be possible, depending on the widget (win can, frame can't).

See D5241
2017-10-17 17:31:38 +09:00
Jean-Philippe Andre c9c9e6a209 elm: Rename Elm.Activate to Efl.Ui.Activate
Note: This is an EO-only beta API.

Ref T5329
2017-10-17 17:31:38 +09:00
Marcel Hollerbach 75f5ea686f efl_ui_focus: add parent_provider
thats just a little helper, where the logic to find and fetch the
provider is bound to the position in the widget tree, this means that
for example gengrid could change the way the logical parent is
evalulated. (For example to map the logical parent to a item)
2017-10-13 12:31:47 +02:00
Jean-Philippe Andre ccee1c0944 eo: Simplify debug_name_override
Simply pass in the strbuf and don't expect the callee to own it. This
makes things simpler and safer (it'll crash only if the callee frees
said strbuf, and shouldn't leak). efl_ebug_name is new in the upcoming
release, EFL 1.21.

Realised this after talking with Amitesh. Thanks.

See 999dbd9764
And c4769ff898
2017-10-13 10:57:00 +09:00
Marcel Hollerbach 8453ebfe4e elm: move the focus direction definition to general
and remove the old definition
2017-10-10 19:28:48 +02:00
Marcel Hollerbach 17e730e8e0 efl_ui_win: port to new focus api! 2017-10-10 19:28:48 +02:00
Jean-Philippe Andre 4c0167916b focus: Avoid infinite loop in window
I kept the safety error message for easier debugging.
Test scenario:
  elementary_test -to "Window Inline"
  Click on an entry. Press Shift+Tab.

Ping @bu5hm4n
2017-10-10 19:32:50 +09:00
Carsten Haitzler 49df80aa6f efl ui win - quieten coverity complaint about dead code
the count ?: 1 check is pointless as count is already checked above.
make it clearer that it's > 0 and remove the ? check. silence for
coverity CID 1380542
2017-09-28 15:28:00 +09:00
Cedric BAIL 1ac4a03d4f elementary: avoid segfault when getting focus due to an infinite recursion.
This was two line switched and setting the callbacks on the wrong object.
2017-09-26 15:21:12 -07:00
Cedric BAIL 0b8e3e6fcf elementary: restore input propagation and destroy array properly. 2017-09-26 10:15:07 -07:00
Jean-Philippe Andre 56667a84b1 win: Remove invalid callbacks
Faulty commit (guess who?):
  596dba5fe5

See also d567faa778

Finally make check works again. That was... a painful lot of patches to
fix.
2017-09-26 18:15:45 +09:00
Jean-Philippe Andre e1df334caf Revert "Fix infinite recursion for legacy + efl ui win events"
This reverts commit d567faa778.

This is not trying to fix the root cause for the infinite loop.
2017-09-26 18:11:38 +09:00
Jean-Philippe Andre 5258a6d46f win: Avoid calling same function twice on shutdown
This avoids calling:
  ecore_evas_callback_delete_request_set
  ecore_evas_callback_resize_set
twice when deleting a window. Also adds safety over sd->ee.
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre c2ae93089b win: Avoid safety ERR in efreet
This is an error happening in make check. Annoying but mostly harmless.
2017-09-26 17:58:07 +09:00
Sungtaek Hong ebff5e8639 elm_bg: rename elm_bg to Efl.Ui.Bg
Summary:
elm_bg was supposed to be used only in legacy,
but since we need a common object to be used as a background of widgets,
it is now renamed as efl_ui_bg and supports EO APIs.

Reviewers: cedric, jpeg, woohyun

Differential Revision: https://phab.enlightenment.org/D5147
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 8557fe818f input: Move pointer props to Canvas
efl_input_pointer_position is defined by two classes... bad!

Fixes T6066
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre e9dfcb44ff widget: Implement translation API in layout
This moves the API entry points from Widget to Layout parts. I don't
think the other widgets support translation, but that is easy to fix.
The actual code implementation remains in elm_widget.c.

Legacy-only widgets are covered by Part_Legacy, while all EO widgets
that have text inherit from Layout (except Win but I don't think the
window title was translatable in legacy).

This removes 2/3 remaining part APIs from Widget.

Ref T5363
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 839c4ed395 elm: Introduce interface Efl.Ui.Translatable
This will be used to replace the part translation API in Elm.Widget. It
should work for both parts and non-parts (ie. the main text of a button,
for instance).

For now I'm taking the following approach:
 - All efl_text_set/get strings are untranslatable, i.e. get() returns
   the visible string, set replaces and can not be translated.
 - translatable_text_set/get needs to be used to enable automatic
   translation, which in turns calls efl_text_set to modify the visible
   string. Thus, translatable applications will have to use
   efl_ui_translatable_text_set a lot more than efl_text_set, unless
   they translate strings application-side.

Note that some other frameworks take a simpler approach equivalent to
calling efl_text_set() with an already translated text. This prevents
runtime language changes of the application, unless the application
handles them specifically.
2017-09-26 17:58:07 +09:00
Carsten Haitzler d567faa778 Fix infinite recursion for legacy + efl ui win events 2017-09-26 16:44:45 +09:00
Cedric BAIL 596dba5fe5 elementary: provide and implement lifecycle event on the window.
pause event means that the window is not visible anymore to any user.
resume is triggered when the window became visible again or just
became visible again.
2017-09-25 15:48:53 -07:00
Jean-Philippe Andre 0339ad7740 elm: Move base implementation for efl_part in widget
This means that ALL part handles inherit from the base part class
Efl.Ui.Widget.Part. Layout is the only exception where Efl.Part is
specially overridden.

This is a first step towards generic part APIs, including background in
all widgets.
2017-09-21 12:27:33 +09:00
Jean-Philippe Andre 3617053547 win: Use Eina.Size2D for pointer position
Also rename the function for more consistency.
2017-09-19 10:51:48 +09:00
Jean-Philippe Andre e4517b28d6 efl: Use Eina.Size2D for screen size
This API isn't so great when considering Wayland...
2017-09-19 10:51:48 +09:00
Jean-Philippe Andre 2df8ad36b4 evas: Use Eina.Slice on the stack (gfx.buffer) 2017-09-19 10:51:48 +09:00
Jean-Philippe Andre 1f242afdef evas: Use Eina.Size2D for gfx.buffer
For consistency.
2017-09-19 10:51:48 +09:00
Jean-Philippe Andre 686366a03b evas: Use Eina.Rect for object list functions
- objects_at_xy_get
- object_top_at_xy_get
- objects_in_rectangle_get
- object_top_in_rectangle_get
2017-09-19 10:51:48 +09:00
Jean-Philippe Andre bfd9487b94 efl: Use Eina.Size2D for Efl.Canvas.max_image_size
Rarely use
2017-09-19 10:51:48 +09:00
Jean-Philippe Andre d8eea084fb efl: Use Eina.Size2D for size hint aspect 2017-09-18 16:50:58 +09:00
Jean-Philippe Andre 6b5d155918 efl: Use Eina.Size2D for size hints base & step 2017-09-18 16:38:47 +09:00
Jean-Philippe Andre a72f3ec64e efl: Use Eina.Size2D for size hint combined min
For this patch I decided to add a pseudo legacy wrapper as the function
is called in a very large number of places. Fixing all those calls to
use the size2d form is a lot of work and a greater risk of b0rking
something.
2017-09-18 16:33:33 +09:00
Jean-Philippe Andre 7d2b4b6916 efl: Use Eina.Size2D for size hint restricted min
This is the "internal" or "intrinsic" minimum size, to be set by EFL and
not by applications.
2017-09-18 14:57:52 +09:00
Jean-Philippe Andre d24dcb3c24 efl: Use Eina.Size2D for size hint max 2017-09-18 14:20:03 +09:00
Jean-Philippe Andre 4c634ed78e efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I
got it right... fingers crossed.
2017-09-18 13:34:50 +09:00
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Jean-Philippe Andre 58c2c50dcc efl_access: Use Eina.Rectangle (EO) 2017-09-13 18:20:45 +09:00
Jean-Philippe Andre 13da5e980e efl_gfx: Use Eina.Rectangle for geometry (EO)
This saves a few lines already (without even having the proper helpers
for stack rectangles).
2017-09-13 18:03:34 +09:00
Jean-Philippe Andre d5a31f3f30 edje/elm: Rename _internal_ to _part_ (EO)
In Edje and Elementary, we have part objects, which are what is returned
by the interface efl_part(). Those objects can't be of an opaque type as
this doesn't work nicely with strongly typed languages such as C++ or
C#. In JS, Lua, C the types are weak and mostly runtime-based so it
doesn't matter much.

As a consequence, the documentation and the types need to look nice in
this EO API. Thus, we remove the abusive term "internal" and explicitly
call all those classes "part" something.

Eventually we want the types to be declared in the EO file so bindings
(C#, C++, ...) can generate the proper access methods, returning the
best possible types.

Note that right now a few of those part types are used in the legacy API
but don't actually need to be exposed externally.

This is kind of a mega commit that does all the renaming at once, but
it's really just a big sed operation. The power of good IDEs :)

Ref T5315
Ref T5306
2017-09-13 13:53:49 +09:00
Jean-Philippe Andre 6d0957b0a5 widget: Rename focus_manager_factory to create
factory is not a verb :)

Ref T5363
2017-09-13 13:43:55 +09:00
Lukasz Stanislawski 9cf8e75668 elm: rename Elm.Interface.Atspi.Component => Efl.Access.Component
Reviewers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D5164
2017-09-12 15:49:29 +09:00
Lukasz Stanislawski dfd17229fd elm: rename Elm.Interface.Atspi.Window => Efl.Access.Window
Reviewers: cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5162
2017-09-12 15:48:10 +09:00
Marcel Hollerbach 6a12d9c367 efl_ui_win: specify the correct manager
a widget in higher hirachies is not registered in the lower one.
2017-09-02 20:06:15 +02:00
Derek Foreman e368896145 elm_win: Stop hiding the mouse cusor on window out under wayland
We needed to do this to prevent burning cpu with animated cursors
before we did frame callback based animating.

Now the compositor will stop our frame callbacks when our cursor
is implicitly visible when the pointer isn't over our window,
so we don't have to use window hides for it.
2017-09-01 13:32:50 -05:00
Jean-Philippe Andre cfe8170624 win: Fixup doc & code of icon_object
Ref T5322
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 74290355da win: Use array for available_profiles (EO)
The legacy API wraps the EO API.
All tested with "Configuration" test case in elm_test.

Ref T5322
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 4d6bb96e8d win: Drop calls to lower when using the EO API
Note: The distinction is made on how the window was created, not on
which API is used (evas_object_lower or efl_gfx_stack_lower or
elm_win_lower).

Ref T5322
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre f88f0798ba win: Implement raise from stack (EO)
I think the intercept is not required anymore. All raise functions call
the ecore evas raise function.

Ref T5322
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre b40d8296ff win: Move focus_highlight_animate to widget (EO)
Similar to the previous commits. Moved for consistency.

Ref T5363
Ref T5322
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 94632f8a44 win: Move focus_highlight_enabled to widget (EO)
This was actually declared in the internal legacy API in widget.
Forwards the calls to the window.

Ref T
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 0972c49438 win: Merge focus_highlight_style with widget (EO)
Note: elm_test "Focus Style" can be used to test this API. The test case
is a bit broken (overly complex EDC?) but if you're patient you can see
the difference between "glow" and "glow_effect".

Ref T5363
Ref T5322
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre c0d7ea4af0 widget: Rename on_focus to on_focus_update (EO)
on_focus seems to imply that focus was just given to the widget, but
that function is called on any focus change (in and out).

Ref T5363
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 89492d859b win: Merge focus with elm_widget's (EO)
I believe this should work fine!

Ref T5363
Ref T5322
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 94d671c971 widget: Fix legacy for focus_mouse_up_handle (EO)
This removes the special code in the legacy API for
elm_widget_focus_mouse_up_handle. Add an internal helper to find the
first widget parent. And mark as protected.
Apparently this functions is still required for the new focus manager.

Ref T5363
2017-08-31 13:48:05 +09:00
Jean-Philippe Andre b6bab481aa widget: Mark old focus API as beta.
It's not beta. It's about to die.
Also, move #define ELM_WIDGET_BETA to the common header file, as it is
consequently required by ALL widgets. :(

Ping @bu5hm4n :)

Ref T5363
2017-08-31 11:22:04 +09:00
Marcel Hollerbach ea5b0bdfde efl_ui_focus_manager: make logical_end work better
it turns out that we should also repsect logical elements that are
having a redirect_manager, since they are more at the "end" then a
potential regular node.

The user now needs to handle the logical_end call on this manager, or
handle at all what he wants to do with this information.

efl_ui_win now handles it in the way that it just focuses that logical
node, (which results in the redirect manager beeing set, then calling
again logical_end on that manager. Repeating this until we have finally
found a regular node that does fit out needs.
2017-08-30 22:39:52 +02:00
Jean-Philippe Andre 8c1f771a67 widget: Use rectangle for focus_hilight
Ref T5363
2017-08-29 16:22:47 +09:00
Jean-Philippe Andre 6aa309ffb8 widget: Rename hook "disable" (EO)
Renamed to on_disabled_update.
Also passed in the new state of disabled. It's more convenient this way,
than having the subclasses call disabled_get.

Also simplify some code...

Ref T5363
2017-08-29 10:40:53 +09:00
Jean-Philippe Andre 6e5e8e567b widget: Rename hook "orientation" (EO)
Renamed to on_orientation_update

This internal / virtual function is in fact not overridden anywhere. Not
sure it is necessary to expose it in EO API?

Ref T5363
2017-08-29 10:40:53 +09:00
Mike Blumenkrantz 8dbea4a709 elm_win: check for wayland engine during finalize by checking for wl win
fake wins don't provide engine info, but a wl win will still exist

@fix
2017-08-25 14:48:12 -04:00
Mike Blumenkrantz d0f1a57ade elm_win: update opaque region for fake windows
fake windows still gotta render

@fix
2017-08-25 14:48:12 -04:00
Cedric BAIL d179a5c2a9 efl: remove PS3 backend.
This backend has received no patch and maintenance from anyone who could
actually test it over the last few years. After talking with KaKaRoTo it
is best to remove it. If anyone want to take over its maintenance, you
are welcome to revert this patch.
2017-08-25 10:48:42 -07:00
Jean-Philippe Andre f1ab8c8fee widget: Remove more functions from EO
Internaaaaaaaalsssss....

Ref T5363
2017-08-23 20:53:20 +09:00
Jean-Philippe Andre 5cfd698894 win: Remove types socket and fake from EO
Fake: This should never have had the fake_canvas_set API. It already can
not work after efl_finalize. And Ecore_Evas isn't part of EO API so it
doesn't make sense at this point to try to expose the fake window as
part of EO API.

Socket: This is the only type of window that implements socket_listen.
So we can just move this function to a new subclass.

NOTE: Socket & plug are currently broken, even in 1.20 (at least for me)!

Ref T5322
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre e9dffa723d win: Add Efl.Ui.Win_Inlined and remove parent2
Inlined windows are the only use case for parent2. We might as well want
to create a separate subclass for those special windows.

Ref T5322
Ref T5363
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 20a5968c12 elm: Use a macro to handle key bindings
This factorizes the code and makes most widgets handle key down events
in the same way:
 - check that the object is not disabled, event is not on hold
 - figure out the key binding based on the class name
 - mark event as on hold

The class name is usually MY_CLASS_NAME but in some cases it was
MY_CLASS_NAME_LEGACY which may be different from the EO class name (eg.
elm_win vs. Efl.Ui.Win). In that case the key bindings are broken.

This breaks key bindings for the following widgets:
 - Win (focus)
 - Image ("clicked")
 - Video (move, play)

This fixes key bindings for the following widgets:
 - Nstate

Some widgets remain broken:
 - Photocam / Efl.Ui.Image.Zoomable

A patch will be applied to restore the key bindings for the above
breaks.
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 069747b9de widget: Add eo event info inside widget_event
This is an internal function that should probably become an overridable
protected method, as it's required for proper event handling in widgets.
Next step: use eo_event_info in the widgets implementations. Then remove
legacy event struct.

Ref T5363
2017-08-23 11:16:45 +09:00
Mike Blumenkrantz f00a49835d wayland: remove xdg5 support
this has not been used or tested since last year and there are no major
compositors which lack xdg6 support
2017-08-11 18:43:12 -04:00
Mike Blumenkrantz 398ffe40a3 wayland: fix xdg-shell popup windows
@fix
2017-08-11 18:43:12 -04:00
Jean-Philippe Andre 39c791dcbc win: Prevent crash inside ecore evas callbacks
After any complex call on the window, a foreign evas/efl callback may be
triggered that could delete the window object. This leads to crashes in
queued jobs or even immediately after said callback (right now EO
prevents immediate memory free using eina_freeq or eina_trash so the
effects aren't immediate).

Funnily enough, this was a known issue according to some comments, but
no one bothered fixing it...

In this particular instance, a focus_out job was crashing while trying
to access now-invalid sd data.

I believe some uses of ELM_WIN_DATA_GET() may still be slightly unsafe
but most look like they should be the result of an EO call on the object
(eg. a call to efl_event_callback_call), which ensures the object is
alive.

Fixes T5869
2017-08-11 11:23:21 +09:00
Marcel Hollerbach df3d0e3d7b efl_ui_focus_manager: make focus a property 2017-08-10 20:56:04 +02:00
Marcel Hollerbach d4cd85aa55 efl_ui_focus_manager: split this of tinto a class and a interface
it turns out to be very handy to have a interface for the moving and
border elements, that is unconnected to the way of how widgets are
registering themself.

This for example enables us to get a simple focus manager that just
redirects the call into a internal 2 dimensional data struct
2017-08-10 20:55:50 +02:00
Jean-Philippe Andre dee61f4097 elm: Cleanup theme and style set functions
This makes efl_ui_layout_theme_set() return a Theme_Apply error
code. The type is now public as Efl.Ui.Theme.Apply.

Ref T5329
Ref T5363
2017-08-09 17:08:24 +09:00
Mike Blumenkrantz f7278719c1 elm_win: set shadow geometry based on borderless state
@fix
2017-08-07 13:26:51 -04:00
Mike Blumenkrantz 56936c91c0 elm_win: simplify/fix recalc logic when changing csd
forcing a full eval here is unnecessary and broken since such an eval could
either change geometry in unexpected ways or fail to accurately change
the underlying canvas geometry

@fix
2017-08-07 13:26:51 -04:00
Mike Blumenkrantz 6a6505106a elm_win: propagate window aspect hint in wayland 2017-08-04 16:15:43 -04:00
Taehyub Kim 94d3fd3d82 win: implement efl_provider_find for EFL_UI_WIN_CLASS
Summary:
Implement efl_provider_find function for efl_ui_win class.
This will support to search window class by efl_provider_find function.

Reviewers: jpeg, cedric, Jaehyun_Cho, thiepha, woohyun, Blackmole

Reviewed By: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D5045
2017-08-04 10:24:03 +09:00
Jean-Philippe Andre 999dbd9764 eo debug name: Use strbuf instead of slstr
This should be a little bit more efficient, even if more "risky"
in terms of leaks. The final API still looks exactly the same.
2017-08-04 10:24:03 +09:00
Jean-Philippe Andre 569ad0bac4 evas/edje/elm: Override debug_name in core classes
This is really only a demonstration of what kind of information
we can print with efl_debug_name_get(). Hopefully this can help
debugging with printf/ERR logs and even help with live debugging
inside gdb.

This shouldn't be used for other purposes than debugging, as the
exact string format is not defined.

@feature
2017-08-04 10:24:03 +09:00
Jiyoun Park c3d8a1d9f4 efl_ui_win: add error hanling code for malloc fail 2017-08-02 16:42:04 +09:00
Jiyoun Park ca625aa323 efl_ui_win: add EFL_UI_WIN_SOCKET_IMAGE type check
elm_win_socket_listen api only work for EFL_UI_WIN_SOCKET_IMAGE type window.
    So it is better to add type check code.
2017-07-31 15:20:02 +09:00
Mike Blumenkrantz 812be4a43b elm_win: do not implement aspect_get()
this breaks aspect hints.

@fix
2017-07-28 15:40:47 -04:00
Mike Blumenkrantz 5070ecc99a elm_win: instantiate csd frame after creating pointer surface
csd attempts to create sw cursors if the pointer surface doesn't exist,
so create the pointer surface before the csd to avoid duplicate cursors

 #TheDisappointer
2017-07-21 16:17:53 -04:00
Mike Blumenkrantz 5acd75c0c9 elm_win: do not set invalid geometries on the window object
clamping to 1x1 is not valid, neither is trying to always position at 0,0

 #IGot99TicketsBut1x1AintOne
2017-07-21 16:17:53 -04:00