2 * Copyright (c) 2013, 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 //==========================================================================
12 * @file ico_syc_mrp_resource_private.h
14 * @brief This file is definition of murpy ressource control
16 //==========================================================================
18 #ifndef __ICO_SYC_MRP_RESOURCE_PRIVATE_H__
19 #define __ICO_SYC_MRP_RESOURCE_PRIVATE_H__
21 #include <murphy/plugins/resource-native/libmurphy-resource/resource-api.h>
27 #define ICO_APC_REQTYPE_REQUEST 0 /* Request from application */
28 #define ICO_APC_REQTYPE_CREATE 1 /* Request automatically */
32 #define REQTYPE_AUTO 1
34 #define RESID_KIND_DISPLAY 0x00000001
35 #define RESID_KIND_SOUND 0x00000002
36 #define RESID_KIND_INPUT 0x00000004
37 #define RESID_KIND_MASK 0x000000FF
39 #define RESID_TYPE_BASIC 0x00000100
40 #define RESID_TYPE_INTERRUPT 0x00000200
41 #define RESID_TYPE_ONSCREEN 0x00000400
42 #define RESID_TYPE_MASK 0x00000F00
44 #define RESID_CMD_ACQUIRE 0x00001000
45 #define RESID_CMD_RELEASE 0x00002000
47 #define RES_STATE_ACQUIRED 1
48 #define RES_STATE_DEPRIVED 2
49 #define RES_STATE_WAITING 3
50 #define RES_STATE_RELEASED 4
52 #define MURPHY_APPID_MAXIMUM_LENGTH 128
56 char appid[MURPHY_APPID_MAXIMUM_LENGTH];
61 } mrp_res_queue_item_t;
63 #define ICO_UXF_MAX_PROCESS_NAME 255
64 #define ICO_UXF_MAX_DEVICE_NAME 255
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 */
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 */
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] */
87 char *soundzone; /* area of playing sound */
88 int soundzoneid; /* area of playing sound */
89 char *soundname; /* sound stream name */
90 int soundid; /* sound id */
91 int soundadjust; /* adjust action */
93 char *device; /* input device name */
94 int input; /* input event id */
96 mrp_res_resource_set_t *rset; /* Murphy resource set */
97 mrp_res_queue_item_t *res_data; /* identifier for the request */
98 mrp_list_hook_t hook; /* keep track of requests */
101 } resource_request_t;
103 typedef void (*ico_syc_mrp_enforce_sound_t)(unsigned short state,
104 resource_request_t *req,
108 int ico_syc_mrp_init(ico_syc_mrp_enforce_sound_t soundcb,
110 void ico_syc_mrp_term(void);
112 bool ico_syc_mrp_acquire_sound_resource(resource_request_t *req);
113 bool ico_syc_mrp_release_sound_resource(resource_request_t *req);
114 void ico_syc_mrp_active_app(const char *appid);
119 #endif /* __ICO_SYC_MRP_RESOURCE_PRIVATE_H__ */
120 /* vim:set expandtab ts=4 sw=4: */