blob: 05f3668fe25f8bca2828a57655262b4b361c48b8 [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
141typedef void (*layer_property_notification_func)(
142 struct ivi_layout_layer *ivilayer,
143 const struct ivi_layout_layer_properties *,
144 enum ivi_layout_notification_mask mask,
145 void *userdata);
146
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900147typedef void (*layer_create_notification_func)(
148 struct ivi_layout_layer *ivilayer,
149 void *userdata);
150
151typedef void (*layer_remove_notification_func)(
152 struct ivi_layout_layer *ivilayer,
153 void *userdata);
154
155typedef void (*surface_create_notification_func)(
156 struct ivi_layout_surface *ivisurf,
157 void *userdata);
158
159typedef void (*surface_remove_notification_func)(
160 struct ivi_layout_surface *ivisurf,
161 void *userdata);
162
163typedef void (*surface_configure_notification_func)(
164 struct ivi_layout_surface *ivisurf,
165 void *userdata);
166
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000167struct ivi_layout_interface {
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900168
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900169 /**
170 * \brief Commit all changes and execute all enqueued commands since
171 * last commit.
172 *
173 * \return IVI_SUCCEEDED if the method call was successful
174 * \return IVI_FAILED if the method call was failed
175 */
176 int32_t (*commit_changes)(void);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900177
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900178 /**
179 * surface controller interface
180 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900181
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900182 /**
183 * \brief register/unregister for notification when ivi_surface is created
184 */
185 int32_t (*add_notification_create_surface)(
186 surface_create_notification_func callback,
187 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900188
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900189 void (*remove_notification_create_surface)(
190 surface_create_notification_func callback,
191 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900192
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900193 /**
194 * \brief register/unregister for notification when ivi_surface is removed
195 */
196 int32_t (*add_notification_remove_surface)(
197 surface_remove_notification_func callback,
198 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900199
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900200 void (*remove_notification_remove_surface)(
201 surface_remove_notification_func callback,
202 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900203
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900204 /**
205 * \brief register/unregister for notification when ivi_surface is configured
206 */
207 int32_t (*add_notification_configure_surface)(
208 surface_configure_notification_func callback,
209 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900210
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900211 void (*remove_notification_configure_surface)(
212 surface_configure_notification_func callback,
213 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900214
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900215 /**
216 * \brief Get all ivi_surfaces which are currently registered and managed
217 * by the services
218 *
219 * \return IVI_SUCCEEDED if the method call was successful
220 * \return IVI_FAILED if the method call was failed
221 */
222 int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900223
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900224 /**
225 * \brief get id of ivi_surface from ivi_layout_surface
226 *
227 * \return id of ivi_surface
228 */
229 uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900230
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900231 /**
232 * \brief get ivi_layout_surface from id of ivi_surface
233 *
234 * \return (struct ivi_layout_surface *)
235 * if the method call was successful
236 * \return NULL if the method call was failed
237 */
238 struct ivi_layout_surface *
239 (*get_surface_from_id)(uint32_t id_surface);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900240
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900241 /**
242 * \brief get ivi_layout_surface_properties from ivisurf
243 *
244 * \return (struct ivi_layout_surface_properties *)
245 * if the method call was successful
246 * \return NULL if the method call was failed
247 */
248 const struct ivi_layout_surface_properties *
249 (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900250
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900251 /**
252 * \brief Get all Surfaces which are currently registered to a given
253 * layer and are managed by the services
254 *
255 * \return IVI_SUCCEEDED if the method call was successful
256 * \return IVI_FAILED if the method call was failed
257 */
258 int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
259 int32_t *pLength,
260 struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900261
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900262 /**
263 * \brief Set the visibility of a ivi_surface.
264 *
265 * If a surface is not visible it will not be rendered.
266 *
267 * \return IVI_SUCCEEDED if the method call was successful
268 * \return IVI_FAILED if the method call was failed
269 */
270 int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf,
271 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900272
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900273 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900274 * \brief Set the opacity of a surface.
275 *
276 * \return IVI_SUCCEEDED if the method call was successful
277 * \return IVI_FAILED if the method call was failed
278 */
279 int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
280 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900281
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900282 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900283 * \brief Set the area of a ivi_surface which should be used for the rendering.
284 *
285 * \return IVI_SUCCEEDED if the method call was successful
286 * \return IVI_FAILED if the method call was failed
287 */
288 int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
289 int32_t x, int32_t y,
290 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900291
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900292 /**
293 * \brief Set the destination area of a ivi_surface within a ivi_layer
294 * for rendering.
295 *
296 * The surface will be scaled to this rectangle for rendering.
297 *
298 * \return IVI_SUCCEEDED if the method call was successful
299 * \return IVI_FAILED if the method call was failed
300 */
301 int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf,
302 int32_t x, int32_t y,
303 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900304
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900305 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900306 * \brief Sets the orientation of a ivi_surface.
307 *
308 * \return IVI_SUCCEEDED if the method call was successful
309 * \return IVI_FAILED if the method call was failed
310 */
311 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
312 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900313
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900314 /**
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000315 * \brief add a listener to listen property changes of ivi_surface
316 *
317 * When a property of the ivi_surface is changed, the property_changed
318 * signal is emitted to the listening controller plugins.
319 * The pointer of the ivi_surface is sent as the void *data argument
320 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900321 *
322 * \return IVI_SUCCEEDED if the method call was successful
323 * \return IVI_FAILED if the method call was failed
324 */
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000325 int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf,
326 struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900327
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900328 /**
329 * \brief get weston_surface of ivi_surface
330 */
331 struct weston_surface *
332 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900333
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900334 /**
335 * \brief set type of transition animation
336 */
337 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
338 enum ivi_layout_transition_type type,
339 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900340
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900341 /**
342 * \brief set duration of transition animation
343 */
344 int32_t (*surface_set_transition_duration)(
345 struct ivi_layout_surface *ivisurf,
346 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900347
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900348 /**
349 * layer controller interface
350 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900351
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900352 /**
353 * \brief register/unregister for notification when ivi_layer is created
354 */
355 int32_t (*add_notification_create_layer)(
356 layer_create_notification_func callback,
357 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900358
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900359 void (*remove_notification_create_layer)(
360 layer_create_notification_func callback,
361 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900362
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900363 /**
364 * \brief register/unregister for notification when ivi_layer is removed
365 */
366 int32_t (*add_notification_remove_layer)(
367 layer_remove_notification_func callback,
368 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900369
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900370 void (*remove_notification_remove_layer)(
371 layer_remove_notification_func callback,
372 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900373
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900374 /**
375 * \brief Create a ivi_layer which should be managed by the service
376 *
377 * \return (struct ivi_layout_layer *)
378 * if the method call was successful
379 * \return NULL if the method call was failed
380 */
381 struct ivi_layout_layer *
382 (*layer_create_with_dimension)(uint32_t id_layer,
383 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900384
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900385 /**
386 * \brief Removes a ivi_layer which is currently managed by the service
387 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900388 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900389
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900390 /**
391 * \brief Get all ivi_layers which are currently registered and managed
392 * by the services
393 *
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)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900398
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900399 /**
400 * \brief get id of ivi_layer from ivi_layout_layer
401 *
402 *
403 * \return id of ivi_layer
404 */
405 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900406
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900407 /**
408 * \brief get ivi_layout_layer from id of layer
409 *
410 * \return (struct ivi_layout_layer *)
411 * if the method call was successful
412 * \return NULL if the method call was failed
413 */
414 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900415
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900416 /**
417 * \brief Get the ivi_layer properties
418 *
419 * \return (const struct ivi_layout_layer_properties *)
420 * if the method call was successful
421 * \return NULL if the method call was failed
422 */
423 const struct ivi_layout_layer_properties *
424 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900425
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900426 /**
427 * \brief Get all ivi_ayers under the given ivi_surface
428 *
429 * \return IVI_SUCCEEDED if the method call was successful
430 * \return IVI_FAILED if the method call was failed
431 */
432 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
433 int32_t *pLength,
434 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900435
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900436 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000437 * \brief Get all Layers of the given weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900438 *
439 * \return IVI_SUCCEEDED if the method call was successful
440 * \return IVI_FAILED if the method call was failed
441 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000442 int32_t (*get_layers_on_screen)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900443 int32_t *pLength,
444 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900445
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900446 /**
447 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
448 * the ivi_layer and its ivi_surfaces will not be rendered.
449 *
450 * \return IVI_SUCCEEDED if the method call was successful
451 * \return IVI_FAILED if the method call was failed
452 */
453 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
454 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900455
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900456 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900457 * \brief Set the opacity of a ivi_layer.
458 *
459 * \return IVI_SUCCEEDED if the method call was successful
460 * \return IVI_FAILED if the method call was failed
461 */
462 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
463 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900464
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900465 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900466 * \brief Set the area of a ivi_layer which should be used for the rendering.
467 *
468 * Only this part will be visible.
469 *
470 * \return IVI_SUCCEEDED if the method call was successful
471 * \return IVI_FAILED if the method call was failed
472 */
473 int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
474 int32_t x, int32_t y,
475 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900476
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900477 /**
478 * \brief Set the destination area on the display for a ivi_layer.
479 *
480 * The ivi_layer will be scaled and positioned to this rectangle
481 * for rendering
482 *
483 * \return IVI_SUCCEEDED if the method call was successful
484 * \return IVI_FAILED if the method call was failed
485 */
486 int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
487 int32_t x, int32_t y,
488 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900489
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900490 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900491 * \brief Sets the orientation of a ivi_layer.
492 *
493 * \return IVI_SUCCEEDED if the method call was successful
494 * \return IVI_FAILED if the method call was failed
495 */
496 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
497 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900498
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900499 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900500 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
501 *
502 * \return IVI_SUCCEEDED if the method call was successful
503 * \return IVI_FAILED if the method call was failed
504 */
505 int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
506 struct ivi_layout_surface *addsurf);
507
508 /**
509 * \brief Removes a surface from a layer which is currently managed by the service
510 */
511 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
512 struct ivi_layout_surface *remsurf);
513
514 /**
515 * \brief Sets render order of ivi_surfaces within a ivi_layer
516 *
517 * \return IVI_SUCCEEDED if the method call was successful
518 * \return IVI_FAILED if the method call was failed
519 */
520 int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
521 struct ivi_layout_surface **pSurface,
522 int32_t number);
523
524 /**
525 * \brief register for notification on property changes of ivi_layer
526 *
527 * \return IVI_SUCCEEDED if the method call was successful
528 * \return IVI_FAILED if the method call was failed
529 */
530 int32_t (*layer_add_notification)(struct ivi_layout_layer *ivilayer,
531 layer_property_notification_func callback,
532 void *userdata);
533
534 /**
535 * \brief remove notification on property changes of ivi_layer
536 */
537 void (*layer_remove_notification)(struct ivi_layout_layer *ivilayer);
538
539 /**
540 * \brief set type of transition animation
541 */
542 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
543 enum ivi_layout_transition_type type,
544 uint32_t duration);
545
546 /**
547 * screen controller interface
548 */
549
550 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000551 * \brief Get the weston_outputs under the given ivi_layer
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900552 *
553 * \return IVI_SUCCEEDED if the method call was successful
554 * \return IVI_FAILED if the method call was failed
555 */
556 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
557 int32_t *pLength,
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000558 struct weston_output ***ppArray);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900559
560 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000561 * \brief Add a ivi_layer to a weston_output which is currently managed
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900562 * by the service
563 *
564 * \return IVI_SUCCEEDED if the method call was successful
565 * \return IVI_FAILED if the method call was failed
566 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000567 int32_t (*screen_add_layer)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900568 struct ivi_layout_layer *addlayer);
569
570 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000571 * \brief Sets render order of ivi_layers on a weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900572 *
573 * \return IVI_SUCCEEDED if the method call was successful
574 * \return IVI_FAILED if the method call was failed
575 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000576 int32_t (*screen_set_render_order)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900577 struct ivi_layout_layer **pLayer,
578 const int32_t number);
579
580 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900581 * transision animation for layer
582 */
583 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
584 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
585 uint32_t is_fade_in,
586 double start_alpha, double end_alpha);
587
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900588 /**
589 * surface content dumping for debugging
590 */
591 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
592 int32_t *width, int32_t *height,
593 int32_t *stride);
594
595 int32_t (*surface_dump)(struct weston_surface *surface,
596 void *target, size_t size,
597 int32_t x, int32_t y,
598 int32_t width, int32_t height);
599
Nobuhiko Tanibata82051702015-06-22 15:31:26 +0900600 /**
Nobuhiko Tanibatadb8efd12015-06-22 15:31:39 +0900601 * \brief remove notification by callback on property changes of ivi_layer
602 */
603 void (*layer_remove_notification_by_callback)(struct ivi_layout_layer *ivilayer,
604 layer_property_notification_func callback,
605 void *userdata);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900606};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900607
608#ifdef __cplusplus
609}
610#endif /* __cplusplus */
611
612#endif /* _IVI_LAYOUT_EXPORT_H_ */