Commit graph

318 commits

Author SHA1 Message Date
Emre Ucan d93a52a6f9 ivi-shell: check ivi_view mappedness in commit_changes()
If the view is not mapped, we do not need to update its
properties. We can use ivi_view_is_mapped() function to
check it.

Also we don't need to call weston_view_damage_below()
for weston_views, which were in the scenegraph. Because
we are calling weston_view_unmap for views of unmapped
ivi_views in build_view_list() function

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:32 +01:00
Emre Ucan f6638a7f0f ivi-shell: unmap views which are not in scenegraph
From Michael Olbrich:
"Both the core in weston_compositor_build_view_list() with view.link
and the ivi-shell in commit_screen_list() with view.layer_link
don't remove the old views from the list.

As a result, all views that are not currently in the list have
old broken links. Destroying such a view tries to remove
the view from these lists and will access the old, invalid pointers."

Therefore, we have to unmap weston_views which are not in current
scenegraph of ivi-shell. I implemented ivi_view_is_mapped() function
to check mappedness of ivi_views. The functions checks:
   - the view is on a layer's order list
   - the layer is on a screen
   - the layer and view's ivi_surface are visible

If ivi_view is not mapped but weston_view is still mapped,
we have to unmap the weston_view with weston_view_unmap() call.

Reported-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:32 +01:00
Emre Ucan e1e7ebdbea ivi-shell: Add build_view_list function
Move the implementation from commit_screen_list to
build_view_list function

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:31 +01:00
Emmanuel Gil Peyrot 9fd254d7b2 ivi-shell: Add missing sentence point
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2018-09-18 11:54:29 +02:00
Sruthik P e0b3022ebb Fix and remove broken links to confluence pages 2018-09-18 11:53:29 +02:00
Harsha M M 46cbd0a7f5 ivi-shell: Remove the compositor destory listener from list during de-init
During de-init ensure removal of compositor destroy notification
from list. Otherwise a dongling pointer is left behind which will
affect other plugins.

Signed-off-by: Harsha M M <harsha.manjulamallikarjun@in.bosch.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-08-10 13:23:14 +03:00
Emre Ucan 67546bed04 ivi-shell: use install paths in example config
The example weston.ini file uses source and build
directory paths. Therefore, it is only useful when
used on the same system that is used to build Weston.

We can use install paths instead of build/source paths
to fix this problem.

v2 changes:
- use $(westondatadir) instead of $(datadir)

Reported-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-07-22 11:17:40 +01:00
Emre Ucan cf4113c629 ivi-shell: listen compositor wake_signal
If compositor wakes up from sleep state, we have
to trigger repaint for all outputs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-07-22 11:06:38 +01:00
Daniel Stone 78a42116ae tests: Reshuffle IVI layout tests
Rename the IVI tests to be more consistent with the others, and invert
the naming of plugin/client to make it slightly more clear what's going
to happen. Handle the renaming by using wet_get_binary_path to rewrite
the local binaries.

As a side-effect, weston.ini ivi-shell-user-interface no longer needs to
be given as an absolute path.

Signed-off-by: Daniel Stone <daniels@collabora.com>

v2:

Call ivi-layout.ivi as ivi-layout-test-client.ivi to keep the same name
in both the file and the lookup, so that the module map does not need to
change the name.

Update code comments to reflect the new names.

Rename ivi_layout-test-plugin.c to ivi-layout-test-plugin.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-06-20 16:10:12 +03:00
Pekka Paalanen 055c1137ae libweston: make wl_output point to weston_head
The user data of a wl_resource representing a wl_output protocol object
used to be a pointer to weston_output. Now that weston_output is being
split, wl_output more accurately refers to weston_head which is a single
monitor.

Change the wl_output user data to point to weston_head.
weston_output_from_resource() is replaced with
weston_head_from_resource().

This change is not strictly necessary, but architecturally it is the
right thing to do. In the future there might appear the need to refer to
a specific head of a cloned pair, for instance.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v5 Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
2018-04-10 14:33:59 +03:00
Emre Ucan 77db9316eb ivi-shell: remove dead assignments in layer transition
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-03-28 13:09:50 +03:00
Emre Ucan 16ac6a0f9d hmi-controller: remove dead assignments in add_launchers
assigned values of x, y, ret and layout_surface are
never read.

(Found by clang source code analyzer)

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-03-28 13:09:50 +03:00
Emre Ucan e8ff7df863 ivi-shell: fix the layer assignment change from one screen to another
if the layer is in order of some screen we need to remove it
from there and mark the screen order as dirty so it will be removed
in commit_screen_list call later
layer should only be assigned to one screen at a time

Signed-off-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-08 14:17:12 +02:00
Emre Ucan 40d67c2862 ivi-shell: don't expilicitly assign outputs to views
it is assigned in weston_view_assign_outputs

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-08 14:16:57 +02:00
Emre Ucan 7b690559a5 ivi-shell: don't schedule compositor repaint
it is not necessary to repaint all outputs after
each commit_changes. Only outputs with modified
views has to be repainted.

