blob: 39ffde131127d3baca4d33d960dce5446b18a87f [file] [log] [blame]
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +09001/*
2 * Copyright (C) 2013 DENSO CORPORATION
3 *
Bryce Harringtonaf637c22015-06-11 12:55:55 -07004 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090011 *
Bryce Harringtonaf637c22015-06-11 12:55:55 -070012 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial
14 * portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090024 */
25
26/**
27 * The ivi-layout library supports API set of controlling properties of
Abdur Rehmanb833d742017-01-01 19:46:34 +050028 * surface and layer which groups surfaces. A unique ID whose type is integer is
29 * required to create surface and layer. With the unique ID, surface and layer
30 * are identified to control them. The API set consists of APIs to control
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090031 * properties of surface and layers about followings,
32 * - visibility.
33 * - opacity.
34 * - clipping (x,y,width,height).
35 * - position and size of it to be displayed.
36 * - orientation per 90 degree.
37 * - add or remove surfaces to a layer.
38 * - order of surfaces/layers in layer/screen to be displayed.
39 * - commit to apply property changes.
40 * - notifications of property change.
41 *
42 * Management of surfaces and layers grouping these surfaces are common
43 * way in In-Vehicle Infotainment system, which integrate several domains
44 * in one system. A layer is allocated to a domain in order to control
45 * application surfaces grouped to the layer all together.
46 *
47 * This API and ABI follow following specifications.
48 * http://projects.genivi.org/wayland-ivi-extension/layer-manager-apis
49 */
50
51#ifndef _IVI_LAYOUT_EXPORT_H_
52#define _IVI_LAYOUT_EXPORT_H_
53
54#ifdef __cplusplus
55extern "C" {
56#endif /* __cplusplus */
57
Jussi Kukkonen649bbce2016-07-19 14:16:27 +030058#include <stdint.h>
59
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090060#include "stdbool.h"
61#include "compositor.h"
62
63#define IVI_SUCCEEDED (0)
64#define IVI_FAILED (-1)
65
66struct ivi_layout_layer;
67struct ivi_layout_screen;
68struct ivi_layout_surface;
69
70struct ivi_layout_surface_properties
71{
72 wl_fixed_t opacity;
73 int32_t source_x;
74 int32_t source_y;
75 int32_t source_width;
76 int32_t source_height;
77 int32_t start_x;
78 int32_t start_y;
79 int32_t start_width;
80 int32_t start_height;
81 int32_t dest_x;
82 int32_t dest_y;
83 int32_t dest_width;
84 int32_t dest_height;
85 enum wl_output_transform orientation;
86 bool visibility;
87 int32_t transition_type;
88 uint32_t transition_duration;
Ucan, Emre (ADITG/SW1)0bd29b62016-03-31 11:08:52 +000089 uint32_t event_mask;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090090};
91
92struct ivi_layout_layer_properties
93{
94 wl_fixed_t opacity;
95 int32_t source_x;
96 int32_t source_y;
97 int32_t source_width;
98 int32_t source_height;
99 int32_t dest_x;
100 int32_t dest_y;
101 int32_t dest_width;
102 int32_t dest_height;
103 enum wl_output_transform orientation;
104 uint32_t visibility;
105 int32_t transition_type;
106 uint32_t transition_duration;
107 double start_alpha;
108 double end_alpha;
109 uint32_t is_fade_in;
Ucan, Emre (ADITG/SW1)0bd29b62016-03-31 11:08:52 +0000110 uint32_t event_mask;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900111};
112
113enum ivi_layout_notification_mask {
114 IVI_NOTIFICATION_NONE = 0,
115 IVI_NOTIFICATION_OPACITY = (1 << 1),
116 IVI_NOTIFICATION_SOURCE_RECT = (1 << 2),
117 IVI_NOTIFICATION_DEST_RECT = (1 << 3),
118 IVI_NOTIFICATION_DIMENSION = (1 << 4),
119 IVI_NOTIFICATION_POSITION = (1 << 5),
120 IVI_NOTIFICATION_ORIENTATION = (1 << 6),
121 IVI_NOTIFICATION_VISIBILITY = (1 << 7),
122 IVI_NOTIFICATION_PIXELFORMAT = (1 << 8),
123 IVI_NOTIFICATION_ADD = (1 << 9),
124 IVI_NOTIFICATION_REMOVE = (1 << 10),
125 IVI_NOTIFICATION_CONFIGURE = (1 << 11),
126 IVI_NOTIFICATION_ALL = 0xFFFF
127};
128
129enum ivi_layout_transition_type{
130 IVI_LAYOUT_TRANSITION_NONE,
131 IVI_LAYOUT_TRANSITION_VIEW_DEFAULT,
132 IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY,
133 IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY,
134 IVI_LAYOUT_TRANSITION_LAYER_FADE,
135 IVI_LAYOUT_TRANSITION_LAYER_MOVE,
136 IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER,
137 IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE,
138 IVI_LAYOUT_TRANSITION_VIEW_RESIZE,
139 IVI_LAYOUT_TRANSITION_VIEW_FADE,
140 IVI_LAYOUT_TRANSITION_MAX,
141};
142
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000143struct ivi_layout_interface {
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900144
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900145 /**
146 * \brief Commit all changes and execute all enqueued commands since
147 * last commit.
148 *
149 * \return IVI_SUCCEEDED if the method call was successful
150 * \return IVI_FAILED if the method call was failed
151 */
152 int32_t (*commit_changes)(void);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900153
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900154 /**
155 * surface controller interface
156 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900157
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900158 /**
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000159 * \brief add a listener for notification when ivi_surface is created
160 *
161 * When an ivi_surface is created, a signal is emitted
162 * to the listening controller plugins.
163 * The pointer of the created ivi_surface is sent as the void *data argument
164 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900165 */
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000166 int32_t (*add_listener_create_surface)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900167
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900168 /**
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +0000169 * \brief add a listener for notification when ivi_surface is removed
170 *
171 * When an ivi_surface is removed, a signal is emitted
172 * to the listening controller plugins.
173 * The pointer of the removed ivi_surface is sent as the void *data argument
174 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900175 */
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +0000176 int32_t (*add_listener_remove_surface)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900177
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900178 /**
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000179 * \brief add a listener for notification when ivi_surface is configured
180 *
181 * When an ivi_surface is configured, a signal is emitted
182 * to the listening controller plugins.
183 * The pointer of the configured ivi_surface is sent as the void *data argument
184 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900185 */
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000186 int32_t (*add_listener_configure_surface)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900187
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900188 /**
189 * \brief Get all ivi_surfaces which are currently registered and managed
190 * by the services
191 *
192 * \return IVI_SUCCEEDED if the method call was successful
193 * \return IVI_FAILED if the method call was failed
194 */
195 int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900196
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900197 /**
198 * \brief get id of ivi_surface from ivi_layout_surface
199 *
200 * \return id of ivi_surface
201 */
202 uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900203
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900204 /**
205 * \brief get ivi_layout_surface from id of ivi_surface
206 *
207 * \return (struct ivi_layout_surface *)
208 * if the method call was successful
209 * \return NULL if the method call was failed
210 */
211 struct ivi_layout_surface *
212 (*get_surface_from_id)(uint32_t id_surface);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900213
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900214 /**
215 * \brief get ivi_layout_surface_properties from ivisurf
216 *
217 * \return (struct ivi_layout_surface_properties *)
218 * if the method call was successful
219 * \return NULL if the method call was failed
220 */
221 const struct ivi_layout_surface_properties *
222 (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900223
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900224 /**
225 * \brief Get all Surfaces which are currently registered to a given
226 * layer and are managed by the services
227 *
228 * \return IVI_SUCCEEDED if the method call was successful
229 * \return IVI_FAILED if the method call was failed
230 */
231 int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
232 int32_t *pLength,
233 struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900234
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900235 /**
236 * \brief Set the visibility of a ivi_surface.
237 *
238 * If a surface is not visible it will not be rendered.
239 *
240 * \return IVI_SUCCEEDED if the method call was successful
241 * \return IVI_FAILED if the method call was failed
242 */
243 int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf,
244 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900245
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900246 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900247 * \brief Set the opacity of a surface.
248 *
249 * \return IVI_SUCCEEDED if the method call was successful
250 * \return IVI_FAILED if the method call was failed
251 */
252 int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
253 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900254
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900255 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900256 * \brief Set the area of a ivi_surface which should be used for the rendering.
257 *
258 * \return IVI_SUCCEEDED if the method call was successful
259 * \return IVI_FAILED if the method call was failed
260 */
261 int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
262 int32_t x, int32_t y,
263 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900264
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900265 /**
266 * \brief Set the destination area of a ivi_surface within a ivi_layer
267 * for rendering.
268 *
269 * The surface will be scaled to this rectangle for rendering.
270 *
271 * \return IVI_SUCCEEDED if the method call was successful
272 * \return IVI_FAILED if the method call was failed
273 */
274 int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf,
275 int32_t x, int32_t y,
276 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900277
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900278 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900279 * \brief Sets the orientation of a ivi_surface.
280 *
281 * \return IVI_SUCCEEDED if the method call was successful
282 * \return IVI_FAILED if the method call was failed
283 */
284 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
285 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900286
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900287 /**
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000288 * \brief add a listener to listen property changes of ivi_surface
289 *
290 * When a property of the ivi_surface is changed, the property_changed
291 * signal is emitted to the listening controller plugins.
292 * The pointer of the ivi_surface is sent as the void *data argument
293 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900294 *
295 * \return IVI_SUCCEEDED if the method call was successful
296 * \return IVI_FAILED if the method call was failed
297 */
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000298 int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf,
299 struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900300
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900301 /**
302 * \brief get weston_surface of ivi_surface
303 */
304 struct weston_surface *
305 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900306
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900307 /**
308 * \brief set type of transition animation
309 */
310 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
311 enum ivi_layout_transition_type type,
312 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900313
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900314 /**
315 * \brief set duration of transition animation
316 */
317 int32_t (*surface_set_transition_duration)(
318 struct ivi_layout_surface *ivisurf,
319 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900320
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900321 /**
322 * layer controller interface
323 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900324
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900325 /**
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000326 * \brief add a listener for notification when ivi_layer is created
327 *
328 * When an ivi_layer is created, a signal is emitted
329 * to the listening controller plugins.
330 * The pointer of the created ivi_layer is sent as the void *data argument
331 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900332 */
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000333 int32_t (*add_listener_create_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900334
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900335 /**
Ucan, Emre (ADITG/SW1)562f2ec2016-04-04 08:05:15 +0000336 * \brief add a listener for notification when ivi_layer is removed
337 *
338 * When an ivi_layer is removed, a signal is emitted
339 * to the listening controller plugins.
340 * The pointer of the removed ivi_layer is sent as the void *data argument
341 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900342 */
Ucan, Emre (ADITG/SW1)562f2ec2016-04-04 08:05:15 +0000343 int32_t (*add_listener_remove_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900344
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900345 /**
346 * \brief Create a ivi_layer which should be managed by the service
347 *
348 * \return (struct ivi_layout_layer *)
349 * if the method call was successful
350 * \return NULL if the method call was failed
351 */
352 struct ivi_layout_layer *
353 (*layer_create_with_dimension)(uint32_t id_layer,
354 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900355
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900356 /**
357 * \brief Removes a ivi_layer which is currently managed by the service
358 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900359 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900360
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900361 /**
362 * \brief Get all ivi_layers which are currently registered and managed
363 * by the services
364 *
365 * \return IVI_SUCCEEDED if the method call was successful
366 * \return IVI_FAILED if the method call was failed
367 */
368 int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900369
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900370 /**
371 * \brief get id of ivi_layer from ivi_layout_layer
372 *
373 *
374 * \return id of ivi_layer
375 */
376 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900377
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900378 /**
379 * \brief get ivi_layout_layer from id of layer
380 *
381 * \return (struct ivi_layout_layer *)
382 * if the method call was successful
383 * \return NULL if the method call was failed
384 */
385 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900386
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900387 /**
388 * \brief Get the ivi_layer properties
389 *
390 * \return (const struct ivi_layout_layer_properties *)
391 * if the method call was successful
392 * \return NULL if the method call was failed
393 */
394 const struct ivi_layout_layer_properties *
395 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900396
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900397 /**
Pekka Paalanenedcb3122016-04-12 17:16:26 +0300398 * \brief Get all ivi-layers under the given ivi-surface
399 *
400 * This means all the ivi-layers the ivi-surface was added to. It has
401 * no relation to geometric overlaps.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900402 *
403 * \return IVI_SUCCEEDED if the method call was successful
404 * \return IVI_FAILED if the method call was failed
405 */
406 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
407 int32_t *pLength,
408 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900409
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900410 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000411 * \brief Get all Layers of the given weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900412 *
413 * \return IVI_SUCCEEDED if the method call was successful
414 * \return IVI_FAILED if the method call was failed
415 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000416 int32_t (*get_layers_on_screen)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900417 int32_t *pLength,
418 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900419
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900420 /**
421 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
422 * the ivi_layer and its ivi_surfaces will not be rendered.
423 *
424 * \return IVI_SUCCEEDED if the method call was successful
425 * \return IVI_FAILED if the method call was failed
426 */
427 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
428 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900429
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900430 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900431 * \brief Set the opacity of a ivi_layer.
432 *
433 * \return IVI_SUCCEEDED if the method call was successful
434 * \return IVI_FAILED if the method call was failed
435 */
436 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
437 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900438
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900439 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900440 * \brief Set the area of a ivi_layer which should be used for the rendering.
441 *
442 * Only this part will be visible.
443 *
444 * \return IVI_SUCCEEDED if the method call was successful
445 * \return IVI_FAILED if the method call was failed
446 */
447 int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
448 int32_t x, int32_t y,
449 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900450
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900451 /**
452 * \brief Set the destination area on the display for a ivi_layer.
453 *
454 * The ivi_layer will be scaled and positioned to this rectangle
455 * for rendering
456 *
457 * \return IVI_SUCCEEDED if the method call was successful
458 * \return IVI_FAILED if the method call was failed
459 */
460 int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
461 int32_t x, int32_t y,
462 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900463
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900464 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900465 * \brief Sets the orientation of a ivi_layer.
466 *
467 * \return IVI_SUCCEEDED if the method call was successful
468 * \return IVI_FAILED if the method call was failed
469 */
470 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
471 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900472
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900473 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900474 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
475 *
476 * \return IVI_SUCCEEDED if the method call was successful
477 * \return IVI_FAILED if the method call was failed
478 */
479 int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
480 struct ivi_layout_surface *addsurf);
481
482 /**
483 * \brief Removes a surface from a layer which is currently managed by the service
484 */
485 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
486 struct ivi_layout_surface *remsurf);
487
488 /**
489 * \brief Sets render order of ivi_surfaces within a ivi_layer
490 *
491 * \return IVI_SUCCEEDED if the method call was successful
492 * \return IVI_FAILED if the method call was failed
493 */
494 int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
495 struct ivi_layout_surface **pSurface,
496 int32_t number);
497
498 /**
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000499 * \brief add a listener to listen property changes of ivi_layer
500 *
501 * When a property of the ivi_layer is changed, the property_changed
502 * signal is emitted to the listening controller plugins.
503 * The pointer of the ivi_layer is sent as the void *data argument
504 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900505 *
506 * \return IVI_SUCCEEDED if the method call was successful
507 * \return IVI_FAILED if the method call was failed
508 */
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000509 int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer,
510 struct wl_listener *listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900511
512 /**
513 * \brief set type of transition animation
514 */
515 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
516 enum ivi_layout_transition_type type,
517 uint32_t duration);
518
519 /**
520 * screen controller interface
521 */
522
523 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000524 * \brief Get the weston_outputs under the given ivi_layer
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900525 *
526 * \return IVI_SUCCEEDED if the method call was successful
527 * \return IVI_FAILED if the method call was failed
528 */
529 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
530 int32_t *pLength,
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000531 struct weston_output ***ppArray);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900532
533 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000534 * \brief Add a ivi_layer to a weston_output which is currently managed
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900535 * by the service
536 *
537 * \return IVI_SUCCEEDED if the method call was successful
538 * \return IVI_FAILED if the method call was failed
539 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000540 int32_t (*screen_add_layer)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900541 struct ivi_layout_layer *addlayer);
542
543 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000544 * \brief Sets render order of ivi_layers on a weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900545 *
546 * \return IVI_SUCCEEDED if the method call was successful
547 * \return IVI_FAILED if the method call was failed
548 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000549 int32_t (*screen_set_render_order)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900550 struct ivi_layout_layer **pLayer,
551 const int32_t number);
552
553 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900554 * transision animation for layer
555 */
556 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
557 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
558 uint32_t is_fade_in,
559 double start_alpha, double end_alpha);
560
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900561 /**
562 * surface content dumping for debugging
563 */
564 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
565 int32_t *width, int32_t *height,
566 int32_t *stride);
567
568 int32_t (*surface_dump)(struct weston_surface *surface,
569 void *target, size_t size,
570 int32_t x, int32_t y,
571 int32_t width, int32_t height);
Pekka Paalaneneaa43fc2016-04-12 16:06:58 +0300572
573 /**
574 * Returns the ivi_layout_surface or NULL
575 *
576 * NULL is returned if there is no ivi_layout_surface corresponding
577 * to the given weston_surface.
578 */
579 struct ivi_layout_surface *
580 (*get_surface)(struct weston_surface *surface);
Ucan, Emre (ADITG/SW1)deee8582017-03-02 08:47:33 +0000581
582 /**
583 * \brief Remove a ivi_layer to a weston_output which is currently managed
584 * by the service
585 *
586 * \return IVI_SUCCEEDED if the method call was successful
587 * \return IVI_FAILED if the method call was failed
588 */
589 int32_t (*screen_remove_layer)(struct weston_output *output,
590 struct ivi_layout_layer *removelayer);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900591};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900592
593#ifdef __cplusplus
594}
595#endif /* __cplusplus */
596
597#endif /* _IVI_LAYOUT_EXPORT_H_ */