141f6de098548285503c559210eb42c700430a80
[profile/ivi/ico-uxf-homescreen.git] / include / ico_syc_type.h
1 /*
2  * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  */
9 /**
10  * @brief   header file of System Controller
11  *          for privilege and general applications
12  *
13  * @date    Feb-21-2014
14  */
15
16 #ifndef _ICO_SYC_TYPE_H_
17 #define _ICO_SYC_TYPE_H_
18
19 #include <stdint.h>
20 #include <wayland-client-protocol.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /*============================================================================*/
27 /* global API                                                                 */
28 /*============================================================================*/
29 #if defined(__GNUC__) && __GNUC__ >= 4
30 #define ICO_API __attribute__ ((visibility("default")))
31 #else
32 #define ICO_API
33 #endif
34
35 /*============================================================================*/
36 /* enum                                                                       */
37 /*============================================================================*/
38 /*
39  * id of event
40  */
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 */
63 } ico_syc_ev_e;
64
65 /*
66  * general fixed value for window attribute
67  * @ICO_SYC_WIN_NOCHANGE: no change value
68  */
69 typedef enum _win_value {
70     ICO_SYC_WIN_NOCHANGE    = 99999999
71 } ico_syc_win_value_e;
72
73 /*
74  * thumbnail data format
75  * @ICO_SYC_THUMB_FORMAT_ARGB: argb format
76  * @ICO_SYC_THUMB_FORMAT_XRGB: xrgb format
77  */
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;
82
83 /*
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
88  */
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;
94
95 /*
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
100  */
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;
106
107 /*
108  * window change hint
109  * @ICO_SYC_WIN_HINT_HINT: hint information(no change)
110  * @ICO_SYC_WIN_HINT_CHANGE: real changed
111  */
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;
116
117 /*
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
122  */
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;
128
129 /*
130  * layer show/hide status
131  * @ICO_SYC_LAYER_VISIBLE_SHOW: show the layer
132  * @ICO_SYC_LAYER_VISIBLE_HIDE: hide the layer
133  */
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;
139
140 /*
141  * surface animation on/off
142  * @ICO_SYC_ANIMATION_ON: surface animation
143  * @ICO_SYC_ANIMATION_OFF: no surface animation
144  */
145 typedef enum _surface_animation {
146     ICO_SYC_ANIMATION_ON  = 1,
147     ICO_SYC_ANIMATION_OFF  = 0
148 } ico_syc_surface_animation;
149
150 /*
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:
157  */
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;
165
166 /*
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
173  */
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;
181
182 /**
183  *  system state
184  */
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;
189
190 /**
191  *  state on/off
192  */
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;
197
198 /**
199  * window animation name
200  */
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"
207
208 /*============================================================================*/
209 /* structure                                                                  */
210 /*============================================================================*/
211 /*
212  * window move information (zone/position/size)
213  */
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;
222
223 /*
224  * window information
225  */
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;
231
232 /*
233  * window attributes
234  */
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;
250
251 /*
252  * thumbnail information
253  * (notify from callback function)
254  */
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;
264
265 /*
266  * layer attributes
267  */
268 typedef struct _layer_attr {
269     int  layer;     /* layer id */
270     int  visible;   /* visible status */
271 } ico_syc_layer_attr_t;
272
273 /*
274  * user list
275  */
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;
281
282 /*
283  * window resource information
284  */
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;
295
296 /*
297  * sound resource information
298  */
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;
305
306 /*
307  * input resource information
308  */
309 typedef struct _res_input {
310     char *name;         /* input device name */
311     int  event;         /* input event id */
312 } ico_syc_res_input_t;
313
314 /*
315  * input region information
316  */
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;
333
334 /*
335  * resource(window/sound/input) information
336  */
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;
342
343 /*
344  * notify changed state information
345  */
346 typedef struct _state_info {
347     int id;
348     int state;
349 } ico_syc_state_info_t;
350
351 /*============================================================================*/
352 /* callback function                                                          */
353 /*============================================================================*/
354 typedef void (*ico_syc_callback_t) (const ico_syc_ev_e event,
355                                     const void *detail,
356                                     void *user_data);
357
358 #ifdef __cplusplus
359 }
360 #endif
361 #endif /*_ICO_SYC_TYPE_H_*/
362 /* vim:set expandtab ts=4 sw=4: */