We need to call weston_view_update_transform
for assigning views to outputs first.
Then, We can call weston_view_schedule_repaint
to trigger repaint for outputs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-08 14:16:44 +02:00
Emre Ucan a4608461b2 ivi-shell: change layer visibility to bool
ivi_layout_layer_set_visibility has bool
as argument.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-08 14:16:44 +02:00
Emre Ucan f85bf152c1 ivi-shell: remove ivi_shell_setting
it has only developermode option parameter.
The parameter is only used in init_ivi_shell.
Therefore, we can basically remove the struct,
and check the option locally in the function.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:55:03 +02:00
Emre Ucan 0c1bbb9e52 ivi-shell: don't load controller modules
controller modules can be loaded as weston modules
from the main function of weston.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:55:03 +02:00
Emre Ucan ffaf09eb2f hmi-controller: load as weston module
weston loads hmi-controller as a weston module.
IVI-shell does not need to load it explicitly.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:54:53 +02:00
Emre Ucan a9db8d7d64 hmi-controller: remove ivi_layout_interface global
Put the interface into hmi_controller struct.
It is better to have it in an object.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:54:53 +02:00
Emre Ucan ce9bc35185 ivi-shell: register ivi_layout_interface
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:54:37 +02:00
Alexandros Frantzis 7d2abcf6c8 libweston: Use struct timespec for touch motion events
Change code related to touch motion events to use struct timespec to
represent time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 27a51b83e5 libweston: Use struct timespec for touch up events
Change code related to touch up events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 9448deb073 libweston: Use struct timespec for touch down events
Change code related to touch down events to use struct timespec to
represent time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 47e79c860b libweston: Use struct timespec for key events
Change code related to key events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 80321942e7 libweston: Use struct timespec for axis events
Change code related to axis events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 215bedc88b libweston: Use struct timespec for button events
Change code related to button events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 84b31f8956 libweston: Use struct timespec for motion events
Change code related to motion events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 0343c6ac69 ivi-shell: Fix incorrect use of logical instead of bitwise operator
Fix the code to use the correct bitwise AND operator '&', instead of the
currently used logical AND operator '&&', to check the value of a bit
flag in a bit mask.

This problem was reported as a warning when building with clang.

Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2017-11-24 14:02:19 +02:00
Pekka Paalanen 9ffb25009c libweston: introduce weston_output_from_resource()
This is a simple wrapper for casting the user data of a wl_resource into
a struct weston_output pointer. Using the wrapper clearly marks all the
places where a wl_output protocol object is used.

Replace ALL wl_output related calls to wl_resource_get_user_data() with
a call to weston_output_from_resource().

v2: add type assert in weston_output_from_resource().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
2017-07-25 16:08:48 +03:00
Michael Teyfel d2535d7614 ivi-shell: Fixed broken link to wiki page in ivi-layout header file
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-25 13:41:52 +03:00
Ucan, Emre (ADITG/SW1) 57ac260c5d ivi-shell: remove orientation calculation
Dead code as orientation cannot be changed anymore, see patches:
ivi-shell: remove layer_set_orientation API
ivi-shell: remove surface_set_orientation API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: added commit message]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-24 13:33:05 +03:00
Ucan, Emre (ADITG/SW1) 6e423ed996 ivi-shell: remove layer_set_orientation API
This API is used to rotate the contents of
application's buffer, which are in the render
order list of the layer. But this API is not
needed because an application can rotate
its buffers with set_buffer_transform request
of wl_surface interface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-24 13:33:00 +03:00
Ucan, Emre (ADITG/SW1) 9337197f82 ivi-shell: remove surface_set_orientation API
This API is used to rotate the contents of
application's buffer. But it is not needed
because an application can rotate its buffers
with set_buffer_transform request of
wl_surface interface.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-24 13:32:48 +03:00
Ucan, Emre (ADITG/SW1) deee858b0b ivi-shell: add_screen_remove_layer API
It is analagous to layer_remove_surface API.
The API removes a layer from the render order
of the screen.

v3:
add the new vfunc at the end of
the ivi_layout_interface struct.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-24 13:13:37 +03:00
Raúl Peñacoba bd8dc0a255
ivi-layout: Add missing free() in ivi_view_create
Signed-off-by: Raúl Peñacoba <raul.mikaop.zelda@gmail.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-03-31 01:32:46 +02:00
Ucan, Emre (ADITG/SW1) 7fe0bb2580 ivi-shell: Damage view below after unmapping
If ivilayer or ivisurf of ivi_view is made invisible in the
commit_changes call, we have to damage the weston_view below this
ivi_view. Otherwise content of this ivi_view will stay visible.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-07 15:03:10 +02:00
Ucan, Emre (ADITG/SW1) 27799355a9 ivi-shell: simplify commit_changes function
It is a better idea to use one for loop instead
of using three nested for loops.

We do not need to update the transformation of
views according to the scenegraph. The important
thing is that every visible view is updated before
commit_changes function returns.

The first if statement checks, if the view is on
the currently rendered scenegraph. The second if
statement checks, if the view's layer or surface
is visible. These checks ensure that we do not
update the transformation matrix of a view, which
is not visible on the screen.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: minor whitespace fix]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-06 12:11:33 +02:00
Ucan, Emre (ADITG/SW1) 1b92ba20ac ivi-shell: pass only ivi_view to update_prop
We can get ivisurf, ivilayer and iviscreen
easily from ivi_view. Then, we do not need
to check, if ivi_view's layer is the same
as the given ivilayer.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-06 12:10:56 +02:00
Ucan, Emre (ADITG/SW1) 847c32d34b ivi-shell: don't check layer is already on the screen
If a layer is removed from a screen's render order list, but the
changes are not commited. Then, the layer could not be added to the
same screen. Because on_screen property of the layer is only changed
in ivi_layout_commit_changes API, when active render order of the screen
is changed.

