2 * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 * @brief header file of System Controller
11 * for privilege and general applications
16 #ifndef _ICO_SYC_TYPE_H_
17 #define _ICO_SYC_TYPE_H_
19 #include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
25 /*============================================================================*/
27 /*============================================================================*/
28 #if defined(__GNUC__) && __GNUC__ >= 4
29 #define ICO_API __attribute__ ((visibility("default")))
34 /*============================================================================*/
36 /*============================================================================*/
40 typedef enum _event_id {
41 ICO_SYC_EV_WIN_CREATE = 1, /* create window */
42 ICO_SYC_EV_WIN_DESTROY = 2, /* destroy window */
43 ICO_SYC_EV_WIN_ACTIVE = 3, /* active window */
44 ICO_SYC_EV_WIN_ATTR_CHANGE = 4, /* change window attribute */
45 ICO_SYC_EV_THUMB_CHANGE = 5, /* map thumbnail data */
46 ICO_SYC_EV_THUMB_UNMAP = 6, /* unmap thumbnail data */
47 ICO_SYC_EV_THUMB_ERROR = 7, /* error map thumbnail */
48 ICO_SYC_EV_LAYER_ATTR_CHANGE = 8, /* change layer attribute */
49 ICO_SYC_EV_USERLIST = 9, /* notify the user list */
50 ICO_SYC_EV_AUTH_FAIL = 10, /* fail in the user authentication */
51 ICO_SYC_EV_RES_ACQUIRE = 11, /* acquired resource */
52 ICO_SYC_EV_RES_DEPRIVE = 12, /* deprived resource */
53 ICO_SYC_EV_RES_WAITING = 13, /* waiting resource */
54 ICO_SYC_EV_RES_REVERT = 14, /* reverted resource */
55 ICO_SYC_EV_RES_RELEASE = 15, /* released resource */
56 ICO_SYC_EV_RES_WINDOW_ID = 16, /* notice window id resource */
57 ICO_SYC_EV_INPUT_SET = 17, /* set input region */
58 ICO_SYC_EV_INPUT_UNSET = 18, /* unset input region */
59 ICO_SYC_EV_LASTINFO = 19, /* notify the last information */
60 ICO_SYC_EV_STATE_CHANGE = 20, /* notify changed state */
61 ICO_SYC_EV_WIN_NAME = 21 /* notify window name */
65 * general fixed value for window attribute
66 * @ICO_SYC_WIN_NOCHANGE: no change value
68 typedef enum _win_value {
69 ICO_SYC_WIN_NOCHANGE = 99999999
70 } ico_syc_win_value_e;
73 * thumbnail data format
74 * @ICO_SYC_THUMB_FORMAT_ARGB: argb format
75 * @ICO_SYC_THUMB_FORMAT_XRGB: xrgb format
77 typedef enum _thumb_format {
78 ICO_SYC_THUMB_FORMAT_ARGB = WL_SHM_FORMAT_ARGB8888,
79 ICO_SYC_THUMB_FORMAT_XRGB = WL_SHM_FORMAT_XRGB8888
80 } ico_syc_thumb_format_e;
83 * window raise/lower status
84 * @ICO_SYC_WIN_RAISE_RAISE: raise the surface
85 * @ICO_SYC_WIN_RAISE_LOWER: lower the surface
86 * @ICO_SYC_WIN_RAISE_NOCHANGE: order of showing surface is not change
88 typedef enum _window_raise {
89 ICO_SYC_WIN_RAISE_RAISE = 1,
90 ICO_SYC_WIN_RAISE_LOWER = 0,
91 ICO_SYC_WIN_RAISE_NOCHANGE = 9
92 } ico_syc_win_raise_e;
95 * window show/hide status
96 * @ICO_SYC_WIN_VISIBLE_SHOW: show the surface
97 * @ICO_SYC_WIN_VISIBLE_HIDE: hide the surface
98 * @ICO_SYC_WIN_VISIBLE_NOCHANGE: show/hide status is not change
100 typedef enum _window_visible {
101 ICO_SYC_WIN_VISIBLE_SHOW = 1,
102 ICO_SYC_WIN_VISIBLE_HIDE = 0,
103 ICO_SYC_WIN_VISIBLE_NOCHANGE = 9
104 } ico_syc_win_visible_e;
108 * @ICO_SYC_WIN_HINT_HINT: hint information(no change)
109 * @ICO_SYC_WIN_HINT_CHANGE: real changed
111 typedef enum _window_change_hint {
112 ICO_SYC_WIN_HINT_HINT = 1,
113 ICO_SYC_WIN_HINT_CHANGE = 0
114 } ico_syc_win_change_hint_e;
117 * type of window active select
118 * @ICO_SYC_WIN_ACTIVE_NONE: no device(surface not active)
119 * @ICO_SYC_WIN_ACTIVE_POINTER: active by pointing device(mouse)
120 * @ICO_SYC_WIN_ACTIVE_TOUCH: active by touchpanel device
122 typedef enum _window_active_select {
123 ICO_SYC_WIN_ACTIVE_NONE = 0,
124 ICO_SYC_WIN_ACTIVE_POINTER = 1,
125 ICO_SYC_WIN_ACTIVE_TOUCH = 2
126 } ico_syc_win_act_select_e;
129 * layer show/hide status
130 * @ICO_SYC_LAYER_VISIBLE_SHOW: show the layer
131 * @ICO_SYC_LAYER_VISIBLE_HIDE: hide the layer
133 typedef enum _layer_visible {
134 ICO_SYC_LAYER_VISIBLE_SHOW = 1,
135 ICO_SYC_LAYER_VISIBLE_HIDE = 0,
136 ICO_SYC_LAYER_VISIBLE_NOCHANGE = 9
137 } ico_syc_layer_visible_e;
140 * surface animation on/off
141 * @ICO_SYC_ANIMATION_ON: surface animation
142 * @ICO_SYC_ANIMATION_OFF: no surface animation
144 typedef enum _surface_animation {
145 ICO_SYC_ANIMATION_ON = 1,
146 ICO_SYC_ANIMATION_OFF = 0
147 } ico_syc_surface_animation;
150 * surface animation target
151 * @ICO_SYC_ANIMATION_TYPE_HIDE:
152 * @ICO_SYC_ANIMATION_TYPE_SHOW:
153 * @ICO_SYC_ANIMATION_TYPE_MOVE:
154 * @ICO_SYC_ANIMATION_TYPE_RESIZE:
155 * @ICO_SYC_ANIMATION_TYPE_ALL:
157 typedef enum _surface_animation_type {
158 ICO_SYC_ANIMATION_TYPE_HIDE = 1,
159 ICO_SYC_ANIMATION_TYPE_SHOW = 2,
160 ICO_SYC_ANIMATION_TYPE_MOVE = 4,
161 ICO_SYC_ANIMATION_TYPE_RESIZE = 8,
162 ICO_SYC_ANIMATION_TYPE_ALL = 0xff
163 } ico_syc_surface_animation_type;
166 * type of window aspect
167 * @ICO_SYC_WIN_ASPECT_FIXED: fixed aspect
168 * @ICO_SYC_WIN_ASPECT_ALIGN_LEFT: left align
169 * @ICO_SYC_WIN_ASPECT_ALIGN_RIGHT: right align
170 * @ICO_SYC_WIN_ASPECT_ALIGN_TOP: top align
171 * @ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM: bottom align
173 typedef enum _window_aspect {
174 ICO_SYC_WIN_ASPECT_FIXED = 16,
175 ICO_SYC_WIN_ASPECT_ALIGN_LEFT = 1,
176 ICO_SYC_WIN_ASPECT_ALIGN_RIGHT = 2,
177 ICO_SYC_WIN_ASPECT_ALIGN_TOP = 4,
178 ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM = 8,
179 } ico_syc_win_aspect_e;
184 typedef enum _system_state {
185 ICO_SYC_STATE_REGULATION = 1, /**< regulation state */
186 ICO_SYC_STATE_NIGHTMODE = 2 /**< night mode state */
187 } ico_syc_system_state_e;
192 typedef enum _state_onoff {
193 ICO_SYC_STATE_OFF = 0, /**< state of off */
194 ICO_SYC_STATE_ON = 1 /**< state of on */
195 } ico_syc_state_onoff_e;
197 /*============================================================================*/
199 /*============================================================================*/
201 * window move information (zone/position/size)
203 typedef struct _win_move {
204 char *zone; /* area of showing application window */
205 int layer; /* layer of showing application window */
206 int pos_x; /* window's display position (x) */
207 int pos_y; /* window's display position (y) */
208 int width; /* window width */
209 int height; /* window height */
210 } ico_syc_win_move_t;
215 typedef struct _win_info {
216 char *appid; /* application id */
217 char *name; /* window's surface name */
218 int surface; /* window's surface id */
219 } ico_syc_win_info_t;
224 typedef struct _win_attr {
225 char *appid; /* application id */
226 char *name; /* window's surface name */
227 char *zone; /* window's current zone name */
228 int surface; /* window's surface id */
229 int nodeid; /* ecu number and display number in the ecu */
230 int layer; /* id of layer that the application's window is on */
231 int pos_x; /* window's display position (x) */
232 int pos_y; /* window's display position (y) */
233 int width; /* window width */
234 int height; /* window height */
235 int raise; /* changed order showing surface in the layer */
236 int visible; /* visible status */
237 int active; /* window active status */
238 } ico_syc_win_attr_t;
241 * thumbnail information
242 * (notify from callback function)
244 typedef struct _thumb_info {
245 char *appid; /* application id */
246 int surface; /* window's surface id */
247 int type; /* buffer type(ICO_WINDOW_MGR_MAP_TYPE_EGL/SHM/PIXEL)*/
248 int width; /* window width */
249 int height; /* window height */
250 int stride; /* byte par line of frame buffer */
251 int format; /* format of buffer */
252 } ico_syc_thumb_info_t;
257 typedef struct _layer_attr {
258 int layer; /* layer id */
259 int visible; /* visible status */
260 } ico_syc_layer_attr_t;
265 typedef struct _user_list {
266 int user_num; /* number of user */
267 char **userlist; /* address of user list */
268 char *user_login; /* name of login user */
269 } ico_syc_userlist_t;
272 * window resource information
274 typedef struct _res_win {
275 char *ECU; /* name to identify ECU */
276 char *display; /* name to identify Display in ECU */
277 char *layer; /* name to identify Layer in Display */
278 char *layout; /* name to identify Layout in Layer */
279 char *area; /* name to Output position in Layout */
280 char *dispatchApp; /* dispatch of application */
281 char *role; /* role of notice */
282 uint32_t resourceId;/* ID number of resource(surface id) */
283 } ico_syc_res_window_t;
286 * sound resource information
288 typedef struct _res_sound {
289 char *zone; /* area of playing sound */
290 char *name; /* sound stream name */
291 char *id; /* sound id */
292 int adjust; /* adjust action */
293 } ico_syc_res_sound_t;
296 * input resource information
298 typedef struct _res_input {
299 char *name; /* input device name */
300 int event; /* input event id */
301 } ico_syc_res_input_t;
304 * input region information
306 #define ICO_SYC_MAX_WINNAME_LEN 40
307 typedef struct _input_region {
308 char winname[ICO_SYC_MAX_WINNAME_LEN];
309 /* target window name */
310 short pos_x; /* input region X coordinate of surface */
311 short pos_y; /* input region Y coordinate of surface */
312 short width; /* input region's width */
313 short height; /* input region's height */
314 short hotspot_x; /* hotspot of X relative coordinate */
315 short hotspot_y; /* hotspot of Y relative coordinate */
316 short cursor_x; /* cursor region X coordinate */
317 short cursor_y; /* cursor region X coordinate */
318 short cursor_width; /* cursor region width */
319 short cursor_height; /* cursor region height */
320 int attr; /* region attributes(currently unused) */
321 } ico_syc_input_region_t;
324 * resource(window/sound/input) information
326 typedef struct _res_info {
327 ico_syc_res_window_t *window; /* window resource information */
328 ico_syc_res_sound_t *sound; /* sound resource information */
329 ico_syc_res_input_t *input; /* input resource information */
330 } ico_syc_res_info_t;
333 * notify changed state information
335 typedef struct _state_info {
338 } ico_syc_state_info_t;
340 /*============================================================================*/
341 /* callback function */
342 /*============================================================================*/
343 typedef void (*ico_syc_callback_t) (const ico_syc_ev_e event,
350 #endif /*_ICO_SYC_TYPE_H_*/
351 /* vim:set expandtab ts=4 sw=4: */