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