It is not possible to change the order of layers in a screen without
clearing and commiting the changes before. This patch fixes this issue.

After this patch, the pending render order list of a screen is always
modified regardless of its active render order list.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-27 16:43:47 +02:00
Ucan, Emre (ADITG/SW1) 67ed902f4b ivi-shell: don't check view is rendered before adding surface
If a surface is removed from a layer's render order list, but the
changes are not commited. Then, the surface could not be added to the
same layer. Because ivi_view of the surface is still in the render order
list of the layer.

It is not possible to change the order of surfaces in a layer without
clearing and commiting the changes before. This patch fixes this issue.

After this patch, the pending render order list of a layer is always
modified regardless of its active render order list.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-27 16:43:46 +02:00
Ucan, Emre (ADITG/SW1) 6660252274 ivi-shell: fix typo in layer_destroy API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-27 16:39:43 +02:00
Quentin Glidic da01c1d105
weston: Make the shell entrypoint specific
This avoids loading a shell as a module, so we are sure to have only one
shell loaded at a time.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-01-17 18:24:58 +01:00
Quentin Glidic 8af2beccbd
weston: Properly namespace modules entrypoint
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-01-17 18:24:56 +01:00
Quentin Glidic 82681571cf libweston: Position layers in an absolute way
Currently, layers’ order depends on the module loading order and it does
not survive runtime modifications (like shell locking/unlocking).
With this patch, modules can safely add their own layer at the expected
position in the stack, with runtime persistence.

v4 Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Daniel Stone <daniels@collabora.com>
[Pekka: fix three whitespace issues]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-17 16:50:18 +02:00
Abdur Rehman b833d742c7 ivi-shell: fix minor typos
- ivi-shell/hmi-controller.c:41: a to an
- ivi-shell/hmi-controller.c:1296: Duplicated 'a'
- ivi-shell/ivi-layout-export.h:28: An to A

Signed-off-by: Abdur Rehman <arehmanq199@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2017-01-03 11:58:52 +00:00
Ucan, Emre (ADITG/SW1) 7da3823ae3 ivi-shell: describe members of type wl_list
I wrote comments on which list they are used with

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: fix surface_list to layer_list, add ivi_layout_transition_set::transition_list]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-09 16:00:36 +02:00
Ucan, Emre (ADITG/SW1) 606f59261d ivi-shell: clear unused struct members
I removed unused members of ivi_layout* data
structs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-09 16:00:19 +02:00
Quentin Glidic 2edc3d5462
libweston: Rename weston_surface::configure to ::committed
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Giulio Camuffo <giulio.camuffo@kdab.com>

Differential Revision: https://phabricator.freedesktop.org/D1246
2016-08-14 09:28:50 +02:00
Jussi Kukkonen 649bbce607 include stdint.h for int32_t/uint32_t
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-26 16:26:08 -07:00
Bryce Harrington 1dbdc0bd8a Include space in 'if ('
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-12 18:45:41 -07:00
Armin Krezović 50ff4bf308 ivi-shell: update for manual surface/view mapping
This is a follow up for ivi-shell to manually
set mapped status for views/surfaces it controls

v2:

- Updated for changes in git master

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-07-01 15:29:26 +03:00
Bryce Harrington 260c2ffd97 input: Rename weston_surface_activate to weston_seat_set_keyboard_focus
The name suggests that it activates surfaces, but the code says it
rather just assigns keyboard focus.  Rename it for clarity, and so the
original function name could be used for something more appropriate
later.  Switch order of parameters since keyboard focus is a property of
the seat.  Update all callers as appropriate.

Change was asked for by pq, May 26, 2016:

 "This should be called weston_seat_set_keyboard_focus(seat, surface).
 Keyboard focus is a property of the seat."

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-30 13:15:33 +03:00
Ucan, Emre (ADITG/SW1) 5e8d55da69 ivi-shell: introduce ivi_layout_view
This patch introduces ivi_layout_view data struct,
which is a wrapper of weston_view.

There is always only one ivi_layout_view for an
ivi_layout_surface and ivi_layout_layer pair.
A surface could have many views with different
geometry and transformations, so that a surface
can be shown on:
	1. On many screens
	2. On the same screen with different positions

The geometry of a view is modified, when properties of
its layer are changed through ivi_layout_interface.
Users of ivi_layout_interface does not have direct access
to ivi_layout_view structure.

v2 changes:
	1. Use ivi_view_is_rendered function instead of
	   active member
	2. Add descriptions to introduced members of
	   structs

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Natsume: add empty line]
Reviewed-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-29 11:31:51 +03:00
Ucan, Emre (ADITG/SW1) d97f10081e ivi-shell: add surface_created listener after launchers
Add surface_created listener after the initialization of launchers.
Otherwise, surfaces of the launchers will be added to the application
layer too.

