blob: c2a8c10efbd880a80fe2bf8e046c5fb35bd7df28 [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
28 * surface and layer which groups surfaces. An unique ID whose type is integer
29 * is required to create surface and layer. With the unique ID, surface and
30 * layer are identified to control them. The API set consists of APIs to control
31 * 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
58#include "stdbool.h"
59#include "compositor.h"
60
61#define IVI_SUCCEEDED (0)
62#define IVI_FAILED (-1)
63
64struct ivi_layout_layer;
65struct ivi_layout_screen;
66struct ivi_layout_surface;
67
68struct ivi_layout_surface_properties
69{
70 wl_fixed_t opacity;
71 int32_t source_x;
72 int32_t source_y;
73 int32_t source_width;
74 int32_t source_height;
75 int32_t start_x;
76 int32_t start_y;
77 int32_t start_width;
78 int32_t start_height;
79 int32_t dest_x;
80 int32_t dest_y;
81 int32_t dest_width;
82 int32_t dest_height;
83 enum wl_output_transform orientation;
84 bool visibility;
85 int32_t transition_type;
86 uint32_t transition_duration;
Ucan, Emre (ADITG/SW1)0bd29b62016-03-31 11:08:52 +000087 uint32_t event_mask;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090088};
89
90struct ivi_layout_layer_properties
91{
92 wl_fixed_t opacity;
93 int32_t source_x;
94 int32_t source_y;
95 int32_t source_width;
96 int32_t source_height;
97 int32_t dest_x;
98 int32_t dest_y;
99 int32_t dest_width;
100 int32_t dest_height;
101 enum wl_output_transform orientation;
102 uint32_t visibility;
103 int32_t transition_type;
104 uint32_t transition_duration;
105 double start_alpha;
106 double end_alpha;
107 uint32_t is_fade_in;
Ucan, Emre (ADITG/SW1)0bd29b62016-03-31 11:08:52 +0000108 uint32_t event_mask;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900109};
110
111enum ivi_layout_notification_mask {
112 IVI_NOTIFICATION_NONE = 0,
113 IVI_NOTIFICATION_OPACITY = (1 << 1),
114 IVI_NOTIFICATION_SOURCE_RECT = (1 << 2),
115 IVI_NOTIFICATION_DEST_RECT = (1 << 3),
116 IVI_NOTIFICATION_DIMENSION = (1 << 4),
117 IVI_NOTIFICATION_POSITION = (1 << 5),
118 IVI_NOTIFICATION_ORIENTATION = (1 << 6),
119 IVI_NOTIFICATION_VISIBILITY = (1 << 7),
120 IVI_NOTIFICATION_PIXELFORMAT = (1 << 8),
121 IVI_NOTIFICATION_ADD = (1 << 9),
122 IVI_NOTIFICATION_REMOVE = (1 << 10),
123 IVI_NOTIFICATION_CONFIGURE = (1 << 11),
124 IVI_NOTIFICATION_ALL = 0xFFFF
125};
126
127enum ivi_layout_transition_type{
128 IVI_LAYOUT_TRANSITION_NONE,
129 IVI_LAYOUT_TRANSITION_VIEW_DEFAULT,
130 IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY,
131 IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY,
132 IVI_LAYOUT_TRANSITION_LAYER_FADE,
133 IVI_LAYOUT_TRANSITION_LAYER_MOVE,
134 IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER,
135 IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE,
136 IVI_LAYOUT_TRANSITION_VIEW_RESIZE,
137 IVI_LAYOUT_TRANSITION_VIEW_FADE,
138 IVI_LAYOUT_TRANSITION_MAX,
139};
140
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900141typedef void (*layer_remove_notification_func)(
142 struct ivi_layout_layer *ivilayer,
143 void *userdata);
144
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900145typedef void (*surface_remove_notification_func)(
146 struct ivi_layout_surface *ivisurf,
147 void *userdata);
148
149typedef void (*surface_configure_notification_func)(
150 struct ivi_layout_surface *ivisurf,
151 void *userdata);
152
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000153struct ivi_layout_interface {
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900154
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900155 /**
156 * \brief Commit all changes and execute all enqueued commands since
157 * last commit.
158 *
159 * \return IVI_SUCCEEDED if the method call was successful
160 * \return IVI_FAILED if the method call was failed
161 */
162 int32_t (*commit_changes)(void);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900163
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900164 /**
165 * surface controller interface
166 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900167
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900168 /**
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000169 * \brief add a listener for notification when ivi_surface is created
170 *
171 * When an ivi_surface is created, a signal is emitted
172 * to the listening controller plugins.
173 * The pointer of the created 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)970f8312016-04-04 08:05:09 +0000176 int32_t (*add_listener_create_surface)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900177
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900178 /**
179 * \brief register/unregister for notification when ivi_surface is removed
180 */
181 int32_t (*add_notification_remove_surface)(
182 surface_remove_notification_func callback,
183 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900184
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900185 void (*remove_notification_remove_surface)(
186 surface_remove_notification_func callback,
187 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900188
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900189 /**
190 * \brief register/unregister for notification when ivi_surface is configured
191 */
192 int32_t (*add_notification_configure_surface)(
193 surface_configure_notification_func callback,
194 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900195
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900196 void (*remove_notification_configure_surface)(
197 surface_configure_notification_func callback,
198 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900199
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900200 /**
201 * \brief Get all ivi_surfaces which are currently registered and managed
202 * by the services
203 *
204 * \return IVI_SUCCEEDED if the method call was successful
205 * \return IVI_FAILED if the method call was failed
206 */
207 int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900208
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900209 /**
210 * \brief get id of ivi_surface from ivi_layout_surface
211 *
212 * \return id of ivi_surface
213 */
214 uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900215
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900216 /**
217 * \brief get ivi_layout_surface from id of ivi_surface
218 *
219 * \return (struct ivi_layout_surface *)
220 * if the method call was successful
221 * \return NULL if the method call was failed
222 */
223 struct ivi_layout_surface *
224 (*get_surface_from_id)(uint32_t id_surface);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900225
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900226 /**
227 * \brief get ivi_layout_surface_properties from ivisurf
228 *
229 * \return (struct ivi_layout_surface_properties *)
230 * if the method call was successful
231 * \return NULL if the method call was failed
232 */
233 const struct ivi_layout_surface_properties *
234 (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900235
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900236 /**
237 * \brief Get all Surfaces which are currently registered to a given
238 * layer and are managed by the services
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 (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
244 int32_t *pLength,
245 struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900246
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900247 /**
248 * \brief Set the visibility of a ivi_surface.
249 *
250 * If a surface is not visible it will not be rendered.
251 *
252 * \return IVI_SUCCEEDED if the method call was successful
253 * \return IVI_FAILED if the method call was failed
254 */
255 int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf,
256 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900257
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900258 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900259 * \brief Set the opacity of a surface.
260 *
261 * \return IVI_SUCCEEDED if the method call was successful
262 * \return IVI_FAILED if the method call was failed
263 */
264 int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
265 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900266
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900267 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900268 * \brief Set the area of a ivi_surface which should be used for the rendering.
269 *
270 * \return IVI_SUCCEEDED if the method call was successful
271 * \return IVI_FAILED if the method call was failed
272 */
273 int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
274 int32_t x, int32_t y,
275 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900276
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900277 /**
278 * \brief Set the destination area of a ivi_surface within a ivi_layer
279 * for rendering.
280 *
281 * The surface will be scaled to this rectangle for rendering.
282 *
283 * \return IVI_SUCCEEDED if the method call was successful
284 * \return IVI_FAILED if the method call was failed
285 */
286 int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf,
287 int32_t x, int32_t y,
288 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900289
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900290 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900291 * \brief Sets the orientation of a ivi_surface.
292 *
293 * \return IVI_SUCCEEDED if the method call was successful
294 * \return IVI_FAILED if the method call was failed
295 */
296 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
297 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900298
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900299 /**
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000300 * \brief add a listener to listen property changes of ivi_surface
301 *
302 * When a property of the ivi_surface is changed, the property_changed
303 * signal is emitted to the listening controller plugins.
304 * The pointer of the ivi_surface is sent as the void *data argument
305 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900306 *
307 * \return IVI_SUCCEEDED if the method call was successful
308 * \return IVI_FAILED if the method call was failed
309 */
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000310 int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf,
311 struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900312
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900313 /**
314 * \brief get weston_surface of ivi_surface
315 */
316 struct weston_surface *
317 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900318
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900319 /**
320 * \brief set type of transition animation
321 */
322 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
323 enum ivi_layout_transition_type type,
324 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900325
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900326 /**
327 * \brief set duration of transition animation
328 */
329 int32_t (*surface_set_transition_duration)(
330 struct ivi_layout_surface *ivisurf,
331 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900332
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900333 /**
334 * layer controller interface
335 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900336
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900337 /**
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000338 * \brief add a listener for notification when ivi_layer is created
339 *
340 * When an ivi_layer is created, a signal is emitted
341 * to the listening controller plugins.
342 * The pointer of the created ivi_layer is sent as the void *data argument
343 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900344 */
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000345 int32_t (*add_listener_create_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900346
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900347 /**
348 * \brief register/unregister for notification when ivi_layer is removed
349 */
350 int32_t (*add_notification_remove_layer)(
351 layer_remove_notification_func callback,
352 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900353
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900354 void (*remove_notification_remove_layer)(
355 layer_remove_notification_func callback,
356 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900357
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900358 /**
359 * \brief Create a ivi_layer which should be managed by the service
360 *
361 * \return (struct ivi_layout_layer *)
362 * if the method call was successful
363 * \return NULL if the method call was failed
364 */
365 struct ivi_layout_layer *
366 (*layer_create_with_dimension)(uint32_t id_layer,
367 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900368
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900369 /**
370 * \brief Removes a ivi_layer which is currently managed by the service
371 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900372 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900373
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900374 /**
375 * \brief Get all ivi_layers which are currently registered and managed
376 * by the services
377 *
378 * \return IVI_SUCCEEDED if the method call was successful
379 * \return IVI_FAILED if the method call was failed
380 */
381 int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900382
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900383 /**
384 * \brief get id of ivi_layer from ivi_layout_layer
385 *
386 *
387 * \return id of ivi_layer
388 */
389 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900390
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900391 /**
392 * \brief get ivi_layout_layer from id of layer
393 *
394 * \return (struct ivi_layout_layer *)
395 * if the method call was successful
396 * \return NULL if the method call was failed
397 */
398 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900399
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900400 /**
401 * \brief Get the ivi_layer properties
402 *
403 * \return (const struct ivi_layout_layer_properties *)
404 * if the method call was successful
405 * \return NULL if the method call was failed
406 */
407 const struct ivi_layout_layer_properties *
408 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900409
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900410 /**
411 * \brief Get all ivi_ayers under the given ivi_surface
412 *
413 * \return IVI_SUCCEEDED if the method call was successful
414 * \return IVI_FAILED if the method call was failed
415 */
416 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
417 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 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000421 * \brief Get all Layers of the given weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900422 *
423 * \return IVI_SUCCEEDED if the method call was successful
424 * \return IVI_FAILED if the method call was failed
425 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000426 int32_t (*get_layers_on_screen)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900427 int32_t *pLength,
428 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900429
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900430 /**
431 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
432 * the ivi_layer and its ivi_surfaces will not be rendered.
433 *
434 * \return IVI_SUCCEEDED if the method call was successful
435 * \return IVI_FAILED if the method call was failed
436 */
437 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
438 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900439
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900440 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900441 * \brief Set the opacity of a ivi_layer.
442 *
443 * \return IVI_SUCCEEDED if the method call was successful
444 * \return IVI_FAILED if the method call was failed
445 */
446 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
447 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900448
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900449 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900450 * \brief Set the area of a ivi_layer which should be used for the rendering.
451 *
452 * Only this part will be visible.
453 *
454 * \return IVI_SUCCEEDED if the method call was successful
455 * \return IVI_FAILED if the method call was failed
456 */
457 int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
458 int32_t x, int32_t y,
459 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900460
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900461 /**
462 * \brief Set the destination area on the display for a ivi_layer.
463 *
464 * The ivi_layer will be scaled and positioned to this rectangle
465 * for rendering
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_destination_rectangle)(struct ivi_layout_layer *ivilayer,
471 int32_t x, int32_t y,
472 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900473
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900474 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900475 * \brief Sets the orientation of a ivi_layer.
476 *
477 * \return IVI_SUCCEEDED if the method call was successful
478 * \return IVI_FAILED if the method call was failed
479 */
480 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
481 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900482
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900483 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900484 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
485 *
486 * \return IVI_SUCCEEDED if the method call was successful
487 * \return IVI_FAILED if the method call was failed
488 */
489 int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
490 struct ivi_layout_surface *addsurf);
491
492 /**
493 * \brief Removes a surface from a layer which is currently managed by the service
494 */
495 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
496 struct ivi_layout_surface *remsurf);
497
498 /**
499 * \brief Sets render order of ivi_surfaces within a ivi_layer
500 *
501 * \return IVI_SUCCEEDED if the method call was successful
502 * \return IVI_FAILED if the method call was failed
503 */
504 int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
505 struct ivi_layout_surface **pSurface,
506 int32_t number);
507
508 /**
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000509 * \brief add a listener to listen property changes of ivi_layer
510 *
511 * When a property of the ivi_layer is changed, the property_changed
512 * signal is emitted to the listening controller plugins.
513 * The pointer of the ivi_layer is sent as the void *data argument
514 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900515 *
516 * \return IVI_SUCCEEDED if the method call was successful
517 * \return IVI_FAILED if the method call was failed
518 */
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000519 int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer,
520 struct wl_listener *listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900521
522 /**
523 * \brief set type of transition animation
524 */
525 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
526 enum ivi_layout_transition_type type,
527 uint32_t duration);
528
529 /**
530 * screen controller interface
531 */
532
533 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000534 * \brief Get the weston_outputs under the given ivi_layer
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900535 *
536 * \return IVI_SUCCEEDED if the method call was successful
537 * \return IVI_FAILED if the method call was failed
538 */
539 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
540 int32_t *pLength,
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000541 struct weston_output ***ppArray);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900542
543 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000544 * \brief Add a ivi_layer to a weston_output which is currently managed
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900545 * by the service
546 *
547 * \return IVI_SUCCEEDED if the method call was successful
548 * \return IVI_FAILED if the method call was failed
549 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000550 int32_t (*screen_add_layer)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900551 struct ivi_layout_layer *addlayer);
552
553 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000554 * \brief Sets render order of ivi_layers on a weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900555 *
556 * \return IVI_SUCCEEDED if the method call was successful
557 * \return IVI_FAILED if the method call was failed
558 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000559 int32_t (*screen_set_render_order)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900560 struct ivi_layout_layer **pLayer,
561 const int32_t number);
562
563 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900564 * transision animation for layer
565 */
566 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
567 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
568 uint32_t is_fade_in,
569 double start_alpha, double end_alpha);
570
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900571 /**
572 * surface content dumping for debugging
573 */
574 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
575 int32_t *width, int32_t *height,
576 int32_t *stride);
577
578 int32_t (*surface_dump)(struct weston_surface *surface,
579 void *target, size_t size,
580 int32_t x, int32_t y,
581 int32_t width, int32_t height);
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_ */