Commit Graph

226 Commits

Author SHA1 Message Date
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
Mike Blumenkrantz 10516fa3fd elm_win: hide pointer surface on mouse out
this should be unmapped so edje stops trying to render to it, though
at some point it could be optimized to not hide and just reuse the buffer
when showing again

 #IGot99TicketsBut1x1AintOne
2017-07-21 16:17:53 -04:00
Mike Blumenkrantz d67bdc92b7 elm_win: show pointer canvas after setting cursor
setting cursor calls resize, which is what sets the surface size

 #IGot99TicketsBut1x1AintOne
2017-07-21 16:17:53 -04:00
Jean-Philippe Andre dccdd20335 elm: Fix a safety error message
Happens when shutting down E
2017-07-20 14:46:49 +09:00
Jean-Philippe Andre 521f41f536 win: Fix main menu when not in framespace
On OSX the framespace and CSD (Client-Side Decorations) are not
supported at all... I am not able to test this case. This patch
restores the main menu functionality based on pre 1.19 themes,
where it was located inside win.edc (app content) and not in
border.edc (framespace).

Note that the initial size of a window may be wrong, eg as in
  elementary_test -to "Main Menu"

Fixes T5734 (hopefully!)
2017-07-18 18:42:16 +09:00
Jean-Philippe Andre 9dddc075d4 win: Amend previous commit about modifiers
The code was invalid, so making it valid now. Explicitely marking
the modifiers as unused, as mentionned in the documentation as
well.

See 9baa8752a9
2017-07-17 16:38:38 +09:00
Jean-Philippe Andre 9baa8752a9 win: Fix ABI compatibility for grab modifiers
This fixes an ABI change when moving from unsigned long long
modifier mask to a simple enum. This is a fix for the release
of EFL 1.20.
2017-07-17 14:24:30 +09:00
Amitesh Singh 98b9bb0da5 win: fix compiler warning 2017-07-13 11:16:48 +09:00
Marcel Hollerbach 23203c9e72 elementary: fix leaking manager objects
they are now automatically destroyed once the object is deleted.
2017-07-10 20:32:07 +02:00
Mike Blumenkrantz 4be19d87f4 elm_win: remove engine checks from window_id_get()
if these exist then just return the id
2017-07-07 15:22:23 -04:00
Mike Blumenkrantz 0ea3d0daaa elm_win: remove engine checks from wl_window_get
if there's a win, return it, otherwise this returns null anyway
2017-07-07 15:22:23 -04:00
Mike Blumenkrantz 81adac88dc elm_win: manually create a wl2 window for FAKE wins under wayland
this enables elm_cnp to function using protocol
2017-07-07 15:22:23 -04:00
Jean-Philippe Andre f8d8136b2c win: Avoid CRI message before finalized
Test case was Bg EO API in elm_test
2017-07-07 15:44:51 +09:00
Jean-Philippe Andre 68ad235f4e win: Try to fix some resizing issues with main menus
Omg this was a pain... The code is complete spaghetti and the
fact that the main menu is now in the framespace doesn't help
either. With this patch and the previous one (about ecore_evas_x)
Edi should be able to open correctly at the proper size and with
a visible menu.

This patch introduces a lot of changes so it'll need testing
before we accept it fully.

Fixes T5482
2017-07-05 18:46:38 +09:00
Jean-Philippe Andre 4488c51c5f win: Fix some sizing issues with main menu
This should fix issues when the main menu is wider than the
window content. This assumes that the menu is horizontal and
aligned with the client content.

The theme should probably handle this case better but right
now I am lost in the spaghetti resizes happening between
edje, elm, evas and X...

I am not very happy with this patch, and I think border.edc
needs some love in order to make it more robust and simpler
to read.

Ref T5482
2017-07-05 17:43:59 +09:00
Jean-Philippe Andre 59081043a8 elm: Always pass valid part name inside part APIs
This affects the legacy content_set/get/unset part APIs. This
should avoid some unwanted ERR messages in case an elm_object_
API is used on an elm widget that doesn't implement said API.