This does create a race where we might miss some surfaces that get
created before the UI client signals ready, but it was agreed the race
is not significant. You cannot use the launchers before the UI is ready,
and someone using systemd integration to launch clients in parallel to
Weston with ivi-shell and hmi-controller is unlikely. After all,
hmi-controller is just a demo.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: added extra commit message notes]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-29 11:31:51 +03:00
Pekka Paalanen 58f98c99f5 Move weston source to compositor/
This is the start of separating weston-the-compositor source files from
libweston source files.

This is moving all the files related to the 'weston' binary. Also the
CMS and systemd plugins are moved.

xwayland plugin is not moved, because it will be turned into a
libweston feature.

To avoid breaking the build, #includes for weston.h are fixed to use
compositor/weston.h. This serves as a reminder that such files may need
further attention: moving to the right directory, or maybe using the
proper -I flags instead.

v2: Move also screen-share.c, and add a note about weston-launch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
2016-06-23 17:44:54 +03:00
Ucan, Emre (ADITG/SW1) ba0c630f12 ivi-shell: remove ivi_layout_get_weston_view
A surface could have more than one views.
Therefore, it is not possible to map a surface to
a specific view. The implementation of the API
iterates the list of views of the surface, and
returns the first found view.

It is not necessary to have this API to found
a view of the surface. Therefore, I removed the API.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-13 12:24:04 +03:00
Giulio Camuffo 179fcda31f Split the modules and include files between weston and libweston
The backends are now installed in lib/libweston-0, and the include
files that will be used by libweston in include/libweston-0. The other
modules and weston-specific include files are kept in the old paths.
A new wet_load_module() is added to load plugins in the old path,
which is not part of libweston, but weston only and defined in main.c.
To allow that to be used by out of tree weston plugins, the function
is declared in a new weston.h, installed in include/weston.

The -0 in the paths is the abi version of libweston, and it will also
be used by the libweston .so. If the abi changes the number will need
to be increased.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-03 13:17:18 +03:00
Giulio Camuffo d52f3b775b compositor: remove the weston_config field in weston_compositor
The config can now be retrieved with a new function defined in weston.h,
wet_get_config(weston_compositor*).

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-06-03 13:16:39 +03:00
Giulio Camuffo fba27fbef2 Move the functions launching clients to main.c
They belong in the compositor rather than libweston since they
set signals handlers, and a library should not do that behind its
user's back. Besides, they were using functions in main.c already
so they were not usable by other compositors.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-03 13:16:39 +03:00
Pekka Paalanen eaa43fc310 ivi-shell: add API for weston_surface -> ivi_layout_surface
Add ivi-layout API for getting an ivi_layout_surface from a
weston_surface if it exists. This can be used by controllers that hook
up to core Weston callbacks and get handed a weston_surface, but need to
use ivi-layout API to manipulate it.

The only ways ivi-layout itself would be able to go from weston_surface
to ivi_layout_surface are either searching through the list of all
ivi_layout_surfaces or adding a dummy destroy listener to the
weston_surface. Therefore the implementation is delegated to
ivi-shell.c.

Ivi-shell.c can easily look up the ivi_shell_surface for a
weston_surface, and that will map 1:1 to an ivi_layout_surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2016-06-01 11:06:49 +03:00
Bryce Harrington e6da35d067 ivi: Fix spellings in comments 2016-05-19 17:35:02 -07:00
Pekka Paalanen edcb312abb ivi-layout: clarify get_layers_under_surface doc
This is derived from the implementation. I was not sure whether "under"
referred to object relationships or region intersections.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2016-05-12 11:49:03 +03:00
Yong Bakos e069871da3 ivi-layout: Correct coordinate adjective grammar, misspellings
Hyphenate 'multi screen' coordinates, and correct misspellings and
grammar within changed lines.

See https://lists.freedesktop.org/archives/wayland-devel/2016-April/028249.html.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-04-29 16:33:08 -07:00
Wataru Natsume 7b3a52ab39 ivi-layout: clear on_layer when layer_destroy
On_layer of ivi_layout_surface should be NULL in the layer_destroy.
Previous code might access to removed ivilayer and cause SEGV.

Signed-off-by: Wataru Natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-12 15:49:09 +03:00
Ucan, Emre (ADITG/SW1) c49aa5acad ivi-shell: rework configure_surface notification
The add_notification_configure_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to
add_listener_configure_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_configure_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 67f0aa8767 ivi-shell: rework remove_surface notification
The add_notification_remove_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_remove_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_remove_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 562f2ecb0c ivi-shell: rework remove_layer notification
The add_notification_remove_layer API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_remove_layer.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_remove_layer

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) c98f2cf16b ivi-shell: rework create_layer_notification
The add_notification_layer_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_layer_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_create_layer

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 970f831588 ivi-shell: rework create_surface notification
The add_notification_create_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to
add_listener_create_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_create_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 3750d1b270 ivi-shell: rework layer_add_notification API
The layer_add_notification API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to layer_add_listener.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

This patch also remove two APIs which are not needed:
- ivi_layout_layer_remove_notification
- ivi_layout_layer_remove_notification_by_callback

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 706cb5aa7c ivi-shell: rework surface_add_notification API
The surface_add_notification API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to surface_add_listener.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

