blob: 1485d3f30f1fa6a7dd3ae2a0b7380fc0f685a9dd [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_configure_notification_func)(
142 struct ivi_layout_surface *ivisurf,
143 void *userdata);
144
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000145struct ivi_layout_interface {
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900146
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900147 /**
148 * \brief Commit all changes and execute all enqueued commands since
149 * last commit.
150 *
151 * \return IVI_SUCCEEDED if the method call was successful
152 * \return IVI_FAILED if the method call was failed
153 */
154 int32_t (*commit_changes)(void);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900155
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900156 /**
157 * surface controller interface
158 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900159
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900160 /**
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000161 * \brief add a listener for notification when ivi_surface is created
162 *
163 * When an ivi_surface is created, a signal is emitted
164 * to the listening controller plugins.
165 * The pointer of the created ivi_surface is sent as the void *data argument
166 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900167 */
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000168 int32_t (*add_listener_create_surface)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900169
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900170 /**
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +0000171 * \brief add a listener for notification when ivi_surface is removed
172 *
173 * When an ivi_surface is removed, a signal is emitted
174 * to the listening controller plugins.
175 * The pointer of the removed ivi_surface is sent as the void *data argument
176 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900177 */
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +0000178 int32_t (*add_listener_remove_surface)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900179
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900180 /**
181 * \brief register/unregister for notification when ivi_surface is configured
182 */
183 int32_t (*add_notification_configure_surface)(
184 surface_configure_notification_func callback,
185 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900186
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900187 void (*remove_notification_configure_surface)(
188 surface_configure_notification_func callback,
189 void *userdata);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900190
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900191 /**
192 * \brief Get all ivi_surfaces which are currently registered and managed
193 * by the services
194 *
195 * \return IVI_SUCCEEDED if the method call was successful
196 * \return IVI_FAILED if the method call was failed
197 */
198 int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900199
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900200 /**
201 * \brief get id of ivi_surface from ivi_layout_surface
202 *
203 * \return id of ivi_surface
204 */
205 uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900206
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900207 /**
208 * \brief get ivi_layout_surface from id of ivi_surface
209 *
210 * \return (struct ivi_layout_surface *)
211 * if the method call was successful
212 * \return NULL if the method call was failed
213 */
214 struct ivi_layout_surface *
215 (*get_surface_from_id)(uint32_t id_surface);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900216
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900217 /**
218 * \brief get ivi_layout_surface_properties from ivisurf
219 *
220 * \return (struct ivi_layout_surface_properties *)
221 * if the method call was successful
222 * \return NULL if the method call was failed
223 */
224 const struct ivi_layout_surface_properties *
225 (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900226
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900227 /**
228 * \brief Get all Surfaces which are currently registered to a given
229 * layer and are managed by the services
230 *
231 * \return IVI_SUCCEEDED if the method call was successful
232 * \return IVI_FAILED if the method call was failed
233 */
234 int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
235 int32_t *pLength,
236 struct ivi_layout_surface ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900237
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900238 /**
239 * \brief Set the visibility of a ivi_surface.
240 *
241 * If a surface is not visible it will not be rendered.
242 *
243 * \return IVI_SUCCEEDED if the method call was successful
244 * \return IVI_FAILED if the method call was failed
245 */
246 int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf,
247 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900248
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900249 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900250 * \brief Set the opacity of a surface.
251 *
252 * \return IVI_SUCCEEDED if the method call was successful
253 * \return IVI_FAILED if the method call was failed
254 */
255 int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
256 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900257
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900258 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900259 * \brief Set the area of a ivi_surface which should be used for the rendering.
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_source_rectangle)(struct ivi_layout_surface *ivisurf,
265 int32_t x, int32_t y,
266 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900267
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900268 /**
269 * \brief Set the destination area of a ivi_surface within a ivi_layer
270 * for rendering.
271 *
272 * The surface will be scaled to this rectangle for rendering.
273 *
274 * \return IVI_SUCCEEDED if the method call was successful
275 * \return IVI_FAILED if the method call was failed
276 */
277 int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf,
278 int32_t x, int32_t y,
279 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900280
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900281 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900282 * \brief Sets the orientation of a ivi_surface.
283 *
284 * \return IVI_SUCCEEDED if the method call was successful
285 * \return IVI_FAILED if the method call was failed
286 */
287 int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf,
288 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900289
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900290 /**
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000291 * \brief add a listener to listen property changes of ivi_surface
292 *
293 * When a property of the ivi_surface is changed, the property_changed
294 * signal is emitted to the listening controller plugins.
295 * The pointer of the ivi_surface is sent as the void *data argument
296 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900297 *
298 * \return IVI_SUCCEEDED if the method call was successful
299 * \return IVI_FAILED if the method call was failed
300 */
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000301 int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf,
302 struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900303
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900304 /**
305 * \brief get weston_surface of ivi_surface
306 */
307 struct weston_surface *
308 (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900309
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900310 /**
311 * \brief set type of transition animation
312 */
313 int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
314 enum ivi_layout_transition_type type,
315 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900316
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900317 /**
318 * \brief set duration of transition animation
319 */
320 int32_t (*surface_set_transition_duration)(
321 struct ivi_layout_surface *ivisurf,
322 uint32_t duration);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900323
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900324 /**
325 * layer controller interface
326 */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900327
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900328 /**
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000329 * \brief add a listener for notification when ivi_layer is created
330 *
331 * When an ivi_layer is created, a signal is emitted
332 * to the listening controller plugins.
333 * The pointer of the created ivi_layer is sent as the void *data argument
334 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900335 */
Ucan, Emre (ADITG/SW1)c98f2cf2016-04-04 08:05:12 +0000336 int32_t (*add_listener_create_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900337
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900338 /**
Ucan, Emre (ADITG/SW1)562f2ec2016-04-04 08:05:15 +0000339 * \brief add a listener for notification when ivi_layer is removed
340 *
341 * When an ivi_layer is removed, a signal is emitted
342 * to the listening controller plugins.
343 * The pointer of the removed ivi_layer is sent as the void *data argument
344 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900345 */
Ucan, Emre (ADITG/SW1)562f2ec2016-04-04 08:05:15 +0000346 int32_t (*add_listener_remove_layer)(struct wl_listener *listener);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900347
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900348 /**
349 * \brief Create a ivi_layer which should be managed by the service
350 *
351 * \return (struct ivi_layout_layer *)
352 * if the method call was successful
353 * \return NULL if the method call was failed
354 */
355 struct ivi_layout_layer *
356 (*layer_create_with_dimension)(uint32_t id_layer,
357 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900358
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900359 /**
360 * \brief Removes a ivi_layer which is currently managed by the service
361 */
Nobuhiko Tanibata3aa8aed2015-06-22 15:32:23 +0900362 void (*layer_destroy)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900363
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900364 /**
365 * \brief Get all ivi_layers which are currently registered and managed
366 * by the services
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 (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900372
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900373 /**
374 * \brief get id of ivi_layer from ivi_layout_layer
375 *
376 *
377 * \return id of ivi_layer
378 */
379 uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900380
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900381 /**
382 * \brief get ivi_layout_layer from id of layer
383 *
384 * \return (struct ivi_layout_layer *)
385 * if the method call was successful
386 * \return NULL if the method call was failed
387 */
388 struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900389
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900390 /**
391 * \brief Get the ivi_layer properties
392 *
393 * \return (const struct ivi_layout_layer_properties *)
394 * if the method call was successful
395 * \return NULL if the method call was failed
396 */
397 const struct ivi_layout_layer_properties *
398 (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900399
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900400 /**
401 * \brief Get all ivi_ayers under the given ivi_surface
402 *
403 * \return IVI_SUCCEEDED if the method call was successful
404 * \return IVI_FAILED if the method call was failed
405 */
406 int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
407 int32_t *pLength,
408 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900409
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900410 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000411 * \brief Get all Layers of the given weston_output
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900412 *
413 * \return IVI_SUCCEEDED if the method call was successful
414 * \return IVI_FAILED if the method call was failed
415 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000416 int32_t (*get_layers_on_screen)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900417 int32_t *pLength,
418 struct ivi_layout_layer ***ppArray);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900419
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900420 /**
421 * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
422 * the ivi_layer and its ivi_surfaces will not be rendered.
423 *
424 * \return IVI_SUCCEEDED if the method call was successful
425 * \return IVI_FAILED if the method call was failed
426 */
427 int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
428 bool newVisibility);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900429
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900430 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900431 * \brief Set the opacity of a ivi_layer.
432 *
433 * \return IVI_SUCCEEDED if the method call was successful
434 * \return IVI_FAILED if the method call was failed
435 */
436 int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
437 wl_fixed_t opacity);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900438
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900439 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900440 * \brief Set the area of a ivi_layer which should be used for the rendering.
441 *
442 * Only this part will be visible.
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_source_rectangle)(struct ivi_layout_layer *ivilayer,
448 int32_t x, int32_t y,
449 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900450
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900451 /**
452 * \brief Set the destination area on the display for a ivi_layer.
453 *
454 * The ivi_layer will be scaled and positioned to this rectangle
455 * for rendering
456 *
457 * \return IVI_SUCCEEDED if the method call was successful
458 * \return IVI_FAILED if the method call was failed
459 */
460 int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
461 int32_t x, int32_t y,
462 int32_t width, int32_t height);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900463
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900464 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900465 * \brief Sets the orientation of a ivi_layer.
466 *
467 * \return IVI_SUCCEEDED if the method call was successful
468 * \return IVI_FAILED if the method call was failed
469 */
470 int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer,
471 enum wl_output_transform orientation);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900472
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900473 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900474 * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
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 (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
480 struct ivi_layout_surface *addsurf);
481
482 /**
483 * \brief Removes a surface from a layer which is currently managed by the service
484 */
485 void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer,
486 struct ivi_layout_surface *remsurf);
487
488 /**
489 * \brief Sets render order of ivi_surfaces within a ivi_layer
490 *
491 * \return IVI_SUCCEEDED if the method call was successful
492 * \return IVI_FAILED if the method call was failed
493 */
494 int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
495 struct ivi_layout_surface **pSurface,
496 int32_t number);
497
498 /**
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000499 * \brief add a listener to listen property changes of ivi_layer
500 *
501 * When a property of the ivi_layer is changed, the property_changed
502 * signal is emitted to the listening controller plugins.
503 * The pointer of the ivi_layer is sent as the void *data argument
504 * to the wl_listener::notify callback function of the listener.
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900505 *
506 * \return IVI_SUCCEEDED if the method call was successful
507 * \return IVI_FAILED if the method call was failed
508 */
Ucan, Emre (ADITG/SW1)3750d1b2016-04-04 08:05:05 +0000509 int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer,
510 struct wl_listener *listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900511
512 /**
513 * \brief set type of transition animation
514 */
515 int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
516 enum ivi_layout_transition_type type,
517 uint32_t duration);
518
519 /**
520 * screen controller interface
521 */
522
523 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000524 * \brief Get the weston_outputs under the given ivi_layer
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 */
529 int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
530 int32_t *pLength,
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000531 struct weston_output ***ppArray);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900532
533 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000534 * \brief Add a ivi_layer to a weston_output which is currently managed
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900535 * by the service
536 *
537 * \return IVI_SUCCEEDED if the method call was successful
538 * \return IVI_FAILED if the method call was failed
539 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000540 int32_t (*screen_add_layer)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900541 struct ivi_layout_layer *addlayer);
542
543 /**
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000544 * \brief Sets render order of ivi_layers on a weston_output
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 */
Ucan, Emre (ADITG/SW1)273874e2016-03-17 15:30:42 +0000549 int32_t (*screen_set_render_order)(struct weston_output *output,
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900550 struct ivi_layout_layer **pLayer,
551 const int32_t number);
552
553 /**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900554 * transision animation for layer
555 */
556 void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
557 int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
558 uint32_t is_fade_in,
559 double start_alpha, double end_alpha);
560
Nobuhiko Tanibatac3fd6242015-04-21 02:13:15 +0900561 /**
562 * surface content dumping for debugging
563 */
564 int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf,
565 int32_t *width, int32_t *height,
566 int32_t *stride);
567
568 int32_t (*surface_dump)(struct weston_surface *surface,
569 void *target, size_t size,
570 int32_t x, int32_t y,
571 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900572};
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900573
574#ifdef __cplusplus
575}
576#endif /* __cplusplus */
577
578#endif /* _IVI_LAYOUT_EXPORT_H_ */