blob: d7a880cae0ddece19e680109301bc51fbebc1a28 [file] [log] [blame]
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +09001/*
2 * Copyright (C) 2013 DENSO CORPORATION
3 *
Bryce Harringtonaf637c22015-06-11 12:55:55 -07004 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090011 *
Bryce Harringtonaf637c22015-06-11 12:55:55 -070012 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial
14 * portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090024 */
25
26/**
27 * The ivi-layout library supports API set of controlling properties of
28 * surface and layer which groups surfaces. An unique ID whose type is integer
29 * is required to create surface and layer. With the unique ID, surface and
30 * layer are identified to control them. The API set consists of APIs to control
31 * properties of surface and layers about followings,
32 * - visibility.
33 * - opacity.
34 * - clipping (x,y,width,height).
35 * - position and size of it to be displayed.
36 * - orientation per 90 degree.
37 * - add or remove surfaces to a layer.
38 * - order of surfaces/layers in layer/screen to be displayed.
39 * - commit to apply property changes.
40 * - notifications of property change.
41 *
42 * Management of surfaces and layers grouping these surfaces are common
43 * way in In-Vehicle Infotainment system, which integrate several domains
44 * in one system. A layer is allocated to a domain in order to control
45 * application surfaces grouped to the layer all together.
46 *
47 * This API and ABI follow following specifications.
48 * http://projects.genivi.org/wayland-ivi-extension/layer-manager-apis
49 */
50
51#ifndef _IVI_LAYOUT_EXPORT_H_
52#define _IVI_LAYOUT_EXPORT_H_
53
54#ifdef __cplusplus
55extern "C" {
56#endif /* __cplusplus */
57
58#include "stdbool.h"
59#include "compositor.h"
60
61#define IVI_SUCCEEDED (0)
62#define IVI_FAILED (-1)
63
64struct ivi_layout_layer;
65struct ivi_layout_screen;
66struct ivi_layout_surface;
67
68struct ivi_layout_surface_properties
69{
70 wl_fixed_t opacity;
71 int32_t source_x;
72 int32_t source_y;
73 int32_t source_width;
74 int32_t source_height;
75 int32_t start_x;
76 int32_t start_y;
77 int32_t start_width;
78 int32_t start_height;
79 int32_t dest_x;
80 int32_t dest_y;
81 int32_t dest_width;
82 int32_t dest_height;
83 enum wl_output_transform orientation;
84 bool visibility;
85 int32_t transition_type;
86 uint32_t transition_duration;
Ucan, Emre (ADITG/SW1)0bd29b62016-03-31 11:08:52 +000087 uint32_t event_mask;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090088};
89
90struct ivi_layout_layer_properties
91{
92 wl_fixed_t opacity;
93 int32_t source_x;
94 int32_t source_y;
95 int32_t source_width;
96 int32_t source_height;
97 int32_t dest_x;
98 int32_t dest_y;
99 int32_t dest_width;
100 int32_t dest_height;
101 enum wl_output_transform orientation;
102 uint32_t visibility;
103 int32_t transition_type;
104 uint32_t transition_duration;
105 double start_alpha;
106 double end_alpha;
107 uint32_t is_fade_in;
Ucan, Emre (ADITG/SW1)0bd29b62016-03-31 11:08:52 +0000108 uint32_t event_mask;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900109};
110
111enum ivi_layout_notification_mask {
112 IVI_NOTIFICATION_NONE = 0,
113 IVI_NOTIFICATION_OPACITY = (1 << 1),
114 IVI_NOTIFICATION_SOURCE_RECT = (1 << 2),
115 IVI_NOTIFICATION_DEST_RECT = (1 << 3),
116 IVI_NOTIFICATION_DIMENSION = (1 << 4),
117 IVI_NOTIFICATION_POSITION = (1 << 5),
118 IVI_NOTIFICATION_ORIENTATION = (1 << 6),
119 IVI_NOTIFICATION_VISIBILITY = (1 << 7),
120 IVI_NOTIFICATION_PIXELFORMAT = (1 << 8),
121 IVI_NOTIFICATION_ADD = (1 << 9),
122 IVI_NOTIFICATION_REMOVE = (1 << 10),
123 IVI_NOTIFICATION_CONFIGURE = (1 << 11),
124 IVI_NOTIFICATION_ALL = 0xFFFF
125};
126
127enum ivi_layout_transition_type{
128 IVI_LAYOUT_TRANSITION_NONE,
129 IVI_LAYOUT_TRANSITION_VIEW_DEFAULT,
130 IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY,
131 IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY,
132 IVI_LAYOUT_TRANSITION_LAYER_FADE,
133 IVI_LAYOUT_TRANSITION_LAYER_MOVE,
134 IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER,
135 IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE,
136 IVI_LAYOUT_TRANSITION_VIEW_RESIZE,
137 IVI_LAYOUT_TRANSITION_VIEW_FADE,
138 IVI_LAYOUT_TRANSITION_MAX,
139};
140
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900141typedef void (*layer_create_notification_func)(
142 struct ivi_layout_layer *ivilayer,
143 void *userdata);
144
145typedef void (*layer_remove_notification_func)(
146 struct ivi_layout_layer *ivilayer,
147 void *userdata);
148
149typedef void (*surface_create_notification_func)(
150 struct ivi_layout_surface *ivisurf,
151 void *userdata);
152
153typedef void (*surface_remove_notification_func)(
154 struct ivi_layout_surface *ivisurf,
155 void *userdata);
156
157typedef void (*surface_configure_notification_func)(
158 struct ivi_layout_surface *ivisurf,
159 void *userdata);
160
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000161struct ivi_layout_interface {
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900162
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900163 /**
164 * \brief Commit all changes and execute all enqueued commands since
165 * last commit.
166 *
167 * \return IVI_SUCCEEDED if the method call was successful
168 * \return IVI_FAILED if the method call was failed
169 */
170 int32_t (*commit_changes)(void);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900171
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900172 /**
173 * surface controller interface
174 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900175
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900176 /**
177 * \brief register/unregister for notification when ivi_surface is created
178 */
179 int32_t (*add_notification_create_surface)(
180 surface_create_notification_func callback,
181 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900182
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900183 void (*remove_notification_create_surface)(
184 surface_create_notification_func callback,
185 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900186
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900187 /**
188 * \brief register/unregister for notification when ivi_surface is removed
189 */
190 int32_t (*add_notification_remove_surface)(
191 surface_remove_notification_func callback,
192 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900193
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900194 void (*remove_notification_remove_surface)(
195 surface_remove_notification_func callback,
196 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900197
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900198 /**
199 * \brief register/unregister for notification when ivi_surface is configured
200 */
201 int32_t (*add_notification_configure_surface)(
202 surface_configure_notification_func callback,
203 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900204
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900205 void (*remove_notification_configure_surface)(
206 surface_configure_notification_func callback,
207 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900208
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900209 /**
210 * \brief Get all ivi_surfaces which are currently registered and managed
211 * by the services
212 *
213 * \return IVI_SUCCEEDED if the method call was successful
214 * \return IVI_FAILED if the method call was failed
215 */
216 int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900217
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900218 /**
219 * \brief get id of ivi_surface from ivi_layout_surface
220 *
221 * \return id of ivi_surface
222 */
223 uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900224
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900225 /**
226 * \brief get ivi_layout_surface from id of ivi_surface
227 *
228 * \return (struct ivi_layout_surface *)
229 * if the method call was successful
230 * \return NULL if the method call was failed
231 */
232 struct ivi_layout_surface *
233 (*get_surface_from_id)(uint32_t id_surface);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900234
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900235 /**
236 * \brief get ivi_layout_surface_properties from ivisurf
237 *
238 * \return (struct ivi_layout_surface_properties *)
239 * if the method call was successful
240 * \return NULL if the method call was failed
241 */
242 const struct ivi_layout_surface_properties *
243 (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900244
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900245 /**
246 * \brief Get all Surfaces which are currently registered to a given
247 * layer and are managed by the services
248 *
249 * \return IVI_SUCCEEDED if the method call was successful
250 * \return IVI_FAILED if the method call was failed
251 */
252 int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
253 int32_t *pLength,
254 struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900255
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900256 /**
257 * \brief Set the visibility of a ivi_surface.
258 *
259 * If a surface is not visible it will not be rendered.
260 *
261 * \return IVI_SUCCEEDED if the method call was successful
262 * \return IVI_FAILED if the method call was failed
263 */
264 int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf,
265 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900266
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900267 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900268 * \brief Set the opacity of a surface.
269 *
270 * \return IVI_SUCCEEDED if the method call was successful
271 * \return IVI_FAILED if the method call was failed
272 */
273 int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
274 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900275
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900276 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900277 * \brief Set the area of a ivi_surface which should be used for the rendering.
278 *
279 * \return IVI_SUCCEEDED if the method call was successful
280 * \return IVI_FAILED if the method call was failed
281 */
282 int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
283 int32_t x, int32_t y,
284 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900285
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900286 /**
287 * \brief Set the destination area of a ivi_surface within a ivi_layer
288 * for rendering.
289 *
290 * The surface will be scaled to this rectangle for rendering.
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_destination_rectangle)(struct ivi_layout_surface *ivisurf,
296 int32_t x, int32_t y,
297 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900298
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900299 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900300 * \brief Sets the orientation of a ivi_surface.
301 *
302 * \return IVI_SUCCEEDED if the method call was successful
303 * \return IVI_FAILED if the method call was failed
304 */
305 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
306 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900307
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900308 /**
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000309 * \brief add a listener to listen property changes of ivi_surface
310 *
311 * When a property of the ivi_surface is changed, the property_changed
312 * signal is emitted to the listening controller plugins.
313 * The pointer of the ivi_surface is sent as the void *data argument
314 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900315 *
316 * \return IVI_SUCCEEDED if the method call was successful
317 * \return IVI_FAILED if the method call was failed
318 */
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000319 int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf,
320 struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900321
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900322 /**
323 * \brief get weston_surface of ivi_surface
324 */
325 struct weston_surface *
326 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900327
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900328 /**
329 * \brief set type of transition animation
330 */
331 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
332 enum ivi_layout_transition_type type,
333 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900334
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900335 /**
336 * \brief set duration of transition animation
337 */
338 int32_t (*surface_set_transition_duration)(
339 struct ivi_layout_surface *ivisurf,
340 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900341
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900342 /**
343 * layer controller interface
344 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900345
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900346 /**
347 * \brief register/unregister for notification when ivi_layer is created
348 */
349 int32_t (*add_notification_create_layer)(
350 layer_create_notification_func callback,
351 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900352
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900353 void (*remove_notification_create_layer)(
354 layer_create_notification_func callback,
355 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900356
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900357 /**
358 * \brief register/unregister for notification when ivi_layer is removed
359 */
360 int32_t (*add_notification_remove_layer)(
361 layer_remove_notification_func callback,
362 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900363
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900364 void (*remove_notification_remove_layer)(
365 layer_remove_notification_func callback,
366 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900367
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900368 /**
369 * \brief Create a ivi_layer which should be managed by the service
370 *
371 * \return (struct ivi_layout_layer *)
372 * if the method call was successful
373 * \return NULL if the method call was failed
374 */
375 struct ivi_layout_layer *
376 (*layer_create_with_dimension)(uint32_t id_layer,
377 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900378
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900379 /**
380 * \brief Removes a ivi_layer which is currently managed by the service
381 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900382 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900383
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900384 /**
385 * \brief Get all ivi_layers which are currently registered and managed
386 * by the services
387 *
388 * \return IVI_SUCCEEDED if the method call was successful
389 * \return IVI_FAILED if the method call was failed
390 */
391 int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900392
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900393 /**
394 * \brief get id of ivi_layer from ivi_layout_layer
395 *
396 *
397 * \return id of ivi_layer
398 */
399 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900400
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900401 /**
402 * \brief get ivi_layout_layer from id of layer
403 *
404 * \return (struct ivi_layout_layer *)
405 * if the method call was successful
406 * \return NULL if the method call was failed
407 */
408 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900409
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900410 /**
411 * \brief Get the ivi_layer properties
412 *
413 * \return (const struct ivi_layout_layer_properties *)
414 * if the method call was successful
415 * \return NULL if the method call was failed
416 */
417 const struct ivi_layout_layer_properties *
418 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900419
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900420 /**
421 * \brief Get all ivi_ayers under the given ivi_surface
422 *
423 * \return IVI_SUCCEEDED if the method call was successful
424 * \return IVI_FAILED if the method call was failed
425 */
426 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
427 int32_t *pLength,
428 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900429
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900430 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000431 * \brief Get all Layers of the given weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900432 *
433 * \return IVI_SUCCEEDED if the method call was successful
434 * \return IVI_FAILED if the method call was failed
435 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000436 int32_t (*get_layers_on_screen)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900437 int32_t *pLength,
438 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900439
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900440 /**
441 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
442 * the ivi_layer and its ivi_surfaces will not be rendered.
443 *
444 * \return IVI_SUCCEEDED if the method call was successful
445 * \return IVI_FAILED if the method call was failed
446 */
447 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
448 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900449
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900450 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900451 * \brief Set the opacity of a ivi_layer.
452 *
453 * \return IVI_SUCCEEDED if the method call was successful
454 * \return IVI_FAILED if the method call was failed
455 */
456 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
457 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900458
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900459 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900460 * \brief Set the area of a ivi_layer which should be used for the rendering.
461 *
462 * Only this part will be visible.
463 *
464 * \return IVI_SUCCEEDED if the method call was successful
465 * \return IVI_FAILED if the method call was failed
466 */
467 int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
468 int32_t x, int32_t y,
469 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900470
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900471 /**
472 * \brief Set the destination area on the display for a ivi_layer.
473 *
474 * The ivi_layer will be scaled and positioned to this rectangle
475 * for rendering
476 *
477 * \return IVI_SUCCEEDED if the method call was successful
478 * \return IVI_FAILED if the method call was failed
479 */
480 int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
481 int32_t x, int32_t y,
482 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900483
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900484 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900485 * \brief Sets the orientation of a ivi_layer.
486 *
487 * \return IVI_SUCCEEDED if the method call was successful
488 * \return IVI_FAILED if the method call was failed
489 */
490 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
491 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900492
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900493 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900494 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
495 *
496 * \return IVI_SUCCEEDED if the method call was successful
497 * \return IVI_FAILED if the method call was failed
498 */
499 int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
500 struct ivi_layout_surface *addsurf);
501
502 /**
503 * \brief Removes a surface from a layer which is currently managed by the service
504 */
505 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
506 struct ivi_layout_surface *remsurf);
507
508 /**
509 * \brief Sets render order of ivi_surfaces within a ivi_layer
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 (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
515 struct ivi_layout_surface **pSurface,
516 int32_t number);
517
518 /**
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000519 * \brief add a listener to listen property changes of ivi_layer
520 *
521 * When a property of the ivi_layer is changed, the property_changed
522 * signal is emitted to the listening controller plugins.
523 * The pointer of the ivi_layer is sent as the void *data argument
524 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900525 *
526 * \return IVI_SUCCEEDED if the method call was successful
527 * \return IVI_FAILED if the method call was failed
528 */
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000529 int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer,
530 struct wl_listener *listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900531
532 /**
533 * \brief set type of transition animation
534 */
535 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
536 enum ivi_layout_transition_type type,
537 uint32_t duration);
538
539 /**
540 * screen controller interface
541 */
542
543 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000544 * \brief Get the weston_outputs under the given ivi_layer
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900545 *
546 * \return IVI_SUCCEEDED if the method call was successful
547 * \return IVI_FAILED if the method call was failed
548 */
549 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
550 int32_t *pLength,
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000551 struct weston_output ***ppArray);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900552
553 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000554 * \brief Add a ivi_layer to a weston_output which is currently managed
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900555 * by the service
556 *
557 * \return IVI_SUCCEEDED if the method call was successful
558 * \return IVI_FAILED if the method call was failed
559 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000560 int32_t (*screen_add_layer)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900561 struct ivi_layout_layer *addlayer);
562
563 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000564 * \brief Sets render order of ivi_layers on a weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900565 *
566 * \return IVI_SUCCEEDED if the method call was successful
567 * \return IVI_FAILED if the method call was failed
568 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000569 int32_t (*screen_set_render_order)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900570 struct ivi_layout_layer **pLayer,
571 const int32_t number);
572
573 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900574 * transision animation for layer
575 */
576 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
577 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
578 uint32_t is_fade_in,
579 double start_alpha, double end_alpha);
580
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900581 /**
582 * surface content dumping for debugging
583 */
584 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
585 int32_t *width, int32_t *height,
586 int32_t *stride);
587
588 int32_t (*surface_dump)(struct weston_surface *surface,
589 void *target, size_t size,
590 int32_t x, int32_t y,
591 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900592};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900593
594#ifdef __cplusplus
595}
596#endif /* __cplusplus */
597
598#endif /* _IVI_LAYOUT_EXPORT_H_ */