Bug fix TIVI-839 ,change the design and permit operation of the music player while...
[profile/ivi/ico-uxf-homescreen.git] / include / ico_uxf_typedef.h
1 /*
2  * Copyright (c) 2013, 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 user experience library for HomeScreen(data structure)
11  *
12  * @date    Feb-28-2013
13  */
14
15 #ifndef _ICO_UXF_TYPEDEF_H_
16 #define _ICO_UXF_TYPEDEF_H_
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 /* Structure of display attribute           */
23 typedef struct  _Ico_Uxf_DisplayAttr    {
24     int                 display;        /* Display ID                           */
25     int                 type;           /* Type                                 */
26     short               num_layers;     /* Number of layers                     */
27     short               hostId;         /* Host ID                              */
28     short               displayNo;      /* Consecutive numbers                  */
29     short               w;              /* The number of the lateral pixels     */
30     short               h;              /* The number of vertical pixels        */
31     short               inch;           /* Screen physical size(0.1 inches of units)*/
32     short               pWidth;         /* compositor width                     */
33     short               pHeight;        /* compositor height                    */
34     short               orientation;
35 #define ICO_UXF_ORIENTATION_HORIZONTAL  (0)
36 #define ICO_UXF_ORIENTATION_VERTICAL    (1)
37     char                name[ICO_UXF_MAX_WIN_NAME+1];
38                                         /* Display name                         */
39 }   Ico_Uxf_DisplayAttr;
40
41 /* Structure of layer attribute             */
42 typedef struct  _Ico_Uxf_LayerAttr  {
43     int                 layer;          /* Layer ID                             */
44     int                 display;        /* Display ID                           */
45     short               w;              /* The number of the lateral pixels     */
46     short               h;              /* The number of vertical pixels        */
47 }   Ico_Uxf_LayerAttr;
48
49 /* Structure of display zone attribute      */
50 typedef struct  _Ico_Uxf_DispZoneAttr  {
51     int                 zone;           /* Zone ID                              */
52     int                 display;        /* Display ID                           */
53     short               x;              /* Left upper X coordinate of the screen*/
54     short               y;              /* Left upper Y coordinate of the screen*/
55     short               w;              /* The number of the lateral pixels     */
56     short               h;              /* The number of vertical pixels        */
57 }   Ico_Uxf_DispZoneAttr;
58
59 /* Structure of window attribute            */
60 typedef struct  _Ico_Uxf_WindowAttr {
61     int                 window;         /* Window ID                            */
62     int                 display;        /* Display ID                           */
63     int                 layer;          /* Layer ID                             */
64     int                 zone;           /* Display Zone ID                      */
65     char                process[ICO_UXF_MAX_PROCESS_NAME+1];
66                                         /* Application ID                       */
67     int                 subwindow;      /* Main window(=0) or Sub window(>0)    */
68     unsigned int        eventmask;      /* Event to receive through this window */
69     short               x;              /* Upper left X coordinate of the window*/
70     short               y;              /* Upper left Y coordinate of the window*/
71     short               w;              /* Width of window                      */
72     short               h;              /* height of window                     */
73     char                control;        /* Visibility control from AppsController*/
74     char                visible;        /* Visibility                           */
75     char                raise;          /* Raise/Lower                          */
76     char                active;         /* Active/Inactive                      */
77 }   Ico_Uxf_WindowAttr;
78
79 /* Structure of input code                  */
80 typedef struct _Ico_Uxf_InputCode   {
81     int         code;                       /* input switch code value              */
82     char        codename[20];               /* input switch code name               */
83 }   Ico_Uxf_InputCode;
84
85 /* Structure of input switch                */
86 typedef struct _Ico_Uxf_InputSw {
87     struct _Ico_Uxf_InputSw     *next;      /* next input switch table              */
88     char        swname[20];                 /* input switch name                    */
89     int         input;                      /* input switch number                  */
90     short       fix;                        /* fixed application switch             */
91     short       numCode;                    /* number of codes                      */
92     Ico_Uxf_InputCode   inputCode[8];       /* code table                           */
93 }   Ico_Uxf_InputSw;
94
95 /* Structure of input device                */
96 typedef struct _Ico_Uxf_InputDev    {
97     struct _Ico_Uxf_InputDev    *next;      /* next input device                    */
98     char        device[32];                 /* input device name                    */
99     int         type;                       /* input device type(unused)            */
100     int         numInputSw;                 /* number of input switch               */
101     Ico_Uxf_InputSw     *inputSw;           /* input switch list                    */
102 }   Ico_Uxf_InputDev;
103
104 /* Structure of window of application       */
105 typedef struct  _Ico_Uxf_ProcessWin {
106     int                 window;         /* Window ID                            */
107                                         /* (0 if window not create)             */
108     int                 windowtype;     /* Type                                 */
109     int                 display;        /* Display ID                           */
110     int                 layer;          /* Layer ID                             */
111     int                 zone;           /* Zone ID                              */
112     short               x;              /* Default X coordinate of the window   */
113     short               y;              /* Default Y coordinate of the window   */
114     short               w;              /* Default width of window              */
115     short               h;              /* Default height of window             */
116     char                name[ICO_UXF_MAX_WIN_NAME+1];
117                                         /* Window name                          */
118 }   Ico_Uxf_ProcessWin;
119
120 /* Structure of application attribute       */
121 typedef struct  _Ico_Uxf_ProcessAttr    {
122     char                process[ICO_UXF_MAX_PROCESS_NAME+1];
123                                         /* Application ID                       */
124     int                 internalid;     /* ProcessID                            */
125     int                 type;           /* Type                                 */
126     short               hostId;         /* Host ID who works of the application */
127     short               myHost;         /* Works in my host(=1) or Other host(=0)*/
128     short               numwindows;     /* Number of windows                    */
129     short               numsounds;      /* Number of sound                      */
130     short               numinputs;      /* Number of input                      */
131     Ico_Uxf_ProcessWin  mainwin;        /* Main window of application           */
132     Ico_Uxf_ProcessWin  *subwin;        /* Sub window of application            */
133     short               status;         /* Running status                       */
134     char                active;         /* Active/Inactive                      */
135     char                child;          /* Child process                        */
136     char                noicon;         /* No icon flag                         */
137     char                autostart;      /* Autostart flag                       */
138     char                suspend;        /* application susupend flag            */
139     unsigned char       invisiblecpu;   /* cpu % at invisible                   */
140 }   Ico_Uxf_ProcessAttr;
141
142 /* Detail of event                          */
143 typedef union  _Ico_Uxf_EventDetail    {
144     int                 event;          /* Event number                         */
145     struct  {                           /* Window event                         */
146         int             event;          /* Event number                         */
147         /* Event about the state conversion of the window                       */
148         /* ICO_UXF_EVENT_VISIBLE,RESIZE,MOVE,REDRAW,NEWWINDOW,DESTORYWINDOW     */
149         int             display;        /* Display ID                           */
150         int             window;         /* Window ID                            */
151         int             layer;          /* layer ID                             */
152         short           x;              /* Window position                      */
153         short           y;
154         short           w;              /* Window size                          */
155         short           h;
156         char            visible;        /* Visibility                           */
157         char            raise;          /* Raise/Lower                          */
158         char            active;         /* Active/inactive(not impliment)       */
159         char            res;            /* (unuse)                              */
160     }           window;
161
162     struct  {                           /* Application event                    */
163         int             event;          /* Event number                         */
164         /* Event about the operating conditions change of the application       */
165         /* EXECPROCESS, TERMPROCESS                                             */
166         char            process[ICO_UXF_MAX_PROCESS_NAME+1];
167                                         /* Application ID                       */
168         int             status;         /* Running status                       */
169         int             regulation;     /* Current regulation                   */
170     }           process;
171
172     struct {                            /* Input Manager event                  */
173         int             event;          /* Event number                         */
174         /* Multi Input Manager event                                            */
175         /* ICO_UXF_EVENT_EXINPUT                                                */
176         char            device[32];     /* input device name                    */
177         int             input;          /* input number                         */
178         int             code;           /* input code                           */
179         int             state;          /* input status                         */
180     }           exinput;
181
182 }   Ico_Uxf_EventDetail;
183
184 /* Event callback function                  */
185 typedef void (*Ico_Uxf_Event_Cb)(const int event,
186                                  const Ico_Uxf_EventDetail detail, int arg);
187
188 /* Hook function                            */
189 typedef void (*Ico_Uxf_Hook)(const char *appid, const int info1, const int info2);
190
191 #ifdef __cplusplus
192 }
193 #endif
194 #endif  /* _ICO_UXF_TYPEDEF_H_ */
195