blob: 4b4328ca4fd4cbd87c9d0572cd22bfeea51a96c5 [file] [log] [blame]
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +09001/*
2 * Copyright (C) 2013 DENSO CORPORATION
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of the copyright holders not be used in
9 * advertising or publicity pertaining to distribution of the software
10 * without specific, written prior permission. The copyright holders make
11 * no representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 */
22
23/**
24 * The ivi-layout library supports API set of controlling properties of
25 * surface and layer which groups surfaces. An unique ID whose type is integer
26 * is required to create surface and layer. With the unique ID, surface and
27 * layer are identified to control them. The API set consists of APIs to control
28 * properties of surface and layers about followings,
29 * - visibility.
30 * - opacity.
31 * - clipping (x,y,width,height).
32 * - position and size of it to be displayed.
33 * - orientation per 90 degree.
34 * - add or remove surfaces to a layer.
35 * - order of surfaces/layers in layer/screen to be displayed.
36 * - commit to apply property changes.
37 * - notifications of property change.
38 *
39 * Management of surfaces and layers grouping these surfaces are common
40 * way in In-Vehicle Infotainment system, which integrate several domains
41 * in one system. A layer is allocated to a domain in order to control
42 * application surfaces grouped to the layer all together.
43 *
44 * This API and ABI follow following specifications.
45 * http://projects.genivi.org/wayland-ivi-extension/layer-manager-apis
46 */
47
48#ifndef _IVI_LAYOUT_EXPORT_H_
49#define _IVI_LAYOUT_EXPORT_H_
50
51#ifdef __cplusplus
52extern "C" {
53#endif /* __cplusplus */
54
55#include "stdbool.h"
56#include "compositor.h"
57
58#define IVI_SUCCEEDED (0)
59#define IVI_FAILED (-1)
60
61struct ivi_layout_layer;
62struct ivi_layout_screen;
63struct ivi_layout_surface;
64
65struct ivi_layout_surface_properties
66{
67 wl_fixed_t opacity;
68 int32_t source_x;
69 int32_t source_y;
70 int32_t source_width;
71 int32_t source_height;
72 int32_t start_x;
73 int32_t start_y;
74 int32_t start_width;
75 int32_t start_height;
76 int32_t dest_x;
77 int32_t dest_y;
78 int32_t dest_width;
79 int32_t dest_height;
80 enum wl_output_transform orientation;
81 bool visibility;
82 int32_t transition_type;
83 uint32_t transition_duration;
84};
85
86struct ivi_layout_layer_properties
87{
88 wl_fixed_t opacity;
89 int32_t source_x;
90 int32_t source_y;
91 int32_t source_width;
92 int32_t source_height;
93 int32_t dest_x;
94 int32_t dest_y;
95 int32_t dest_width;
96 int32_t dest_height;
97 enum wl_output_transform orientation;
98 uint32_t visibility;
99 int32_t transition_type;
100 uint32_t transition_duration;
101 double start_alpha;
102 double end_alpha;
103 uint32_t is_fade_in;
104};
105
106enum ivi_layout_notification_mask {
107 IVI_NOTIFICATION_NONE = 0,
108 IVI_NOTIFICATION_OPACITY = (1 << 1),
109 IVI_NOTIFICATION_SOURCE_RECT = (1 << 2),
110 IVI_NOTIFICATION_DEST_RECT = (1 << 3),
111 IVI_NOTIFICATION_DIMENSION = (1 << 4),
112 IVI_NOTIFICATION_POSITION = (1 << 5),
113 IVI_NOTIFICATION_ORIENTATION = (1 << 6),
114 IVI_NOTIFICATION_VISIBILITY = (1 << 7),
115 IVI_NOTIFICATION_PIXELFORMAT = (1 << 8),
116 IVI_NOTIFICATION_ADD = (1 << 9),
117 IVI_NOTIFICATION_REMOVE = (1 << 10),
118 IVI_NOTIFICATION_CONFIGURE = (1 << 11),
119 IVI_NOTIFICATION_ALL = 0xFFFF
120};
121
122enum ivi_layout_transition_type{
123 IVI_LAYOUT_TRANSITION_NONE,
124 IVI_LAYOUT_TRANSITION_VIEW_DEFAULT,
125 IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY,
126 IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY,
127 IVI_LAYOUT_TRANSITION_LAYER_FADE,
128 IVI_LAYOUT_TRANSITION_LAYER_MOVE,
129 IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER,
130 IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE,
131 IVI_LAYOUT_TRANSITION_VIEW_RESIZE,
132 IVI_LAYOUT_TRANSITION_VIEW_FADE,
133 IVI_LAYOUT_TRANSITION_MAX,
134};
135
136typedef void (*layer_property_notification_func)(
137 struct ivi_layout_layer *ivilayer,
138 const struct ivi_layout_layer_properties *,
139 enum ivi_layout_notification_mask mask,
140 void *userdata);
141
142typedef void (*surface_property_notification_func)(
143 struct ivi_layout_surface *ivisurf,
144 const struct ivi_layout_surface_properties *,
145 enum ivi_layout_notification_mask mask,
146 void *userdata);
147
148typedef void (*layer_create_notification_func)(
149 struct ivi_layout_layer *ivilayer,
150 void *userdata);
151
152typedef void (*layer_remove_notification_func)(
153 struct ivi_layout_layer *ivilayer,
154 void *userdata);
155
156typedef void (*surface_create_notification_func)(
157 struct ivi_layout_surface *ivisurf,
158 void *userdata);
159
160typedef void (*surface_remove_notification_func)(
161 struct ivi_layout_surface *ivisurf,
162 void *userdata);
163
164typedef void (*surface_configure_notification_func)(
165 struct ivi_layout_surface *ivisurf,
166 void *userdata);
167
168typedef void (*ivi_controller_surface_content_callback)(
169 struct ivi_layout_surface *ivisurf,
170 int32_t content,
171 void *userdata);
172
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900173struct ivi_controller_interface {
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900174
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900175 /**
176 * \brief Commit all changes and execute all enqueued commands since
177 * last commit.
178 *
179 * \return IVI_SUCCEEDED if the method call was successful
180 * \return IVI_FAILED if the method call was failed
181 */
182 int32_t (*commit_changes)(void);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900183
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900184 /**
185 * surface controller interface
186 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900187
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900188 /**
189 * \brief register/unregister for notification when ivi_surface is created
190 */
191 int32_t (*add_notification_create_surface)(
192 surface_create_notification_func callback,
193 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900194
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900195 void (*remove_notification_create_surface)(
196 surface_create_notification_func callback,
197 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900198
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900199 /**
200 * \brief register/unregister for notification when ivi_surface is removed
201 */
202 int32_t (*add_notification_remove_surface)(
203 surface_remove_notification_func callback,
204 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900205
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900206 void (*remove_notification_remove_surface)(
207 surface_remove_notification_func callback,
208 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900209
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900210 /**
211 * \brief register/unregister for notification when ivi_surface is configured
212 */
213 int32_t (*add_notification_configure_surface)(
214 surface_configure_notification_func callback,
215 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900216
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900217 void (*remove_notification_configure_surface)(
218 surface_configure_notification_func callback,
219 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900220
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900221 /**
222 * \brief Get all ivi_surfaces which are currently registered and managed
223 * by the services
224 *
225 * \return IVI_SUCCEEDED if the method call was successful
226 * \return IVI_FAILED if the method call was failed
227 */
228 int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900229
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900230 /**
231 * \brief get id of ivi_surface from ivi_layout_surface
232 *
233 * \return id of ivi_surface
234 */
235 uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900236
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900237 /**
238 * \brief get ivi_layout_surface from id of ivi_surface
239 *
240 * \return (struct ivi_layout_surface *)
241 * if the method call was successful
242 * \return NULL if the method call was failed
243 */
244 struct ivi_layout_surface *
245 (*get_surface_from_id)(uint32_t id_surface);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900246
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900247 /**
248 * \brief get ivi_layout_surface_properties from ivisurf
249 *
250 * \return (struct ivi_layout_surface_properties *)
251 * if the method call was successful
252 * \return NULL if the method call was failed
253 */
254 const struct ivi_layout_surface_properties *
255 (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900256
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900257 /**
258 * \brief Get all Surfaces which are currently registered to a given
259 * layer and are managed by the services
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 (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
265 int32_t *pLength,
266 struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900267
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900268 /**
269 * \brief Set the visibility of a ivi_surface.
270 *
271 * If a surface is not visible it will not be rendered.
272 *
273 * \return IVI_SUCCEEDED if the method call was successful
274 * \return IVI_FAILED if the method call was failed
275 */
276 int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf,
277 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900278
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900279 /**
280 * \brief Get the visibility of a surface.
281 *
282 * If a surface is not visible it will not be rendered.
283 *
284 * \return true if surface is visible
285 * \return false if surface is invisible or the method call was failed
286 */
287 bool (*surface_get_visibility)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900288
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900289 /**
290 * \brief Set the opacity of a surface.
291 *
292 * \return IVI_SUCCEEDED if the method call was successful
293 * \return IVI_FAILED if the method call was failed
294 */
295 int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
296 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900297
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900298 /**
299 * \brief Get the opacity of a ivi_surface.
300 *
301 * \return opacity if the method call was successful
302 * \return wl_fixed_from_double(0.0) if the method call was failed
303 */
304 wl_fixed_t (*surface_get_opacity)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900305
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900306 /**
307 * \brief Set the area of a ivi_surface which should be used for the rendering.
308 *
309 * \return IVI_SUCCEEDED if the method call was successful
310 * \return IVI_FAILED if the method call was failed
311 */
312 int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
313 int32_t x, int32_t y,
314 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900315
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900316 /**
317 * \brief Set the destination area of a ivi_surface within a ivi_layer
318 * for rendering.
319 *
320 * The surface will be scaled to this rectangle for rendering.
321 *
322 * \return IVI_SUCCEEDED if the method call was successful
323 * \return IVI_FAILED if the method call was failed
324 */
325 int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf,
326 int32_t x, int32_t y,
327 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900328
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900329 /**
330 * \brief Sets the horizontal and vertical position of the surface.
331 *
332 * \return IVI_SUCCEEDED if the method call was successful
333 * \return IVI_FAILED if the method call was failed
334 */
335 int32_t (*surface_set_position)(struct ivi_layout_surface *ivisurf,
336 int32_t dest_x, int32_t dest_y);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900337
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900338 /**
339 * \brief Get the horizontal and vertical position of the surface.
340 *
341 * \return IVI_SUCCEEDED if the method call was successful
342 * \return IVI_FAILED if the method call was failed
343 */
344 int32_t (*surface_get_position)(struct ivi_layout_surface *ivisurf,
345 int32_t *dest_x, int32_t *dest_y);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900346
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900347 /**
348 * \brief Set the horizontal and vertical dimension of the surface.
349 *
350 * \return IVI_SUCCEEDED if the method call was successful
351 * \return IVI_FAILED if the method call was failed
352 */
353 int32_t (*surface_set_dimension)(struct ivi_layout_surface *ivisurf,
354 int32_t dest_width, int32_t dest_height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900355
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900356 /**
357 * \brief Get the horizontal and vertical dimension of the surface.
358 *
359 * \return IVI_SUCCEEDED if the method call was successful
360 * \return IVI_FAILED if the method call was failed
361 */
362 int32_t (*surface_get_dimension)(struct ivi_layout_surface *ivisurf,
363 int32_t *dest_width, int32_t *dest_height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900364
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900365 /**
366 * \brief Sets the orientation of a ivi_surface.
367 *
368 * \return IVI_SUCCEEDED if the method call was successful
369 * \return IVI_FAILED if the method call was failed
370 */
371 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
372 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900373
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900374 /**
375 * \brief Gets the orientation of a surface.
376 *
377 * \return (enum wl_output_transform)
378 * if the method call was successful
379 * \return WL_OUTPUT_TRANSFORM_NORMAL if the method call was failed
380 */
381 enum wl_output_transform
382 (*surface_get_orientation)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900383
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900384 /**
385 * \brief Set an observer callback for ivi_surface content status change.
386 *
387 * \return IVI_SUCCEEDED if the method call was successful
388 * \return IVI_FAILED if the method call was failed
389 */
390 int32_t (*surface_set_content_observer)(
391 struct ivi_layout_surface *ivisurf,
392 ivi_controller_surface_content_callback callback,
393 void* userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900394
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900395 /**
396 * \brief register for notification on property changes of ivi_surface
397 *
398 * \return IVI_SUCCEEDED if the method call was successful
399 * \return IVI_FAILED if the method call was failed
400 */
401 int32_t (*surface_add_notification)(struct ivi_layout_surface *ivisurf,
402 surface_property_notification_func callback,
403 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900404
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900405 /**
406 * \brief remove notification on property changes of ivi_surface
407 */
408 void (*surface_remove_notification)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900409
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900410 /**
411 * \brief get weston_surface of ivi_surface
412 */
413 struct weston_surface *
414 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900415
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900416 /**
417 * \brief set type of transition animation
418 */
419 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
420 enum ivi_layout_transition_type type,
421 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900422
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900423 /**
424 * \brief set duration of transition animation
425 */
426 int32_t (*surface_set_transition_duration)(
427 struct ivi_layout_surface *ivisurf,
428 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900429
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900430 /**
431 * layer controller interface
432 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900433
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900434 /**
435 * \brief register/unregister for notification when ivi_layer is created
436 */
437 int32_t (*add_notification_create_layer)(
438 layer_create_notification_func callback,
439 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900440
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900441 void (*remove_notification_create_layer)(
442 layer_create_notification_func callback,
443 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900444
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900445 /**
446 * \brief register/unregister for notification when ivi_layer is removed
447 */
448 int32_t (*add_notification_remove_layer)(
449 layer_remove_notification_func callback,
450 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900451
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900452 void (*remove_notification_remove_layer)(
453 layer_remove_notification_func callback,
454 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900455
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900456 /**
457 * \brief Create a ivi_layer which should be managed by the service
458 *
459 * \return (struct ivi_layout_layer *)
460 * if the method call was successful
461 * \return NULL if the method call was failed
462 */
463 struct ivi_layout_layer *
464 (*layer_create_with_dimension)(uint32_t id_layer,
465 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900466
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900467 /**
468 * \brief Removes a ivi_layer which is currently managed by the service
469 */
470 void (*layer_remove)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900471
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900472 /**
473 * \brief Get all ivi_layers which are currently registered and managed
474 * by the services
475 *
476 * \return IVI_SUCCEEDED if the method call was successful
477 * \return IVI_FAILED if the method call was failed
478 */
479 int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900480
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900481 /**
482 * \brief get id of ivi_layer from ivi_layout_layer
483 *
484 *
485 * \return id of ivi_layer
486 */
487 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900488
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900489 /**
490 * \brief get ivi_layout_layer from id of layer
491 *
492 * \return (struct ivi_layout_layer *)
493 * if the method call was successful
494 * \return NULL if the method call was failed
495 */
496 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900497
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900498 /**
499 * \brief Get the ivi_layer properties
500 *
501 * \return (const struct ivi_layout_layer_properties *)
502 * if the method call was successful
503 * \return NULL if the method call was failed
504 */
505 const struct ivi_layout_layer_properties *
506 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900507
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900508 /**
509 * \brief Get all ivi_ayers under the given ivi_surface
510 *
511 * \return IVI_SUCCEEDED if the method call was successful
512 * \return IVI_FAILED if the method call was failed
513 */
514 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
515 int32_t *pLength,
516 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900517
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900518 /**
519 * \brief Get all Layers of the given screen
520 *
521 * \return IVI_SUCCEEDED if the method call was successful
522 * \return IVI_FAILED if the method call was failed
523 */
524 int32_t (*get_layers_on_screen)(struct ivi_layout_screen *iviscrn,
525 int32_t *pLength,
526 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900527
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900528 /**
529 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
530 * the ivi_layer and its ivi_surfaces will not be rendered.
531 *
532 * \return IVI_SUCCEEDED if the method call was successful
533 * \return IVI_FAILED if the method call was failed
534 */
535 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
536 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900537
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900538 /**
539 * \brief Get the visibility of a layer. If a layer is not visible,
540 * the layer and its surfaces will not be rendered.
541 *
542 * \return true if layer is visible
543 * \return false if layer is invisible or the method call was failed
544 */
545 bool (*layer_get_visibility)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900546
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900547 /**
548 * \brief Set the opacity of a ivi_layer.
549 *
550 * \return IVI_SUCCEEDED if the method call was successful
551 * \return IVI_FAILED if the method call was failed
552 */
553 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
554 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900555
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900556 /**
557 * \brief Get the opacity of a ivi_layer.
558 *
559 * \return opacity if the method call was successful
560 * \return wl_fixed_from_double(0.0) if the method call was failed
561 */
562 wl_fixed_t (*layer_get_opacity)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900563
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900564 /**
565 * \brief Set the area of a ivi_layer which should be used for the rendering.
566 *
567 * Only this part will be visible.
568 *
569 * \return IVI_SUCCEEDED if the method call was successful
570 * \return IVI_FAILED if the method call was failed
571 */
572 int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
573 int32_t x, int32_t y,
574 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900575
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900576 /**
577 * \brief Set the destination area on the display for a ivi_layer.
578 *
579 * The ivi_layer will be scaled and positioned to this rectangle
580 * for rendering
581 *
582 * \return IVI_SUCCEEDED if the method call was successful
583 * \return IVI_FAILED if the method call was failed
584 */
585 int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
586 int32_t x, int32_t y,
587 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900588
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900589 /**
590 * \brief Sets the horizontal and vertical position of the ivi_layer.
591 *
592 * \return IVI_SUCCEEDED if the method call was successful
593 * \return IVI_FAILED if the method call was failed
594 */
595 int32_t (*layer_set_position)(struct ivi_layout_layer *ivilayer,
596 int32_t dest_x, int32_t dest_y);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900597
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900598 /**
599 * \brief Get the horizontal and vertical position of the ivi_layer.
600 *
601 * \return IVI_SUCCEEDED if the method call was successful
602 * \return IVI_FAILED if the method call was failed
603 */
604 int32_t (*layer_get_position)(struct ivi_layout_layer *ivilayer,
605 int32_t *dest_x, int32_t *dest_y);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900606
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900607 /**
608 * \brief Set the horizontal and vertical dimension of the layer.
609 *
610 * \return IVI_SUCCEEDED if the method call was successful
611 * \return IVI_FAILED if the method call was failed
612 */
613 int32_t (*layer_set_dimension)(struct ivi_layout_layer *ivilayer,
614 int32_t dest_width, int32_t dest_height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900615
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900616 /**
617 * \brief Get the horizontal and vertical dimension of the layer.
618 *
619 * \return IVI_SUCCEEDED if the method call was successful
620 * \return IVI_FAILED if the method call was failed
621 */
622 int32_t (*layer_get_dimension)(struct ivi_layout_layer *ivilayer,
623 int32_t *dest_width, int32_t *dest_height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900624
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900625 /**
626 * \brief Sets the orientation of a ivi_layer.
627 *
628 * \return IVI_SUCCEEDED if the method call was successful
629 * \return IVI_FAILED if the method call was failed
630 */
631 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
632 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900633
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900634 /**
635 * \brief Gets the orientation of a layer.
636 *
637 * \return (enum wl_output_transform)
638 * if the method call was successful
639 * \return WL_OUTPUT_TRANSFORM_NORMAL if the method call was failed
640 */
641 enum wl_output_transform
642 (*layer_get_orientation)(struct ivi_layout_layer *ivilayer);
643
644 /**
645 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
646 *
647 * \return IVI_SUCCEEDED if the method call was successful
648 * \return IVI_FAILED if the method call was failed
649 */
650 int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
651 struct ivi_layout_surface *addsurf);
652
653 /**
654 * \brief Removes a surface from a layer which is currently managed by the service
655 */
656 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
657 struct ivi_layout_surface *remsurf);
658
659 /**
660 * \brief Sets render order of ivi_surfaces within a ivi_layer
661 *
662 * \return IVI_SUCCEEDED if the method call was successful
663 * \return IVI_FAILED if the method call was failed
664 */
665 int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
666 struct ivi_layout_surface **pSurface,
667 int32_t number);
668
669 /**
670 * \brief register for notification on property changes of ivi_layer
671 *
672 * \return IVI_SUCCEEDED if the method call was successful
673 * \return IVI_FAILED if the method call was failed
674 */
675 int32_t (*layer_add_notification)(struct ivi_layout_layer *ivilayer,
676 layer_property_notification_func callback,
677 void *userdata);
678
679 /**
680 * \brief remove notification on property changes of ivi_layer
681 */
682 void (*layer_remove_notification)(struct ivi_layout_layer *ivilayer);
683
684 /**
685 * \brief set type of transition animation
686 */
687 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
688 enum ivi_layout_transition_type type,
689 uint32_t duration);
690
691 /**
692 * screen controller interface
693 */
694
695 /**
696 * \brief get ivi_layout_screen from id of ivi_screen
697 *
698 * \return (struct ivi_layout_screen *)
699 * if the method call was successful
700 * \return NULL if the method call was failed
701 */
702 struct ivi_layout_screen *
703 (*get_screen_from_id)(uint32_t id_screen);
704
705 /**
706 * \brief Get the screen resolution of a specific ivi_screen
707 *
708 * \return IVI_SUCCEEDED if the method call was successful
709 * \return IVI_FAILED if the method call was failed
710 */
711 int32_t (*get_screen_resolution)(struct ivi_layout_screen *iviscrn,
712 int32_t *pWidth,
713 int32_t *pHeight);
714
715 /**
716 * \brief Get the ivi_screens
717 *
718 * \return IVI_SUCCEEDED if the method call was successful
719 * \return IVI_FAILED if the method call was failed
720 */
721 int32_t (*get_screens)(int32_t *pLength, struct ivi_layout_screen ***ppArray);
722
723 /**
724 * \brief Get the ivi_screens under the given ivi_layer
725 *
726 * \return IVI_SUCCEEDED if the method call was successful
727 * \return IVI_FAILED if the method call was failed
728 */
729 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
730 int32_t *pLength,
731 struct ivi_layout_screen ***ppArray);
732
733 /**
734 * \brief Add a ivi_layer to a ivi_screen which is currently managed
735 * by the service
736 *
737 * \return IVI_SUCCEEDED if the method call was successful
738 * \return IVI_FAILED if the method call was failed
739 */
740 int32_t (*screen_add_layer)(struct ivi_layout_screen *iviscrn,
741 struct ivi_layout_layer *addlayer);
742
743 /**
744 * \brief Sets render order of ivi_layers on a ivi_screen
745 *
746 * \return IVI_SUCCEEDED if the method call was successful
747 * \return IVI_FAILED if the method call was failed
748 */
749 int32_t (*screen_set_render_order)(struct ivi_layout_screen *iviscrn,
750 struct ivi_layout_layer **pLayer,
751 const int32_t number);
752
753 /**
754 * \brief get weston_output from ivi_layout_screen.
755 *
756 * \return (struct weston_output *)
757 * if the method call was successful
758 * \return NULL if the method call was failed
759 */
760 struct weston_output *(*screen_get_output)(struct ivi_layout_screen *);
761
762
763 /**
764 * transision animation for layer
765 */
766 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
767 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
768 uint32_t is_fade_in,
769 double start_alpha, double end_alpha);
770
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900771 /**
772 * surface content dumping for debugging
773 */
774 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
775 int32_t *width, int32_t *height,
776 int32_t *stride);
777
778 int32_t (*surface_dump)(struct weston_surface *surface,
779 void *target, size_t size,
780 int32_t x, int32_t y,
781 int32_t width, int32_t height);
782
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900783};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900784
785#ifdef __cplusplus
786}
787#endif /* __cplusplus */
788
789#endif /* _IVI_LAYOUT_EXPORT_H_ */