2 * Copyright (C) 2013 DENSO CORPORATION
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.
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.
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,
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.
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.
45 #ifndef _IVI_LAYOUT_H_
46 #define _IVI_LAYOUT_H_
50 #endif /* __cplusplus */
52 #include "compositor.h"
54 struct ivi_layout_surface;
55 struct ivi_layout_layer;
56 struct ivi_layout_screen;
58 struct ivi_layout_SurfaceProperties
64 uint32_t sourceHeight;
65 uint32_t origSourceWidth;
66 uint32_t origSourceHeight;
77 uint32_t frameCounter;
79 uint32_t updateCounter;
81 uint32_t nativeSurface;
82 uint32_t inputDevicesAcceptance;
83 uint32_t chromaKeyEnabled;
84 uint32_t chromaKeyRed;
85 uint32_t chromaKeyGreen;
86 uint32_t chromaKeyBlue;
88 int32_t transitionType;
89 uint32_t transitionDuration;
92 struct ivi_layout_LayerProperties
98 uint32_t sourceHeight;
99 uint32_t origSourceWidth;
100 uint32_t origSourceHeight;
105 uint32_t orientation;
108 uint32_t chromaKeyEnabled;
109 uint32_t chromaKeyRed;
110 uint32_t chromaKeyGreen;
111 uint32_t chromaKeyBlue;
113 int32_t transitionType;
114 uint32_t transitionDuration;
120 enum ivi_layout_warning_flag {
121 IVI_WARNING_INVALID_WL_SURFACE,
122 IVI_WARNING_IVI_ID_IN_USE
125 enum ivi_layout_notification_mask;
126 typedef void(*surfacePropertyNotificationFunc)(struct ivi_layout_surface *ivisurf,
127 struct ivi_layout_SurfaceProperties *prop,
128 enum ivi_layout_notification_mask mask,
131 struct ivi_layout_interface {
132 struct weston_view* (*get_weston_view)(struct ivi_layout_surface *surface);
133 void (*surfaceConfigure)(struct ivi_layout_surface *ivisurf,
134 int32_t width, int32_t height);
135 int32_t (*surfaceSetNativeContent)(struct weston_surface *wl_surface,
138 uint32_t id_surface);
139 struct ivi_layout_surface* (*surfaceCreate)(struct weston_surface *wl_surface,
140 uint32_t id_surface);
141 struct ivi_layout_surface* (*surfaceFind)(struct weston_surface *wl_surface);
142 int32_t (*surfaceAddNotification)(struct ivi_layout_surface *ivisurf,
143 surfacePropertyNotificationFunc callback,
145 int32_t (*surfaceRemoveNotification)(struct ivi_layout_surface *ivisurf);
147 void (*initWithCompositor)(struct weston_compositor *ec);
148 void (*emitWarningSignal)(uint32_t id_surface,
149 enum ivi_layout_warning_flag flag);
152 extern struct ivi_layout_interface ivi_layout_interface;
156 #endif /* __cplusplus */
158 #endif /* _IVI_LAYOUT_H_ */