blob: f8802544d2a1b3130cc6498d1660141e7df837dd [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 /**
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000279 * \brief add a listener to listen property changes of ivi_surface
280 *
281 * When a property of the ivi_surface is changed, the property_changed
282 * signal is emitted to the listening controller plugins.
283 * The pointer of the ivi_surface is sent as the void *data argument
284 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900285 *
286 * \return IVI_SUCCEEDED if the method call was successful
287 * \return IVI_FAILED if the method call was failed
288 */
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000289 int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf,
290 struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900291
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900292 /**
293 * \brief get weston_surface of ivi_surface
294 */
295 struct weston_surface *
296 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900297
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900298 /**
299 * \brief set type of transition animation
300 */
301 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
302 enum ivi_layout_transition_type type,
303 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900304
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900305 /**
306 * \brief set duration of transition animation
307 */
308 int32_t (*surface_set_transition_duration)(
309 struct ivi_layout_surface *ivisurf,
310 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900311
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900312 /**
313 * layer controller interface
314 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900315
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900316 /**
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000317 * \brief add a listener for notification when ivi_layer is created
318 *
319 * When an ivi_layer is created, a signal is emitted
320 * to the listening controller plugins.
321 * The pointer of the created ivi_layer is sent as the void *data argument
322 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900323 */
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000324 int32_t (*add_listener_create_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900325
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900326 /**
Ucan, Emre (ADITG/SW1)562f2ec2016-04-04 08:05:15 +0000327 * \brief add a listener for notification when ivi_layer is removed
328 *
329 * When an ivi_layer is removed, a signal is emitted
330 * to the listening controller plugins.
331 * The pointer of the removed ivi_layer is sent as the void *data argument
332 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900333 */
Ucan, Emre (ADITG/SW1)562f2ec2016-04-04 08:05:15 +0000334 int32_t (*add_listener_remove_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900335
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900336 /**
337 * \brief Create a ivi_layer which should be managed by the service
338 *
339 * \return (struct ivi_layout_layer *)
340 * if the method call was successful
341 * \return NULL if the method call was failed
342 */
343 struct ivi_layout_layer *
344 (*layer_create_with_dimension)(uint32_t id_layer,
345 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900346
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900347 /**
348 * \brief Removes a ivi_layer which is currently managed by the service
349 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900350 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900351
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900352 /**
353 * \brief Get all ivi_layers which are currently registered and managed
354 * by the services
355 *
356 * \return IVI_SUCCEEDED if the method call was successful
357 * \return IVI_FAILED if the method call was failed
358 */
359 int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900360
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900361 /**
362 * \brief get id of ivi_layer from ivi_layout_layer
363 *
364 *
365 * \return id of ivi_layer
366 */
367 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900368
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900369 /**
370 * \brief get ivi_layout_layer from id of layer
371 *
372 * \return (struct ivi_layout_layer *)
373 * if the method call was successful
374 * \return NULL if the method call was failed
375 */
376 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900377
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900378 /**
379 * \brief Get the ivi_layer properties
380 *
381 * \return (const struct ivi_layout_layer_properties *)
382 * if the method call was successful
383 * \return NULL if the method call was failed
384 */
385 const struct ivi_layout_layer_properties *
386 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900387
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900388 /**
Pekka Paalanenedcb3122016-04-12 17:16:26 +0300389 * \brief Get all ivi-layers under the given ivi-surface
390 *
391 * This means all the ivi-layers the ivi-surface was added to. It has
392 * no relation to geometric overlaps.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900393 *
394 * \return IVI_SUCCEEDED if the method call was successful
395 * \return IVI_FAILED if the method call was failed
396 */
397 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
398 int32_t *pLength,
399 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900400
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900401 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000402 * \brief Get all Layers of the given weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900403 *
404 * \return IVI_SUCCEEDED if the method call was successful
405 * \return IVI_FAILED if the method call was failed
406 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000407 int32_t (*get_layers_on_screen)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900408 int32_t *pLength,
409 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900410
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900411 /**
412 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
413 * the ivi_layer and its ivi_surfaces will not be rendered.
414 *
415 * \return IVI_SUCCEEDED if the method call was successful
416 * \return IVI_FAILED if the method call was failed
417 */
418 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
419 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900420
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900421 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900422 * \brief Set the opacity of a ivi_layer.
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_opacity)(struct ivi_layout_layer *ivilayer,
428 wl_fixed_t opacity);
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 area of a ivi_layer which should be used for the rendering.
432 *
433 * Only this part will be visible.
434 *
435 * \return IVI_SUCCEEDED if the method call was successful
436 * \return IVI_FAILED if the method call was failed
437 */
438 int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
439 int32_t x, int32_t y,
440 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900441
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900442 /**
443 * \brief Set the destination area on the display for a ivi_layer.
444 *
445 * The ivi_layer will be scaled and positioned to this rectangle
446 * for rendering
447 *
448 * \return IVI_SUCCEEDED if the method call was successful
449 * \return IVI_FAILED if the method call was failed
450 */
451 int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
452 int32_t x, int32_t y,
453 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900454
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900455 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900456 * \brief Sets the orientation of a ivi_layer.
457 *
458 * \return IVI_SUCCEEDED if the method call was successful
459 * \return IVI_FAILED if the method call was failed
460 */
461 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
462 enum wl_output_transform orientation);
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 Add a ivi_surface to a ivi_layer which is currently managed by the service
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_add_surface)(struct ivi_layout_layer *ivilayer,
471 struct ivi_layout_surface *addsurf);
472
473 /**
474 * \brief Removes a surface from a layer which is currently managed by the service
475 */
476 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
477 struct ivi_layout_surface *remsurf);
478
479 /**
480 * \brief Sets render order of ivi_surfaces within a ivi_layer
481 *
482 * \return IVI_SUCCEEDED if the method call was successful
483 * \return IVI_FAILED if the method call was failed
484 */
485 int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
486 struct ivi_layout_surface **pSurface,
487 int32_t number);
488
489 /**
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000490 * \brief add a listener to listen property changes of ivi_layer
491 *
492 * When a property of the ivi_layer is changed, the property_changed
493 * signal is emitted to the listening controller plugins.
494 * The pointer of the ivi_layer is sent as the void *data argument
495 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900496 *
497 * \return IVI_SUCCEEDED if the method call was successful
498 * \return IVI_FAILED if the method call was failed
499 */
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000500 int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer,
501 struct wl_listener *listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900502
503 /**
504 * \brief set type of transition animation
505 */
506 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
507 enum ivi_layout_transition_type type,
508 uint32_t duration);
509
510 /**
511 * screen controller interface
512 */
513
514 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000515 * \brief Get the weston_outputs under the given ivi_layer
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900516 *
517 * \return IVI_SUCCEEDED if the method call was successful
518 * \return IVI_FAILED if the method call was failed
519 */
520 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
521 int32_t *pLength,
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000522 struct weston_output ***ppArray);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900523
524 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000525 * \brief Add a ivi_layer to a weston_output which is currently managed
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900526 * by the service
527 *
528 * \return IVI_SUCCEEDED if the method call was successful
529 * \return IVI_FAILED if the method call was failed
530 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000531 int32_t (*screen_add_layer)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900532 struct ivi_layout_layer *addlayer);
533
534 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000535 * \brief Sets render order of ivi_layers on a weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900536 *
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_set_render_order)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900541 struct ivi_layout_layer **pLayer,
542 const int32_t number);
543
544 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900545 * transision animation for layer
546 */
547 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
548 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
549 uint32_t is_fade_in,
550 double start_alpha, double end_alpha);
551
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900552 /**
553 * surface content dumping for debugging
554 */
555 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
556 int32_t *width, int32_t *height,
557 int32_t *stride);
558
559 int32_t (*surface_dump)(struct weston_surface *surface,
560 void *target, size_t size,
561 int32_t x, int32_t y,
562 int32_t width, int32_t height);
Pekka Paalaneneaa43fc2016-04-12 16:06:58 +0300563
564 /**
565 * Returns the ivi_layout_surface or NULL
566 *
567 * NULL is returned if there is no ivi_layout_surface corresponding
568 * to the given weston_surface.
569 */
570 struct ivi_layout_surface *
571 (*get_surface)(struct weston_surface *surface);
Ucan, Emre (ADITG/SW1)deee8582017-03-02 08:47:33 +0000572
573 /**
574 * \brief Remove a ivi_layer to a weston_output which is currently managed
575 * by the service
576 *
577 * \return IVI_SUCCEEDED if the method call was successful
578 * \return IVI_FAILED if the method call was failed
579 */
580 int32_t (*screen_remove_layer)(struct weston_output *output,
581 struct ivi_layout_layer *removelayer);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900582};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900583
584#ifdef __cplusplus
585}
586#endif /* __cplusplus */
587
588#endif /* _IVI_LAYOUT_EXPORT_H_ */