What this does is request the widget for the name of the default
part if NULL was passed in. Since some widgets are not elm_layout,
they have to override the API themselves, which is why I made it
an internal EO API (rather than a series of efl_isa()).

In theory, part should never be NULL when reaching the internal
implementation code in the widgets, at least for content.

In EO, efl_part(obj, NULL) should be invalid.

Ref T5629
2017-06-30 14:37:54 +09:00
Mike Blumenkrantz 34ce5d648f elm_win: access wl seats in a more portable way
seat names are not guaranteed to be the same in every compositor so
this should not be hardcoded
2017-06-23 17:43:44 -04:00
Jean-Philippe Andre 8ba83b102f win: Implement Efl.Canvas device & seat get
By name or id
2017-06-15 17:35:44 +09:00
Vincent Torri c233274529 elm+evas - windows - fix alt+f4 to work without losing alt key
fixes  T5581
2017-06-15 16:00:38 +09:00
Jean-Philippe Andre f54d891b2c win: Use efl_data_scope_safe_get instead of macros
This removes macros that don't make the code easier to read
and aren't actually as safe as this safe data_get.
2017-06-14 16:54:15 +09:00
Jean-Philippe Andre ed41adf791 widget: Implement mirrored from Efl.Ui.Base
Ref T5363
2017-06-14 11:02:05 +09:00
Jean-Philippe Andre 06b14827b7 widget: Implement scale from Efl.Ui.Base 2017-06-12 11:50:30 +09:00
Marcel Hollerbach af858d1d93 elm_widget: add factory method to the widget
with this function you can trap the creation of the mangers, and change
the behaviour as you need it. For example returning a custom manager.
2017-06-09 10:16:19 +02:00
Bryce Harrington 4f5ea8f3b7 elm_win: Fix breakage in frame bg style with Elementary WL2
Summary:
An else statement was added in 5ebdf8f3 with no clause, resulting in the
bg_solid property becoming conditionalized such that it won't be set
correctly when HAVE_ELEMENTARY_WL2 is defined and there is no wayland
window in use.

Further, this also causes focus to be left undefined.  Since there's no
window, presumably it should be turned off in this circumstance.

fix CID1375496, CID1375497

Reviewers: zmike

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4899
2017-05-23 16:46:00 -04:00
Mike Blumenkrantz 2fe7878235 wayland: move pointer-related functions to ecore_wl2_input namespace
windows do not have pointers or cursors under wayland, seats do. due to
lack of multiseat support, most components simply use the "default" seat
with these functions, but this should make the corresponding code more
easily adaptable
2017-05-19 12:41:17 -04:00
Mike Blumenkrantz 5ebdf8f341 wayland: use shell activated state to indicate focus in csd
the current (v6) xdg-shell spec reads as follows:

	  Client window decorations should be painted as if the window is
	  active. Do not assume this means that the window actually has
	  keyboard or pointer focus.

so this is not equivalent to receiving/losing input focus and should not
be propagated as such

@fix
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 01d3edef00 elm_win: don't unset wl cursor when starting move operation
I don't understand why this is here and it isn't required by spec?

ref ea7bbfe47d
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 23cf5e80f7 elm_win: add elm_win_get()
it's frequently useful to be able to return the window object from
any object. this simplifies doing so for users

@feature
2017-05-19 12:41:16 -04:00
Jean-Philippe Andre 55b529cebc evas/elm: Make group_add/group_del internal functions
This hides those two legacy functions from the EO API.
2017-05-19 14:07:00 +09:00
Jean-Philippe Andre 781594088e evas: Make Efl.Canvas.Object.legacy_ctor internal
Continuing...
2017-05-19 14:07:00 +09:00
Jean-Philippe Andre 093938e5d9 win: Remove special class Efl.Ui.Win.Standard
All windows should be standard, really. Except when using legacy
elm_win_add() or if type_set() was called with a specific type.

I dislike type_set...

Ref T5322
2017-05-17 10:39:43 +09:00
Jean-Philippe Andre 01d4886328 evas: Add seat arg to modifier/lock EO APIs
This now matches the new seat-related set of APIs present as EAPI.
2017-05-16 20:47:49 +09:00