This patch also remove two APIs which are not needed:
- ivi_layout_surface_remove_notification
- ivi_layout_surface_remove_notification_by_callback

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 0bd29b6a52 ivi-shell: move event_mask to properties struct
I moved the event_mask to ivi_layout_*_properties struct,
so that it is easily accessible with get_properties_of_*
APIs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-01 14:39:30 +03:00
Ucan, Emre (ADITG/SW1) 8e21e96795 ivi-shell: remove content_observer leftover
content_observer_notification is removed by the commit:
193e301c74.

Therefore, this callback function is unused.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-01 14:38:01 +03:00
Pekka Paalanen 94cb06a208 ivi-shell: harden get_ivi_shell_surface()
Add more sanity checks to get_ivi_shell_surface() just in case.

If the configure hook is set, we must always have non-NULL
configure_private.

Check the ivi_shell_surface matches the surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
2016-03-24 13:48:21 +02:00
Pekka Paalanen fd45f60f4e ivi-shell: add sanity check in ivi_shell_surface_configure
This should not get called unless there is an ivi_shell_surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
2016-03-24 13:48:21 +02:00
Pekka Paalanen cfb053f27f ivi-shell: add input panel label func
Copied from desktop-shell/input-panel.c, add a label function for the
input panel.

This patch strictly reduces the difference between input-panel.c and
input-panel-ivi.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
2016-03-24 13:48:21 +02:00
Pekka Paalanen 13281f693c ivi-shell: add shell surface labels
To be used by the Weston timeline feature for identifying surfaces in a
trace. The 'get_label' functionality can also be used by any debugging
code, too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
2016-03-24 13:48:21 +02:00
Ucan, Emre (ADITG/SW1) 1c04d7b897 ivi-shell: remove ivi_layout_get_screen_output API
The controller plugins use IVI Layout API with weston outputs.
Therefore, this API is not required.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) 6d89b1cdc4 ivi-shell: remove ivi_layout_get_screen_from_id API
The controller plugins does not use ivi screens for IVI layout APIs.
They use weston outputs directly. Therefore, this API is unnecessary.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) b216c92d4d ivi-shell: implement get_screen_from_output
It is an internal API, which returns ivi_layout_screen
for a pregiven weston_output.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) 273874e3c7 ivi-shell: use weston_output in public APIs
IVI layout APIs now are called with weston_output pointers,
instead of ivi_layout_screen pointers.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) 3a8521e005 ivi-shell: remove ivi_layout_get_screens API
The compositor data struct already has a list of weston outputs.
Therefore, this API is not required.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) ff6a9f8474 ivi-shell: remove ivi_layout_get_screen_resolution API
The controller plugins can get the screen resolution directly from
weston output. Therefore, this API is not required.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) d56b90d948 ivi-shell: remove ivi_layout_get_id_of_screen API
ivi-screen does not have an id. IVI layout implementation is using
id of weston output. Therefore, this API is unnecessary.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) 1e344dc2c4 ivi-shell: remove id_screen
use output id instead

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24 11:10:07 +02:00
Ucan, Emre (ADITG/SW1) c6459c495d hmi-controller: fix wrong panel width
The width of the first base layer is used for all panels.
Every display has a base layer which is as big as the
display. Therefore, it is wrong to use the width of the
first base layer for all panels, because every display
could have a different resolution.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-18 12:42:50 +02:00
Ucan, Emre (ADITG/SW1) 783cb4dcfe hmi-controller: fix wrong background surface size
In current implementation, the size of the first application
layer is used for the background image of a display.

This is wrong because:
	1. The background surface should be fullscreen.
	2. Each display could have different resolution.

We should use the size of the base layer of each display
for the background image.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-18 12:41:15 +02:00
Bryce Harrington e99e4bf2b9 clients & tests: Unify multiple definitions of x*alloc and related functions
Direct fail_on_null calls now produce output like:

    [weston-info] clients/weston-info.c:714: out of memory

xmalloc, et al produce output on failure like:

    [weston-info] out of memory (-1)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17 14:13:13 +02:00
Ucan, Emre (ADITG/SW1) 4e221f0327 ivi-shell: simplify ivi_layout_screen_set_render_order
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: fix subject, add commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17 13:32:21 +02:00
Ucan, Emre (ADITG/SW1) f46306f059 ivi-shell: simplify ivi_layout_screen_add_layer
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17 13:32:05 +02:00
Ucan, Emre (ADITG/SW1) 72ad164b5d ivi-shell: simplify ivi_layout_set_render_order
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17 13:31:39 +02:00
Ucan, Emre (ADITG/SW1) 10942379d2 ivi-shell: simplify ivi_layout_layer_add_surface
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17 13:31:18 +02:00
Ucan, Emre (ADITG/SW1) 536d833515 ivi-shell: simplify ivi_layout_remove_surface
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17 13:31:00 +02:00
Pekka Paalanen 5cbf1e8146 ivi-shell: remove add_configured_listener left-over
In all my rebases, this got accidentally left behind. The implementation
was removed in 4a7503976b but
32ca791df8 reintroduced it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-16 16:20:07 +02:00
Pekka Paalanen 32ca791df8 ivi-shell: introduce ivi-layout-shell.h
This new header encapsulates the API that ivi-layout offers to
ivi-shell.c to call.

