Revert "Corresponding to TizenIVI3.0 M14.3, GENIVI-LayerManagement was used instead...
[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 <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 /*============================================================================*/
26 /* global API                                                                 */
27 /*============================================================================*/
28 #if defined(__GNUC__) && __GNUC__ >= 4
29 #define ICO_API __attribute__ ((visibility("default")))
30 #else
31 #define ICO_API
32 #endif
33
34 /*============================================================================*/
35 /* enum                                                                       */
36 /*============================================================================*/
37 /*
38  * id of event
39  */
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 */
62 } ico_syc_ev_e;
63
64 /*
65  * general fixed value for window attribute
66  * @ICO_SYC_WIN_NOCHANGE: no change value
67  */
68 typedef enum _win_value {
69     ICO_SYC_WIN_NOCHANGE    = 99999999
70 } ico_syc_win_value_e;
71
72 /*
73  * thumbnail data format
74  * @ICO_SYC_THUMB_FORMAT_ARGB: argb format
75  * @ICO_SYC_THUMB_FORMAT_XRGB: xrgb format
76  */
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;
81
82 /*
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
87  */
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;
93
94 /*
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
99  */
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;
105
106 /*
107  * window change hint
108  * @ICO_SYC_WIN_HINT_HINT: hint information(no change)
109  * @ICO_SYC_WIN_HINT_CHANGE: real changed
110  */
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;
115
116 /*
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
121  */
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;
127
128 /*
129  * layer show/hide status
130  * @ICO_SYC_LAYER_VISIBLE_SHOW: show the layer
131  * @ICO_SYC_LAYER_VISIBLE_HIDE: hide the layer
132  */
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;
138
139 /*
140  * surface animation on/off
141  * @ICO_SYC_ANIMATION_ON: surface animation
142  * @ICO_SYC_ANIMATION_OFF: no surface animation
143  */
144 typedef enum _surface_animation {
145     ICO_SYC_ANIMATION_ON  = 1,
146     ICO_SYC_ANIMATION_OFF  = 0
147 } ico_syc_surface_animation;
148
149 /*
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:
156  */
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;
164
165 /*
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
172  */
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;
180
181 /**
182  *  system state
183  */
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;
188
189 /**
190  *  state on/off
191  */
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;
196
197 /*============================================================================*/
198 /* structure                                                                  */
199 /*============================================================================*/
200 /*
201  * window move information (zone/position/size)
202  */
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;
211
212 /*
213  * window information
214  */
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;
220
221 /*
222  * window attributes
223  */
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;
239
240 /*
241  * thumbnail information
242  * (notify from callback function)
243  */
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;
253
254 /*
255  * layer attributes
256  */
257 typedef struct _layer_attr {
258     int  layer;     /* layer id */
259     int  visible;   /* visible status */
260 } ico_syc_layer_attr_t;
261
262 /*
263  * user list
264  */
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;
270
271 /*
272  * window resource information
273  */
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;
284
285 /*
286  * sound resource information
287  */
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;
294
295 /*
296  * input resource information
297  */
298 typedef struct _res_input {
299     char *name;         /* input device name */
300     int  event;         /* input event id */
301 } ico_syc_res_input_t;
302
303 /*
304  * input region information
305  */
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;
322
323 /*
324  * resource(window/sound/input) information
325  */
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;
331
332 /*
333  * notify changed state information
334  */
335 typedef struct _state_info {
336     int id;
337     int state;
338 } ico_syc_state_info_t;
339
340 /*============================================================================*/
341 /* callback function                                                          */
342 /*============================================================================*/
343 typedef void (*ico_syc_callback_t) (const ico_syc_ev_e event,
344                                     const void *detail,
345                                     void *user_data);
346
347 #ifdef __cplusplus
348 }
349 #endif
350 #endif /*_ICO_SYC_TYPE_H_*/
351 /* vim:set expandtab ts=4 sw=4: */