summaryrefslogtreecommitdiff
path: root/LayerManagerClient/ilmClient/include/ilm_types.h
blob: 321925a58cdbe36bb4bc175530bb5708b88ac5c1 (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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
/***************************************************************************
*
* Copyright 2010,2011 BMW Car IT GmbH
* Copyright (C) 2012 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*        http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
****************************************************************************/
#ifndef _ILM_TYPES_H_
#define _ILM_TYPES_H_

#include "ilm_client_platform.h"

/**
 * convenience macro to access single bits of a bitmask
 */
#define BIT(x) (1 << (x))


/**
 * \brief Represent the logical true value
 * \ingroup ilmClient
 **/
#define ILM_TRUE     1u

/**
 * \brief Represent the logical false value
 * \ingroup ilmClient
 **/
#define ILM_FALSE     0u

/**
 * \brief Enumeration on possible error codes
 * \ingroup ilmClient
 **/
typedef enum e_ilmErrorTypes
{
    ILM_SUCCESS = 0,                  /*!< ErrorCode if the method call was successful */
    ILM_FAILED= 1,                    /*!< ErrorCode if the method call has failed */
    ILM_ERROR_INVALID_ARGUMENTS = 2,  /*!< ErrorCode if the method was called with invalid arguments */
    ILM_ERROR_ON_CONNECTION = 3       /*!< ErrorCode if connection error has occured */
} ilmErrorTypes;

/**
 * \brief Enumeration for supported pixelformats
 * \ingroup ilmClient
 **/
typedef enum e_ilmPixelFormat
{
    ILM_PIXELFORMAT_R_8 = 0,           /*!< Pixelformat value, to describe a 8 bit luminance surface */
    ILM_PIXELFORMAT_RGB_888 = 1,       /*!< Pixelformat value, to describe a 24 bit rgb surface */
    ILM_PIXELFORMAT_RGBA_8888 =2,      /*!< Pixelformat value, to describe a 24 bit rgb surface with 8 bit alpha */
    ILM_PIXELFORMAT_RGB_565 = 3,       /*!< Pixelformat value, to describe a 16 bit rgb surface */
    ILM_PIXELFORMAT_RGBA_5551 = 4,     /*!< Pixelformat value, to describe a 16 bit rgb surface, with binary mask */
    ILM_PIXELFORMAT_RGBA_6661 = 5,     /*!< Pixelformat value, to describe a 18 bit rgb surface, with binars mask */
    ILM_PIXELFORMAT_RGBA_4444 = 6,     /*!< Pixelformat value, to describe a 12 bit rgb surface, with 4 bit alpha */
    ILM_PIXEL_FORMAT_UNKNOWN = 7       /*!< Pixelformat not known */
} ilmPixelFormat;

/**
 * \brief Enumeration for supported layertypes
 * \ingroup ilmClient
 **/
typedef enum e_ilmLayerType
{
    ILM_LAYERTYPE_UNKNOWN = 0,         /*!< LayerType not known */
    ILM_LAYERTYPE_HARDWARE = 1,        /*!< LayerType value, to describe a hardware layer */
    ILM_LAYERTYPE_SOFTWARE2D = 2,      /*!< LayerType value, to describe a redirected offscreen buffer layer */
    ILM_LAYERTYPE_SOFTWARE2_5D = 3     /*!< LayerType value, to describe a redirected offscreen buffer layer, which can be rotated in the 3d space */
} ilmLayerType;

/**
 * \brief Enumeration for supported graphical objects
 * \ingroup ilmClient
 **/
typedef enum e_ilmObjectType
{
    ILM_SURFACE = 0,                   /*!< Surface Object Type */
    ILM_LAYER = 1,                     /*!< Layer Object Type */
    ILM_SURFACEGROUP = 2,              /*!< SurfaceGroup Object Type */
    ILM_LAYERGROUP = 3                 /*!< LayerGroup Object Type */
} ilmObjectType;

/**
 * \brief Enumeration for supported orientations of booth, surface and layer
 * \ingroup ilmClient
 **/
typedef enum e_ilmOrientation
{
    ILM_ZERO = 0,                       /*!< Orientation value, to describe 0 degree of rotation regarding the z-axis*/
    ILM_NINETY = 1,                     /*!< Orientation value, to describe 90 degree of rotation regarding the z-axis*/
    ILM_ONEHUNDREDEIGHTY = 2,           /*!< Orientation value, to describe 180 degree of rotation regarding the z-axis*/
    ILM_TWOHUNDREDSEVENTY = 3           /*!< Orientation value, to describe 270 degree of rotation regarding the z-axis*/
} ilmOrientation;

/**
 * \brief Identifier of different input device types. Can be used as a bitmask.
 * \ingroup ilmClient
 */
typedef unsigned int ilmInputDevice;
#define ILM_INPUT_DEVICE_KEYBOARD   ((ilmInputDevice) 1 << 0)
#define ILM_INPUT_DEVICE_POINTER    ((ilmInputDevice) 1 << 1)
#define ILM_INPUT_DEVICE_TOUCH      ((ilmInputDevice) 1 << 2)
#define ILM_INPUT_DEVICE_ALL        ((ilmInputDevice) ~0)


/**
 * \brief Typedef for representing a layer
 * \ingroup ilmClient
 **/
typedef t_ilm_uint     t_ilm_layer;

/**
 * \brief Typedef for representing a surface
 * \ingroup ilmClient
 **/
typedef t_ilm_uint     t_ilm_surface;

/**
 * \brief Typedef for representing a layergroup
 * \ingroup ilmClient
 **/
typedef t_ilm_uint     t_ilm_layergroup;

/**
 * \brief Typedef for representing a surfacegroup
 * \ingroup ilmClient
 **/
typedef t_ilm_uint     t_ilm_surfacegroup;

/**
 * \brief Typedef for representing a display number
 * \ingroup ilmClient
 **/
typedef t_ilm_uint     t_ilm_display;

/**
 * \brief Typedef for representing layer capabilities
 * \ingroup ilmClient
 **/
typedef t_ilm_uint     t_ilm_layercapabilities;

/**
 * \brief Typedef for representing a native window handle
 * \ingroup ilmClient
 **/
typedef t_ilm_ulong    t_ilm_nativehandle;

/**
 * \brief Typedef for representing a ascii string
 * \ingroup ilmClient
 **/
typedef t_ilm_char* t_ilm_string;

/**
 * \brief Typedef for representing a const ascii string
 * \ingroup ilmClient
 **/
typedef t_ilm_const_char* t_ilm_const_string;

/**
 * \brief Typedef for representing a the surface properties structure
 * \ingroup ilmClient
 **/
struct ilmSurfaceProperties
{
    t_ilm_float opacity;                    /*!< opacity value of the surface */
    t_ilm_uint sourceX;                     /*!< x source position value of the surface */
    t_ilm_uint sourceY;                     /*!< y source position value of the surface */
    t_ilm_uint sourceWidth;                 /*!< source width value of the surface */
    t_ilm_uint sourceHeight;                /*!< source height value of the surface */
    t_ilm_uint origSourceWidth;             /*!< original source width value of the surface */
    t_ilm_uint origSourceHeight;            /*!< original source height value of the surface */
    t_ilm_uint destX;                       /*!< x destination position value of the surface */
    t_ilm_uint destY;                       /*!< y desitination position value of the surface */
    t_ilm_uint destWidth;                   /*!< destination width value of the surface */
    t_ilm_uint destHeight;                  /*!< destination height value of the surface */
    ilmOrientation orientation;             /*!< orientation value of the surface */
    t_ilm_bool visibility;                  /*!< visibility value of the surface */
    t_ilm_uint frameCounter;                /*!< already rendered frames of surface */
    t_ilm_uint drawCounter;                 /*!< content updates of surface */
    t_ilm_uint updateCounter;               /*!< content updates of surface */
    t_ilm_uint pixelformat;                 /*!< pixel format of surface */
    t_ilm_uint nativeSurface;               /*!< native surface handle of surface */
    ilmInputDevice inputDevicesAcceptance;  /*!< bitmask of ilmInputDevice from which the surface can accept input events */
    t_ilm_bool chromaKeyEnabled;            /*!< chromakey validness of the surface */
    t_ilm_uint chromaKeyRed;                /*!< chromakey's red value of the surface */
    t_ilm_uint chromaKeyGreen;              /*!< chromakey's green value of the surface */
    t_ilm_uint chromaKeyBlue;               /*!< chromakey's blue value of the surface */
    t_ilm_int  creatorPid;                  /*!< process id of application that created this surface */
};

/**
 * \brief Typedef for representing a the layer properties structure
 * \ingroup ilmClient
 **/
struct ilmLayerProperties
{
    t_ilm_float opacity;         /*!< opacity value of the layer */
    t_ilm_uint sourceX;          /*!< x source position value of the layer */
    t_ilm_uint sourceY;          /*!< y source position value of the layer */
    t_ilm_uint sourceWidth;      /*!< source width value of the layer */
    t_ilm_uint sourceHeight;     /*!< source height value of the layer */
    t_ilm_uint origSourceWidth;  /*!< original source width value of the layer */
    t_ilm_uint origSourceHeight; /*!< original source height value of the layer */
    t_ilm_uint destX;            /*!< x destination position value of the layer */
    t_ilm_uint destY;            /*!< y desitination position value of the layer */
    t_ilm_uint destWidth;        /*!< destination width value of the layer */
    t_ilm_uint destHeight;       /*!< destination height value of the layer */
    ilmOrientation orientation;  /*!< orientation value of the layer */
    t_ilm_bool visibility;       /*!< visibility value of the layer */
    t_ilm_uint type;             /*!< type of layer */
    t_ilm_bool chromaKeyEnabled; /*!< chromakey validness of the layer */
    t_ilm_uint chromaKeyRed;     /*!< chromakey's red value of the layer */
    t_ilm_uint chromaKeyGreen;   /*!< chromakey's green value of the layer */
    t_ilm_uint chromaKeyBlue;    /*!< chromakey's blue value of the layer */
    t_ilm_int  creatorPid;       /*!< process id of application that created this layer */
};

/**
 * enum representing all possible incoming events for ilmClient and
 * Communicator Plugin
 */
typedef enum e_t_ilm_message_type
{
    IpcMessageTypeNone = 0,
    IpcMessageTypeCommand,
    IpcMessageTypeConnect,
    IpcMessageTypeDisconnect,
    IpcMessageTypeNotification,
    IpcMessageTypeError,
    IpcMessageTypeShutdown
} t_ilm_message_type;

/**
 * Typedef for opaque handling of client handles within an IpcModule
 */
typedef void* t_ilm_client_handle;

/**
 * Typedef for opaque handling of messages from IpcModule
 */
typedef void* t_ilm_message;

/**
 * enum representing the possible flags for changed properties in notification callbacks.
 */
typedef enum
{
    ILM_NOTIFICATION_VISIBILITY         = BIT(1),
    ILM_NOTIFICATION_OPACITY            = BIT(2),
    ILM_NOTIFICATION_ORIENTATION        = BIT(3),
    ILM_NOTIFICATION_SOURCE_RECT        = BIT(4),
    ILM_NOTIFICATION_DEST_RECT          = BIT(5),
    ILM_NOTIFICATION_ALL                = 0xffff
} t_ilm_notification_mask;

/**
 * Typedef for notification callback on property changes of a layer
 */
typedef void(*layerNotificationFunc)(t_ilm_layer layer,
                                     struct ilmLayerProperties*,
                                     t_ilm_notification_mask mask);

/**
 * Typedef for notification callback on property changes of a surface
 */
typedef void(*surfaceNotificationFunc)(t_ilm_surface surface,
                                     struct ilmSurfaceProperties*,
                                     t_ilm_notification_mask mask);

#endif // _ILM_TYPES_H_