blob: 54af286c3b3bc425a21d92106968210bb50c8013 [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 /**
283 * \brief Get the visibility of a surface.
284 *
285 * If a surface is not visible it will not be rendered.
286 *
287 * \return true if surface is visible
288 * \return false if surface is invisible or the method call was failed
289 */
290 bool (*surface_get_visibility)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900291
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900292 /**
293 * \brief Set the opacity of a surface.
294 *
295 * \return IVI_SUCCEEDED if the method call was successful
296 * \return IVI_FAILED if the method call was failed
297 */
298 int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
299 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900300
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900301 /**
302 * \brief Get the opacity of a ivi_surface.
303 *
304 * \return opacity if the method call was successful
305 * \return wl_fixed_from_double(0.0) if the method call was failed
306 */
307 wl_fixed_t (*surface_get_opacity)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900308
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900309 /**
310 * \brief Set the area of a ivi_surface which should be used for the rendering.
311 *
312 * \return IVI_SUCCEEDED if the method call was successful
313 * \return IVI_FAILED if the method call was failed
314 */
315 int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
316 int32_t x, int32_t y,
317 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900318
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900319 /**
320 * \brief Set the destination area of a ivi_surface within a ivi_layer
321 * for rendering.
322 *
323 * The surface will be scaled to this rectangle for rendering.
324 *
325 * \return IVI_SUCCEEDED if the method call was successful
326 * \return IVI_FAILED if the method call was failed
327 */
328 int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf,
329 int32_t x, int32_t y,
330 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900331
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900332 /**
333 * \brief Sets the horizontal and vertical position of the surface.
334 *
335 * \return IVI_SUCCEEDED if the method call was successful
336 * \return IVI_FAILED if the method call was failed
337 */
338 int32_t (*surface_set_position)(struct ivi_layout_surface *ivisurf,
339 int32_t dest_x, int32_t dest_y);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900340
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900341 /**
342 * \brief Get the horizontal and vertical position of the surface.
343 *
344 * \return IVI_SUCCEEDED if the method call was successful
345 * \return IVI_FAILED if the method call was failed
346 */
347 int32_t (*surface_get_position)(struct ivi_layout_surface *ivisurf,
348 int32_t *dest_x, int32_t *dest_y);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900349
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900350 /**
351 * \brief Set the horizontal and vertical dimension of the surface.
352 *
353 * \return IVI_SUCCEEDED if the method call was successful
354 * \return IVI_FAILED if the method call was failed
355 */
356 int32_t (*surface_set_dimension)(struct ivi_layout_surface *ivisurf,
357 int32_t dest_width, int32_t dest_height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900358
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900359 /**
360 * \brief Get the horizontal and vertical dimension of the surface.
361 *
362 * \return IVI_SUCCEEDED if the method call was successful
363 * \return IVI_FAILED if the method call was failed
364 */
365 int32_t (*surface_get_dimension)(struct ivi_layout_surface *ivisurf,
366 int32_t *dest_width, int32_t *dest_height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900367
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900368 /**
369 * \brief Sets the orientation of a ivi_surface.
370 *
371 * \return IVI_SUCCEEDED if the method call was successful
372 * \return IVI_FAILED if the method call was failed
373 */
374 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
375 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900376
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900377 /**
378 * \brief Gets the orientation of a surface.
379 *
380 * \return (enum wl_output_transform)
381 * if the method call was successful
382 * \return WL_OUTPUT_TRANSFORM_NORMAL if the method call was failed
383 */
384 enum wl_output_transform
385 (*surface_get_orientation)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900386
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900387 /**
388 * \brief Set an observer callback for ivi_surface content status change.
389 *
390 * \return IVI_SUCCEEDED if the method call was successful
391 * \return IVI_FAILED if the method call was failed
392 */
393 int32_t (*surface_set_content_observer)(
394 struct ivi_layout_surface *ivisurf,
395 ivi_controller_surface_content_callback callback,
396 void* userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900397
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900398 /**
399 * \brief register for notification on property changes of ivi_surface
400 *
401 * \return IVI_SUCCEEDED if the method call was successful
402 * \return IVI_FAILED if the method call was failed
403 */
404 int32_t (*surface_add_notification)(struct ivi_layout_surface *ivisurf,
405 surface_property_notification_func callback,
406 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900407
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900408 /**
409 * \brief remove notification on property changes of ivi_surface
410 */
411 void (*surface_remove_notification)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900412
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900413 /**
414 * \brief get weston_surface of ivi_surface
415 */
416 struct weston_surface *
417 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900418
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900419 /**
420 * \brief set type of transition animation
421 */
422 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
423 enum ivi_layout_transition_type type,
424 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900425
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900426 /**
427 * \brief set duration of transition animation
428 */
429 int32_t (*surface_set_transition_duration)(
430 struct ivi_layout_surface *ivisurf,
431 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900432
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900433 /**
434 * layer controller interface
435 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900436
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900437 /**
438 * \brief register/unregister for notification when ivi_layer is created
439 */
440 int32_t (*add_notification_create_layer)(
441 layer_create_notification_func callback,
442 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900443
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900444 void (*remove_notification_create_layer)(
445 layer_create_notification_func callback,
446 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900447
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900448 /**
449 * \brief register/unregister for notification when ivi_layer is removed
450 */
451 int32_t (*add_notification_remove_layer)(
452 layer_remove_notification_func callback,
453 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900454
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900455 void (*remove_notification_remove_layer)(
456 layer_remove_notification_func callback,
457 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900458
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900459 /**
460 * \brief Create a ivi_layer which should be managed by the service
461 *
462 * \return (struct ivi_layout_layer *)
463 * if the method call was successful
464 * \return NULL if the method call was failed
465 */
466 struct ivi_layout_layer *
467 (*layer_create_with_dimension)(uint32_t id_layer,
468 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900469
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900470 /**
471 * \brief Removes a ivi_layer which is currently managed by the service
472 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900473 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900474
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900475 /**
476 * \brief Get all ivi_layers which are currently registered and managed
477 * by the services
478 *
479 * \return IVI_SUCCEEDED if the method call was successful
480 * \return IVI_FAILED if the method call was failed
481 */
482 int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900483
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900484 /**
485 * \brief get id of ivi_layer from ivi_layout_layer
486 *
487 *
488 * \return id of ivi_layer
489 */
490 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900491
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900492 /**
493 * \brief get ivi_layout_layer from id of layer
494 *
495 * \return (struct ivi_layout_layer *)
496 * if the method call was successful
497 * \return NULL if the method call was failed
498 */
499 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900500
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900501 /**
502 * \brief Get the ivi_layer properties
503 *
504 * \return (const struct ivi_layout_layer_properties *)
505 * if the method call was successful
506 * \return NULL if the method call was failed
507 */
508 const struct ivi_layout_layer_properties *
509 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900510
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900511 /**
512 * \brief Get all ivi_ayers under the given ivi_surface
513 *
514 * \return IVI_SUCCEEDED if the method call was successful
515 * \return IVI_FAILED if the method call was failed
516 */
517 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
518 int32_t *pLength,
519 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900520
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900521 /**
522 * \brief Get all Layers of the given screen
523 *
524 * \return IVI_SUCCEEDED if the method call was successful
525 * \return IVI_FAILED if the method call was failed
526 */
527 int32_t (*get_layers_on_screen)(struct ivi_layout_screen *iviscrn,
528 int32_t *pLength,
529 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900530
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900531 /**
532 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
533 * the ivi_layer and its ivi_surfaces will not be rendered.
534 *
535 * \return IVI_SUCCEEDED if the method call was successful
536 * \return IVI_FAILED if the method call was failed
537 */
538 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
539 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900540
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900541 /**
542 * \brief Get the visibility of a layer. If a layer is not visible,
543 * the layer and its surfaces will not be rendered.
544 *
545 * \return true if layer is visible
546 * \return false if layer is invisible or the method call was failed
547 */
548 bool (*layer_get_visibility)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900549
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900550 /**
551 * \brief Set the opacity of a ivi_layer.
552 *
553 * \return IVI_SUCCEEDED if the method call was successful
554 * \return IVI_FAILED if the method call was failed
555 */
556 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
557 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900558
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900559 /**
560 * \brief Get the opacity of a ivi_layer.
561 *
562 * \return opacity if the method call was successful
563 * \return wl_fixed_from_double(0.0) if the method call was failed
564 */
565 wl_fixed_t (*layer_get_opacity)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900566
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900567 /**
568 * \brief Set the area of a ivi_layer which should be used for the rendering.
569 *
570 * Only this part will be visible.
571 *
572 * \return IVI_SUCCEEDED if the method call was successful
573 * \return IVI_FAILED if the method call was failed
574 */
575 int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
576 int32_t x, int32_t y,
577 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900578
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900579 /**
580 * \brief Set the destination area on the display for a ivi_layer.
581 *
582 * The ivi_layer will be scaled and positioned to this rectangle
583 * for rendering
584 *
585 * \return IVI_SUCCEEDED if the method call was successful
586 * \return IVI_FAILED if the method call was failed
587 */
588 int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
589 int32_t x, int32_t y,
590 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900591
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900592 /**
593 * \brief Sets the horizontal and vertical position of the ivi_layer.
594 *
595 * \return IVI_SUCCEEDED if the method call was successful
596 * \return IVI_FAILED if the method call was failed
597 */
598 int32_t (*layer_set_position)(struct ivi_layout_layer *ivilayer,
599 int32_t dest_x, int32_t dest_y);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900600
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900601 /**
602 * \brief Get the horizontal and vertical position of the ivi_layer.
603 *
604 * \return IVI_SUCCEEDED if the method call was successful
605 * \return IVI_FAILED if the method call was failed
606 */
607 int32_t (*layer_get_position)(struct ivi_layout_layer *ivilayer,
608 int32_t *dest_x, int32_t *dest_y);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900609
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900610 /**
611 * \brief Set the horizontal and vertical dimension of the layer.
612 *
613 * \return IVI_SUCCEEDED if the method call was successful
614 * \return IVI_FAILED if the method call was failed
615 */
616 int32_t (*layer_set_dimension)(struct ivi_layout_layer *ivilayer,
617 int32_t dest_width, int32_t dest_height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900618
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900619 /**
620 * \brief Get the horizontal and vertical dimension of the layer.
621 *
622 * \return IVI_SUCCEEDED if the method call was successful
623 * \return IVI_FAILED if the method call was failed
624 */
625 int32_t (*layer_get_dimension)(struct ivi_layout_layer *ivilayer,
626 int32_t *dest_width, int32_t *dest_height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900627
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900628 /**
629 * \brief Sets the orientation of a ivi_layer.
630 *
631 * \return IVI_SUCCEEDED if the method call was successful
632 * \return IVI_FAILED if the method call was failed
633 */
634 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
635 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900636
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900637 /**
638 * \brief Gets the orientation of a layer.
639 *
640 * \return (enum wl_output_transform)
641 * if the method call was successful
642 * \return WL_OUTPUT_TRANSFORM_NORMAL if the method call was failed
643 */
644 enum wl_output_transform
645 (*layer_get_orientation)(struct ivi_layout_layer *ivilayer);
646
647 /**
648 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
649 *
650 * \return IVI_SUCCEEDED if the method call was successful
651 * \return IVI_FAILED if the method call was failed
652 */
653 int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
654 struct ivi_layout_surface *addsurf);
655
656 /**
657 * \brief Removes a surface from a layer which is currently managed by the service
658 */
659 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
660 struct ivi_layout_surface *remsurf);
661
662 /**
663 * \brief Sets render order of ivi_surfaces within a ivi_layer
664 *
665 * \return IVI_SUCCEEDED if the method call was successful
666 * \return IVI_FAILED if the method call was failed
667 */
668 int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
669 struct ivi_layout_surface **pSurface,
670 int32_t number);
671
672 /**
673 * \brief register for notification on property changes of ivi_layer
674 *
675 * \return IVI_SUCCEEDED if the method call was successful
676 * \return IVI_FAILED if the method call was failed
677 */
678 int32_t (*layer_add_notification)(struct ivi_layout_layer *ivilayer,
679 layer_property_notification_func callback,
680 void *userdata);
681
682 /**
683 * \brief remove notification on property changes of ivi_layer
684 */
685 void (*layer_remove_notification)(struct ivi_layout_layer *ivilayer);
686
687 /**
688 * \brief set type of transition animation
689 */
690 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
691 enum ivi_layout_transition_type type,
692 uint32_t duration);
693
694 /**
695 * screen controller interface
696 */
697
698 /**
699 * \brief get ivi_layout_screen from id of ivi_screen
700 *
701 * \return (struct ivi_layout_screen *)
702 * if the method call was successful
703 * \return NULL if the method call was failed
704 */
705 struct ivi_layout_screen *
706 (*get_screen_from_id)(uint32_t id_screen);
707
708 /**
709 * \brief Get the screen resolution of a specific ivi_screen
710 *
711 * \return IVI_SUCCEEDED if the method call was successful
712 * \return IVI_FAILED if the method call was failed
713 */
714 int32_t (*get_screen_resolution)(struct ivi_layout_screen *iviscrn,
715 int32_t *pWidth,
716 int32_t *pHeight);
717
718 /**
719 * \brief Get the ivi_screens
720 *
721 * \return IVI_SUCCEEDED if the method call was successful
722 * \return IVI_FAILED if the method call was failed
723 */
724 int32_t (*get_screens)(int32_t *pLength, struct ivi_layout_screen ***ppArray);
725
726 /**
727 * \brief Get the ivi_screens under the given ivi_layer
728 *
729 * \return IVI_SUCCEEDED if the method call was successful
730 * \return IVI_FAILED if the method call was failed
731 */
732 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
733 int32_t *pLength,
734 struct ivi_layout_screen ***ppArray);
735
736 /**
737 * \brief Add a ivi_layer to a ivi_screen which is currently managed
738 * by the service
739 *
740 * \return IVI_SUCCEEDED if the method call was successful
741 * \return IVI_FAILED if the method call was failed
742 */
743 int32_t (*screen_add_layer)(struct ivi_layout_screen *iviscrn,
744 struct ivi_layout_layer *addlayer);
745
746 /**
747 * \brief Sets render order of ivi_layers on a ivi_screen
748 *
749 * \return IVI_SUCCEEDED if the method call was successful
750 * \return IVI_FAILED if the method call was failed
751 */
752 int32_t (*screen_set_render_order)(struct ivi_layout_screen *iviscrn,
753 struct ivi_layout_layer **pLayer,
754 const int32_t number);
755
756 /**
757 * \brief get weston_output from ivi_layout_screen.
758 *
759 * \return (struct weston_output *)
760 * if the method call was successful
761 * \return NULL if the method call was failed
762 */
763 struct weston_output *(*screen_get_output)(struct ivi_layout_screen *);
764
765
766 /**
767 * transision animation for layer
768 */
769 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
770 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
771 uint32_t is_fade_in,
772 double start_alpha, double end_alpha);
773
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900774 /**
775 * surface content dumping for debugging
776 */
777 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
778 int32_t *width, int32_t *height,
779 int32_t *stride);
780
781 int32_t (*surface_dump)(struct weston_surface *surface,
782 void *target, size_t size,
783 int32_t x, int32_t y,
784 int32_t width, int32_t height);
785
Nobuhiko Tanibata82051702015-06-22 15:31:26 +0900786 /**
787 * remove notification by callback on property changes of ivi_surface
788 */
789 void (*surface_remove_notification_by_callback)(struct ivi_layout_surface *ivisurf,
790 surface_property_notification_func callback,
791 void *userdata);
792
Nobuhiko Tanibatadb8efd12015-06-22 15:31:39 +0900793 /**
794 * \brief remove notification by callback on property changes of ivi_layer
795 */
796 void (*layer_remove_notification_by_callback)(struct ivi_layout_layer *ivilayer,
797 layer_property_notification_func callback,
798 void *userdata);
799
Nobuhiko Tanibata4d0116e2015-06-22 15:31:57 +0900800 /**
801 * \brief get id of ivi_screen from ivi_layout_screen
802 *
803 *
804 * \return id of ivi_screen
805 */
806 uint32_t (*get_id_of_screen)(struct ivi_layout_screen *iviscrn);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900807};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900808
809#ifdef __cplusplus
810}
811#endif /* __cplusplus */
812
813#endif /* _IVI_LAYOUT_EXPORT_H_ */