FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiBlkManager.c @ 92:c0052fe355d3
src/ui/bmi/*.[ch]: rm trailing white space
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 08 Nov 2020 06:39:16 +0000 |
parents | 67bfe9f274f6 |
children | 1c4536a30e32 |
comparison
equal
deleted
inserted
replaced
91:c3d28a37caad | 92:c0052fe355d3 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 | 2 |
3 CONDAT (UK) | 3 CONDAT (UK) |
4 | 4 |
5 ******************************************************************************** | 5 ******************************************************************************** |
6 | 6 |
7 This software product is the property of Condat (UK) Ltd and may not be | 7 This software product is the property of Condat (UK) Ltd and may not be |
8 disclosed to any third party without the express permission of the owner. | 8 disclosed to any third party without the express permission of the owner. |
9 | 9 |
10 ******************************************************************************** | 10 ******************************************************************************** |
11 | 11 |
12 $Project name: Basic MMI | 12 $Project name: Basic MMI |
13 $Project code: BMI (6349) | 13 $Project code: BMI (6349) |
14 $Module: PhoneBook | 14 $Module: PhoneBook |
15 $File: MmiBlkManager.c | 15 $File: MmiBlkManager.c |
16 $Revision: 1.0 | 16 $Revision: 1.0 |
17 | 17 |
18 $Author: Condat(UK) | 18 $Author: Condat(UK) |
19 $Date: 25/10/00 | 19 $Date: 25/10/00 |
20 | 20 |
21 ******************************************************************************** | 21 ******************************************************************************** |
22 | 22 |
23 Description: | 23 Description: |
24 | 24 |
25 This module, in conjunction with the MmiBlkResources module, | 25 This module, in conjunction with the MmiBlkResources module, |
26 provides the access to block resources for the MMI. | 26 provides the access to block resources for the MMI. |
27 | 27 |
28 The block manager is responsible for creating and initialising | 28 The block manager is responsible for creating and initialising |
29 the structures and tables to allow access to the strings, icons | 29 the structures and tables to allow access to the strings, icons |
30 sounds and vibrations required by the MMI. | 30 sounds and vibrations required by the MMI. |
31 | 31 |
32 Each of these items is effectively a contiguous block of memory, | 32 Each of these items is effectively a contiguous block of memory, |
33 which is accessed via a block resource. Each of the block resources | 33 which is accessed via a block resource. Each of the block resources |
34 are provided by this package | 34 are provided by this package |
35 | 35 |
36 ******************************************************************************** | 36 ******************************************************************************** |
37 | 37 |
38 $History: MmiBlkManager.c | 38 $History: MmiBlkManager.c |
39 | 39 |
40 25/10/00 Original Condat(UK) BMI version. | 40 25/10/00 Original Condat(UK) BMI version. |
41 | 41 |
42 $End | 42 $End |
43 | 43 |
44 *******************************************************************************/ | 44 *******************************************************************************/ |
45 | 45 |
46 | 46 |
47 /******************************************************************************* | 47 /******************************************************************************* |
48 | 48 |
49 Include Files | 49 Include Files |
50 | 50 |
51 *******************************************************************************/ | 51 *******************************************************************************/ |
52 | 52 |
53 #define ENTITY_MFW | 53 #define ENTITY_MFW |
54 | 54 |
55 /* includes */ | 55 /* includes */ |
77 | 77 |
78 #include "MmiBlkManager.h" | 78 #include "MmiBlkManager.h" |
79 | 79 |
80 | 80 |
81 /******************************************************************************* | 81 /******************************************************************************* |
82 | 82 |
83 Local structures and definitions | 83 Local structures and definitions |
84 | 84 |
85 *******************************************************************************/ | 85 *******************************************************************************/ |
86 | 86 |
87 /* Define a type for the manager control block, this contains | 87 /* Define a type for the manager control block, this contains |
88 an array identifying each of the resource manager handles | 88 an array identifying each of the resource manager handles |
89 which are populated as part of the initialisation sequence | 89 which are populated as part of the initialisation sequence |
101 typedef struct _tManagerControl_ | 101 typedef struct _tManagerControl_ |
102 { | 102 { |
103 long int BlkKey; | 103 long int BlkKey; |
104 tBlkHandle BaseAddress; | 104 tBlkHandle BaseAddress; |
105 int BlkLength; | 105 int BlkLength; |
106 tBlkHandle RsrcList[BLOCK_MANAGER_ENTRY_COUNT]; | 106 tBlkHandle RsrcList[BLOCK_MANAGER_ENTRY_COUNT]; |
107 pManagerEntry EntryPtr; | 107 pManagerEntry EntryPtr; |
108 } tManagerControl, *pManagerControl; | 108 } tManagerControl, *pManagerControl; |
109 | 109 |
110 | 110 |
111 /******************************************************************************* | 111 /******************************************************************************* |
112 | 112 |
113 Local routines | 113 Local routines |
114 | 114 |
115 *******************************************************************************/ | 115 *******************************************************************************/ |
116 | 116 |
117 /******************************************************************************* | 117 /******************************************************************************* |
118 | 118 |
119 $Function: ValidManagerResource | 119 $Function: ValidManagerResource |
121 $Description: Determines if the resource indicated by the handle is valid | 121 $Description: Determines if the resource indicated by the handle is valid |
122 | 122 |
123 $Returns: Zero if failure, non-zero if valid resource | 123 $Returns: Zero if failure, non-zero if valid resource |
124 | 124 |
125 $Arguments: ManagerRsrc, handle of resource manager | 125 $Arguments: ManagerRsrc, handle of resource manager |
126 | 126 |
127 *******************************************************************************/ | 127 *******************************************************************************/ |
128 | 128 |
129 static int ValidManagerResource( tBlkHandle ManagerRsrc ) | 129 static int ValidManagerResource( tBlkHandle ManagerRsrc ) |
130 { | 130 { |
131 pManagerControl ManagerControl = (pManagerControl) ManagerRsrc; | 131 pManagerControl ManagerControl = (pManagerControl) ManagerRsrc; |
136 return ( ManagerControl->BlkKey == BLOCK_MANAGER_KEY ); | 136 return ( ManagerControl->BlkKey == BLOCK_MANAGER_KEY ); |
137 } | 137 } |
138 | 138 |
139 | 139 |
140 /******************************************************************************* | 140 /******************************************************************************* |
141 | 141 |
142 Public routines | 142 Public routines |
143 | 143 |
144 *******************************************************************************/ | 144 *******************************************************************************/ |
145 | 145 |
146 | 146 |
147 /******************************************************************************* | 147 /******************************************************************************* |
148 | 148 |
149 $Function: mmibm_Initialise | 149 $Function: mmibm_Initialise |
150 | 150 |
151 $Description: Initialise a block manager object | 151 $Description: Initialise a block manager object |
152 | 152 |
153 $Returns: Handle of block manager object, NULL if failure | 153 $Returns: Handle of block manager object, NULL if failure |
154 | 154 |
155 $Arguments: BlkBase, base address of the block manager data | 155 $Arguments: BlkBase, base address of the block manager data |
156 NumEntries, number of entries to be dealt with by the | 156 NumEntries, number of entries to be dealt with by the |
157 block manager | 157 block manager |
158 | 158 |
159 *******************************************************************************/ | 159 *******************************************************************************/ |
160 | 160 |
161 tBlkHandle mmibm_Initialise( tBlkHandle BlkBase, int NumEntries ) | 161 tBlkHandle mmibm_Initialise( tBlkHandle BlkBase, int NumEntries ) |
162 { | 162 { |
163 pManagerControl MyControl; | 163 pManagerControl MyControl; |
181 /* Now for each entry in the incoming block list we can create | 181 /* Now for each entry in the incoming block list we can create |
182 a handler instance | 182 a handler instance |
183 */ | 183 */ |
184 for ( i = 0; i < NumEntries; i++ ) | 184 for ( i = 0; i < NumEntries; i++ ) |
185 if ( ( Entry = MyControl->EntryPtr[i].Id ) < BLOCK_MANAGER_ENTRY_COUNT ) | 185 if ( ( Entry = MyControl->EntryPtr[i].Id ) < BLOCK_MANAGER_ENTRY_COUNT ) |
186 MyControl->RsrcList[ Entry ] = mmibr_Initialise( | 186 MyControl->RsrcList[ Entry ] = mmibr_Initialise( |
187 MyControl->EntryPtr[i].EntryBase, MyControl->EntryPtr[i].NumEntries ); | 187 MyControl->EntryPtr[i].EntryBase, MyControl->EntryPtr[i].NumEntries ); |
188 } | 188 } |
189 | 189 |
190 return MyControl; | 190 return MyControl; |
191 } | 191 } |
198 $Description: Shutdown routine to deallocate resources ina controlled manner | 198 $Description: Shutdown routine to deallocate resources ina controlled manner |
199 | 199 |
200 $Returns: none. | 200 $Returns: none. |
201 | 201 |
202 $Arguments: *BlkHandle, pointer to resource manager handle | 202 $Arguments: *BlkHandle, pointer to resource manager handle |
203 | 203 |
204 *******************************************************************************/ | 204 *******************************************************************************/ |
205 | 205 |
206 void mmibm_ShutDown( tBlkHandle *BlkHandle ) | 206 void mmibm_ShutDown( tBlkHandle *BlkHandle ) |
207 { | 207 { |
208 /* Convert and verify the incoming handle | 208 /* Convert and verify the incoming handle |
228 | 228 |
229 /******************************************************************************* | 229 /******************************************************************************* |
230 | 230 |
231 $Function: mmibm_SupplyResourceHandler | 231 $Function: mmibm_SupplyResourceHandler |
232 | 232 |
233 $Description: | 233 $Description: |
234 | 234 |
235 Since this module will be managing each of the block handlers | 235 Since this module will be managing each of the block handlers |
236 for each of the resources, we need to be able to supply the | 236 for each of the resources, we need to be able to supply the |
237 appropriate handle for any given type to the calling routine. | 237 appropriate handle for any given type to the calling routine. |
238 | 238 |
239 $Returns: Handle to requesteb block resource handler, NULL if failure | 239 $Returns: Handle to requesteb block resource handler, NULL if failure |
240 | 240 |
241 $Arguments: ManagerHandle, handle of the block manager | 241 $Arguments: ManagerHandle, handle of the block manager |
242 Id, identifier of the resource table for which the resource | 242 Id, identifier of the resource table for which the resource |
243 handler is required | 243 handler is required |
244 | 244 |
245 *******************************************************************************/ | 245 *******************************************************************************/ |
246 | 246 |
247 tBlkHandle mmibm_SupplyResourceHandler( tBlkHandle ManagerHandle, tBlkId Id ) | 247 tBlkHandle mmibm_SupplyResourceHandler( tBlkHandle ManagerHandle, tBlkId Id ) |
248 { | 248 { |
249 /* Convert and verify the incoming handle | 249 /* Convert and verify the incoming handle |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 | 266 |
267 /******************************************************************************* | 267 /******************************************************************************* |
268 | 268 |
269 End of File | 269 End of File |
270 | 270 |
271 *******************************************************************************/ | 271 *******************************************************************************/ |
272 | 272 |