Adapt the AIL filter used to new ones
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / ico_syc_mrp_resource_private.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 //==========================================================================
11 /**
12  *  @file   ico_syc_mrp_resource_private.h
13  *
14  *  @brief  This file is definition of murpy ressource control
15  */
16 //==========================================================================
17
18 #ifndef __ICO_SYC_MRP_RESOURCE_PRIVATE_H__
19 #define __ICO_SYC_MRP_RESOURCE_PRIVATE_H__
20
21 #include <murphy/plugins/resource-native/libmurphy-resource/resource-api.h>
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26
27 #define ICO_APC_REQTYPE_REQUEST 0               /* Request from application         */
28 #define ICO_APC_REQTYPE_CREATE  1               /* Request automatically             */
29
30 // TODO 
31 #define REQTYPE_APP             0
32 #define REQTYPE_AUTO            1
33
34 #define RESID_KIND_DISPLAY      0x00000001  
35 #define RESID_KIND_SOUND        0x00000002  
36 #define RESID_KIND_INPUT        0x00000004  
37 #define RESID_KIND_MASK         0x000000FF  
38                                             
39 #define RESID_TYPE_BASIC        0x00000100  
40 #define RESID_TYPE_INTERRUPT    0x00000200  
41 #define RESID_TYPE_ONSCREEN     0x00000400  
42 #define RESID_TYPE_MASK         0x00000F00  
43
44 #define RESID_CMD_ACQUIRE       0x00001000
45 #define RESID_CMD_RELEASE       0x00002000
46
47 #define RES_STATE_ACQUIRED      1
48 #define RES_STATE_DEPRIVED      2
49 #define RES_STATE_WAITING       3
50 #define RES_STATE_RELEASED      4
51
52 #define MURPHY_APPID_MAXIMUM_LENGTH 128
53
54 typedef struct {
55     int  req_id;
56     char appid[MURPHY_APPID_MAXIMUM_LENGTH];
57     int  res_type;
58     int  zone_idx;
59     int  prio;
60     mrp_list_hook_t hook;
61 } mrp_res_queue_item_t;
62
63 #define ICO_UXF_MAX_PROCESS_NAME 255
64 #define ICO_UXF_MAX_DEVICE_NAME  255
65
66 /* request information                          */
67 typedef struct  _resource_request {
68     int                         id;             /* request object                   */
69     int                         prio;           /* request priority                 */
70     unsigned short              reqtype;        /* Request type                     */
71     unsigned short              category;        /* Request category */
72
73     int  resid;           /* resource id      */
74     char *appid;          /* application id */
75     int  appkind;         /* id of application kind */
76     int  pid;             /* process id     */
77     int  state;           /* request state */
78
79     char *dispzone;       /* area of showing application window */
80     int  dispzoneid;      /* area of showing application window */
81     int  layerid;         /* layer of showing application window */
82     char *winname;        /* window's surface name */
83     int  surfaceid;       /* window id */
84     char *animation;      /* name of animation */
85     int  animationTime;   /* time of animation[ms] */
86     bool  bEx;            /* Expansion flag */
87     char *ECU;            /* name to identify ECU */
88     char *display;        /* name to identify Display in ECU */
89     char *layer;          /* name to identify Layer in Display */
90     char *layout;         /* name to identify layout in Layer */
91     char *area;           /* name to Output position in Layout */
92     char *dispatchApp;    /* origin of application */
93     char *role;           /* role of notice kind */
94     int   role_stt;       /* state number change from role */
95     int   resourceId;     /* ID number of resource */
96
97     char *soundzone;      /* area of playing sound */
98     int  soundzoneid;     /* area of playing sound */
99     char *soundname;      /* sound stream name */
100     int  soundid;         /* sound id */
101     int  soundadjust;     /* adjust action */
102
103     char *device;         /* input device name */
104     int  input;           /* input event id */
105
106     mrp_res_resource_set_t      *rset;          /* Murphy resource set */
107     mrp_res_queue_item_t        *res_data;      /* identifier for the request */
108     mrp_list_hook_t             hook;           /* keep track of requests */
109     int                         released;
110
111 } resource_request_t;
112
113 typedef void (*ico_syc_mrp_enforce_sound_t)(unsigned short state,
114                                             resource_request_t *req,
115                                             void *user_data);
116
117
118 int ico_syc_mrp_init(ico_syc_mrp_enforce_sound_t soundcb,
119                      void *user_data);
120 void ico_syc_mrp_term(void);
121
122 bool ico_syc_mrp_acquire_sound_resource(resource_request_t *req);
123 bool ico_syc_mrp_release_sound_resource(resource_request_t *req);
124 void ico_syc_mrp_active_app(const char *appid);
125
126 #ifdef __cplusplus
127 }
128 #endif
129 #endif  /* __ICO_SYC_MRP_RESOURCE_PRIVATE_H__ */
130 /* vim:set expandtab ts=4 sw=4: */