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_
20 #include <wayland-client-protocol.h>
26 /*============================================================================*/
28 /*============================================================================*/
29 #if defined(__GNUC__) && __GNUC__ >= 4
30 #define ICO_API __attribute__ ((visibility("default")))
35 /*============================================================================*/
37 /*============================================================================*/
41 typedef enum _event_id {
42 ICO_SYC_EV_WIN_CREATE = 1, /* create window */
43 ICO_SYC_EV_WIN_DESTROY = 2, /* destroy window */
44 ICO_SYC_EV_WIN_ACTIVE = 3, /* active window */
45 ICO_SYC_EV_WIN_ATTR_CHANGE = 4, /* change window attribute */
46 ICO_SYC_EV_THUMB_CHANGE = 5, /* map thumbnail data */
47 ICO_SYC_EV_THUMB_UNMAP = 6, /* unmap thumbnail data */
48 ICO_SYC_EV_THUMB_ERROR = 7, /* error map thumbnail */
49 ICO_SYC_EV_LAYER_ATTR_CHANGE = 8, /* change layer attribute */
50 ICO_SYC_EV_USERLIST = 9, /* notify the user list */
51 ICO_SYC_EV_AUTH_FAIL = 10, /* fail in the user authentication */
52 ICO_SYC_EV_RES_ACQUIRE = 11, /* acquired resource */
53 ICO_SYC_EV_RES_DEPRIVE = 12, /* deprived resource */
54 ICO_SYC_EV_RES_WAITING = 13, /* waiting resource */
55 ICO_SYC_EV_RES_REVERT = 14, /* reverted resource */
56 ICO_SYC_EV_RES_RELEASE = 15, /* released resource */
57 ICO_SYC_EV_RES_WINDOW_ID = 16, /* notice window id resource */
58 ICO_SYC_EV_INPUT_SET = 17, /* set input region */
59 ICO_SYC_EV_INPUT_UNSET = 18, /* unset input region */
60 ICO_SYC_EV_LASTINFO = 19, /* notify the last information */
61 ICO_SYC_EV_STATE_CHANGE = 20, /* notify changed state */
62 ICO_SYC_EV_WIN_NAME = 21 /* notify window name */
66 * general fixed value for window attribute
67 * @ICO_SYC_WIN_NOCHANGE: no change value
69 typedef enum _win_value {
70 ICO_SYC_WIN_NOCHANGE = 99999999
71 } ico_syc_win_value_e;
74 * thumbnail data format
75 * @ICO_SYC_THUMB_FORMAT_ARGB: argb format
76 * @ICO_SYC_THUMB_FORMAT_XRGB: xrgb format
78 typedef enum _thumb_format {
79 ICO_SYC_THUMB_FORMAT_ARGB = WL_SHM_FORMAT_ARGB8888,
80 ICO_SYC_THUMB_FORMAT_XRGB = WL_SHM_FORMAT_XRGB8888
81 } ico_syc_thumb_format_e;
84 * window raise/lower status
85 * @ICO_SYC_WIN_RAISE_RAISE: raise the surface
86 * @ICO_SYC_WIN_RAISE_LOWER: lower the surface
87 * @ICO_SYC_WIN_RAISE_NOCHANGE: order of showing surface is not change
89 typedef enum _window_raise {
90 ICO_SYC_WIN_RAISE_RAISE = 1,
91 ICO_SYC_WIN_RAISE_LOWER = 0,
92 ICO_SYC_WIN_RAISE_NOCHANGE = 9
93 } ico_syc_win_raise_e;
96 * window show/hide status
97 * @ICO_SYC_WIN_VISIBLE_SHOW: show the surface
98 * @ICO_SYC_WIN_VISIBLE_HIDE: hide the surface
99 * @ICO_SYC_WIN_VISIBLE_NOCHANGE: show/hide status is not change
101 typedef enum _window_visible {
102 ICO_SYC_WIN_VISIBLE_SHOW = 1,
103 ICO_SYC_WIN_VISIBLE_HIDE = 0,
104 ICO_SYC_WIN_VISIBLE_NOCHANGE = 9
105 } ico_syc_win_visible_e;
109 * @ICO_SYC_WIN_HINT_HINT: hint information(no change)
110 * @ICO_SYC_WIN_HINT_CHANGE: real changed
112 typedef enum _window_change_hint {
113 ICO_SYC_WIN_HINT_HINT = 1,
114 ICO_SYC_WIN_HINT_CHANGE = 0
115 } ico_syc_win_change_hint_e;
118 * type of window active select
119 * @ICO_SYC_WIN_ACTIVE_NONE: no device(surface not active)
120 * @ICO_SYC_WIN_ACTIVE_POINTER: active by pointing device(mouse)
121 * @ICO_SYC_WIN_ACTIVE_TOUCH: active by touchpanel device
123 typedef enum _window_active_select {
124 ICO_SYC_WIN_ACTIVE_NONE = 0,
125 ICO_SYC_WIN_ACTIVE_POINTER = 1,
126 ICO_SYC_WIN_ACTIVE_TOUCH = 2
127 } ico_syc_win_act_select_e;
130 * layer show/hide status
131 * @ICO_SYC_LAYER_VISIBLE_SHOW: show the layer
132 * @ICO_SYC_LAYER_VISIBLE_HIDE: hide the layer
134 typedef enum _layer_visible {
135 ICO_SYC_LAYER_VISIBLE_SHOW = 1,
136 ICO_SYC_LAYER_VISIBLE_HIDE = 0,
137 ICO_SYC_LAYER_VISIBLE_NOCHANGE = 9
138 } ico_syc_layer_visible_e;
141 * surface animation on/off
142 * @ICO_SYC_ANIMATION_ON: surface animation
143 * @ICO_SYC_ANIMATION_OFF: no surface animation
145 typedef enum _surface_animation {
146 ICO_SYC_ANIMATION_ON = 1,
147 ICO_SYC_ANIMATION_OFF = 0
148 } ico_syc_surface_animation;
151 * surface animation target
152 * @ICO_SYC_ANIMATION_TYPE_HIDE:
153 * @ICO_SYC_ANIMATION_TYPE_SHOW:
154 * @ICO_SYC_ANIMATION_TYPE_MOVE:
155 * @ICO_SYC_ANIMATION_TYPE_RESIZE:
156 * @ICO_SYC_ANIMATION_TYPE_ALL:
158 typedef enum _surface_animation_type {
159 ICO_SYC_ANIMATION_TYPE_HIDE = 1,
160 ICO_SYC_ANIMATION_TYPE_SHOW = 2,
161 ICO_SYC_ANIMATION_TYPE_MOVE = 4,
162 ICO_SYC_ANIMATION_TYPE_RESIZE = 8,
163 ICO_SYC_ANIMATION_TYPE_ALL = 0xff
164 } ico_syc_surface_animation_type;
167 * type of window aspect
168 * @ICO_SYC_WIN_ASPECT_FIXED: fixed aspect
169 * @ICO_SYC_WIN_ASPECT_ALIGN_LEFT: left align
170 * @ICO_SYC_WIN_ASPECT_ALIGN_RIGHT: right align
171 * @ICO_SYC_WIN_ASPECT_ALIGN_TOP: top align
172 * @ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM: bottom align
174 typedef enum _window_aspect {
175 ICO_SYC_WIN_ASPECT_FIXED = 16,
176 ICO_SYC_WIN_ASPECT_ALIGN_LEFT = 1,
177 ICO_SYC_WIN_ASPECT_ALIGN_RIGHT = 2,
178 ICO_SYC_WIN_ASPECT_ALIGN_TOP = 4,
179 ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM = 8,
180 } ico_syc_win_aspect_e;
185 typedef enum _system_state {
186 ICO_SYC_STATE_REGULATION = 1, /**< regulation state */
187 ICO_SYC_STATE_NIGHTMODE = 2 /**< night mode state */
188 } ico_syc_system_state_e;
193 typedef enum _state_onoff {
194 ICO_SYC_STATE_OFF = 0, /**< state of off */
195 ICO_SYC_STATE_ON = 1 /**< state of on */
196 } ico_syc_state_onoff_e;
199 * window animation name
201 #define ICO_SYC_WIN_ANIMATION_FADE "Fade"
202 #define ICO_SYC_WIN_ANIMATION_SLIDE "Slide"
203 #define ICO_SYC_WIN_ANIMATION_SLIDE_TOTOP "Slide.toTop"
204 #define ICO_SYC_WIN_ANIMATION_SLIDE_TOBUTTOM "Slide.toButtom"
205 #define ICO_SYC_WIN_ANIMATION_SLIDE_TOLEFT "Slide.toLeft"
206 #define ICO_SYC_WIN_ANIMATION_SLIDE_TORIGHT "Slide.toRight"
208 /*============================================================================*/
210 /*============================================================================*/
212 * window move information (zone/position/size)
214 typedef struct _win_move {
215 char *zone; /* area of showing application window */
216 int layer; /* layer of showing application window */
217 int pos_x; /* window's display position (x) */
218 int pos_y; /* window's display position (y) */
219 int width; /* window width */
220 int height; /* window height */
221 } ico_syc_win_move_t;
226 typedef struct _win_info {
227 char *appid; /* application id */
228 char *name; /* window's surface name */
229 int surface; /* window's surface id */
230 } ico_syc_win_info_t;
235 typedef struct _win_attr {
236 char *appid; /* application id */
237 char *name; /* window's surface name */
238 char *zone; /* window's current zone name */
239 int surface; /* window's surface id */
240 int nodeid; /* ecu number and display number in the ecu */
241 int layer; /* id of layer that the application's window is on */
242 int pos_x; /* window's display position (x) */
243 int pos_y; /* window's display position (y) */
244 int width; /* window width */
245 int height; /* window height */
246 int raise; /* changed order showing surface in the layer */
247 int visible; /* visible status */
248 int active; /* window active status */
249 } ico_syc_win_attr_t;
252 * thumbnail information
253 * (notify from callback function)
255 typedef struct _thumb_info {
256 char *appid; /* application id */
257 int surface; /* window's surface id */
258 int type; /* buffer type */
259 int width; /* window width */
260 int height; /* window height */
261 int stride; /* byte par line of frame buffer */
262 int format; /* format of buffer */
263 } ico_syc_thumb_info_t;
268 typedef struct _layer_attr {
269 int layer; /* layer id */
270 int visible; /* visible status */
271 } ico_syc_layer_attr_t;
276 typedef struct _user_list {
277 int user_num; /* number of user */
278 char **userlist; /* address of user list */
279 char *user_login; /* name of login user */
280 } ico_syc_userlist_t;
283 * window resource information
285 typedef struct _res_win {
286 char *ECU; /* name to identify ECU */
287 char *display; /* name to identify Display in ECU */
288 char *layer; /* name to identify Layer in Display */
289 char *layout; /* name to identify Layout in Layer */
290 char *area; /* name to Output position in Layout */
291 char *dispatchApp; /* dispatch of application */
292 char *role; /* role of notice */
293 uint32_t resourceId;/* ID number of resource(surface id) */
294 } ico_syc_res_window_t;
297 * sound resource information
299 typedef struct _res_sound {
300 char *zone; /* area of playing sound */
301 char *name; /* sound stream name */
302 char *id; /* sound id */
303 int adjust; /* adjust action */
304 } ico_syc_res_sound_t;
307 * input resource information
309 typedef struct _res_input {
310 char *name; /* input device name */
311 int event; /* input event id */
312 } ico_syc_res_input_t;
315 * input region information
317 #define ICO_SYC_MAX_WINNAME_LEN 40
318 typedef struct _input_region {
319 char winname[ICO_SYC_MAX_WINNAME_LEN];
320 /* target window name */
321 short pos_x; /* input region X coordinate of surface */
322 short pos_y; /* input region Y coordinate of surface */
323 short width; /* input region's width */
324 short height; /* input region's height */
325 short hotspot_x; /* hotspot of X relative coordinate */
326 short hotspot_y; /* hotspot of Y relative coordinate */
327 short cursor_x; /* cursor region X coordinate */
328 short cursor_y; /* cursor region X coordinate */
329 short cursor_width; /* cursor region width */
330 short cursor_height; /* cursor region height */
331 int attr; /* region attributes(currently unused) */
332 } ico_syc_input_region_t;
335 * resource(window/sound/input) information
337 typedef struct _res_info {
338 ico_syc_res_window_t *window; /* window resource information */
339 ico_syc_res_sound_t *sound; /* sound resource information */
340 ico_syc_res_input_t *input; /* input resource information */
341 } ico_syc_res_info_t;
344 * notify changed state information
346 typedef struct _state_info {
349 } ico_syc_state_info_t;
351 /*============================================================================*/
352 /* callback function */
353 /*============================================================================*/
354 typedef void (*ico_syc_callback_t) (const ico_syc_ev_e event,
361 #endif /*_ICO_SYC_TYPE_H_*/
362 /* vim:set expandtab ts=4 sw=4: */