ivi-shell.c no longer uses ivi-layout-private.h. This limits the
ivi-layout internal structures to just ivi-layout code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2016-03-16 13:11:20 +02:00
Pekka Paalanen 4a7503976b ivi-shell: remove configured signal from ivi-layout
Now that ivi-layout calls directly into ivi-shell.c, this signal is no
longer used. Remove it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2016-03-16 13:11:11 +02:00
Pekka Paalanen 1f82193379 ivi-shell: call shell_surface_send_configure() directly
For some reason, it seems that ivi-layout.c has tried hard to avoid
calling directly into ivi-shell.c. This means there is a jump through
hoops just to get the configure event sent to the clients. Ivi-shell
registers a listener for a ivi-layout signal for sending the event.

Instead, let ivi-layout.c call directly into ivi-shell.c, and expose a
function to send out the configure events. This reduces some confusion
on who calls what.

The main idea though is that this makes ivi-shell.c not depend on struct
ivi_layout_surface fields directly anymore. In following patches,
ivi_layout_surface can be made opaque for ivi-shell.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2016-03-16 13:10:46 +02:00
Pekka Paalanen f72df1dfe1 ivi-shell: add include guards on ivi-shell.h
It's our standard practice. This file will get used a bit more in the
future.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-15 15:37:27 -07:00
Pekka Paalanen ae8c3d876b ivi-shell: include config.h in ivi-layout-transition.c
Every .c file must include config.h as the first thing.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-15 15:37:23 -07:00
Ucan, Emre (ADITG/SW1) 193e301c74 ivi-shell: remove content_observer notification
The content observer notification struct and its
set API (ivi_layout_surface_set_content_observer)
are removed. Because they are unused.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-15 14:25:09 +02:00
Mateusz Polrola dada6e3b79 ivi-shell: Remove all surface transitions when it is being removed.
If surface transitions are not removed when surface is being removed, it
can lead to crash later when transition will finish, as it will try to
reference already freed memory.
This change exposes function that can remove all existing transitions
for given surface and it is being called during surface cleanup.

Signed-off-by: Mateusz Polrola <mateuszx.potrola@intel.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-15 14:12:06 +02:00
Ucan, Emre \(ADITG/SW1\) 16d1fa156a ivi-shell: remove ivi_layout_layer_set_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:35 -08:00
Ucan, Emre \(ADITG/SW1\) 45d3942816 ivi-shell: remove ivi_layout_surface_set_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) e62bfd8d5e ivi-shell: remove ivi_layout_layer_set_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 161da40b06 ivi-shell: remove ivi_layout_surface_set_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 5bb068d16d ivi-shell: remove ivi_layout_layer_get_orientation API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 4d9001bc49 ivi-shell: remove ivi_layout_surface_get_orientation API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 18691f0310 ivi-shell: remove ivi_layout_layer_get_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) c507f67f9e ivi-shell: remove ivi_layout_surface_get_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) dfc2d76432 ivi-shell: remove ivi_layout_layer_get_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) b2ff255792 ivi-shell: remove ivi_layout_surface_get_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) c3aee1f67f ivi-shell: remove ivi_layout_layer_get_opacity API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 995e6fbcd0 ivi-shell: remove ivi_layout_surface_get_opacity API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 17610f240b ivi-shell: remove ivi_layout_layer_get_visibility API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) c6a138c6f0 ivi-shell: remove ivi_layout_surface_get_visibility API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:27 -08:00
Wataru Natsume 9d8b4414d7 hmi-controller: fix leak of ivi surface list
get_surfaces_on_layer() allocates memory and stores the pointer to
'ivisurfs'. But it was not freed.

Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-04 13:45:31 +02:00
Wataru Natsume 9c926fe9f5 remove warning of ivisurface reassign on the ivilayer
The warning of ivisurface reassign can be removed. It is ok to reassign
a surface to a layer it is already on.

