blob: dade418a5dae6471cec7db6a25c7a39d33de11f4 [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;
87};
88
89struct ivi_layout_layer_properties
90{
91 wl_fixed_t opacity;
92 int32_t source_x;
93 int32_t source_y;
94 int32_t source_width;
95 int32_t source_height;
96 int32_t dest_x;
97 int32_t dest_y;
98 int32_t dest_width;
99 int32_t dest_height;
100 enum wl_output_transform orientation;
101 uint32_t visibility;
102 int32_t transition_type;
103 uint32_t transition_duration;
104 double start_alpha;
105 double end_alpha;
106 uint32_t is_fade_in;
107};
108
109enum ivi_layout_notification_mask {
110 IVI_NOTIFICATION_NONE = 0,
111 IVI_NOTIFICATION_OPACITY = (1 << 1),
112 IVI_NOTIFICATION_SOURCE_RECT = (1 << 2),
113 IVI_NOTIFICATION_DEST_RECT = (1 << 3),
114 IVI_NOTIFICATION_DIMENSION = (1 << 4),
115 IVI_NOTIFICATION_POSITION = (1 << 5),
116 IVI_NOTIFICATION_ORIENTATION = (1 << 6),
117 IVI_NOTIFICATION_VISIBILITY = (1 << 7),
118 IVI_NOTIFICATION_PIXELFORMAT = (1 << 8),
119 IVI_NOTIFICATION_ADD = (1 << 9),
120 IVI_NOTIFICATION_REMOVE = (1 << 10),
121 IVI_NOTIFICATION_CONFIGURE = (1 << 11),
122 IVI_NOTIFICATION_ALL = 0xFFFF
123};
124
125enum ivi_layout_transition_type{
126 IVI_LAYOUT_TRANSITION_NONE,
127 IVI_LAYOUT_TRANSITION_VIEW_DEFAULT,
128 IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY,
129 IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY,
130 IVI_LAYOUT_TRANSITION_LAYER_FADE,
131 IVI_LAYOUT_TRANSITION_LAYER_MOVE,
132 IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER,
133 IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE,
134 IVI_LAYOUT_TRANSITION_VIEW_RESIZE,
135 IVI_LAYOUT_TRANSITION_VIEW_FADE,
136 IVI_LAYOUT_TRANSITION_MAX,
137};
138
139typedef void (*layer_property_notification_func)(
140 struct ivi_layout_layer *ivilayer,
141 const struct ivi_layout_layer_properties *,
142 enum ivi_layout_notification_mask mask,
143 void *userdata);
144
145typedef void (*surface_property_notification_func)(
146 struct ivi_layout_surface *ivisurf,
147 const struct ivi_layout_surface_properties *,
148 enum ivi_layout_notification_mask mask,
149 void *userdata);
150
151typedef void (*layer_create_notification_func)(
152 struct ivi_layout_layer *ivilayer,
153 void *userdata);
154
155typedef void (*layer_remove_notification_func)(
156 struct ivi_layout_layer *ivilayer,
157 void *userdata);
158
159typedef void (*surface_create_notification_func)(
160 struct ivi_layout_surface *ivisurf,
161 void *userdata);
162
163typedef void (*surface_remove_notification_func)(
164 struct ivi_layout_surface *ivisurf,
165 void *userdata);
166
167typedef void (*surface_configure_notification_func)(
168 struct ivi_layout_surface *ivisurf,
169 void *userdata);
170
171typedef void (*ivi_controller_surface_content_callback)(
172 struct ivi_layout_surface *ivisurf,
173 int32_t content,
174 void *userdata);
175
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000176struct ivi_layout_interface {
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900177
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900178 /**
179 * \brief Commit all changes and execute all enqueued commands since
180 * last commit.
181 *
182 * \return IVI_SUCCEEDED if the method call was successful
183 * \return IVI_FAILED if the method call was failed
184 */
185 int32_t (*commit_changes)(void);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900186
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900187 /**
188 * surface controller interface
189 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900190
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900191 /**
192 * \brief register/unregister for notification when ivi_surface is created
193 */
194 int32_t (*add_notification_create_surface)(
195 surface_create_notification_func callback,
196 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900197
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900198 void (*remove_notification_create_surface)(
199 surface_create_notification_func callback,
200 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900201
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900202 /**
203 * \brief register/unregister for notification when ivi_surface is removed
204 */
205 int32_t (*add_notification_remove_surface)(
206 surface_remove_notification_func callback,
207 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900208
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900209 void (*remove_notification_remove_surface)(
210 surface_remove_notification_func callback,
211 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900212
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900213 /**
214 * \brief register/unregister for notification when ivi_surface is configured
215 */
216 int32_t (*add_notification_configure_surface)(
217 surface_configure_notification_func callback,
218 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900219
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900220 void (*remove_notification_configure_surface)(
221 surface_configure_notification_func callback,
222 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900223
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900224 /**
225 * \brief Get all ivi_surfaces which are currently registered and managed
226 * 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)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900232
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900233 /**
234 * \brief get id of ivi_surface from ivi_layout_surface
235 *
236 * \return id of ivi_surface
237 */
238 uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900239
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900240 /**
241 * \brief get ivi_layout_surface from id of ivi_surface
242 *
243 * \return (struct ivi_layout_surface *)
244 * if the method call was successful
245 * \return NULL if the method call was failed
246 */
247 struct ivi_layout_surface *
248 (*get_surface_from_id)(uint32_t id_surface);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900249
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900250 /**
251 * \brief get ivi_layout_surface_properties from ivisurf
252 *
253 * \return (struct ivi_layout_surface_properties *)
254 * if the method call was successful
255 * \return NULL if the method call was failed
256 */
257 const struct ivi_layout_surface_properties *
258 (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900259
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900260 /**
261 * \brief Get all Surfaces which are currently registered to a given
262 * layer and are managed by the services
263 *
264 * \return IVI_SUCCEEDED if the method call was successful
265 * \return IVI_FAILED if the method call was failed
266 */
267 int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
268 int32_t *pLength,
269 struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900270
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900271 /**
272 * \brief Set the visibility of a ivi_surface.
273 *
274 * If a surface is not visible it will not be rendered.
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_visibility)(struct ivi_layout_surface *ivisurf,
280 bool newVisibility);
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 opacity of a surface.
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_opacity)(struct ivi_layout_surface *ivisurf,
289 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900290
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900291 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900292 * \brief Set the area of a ivi_surface which should be used for the rendering.
293 *
294 * \return IVI_SUCCEEDED if the method call was successful
295 * \return IVI_FAILED if the method call was failed
296 */
297 int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
298 int32_t x, int32_t y,
299 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900300
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900301 /**
302 * \brief Set the destination area of a ivi_surface within a ivi_layer
303 * for rendering.
304 *
305 * The surface will be scaled to this rectangle for rendering.
306 *
307 * \return IVI_SUCCEEDED if the method call was successful
308 * \return IVI_FAILED if the method call was failed
309 */
310 int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf,
311 int32_t x, int32_t y,
312 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900313
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900314 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900315 * \brief Sets the orientation of a ivi_surface.
316 *
317 * \return IVI_SUCCEEDED if the method call was successful
318 * \return IVI_FAILED if the method call was failed
319 */
320 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
321 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900322
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900323 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900324 * \brief register for notification on property changes of ivi_surface
325 *
326 * \return IVI_SUCCEEDED if the method call was successful
327 * \return IVI_FAILED if the method call was failed
328 */
329 int32_t (*surface_add_notification)(struct ivi_layout_surface *ivisurf,
330 surface_property_notification_func callback,
331 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900332
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900333 /**
334 * \brief remove notification on property changes of ivi_surface
335 */
336 void (*surface_remove_notification)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900337
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900338 /**
339 * \brief get weston_surface of ivi_surface
340 */
341 struct weston_surface *
342 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900343
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900344 /**
345 * \brief set type of transition animation
346 */
347 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
348 enum ivi_layout_transition_type type,
349 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900350
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900351 /**
352 * \brief set duration of transition animation
353 */
354 int32_t (*surface_set_transition_duration)(
355 struct ivi_layout_surface *ivisurf,
356 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900357
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900358 /**
359 * layer controller interface
360 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900361
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900362 /**
363 * \brief register/unregister for notification when ivi_layer is created
364 */
365 int32_t (*add_notification_create_layer)(
366 layer_create_notification_func callback,
367 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900368
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900369 void (*remove_notification_create_layer)(
370 layer_create_notification_func callback,
371 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900372
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900373 /**
374 * \brief register/unregister for notification when ivi_layer is removed
375 */
376 int32_t (*add_notification_remove_layer)(
377 layer_remove_notification_func callback,
378 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900379
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900380 void (*remove_notification_remove_layer)(
381 layer_remove_notification_func callback,
382 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900383
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900384 /**
385 * \brief Create a ivi_layer which should be managed by the service
386 *
387 * \return (struct ivi_layout_layer *)
388 * if the method call was successful
389 * \return NULL if the method call was failed
390 */
391 struct ivi_layout_layer *
392 (*layer_create_with_dimension)(uint32_t id_layer,
393 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900394
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900395 /**
396 * \brief Removes a ivi_layer which is currently managed by the service
397 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900398 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900399
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900400 /**
401 * \brief Get all ivi_layers which are currently registered and managed
402 * by the services
403 *
404 * \return IVI_SUCCEEDED if the method call was successful
405 * \return IVI_FAILED if the method call was failed
406 */
407 int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900408
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900409 /**
410 * \brief get id of ivi_layer from ivi_layout_layer
411 *
412 *
413 * \return id of ivi_layer
414 */
415 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900416
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900417 /**
418 * \brief get ivi_layout_layer from id of layer
419 *
420 * \return (struct ivi_layout_layer *)
421 * if the method call was successful
422 * \return NULL if the method call was failed
423 */
424 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900425
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900426 /**
427 * \brief Get the ivi_layer properties
428 *
429 * \return (const struct ivi_layout_layer_properties *)
430 * if the method call was successful
431 * \return NULL if the method call was failed
432 */
433 const struct ivi_layout_layer_properties *
434 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900435
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900436 /**
437 * \brief Get all ivi_ayers under the given ivi_surface
438 *
439 * \return IVI_SUCCEEDED if the method call was successful
440 * \return IVI_FAILED if the method call was failed
441 */
442 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
443 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 Get all Layers of the given screen
448 *
449 * \return IVI_SUCCEEDED if the method call was successful
450 * \return IVI_FAILED if the method call was failed
451 */
452 int32_t (*get_layers_on_screen)(struct ivi_layout_screen *iviscrn,
453 int32_t *pLength,
454 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900455
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900456 /**
457 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
458 * the ivi_layer and its ivi_surfaces will not be rendered.
459 *
460 * \return IVI_SUCCEEDED if the method call was successful
461 * \return IVI_FAILED if the method call was failed
462 */
463 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
464 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900465
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900466 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900467 * \brief Set the opacity of a ivi_layer.
468 *
469 * \return IVI_SUCCEEDED if the method call was successful
470 * \return IVI_FAILED if the method call was failed
471 */
472 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
473 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900474
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900475 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900476 * \brief Set the area of a ivi_layer which should be used for the rendering.
477 *
478 * Only this part will be visible.
479 *
480 * \return IVI_SUCCEEDED if the method call was successful
481 * \return IVI_FAILED if the method call was failed
482 */
483 int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
484 int32_t x, int32_t y,
485 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900486
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900487 /**
488 * \brief Set the destination area on the display for a ivi_layer.
489 *
490 * The ivi_layer will be scaled and positioned to this rectangle
491 * for rendering
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_destination_rectangle)(struct ivi_layout_layer *ivilayer,
497 int32_t x, int32_t y,
498 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900499
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900500 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900501 * \brief Sets the orientation of a ivi_layer.
502 *
503 * \return IVI_SUCCEEDED if the method call was successful
504 * \return IVI_FAILED if the method call was failed
505 */
506 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
507 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900508
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900509 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900510 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
511 *
512 * \return IVI_SUCCEEDED if the method call was successful
513 * \return IVI_FAILED if the method call was failed
514 */
515 int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
516 struct ivi_layout_surface *addsurf);
517
518 /**
519 * \brief Removes a surface from a layer which is currently managed by the service
520 */
521 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
522 struct ivi_layout_surface *remsurf);
523
524 /**
525 * \brief Sets render order of ivi_surfaces within a 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_set_render_order)(struct ivi_layout_layer *ivilayer,
531 struct ivi_layout_surface **pSurface,
532 int32_t number);
533
534 /**
535 * \brief register for notification on property changes of ivi_layer
536 *
537 * \return IVI_SUCCEEDED if the method call was successful
538 * \return IVI_FAILED if the method call was failed
539 */
540 int32_t (*layer_add_notification)(struct ivi_layout_layer *ivilayer,
541 layer_property_notification_func callback,
542 void *userdata);
543
544 /**
545 * \brief remove notification on property changes of ivi_layer
546 */
547 void (*layer_remove_notification)(struct ivi_layout_layer *ivilayer);
548
549 /**
550 * \brief set type of transition animation
551 */
552 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
553 enum ivi_layout_transition_type type,
554 uint32_t duration);
555
556 /**
557 * screen controller interface
558 */
559
560 /**
561 * \brief get ivi_layout_screen from id of ivi_screen
562 *
563 * \return (struct ivi_layout_screen *)
564 * if the method call was successful
565 * \return NULL if the method call was failed
566 */
567 struct ivi_layout_screen *
568 (*get_screen_from_id)(uint32_t id_screen);
569
570 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900571 * \brief Get the ivi_screens under the given ivi_layer
572 *
573 * \return IVI_SUCCEEDED if the method call was successful
574 * \return IVI_FAILED if the method call was failed
575 */
576 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
577 int32_t *pLength,
578 struct ivi_layout_screen ***ppArray);
579
580 /**
581 * \brief Add a ivi_layer to a ivi_screen which is currently managed
582 * by the service
583 *
584 * \return IVI_SUCCEEDED if the method call was successful
585 * \return IVI_FAILED if the method call was failed
586 */
587 int32_t (*screen_add_layer)(struct ivi_layout_screen *iviscrn,
588 struct ivi_layout_layer *addlayer);
589
590 /**
591 * \brief Sets render order of ivi_layers on a ivi_screen
592 *
593 * \return IVI_SUCCEEDED if the method call was successful
594 * \return IVI_FAILED if the method call was failed
595 */
596 int32_t (*screen_set_render_order)(struct ivi_layout_screen *iviscrn,
597 struct ivi_layout_layer **pLayer,
598 const int32_t number);
599
600 /**
601 * \brief get weston_output from ivi_layout_screen.
602 *
603 * \return (struct weston_output *)
604 * if the method call was successful
605 * \return NULL if the method call was failed
606 */
607 struct weston_output *(*screen_get_output)(struct ivi_layout_screen *);
608
609
610 /**
611 * transision animation for layer
612 */
613 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
614 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
615 uint32_t is_fade_in,
616 double start_alpha, double end_alpha);
617
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900618 /**
619 * surface content dumping for debugging
620 */
621 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
622 int32_t *width, int32_t *height,
623 int32_t *stride);
624
625 int32_t (*surface_dump)(struct weston_surface *surface,
626 void *target, size_t size,
627 int32_t x, int32_t y,
628 int32_t width, int32_t height);
629
Nobuhiko Tanibata82051702015-06-22 15:31:26 +0900630 /**
631 * remove notification by callback on property changes of ivi_surface
632 */
633 void (*surface_remove_notification_by_callback)(struct ivi_layout_surface *ivisurf,
634 surface_property_notification_func callback,
635 void *userdata);
636
Nobuhiko Tanibatadb8efd12015-06-22 15:31:39 +0900637 /**
638 * \brief remove notification by callback on property changes of ivi_layer
639 */
640 void (*layer_remove_notification_by_callback)(struct ivi_layout_layer *ivilayer,
641 layer_property_notification_func callback,
642 void *userdata);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900643};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900644
645#ifdef __cplusplus
646}
647#endif /* __cplusplus */
648
649#endif /* _IVI_LAYOUT_EXPORT_H_ */