summaryrefslogtreecommitdiff
path: root/ivi-shell/ivi-layout.h
blob: 21762ad0f7cea3a7d53f1ad7e11414206ecd5adb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
 * Copyright (C) 2013 DENSO CORPORATION
 *
 * Permission to use, copy, modify, distribute, and sell this software and
 * its documentation for any purpose is hereby granted without fee, provided
 * that the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of the copyright holders not be used in
 * advertising or publicity pertaining to distribution of the software
 * without specific, written prior permission.  The copyright holders make
 * no representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 *
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/**
 * The ivi-layout library supports API set of controlling properties of
 * surface and layer which groups surfaces. An unique ID whose type is integer
 * is required to create surface and layer. With the unique ID, surface and
 * layer are identified to control them. The API set consists of APIs to control
 * properties of surface and layers about followings,
 * - visibility.
 * - opacity.
 * - clipping (x,y,width,height).
 * - position and size of it to be displayed.
 * - orientation per 90 degree.
 * - add or remove surfaces to a layer.
 * - order of surfaces/layers in layer/screen to be displayed.
 * - commit to apply property changes.
 * - notifications of property change.
 *
 * Management of surfaces and layers grouping these surfaces are common way in
 * In-Vehicle Infotainment system, which integrate several domains in one system.
 * A layer is allocated to a domain in order to control application surfaces
 * grouped to the layer all together.
 */

#ifndef _IVI_LAYOUT_H_
#define _IVI_LAYOUT_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "compositor.h"

struct ivi_layout_surface;
struct ivi_layout_layer;
struct ivi_layout_screen;

struct ivi_layout_SurfaceProperties
{
    float    opacity;
    uint32_t sourceX;
    uint32_t sourceY;
    uint32_t sourceWidth;
    uint32_t sourceHeight;
    uint32_t origSourceWidth;
    uint32_t origSourceHeight;
    int32_t  destX;
    int32_t  destY;
    uint32_t destWidth;
    uint32_t destHeight;
    uint32_t orientation;
    uint32_t visibility;
    uint32_t frameCounter;
    uint32_t drawCounter;
    uint32_t updateCounter;
    uint32_t pixelformat;
    uint32_t nativeSurface;
    uint32_t inputDevicesAcceptance;
    uint32_t chromaKeyEnabled;
    uint32_t chromaKeyRed;
    uint32_t chromaKeyGreen;
    uint32_t chromaKeyBlue;
    int32_t  creatorPid;
};

struct ivi_layout_LayerProperties
{
    float    opacity;
    uint32_t sourceX;
    uint32_t sourceY;
    uint32_t sourceWidth;
    uint32_t sourceHeight;
    uint32_t origSourceWidth;
    uint32_t origSourceHeight;
    int32_t  destX;
    int32_t  destY;
    uint32_t destWidth;
    uint32_t destHeight;
    uint32_t orientation;
    uint32_t visibility;
    uint32_t type;
    uint32_t chromaKeyEnabled;
    uint32_t chromaKeyRed;
    uint32_t chromaKeyGreen;
    uint32_t chromaKeyBlue;
    int32_t  creatorPid;
};

struct ivi_layout_interface {
	struct weston_view* (*get_weston_view)(struct ivi_layout_surface *surface);
	void (*surfaceConfigure)(struct ivi_layout_surface *ivisurf,
				 uint32_t width, uint32_t height);
	int32_t (*surfaceSetNativeContent)(struct weston_surface *wl_surface,
					   uint32_t width,
                                           uint32_t height,
                                           uint32_t id_surface);
	struct ivi_layout_surface* (*surfaceCreate)(struct weston_surface *wl_surface,
							      uint32_t id_surface);
	void (*initWithCompositor)(struct weston_compositor *ec);
};

WL_EXPORT struct ivi_layout_interface ivi_layout_interface;

#ifdef __cplusplus
} /**/
#endif /* __cplusplus */

#endif /* _IVI_LAYOUT_H_ */