The warning started to show up during normal operations since patch
"hmi-controller: remove duplicate commit_changes in random mode".

Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
[Pekka: rewrote commit message, removed unneeded comments.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-04 13:35:37 +02:00
Wataru Natsume 161255ea49 hmi-controller: remove duplicate commit_changes in random mode
Previous code cleaned up surfaces in layer once and then added
surfaces to a layer in random. In this flow, two commitchanges are
required.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[WATARU_NATSUME@xddp.denso.co.jp: Removes unnecessary check]
Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-04 13:22:17 +02:00
Nobuhiko Tanibata 90c2789e8d ivi-layout: apply opacity to weston_view correctly
update_opacity is only called when a ivi-surface is visible. But the
previous code also checks event masks redundantly. However if the event
happens when ivi-surface is invisible, opacity is not calculated. This
patch removes this redundant check to fix potential bug.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-02-03 14:29:03 +02:00
Peter Hutterer 87743e9303 Support axis source, axis discrete, frame and axis stop events
[jonas: only send focus wl_pointer.frame if resource supports it]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2016-01-19 12:33:26 +08:00
Peter Hutterer 89b6a4931e Add a weston_pointer_axis_event
Use an event struct to pass axis events around. This helps dealing with the
upcoming axis discrete changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-01-19 10:53:16 +08:00
Nobuhiko Tanibata 1c2201b543 ivi-shell: hmi-controller supports multi screens at random-mode.
It shows ivi applications at screensa randomly.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata a7ffa68e70 ivi-shell: hmi-controller supports multi screens at fullscreen mode.
It shows ivi applications in fullscreen per screen like,
The first screen: Application 1,4,5,6,,,,
The seconed screen: Application 2,
The third screen: Application 3

Thie mode assigns one application to each screen at first. And remaind
applications more than screens will be assigned to the first screen.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata d156d9c4cf ivi-shell: hmi-controller supports multi screens at side-by-side mode.
It shows 2 ivi application in a screen at side-by-side. It moves
additinal application more than 2xN to next screen N+1.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata a8aa91c0d1 ivi-shell: hmi-controller supports multi screens at tiling mode.
It shows 8 ivi applications in a screen at tiling. It moves additional
application more than 8xN to next screen N+1.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata d789c66a0f hmi-controller: allocate application layers for multi-screen
To locate surfaces of application on multi screens, multi layers are
created baseod on application-layer-id + base-layer-id-offset x N.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata 2e656769b6 hmi-controller: allocate background surfaces for multi-screen
A surface ID for layer of background/panel image is set by key: background-id
or panel-id at weston.ini. To support multi screens, it also support offset,
surface-id-offset, to offset the surface ID to next ID for a layer on next
screen.

According to the above key, hmi-controller and ivi-shell-user-interface
who increments the number of screens per notification of wl_output.
crate surface and draw background/panel image on multi surface on screens.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata 744b03093b hmi-controller: allocate base layers for multi-screen
A layer ID for screen is set by key: base-layer-id at weston.ini. To
support multi screens. It also support offset to offset the layer ID
to next ID for next screen.

For example,
base-layer-id=1000
base-layer-id-offset=10000

Layer id for screen 0: 1000
Layer id for screen 1: 11000
Layer id for screen 2: 21000

To support multi screen, create layers for background and panel bar which
located in the below per screens. At the moment, it is only layers.
Surfaces to be created at next patch in the patch set.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata 35711df126 ivi-shell: hmi-controller implements internal method to get screen.
- get screens from weston core
- provide screens as internel method
- the iviscn is stored in array inverse order in index.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata 1c2618e9ff ivi-shell: multi screen support to calcuration of a mask of weston_surface.
A weston_surface is transformed to multi screen coordinate, global
coordinate by matrix:m now.

Additionally, a mask needs to be calucated, taking account into,
- multi screen coordination: a destination rectangle of layer in the
  coordination is easily calcurated by adding weston_output.{x,y} in
  simple. This is because there is no scaled and rotated transformation.
- intersect inside of a screen the layer is assigned to. This is because
  overlapped region of weston surface in another screen shall not be
  displayed according to ivi use case.

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata 29babdf099 ivi-shell: convert from screen to global coordinates
In single screen, the coordinates of layer local coordinates are the
same as global coordinates. However, to support multi screens, the
layer-local coordinates shall be transformed to multi screen coordinates,
which is global coordinates. The abosolute coordinates of a screen in global
stored in (x,y) of output of its weston output so it shall be used to
transform layer-local to global coordinates.

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata b4cb25dc26 ivi-shell: avoid update_prop() on invisible surfaces
For multi screen support, ivi_layout_screen to be taken account into
property change in commitChanges.

Property change is now done in update_prop so to consider ivi_screen
property for caluculating transform of weston surface, ivi_layout_screen
 is added as a parameter of update_prop.

However, update_prop of weston_view of a ivi_surface can not be done
even if it is set on a screen. The propoerty change shall be done only
when a visibility of ivi_surface or ivi_layer which contains the
ivi_surface is ON. Such a condition shall be checked at commit_changes
as well to avoid calling update_prop, which actually updates
weston_views.

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:16:11 +02:00
Nobuhiko Tanibata 0627b4a73d ivi-shell: activate weston surface with a seat when left click or touch.
Similar with Desktop shell, set activate to weston surface which is
left-clicked by pointer or touched. This is needed to focus it with a seat.
Without this, a feature who gets activated weston surface by using
weston_surface_get_main_surface doesn't work correctly because it can
not get correct focused weston surface. For example, input-panel uses
weston_surface_get_main_surface to get a weston surface. With this
weston surface, it get a member: output to decide which output shall
show a input-panel, software keyboard. Without activation,
input-panel-ivi can not find a correct output which shows e.g.
weston-editor who uses input-method.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-12-14 13:15:41 +02:00
Nobuhiko Tanibata 747c3865ab ivi-shell: remove a code which expects only a screen in the system.
It breaks from wl_list_for_each of screens when the frist screen found.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-11-27 15:03:29 +02:00
Nobuhiko Tanibata fbfa8f21f9 ivi-shell: fix layout_layer.view_list is not initilized per a screen.
This is potential bug when it supports several screens. If view_list is
initilized here, the views, which are set by the previous screen, are
cleared. So View list shall be initilized in front of wl_list_for_each
of all screens.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-11-27 15:03:29 +02:00
Nobuhiko Tanibata 77b0ee18a2 ivi-shell: avoid inserting a ivi_layer to multiple screens.
In just previous wl_list_for_each_safe, list of layer in a screen is
cleaned up. And then, the list is re-constructed from
pending.layer_list.

In this re-construction, if order.link of a layer were inserted into a
screen whose number is later one of current screen, the order.link will
inserted into layer_list of two screens. This shall be avoided.

However, if we want to implement a feature to allow a layer to be added
to multiple screens. A layer shall have several order.link per screens.
So, I marked here as TODO.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-11-27 15:03:29 +02:00
Nobuhiko Tanibata 3e710d19fe ivi-shell: fix TODO which expects only one screen in the system.
It just return the first screen found in screen list.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-11-27 15:03:29 +02:00
Jonas Ådahl d2510105a6 input: Make pointer grab motion callbacks take an event struct
Instead of only passing absolute pointer coordinates, effectively
loosing motion event data, pass a struct that can potentially contain
different types of motion events, currently being absolute and relative.

A helper function to get resulting absolute coordinates was added for
when previous callbacks simply used the (x, y) coordinates.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-11-20 11:44:56 +08:00
Jonas Ådahl b57f472c84 Use input method protocol from wayland-protocols
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-11-19 13:17:59 +02:00
Jonas Ådahl 0336ca0cc5 input: Pass axis events through pointer grab interfaces
Don't only send motions and buttons but also axis events through the
pointer grab interface.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-11-02 14:30:16 +08:00
Ucan, Emre \(ADITG/SW1\) 0c0e51e096 ivi-shell: rename ivi_controller_interface
The name of ivi_controller_interface is changed to ivi_layout_interface
with this patch.

This name is better suited to the interface, because it is implemented
in ivi-layout.c and its methods are linked to ivi_layout* functions.

Furthermore, the controller modules (e.g. hmi-controller) are the users
of this interface and they have their own interfaces,
which are called *_controller_interface,
e.g.: ivi_hmi_controller_interface.

This causes confusion about the software architecture.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
2015-10-29 13:55:16 -07:00
Chris Michael c083af9907 ivi-shell: Add missing '\n' in weston_log function usage
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-01 10:04:15 -07:00
Ucan, Emre (ADITG/SW1) 64635ee699 ivi-shell: introduce get_weston_view
The internal API "get_weston_view" is introduced, which returns the
weston_view of the given ivi_layout_surface. The API returns a NULL
pointer, if the ivi_layout_surface does not have any weston_view.

The weston_view is required in many places of ivi-shell implementation.
Therefore, this API will reduce lines of code. Furthermore, it will
increase the maintainability of the ivi-shell implementation.

Old way of getting the weston_view was flawed, because the views list of
the weston_surface is read without controlling the existence of the
weston_surface.  New implementation explicitly throws an error if the
weston_surface does not exist.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[Pekka: Line-wrapped the commit message.]
2015-10-01 12:56:32 +03:00
Ucan, Emre (ADITG/SW1) 4a18364595 ivi-shell: remove is_surface_in_layer API
This internal API is redundant, because a surface is allowed to be only
on one layer.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
2015-10-01 12:35:49 +03:00
Ucan, Emre (ADITG/SW1) bb4ec0a186 ivi-shell: remove is_layer_in_screen API
This internal API is redundant, because a layer is allowed to be only on
one screen.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
2015-10-01 12:34:24 +03:00
Ucan, Emre (ADITG/SW1) dfac375993 ivi-shell: remove struct link_layer
link_layer's sole purpose is to link a surface to multiple layers, if
the surface should be shown in multiple layers.  This can be only
achieved, if the surface has multiple weston_views with different
transformation matrices.

Current implementation assumes in many places that a ivi_surface has
only one weston_view.  Therefore, a surface can be only shown on one
layer.

Although this (a surface on multiple layers) is a nice to have feature
for ivi-shell, it is not very crucial.  In any case, it is not an easy
task to implement this feature, because it has lot of corner cases.

I removed with this patch the link_layer data structure, because it does
not have any purpose in current implementation.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[Pekka: Line-wrapped the commit message.]
2015-10-01 12:09:40 +03:00
Ucan, Emre (ADITG/SW1) 8a223673ad ivi-shell: remove struct link_screen
link_screen's sole purpose is to link a layer to multiple screens, if
the layer should be shown in multiple screens.  This can be only
achieved, if surfaces of the layer have multiple weston_views dedicated
to the different screens.

Current implementation assumes in many places that a ivi_surface has
only one weston_view.  Therefore, a layer can be only shown on one
screen.

Although this (a layer on multiple screens) is a nice to have feature
for ivi-shell, it is not very crucial.  In any case, it is not an easy
task to implement this feature, because it has lot of corner cases.

I removed with this patch the link_screen data structure, because it
does not have any purpose in current implementation.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[Pekka: Line-wrapped commit message.]
2015-10-01 12:07:39 +03:00
Lucas Tanure a3377cd114 ivi-layout-transition: Standardize the check for layout_transition_register
Check the return from layout_transition_register in order to fix
potential leak of memory pointed to by transition. And don't register a
null transition.

Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-30 12:27:56 -07:00
Lucas Tanure c8dcd16b01 ivi-layout-transition: Fix potential leak of memory pointed to by transition
Several fixes to handle invalid transition objects:

1. Free transition in ivi_layout_transition_fade_layer if we fail to
   allocate memory for data

2. Check if transition is not null and if layout_transition_register was
   ok before return, if not, free transition

3. Destroy transition if layout_transition_register was not ok, we can't
   just free transition, we need to call layout_transition_destroy in
   order to free private_data from transition

Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-23 17:02:28 -07:00