downstream: ivi-controller: consitent use of opacity
[profile/ivi/wayland-ivi-extension.git] / weston-ivi-shell / src / ivi-layout-export.h
1 /*
2  * Copyright (C) 2013 DENSO CORPORATION
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation for any purpose is hereby granted without fee, provided
6  * that the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name of the copyright holders not be used in
9  * advertising or publicity pertaining to distribution of the software
10  * without specific, written prior permission.  The copyright holders make
11  * no representations about the suitability of this software for any
12  * purpose.  It is provided "as is" without express or implied warranty.
13  *
14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  */
22
23 /**
24  * The ivi-layout library supports API set of controlling properties of
25  * surface and layer which groups surfaces. An unique ID whose type is integer
26  * is required to create surface and layer. With the unique ID, surface and
27  * layer are identified to control them. The API set consists of APIs to control
28  * properties of surface and layers about followings,
29  * - visibility.
30  * - opacity.
31  * - clipping (x,y,width,height).
32  * - position and size of it to be displayed.
33  * - orientation per 90 degree.
34  * - add or remove surfaces to a layer.
35  * - order of surfaces/layers in layer/screen to be displayed.
36  * - commit to apply property changes.
37  * - notifications of property change.
38  *
39  * Management of surfaces and layers grouping these surfaces are common way in
40  * In-Vehicle Infotainment system, which integrate several domains in one system.
41  * A layer is allocated to a domain in order to control application surfaces
42  * grouped to the layer all together.
43  */
44
45 #ifndef _IVI_LAYOUT_EXPORT_H_
46 #define _IVI_LAYOUT_EXPORT_H_
47
48 #ifdef __cplusplus
49 extern "C" {
50 #endif /* __cplusplus */
51
52 #include "compositor.h"
53 #include "ivi-layout.h"
54
55 struct ivi_layout_layer;
56 struct ivi_layout_screen;
57
58 enum ivi_layout_notification_mask {
59     IVI_NOTIFICATION_NONE        = 0,
60     IVI_NOTIFICATION_OPACITY     = (1 << 1),
61     IVI_NOTIFICATION_SOURCE_RECT = (1 << 2),
62     IVI_NOTIFICATION_DEST_RECT   = (1 << 3),
63     IVI_NOTIFICATION_DIMENSION   = (1 << 4),
64     IVI_NOTIFICATION_POSITION    = (1 << 5),
65     IVI_NOTIFICATION_ORIENTATION = (1 << 6),
66     IVI_NOTIFICATION_VISIBILITY  = (1 << 7),
67     IVI_NOTIFICATION_PIXELFORMAT = (1 << 8),
68     IVI_NOTIFICATION_ADD         = (1 << 9),
69     IVI_NOTIFICATION_REMOVE      = (1 << 10),
70     IVI_NOTIFICATION_CONFIGURE   = (1 << 11),
71     IVI_NOTIFICATION_KEYBOARD_FOCUS = (1 << 12),
72     IVI_NOTIFICATION_ALL         = 0xFFFF
73 };
74
75 enum ivi_layout_transition_type{
76     IVI_LAYOUT_TRANSITION_NONE,
77     IVI_LAYOUT_TRANSITION_VIEW_DEFAULT,
78     IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY,
79     IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY,
80     IVI_LAYOUT_TRANSITION_LAYER_FADE,
81     IVI_LAYOUT_TRANSITION_LAYER_MOVE,
82     IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER,
83     IVI_LAYOUT_TRANSITION_MAX,
84 };
85
86 typedef void(*shellWarningNotificationFunc)(uint32_t id_surface,
87                                             enum ivi_layout_warning_flag warn,
88                                             void *userdata);
89
90 typedef void(*layerPropertyNotificationFunc)(struct ivi_layout_layer *ivilayer,
91                                             struct ivi_layout_LayerProperties*,
92                                             enum ivi_layout_notification_mask mask,
93                                             void *userdata);
94
95 typedef void(*surfacePropertyNotificationFunc)(struct ivi_layout_surface *ivisurf,
96                                             struct ivi_layout_SurfaceProperties*,
97                                             enum ivi_layout_notification_mask mask,
98                                             void *userdata);
99
100 typedef void(*layerCreateNotificationFunc)(struct ivi_layout_layer *ivilayer,
101                                             void *userdata);
102
103 typedef void(*layerRemoveNotificationFunc)(struct ivi_layout_layer *ivilayer,
104                                             void *userdata);
105
106 typedef void(*surfaceCreateNotificationFunc)(struct ivi_layout_surface *ivisurf,
107                                             void *userdata);
108
109 typedef void(*surfaceRemoveNotificationFunc)(struct ivi_layout_surface *ivisurf,
110                                             void *userdata);
111
112 typedef void(*surfaceConfigureNotificationFunc)(struct ivi_layout_surface *ivisurf,
113                                             void *userdata);
114
115 typedef void(*ivi_controller_surface_content_callback)(struct ivi_layout_surface *ivisurf,
116                                             int32_t content,
117                                             void *userdata);
118
119 int32_t
120 ivi_layout_addNotificationShellWarning(shellWarningNotificationFunc callback,
121                                        void *userdata);
122
123 void
124 ivi_layout_removeNotificationShellWarning(shellWarningNotificationFunc callback,
125                                           void *userdata);
126
127 /**
128  * \brief to be called by ivi-shell in order to set initail view of
129  * weston_surface.
130  */
131 /*
132 struct weston_view *
133 ivi_layout_get_weston_view(struct ivi_layout_surface *surface);
134 */
135
136 /**
137  * \brief initialize ivi-layout
138  */
139 /*
140 void
141 ivi_layout_initWithCompositor(struct weston_compositor *ec);
142 */
143
144 /**
145  * \brief register for notification when layer is created
146  */
147 int32_t
148 ivi_layout_addNotificationCreateLayer(layerCreateNotificationFunc callback,
149                                       void *userdata);
150
151 void
152 ivi_layout_removeNotificationCreateLayer(layerCreateNotificationFunc callback,
153                                          void *userdata);
154
155 /**
156  * \brief register for notification when layer is removed
157  */
158 int32_t
159 ivi_layout_addNotificationRemoveLayer(layerRemoveNotificationFunc callback,
160                                       void *userdata);
161
162 void
163 ivi_layout_removeNotificationRemoveLayer(layerRemoveNotificationFunc callback,
164                                          void *userdata);
165
166 /**
167  * \brief register for notification when surface is created
168  */
169 int32_t
170 ivi_layout_addNotificationCreateSurface(surfaceCreateNotificationFunc callback,
171                                         void *userdata);
172
173 void
174 ivi_layout_removeNotificationCreateSurface(surfaceCreateNotificationFunc callback,
175                                            void *userdata);
176
177 /**
178  * \brief register for notification when surface is removed
179  */
180 int32_t
181 ivi_layout_addNotificationRemoveSurface(surfaceRemoveNotificationFunc callback,
182                                         void *userdata);
183
184 void
185 ivi_layout_removeNotificationRemoveSurface(surfaceRemoveNotificationFunc callback,
186                                            void *userdata);
187
188 /**
189  * \brief register for notification when surface is configured
190  */
191 int32_t
192 ivi_layout_addNotificationConfigureSurface(surfaceConfigureNotificationFunc callback,
193                                            void *userdata);
194
195 void
196 ivi_layout_removeNotificationConfigureSurface(surfaceConfigureNotificationFunc callback,
197                                               void *userdata);
198
199 /**
200  * \brief get id of surface from ivi_layout_surface
201  *
202  * \return  0 if the method call was successful
203  * \return -1 if the method call was failed
204  */
205 uint32_t
206 ivi_layout_getIdOfSurface(struct ivi_layout_surface *ivisurf);
207
208 /**
209  * \brief get id of layer from ivi_layout_layer
210  *
211  *
212  * \return  0 if the method call was successful
213  * \return -1 if the method call was failed
214  */
215 uint32_t
216 ivi_layout_getIdOfLayer(struct ivi_layout_layer *ivilayer);
217
218 /**
219  * \brief get ivi_layout_layer from id of layer
220  *
221  * \return (struct ivi_layout_layer *)
222  *              if the method call was successful
223  * \return NULL if the method call was failed
224  */
225 struct ivi_layout_layer *
226 ivi_layout_getLayerFromId(uint32_t id_layer);
227
228 /**
229  * \brief get ivi_layout_surface from id of surface
230  *
231  * \return (struct ivi_layout_surface *)
232  *              if the method call was successful
233  * \return NULL if the method call was failed
234  */
235 struct ivi_layout_surface *
236 ivi_layout_getSurfaceFromId(uint32_t id_surface);
237
238 /**
239  * \brief get ivi_layout_screen from id of screen
240  *
241  * \return (struct ivi_layout_screen *)
242  *              if the method call was successful
243  * \return NULL if the method call was failed
244  */
245 struct ivi_layout_screen *
246 ivi_layout_getScreenFromId(uint32_t id_screen);
247
248 /**
249  * \brief Get the screen resolution of a specific screen
250  *
251  * \return  0 if the method call was successful
252  * \return -1 if the method call was failed
253  */
254 int32_t
255 ivi_layout_getScreenResolution(struct ivi_layout_screen *iviscrn,
256                                   int32_t *pWidth,
257                                   int32_t *pHeight);
258
259 /**
260  * \brief register for notification on property changes of surface
261  *
262  * \return  0 if the method call was successful
263  * \return -1 if the method call was failed
264  */
265 int32_t
266 ivi_layout_surfaceAddNotification(struct ivi_layout_surface *ivisurf,
267                                      surfacePropertyNotificationFunc callback,
268                                      void *userdata);
269
270 /**
271  * \brief remove notification on property changes of surface
272  *
273  * \return  0 if the method call was successful
274  * \return -1 if the method call was failed
275  */
276 int32_t
277 ivi_layout_surfaceRemoveNotification(struct ivi_layout_surface *ivisurf);
278
279 /**
280  * \brief Create a surface
281  *
282  * \return  0 if the method call was successful
283  * \return -1 if the method call was failed
284  */
285 /*
286 struct ivi_layout_surface *
287 ivi_layout_surfaceCreate(struct weston_surface *wl_surface,
288                             uint32_t id_surface);
289 */
290
291 /**
292  * \brief Set the native content of an application to be used as surface content.
293  *        If wl_surface is NULL, remove the native content of a surface
294  *
295  * \return  0 if the method call was successful
296  * \return -1 if the method call was failed
297  */
298 /*
299 int32_t
300 ivi_layout_surfaceSetNativeContent(struct weston_surface *wl_surface,
301                                       uint32_t width,
302                                       uint32_t height,
303                                       uint32_t id_surface);
304 */
305
306 /**
307  * \brief Set an observer callback for surface content status change.
308  *
309  * \return  0 if the method call was successful
310  * \return -1 if the method call was failed
311  */
312 int32_t
313 ivi_layout_surfaceSetContentObserver(struct ivi_layout_surface *ivisurf,
314                                      ivi_controller_surface_content_callback callback,
315                                      void* userdata);
316
317 /**
318  * \brief initialize ivi_layout_surface dest/source width and height
319  */
320 /*
321 void
322 ivi_layout_surfaceConfigure(struct ivi_layout_surface *ivisurf,
323                                uint32_t width, uint32_t height);
324 */
325
326 /**
327  * \brief Remove a surface
328  *
329  * \return  0 if the method call was successful
330  * \return -1 if the method call was failed
331  */
332 int32_t
333 ivi_layout_surfaceRemove(struct ivi_layout_surface *ivisurf);
334
335 /**
336  * \brief Set from which kind of devices the surface can accept input events.
337  * By default, a surface accept input events from all kind of devices (keyboards, pointer, ...)
338  * By calling this function, you can adjust surface preferences. Note that this function only
339  * adjust the acceptance for the specified devices. Non specified are keept untouched.
340  *
341  * Typicall use case for this function is when dealing with pointer or touch events.
342  * Those are normally dispatched to the first visible surface below the coordinate.
343  * If you want a different behavior (i.e. forward events to an other surface below the coordinate,
344  * you can set all above surfaces to refuse input events)
345  *
346  * \return  0 if the method call was successful
347  * \return -1 if the method call was failed
348  */
349 int32_t
350 ivi_layout_UpdateInputEventAcceptanceOn(struct ivi_layout_surface *ivisurf,
351                                            int32_t devices,
352                                            int32_t acceptance);
353
354 /**
355  * \brief  Get the layer properties
356  *
357  * \return  0 if the method call was successful
358  * \return -1 if the method call was failed
359  */
360 int32_t
361 ivi_layout_getPropertiesOfLayer(struct ivi_layout_layer *ivilayer,
362                 struct ivi_layout_LayerProperties *pLayerProperties);
363
364 /**
365  * \brief  Get the number of hardware layers of a screen
366  *
367  * \return  0 if the method call was successful
368  * \return -1 if the method call was failed
369  */
370 int32_t
371 ivi_layout_getNumberOfHardwareLayers(uint32_t id_screen,
372                                         int32_t *pNumberOfHardwareLayers);
373
374 /**
375  * \brief Get the screens
376  *
377  * \return  0 if the method call was successful
378  * \return -1 if the method call was failed
379  */
380 int32_t
381 ivi_layout_getScreens(int32_t *pLength, struct ivi_layout_screen ***ppArray);
382
383 /**
384  * \brief Get the screens under the given layer
385  *
386  * \return  0 if the method call was successful
387  * \return -1 if the method call was failed
388  */
389 int32_t
390 ivi_layout_getScreensUnderLayer(struct ivi_layout_layer *ivilayer,
391                                    int32_t *pLength,
392                                    struct ivi_layout_screen ***ppArray);
393
394 /**
395  * \brief Get all Layers which are currently registered and managed by the services
396  *
397  * \return  0 if the method call was successful
398  * \return -1 if the method call was failed
399  */
400 int32_t
401 ivi_layout_getLayers(int32_t *pLength, struct ivi_layout_layer ***ppArray);
402
403 /**
404  * \brief Get all Layers of the given screen
405  *
406  * \return  0 if the method call was successful
407  * \return -1 if the method call was failed
408  */
409 int32_t
410 ivi_layout_getLayersOnScreen(struct ivi_layout_screen *iviscrn,
411                                 int32_t *pLength,
412                                 struct ivi_layout_layer ***ppArray);
413
414 /**
415  * \brief Get all Layers under the given surface
416  *
417  * \return  0 if the method call was successful
418  * \return -1 if the method call was failed
419  */
420 int32_t
421 ivi_layout_getLayersUnderSurface(struct ivi_layout_surface *ivisurf,
422                                     int32_t *pLength,
423                                     struct ivi_layout_layer ***ppArray);
424
425 /**
426  * \brief Get all Surfaces which are currently registered and managed by the services
427  *
428  * \return  0 if the method call was successful
429  * \return -1 if the method call was failed
430  */
431 int32_t
432 ivi_layout_getSurfaces(int32_t *pLength, struct ivi_layout_surface ***ppArray);
433
434 /**
435  * \brief Get all Surfaces which are currently registered to a given layer and are managed by the services
436  *
437  * \return  0 if the method call was successful
438  * \return -1 if the method call was failed
439  */
440 int32_t
441 ivi_layout_getSurfacesOnLayer(struct ivi_layout_layer *ivilayer,
442                                  int32_t *pLength,
443                                  struct ivi_layout_surface ***ppArray);
444
445 /**
446  * \brief Create a layer which should be managed by the service
447  *
448  * \return  0 if the method call was successful
449  * \return -1 if the method call was failed
450  */
451 struct ivi_layout_layer *
452 ivi_layout_layerCreateWithDimension(uint32_t id_layer,
453                                        int32_t width, int32_t height);
454
455 /**
456  * \brief Removes a layer which is currently managed by the service
457  *
458  * \return  0 if the method call was successful
459  * \return -1 if the method call was failed
460  */
461 int32_t
462 ivi_layout_layerRemove(struct ivi_layout_layer *ivilayer);
463
464 /**
465  * \brief Get the current type of the layer.
466  *
467  * \return  0 if the method call was successful
468  * \return -1 if the method call was failed
469  */
470 int32_t
471 ivi_layout_layerGetType(struct ivi_layout_layer *ivilayer,
472                            int32_t *pLayerType);
473
474 /**
475  * \brief Set the visibility of a layer. If a layer is not visible, the layer and its
476  * surfaces will not be rendered.
477  *
478  * \return  0 if the method call was successful
479  * \return -1 if the method call was failed
480  */
481 int32_t
482 ivi_layout_layerSetVisibility(struct ivi_layout_layer *ivilayer,
483                                  int32_t newVisibility);
484
485 /**
486  * \brief Get the visibility of a layer. If a layer is not visible, the layer and its
487  * surfaces will not be rendered.
488  *
489  * \return  0 if the method call was successful
490  * \return -1 if the method call was failed
491  */
492 int32_t
493 ivi_layout_layerGetVisibility(struct ivi_layout_layer *ivilayer,
494                                  int32_t *pVisibility);
495
496 /**
497  * \brief Set the opacity of a layer.
498  *
499  * \return  0 if the method call was successful
500  * \return -1 if the method call was failed
501  */
502 int32_t
503 ivi_layout_layerSetOpacity(struct ivi_layout_layer *ivilayer, float opacity);
504
505 /**
506  * \brief Get the opacity of a layer.
507  *
508  * \return  0 if the method call was successful
509  * \return -1 if the method call was failed
510  */
511 int32_t
512 ivi_layout_layerGetOpacity(struct ivi_layout_layer *ivilayer, float *pOpacity);
513
514 /**
515  * \brief Set the area of a layer which should be used for the rendering.
516  *        Only this part will be visible.
517  *
518  * \return  0 if the method call was successful
519  * \return -1 if the method call was failed
520  */
521 int32_t
522 ivi_layout_layerSetSourceRectangle(struct ivi_layout_layer *ivilayer,
523                                       int32_t x, int32_t y,
524                                       int32_t width, int32_t height);
525
526 /**
527  * \brief Set the destination area on the display for a layer.
528  *        The layer will be scaled and positioned to this rectangle for rendering
529  *
530  * \return  0 if the method call was successful
531  * \return -1 if the method call was failed
532  */
533 int32_t
534 ivi_layout_layerSetDestinationRectangle(struct ivi_layout_layer *ivilayer,
535                                            int32_t x, int32_t y,
536                                            int32_t width, int32_t height);
537
538 /**
539  * \brief Get the horizontal and vertical dimension of the layer.
540  *
541  * \return  0 if the method call was successful
542  * \return -1 if the method call was failed
543  */
544 int32_t
545 ivi_layout_layerGetDimension(struct ivi_layout_layer *ivilayer,
546                                 int32_t *pDimension);
547
548 /**
549  * \brief Set the horizontal and vertical dimension of the layer.
550  *
551  * \return  0 if the method call was successful
552  * \return -1 if the method call was failed
553  */
554 int32_t
555 ivi_layout_layerSetDimension(struct ivi_layout_layer *ivilayer,
556                                 int32_t *pDimension);
557
558 /**
559  * \brief Get the horizontal and vertical position of the layer.
560  *
561  * \return  0 if the method call was successful
562  * \return -1 if the method call was failed
563  */
564 int32_t
565 ivi_layout_layerGetPosition(struct ivi_layout_layer *ivilayer,
566                                int32_t *pPosition);
567
568 /**
569  * \brief Sets the horizontal and vertical position of the layer.
570  *
571  * \return  0 if the method call was successful
572  * \return -1 if the method call was failed
573  */
574 int32_t
575 ivi_layout_layerSetPosition(struct ivi_layout_layer *ivilayer,
576                                int32_t *pPosition);
577
578 /**
579  * \brief Sets the orientation of a layer.
580  *
581  * \return  0 if the method call was successful
582  * \return -1 if the method call was failed
583  */
584 int32_t
585 ivi_layout_layerSetOrientation(struct ivi_layout_layer *ivilayer,
586                                   int32_t orientation);
587
588 /**
589  * \brief Gets the orientation of a layer.
590  *
591  * \return  0 if the method call was successful
592  * \return -1 if the method call was failed
593  */
594 int32_t
595 ivi_layout_layerGetOrientation(struct ivi_layout_layer *ivilayer,
596                                   int32_t *pOrientation);
597
598 /**
599  * \brief Sets the color value which defines the transparency value.
600  *
601  * \return  0 if the method call was successful
602  * \return -1 if the method call was failed
603  */
604 int32_t
605 ivi_layout_layerSetChromaKey(struct ivi_layout_layer *ivilayer,
606                                 int32_t* pColor);
607
608 /**
609  * \brief Sets render order of surfaces within one layer
610  *
611  * \return  0 if the method call was successful
612  * \return -1 if the method call was failed
613  */
614 int32_t
615 ivi_layout_layerSetRenderOrder(struct ivi_layout_layer *ivilayer,
616                                   struct ivi_layout_surface **pSurface,
617                                   int32_t number);
618
619 /**
620  * \brief Get the capabilities of a layer
621  *
622  * \return  0 if the method call was successful
623  * \return -1 if the method call was failed
624  */
625 int32_t
626 ivi_layout_layerGetCapabilities(struct ivi_layout_layer *ivilayer,
627                                    int32_t *pCapabilities);
628
629 /**
630  * \brief Get the possible capabilities of a layertype
631  *
632  * \return  0 if the method call was successful
633  * \return -1 if the method call was failed
634  */
635 int32_t
636 ivi_layout_layerTypeGetCapabilities(int32_t layerType,
637                                        int32_t *pCapabilities);
638
639 /**
640  * \brief Create the logical surface, which has no native buffer associated
641  *
642  * \return  0 if the method call was successful
643  * \return -1 if the method call was failed
644  */
645 int32_t
646 ivi_layout_surfaceInitialize(struct ivi_layout_surface **pSurface);
647
648 /**
649  * \brief Set the visibility of a surface.
650  *        If a surface is not visible it will not be rendered.
651  *
652  * \return  0 if the method call was successful
653  * \return -1 if the method call was failed
654  */
655 int32_t
656 ivi_layout_surfaceSetVisibility(struct ivi_layout_surface *ivisurf,
657                                    int32_t newVisibility);
658
659 /**
660  * \brief Get the visibility of a surface.
661  *        If a surface is not visible it will not be rendered.
662  *
663  * \return  0 if the method call was successful
664  * \return -1 if the method call was failed
665  */
666 int32_t
667 ivi_layout_surfaceGetVisibility(struct ivi_layout_surface *ivisurf,
668                                    int32_t *pVisibility);
669
670 /**
671  * \brief Set the opacity of a surface.
672  *
673  * \return  0 if the method call was successful
674  * \return -1 if the method call was failed
675  */
676 int32_t
677 ivi_layout_surfaceSetOpacity(struct ivi_layout_surface *ivisurf,
678                                 float opacity);
679
680 /**
681  * \brief Get the opacity of a surface.
682  *
683  * \return  0 if the method call was successful
684  * \return -1 if the method call was failed
685  */
686 int32_t
687 ivi_layout_surfaceGetOpacity(struct ivi_layout_surface *ivisurf,
688                                 float *pOpacity);
689
690 /**
691  * \brief Set the keyboard focus on a certain surface
692  * To receive keyboard events, 2 conditions must be fulfilled:
693  *  1- The surface must accept events from keyboard. See ilm_UpdateInputEventAcceptanceOn
694  *  2- The keyboard focus must be set on that surface
695  *
696  * \return  0 if the method call was successful
697  * \return -1 if the method call was failed
698  */
699 int32_t
700 ivi_layout_SetKeyboardFocusOn(uint32_t *surface_ids, size_t size);
701
702 /**
703  * \brief Get the indentifier of the surface which hold the keyboard focus
704  *
705  * \return  0 if the method call was successful
706  * \return -1 if the method call was failed
707  */
708 int32_t
709 ivi_layout_GetKeyboardFocusSurfaceId(uint32_t *surface_ids, size_t size, uint32_t *count);
710
711 /**
712  * \brief Set the destination area of a surface within a layer for rendering.
713  *        The surface will be scaled to this rectangle for rendering.
714  *
715  * \return  0 if the method call was successful
716  * \return -1 if the method call was failed
717  */
718 int32_t
719 ivi_layout_surfaceSetDestinationRectangle(struct ivi_layout_surface *ivisurf,
720                                              int32_t x, int32_t y,
721                                              int32_t width, int32_t height);
722
723 /**
724  * \brief Set the horizontal and vertical dimension of the surface.
725  *
726  * \return  0 if the method call was successful
727  * \return -1 if the method call was failed
728  */
729 int32_t
730 ivi_layout_surfaceSetDimension(struct ivi_layout_surface *ivisurf,
731                                   int32_t *pDimension);
732
733 /**
734  * \brief Get the horizontal and vertical dimension of the surface.
735  *
736  * \return  0 if the method call was successful
737  * \return -1 if the method call was failed
738  */
739 int32_t
740 ivi_layout_surfaceGetDimension(struct ivi_layout_surface *ivisurf,
741                                   int32_t *pDimension);
742
743 /**
744  * \brief Sets the horizontal and vertical position of the surface.
745  *
746  * \return  0 if the method call was successful
747  * \return -1 if the method call was failed
748  */
749 int32_t
750 ivi_layout_surfaceSetPosition(struct ivi_layout_surface *ivisurf,
751                                  int32_t *pPosition);
752
753 /**
754  * \brief Get the horizontal and vertical position of the surface.
755  *
756  * \return  0 if the method call was successful
757  * \return -1 if the method call was failed
758  */
759 int32_t
760 ivi_layout_surfaceGetPosition(struct ivi_layout_surface *ivisurf,
761                                  int32_t *pPosition);
762
763 /**
764  * \brief Sets the orientation of a surface.
765  *
766  * \return  0 if the method call was successful
767  * \return -1 if the method call was failed
768  */
769 int32_t
770 ivi_layout_surfaceSetOrientation(struct ivi_layout_surface *ivisurf,
771                                     int32_t orientation);
772
773 /**
774  * \brief Gets the orientation of a surface.
775  *
776  * \return  0 if the method call was successful
777  * \return -1 if the method call was failed
778  */
779 int32_t
780 ivi_layout_surfaceGetOrientation(struct ivi_layout_surface *ivisurf,
781                                     int32_t *pOrientation);
782
783 /**
784  * \brief Gets the pixelformat of a surface.
785  *
786  * \return  0 if the method call was successful
787  * \return -1 if the method call was failed
788  */
789 int32_t
790 ivi_layout_surfaceGetPixelformat(struct ivi_layout_layer *ivisurf,
791                                     int32_t *pPixelformat);
792
793 /**
794  * \brief Sets the color value which defines the transparency value of a surface.
795  *
796  * \return  0 if the method call was successful
797  * \return -1 if the method call was failed
798  */
799 int32_t
800 ivi_layout_surfaceSetChromaKey(struct ivi_layout_surface *ivisurf,
801                                   int32_t* pColor);
802
803 /**
804  * \brief Add a layer to a screen which is currently managed by the service
805  *
806  * \return  0 if the method call was successful
807  * \return -1 if the method call was failed
808  */
809 int32_t
810 ivi_layout_screenAddLayer(struct ivi_layout_screen *iviscrn,
811                              struct ivi_layout_layer *addlayer);
812
813 /**
814  * \brief Sets render order of layers on a display
815  *
816  * \return  0 if the method call was successful
817  * \return -1 if the method call was failed
818  */
819 int32_t
820 ivi_layout_screenSetRenderOrder(struct ivi_layout_screen *iviscrn,
821                                    struct ivi_layout_layer **pLayer,
822                                    const int32_t number);
823
824 /**
825  * \brief Enable or disable a rendering optimization
826  *
827  * \return  0 if the method call was successful
828  * \return -1 if the method call was failed
829  */
830 int32_t
831 ivi_layout_SetOptimizationMode(uint32_t id, int32_t mode);
832
833 /**
834  * \brief Get the current enablement for an optimization
835  *
836  * \return  0 if the method call was successful
837  * \return -1 if the method call was failed
838  */
839 int32_t
840 ivi_layout_GetOptimizationMode(uint32_t id, int32_t *pMode);
841
842 /**
843  * \brief register for notification on property changes of layer
844  *
845  * \return  0 if the method call was successful
846  * \return -1 if the method call was failed
847  */
848 int32_t
849 ivi_layout_layerAddNotification(struct ivi_layout_layer *ivilayer,
850                                    layerPropertyNotificationFunc callback,
851                                    void *userdata);
852
853 /**
854  * \brief remove notification on property changes of layer
855  *
856  * \return  0 if the method call was successful
857  * \return -1 if the method call was failed
858  */
859 int32_t
860 ivi_layout_layerRemoveNotification(struct ivi_layout_layer *ivilayer);
861
862 /**
863  * \brief Get the surface properties
864  *
865  * \return  0 if the method call was successful
866  * \return -1 if the method call was failed
867  */
868 int32_t
869 ivi_layout_getPropertiesOfSurface(struct ivi_layout_surface *ivisurf,
870                 struct ivi_layout_SurfaceProperties *pSurfaceProperties);
871
872 /**
873  * \brief Add a surface to a layer which is currently managed by the service
874  *
875  * \return  0 if the method call was successful
876  * \return -1 if the method call was failed
877  */
878 int32_t
879 ivi_layout_layerAddSurface(struct ivi_layout_layer *ivilayer,
880                               struct ivi_layout_surface *addsurf);
881
882 /**
883  * \brief Removes a surface from a layer which is currently managed by the service
884  *
885  * \return  0 if the method call was successful
886  * \return -1 if the method call was failed
887  */
888 int32_t
889 ivi_layout_layerRemoveSurface(struct ivi_layout_layer *ivilayer,
890                                  struct ivi_layout_surface *remsurf);
891
892 /**
893  * \brief Set the area of a surface which should be used for the rendering.
894  *
895  * \return  0 if the method call was successful
896  * \return -1 if the method call was failed
897  */
898 int32_t
899 ivi_layout_surfaceSetSourceRectangle(struct ivi_layout_surface *ivisurf,
900                                         int32_t x, int32_t y,
901                                         int32_t width, int32_t height);
902
903 /**
904  * \brief get weston_output from ivi_layout_screen.
905  *
906  * \return (struct weston_screen *)
907  *              if the method call was successful
908  * \return NULL if the method call was failed
909  */
910 struct weston_output *
911 ivi_layout_screenGetOutput(struct ivi_layout_screen *);
912
913 struct weston_surface *
914 ivi_layout_surfaceGetWestonSurface(struct ivi_layout_surface *ivisurf);
915
916 int32_t
917 ivi_layout_surfaceGetSize(struct ivi_layout_surface *ivisurf, int32_t *width, int32_t *height, int32_t *stride);
918
919 int32_t
920 ivi_layout_layerSetTransition(struct ivi_layout_layer *ivilayer,
921                               enum ivi_layout_transition_type type,
922                               uint32_t duration);
923
924 int32_t
925 ivi_layout_layerSetFadeInfo(struct ivi_layout_layer* layer,
926                                     uint32_t is_fade_in,
927                                     double start_alpha, double end_alpha);
928
929 int32_t
930 ivi_layout_surfaceSetTransition(struct ivi_layout_surface *ivisurf,
931                                 enum ivi_layout_transition_type type,
932                                 uint32_t duration);
933
934 int32_t
935 ivi_layout_surfaceSetTransitionDuration(struct ivi_layout_surface *ivisurf,uint32_t duration);
936
937 /**
938  * \brief Commit all changes and execute all enqueued commands since last commit.
939  *
940  * \return  0 if the method call was successful
941  * \return -1 if the method call was failed
942  */
943 int32_t
944 ivi_layout_commitChanges(void);
945
946 #ifdef __cplusplus
947 } /**/
948 #endif /* __cplusplus */
949
950 #endif /* _IVI_LAYOUT_EXPORT_H_ */