blob: 2ed1e766ac772032865644071455dbf578e310cb [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 (*surface_remove_notification_func)(
142 struct ivi_layout_surface *ivisurf,
143 void *userdata);
144
145typedef void (*surface_configure_notification_func)(
146 struct ivi_layout_surface *ivisurf,
147 void *userdata);
148
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000149struct ivi_layout_interface {
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900150
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900151 /**
152 * \brief Commit all changes and execute all enqueued commands since
153 * last commit.
154 *
155 * \return IVI_SUCCEEDED if the method call was successful
156 * \return IVI_FAILED if the method call was failed
157 */
158 int32_t (*commit_changes)(void);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900159
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900160 /**
161 * surface controller interface
162 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900163
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900164 /**
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000165 * \brief add a listener for notification when ivi_surface is created
166 *
167 * When an ivi_surface is created, a signal is emitted
168 * to the listening controller plugins.
169 * The pointer of the created ivi_surface is sent as the void *data argument
170 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900171 */
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000172 int32_t (*add_listener_create_surface)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900173
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900174 /**
175 * \brief register/unregister for notification when ivi_surface is removed
176 */
177 int32_t (*add_notification_remove_surface)(
178 surface_remove_notification_func callback,
179 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900180
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900181 void (*remove_notification_remove_surface)(
182 surface_remove_notification_func callback,
183 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900184
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900185 /**
186 * \brief register/unregister for notification when ivi_surface is configured
187 */
188 int32_t (*add_notification_configure_surface)(
189 surface_configure_notification_func callback,
190 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900191
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900192 void (*remove_notification_configure_surface)(
193 surface_configure_notification_func callback,
194 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900195
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900196 /**
197 * \brief Get all ivi_surfaces which are currently registered and managed
198 * by the services
199 *
200 * \return IVI_SUCCEEDED if the method call was successful
201 * \return IVI_FAILED if the method call was failed
202 */
203 int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900204
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900205 /**
206 * \brief get id of ivi_surface from ivi_layout_surface
207 *
208 * \return id of ivi_surface
209 */
210 uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900211
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900212 /**
213 * \brief get ivi_layout_surface from id of ivi_surface
214 *
215 * \return (struct ivi_layout_surface *)
216 * if the method call was successful
217 * \return NULL if the method call was failed
218 */
219 struct ivi_layout_surface *
220 (*get_surface_from_id)(uint32_t id_surface);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900221
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900222 /**
223 * \brief get ivi_layout_surface_properties from ivisurf
224 *
225 * \return (struct ivi_layout_surface_properties *)
226 * if the method call was successful
227 * \return NULL if the method call was failed
228 */
229 const struct ivi_layout_surface_properties *
230 (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900231
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900232 /**
233 * \brief Get all Surfaces which are currently registered to a given
234 * layer and are managed by the services
235 *
236 * \return IVI_SUCCEEDED if the method call was successful
237 * \return IVI_FAILED if the method call was failed
238 */
239 int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
240 int32_t *pLength,
241 struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900242
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900243 /**
244 * \brief Set the visibility of a ivi_surface.
245 *
246 * If a surface is not visible it will not be rendered.
247 *
248 * \return IVI_SUCCEEDED if the method call was successful
249 * \return IVI_FAILED if the method call was failed
250 */
251 int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf,
252 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900253
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900254 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900255 * \brief Set the opacity of a surface.
256 *
257 * \return IVI_SUCCEEDED if the method call was successful
258 * \return IVI_FAILED if the method call was failed
259 */
260 int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
261 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900262
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900263 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900264 * \brief Set the area of a ivi_surface which should be used for the rendering.
265 *
266 * \return IVI_SUCCEEDED if the method call was successful
267 * \return IVI_FAILED if the method call was failed
268 */
269 int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
270 int32_t x, int32_t y,
271 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900272
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900273 /**
274 * \brief Set the destination area of a ivi_surface within a ivi_layer
275 * for rendering.
276 *
277 * The surface will be scaled to this rectangle for 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_destination_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 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900287 * \brief Sets the orientation of a ivi_surface.
288 *
289 * \return IVI_SUCCEEDED if the method call was successful
290 * \return IVI_FAILED if the method call was failed
291 */
292 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
293 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900294
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900295 /**
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000296 * \brief add a listener to listen property changes of ivi_surface
297 *
298 * When a property of the ivi_surface is changed, the property_changed
299 * signal is emitted to the listening controller plugins.
300 * The pointer of the ivi_surface is sent as the void *data argument
301 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900302 *
303 * \return IVI_SUCCEEDED if the method call was successful
304 * \return IVI_FAILED if the method call was failed
305 */
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000306 int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf,
307 struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900308
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900309 /**
310 * \brief get weston_surface of ivi_surface
311 */
312 struct weston_surface *
313 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900314
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900315 /**
316 * \brief set type of transition animation
317 */
318 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
319 enum ivi_layout_transition_type type,
320 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900321
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900322 /**
323 * \brief set duration of transition animation
324 */
325 int32_t (*surface_set_transition_duration)(
326 struct ivi_layout_surface *ivisurf,
327 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900328
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900329 /**
330 * layer controller interface
331 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900332
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900333 /**
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000334 * \brief add a listener for notification when ivi_layer is created
335 *
336 * When an ivi_layer is created, a signal is emitted
337 * to the listening controller plugins.
338 * The pointer of the created ivi_layer is sent as the void *data argument
339 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900340 */
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000341 int32_t (*add_listener_create_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900342
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900343 /**
Ucan, Emre (ADITG/SW1)562f2ec2016-04-04 08:05:15 +0000344 * \brief add a listener for notification when ivi_layer is removed
345 *
346 * When an ivi_layer is removed, a signal is emitted
347 * to the listening controller plugins.
348 * The pointer of the removed ivi_layer is sent as the void *data argument
349 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900350 */
Ucan, Emre (ADITG/SW1)562f2ec2016-04-04 08:05:15 +0000351 int32_t (*add_listener_remove_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900352
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900353 /**
354 * \brief Create a ivi_layer which should be managed by the service
355 *
356 * \return (struct ivi_layout_layer *)
357 * if the method call was successful
358 * \return NULL if the method call was failed
359 */
360 struct ivi_layout_layer *
361 (*layer_create_with_dimension)(uint32_t id_layer,
362 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900363
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900364 /**
365 * \brief Removes a ivi_layer which is currently managed by the service
366 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900367 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900368
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900369 /**
370 * \brief Get all ivi_layers which are currently registered and managed
371 * by the services
372 *
373 * \return IVI_SUCCEEDED if the method call was successful
374 * \return IVI_FAILED if the method call was failed
375 */
376 int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900377
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900378 /**
379 * \brief get id of ivi_layer from ivi_layout_layer
380 *
381 *
382 * \return id of ivi_layer
383 */
384 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900385
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900386 /**
387 * \brief get ivi_layout_layer from id of layer
388 *
389 * \return (struct ivi_layout_layer *)
390 * if the method call was successful
391 * \return NULL if the method call was failed
392 */
393 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900394
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900395 /**
396 * \brief Get the ivi_layer properties
397 *
398 * \return (const struct ivi_layout_layer_properties *)
399 * if the method call was successful
400 * \return NULL if the method call was failed
401 */
402 const struct ivi_layout_layer_properties *
403 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900404
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900405 /**
406 * \brief Get all ivi_ayers under the given ivi_surface
407 *
408 * \return IVI_SUCCEEDED if the method call was successful
409 * \return IVI_FAILED if the method call was failed
410 */
411 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
412 int32_t *pLength,
413 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900414
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900415 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000416 * \brief Get all Layers of the given weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900417 *
418 * \return IVI_SUCCEEDED if the method call was successful
419 * \return IVI_FAILED if the method call was failed
420 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000421 int32_t (*get_layers_on_screen)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900422 int32_t *pLength,
423 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900424
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900425 /**
426 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
427 * the ivi_layer and its ivi_surfaces will not be rendered.
428 *
429 * \return IVI_SUCCEEDED if the method call was successful
430 * \return IVI_FAILED if the method call was failed
431 */
432 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
433 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900434
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900435 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900436 * \brief Set the opacity of a ivi_layer.
437 *
438 * \return IVI_SUCCEEDED if the method call was successful
439 * \return IVI_FAILED if the method call was failed
440 */
441 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
442 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900443
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900444 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900445 * \brief Set the area of a ivi_layer which should be used for the rendering.
446 *
447 * Only this part will be visible.
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 (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
453 int32_t x, int32_t y,
454 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900455
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900456 /**
457 * \brief Set the destination area on the display for a ivi_layer.
458 *
459 * The ivi_layer will be scaled and positioned to this rectangle
460 * for rendering
461 *
462 * \return IVI_SUCCEEDED if the method call was successful
463 * \return IVI_FAILED if the method call was failed
464 */
465 int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
466 int32_t x, int32_t y,
467 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900468
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900469 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900470 * \brief Sets the orientation of a ivi_layer.
471 *
472 * \return IVI_SUCCEEDED if the method call was successful
473 * \return IVI_FAILED if the method call was failed
474 */
475 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
476 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900477
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900478 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900479 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
480 *
481 * \return IVI_SUCCEEDED if the method call was successful
482 * \return IVI_FAILED if the method call was failed
483 */
484 int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
485 struct ivi_layout_surface *addsurf);
486
487 /**
488 * \brief Removes a surface from a layer which is currently managed by the service
489 */
490 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
491 struct ivi_layout_surface *remsurf);
492
493 /**
494 * \brief Sets render order of ivi_surfaces within a ivi_layer
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_set_render_order)(struct ivi_layout_layer *ivilayer,
500 struct ivi_layout_surface **pSurface,
501 int32_t number);
502
503 /**
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000504 * \brief add a listener to listen property changes of ivi_layer
505 *
506 * When a property of the ivi_layer is changed, the property_changed
507 * signal is emitted to the listening controller plugins.
508 * The pointer of the ivi_layer is sent as the void *data argument
509 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900510 *
511 * \return IVI_SUCCEEDED if the method call was successful
512 * \return IVI_FAILED if the method call was failed
513 */
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000514 int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer,
515 struct wl_listener *listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900516
517 /**
518 * \brief set type of transition animation
519 */
520 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
521 enum ivi_layout_transition_type type,
522 uint32_t duration);
523
524 /**
525 * screen controller interface
526 */
527
528 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000529 * \brief Get the weston_outputs under the given ivi_layer
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900530 *
531 * \return IVI_SUCCEEDED if the method call was successful
532 * \return IVI_FAILED if the method call was failed
533 */
534 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
535 int32_t *pLength,
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000536 struct weston_output ***ppArray);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900537
538 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000539 * \brief Add a ivi_layer to a weston_output which is currently managed
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900540 * by the service
541 *
542 * \return IVI_SUCCEEDED if the method call was successful
543 * \return IVI_FAILED if the method call was failed
544 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000545 int32_t (*screen_add_layer)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900546 struct ivi_layout_layer *addlayer);
547
548 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000549 * \brief Sets render order of ivi_layers on a weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900550 *
551 * \return IVI_SUCCEEDED if the method call was successful
552 * \return IVI_FAILED if the method call was failed
553 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000554 int32_t (*screen_set_render_order)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900555 struct ivi_layout_layer **pLayer,
556 const int32_t number);
557
558 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900559 * transision animation for layer
560 */
561 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
562 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
563 uint32_t is_fade_in,
564 double start_alpha, double end_alpha);
565
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900566 /**
567 * surface content dumping for debugging
568 */
569 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
570 int32_t *width, int32_t *height,
571 int32_t *stride);
572
573 int32_t (*surface_dump)(struct weston_surface *surface,
574 void *target, size_t size,
575 int32_t x, int32_t y,
576 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900577};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900578
579#ifdef __cplusplus
580}
581#endif /* __cplusplus */
582
583#endif /* _IVI_LAYOUT_EXPORT_H_ */