FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiResources.c @ 160:2d19a232f9eb
mmiResources.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 18 Nov 2020 05:55:32 +0000 |
parents | c0052fe355d3 |
children |
comparison
equal
deleted
inserted
replaced
159:368f10ebcc64 | 160:2d19a232f9eb |
---|---|
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: Resource Manager | 14 $Module: Resource Manager |
15 $File: MmiResources.c | 15 $File: MmiResources.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 |
41 read only actions this should not be a problem. | 41 read only actions this should not be a problem. |
42 | 42 |
43 ******************************************************************************** | 43 ******************************************************************************** |
44 $History: MmiResources.c | 44 $History: MmiResources.c |
45 | 45 |
46 Sep 14, 2007 REF: OMAPS00145860 Adrian Salido | 46 Sep 14, 2007 REF: OMAPS00145860 Adrian Salido |
47 Description: FT - MMI: Wrong trace class of new_getDataColour | 47 Description: FT - MMI: Wrong trace class of new_getDataColour |
48 Solution: changed event traces to function traces because the information content of | 48 Solution: changed event traces to function traces because the information content of |
49 this is low for non-MMI people and against TI coding convention. | 49 this is low for non-MMI people and against TI coding convention. |
50 | 50 |
51 Nov 07, 2006 ER:OMAPS00070661 R.Prabakar(a0393213) | 51 Nov 07, 2006 ER:OMAPS00070661 R.Prabakar(a0393213) |
52 R99 network compliancy : Implemented Language Notification and Provide Local Information (Language setting) | 52 R99 network compliancy : Implemented Language Notification and Provide Local Information (Language setting) |
53 SAT proactive commands and Language Selection SAT event | 53 SAT proactive commands and Language Selection SAT event |
54 | 54 |
55 May 30, 2006 DR: OMAPS00070657 x0pleela | 55 May 30, 2006 DR: OMAPS00070657 x0pleela |
56 Description: CPHS feature on Locosto-Lite | 56 Description: CPHS feature on Locosto-Lite |
57 Solution: For ALS feature, | 57 Solution: For ALS feature, |
58 a) Modified "MmiRsrcGetText" function to return the string from FFS for the current active line | 58 a) Modified "MmiRsrcGetText" function to return the string from FFS for the current active line |
59 | 59 |
60 March 01, 2005 REF: ENH 29313 Deepa M.D | 60 March 01, 2005 REF: ENH 29313 Deepa M.D |
61 Isolating colour build related changes from MMI LITE flag. | 61 Isolating colour build related changes from MMI LITE flag. |
62 The proper Feature flag COLORDISPLAY was used for all color | 62 The proper Feature flag COLORDISPLAY was used for all color |
63 related changes. | 63 related changes. |
64 | 64 |
65 Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu. | 65 Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu. |
66 Issue description: Golite booting problem. | 66 Issue description: Golite booting problem. |
67 Solution: If the FFS is not formatted, prevent writing into the FFS. | 67 Solution: If the FFS is not formatted, prevent writing into the FFS. |
68 | 68 |
69 | 69 |
70 Aug 25, 2004 REF: CRR 24904 Deepa M.D | 70 Aug 25, 2004 REF: CRR 24904 Deepa M.D |
71 Bug:cleanup compile switches used for Go-lite | 71 Bug:cleanup compile switches used for Go-lite |
72 Fix:COLOURDISPLAY compiler switch has been added to the functions which are | 72 Fix:COLOURDISPLAY compiler switch has been added to the functions which are |
73 used only for the normal color build. | 73 used only for the normal color build. |
74 | 74 |
75 | 75 |
76 Aug 25, 2004 REF: CRR 24297 Deepa M.D | 76 Aug 25, 2004 REF: CRR 24297 Deepa M.D |
77 Bug:Reduction of the size of the variable ColArray | 77 Bug:Reduction of the size of the variable ColArray |
78 Fix:The size of the structure T_COLDATA has been reduced for the Go-lite version. | 78 Fix:The size of the structure T_COLDATA has been reduced for the Go-lite version. |
79 For Go-lite only two colors are being used(Black&White), hence the members of the | 79 For Go-lite only two colors are being used(Black&White), hence the members of the |
80 T_COLDATA structure can be reduced to U8. | 80 T_COLDATA structure can be reduced to U8. |
81 | 81 |
82 | 82 |
83 25/10/00 Original Condat(UK) BMI version. | 83 25/10/00 Original Condat(UK) BMI version. |
84 03/10/02 Replaced most of the file with version on branch for issue 1150 (MC, SPR 1242) | 84 03/10/02 Replaced most of the file with version on branch for issue 1150 (MC, SPR 1242) |
85 $End | 85 $End |
86 | 86 |
87 *******************************************************************************/ | 87 *******************************************************************************/ |
88 | 88 |
89 | 89 |
169 | 169 |
170 | 170 |
171 #include "MmiDialogs.h" | 171 #include "MmiDialogs.h" |
172 #include "MmiLists.h" | 172 #include "MmiLists.h" |
173 #include "MmiDialogs.h" | 173 #include "MmiDialogs.h" |
174 #include "Mmiicons.h" //GW | 174 #include "Mmiicons.h" //GW |
175 #include "mfw_ffs.h" | 175 #include "mfw_ffs.h" |
176 // this is for traces | 176 // this is for traces |
177 #include "cus_aci.h" | 177 #include "cus_aci.h" |
178 | 178 |
179 #include "prim.h" | 179 #include "prim.h" |
180 #ifndef PCM_2_FFS | 180 #ifndef PCM_2_FFS |
181 #include "pcm.h" | 181 #include "pcm.h" |
182 #endif | 182 #endif |
183 | |
184 | 183 |
185 | 184 |
186 #include "MmiLists.h" | 185 #include "MmiLists.h" |
187 #include "mmiColours.h" | 186 #include "mmiColours.h" |
188 | 187 |
218 //move to header for the moment #define LINE_HEIGHT 12 | 217 //move to header for the moment #define LINE_HEIGHT 12 |
219 #endif | 218 #endif |
220 //x33x-end*/ | 219 //x33x-end*/ |
221 | 220 |
222 #ifndef LSCREEN | 221 #ifndef LSCREEN |
223 #define SK_HEIGHT_LATIN (LINE_HEIGHT_LATIN) | 222 #define SK_HEIGHT_LATIN (LINE_HEIGHT_LATIN) |
224 #define SK_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE) | 223 #define SK_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE) |
225 #define TITLE_HEIGHT_LATIN (LINE_HEIGHT_LATIN) | 224 #define TITLE_HEIGHT_LATIN (LINE_HEIGHT_LATIN) |
226 #define TITLE_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE) | 225 #define TITLE_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE) |
227 | 226 |
228 #define NLINES_LATIN (SCREEN_SIZE_Y/LINE_HEIGHT_LATIN) //6 | 227 #define NLINES_LATIN (SCREEN_SIZE_Y/LINE_HEIGHT_LATIN) //6 |
229 #define NLINES_CHINESE (SCREEN_SIZE_Y/LINE_HEIGHT_CHINESE) //4 | 228 #define NLINES_CHINESE (SCREEN_SIZE_Y/LINE_HEIGHT_CHINESE) //4 |
230 #define CHINESE_MENU_VERTICAL_SIZE ((NLINES_CHINESE-1)*LINE_HEIGHT_CHINESE) | 229 #define CHINESE_MENU_VERTICAL_SIZE ((NLINES_CHINESE-1)*LINE_HEIGHT_CHINESE) |
231 #define STANDARD_MENU_VERTICAL_SIZE ((NLINES_LATIN-1)*LINE_HEIGHT_LATIN) | 230 #define STANDARD_MENU_VERTICAL_SIZE ((NLINES_LATIN-1)*LINE_HEIGHT_LATIN) |
232 | 231 |
233 #define ICON_HEIGHT (6) | 232 #define ICON_HEIGHT (6) |
234 #else | 233 #else |
235 #define SK_HEIGHT_LATIN (LINE_HEIGHT+8) | 234 #define SK_HEIGHT_LATIN (LINE_HEIGHT+8) |
236 #define SK_HEIGHT_CHINESE (LINE_HEIGHT+8) | 235 #define SK_HEIGHT_CHINESE (LINE_HEIGHT+8) |
237 #define TITLE_HEIGHT_LATIN (LINE_HEIGHT_LATIN+4) | 236 #define TITLE_HEIGHT_LATIN (LINE_HEIGHT_LATIN+4) |
238 #define TITLE_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE+4) | 237 #define TITLE_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE+4) |
239 #define ALLOFFSET (LINE_HEIGHT*2) | 238 #define ALLOFFSET (LINE_HEIGHT*2) |
240 #define MNUOFFSET (LINE_HEIGHT) | 239 #define MNUOFFSET (LINE_HEIGHT) |
241 | 240 |
242 #define NLINES_LATIN (SCREEN_SIZE_Y/LINE_HEIGHT_LATIN) | 241 #define NLINES_LATIN (SCREEN_SIZE_Y/LINE_HEIGHT_LATIN) |
243 #define NLINES_CHINESE (SCREEN_SIZE_Y/LINE_HEIGHT_CHINESE) | 242 #define NLINES_CHINESE (SCREEN_SIZE_Y/LINE_HEIGHT_CHINESE) |
244 #define CHINESE_MENU_VERTICAL_SIZE ((NLINES_CHINESE*LINE_HEIGHT_CHINESE)-SK_HEIGHT_CHINESE) | 243 #define CHINESE_MENU_VERTICAL_SIZE ((NLINES_CHINESE*LINE_HEIGHT_CHINESE)-SK_HEIGHT_CHINESE) |
245 #define STANDARD_MENU_VERTICAL_SIZE ((NLINES_LATIN*LINE_HEIGHT_LATIN)-SK_HEIGHT_LATIN) | 244 #define STANDARD_MENU_VERTICAL_SIZE ((NLINES_LATIN*LINE_HEIGHT_LATIN)-SK_HEIGHT_LATIN) |
246 | 245 |
247 #define ICON_HEIGHT (22) | 246 #define ICON_HEIGHT (22) |
248 #endif | 247 #endif |
249 | 248 |
250 | 249 |
251 /******************************************************************************* | 250 /******************************************************************************* |
252 | 251 |
258 handles. These are not re-entrant, but what the | 257 handles. These are not re-entrant, but what the |
259 hell, there will only be one of these in the | 258 hell, there will only be one of these in the |
260 system | 259 system |
261 */ | 260 */ |
262 static tBlkHandle BlkManager = NULL; | 261 static tBlkHandle BlkManager = NULL; |
263 UBYTE currentLanguage = NULL; | 262 UBYTE currentLanguage = NULL; |
264 static tBlkHandle Language = NULL; | 263 static tBlkHandle Language = NULL; |
265 static long int ModuleKey = -1; | 264 static long int ModuleKey = -1; |
266 | 265 |
267 | 266 |
268 /* Define a unique key value to determine if the constructor | 267 /* Define a unique key value to determine if the constructor |
294 /*SPR 1111, country code and langauge tables*/ | 293 /*SPR 1111, country code and langauge tables*/ |
295 /*MC, if English and Chinese Available*/ | 294 /*MC, if English and Chinese Available*/ |
296 #ifdef CHINESE_MMI | 295 #ifdef CHINESE_MMI |
297 static const CountryLangEntry LanguageTableEntries[7]= | 296 static const CountryLangEntry LanguageTableEntries[7]= |
298 { | 297 { |
299 {"001", ENGLISH_LANGUAGE}, /*USA*/ | 298 {"001", ENGLISH_LANGUAGE}, /*USA*/ |
300 {"044", ENGLISH_LANGUAGE}, /*UK*/ | 299 {"044", ENGLISH_LANGUAGE}, /*UK*/ |
301 {"061", ENGLISH_LANGUAGE}, /*Australia*/ | 300 {"061", ENGLISH_LANGUAGE}, /*Australia*/ |
302 {"353", ENGLISH_LANGUAGE}, /*Ireland*/ | 301 {"353", ENGLISH_LANGUAGE}, /*Ireland*/ |
303 {"064", ENGLISH_LANGUAGE}, /*New Zealand*/ | 302 {"064", ENGLISH_LANGUAGE}, /*New Zealand*/ |
304 {"086", CHINESE_LANGUAGE}, /*PRChina*/ | 303 {"086", CHINESE_LANGUAGE}, /*PRChina*/ |
305 {"065", CHINESE_LANGUAGE} /*Singapore*/ | 304 {"065", CHINESE_LANGUAGE} /*Singapore*/ |
306 }; | 305 }; |
307 | 306 |
308 static const CountryLanguageTable LanguageTable = | 307 static const CountryLanguageTable LanguageTable = |
309 { 7, (CountryLangEntry*)LanguageTableEntries}; | 308 { 7, (CountryLangEntry*)LanguageTableEntries}; |
310 #else /*MC, if English and German Available*/ | 309 #else /*MC, if English and German Available*/ |
311 static const CountryLangEntry LanguageTableEntries[7]= | 310 static const CountryLangEntry LanguageTableEntries[7]= |
312 { | 311 { |
313 {"001", ENGLISH_LANGUAGE}, /*USA*/ | 312 {"001", ENGLISH_LANGUAGE}, /*USA*/ |
314 {"044", ENGLISH_LANGUAGE}, /*UK*/ | 313 {"044", ENGLISH_LANGUAGE}, /*UK*/ |
315 {"061", ENGLISH_LANGUAGE}, /*Australia*/ | 314 {"061", ENGLISH_LANGUAGE}, /*Australia*/ |
316 {"353", ENGLISH_LANGUAGE}, /*Ireland*/ | 315 {"353", ENGLISH_LANGUAGE}, /*Ireland*/ |
317 {"064", ENGLISH_LANGUAGE}, /*New Zealand*/ | 316 {"064", ENGLISH_LANGUAGE}, /*New Zealand*/ |
318 {"043", GERMAN_LANGUAGE}, /*Austria*/ | 317 {"043", GERMAN_LANGUAGE}, /*Austria*/ |
319 {"049", GERMAN_LANGUAGE} /*Germany*/ | 318 {"049", GERMAN_LANGUAGE} /*Germany*/ |
320 }; | 319 }; |
321 | 320 |
322 static const CountryLanguageTable LanguageTable = | 321 static const CountryLanguageTable LanguageTable = |
323 { 7, (CountryLangEntry*)LanguageTableEntries}; | 322 { 7, (CountryLangEntry*)LanguageTableEntries}; |
324 | 323 |
325 | 324 |
326 #endif | 325 #endif |
327 | 326 |
328 typedef struct | 327 typedef struct |
329 { | 328 { |
330 // cp_resource_file_t rf; | 329 // cp_resource_file_t rf; |
331 RESOURCE_DIRECTORY_HEADER language_table; | 330 RESOURCE_DIRECTORY_HEADER language_table; |
332 RESOURCE_DIRECTORY_HEADER melody_table; | 331 RESOURCE_DIRECTORY_HEADER melody_table; |
333 RESOURCE_DIRECTORY_HEADER glyph_table; | 332 RESOURCE_DIRECTORY_HEADER glyph_table; |
334 RESOURCE_DIRECTORY_HEADER zone_table; | 333 RESOURCE_DIRECTORY_HEADER zone_table; |
335 | 334 |
336 UBYTE langid; // current language_table | 335 UBYTE langid; // current language_table |
337 UBYTE fontid; // current font | 336 UBYTE fontid; // current font |
338 ST_DIMENSION fontHeight; // current font height | 337 ST_DIMENSION fontHeight; // current font height |
339 | 338 |
340 } res_ResMgr_type; | 339 } res_ResMgr_type; |
341 | |
342 | |
343 | 340 |
344 | 341 |
345 typedef struct | 342 typedef struct |
346 { | 343 { |
347 T_MMI_CONTROL mmi_control; | 344 T_MMI_CONTROL mmi_control; |
349 } T_resources; | 346 } T_resources; |
350 | 347 |
351 T_resources resources_data; | 348 T_resources resources_data; |
352 | 349 |
353 enum { | 350 enum { |
354 COL_TYPE_SCREEN=0, | 351 COL_TYPE_SCREEN=0, |
355 COL_TYPE_SK, | 352 COL_TYPE_SK, |
356 COL_TYPE_HL, | 353 COL_TYPE_HL, |
357 COL_TYPE_TITLE, | 354 COL_TYPE_TITLE, |
358 COL_TYPE_MAX | 355 COL_TYPE_MAX |
359 }; | 356 }; |
360 /***************************Go-lite Optimization changes Start***********************/ | 357 /***************************Go-lite Optimization changes Start***********************/ |
361 //Aug 25, 2004 REF: CRR 24297 Deepa M.D | 358 //Aug 25, 2004 REF: CRR 24297 Deepa M.D |
362 //T_COLDATA structure for the Go-lite has been reduced in size. | 359 //T_COLDATA structure for the Go-lite has been reduced in size. |
363 //March 01, 2005 REF: ENH 29313 Deepa M.D | 360 //March 01, 2005 REF: ENH 29313 Deepa M.D |
364 // Isolating colour build related changes from MMI LITE flag. | 361 // Isolating colour build related changes from MMI LITE flag. |
365 // The proper Feature flag COLORDISPLAY was used for all color | 362 // The proper Feature flag COLORDISPLAY was used for all color |
366 //related changes. | 363 //related changes. |
367 #ifdef COLOURDISPLAY | 364 #ifdef COLOURDISPLAY |
368 typedef struct { | 365 typedef struct { |
369 U32 fgd; | 366 U32 fgd; |
370 U32 bgd; | 367 U32 bgd; |
371 } T_COLDATA; | 368 } T_COLDATA; |
372 #else | 369 #else |
373 typedef struct { | 370 typedef struct { |
374 U8 fgd; | 371 U8 fgd; |
375 U8 bgd; | 372 U8 bgd; |
376 } T_COLDATA; | 373 } T_COLDATA; |
377 #endif | 374 #endif |
378 /***************************Go-lite Optimization changes end***********************/ | 375 /***************************Go-lite Optimization changes end***********************/ |
379 const char * colourFileDir = "/mmi"; | 376 const char * colourFileDir = "/mmi"; |
380 const char * colourFileName = "MmiColour"; | 377 const char * colourFileName = "MmiColour"; |
392 #define NLINES ((SCREEN_SIZE_Y-SK_HEIGHT_LATIN)/LINE_HEIGHT) | 389 #define NLINES ((SCREEN_SIZE_Y-SK_HEIGHT_LATIN)/LINE_HEIGHT) |
393 #define NLINES_MAX ((SCREEN_SIZE_Y-SK_HEIGHT_LATIN)/LINE_HEIGHT) | 390 #define NLINES_MAX ((SCREEN_SIZE_Y-SK_HEIGHT_LATIN)/LINE_HEIGHT) |
394 #endif | 391 #endif |
395 | 392 |
396 /*Data should be reset */ | 393 /*Data should be reset */ |
397 MfwRect menuArea = {0,0,10,10}; | 394 MfwRect menuArea = {0,0,10,10}; |
398 MfwRect menuNamesArea = {0,0,10,10}; | 395 MfwRect menuNamesArea = {0,0,10,10}; |
399 MfwRect menuListArea = {0,0,10,10}; | 396 MfwRect menuListArea = {0,0,10,10}; |
400 MfwRect editor_menuArea = {0,0,10,10}; /* menus display area */ | 397 MfwRect editor_menuArea = {0,0,10,10}; /* menus display area */ |
401 MfwRect network_menuArea = {0,0,10,10}; /* menus display area */ | 398 MfwRect network_menuArea = {0,0,10,10}; /* menus display area */ |
402 MfwRect sat_setup_menuArea = {0,0,10,10}; /* menus display area */ | 399 MfwRect sat_setup_menuArea = {0,0,10,10}; /* menus display area */ |
403 MfwRect sat_select_menuArea = {0,0,10,10}; /* menus display area */ | 400 MfwRect sat_select_menuArea = {0,0,10,10}; /* menus display area */ |
404 MfwRect smscb_M_CBArea = {0,0,10,10}; /* menus display area */ | 401 MfwRect smscb_M_CBArea = {0,0,10,10}; /* menus display area */ |
405 MfwRect smscb_M_CB_ACTArea = {0,0,10,10}; /* menus display area */ | 402 MfwRect smscb_M_CB_ACTArea = {0,0,10,10}; /* menus display area */ |
406 MfwRect smscb_M_CB_TOPArea = {0,0,10,10};/* menus display area */ | 403 MfwRect smscb_M_CB_TOPArea = {0,0,10,10};/* menus display area */ |
407 MfwRect smscb_M_CB_TOP_CONSArea = {0,0,10,10}; /* menus display area */ | 404 MfwRect smscb_M_CB_TOP_CONSArea = {0,0,10,10}; /* menus display area */ |
408 MfwRect smscb_M_CB_TOP_CONS_SELArea = {0,0,10,10}; /* menus display area */ | 405 MfwRect smscb_M_CB_TOP_CONS_SELArea = {0,0,10,10}; /* menus display area */ |
409 MfwRect smscb_CBArea = {0,0,10,10}; /* menus display area */ | 406 MfwRect smscb_CBArea = {0,0,10,10}; /* menus display area */ |
410 MfwRect smscb_CB_OPTArea = {0,0,10,10}; /* menus display area */ | 407 MfwRect smscb_CB_OPTArea = {0,0,10,10}; /* menus display area */ |
411 MfwRect readSMS_menuArea = {0,0,10,10}; /* menus display area */ | 408 MfwRect readSMS_menuArea = {0,0,10,10}; /* menus display area */ |
412 #ifdef FF_MMI_FILEMANAGER | 409 #ifdef FF_MMI_FILEMANAGER |
413 MfwRect FileType_menuArea = {0,0,10,10}; /* menus display area */ // RAVI - 19-05-2005 | 410 MfwRect FileType_menuArea = {0,0,10,10}; /* menus display area */ // RAVI - 19-05-2005 |
414 #endif | 411 #endif |
415 MfwRect SmsRead_R_OPTArea = {0,0,10,10};/* menus display area */ | 412 MfwRect SmsRead_R_OPTArea = {0,0,10,10};/* menus display area */ |
416 MfwRect SmsSend_R_OPTArea = {0,0,10,10}; /* menus display area */ | 413 MfwRect SmsSend_R_OPTArea = {0,0,10,10}; /* menus display area */ |
417 MfwRect melody_menuArea = {0,0,10,10}; /* menus display area */ | 414 MfwRect melody_menuArea = {0,0,10,10}; /* menus display area */ |
418 MfwRect MAINICONarea = {0,0,10,10}; | 415 MfwRect MAINICONarea = {0,0,10,10}; |
419 MfwRect MAINICONareaColour = {0,0,10,10}; //For the larger colour main icons | 416 MfwRect MAINICONareaColour = {0,0,10,10}; //For the larger colour main icons |
420 | 417 |
421 static int resources_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); | 418 static int resources_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); |
422 static void resources_language_confirm(void); | 419 static void resources_language_confirm(void); |
423 void resources_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason); | 420 void resources_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason); |
424 void resources (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | 421 void resources (T_MFW_HND win, USHORT event, SHORT value, void * parameter); |
431 EXTERN int flash_formatted(void); | 428 EXTERN int flash_formatted(void); |
432 EXTERN void idle_setBgdBitmap(int bmpId); | 429 EXTERN void idle_setBgdBitmap(int bmpId); |
433 // END - RAVI | 430 // END - RAVI |
434 | 431 |
435 | 432 |
436 | |
437 /******************************************************************************* | 433 /******************************************************************************* |
438 | 434 |
439 Private Routines | 435 Private Routines |
440 | 436 |
441 *******************************************************************************/ | 437 *******************************************************************************/ |
442 | 438 |
443 static void LanguageEnable( int newLanguage ) | 439 static void LanguageEnable( int newLanguage ) |
444 { | 440 { |
445 /* Initialise if required | 441 /* Initialise if required |
446 */ | 442 */ |
447 currentLanguage = newLanguage; | 443 currentLanguage = newLanguage; |
448 if ( ModuleKey != KEYVALUE ) | 444 if ( ModuleKey != KEYVALUE ) |
449 { | 445 { |
450 /* Nope, then go do it, If the mmibm_* routines fail to initialise | 446 /* Nope, then go do it, If the mmibm_* routines fail to initialise |
451 they will return NULL, and they both deal with bad input values | 447 they will return NULL, and they both deal with bad input values |
452 cleanly, so we don't need error checking here. | 448 cleanly, so we don't need error checking here. |
453 */ | 449 */ |
454 BlkManager = mmibm_Initialise( Mmir_BaseAddress(), Mmir_NumberOfEntries() ); | 450 BlkManager = mmibm_Initialise( Mmir_BaseAddress(), Mmir_NumberOfEntries() ); |
455 ModuleKey = KEYVALUE; | 451 ModuleKey = KEYVALUE; |
456 } | 452 } |
457 | 453 |
458 /* Set up the new language based on the incoming value | 454 /* Set up the new language based on the incoming value |
459 */ | 455 */ |
460 /*MC, SPR 1150, simplified for easier addition of new languages*/ | 456 /*MC, SPR 1150, simplified for easier addition of new languages*/ |
461 if (newLanguage> 0 && newLanguage <= NO_OF_LANGUAGES) | 457 if (newLanguage> 0 && newLanguage <= NO_OF_LANGUAGES) |
462 Language = mmibm_SupplyResourceHandler( BlkManager, newLanguage ); | 458 Language = mmibm_SupplyResourceHandler( BlkManager, newLanguage ); |
463 } | 459 } |
464 | 460 |
465 | 461 |
466 /******************************************************************************* | 462 /******************************************************************************* |
467 | 463 |
468 Public Routines | 464 Public Routines |
469 | 465 |
470 *******************************************************************************/ | 466 *******************************************************************************/ |
471 | 467 |
472 /******************************************************************************* | 468 /******************************************************************************* |
473 $Function: MmiRsrcGetText | 469 $Function: MmiRsrcGetText |
474 | 470 |
475 $Description: Define access routine for the actual get text | 471 $Description: Define access routine for the actual get text |
476 routine. In order to make sure the routine can | 472 routine. In order to make sure the routine can |
477 be invoked and will automatically start, we will | 473 be invoked and will automatically start, we will |
478 use the key value above to ensure we detect the | 474 use the key value above to ensure we detect the |
479 startup conditions. | 475 startup conditions. |
480 | 476 |
481 The calling routine for this function should check | 477 The calling routine for this function should check |
482 for NULL values which will be returned if the | 478 for NULL values which will be returned if the |
483 | 479 |
484 $Returns: Pointer to resource indicated by Id (Or NULL) | 480 $Returns: Pointer to resource indicated by Id (Or NULL) |
485 | 481 |
486 $Arguments: Id of requested resource | 482 $Arguments: Id of requested resource |
487 | 483 |
488 *******************************************************************************/ | 484 *******************************************************************************/ |
489 | 485 |
490 char *MmiRsrcGetText( int Id ) | 486 char *MmiRsrcGetText( int Id ) |
491 { | 487 { |
492 /* Check if we have already initialised | 488 /* Check if we have already initialised |
493 */ | 489 */ |
494 if ( ModuleKey != KEYVALUE ) | 490 if ( ModuleKey != KEYVALUE ) |
495 LanguageEnable( ENGLISH_LANGUAGE ); | 491 LanguageEnable( ENGLISH_LANGUAGE ); |
496 | 492 |
497 /* JVJ #1576 SAT is an exception, since the Menu string is variable depending on the SIM*/ | 493 /* JVJ #1576 SAT is an exception, since the Menu string is variable depending on the SIM*/ |
498 /* but the Languages table is constant. Therefore we need this workaround for the Mainmenu*/ | 494 /* but the Languages table is constant. Therefore we need this workaround for the Mainmenu*/ |
499 /* to display the SAT header */ | 495 /* to display the SAT header */ |
501 return (char*)SIMToolKitString; | 497 return (char*)SIMToolKitString; |
502 | 498 |
503 //x0pleela 23 May, 2006 DR: OMAPS00070657 | 499 //x0pleela 23 May, 2006 DR: OMAPS00070657 |
504 #ifdef FF_CPHS | 500 #ifdef FF_CPHS |
505 if( (Id==TxtLine1) && strlen(FFS_flashData.line1)) | 501 if( (Id==TxtLine1) && strlen(FFS_flashData.line1)) |
506 return (char*)FFS_flashData.line1; | 502 return (char*)FFS_flashData.line1; |
507 | 503 |
508 else if( (Id==TxtLine2) && strlen(FFS_flashData.line2)) | 504 else if( (Id==TxtLine2) && strlen(FFS_flashData.line2)) |
509 return (char*)FFS_flashData.line2; | 505 return (char*)FFS_flashData.line2; |
510 #endif | 506 #endif |
511 /* use the currently set up resource handler for the English | 507 /* use the currently set up resource handler for the English |
512 language to get the text associaed with the Id, again if | 508 language to get the text associaed with the Id, again if |
513 there has been a problem with the initialisation of the | 509 there has been a problem with the initialisation of the |
514 English handler, then the fetch routine will deal with it | 510 English handler, then the fetch routine will deal with it |
515 cleanly and return NULL. | 511 cleanly and return NULL. |
516 */ | 512 */ |
517 return (char *) mmibr_Fetch( Language, Id ); | 513 return (char *) mmibr_Fetch( Language, Id ); |
518 } | 514 } |
519 | 515 |
520 /*MC, SPR 1150 new function, don't need to write a new function for each new langauge now*/ | 516 /*MC, SPR 1150 new function, don't need to write a new function for each new langauge now*/ |
521 void MmiRsrcSetLang( int lang ) | 517 void MmiRsrcSetLang( int lang ) |
522 { if (lang == CHINESE_LANGUAGE) | 518 { if (lang == CHINESE_LANGUAGE) |
523 dspl_set_char_type(DSPL_TYPE_UNICODE); | 519 dspl_set_char_type(DSPL_TYPE_UNICODE); |
524 else | 520 else |
525 dspl_set_char_type(DSPL_TYPE_ASCII); | 521 dspl_set_char_type(DSPL_TYPE_ASCII); |
526 LanguageEnable( lang ); | 522 LanguageEnable( lang ); |
527 Mmi_layout_areas(); | 523 Mmi_layout_areas(); |
528 FFS_flashData.language = lang; | 524 FFS_flashData.language = lang; |
529 | 525 |
530 // Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu | 526 // Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu |
531 // Issue description: Golite booting problem. | 527 // Issue description: Golite booting problem. |
532 // Solution: If the FFS is not formatted, prevent writing into the FFS. | 528 // Solution: If the FFS is not formatted, prevent writing into the FFS. |
533 if(flash_formatted() == TRUE) | 529 if(flash_formatted() == TRUE) |
534 { | 530 { |
535 flash_write(); | 531 flash_write(); |
536 } | 532 } |
537 | 533 } |
538 | 534 |
539 } | |
540 /*MC SPR 1150, Simplified menu interface functions. | 535 /*MC SPR 1150, Simplified menu interface functions. |
541 It should be simpler to add new functions for new languages | 536 It should be simpler to add new functions for new languages |
542 We still need to write individual functions for each language to interface with the menus as | 537 We still need to write individual functions for each language to interface with the menus as |
543 the menu architecture does not allow passing parmeters*/ | 538 the menu architecture does not allow passing parmeters*/ |
544 /*OMAPS00070661 (SAT-Lang selection) a0393213(R.Prabakar) language selection sent to mfw*/ | 539 /*OMAPS00070661 (SAT-Lang selection) a0393213(R.Prabakar) language selection sent to mfw*/ |
583 /*MC SPR 1150,new generic langauge change function*/ | 578 /*MC SPR 1150,new generic langauge change function*/ |
584 void Mmi_Set2Language(int lang) | 579 void Mmi_Set2Language(int lang) |
585 { | 580 { |
586 T_MFW_HND win = mfw_parent(mfw_header()); | 581 T_MFW_HND win = mfw_parent(mfw_header()); |
587 #ifndef FF_MMI_R99_SAT_LANG /*OMAPS00070661(SAT-lang notify) a0393213(R.Prabakar)*/ | 582 #ifndef FF_MMI_R99_SAT_LANG /*OMAPS00070661(SAT-lang notify) a0393213(R.Prabakar)*/ |
588 resources_Init(win); | 583 resources_Init(win); |
589 MmiRsrcSetLang(lang); | 584 MmiRsrcSetLang(lang); |
590 SEND_EVENT (resources_data.resources_win, SHOW_CONFIRM, 0, 0); | 585 SEND_EVENT (resources_data.resources_win, SHOW_CONFIRM, 0, 0); |
591 #else | 586 #else |
592 /*OMAPS00070661 The sequence is changed to prevent the crash when the language is changed in quick succession*/ | 587 /*OMAPS00070661 The sequence is changed to prevent the crash when the language is changed in quick succession*/ |
593 MmiRsrcSetLang(lang); | 588 MmiRsrcSetLang(lang); |
594 if(!resources_data.resources_win) | 589 if(!resources_data.resources_win) |
595 { | 590 { |
596 resources_Init(win); | 591 resources_Init(win); |
597 SEND_EVENT (resources_data.resources_win, SHOW_CONFIRM, 0, 0); | 592 SEND_EVENT (resources_data.resources_win, SHOW_CONFIRM, 0, 0); |
598 } | 593 } |
599 #endif | 594 #endif |
600 | |
601 } | 595 } |
602 | 596 |
603 UBYTE Mmi_getCurrentLanguage(void) | 597 UBYTE Mmi_getCurrentLanguage(void) |
604 { | 598 { |
605 return currentLanguage; | 599 return currentLanguage; |
606 } | 600 } |
607 | 601 |
608 //GW Created to return height of a line with just numbers on it | 602 //GW Created to return height of a line with just numbers on it |
609 UBYTE numberLineHeight(void) | 603 UBYTE numberLineHeight(void) |
610 { | 604 { |
611 #ifndef LSCREEN | 605 #ifndef LSCREEN |
612 //All numbers are 8 bits high (whether chinese or latin chars) | 606 //All numbers are 8 bits high (whether chinese or latin chars) |
613 return (8); | 607 return (8); |
614 #else | 608 #else |
615 //all text is 12 bits high | 609 //all text is 12 bits high |
616 return (12); | 610 return (12); |
617 #endif | 611 #endif |
618 } | 612 } |
613 | |
619 //GW Created | 614 //GW Created |
620 UBYTE Mmi_layout_line(int lineNo) | 615 UBYTE Mmi_layout_line(int lineNo) |
621 { | 616 { |
622 #ifndef LSCREEN | 617 #ifndef LSCREEN |
623 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 618 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
624 { | 619 { |
625 switch (lineNo) | 620 switch (lineNo) |
626 { | 621 { |
627 case 1: return FIRST_LINE_CHINESE; | 622 case 1: return FIRST_LINE_CHINESE; |
628 | 623 |
629 case SECOND_LAST_LINE_TOP: | 624 case SECOND_LAST_LINE_TOP: |
630 case 2: return SECOND_LINE_CHINESE; | 625 case 2: return SECOND_LINE_CHINESE; |
631 | 626 |
632 case LAST_LINE_TOP: | 627 case LAST_LINE_TOP: |
633 case 3: return THIRD_LINE_CHINESE; | 628 case 3: return THIRD_LINE_CHINESE; |
634 | 629 |
635 case LAST_LINE: | 630 case LAST_LINE: |
636 case 4: return FOURTH_LINE_CHINESE; | 631 case 4: return FOURTH_LINE_CHINESE; |
637 //We are now asking for an invalid line | 632 //We are now asking for an invalid line |
638 default: return FOURTH_LINE_CHINESE; | 633 default: return FOURTH_LINE_CHINESE; |
639 | 634 |
640 } | 635 } |
641 } | 636 } |
642 else | 637 else |
643 { | 638 { |
644 switch (lineNo) | 639 switch (lineNo) |
645 { | 640 { |
646 case 1: return FIRST_LINE; | 641 case 1: return FIRST_LINE; |
647 case 2: return SECOND_LINE; | 642 case 2: return SECOND_LINE; |
648 case 3: return THIRD_LINE; | 643 case 3: return THIRD_LINE; |
649 | 644 |
650 case SECOND_LAST_LINE_TOP: | 645 case SECOND_LAST_LINE_TOP: |
651 case 4: return FOURTH_LINE; | 646 case 4: return FOURTH_LINE; |
652 | 647 |
653 case LAST_LINE_TOP: //y-coord of the top of last line | 648 case LAST_LINE_TOP: //y-coord of the top of last line |
654 case 5: return FIFTH_LINE; | 649 case 5: return FIFTH_LINE; |
655 | 650 |
656 case LAST_LINE: | 651 case LAST_LINE: |
657 case 6: return SIXTH_LINE; | 652 case 6: return SIXTH_LINE; |
658 //We are now asking for an invalid line | 653 //We are now asking for an invalid line |
659 default: return SIXTH_LINE; | 654 default: return SIXTH_LINE; |
660 } | 655 } |
661 } | 656 } |
662 #else | 657 #else |
663 //assume both fonts are now the same height. | 658 //assume both fonts are now the same height. |
664 switch (lineNo) | 659 switch (lineNo) |
665 { | 660 { |
666 case SECOND_LAST_LINE_TOP: return ( (UBYTE)(SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()-LINE_HEIGHT)); | 661 case SECOND_LAST_LINE_TOP: return ( (UBYTE)(SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()-LINE_HEIGHT)); |
667 case LAST_LINE_TOP: return ( (UBYTE)(SCREEN_SIZE_Y-Mmi_layout_softkeyHeight())); | 662 case LAST_LINE_TOP: return ( (UBYTE)(SCREEN_SIZE_Y-Mmi_layout_softkeyHeight())); |
668 case LAST_LINE: return ( (UBYTE) SCREEN_SIZE_Y); | 663 case LAST_LINE: return ( (UBYTE) SCREEN_SIZE_Y); |
669 | 664 |
670 default: return (lineNo*LINE_HEIGHT); | 665 default: return (lineNo*LINE_HEIGHT); |
671 } | 666 } |
672 #endif | 667 #endif |
673 } | 668 } |
669 | |
674 UBYTE Mmi_layout_line_icons(int lineNo) | 670 UBYTE Mmi_layout_line_icons(int lineNo) |
675 { | 671 { |
676 #ifndef LSCREEN | 672 #ifndef LSCREEN |
677 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 673 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
678 { | 674 { |
679 switch (lineNo) | 675 switch (lineNo) |
680 { | 676 { |
681 case 1: return FIRST_LINE_CHINESE; | 677 case 1: return FIRST_LINE_CHINESE; |
682 | 678 |
683 case SECOND_LAST_LINE_TOP: | 679 case SECOND_LAST_LINE_TOP: |
684 case 2: return SECOND_LINE_CHINESE; | 680 case 2: return SECOND_LINE_CHINESE; |
685 | 681 |
686 case LAST_LINE_TOP: | 682 case LAST_LINE_TOP: |
687 case 3: return THIRD_LINE_CHINESE; | 683 case 3: return THIRD_LINE_CHINESE; |
688 | 684 |
689 case LAST_LINE: | 685 case LAST_LINE: |
690 case 4: return FOURTH_LINE_CHINESE; | 686 case 4: return FOURTH_LINE_CHINESE; |
691 //We are now asking for an invalid line | 687 //We are now asking for an invalid line |
692 default: return FOURTH_LINE_CHINESE; | 688 default: return FOURTH_LINE_CHINESE; |
693 | 689 |
694 } | 690 } |
695 } | 691 } |
696 else | 692 else |
697 { | 693 { |
698 switch (lineNo) | 694 switch (lineNo) |
699 { | 695 { |
700 case 1: //nobreak; | 696 case 1: //nobreak; |
701 case 2: //nobreak; | 697 case 2: //nobreak; |
702 case 3: //nobreak; | 698 case 3: //nobreak; |
703 default: return (FIRST_LINE_ICON+(lineNo-1)*LINE_HEIGHT); | 699 default: return (FIRST_LINE_ICON+(lineNo-1)*LINE_HEIGHT); |
704 | 700 |
705 case SECOND_LAST_LINE_TOP: | 701 case SECOND_LAST_LINE_TOP: |
706 case 4: return FOURTH_LINE; | 702 case 4: return FOURTH_LINE; |
707 | 703 |
708 case LAST_LINE_TOP: //y-coord of the top of last line | 704 case LAST_LINE_TOP: //y-coord of the top of last line |
709 case 5: return FIFTH_LINE; | 705 case 5: return FIFTH_LINE; |
710 | 706 |
711 case LAST_LINE: | 707 case LAST_LINE: |
712 case 6: return SIXTH_LINE; | 708 case 6: return SIXTH_LINE; |
713 } | 709 } |
714 | 710 |
715 } | 711 } |
716 #else | 712 #else |
717 switch (lineNo) | 713 switch (lineNo) |
718 { | 714 { |
719 case SECOND_LAST_LINE_TOP: return((UBYTE)(SCREEN_SIZE_Y-(Mmi_layout_softkeyHeight()+Mmi_layout_line_height()))); | 715 case SECOND_LAST_LINE_TOP: return((UBYTE)(SCREEN_SIZE_Y-(Mmi_layout_softkeyHeight()+Mmi_layout_line_height()))); |
720 case LAST_LINE_TOP: return((UBYTE)(SCREEN_SIZE_Y-(Mmi_layout_softkeyHeight()))); | 716 case LAST_LINE_TOP: return((UBYTE)(SCREEN_SIZE_Y-(Mmi_layout_softkeyHeight()))); |
721 case LAST_LINE: return((UBYTE)(SCREEN_SIZE_Y)); | 717 case LAST_LINE: return((UBYTE)(SCREEN_SIZE_Y)); |
722 default: return(Mmi_layout_IconHeight()+Mmi_layout_line_height()*lineNo); | 718 default: return(Mmi_layout_IconHeight()+Mmi_layout_line_height()*lineNo); |
723 | 719 |
724 } | 720 } |
725 #endif | 721 #endif |
726 } | 722 } |
727 | 723 |
728 UBYTE Mmi_layout_line_height(void) | 724 UBYTE Mmi_layout_line_height(void) |
729 { | 725 { |
730 #ifndef LSCREEN | 726 #ifndef LSCREEN |
731 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 727 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
732 return LINE_HEIGHT_CHINESE; | 728 return LINE_HEIGHT_CHINESE; |
733 else | 729 else |
734 return LINE_HEIGHT; | 730 return LINE_HEIGHT; |
735 #else | 731 #else |
736 return (LINE_HEIGHT); | 732 return (LINE_HEIGHT); |
737 #endif | 733 #endif |
738 } | 734 } |
739 | 735 |
740 UBYTE Mmi_layout_softkeyHeight( void ) | 736 UBYTE Mmi_layout_softkeyHeight( void ) |
741 { | 737 { |
742 #ifndef LSCREEN | 738 #ifndef LSCREEN |
743 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 739 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
744 return SK_HEIGHT_CHINESE; | 740 return SK_HEIGHT_CHINESE; |
745 else | 741 else |
746 return SK_HEIGHT_LATIN; | 742 return SK_HEIGHT_LATIN; |
747 #else | 743 #else |
748 return (SK_HEIGHT_LATIN); | 744 return (SK_HEIGHT_LATIN); |
749 #endif | 745 #endif |
750 } | 746 } |
747 | |
751 UBYTE Mmi_layout_softkeyArea( MfwRect* rect ) | 748 UBYTE Mmi_layout_softkeyArea( MfwRect* rect ) |
752 { | 749 { |
753 if (!rect) | 750 if (!rect) |
754 return (0); | 751 return (0); |
755 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 752 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
756 rect->sy = SK_HEIGHT_CHINESE; | 753 rect->sy = SK_HEIGHT_CHINESE; |
757 else | 754 else |
758 rect->sy = SK_HEIGHT_LATIN; | 755 rect->sy = SK_HEIGHT_LATIN; |
759 rect->px = 0; | 756 rect->px = 0; |
760 rect->sx = SCREEN_SIZE_X; | 757 rect->sx = SCREEN_SIZE_X; |
761 rect->py = SCREEN_SIZE_Y-rect->sy; | 758 rect->py = SCREEN_SIZE_Y-rect->sy; |
762 return(1); | 759 return(1); |
763 } | 760 } |
761 | |
764 UBYTE Mmi_layout_TitleHeight( void ) | 762 UBYTE Mmi_layout_TitleHeight( void ) |
765 { | 763 { |
766 #ifndef LSCREEN | 764 #ifndef LSCREEN |
767 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 765 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
768 return TITLE_HEIGHT_CHINESE; | 766 return TITLE_HEIGHT_CHINESE; |
769 else | 767 else |
770 return TITLE_HEIGHT_LATIN; | 768 return TITLE_HEIGHT_LATIN; |
771 #else | 769 #else |
772 return (TITLE_HEIGHT_LATIN); | 770 return (TITLE_HEIGHT_LATIN); |
773 #endif | 771 #endif |
774 } | 772 } |
773 | |
775 UBYTE Mmi_layout_IconHeight( void ) | 774 UBYTE Mmi_layout_IconHeight( void ) |
776 { | 775 { |
777 return (ICON_HEIGHT); | 776 return (ICON_HEIGHT); |
778 } | 777 } |
779 | 778 |
780 UBYTE Mmi_number_of_lines_with_icons_on_top(void) | 779 UBYTE Mmi_number_of_lines_with_icons_on_top(void) |
781 { | 780 { |
782 #ifndef LSCREEN | 781 #ifndef LSCREEN |
783 { | 782 { |
784 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 783 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
785 return 2; | 784 return 2; |
786 else | 785 else |
787 return 4; | 786 return 4; |
788 } | 787 } |
789 #else | 788 #else |
790 return NLINES_MAX-1; | 789 return NLINES_MAX-1; |
791 #endif | 790 #endif |
792 } | 791 } |
793 | 792 |
794 | 793 |
795 UBYTE Mmi_number_of_lines_without_icons_on_top(void) | 794 UBYTE Mmi_number_of_lines_without_icons_on_top(void) |
796 { | 795 { |
797 #ifndef LSCREEN | 796 #ifndef LSCREEN |
798 { | 797 { |
799 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 798 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
800 return 3; | 799 return 3; |
801 else | 800 else |
802 return 5; | 801 return 5; |
803 } | 802 } |
804 #else //assume a single font of 12 pixels high 10 lines x 12 pixels | 803 #else //assume a single font of 12 pixels high 10 lines x 12 pixels |
805 return NLINES_MAX; | 804 return NLINES_MAX; |
806 #endif | 805 #endif |
807 } | 806 } |
808 | 807 |
809 //GW 10/02/03 Modified code - icon position is now sorted out by 'iconsMainIconsAreaSet' - the code | 808 //GW 10/02/03 Modified code - icon position is now sorted out by 'iconsMainIconsAreaSet' - the code |
810 // here only supplies the available screen size | 809 // here only supplies the available screen size |
811 void Mmi_layout_areas(void) | 810 void Mmi_layout_areas(void) |
812 { | 811 { |
813 MAINICONarea.px = 0; | 812 MAINICONarea.px = 0; |
814 MAINICONarea.py =Mmi_layout_line_height(); | 813 MAINICONarea.py =Mmi_layout_line_height(); |
815 | 814 |
816 MAINICONarea.sx = SCREEN_SIZE_X; | 815 MAINICONarea.sx = SCREEN_SIZE_X; |
817 MAINICONarea.sy =SCREEN_SIZE_Y-Mmi_layout_line_height()*2-1; | 816 MAINICONarea.sy =SCREEN_SIZE_Y-Mmi_layout_line_height()*2-1; |
818 | 817 |
819 Mmi_set_area_attr(&menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 818 Mmi_set_area_attr(&menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
820 Mmi_set_area_attr(&menuNamesArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-LINE_HEIGHT-Mmi_layout_softkeyHeight()); | 819 Mmi_set_area_attr(&menuNamesArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-LINE_HEIGHT-Mmi_layout_softkeyHeight()); |
821 Mmi_set_area_attr(&menuListArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 820 Mmi_set_area_attr(&menuListArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
822 Mmi_set_area_attr(&editor_menuArea,Mmi_layout_line(1),0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 821 Mmi_set_area_attr(&editor_menuArea,Mmi_layout_line(1),0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
823 Mmi_set_area_attr(&network_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-/*Mmi_layout_IconHeight()-*/Mmi_layout_softkeyHeight()); /* SPR#2354 - SH - icons aren't shown */ | 822 Mmi_set_area_attr(&network_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-/*Mmi_layout_IconHeight()-*/Mmi_layout_softkeyHeight()); /* SPR#2354 - SH - icons aren't shown */ |
824 Mmi_set_area_attr(&sat_setup_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 823 Mmi_set_area_attr(&sat_setup_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
825 Mmi_set_area_attr(&sat_select_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 824 Mmi_set_area_attr(&sat_select_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
826 Mmi_set_area_attr(&smscb_M_CBArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 825 Mmi_set_area_attr(&smscb_M_CBArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
827 Mmi_set_area_attr(&smscb_M_CB_ACTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 826 Mmi_set_area_attr(&smscb_M_CB_ACTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
828 Mmi_set_area_attr(&smscb_M_CB_TOPArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 827 Mmi_set_area_attr(&smscb_M_CB_TOPArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
829 Mmi_set_area_attr(&smscb_M_CB_TOP_CONSArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 828 Mmi_set_area_attr(&smscb_M_CB_TOP_CONSArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
830 Mmi_set_area_attr(&smscb_M_CB_TOP_CONS_SELArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 829 Mmi_set_area_attr(&smscb_M_CB_TOP_CONS_SELArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
831 Mmi_set_area_attr(&smscb_CBArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 830 Mmi_set_area_attr(&smscb_CBArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
832 Mmi_set_area_attr(&smscb_CB_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 831 Mmi_set_area_attr(&smscb_CB_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
833 Mmi_set_area_attr(&readSMS_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 832 Mmi_set_area_attr(&readSMS_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
834 #ifdef FF_MMI_FILEMANAGER | 833 #ifdef FF_MMI_FILEMANAGER |
835 Mmi_set_area_attr(&FileType_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); // RAVI - 27-05-2005 | 834 Mmi_set_area_attr(&FileType_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); // RAVI - 27-05-2005 |
836 #endif | 835 #endif |
837 Mmi_set_area_attr(&SmsRead_R_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 836 Mmi_set_area_attr(&SmsRead_R_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
838 Mmi_set_area_attr(&SmsSend_R_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 837 Mmi_set_area_attr(&SmsSend_R_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
839 Mmi_set_area_attr(&melody_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); | 838 Mmi_set_area_attr(&melody_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); |
840 iconsMainIconsAreaSet (MAINICONarea); | 839 iconsMainIconsAreaSet (MAINICONarea); |
841 | |
842 } | 840 } |
843 | 841 |
844 void Mmi_set_area_attr(MfwRect* area,U16 px,U16 py,U16 sx,U16 sy) | 842 void Mmi_set_area_attr(MfwRect* area,U16 px,U16 py,U16 sx,U16 sy) |
845 { | 843 { |
846 | 844 /* pass in top-left/bottom-right coordinates*/ |
847 /* pass in top-left/bottom-right coordinates*/ | 845 area->px = px; |
848 area->px = px; | 846 area->py = py; |
849 area->py = py; | 847 area->sx = sx-px; |
850 area->sx = sx-px; | 848 area->sy = sy-py; |
851 area->sy = sy-py; | 849 } |
852 } | 850 |
853 | 851 /******************************************************************************* |
854 /******************************************************************************* | 852 |
855 | 853 $Function: resources_Init |
856 $Function: resources_Init | |
857 | 854 |
858 $Description: | 855 $Description: |
859 | 856 |
860 $Returns: window | 857 $Returns: window |
861 | 858 |
862 $Arguments: parent window | 859 $Arguments: parent window |
863 | 860 |
864 *******************************************************************************/ | 861 *******************************************************************************/ |
865 T_MFW_HND resources_Init(T_MFW_HND parent_window) | 862 T_MFW_HND resources_Init(T_MFW_HND parent_window) |
866 { | 863 { |
867 return (resources_create (parent_window)); | 864 return (resources_create (parent_window)); |
868 } | 865 } |
869 | 866 |
870 // API - 1550 - 13-01-03 - Add this function to reset the backgrounds of Idle and Main Menus. | 867 // API - 1550 - 13-01-03 - Add this function to reset the backgrounds of Idle and Main Menus. |
871 void resetFactoryBackground ( void ) | 868 void resetFactoryBackground ( void ) |
872 { | 869 { |
873 idle_setBgdBitmap(BGD_TI_LOGO); | 870 idle_setBgdBitmap(BGD_TI_LOGO); |
874 FFS_flashData.IdleScreenBgd = BGD_TI_LOGO; | 871 FFS_flashData.IdleScreenBgd = BGD_TI_LOGO; |
875 | 872 |
876 icon_setMainBgdBitmap(BGD_SQUARE); | 873 icon_setMainBgdBitmap(BGD_SQUARE); |
877 FFS_flashData.MainMenuBgd = BGD_SQUARE; | 874 FFS_flashData.MainMenuBgd = BGD_SQUARE; |
878 | 875 |
879 FFS_flashData.ProviderNetworkShow = TRUE; | 876 FFS_flashData.ProviderNetworkShow = TRUE; |
880 } | 877 } |
881 | 878 |
882 void resetFactoryColour ( void ) | 879 void resetFactoryColour ( void ) |
883 { | 880 { |
884 initDefaultDataColour(); | 881 initDefaultDataColour(); |
885 if(flash_data_write(colourFileDir, colourFileName, colArray, sizeof(colArray)) >= EFFS_OK) | 882 if(flash_data_write(colourFileDir, colourFileName, colArray, sizeof(colArray)) >= EFFS_OK) |
886 { | 883 { |
887 TRACE_EVENT("File Created in FFS"); | 884 TRACE_EVENT("File Created in FFS"); |
888 } | 885 } |
889 else | 886 else |
890 { | 887 { |
891 TRACE_EVENT("File Not Created in FFS"); | 888 TRACE_EVENT("File Not Created in FFS"); |
892 } | 889 } |
893 | 890 } |
894 } | 891 |
895 void colour_initial_colours (void) | 892 void colour_initial_colours (void) |
896 { | 893 { |
897 /* API/GW - Added to read the flash structure to see if the file structure to save the colour data in has been created | 894 /* API/GW - Added to read the flash structure to see if the file structure to save the colour data in has been created |
898 and if so save the initialised data to flash or load the saved values out of flash | 895 and if so save the initialised data to flash or load the saved values out of flash |
899 */ | 896 */ |
900 if (flash_data_read(colourFileDir, colourFileName, colArray, sizeof(colArray)) == sizeof(colArray)) | 897 if (flash_data_read(colourFileDir, colourFileName, colArray, sizeof(colArray)) == sizeof(colArray)) |
901 /* Marcus: Issue 1719: 11/02/2003: Altered comparison in condition */ | 898 /* Marcus: Issue 1719: 11/02/2003: Altered comparison in condition */ |
902 { | 899 { |
903 TRACE_EVENT("Correctly Read in!"); | 900 TRACE_EVENT("Correctly Read in!"); |
904 } | 901 } |
905 else | 902 else |
906 { | 903 { |
907 resetFactoryColour(); | 904 resetFactoryColour(); |
908 } | 905 } |
909 } | 906 } |
910 /******************************************************************************* | 907 |
911 | 908 /******************************************************************************* |
912 $Function: resources_Exit | 909 |
913 | 910 $Function: resources_Exit |
914 $Description: exit network handling (Backward Compatibility interface) | 911 |
915 | 912 $Description: exit network handling (Backward Compatibility interface) |
916 $Returns: none | 913 |
917 | 914 $Returns: none |
918 $Arguments: window | 915 |
916 $Arguments: window | |
919 | 917 |
920 *******************************************************************************/ | 918 *******************************************************************************/ |
921 void resources_Exit (T_MFW_HND own_window) | 919 void resources_Exit (T_MFW_HND own_window) |
922 { | 920 { |
923 | 921 |
926 | 924 |
927 resources_destroy (data->resources_win); | 925 resources_destroy (data->resources_win); |
928 } | 926 } |
929 | 927 |
930 | 928 |
931 | 929 /******************************************************************************* |
932 | 930 |
933 /******************************************************************************* | 931 $Function: resources_create |
934 | 932 |
935 $Function: resources_create | 933 $Description: create network top window |
936 | 934 |
937 $Description: create network top window | 935 $Returns: window |
938 | 936 |
939 $Returns: window | 937 $Arguments: parent_window |
940 | |
941 $Arguments: parent_window | |
942 | 938 |
943 *******************************************************************************/ | 939 *******************************************************************************/ |
944 T_MFW_HND resources_create (T_MFW_HND parent_window) | 940 T_MFW_HND resources_create (T_MFW_HND parent_window) |
945 { | 941 { |
946 T_resources * data = &resources_data; | 942 T_resources * data = &resources_data; |
959 data->mmi_control.dialog = (T_DIALOG_FUNC)resources; | 955 data->mmi_control.dialog = (T_DIALOG_FUNC)resources; |
960 data->mmi_control.data = data; | 956 data->mmi_control.data = data; |
961 win = ((T_MFW_HDR *)data->resources_win)->data; | 957 win = ((T_MFW_HDR *)data->resources_win)->data; |
962 win->user = (void *) data; | 958 win->user = (void *) data; |
963 | 959 |
964 | |
965 winShow(data->resources_win); | 960 winShow(data->resources_win); |
966 /* | 961 /* |
967 * return window handle | 962 * return window handle |
968 */ | 963 */ |
969 return data->resources_win; | 964 return data->resources_win; |
970 } | 965 } |
971 | 966 |
972 | 967 |
973 | 968 /******************************************************************************* |
974 /******************************************************************************* | 969 |
975 | 970 $Function: resources_destroy |
976 $Function: resources_destroy | |
977 | 971 |
978 $Description: | 972 $Description: |
979 | 973 |
980 $Returns: none | 974 $Returns: none |
981 | 975 |
982 $Arguments: window | 976 $Arguments: window |
983 | 977 |
984 *******************************************************************************/ | 978 *******************************************************************************/ |
985 void resources_destroy (T_MFW_HND own_window) | 979 void resources_destroy (T_MFW_HND own_window) |
986 { | 980 { |
987 T_MFW_WIN * win; | 981 T_MFW_WIN * win; |
1007 } | 1001 } |
1008 | 1002 |
1009 | 1003 |
1010 /******************************************************************************* | 1004 /******************************************************************************* |
1011 | 1005 |
1012 $Function: resources_win_cb | 1006 $Function: resources_win_cb |
1013 | 1007 |
1014 $Description: network top window | 1008 $Description: network top window |
1015 | 1009 |
1016 $Returns: status int | 1010 $Returns: status int |
1017 | 1011 |
1018 $Arguments: event, window | 1012 $Arguments: event, window |
1019 | 1013 |
1020 *******************************************************************************/ | 1014 *******************************************************************************/ |
1021 static int resources_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) | 1015 static int resources_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) |
1022 { | 1016 { |
1023 /* | 1017 /* |
1025 */ | 1019 */ |
1026 return 1; | 1020 return 1; |
1027 } | 1021 } |
1028 | 1022 |
1029 | 1023 |
1030 | 1024 /******************************************************************************* |
1031 | 1025 |
1032 | 1026 $Function: resources_language_confirm |
1033 /******************************************************************************* | |
1034 | |
1035 $Function: resources_language_confirm | |
1036 | 1027 |
1037 $Description: | 1028 $Description: |
1038 | 1029 |
1039 $Returns: void | 1030 $Returns: void |
1040 | 1031 |
1041 $Arguments: void | 1032 $Arguments: void |
1042 | 1033 |
1043 *******************************************************************************/ | 1034 *******************************************************************************/ |
1044 static void resources_language_confirm(void) | 1035 static void resources_language_confirm(void) |
1045 { | 1036 { |
1046 T_DISPLAY_DATA display_info; | 1037 T_DISPLAY_DATA display_info; |
1047 | 1038 |
1048 TRACE_FUNCTION ("resources_language_confirm()"); | 1039 TRACE_FUNCTION ("resources_language_confirm()"); |
1049 | 1040 |
1050 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtDone, TxtNull , COLOUR_STATUS_PINS); | 1041 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtDone, TxtNull , COLOUR_STATUS_PINS); |
1051 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)resources_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT ); | 1042 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)resources_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT ); |
1052 | 1043 |
1053 /* | 1044 /* |
1054 * Call Info Screen | 1045 * Call Info Screen |
1055 */ | 1046 */ |
1056 info_dialog (resources_data.resources_win, &display_info); | 1047 info_dialog (resources_data.resources_win, &display_info); |
1057 | 1048 } |
1058 } | 1049 |
1059 | 1050 /******************************************************************************* |
1060 /******************************************************************************* | 1051 |
1061 | 1052 $Function: resources_dialog_cb |
1062 $Function: resources_dialog_cb | |
1063 | 1053 |
1064 $Description: | 1054 $Description: |
1065 | 1055 |
1066 $Returns: void | 1056 $Returns: void |
1067 | 1057 |
1068 $Arguments: window, identifier, reason | 1058 $Arguments: window, identifier, reason |
1069 | 1059 |
1070 *******************************************************************************/ | 1060 *******************************************************************************/ |
1071 void resources_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) | 1061 void resources_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) |
1072 { | 1062 { |
1073 TRACE_FUNCTION ("resources_dialog_cb()"); | 1063 TRACE_FUNCTION ("resources_dialog_cb()"); |
1074 | 1064 |
1075 switch (reason) | 1065 switch (reason) |
1076 { | 1066 { |
1077 case INFO_TIMEOUT: | 1067 case INFO_TIMEOUT: |
1078 /* no break; */ | 1068 /* no break; */ |
1085 break; | 1075 break; |
1086 } | 1076 } |
1087 } | 1077 } |
1088 | 1078 |
1089 | 1079 |
1090 | 1080 /******************************************************************************* |
1091 /******************************************************************************* | 1081 |
1092 | 1082 $Function: resources |
1093 $Function: resources | |
1094 | 1083 |
1095 $Description: | 1084 $Description: |
1096 | 1085 |
1097 $Returns: void | 1086 $Returns: void |
1098 | 1087 |
1099 $Arguments: window, event, value, parameter | 1088 $Arguments: window, event, value, parameter |
1100 | 1089 |
1101 *******************************************************************************/ | 1090 *******************************************************************************/ |
1102 void resources (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 1091 void resources (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
1103 { | 1092 { |
1104 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI | 1093 // T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; // RAVI |
1107 TRACE_FUNCTION("resources()"); | 1096 TRACE_FUNCTION("resources()"); |
1108 | 1097 |
1109 switch (event) | 1098 switch (event) |
1110 { | 1099 { |
1111 case SHOW_CONFIRM: | 1100 case SHOW_CONFIRM: |
1112 resources_language_confirm(); | 1101 resources_language_confirm(); |
1113 break; | 1102 break; |
1114 } | 1103 } |
1115 | 1104 } |
1116 } | 1105 |
1117 /*MC added for SPR 1111*/ | 1106 /*MC added for SPR 1111*/ |
1118 /******************************************************************************* | 1107 /******************************************************************************* |
1119 | 1108 |
1120 $Function: resources_reset_language | 1109 $Function: resources_reset_language |
1121 | 1110 |
1122 $Description: Reset language using Pseudo-SS string | 1111 $Description: Reset language using Pseudo-SS string |
1123 | 1112 |
1124 $Returns: TRUE if reset successful, FALSE otherwise | 1113 $Returns: TRUE if reset successful, FALSE otherwise |
1125 | 1114 |
1126 $Arguments: Pseudo-SS string | 1115 $Arguments: Pseudo-SS string |
1127 | 1116 |
1128 *******************************************************************************/ | 1117 *******************************************************************************/ |
1129 BOOL resources_reset_language(char* string) | 1118 BOOL resources_reset_language(char* string) |
1130 { | 1119 { |
1131 char country_code[4]; | 1120 char country_code[4]; |
1132 int i; | 1121 int i; |
1133 /*extract country code from input string*/ | 1122 /*extract country code from input string*/ |
1134 memcpy(country_code, &string[3], 3); | 1123 memcpy(country_code, &string[3], 3); |
1135 country_code[3] = NULL; | 1124 country_code[3] = NULL; |
1136 | 1125 |
1137 /*for each entry in Language table*/ | 1126 /*for each entry in Language table*/ |
1138 for(i=0; i<LanguageTable.no_of_entries; i++) | 1127 for(i=0; i<LanguageTable.no_of_entries; i++) |
1139 { /*if country matches that of entry*/ | 1128 { /*if country matches that of entry*/ |
1140 | 1129 |
1141 if (!strcmp(country_code, LanguageTable.entries[i].country_dialling_code)) | 1130 if (!strcmp(country_code, LanguageTable.entries[i].country_dialling_code)) |
1142 { /*MC SPR 1150, check language fits in allowed range, rather than checking for each | 1131 { /*MC SPR 1150, check language fits in allowed range, rather than checking for each |
1143 and every language (easier to add more languages this way)*/ | 1132 and every language (easier to add more languages this way)*/ |
1144 if (LanguageTable.entries[i].language>0 && LanguageTable.entries[i].language <= NO_OF_LANGUAGES) | 1133 if (LanguageTable.entries[i].language>0 && LanguageTable.entries[i].language <= NO_OF_LANGUAGES) |
1145 { MmiRsrcSetLang(LanguageTable.entries[i].language); | 1134 { MmiRsrcSetLang(LanguageTable.entries[i].language); |
1146 return TRUE; | 1135 return TRUE; |
1147 } | 1136 } |
1148 } | 1137 } |
1149 } | 1138 } |
1150 /*if no matches found*/ | 1139 /*if no matches found*/ |
1151 return FALSE; | 1140 return FALSE; |
1152 } | 1141 } |
1153 | 1142 |
1154 /******************************************************************************* | 1143 /******************************************************************************* |
1155 | 1144 |
1156 $Function: | 1145 $Function: |
1170 //Aug 25, 2004 REF: CRR 24297 Deepa M.D | 1159 //Aug 25, 2004 REF: CRR 24297 Deepa M.D |
1171 //This function is called only for Color build. | 1160 //This function is called only for Color build. |
1172 #ifdef COLOURDISPLAY | 1161 #ifdef COLOURDISPLAY |
1173 void init_getDataColour(int screenType, int colType, U32 *fgd, U32 *bgd) | 1162 void init_getDataColour(int screenType, int colType, U32 *fgd, U32 *bgd) |
1174 { | 1163 { |
1175 U32 fgColor; | 1164 U32 fgColor; |
1176 U32 bgColor; | 1165 U32 bgColor; |
1177 U32 fgHLColor = NO_COLOUR_DEFINED; | 1166 U32 fgHLColor = NO_COLOUR_DEFINED; |
1178 U32 bgHLColor = NO_COLOUR_DEFINED; | 1167 U32 bgHLColor = NO_COLOUR_DEFINED; |
1179 U32 fgSKColor = NO_COLOUR_DEFINED; | 1168 U32 fgSKColor = NO_COLOUR_DEFINED; |
1180 U32 bgSKColor = NO_COLOUR_DEFINED; | 1169 U32 bgSKColor = NO_COLOUR_DEFINED; |
1181 U32 fgTColor = NO_COLOUR_DEFINED; | 1170 U32 fgTColor = NO_COLOUR_DEFINED; |
1182 U32 bgTColor = NO_COLOUR_DEFINED; | 1171 U32 bgTColor = NO_COLOUR_DEFINED; |
1183 | 1172 |
1184 TRACE_EVENT("init_getDataColour"); | 1173 TRACE_EVENT("init_getDataColour"); |
1185 | 1174 |
1186 switch (screenType) | 1175 switch (screenType) |
1187 { | 1176 { |
1188 case COLOUR_STATUS_WELCOME: //start screen | 1177 case COLOUR_STATUS_WELCOME: //start screen |
1189 case COLOUR_STATUS_GOODBYE: //end screen | 1178 case COLOUR_STATUS_GOODBYE: //end screen |
1190 fgColor = COL_Black; | 1179 fgColor = COL_Black; |
1191 bgColor = COL_White; | 1180 bgColor = COL_White; |
1192 fgSKColor = COL_Blue; | 1181 fgSKColor = COL_Blue; |
1193 bgSKColor = COL_Yellow; | 1182 bgSKColor = COL_Yellow; |
1194 break; | 1183 break; |
1195 | 1184 |
1196 /* GW#2294 Use a more legible colour as default background colour.*/ | 1185 /* GW#2294 Use a more legible colour as default background colour.*/ |
1197 case COLOUR_POPUP: | 1186 case COLOUR_POPUP: |
1198 case COLOUR_STATUS: //generic status window | 1187 case COLOUR_STATUS: //generic status window |
1199 fgColor = COL_Red; //0x0000FF00; | 1188 fgColor = COL_Red; //0x0000FF00; |
1200 bgColor = COL_Yellow;//0x00FFFFFF; | 1189 bgColor = COL_Yellow;//0x00FFFFFF; |
1201 fgSKColor = COL_Red; | 1190 fgSKColor = COL_Red; |
1202 bgSKColor = COL_TRANSPARENT; | 1191 bgSKColor = COL_TRANSPARENT; |
1203 break; | 1192 break; |
1204 | 1193 |
1205 case COLOUR_EDITOR: | 1194 case COLOUR_EDITOR: |
1206 fgTColor = COL_White; | 1195 fgTColor = COL_White; |
1207 bgTColor = COL_Blue; | 1196 bgTColor = COL_Blue; |
1208 fgColor = COL_Blue; // 0x00FFFF00; | 1197 fgColor = COL_Blue; // 0x00FFFF00; |
1209 bgColor = COL_Yellow;//COL_White;//0x00FFFFFF; | 1198 bgColor = COL_Yellow;//COL_White;//0x00FFFFFF; |
1210 fgSKColor = COL_Blue; | 1199 fgSKColor = COL_Blue; |
1211 bgSKColor = COL_PaleYellow; //0x00FFFF00; | 1200 bgSKColor = COL_PaleYellow; //0x00FFFF00; |
1212 break; | 1201 break; |
1213 | 1202 |
1214 case COLOUR_LIST_MAIN: | 1203 case COLOUR_LIST_MAIN: |
1215 fgTColor = COL_White; | 1204 fgTColor = COL_White; |
1216 bgTColor = COL_BLK; | 1205 bgTColor = COL_BLK; |
1217 fgColor = COL_Yellow ; | 1206 fgColor = COL_Yellow ; |
1218 bgColor = COL_Blue; | 1207 bgColor = COL_Blue; |
1219 fgColor = COL_Black ; | 1208 fgColor = COL_Black ; |
1220 bgColor = COL_White; | 1209 bgColor = COL_White; |
1221 fgSKColor = COL_W; | 1210 fgSKColor = COL_W; |
1222 bgSKColor = COL_BLK; //0x00FFFF00; | 1211 bgSKColor = COL_BLK; //0x00FFFF00; |
1223 bgHLColor = COL_MidGrey; | 1212 bgHLColor = COL_MidGrey; |
1224 break; | 1213 break; |
1225 | 1214 |
1226 case COLOUR_LIST_SUBMENU: | 1215 case COLOUR_LIST_SUBMENU: |
1227 case COLOUR_LIST_SUBMENU1: | 1216 case COLOUR_LIST_SUBMENU1: |
1228 case COLOUR_LIST_SUBMENU2: | 1217 case COLOUR_LIST_SUBMENU2: |
1229 case COLOUR_LIST_SUBMENU3: | 1218 case COLOUR_LIST_SUBMENU3: |
1230 case COLOUR_LIST_SUBMENU4: | 1219 case COLOUR_LIST_SUBMENU4: |
1231 fgTColor = COL_Blue; | 1220 fgTColor = COL_Blue; |
1232 bgTColor = COL_PaleYellow; | 1221 bgTColor = COL_PaleYellow; |
1233 fgColor = COL_Black ; | 1222 fgColor = COL_Black ; |
1234 bgColor = COL_White; | 1223 bgColor = COL_White; |
1235 bgHLColor = COL_MidGrey; | 1224 bgHLColor = COL_MidGrey; |
1236 fgSKColor = COL_Blue; | 1225 fgSKColor = COL_Blue; |
1237 bgSKColor = COL_PaleYellow; //0x00FFFF00; | 1226 bgSKColor = COL_PaleYellow; //0x00FFFF00; |
1238 break; | 1227 break; |
1239 | 1228 |
1240 case COLOUR_LIST_COLOUR: | 1229 case COLOUR_LIST_COLOUR: |
1241 fgColor = COL_RG2; | 1230 fgColor = COL_RG2; |
1242 bgColor = COL_W2; | 1231 bgColor = COL_W2; |
1243 fgSKColor = COL_W; | 1232 fgSKColor = COL_W; |
1244 bgSKColor = COL_B; | 1233 bgSKColor = COL_B; |
1245 fgTColor = COL_RG; | 1234 fgTColor = COL_RG; |
1246 bgTColor = COL_B; | 1235 bgTColor = COL_B; |
1247 fgHLColor = dspl_GetBgdColour(); | 1236 fgHLColor = dspl_GetBgdColour(); |
1248 bgHLColor = dspl_GetFgdColour(); | 1237 bgHLColor = dspl_GetFgdColour(); |
1249 break; | 1238 break; |
1250 | 1239 |
1251 //Colours for specific displays | 1240 //Colours for specific displays |
1252 case COLOUR_GAME: | 1241 case COLOUR_GAME: |
1253 fgColor = COL_BLK ; | 1242 fgColor = COL_BLK ; |
1254 bgColor = COL_W; | 1243 bgColor = COL_W; |
1255 fgSKColor = COL_BLK ; | 1244 fgSKColor = COL_BLK ; |
1256 bgSKColor = COL_Orange; | 1245 bgSKColor = COL_Orange; |
1257 fgHLColor = COL_B; | 1246 fgHLColor = COL_B; |
1258 bgHLColor = COL_W; | 1247 bgHLColor = COL_W; |
1259 fgTColor = COL_RB; | 1248 fgTColor = COL_RB; |
1260 bgTColor = COL_G; | 1249 bgTColor = COL_G; |
1261 break; | 1250 break; |
1262 | 1251 |
1263 case COLOUR_IDLE: | 1252 case COLOUR_IDLE: |
1264 fgColor = COL_BLK;//Green ; | 1253 fgColor = COL_BLK;//Green ; |
1265 bgColor = COL_TRANSPARENT;//White ; | 1254 bgColor = COL_TRANSPARENT;//White ; |
1266 fgSKColor = COL_Blue; | 1255 fgSKColor = COL_Blue; |
1267 bgSKColor = COL_TRANSPARENT; | 1256 bgSKColor = COL_TRANSPARENT; |
1268 //Colours are for the icons | 1257 //Colours are for the icons |
1269 fgTColor = COL_RB; | 1258 fgTColor = COL_RB; |
1270 bgTColor = COL_G; | 1259 bgTColor = COL_G; |
1271 break; | 1260 break; |
1272 | 1261 |
1273 case COLOUR_INCALL: | 1262 case COLOUR_INCALL: |
1274 fgColor = COL_RG ; | 1263 fgColor = COL_RG ; |
1275 bgColor = COL_BLK; | 1264 bgColor = COL_BLK; |
1276 fgSKColor = COL_B ; /* SPR#1699 - SH - Modified so softkeys visible */ | 1265 fgSKColor = COL_B ; /* SPR#1699 - SH - Modified so softkeys visible */ |
1277 bgSKColor = COL_TRANSPARENT; | 1266 bgSKColor = COL_TRANSPARENT; |
1278 fgHLColor = COL_B; | 1267 fgHLColor = COL_B; |
1279 bgHLColor = COL_W; | 1268 bgHLColor = COL_W; |
1280 fgTColor = COL_RB; | 1269 fgTColor = COL_RB; |
1281 bgTColor = COL_G; | 1270 bgTColor = COL_G; |
1282 break; | 1271 break; |
1283 | 1272 |
1284 | 1273 default: |
1285 default: | 1274 fgColor = 0x002020FF; |
1286 fgColor = 0x002020FF; | 1275 bgColor = COL_GR;//0x00FFFFFF; |
1287 bgColor = COL_GR;//0x00FFFFFF; | 1276 fgSKColor = 0x0000FF01; |
1288 fgSKColor = 0x0000FF01; | 1277 bgSKColor = COL_GR;//0x00FF0000; |
1289 bgSKColor = COL_GR;//0x00FF0000; | 1278 break; |
1290 break; | 1279 } |
1291 } | 1280 |
1292 | 1281 /*If we have no preference for the other colours - set to default*/ |
1293 /*If we have no preference for the other colours - set to default*/ | 1282 if (fgHLColor == NO_COLOUR_DEFINED) |
1294 if (fgHLColor == NO_COLOUR_DEFINED) | 1283 fgHLColor = bgColor; |
1295 fgHLColor = bgColor; | 1284 if (bgHLColor == NO_COLOUR_DEFINED) |
1296 if (bgHLColor == NO_COLOUR_DEFINED) | 1285 bgHLColor = fgColor; |
1297 bgHLColor = fgColor; | 1286 |
1298 | 1287 if (fgSKColor == NO_COLOUR_DEFINED) |
1299 if (fgSKColor == NO_COLOUR_DEFINED) | 1288 fgSKColor = fgColor; |
1300 fgSKColor = fgColor; | 1289 if (bgSKColor == NO_COLOUR_DEFINED) |
1301 if (bgSKColor == NO_COLOUR_DEFINED) | 1290 bgSKColor = bgColor; |
1302 bgSKColor = bgColor; | 1291 if (fgTColor == NO_COLOUR_DEFINED) |
1303 if (fgTColor == NO_COLOUR_DEFINED) | 1292 fgTColor = fgColor; |
1304 fgTColor = fgColor; | 1293 if (bgTColor == NO_COLOUR_DEFINED) |
1305 if (bgTColor == NO_COLOUR_DEFINED) | 1294 bgTColor = bgColor; |
1306 bgTColor = bgColor; | 1295 |
1307 | 1296 switch (colType) |
1308 switch (colType) | 1297 { |
1309 { | 1298 case COL_TYPE_SCREEN: |
1310 case COL_TYPE_SCREEN: | 1299 default: |
1311 default: | 1300 *fgd = fgColor; |
1312 *fgd = fgColor; | 1301 *bgd = bgColor; |
1313 *bgd = bgColor; | 1302 break; |
1314 break; | 1303 case COL_TYPE_SK: |
1315 case COL_TYPE_SK: | 1304 *fgd = fgSKColor; |
1316 *fgd = fgSKColor; | 1305 *bgd = bgSKColor; |
1317 *bgd = bgSKColor; | 1306 break; |
1318 break; | 1307 case COL_TYPE_HL: |
1319 case COL_TYPE_HL: | 1308 *fgd = fgHLColor; |
1320 *fgd = fgHLColor; | 1309 *bgd = bgHLColor; |
1321 *bgd = bgHLColor; | 1310 break; |
1322 break; | 1311 case COL_TYPE_TITLE: |
1323 case COL_TYPE_TITLE: | 1312 *fgd = fgTColor; |
1324 *fgd = fgTColor; | 1313 *bgd = bgTColor; |
1325 *bgd = bgTColor; | 1314 break; |
1326 break; | 1315 |
1327 | 1316 } |
1328 } | 1317 if (*fgd == *bgd) |
1329 if (*fgd == *bgd) | 1318 { |
1330 { | 1319 if (*fgd != COL_B) |
1331 if (*fgd != COL_B) | 1320 *fgd = COL_B; |
1332 *fgd = COL_B; | 1321 } |
1333 } | |
1334 } | 1322 } |
1335 #endif | 1323 #endif |
1336 /***************************Go-lite Optimization changes end***********************/ | 1324 /***************************Go-lite Optimization changes end***********************/ |
1337 //This array will be used to store all the colour info for each colour type. | 1325 //This array will be used to store all the colour info for each colour type. |
1338 //This will allow us to let the user change the colour selected | 1326 //This will allow us to let the user change the colour selected |
1356 //COLOURDISPLAY compiler switch | 1344 //COLOURDISPLAY compiler switch |
1357 #ifdef COLOURDISPLAY | 1345 #ifdef COLOURDISPLAY |
1358 void setDataColour(int screenType, int colType, U32 fgdORbgd, U32 newColour) | 1346 void setDataColour(int screenType, int colType, U32 fgdORbgd, U32 newColour) |
1359 { | 1347 { |
1360 | 1348 |
1361 TRACE_EVENT("setDataColour"); | 1349 TRACE_EVENT("setDataColour"); |
1362 | 1350 |
1363 if ((newColour == NO_COLOUR_DEFINED) || (fgdORbgd ==NO_COL)) | 1351 if ((newColour == NO_COLOUR_DEFINED) || (fgdORbgd ==NO_COL)) |
1364 return; | 1352 return; |
1365 if ((screenType < LAST_COLOUR_DEF) && | 1353 if ((screenType < LAST_COLOUR_DEF) && |
1366 (screenType >=0) && | 1354 (screenType >=0) && |
1367 (colType < LAST_COLOUR_DEF) && | 1355 (colType < LAST_COLOUR_DEF) && |
1368 (colType >=0)) | 1356 (colType >=0)) |
1369 { | 1357 { |
1370 if (fgdORbgd == FGD_COL) | 1358 if (fgdORbgd == FGD_COL) |
1371 { | 1359 { |
1372 //Do not allow transparent foreground colours | 1360 //Do not allow transparent foreground colours |
1373 if ((newColour & 0xFF000000) != 0xFF000000) | 1361 if ((newColour & 0xFF000000) != 0xFF000000) |
1374 colArray[screenType][colType].fgd = newColour; | 1362 colArray[screenType][colType].fgd = newColour; |
1375 } | 1363 } |
1376 else | 1364 else |
1377 { | 1365 { |
1378 colArray[screenType][colType].bgd = newColour; | 1366 colArray[screenType][colType].bgd = newColour; |
1379 } | 1367 } |
1380 } | 1368 } |
1381 } | 1369 } |
1382 #endif | 1370 #endif |
1383 /***************************Go-lite Optimization changes Start***********************/ | 1371 /***************************Go-lite Optimization changes Start***********************/ |
1384 | 1372 |
1385 | 1373 |
1396 $History | 1384 $History |
1397 | 1385 |
1398 *******************************************************************************/ | 1386 *******************************************************************************/ |
1399 void initDefaultDataColour (void) | 1387 void initDefaultDataColour (void) |
1400 { | 1388 { |
1401 | 1389 int i,j; |
1402 int i,j; | 1390 |
1403 | 1391 for (i=0; i<LAST_COLOUR_DEF;i++) |
1404 for (i=0; i<LAST_COLOUR_DEF;i++) | 1392 { |
1405 { | 1393 for (j=0; j<COL_TYPE_MAX;j++) |
1406 for (j=0; j<COL_TYPE_MAX;j++) | 1394 { |
1407 { | 1395 /***************************Go-lite Optimization changes Start***********************/ |
1408 /***************************Go-lite Optimization changes Start***********************/ | 1396 //Aug 25, 2004 REF: CRR 24297 Deepa M.D |
1409 //Aug 25, 2004 REF: CRR 24297 Deepa M.D | 1397 //For Go-lite build, do the initialization of the colArray with black and white. |
1410 //For Go-lite build, do the initialization of the colArray with black and white. | 1398 //March 01, 2005 REF: ENH 29313 Deepa M.D |
1411 //March 01, 2005 REF: ENH 29313 Deepa M.D | 1399 // Isolating colour build related changes from MMI LITE flag. |
1412 // Isolating colour build related changes from MMI LITE flag. | 1400 // The proper Feature flag COLORDISPLAY was used for all color |
1413 // The proper Feature flag COLORDISPLAY was used for all color | 1401 //related changes. |
1414 //related changes. | |
1415 #ifdef COLOURDISPLAY | 1402 #ifdef COLOURDISPLAY |
1416 init_getDataColour(i, j, &colArray[i][j].fgd, &colArray[i][j].bgd); | 1403 init_getDataColour(i, j, &colArray[i][j].fgd, &colArray[i][j].bgd); |
1417 #else | 1404 #else |
1418 colArray[i][j].fgd = COL_Lite_Black; | 1405 colArray[i][j].fgd = COL_Lite_Black; |
1419 colArray[i][j].bgd = COL_Lite_White; | 1406 colArray[i][j].bgd = COL_Lite_White; |
1420 #endif | 1407 #endif |
1421 /***************************Go-lite Optimization changes end***********************/ | 1408 /***************************Go-lite Optimization changes end***********************/ |
1422 } | 1409 } |
1423 } | 1410 } |
1424 } | 1411 } |
1425 | 1412 |
1426 void getDataColour(int screenType, int colType, U32 *fgd, U32 *bgd) | 1413 void getDataColour(int screenType, int colType, U32 *fgd, U32 *bgd) |
1427 { | 1414 { |
1428 | 1415 TRACE_EVENT("getDataColour"); |
1429 | 1416 |
1430 TRACE_EVENT("getDataColour"); | 1417 if ((screenType == COLOUR_LIST_COLOUR) && (colType ==COL_TYPE_HL)) |
1431 | 1418 { |
1432 if ((screenType == COLOUR_LIST_COLOUR) && (colType ==COL_TYPE_HL)) | 1419 /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ |
1433 { | 1420 MMI_TRACE_EVENT("new_getDataColour IF"); |
1434 /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ | 1421 |
1435 MMI_TRACE_EVENT("new_getDataColour IF"); | 1422 *fgd = dspl_GetBgdColour(); |
1436 | 1423 *bgd = dspl_GetFgdColour(); |
1437 *fgd = dspl_GetBgdColour(); | 1424 } |
1438 *bgd = dspl_GetFgdColour(); | 1425 else if ((screenType < LAST_COLOUR_DEF) && |
1439 } | 1426 (screenType >=0) && |
1440 else if ((screenType < LAST_COLOUR_DEF) && | 1427 (colType < COL_TYPE_MAX) && |
1441 (screenType >=0) && | 1428 (colType >=0)) |
1442 (colType < COL_TYPE_MAX) && | 1429 { |
1443 (colType >=0)) | 1430 /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ |
1444 { | 1431 MMI_TRACE_EVENT("new_getDataColour ELSE IF"); |
1445 /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ | 1432 *fgd = colArray[screenType][colType].fgd; |
1446 MMI_TRACE_EVENT("new_getDataColour ELSE IF"); | 1433 *bgd = colArray[screenType][colType].bgd; |
1447 *fgd = colArray[screenType][colType].fgd; | 1434 /***************************Go-lite Optimization changes Start***********************/ |
1448 *bgd = colArray[screenType][colType].bgd; | 1435 //Aug 25, 2004 REF: CRR 24297 Deepa M.D |
1449 /***************************Go-lite Optimization changes Start***********************/ | 1436 //Set the fgd and bgd color for Go-lite version based |
1450 //Aug 25, 2004 REF: CRR 24297 Deepa M.D | 1437 //on the value stored in the colArray |
1451 //Set the fgd and bgd color for Go-lite version based | 1438 //March 01, 2005 REF: ENH 29313 Deepa M.D |
1452 //on the value stored in the colArray | 1439 // Isolating colour build related changes from MMI LITE flag. |
1453 //March 01, 2005 REF: ENH 29313 Deepa M.D | 1440 // The proper Feature flag COLORDISPLAY was used for all color |
1454 // Isolating colour build related changes from MMI LITE flag. | 1441 //related changes. |
1455 // The proper Feature flag COLORDISPLAY was used for all color | |
1456 //related changes. | |
1457 #ifndef COLOURDISPLAY | 1442 #ifndef COLOURDISPLAY |
1458 if(*fgd==COL_Lite_Black) | 1443 if(*fgd==COL_Lite_Black) |
1459 *fgd=COL_Black; | 1444 *fgd=COL_Black; |
1460 else | 1445 else |
1461 *fgd=COL_White; | 1446 *fgd=COL_White; |
1462 if(*bgd==COL_Lite_Black) | 1447 if(*bgd==COL_Lite_Black) |
1463 *bgd=COL_Black; | 1448 *bgd=COL_Black; |
1464 else | 1449 else |
1465 *bgd=COL_White; | 1450 *bgd=COL_White; |
1466 #endif | 1451 #endif |
1467 /***************************Go-lite Optimization changes end***********************/ | 1452 /***************************Go-lite Optimization changes end***********************/ |
1468 } | 1453 } |
1469 else | 1454 else |
1470 { | 1455 { |
1471 /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ | 1456 /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ |
1472 MMI_TRACE_EVENT("new_getDataColour ELSE"); | 1457 MMI_TRACE_EVENT("new_getDataColour ELSE"); |
1473 *fgd = colArray[0][0].fgd; | 1458 *fgd = colArray[0][0].fgd; |
1474 *bgd = colArray[0][0].bgd; | 1459 *bgd = colArray[0][0].bgd; |
1475 /***************************Go-lite Optimization changes Start***********************/ | 1460 /***************************Go-lite Optimization changes Start***********************/ |
1476 //Aug 25, 2004 REF: CRR 24297 Deepa M.D | 1461 //Aug 25, 2004 REF: CRR 24297 Deepa M.D |
1477 //Set the fgd and bgd color for Go-lite version based | 1462 //Set the fgd and bgd color for Go-lite version based |
1478 //on the value stored in the colArray | 1463 //on the value stored in the colArray |
1479 //March 01, 2005 REF: ENH 29313 Deepa M.D | 1464 //March 01, 2005 REF: ENH 29313 Deepa M.D |
1480 // Isolating colour build related changes from MMI LITE flag. | 1465 // Isolating colour build related changes from MMI LITE flag. |
1481 // The proper Feature flag COLORDISPLAY was used for all color | 1466 // The proper Feature flag COLORDISPLAY was used for all color |
1482 //related changes. | 1467 //related changes. |
1483 #ifndef COLOURDISPLAY | 1468 #ifndef COLOURDISPLAY |
1484 if(*fgd==COL_Lite_Black) | 1469 if(*fgd==COL_Lite_Black) |
1485 *fgd=COL_Black; | 1470 *fgd=COL_Black; |
1486 else | 1471 else |
1487 *fgd=COL_White; | 1472 *fgd=COL_White; |
1488 if(*bgd==COL_Lite_Black) | 1473 if(*bgd==COL_Lite_Black) |
1489 *bgd=COL_Black; | 1474 *bgd=COL_Black; |
1490 else | 1475 else |
1491 *bgd=COL_White; | 1476 *bgd=COL_White; |
1492 #endif | 1477 #endif |
1493 /***************************Go-lite Optimization changes end***********************/ | 1478 /***************************Go-lite Optimization changes end***********************/ |
1494 TRACE_EVENT_P1("fdg color is %d",*fgd); | 1479 TRACE_EVENT_P1("fdg color is %d",*fgd); |
1495 TRACE_EVENT_P1("bdg color is %d",*bgd); | 1480 TRACE_EVENT_P1("bdg color is %d",*bgd); |
1496 | 1481 |
1497 } | 1482 } |
1498 } | 1483 } |
1499 | 1484 |
1500 /******************************************************************************* | 1485 /******************************************************************************* |
1501 | 1486 |
1502 $Function: | 1487 $Function: |
1512 *******************************************************************************/ | 1497 *******************************************************************************/ |
1513 static U32 oldFgdCol,oldBgdCol; | 1498 static U32 oldFgdCol,oldBgdCol; |
1514 static U32 oldmnuFgdCol,oldmnuBgdCol; | 1499 static U32 oldmnuFgdCol,oldmnuBgdCol; |
1515 void resources_setColour(unsigned int colIndex) | 1500 void resources_setColour(unsigned int colIndex) |
1516 { | 1501 { |
1517 U32 fgdColour,bgdColour; | 1502 U32 fgdColour,bgdColour; |
1518 getDataColour(colIndex, COL_TYPE_SCREEN, &fgdColour, &bgdColour); | 1503 getDataColour(colIndex, COL_TYPE_SCREEN, &fgdColour, &bgdColour); |
1519 oldFgdCol = dspl_SetFgdColour( fgdColour); | 1504 oldFgdCol = dspl_SetFgdColour( fgdColour); |
1520 oldBgdCol = dspl_SetBgdColour( bgdColour); | 1505 oldBgdCol = dspl_SetBgdColour( bgdColour); |
1521 if (colIndex==0xFFFF) | 1506 if (colIndex==0xFFFF) |
1522 {//disabled for the moment | 1507 {//disabled for the moment |
1523 char str[50]; | 1508 char str[50]; |
1524 sprintf(str,"Id=%d (%x,%x)",colIndex,fgdColour,bgdColour); | 1509 sprintf(str,"Id=%d (%x,%x)",colIndex,fgdColour,bgdColour); |
1525 dspl_ScrText (0, 180, str, 0); | 1510 dspl_ScrText (0, 180, str, 0); |
1526 } | 1511 } |
1527 } | 1512 } |
1528 /******************************************************************************* | 1513 /******************************************************************************* |
1529 | 1514 |
1530 $Function: | 1515 $Function: |
1531 | 1516 |
1538 $History | 1523 $History |
1539 | 1524 |
1540 *******************************************************************************/ | 1525 *******************************************************************************/ |
1541 void resources_setSKColour(unsigned int colIndex) | 1526 void resources_setSKColour(unsigned int colIndex) |
1542 { | 1527 { |
1543 U32 fgdSKColour,bgdSKColour; | 1528 U32 fgdSKColour,bgdSKColour; |
1544 getDataColour(colIndex, COL_TYPE_SK, &fgdSKColour, &bgdSKColour ); | 1529 getDataColour(colIndex, COL_TYPE_SK, &fgdSKColour, &bgdSKColour ); |
1545 oldmnuFgdCol = dspl_SetFgdColour( fgdSKColour); | 1530 oldmnuFgdCol = dspl_SetFgdColour( fgdSKColour); |
1546 oldmnuBgdCol = dspl_SetBgdColour( bgdSKColour); | 1531 oldmnuBgdCol = dspl_SetBgdColour( bgdSKColour); |
1547 } | 1532 } |
1548 /******************************************************************************* | 1533 /******************************************************************************* |
1549 | 1534 |
1550 $Function: | 1535 $Function: |
1551 | 1536 |
1558 $History | 1543 $History |
1559 | 1544 |
1560 *******************************************************************************/ | 1545 *******************************************************************************/ |
1561 void resources_setHLColour(unsigned int colIndex) | 1546 void resources_setHLColour(unsigned int colIndex) |
1562 { | 1547 { |
1563 U32 fgdColour,bgdColour; | 1548 U32 fgdColour,bgdColour; |
1564 #ifdef COLOURDISPLAY | 1549 #ifdef COLOURDISPLAY |
1565 getDataColour(colIndex, COL_TYPE_HL, &fgdColour, &bgdColour ); | 1550 getDataColour(colIndex, COL_TYPE_HL, &fgdColour, &bgdColour ); |
1566 #else | 1551 #else |
1567 //For b+w highlight, get fgd colour as bgd and vice versa | 1552 //For b+w highlight, get fgd colour as bgd and vice versa |
1568 fgdColour = dspl_GetBgdColour(); | 1553 fgdColour = dspl_GetBgdColour(); |
1569 bgdColour = dspl_GetFgdColour(); | 1554 bgdColour = dspl_GetFgdColour(); |
1570 //If one colour is black/white, make other colour the opposite | 1555 //If one colour is black/white, make other colour the opposite |
1571 if (fgdColour == COL_Black) | 1556 if (fgdColour == COL_Black) |
1572 bgdColour = COL_White; | 1557 bgdColour = COL_White; |
1573 else if (bgdColour == COL_Black) | 1558 else if (bgdColour == COL_Black) |
1574 fgdColour = COL_White; | 1559 fgdColour = COL_White; |
1575 else if (fgdColour == COL_White) | 1560 else if (fgdColour == COL_White) |
1576 bgdColour = COL_Black; | 1561 bgdColour = COL_Black; |
1577 else if (bgdColour == COL_White) | 1562 else if (bgdColour == COL_White) |
1578 fgdColour = COL_Black; | 1563 fgdColour = COL_Black; |
1579 else | 1564 else |
1580 { //Default : assume the rest of the display is black on white=> highlight is white on black. | 1565 { //Default : assume the rest of the display is black on white=> highlight is white on black. |
1581 fgdColour = COL_White; | 1566 fgdColour = COL_White; |
1582 bgdColour = COL_Black; | 1567 bgdColour = COL_Black; |
1583 } | 1568 } |
1584 | 1569 |
1585 #endif | 1570 #endif |
1586 oldmnuFgdCol = dspl_SetFgdColour( fgdColour); | 1571 oldmnuFgdCol = dspl_SetFgdColour( fgdColour); |
1587 oldmnuBgdCol = dspl_SetBgdColour( bgdColour); | 1572 oldmnuBgdCol = dspl_SetBgdColour( bgdColour); |
1588 } | 1573 } |
1589 /******************************************************************************* | 1574 /******************************************************************************* |
1590 | 1575 |
1591 $Function: | 1576 $Function: |
1592 | 1577 |
1599 $History | 1584 $History |
1600 | 1585 |
1601 *******************************************************************************/ | 1586 *******************************************************************************/ |
1602 void resources_setTitleColour(unsigned int colIndex) | 1587 void resources_setTitleColour(unsigned int colIndex) |
1603 { | 1588 { |
1604 U32 fgdColour,bgdColour; | 1589 U32 fgdColour,bgdColour; |
1605 getDataColour(colIndex, COL_TYPE_TITLE, &fgdColour, &bgdColour ); | 1590 getDataColour(colIndex, COL_TYPE_TITLE, &fgdColour, &bgdColour ); |
1606 oldmnuFgdCol = dspl_SetFgdColour( fgdColour); | 1591 oldmnuFgdCol = dspl_SetFgdColour( fgdColour); |
1607 oldmnuBgdCol = dspl_SetBgdColour( bgdColour); | 1592 oldmnuBgdCol = dspl_SetBgdColour( bgdColour); |
1608 } | 1593 } |
1609 /******************************************************************************* | 1594 /******************************************************************************* |
1610 | 1595 |
1611 $Function: | 1596 $Function: |
1612 | 1597 |
1619 $History | 1604 $History |
1620 | 1605 |
1621 *******************************************************************************/ | 1606 *******************************************************************************/ |
1622 void resources_restoreColour(void) | 1607 void resources_restoreColour(void) |
1623 { | 1608 { |
1624 dspl_SetFgdColour( oldFgdCol); | 1609 dspl_SetFgdColour( oldFgdCol); |
1625 dspl_SetBgdColour( oldBgdCol); | 1610 dspl_SetBgdColour( oldBgdCol); |
1626 } | 1611 } |
1627 /******************************************************************************* | 1612 /******************************************************************************* |
1628 | 1613 |
1629 $Function: | 1614 $Function: |
1630 | 1615 |
1638 GW 28/11/02 - | 1623 GW 28/11/02 - |
1639 | 1624 |
1640 *******************************************************************************/ | 1625 *******************************************************************************/ |
1641 void resources_restoreMnuColour(void) | 1626 void resources_restoreMnuColour(void) |
1642 { | 1627 { |
1643 dspl_SetFgdColour( oldmnuFgdCol); | 1628 dspl_SetFgdColour( oldmnuFgdCol); |
1644 dspl_SetBgdColour( oldmnuBgdCol); | 1629 dspl_SetBgdColour( oldmnuBgdCol); |
1645 } | 1630 } |
1646 | 1631 |
1647 | 1632 |
1648 /******************************************************************************* | 1633 /******************************************************************************* |
1649 | 1634 |
1659 GW 28/11/02 - | 1644 GW 28/11/02 - |
1660 | 1645 |
1661 *******************************************************************************/ | 1646 *******************************************************************************/ |
1662 void getDisplayData(int txtId,int *colDisplayType, int *colType, int *colFgdSelect) | 1647 void getDisplayData(int txtId,int *colDisplayType, int *colType, int *colFgdSelect) |
1663 { | 1648 { |
1664 *colFgdSelect = NO_COL; | 1649 *colFgdSelect = NO_COL; |
1665 | 1650 |
1666 /**/ | 1651 /**/ |
1667 switch (txtId) | 1652 switch (txtId) |
1668 { | 1653 { |
1669 | 1654 |
1670 default: | 1655 default: |
1671 *colFgdSelect = NO_COL; | 1656 *colFgdSelect = NO_COL; |
1672 break; | 1657 break; |
1673 | 1658 |
1674 case TxtIdleScreenBackground: | 1659 case TxtIdleScreenBackground: |
1675 *colDisplayType = COLOUR_IDLE; | 1660 *colDisplayType = COLOUR_IDLE; |
1676 *colType = COL_TYPE_SCREEN; | 1661 *colType = COL_TYPE_SCREEN; |
1677 *colFgdSelect = BGD_COL; | 1662 *colFgdSelect = BGD_COL; |
1678 break; | 1663 break; |
1679 case TxtIdleScreenSoftKey: | 1664 case TxtIdleScreenSoftKey: |
1680 *colDisplayType = COLOUR_IDLE; | 1665 *colDisplayType = COLOUR_IDLE; |
1681 *colType = COL_TYPE_SK; | 1666 *colType = COL_TYPE_SK; |
1682 *colFgdSelect = FGD_COL; | 1667 *colFgdSelect = FGD_COL; |
1683 break; | 1668 break; |
1684 case TxtIdleScreenText: | 1669 case TxtIdleScreenText: |
1685 *colDisplayType = COLOUR_IDLE; | 1670 *colDisplayType = COLOUR_IDLE; |
1686 *colType = COL_TYPE_SCREEN; | 1671 *colType = COL_TYPE_SCREEN; |
1687 *colFgdSelect = FGD_COL; | 1672 *colFgdSelect = FGD_COL; |
1688 break; | 1673 break; |
1689 case TxtIdleScreenNetworkName: | 1674 case TxtIdleScreenNetworkName: |
1690 *colDisplayType = COLOUR_IDLE; | 1675 *colDisplayType = COLOUR_IDLE; |
1691 *colType = COL_TYPE_SCREEN; | 1676 *colType = COL_TYPE_SCREEN; |
1692 *colFgdSelect = FGD_COL; | 1677 *colFgdSelect = FGD_COL; |
1693 break; | 1678 break; |
1694 case TxtGeneralBackground: | 1679 case TxtGeneralBackground: |
1695 *colDisplayType = COLOUR_LIST_MAIN; | 1680 *colDisplayType = COLOUR_LIST_MAIN; |
1696 *colType = COL_TYPE_SCREEN; | 1681 *colType = COL_TYPE_SCREEN; |
1697 *colFgdSelect = BGD_COL; | 1682 *colFgdSelect = BGD_COL; |
1698 break; | 1683 break; |
1699 case TxtMenuSoftKeyForeground: | 1684 case TxtMenuSoftKeyForeground: |
1700 *colDisplayType = COLOUR_LIST_MAIN; | 1685 *colDisplayType = COLOUR_LIST_MAIN; |
1701 *colType = COL_TYPE_SK; | 1686 *colType = COL_TYPE_SK; |
1702 *colFgdSelect = FGD_COL; | 1687 *colFgdSelect = FGD_COL; |
1703 break; | 1688 break; |
1704 case TxtMenuSoftKeyBackground: | 1689 case TxtMenuSoftKeyBackground: |
1705 *colDisplayType = COLOUR_LIST_MAIN; | 1690 *colDisplayType = COLOUR_LIST_MAIN; |
1706 *colType = COL_TYPE_SK; | 1691 *colType = COL_TYPE_SK; |
1707 *colFgdSelect = BGD_COL; | 1692 *colFgdSelect = BGD_COL; |
1708 break; | 1693 break; |
1709 case TxtSubMenuHeadingText: | 1694 case TxtSubMenuHeadingText: |
1710 *colDisplayType = COLOUR_LIST_SUBMENU; | 1695 *colDisplayType = COLOUR_LIST_SUBMENU; |
1711 *colType = COL_TYPE_TITLE; | 1696 *colType = COL_TYPE_TITLE; |
1712 *colFgdSelect = FGD_COL; | 1697 *colFgdSelect = FGD_COL; |
1713 break; | 1698 break; |
1714 | 1699 |
1715 case TxtSubMenuHeadingBackground: | 1700 case TxtSubMenuHeadingBackground: |
1716 *colDisplayType = COLOUR_LIST_SUBMENU; | 1701 *colDisplayType = COLOUR_LIST_SUBMENU; |
1717 *colType = COL_TYPE_TITLE; | 1702 *colType = COL_TYPE_TITLE; |
1718 *colFgdSelect = BGD_COL; | 1703 *colFgdSelect = BGD_COL; |
1719 break; | 1704 break; |
1720 case TxtSubMenuTextForeground: | 1705 case TxtSubMenuTextForeground: |
1721 *colDisplayType = COLOUR_LIST_SUBMENU; | 1706 *colDisplayType = COLOUR_LIST_SUBMENU; |
1722 *colType = COL_TYPE_SCREEN; | 1707 *colType = COL_TYPE_SCREEN; |
1723 *colFgdSelect = FGD_COL; | 1708 *colFgdSelect = FGD_COL; |
1724 break; | 1709 break; |
1725 | 1710 |
1726 case TxtSubMenuTextBackground: | 1711 case TxtSubMenuTextBackground: |
1727 *colDisplayType = COLOUR_LIST_SUBMENU; | 1712 *colDisplayType = COLOUR_LIST_SUBMENU; |
1728 *colType = COL_TYPE_SCREEN; | 1713 *colType = COL_TYPE_SCREEN; |
1729 *colFgdSelect = BGD_COL; | 1714 *colFgdSelect = BGD_COL; |
1730 break; | 1715 break; |
1731 case TxtSubMenuSelectionBar: | 1716 case TxtSubMenuSelectionBar: |
1732 *colDisplayType = COLOUR_LIST_SUBMENU; | 1717 *colDisplayType = COLOUR_LIST_SUBMENU; |
1733 *colType = COL_TYPE_HL; | 1718 *colType = COL_TYPE_HL; |
1734 *colFgdSelect = BGD_COL; | 1719 *colFgdSelect = BGD_COL; |
1735 break; | 1720 break; |
1736 case TxtPopUpTextForeground: /* GW#2294 COLOUR_STATUS has been used for all popups - change this colour instead of COLOUR_POPUP .*/ | 1721 case TxtPopUpTextForeground: /* GW#2294 COLOUR_STATUS has been used for all popups - change this colour instead of COLOUR_POPUP .*/ |
1737 *colDisplayType = COLOUR_STATUS; | 1722 *colDisplayType = COLOUR_STATUS; |
1738 *colType = COL_TYPE_SCREEN; | 1723 *colType = COL_TYPE_SCREEN; |
1739 *colFgdSelect = FGD_COL; | 1724 *colFgdSelect = FGD_COL; |
1740 break; | 1725 break; |
1741 case TxtPopUpTextBackground: /* GW#2294 COLOUR_STATUS has been used for all popups - change this colour instead of COLOUR_POPUP .*/ | 1726 case TxtPopUpTextBackground: /* GW#2294 COLOUR_STATUS has been used for all popups - change this colour instead of COLOUR_POPUP .*/ |
1742 *colDisplayType = COLOUR_STATUS; | 1727 *colDisplayType = COLOUR_STATUS; |
1743 *colType = COL_TYPE_SCREEN; | 1728 *colType = COL_TYPE_SCREEN; |
1744 *colFgdSelect = BGD_COL; | 1729 *colFgdSelect = BGD_COL; |
1745 break; | 1730 break; |
1746 } | 1731 } |
1747 /**/ | 1732 /**/ |
1748 } | 1733 } |
1749 /******************************************************************************* | 1734 /******************************************************************************* |
1750 | 1735 |
1751 $Function: | 1736 $Function: |
1760 | 1745 |
1761 *******************************************************************************/ | 1746 *******************************************************************************/ |
1762 //This is called to set the colour of menu items controlled by the text id's | 1747 //This is called to set the colour of menu items controlled by the text id's |
1763 int resources_getColourFromText(int txtId) | 1748 int resources_getColourFromText(int txtId) |
1764 { | 1749 { |
1765 U32 col; | 1750 U32 col; |
1766 switch (txtId) | 1751 switch (txtId) |
1767 { | 1752 { |
1768 case TxtColourBlack: col = COL_Black; break; | 1753 case TxtColourBlack: col = COL_Black; break; |
1769 case TxtColourBlue: col = COL_Blue; break; | 1754 case TxtColourBlue: col = COL_Blue; break; |
1770 case TxtColourCyan: col = COL_Cyan; break; | 1755 case TxtColourCyan: col = COL_Cyan; break; |
1771 case TxtColourGreen: col = COL_Green; break; | 1756 case TxtColourGreen: col = COL_Green; break; |
1772 case TxtColourMagenta: col = COL_Magenta; break; | 1757 case TxtColourMagenta: col = COL_Magenta; break; |
1773 case TxtColourYellow: col = COL_Yellow; break; | 1758 case TxtColourYellow: col = COL_Yellow; break; |
1774 case TxtColourRed: col = COL_Red; break; | 1759 case TxtColourRed: col = COL_Red; break; |
1775 case TxtColourWhite: col = COL_White; break; | 1760 case TxtColourWhite: col = COL_White; break; |
1776 case TxtColourPink: col = COL_Pink; break;// 0x00FF4040; break; | 1761 case TxtColourPink: col = COL_Pink; break;// 0x00FF4040; break; |
1777 case TxtColourOrange: col = COL_Orange; break; | 1762 case TxtColourOrange: col = COL_Orange; break; |
1778 case TxtColourLightBlue: col = COL_LightBlue; break;// 0x004040FF; break; | 1763 case TxtColourLightBlue: col = COL_LightBlue; break;// 0x004040FF; break; |
1779 case TxtColourLightGreen: col = COL_LightGreen; break;// 0x0040FF40; break; | 1764 case TxtColourLightGreen: col = COL_LightGreen; break;// 0x0040FF40; break; |
1780 case TxtColourPaleYellow: col = COL_PaleYellow; break;// 0x00FFFF40; break; | 1765 case TxtColourPaleYellow: col = COL_PaleYellow; break;// 0x00FFFF40; break; |
1781 case TxtColourTransparent: col = COL_Transparent; break; | 1766 case TxtColourTransparent: col = COL_Transparent; break; |
1782 default: col = NO_COLOUR_DEFINED; | 1767 default: col = NO_COLOUR_DEFINED; |
1783 } | 1768 } |
1784 return (col); | 1769 return (col); |
1785 } | 1770 } |
1786 | |
1787 | 1771 |
1788 | 1772 |
1789 /******************************************************************************* | 1773 /******************************************************************************* |
1790 | 1774 |
1791 $Function: | 1775 $Function: |
1806 int colType; | 1790 int colType; |
1807 int colFgdSelect = FALSE; | 1791 int colFgdSelect = FALSE; |
1808 int colDisplayType; | 1792 int colDisplayType; |
1809 U32 fgd,bgd; | 1793 U32 fgd,bgd; |
1810 | 1794 |
1811 col = resources_getColourFromText(txtId); | 1795 col = resources_getColourFromText(txtId); |
1812 if (col == NO_COLOUR_DEFINED) | 1796 if (col == NO_COLOUR_DEFINED) |
1813 { | 1797 { |
1814 getDisplayData(txtId, &colDisplayType, &colType,&colFgdSelect); | 1798 getDisplayData(txtId, &colDisplayType, &colType,&colFgdSelect); |
1815 getDataColour(colDisplayType, colType, &fgd, &bgd); | 1799 getDataColour(colDisplayType, colType, &fgd, &bgd); |
1816 switch (colFgdSelect) | 1800 switch (colFgdSelect) |
1817 { | 1801 { |
1818 case FGD_COL: col = fgd; break; | 1802 case FGD_COL: col = fgd; break; |
1819 case BGD_COL: col = bgd; break; | 1803 case BGD_COL: col = bgd; break; |
1820 default: break; | 1804 default: break; |
1821 } | 1805 } |
1822 } | 1806 } |
1823 if (col != NO_COLOUR_DEFINED) | 1807 if (col != NO_COLOUR_DEFINED) |
1824 { | 1808 { |
1825 if (col!=COL_Transparent) | 1809 if (col!=COL_Transparent) |
1826 { | 1810 { |
1827 dspl_SetFgdColour( col ); | 1811 dspl_SetFgdColour( col ); |
1828 dspl_SetBgdColour( (~col) & 0x00FFFFFF ); | 1812 dspl_SetBgdColour( (~col) & 0x00FFFFFF ); |
1829 } | 1813 } |
1830 else | 1814 else |
1831 { | 1815 { |
1832 dspl_SetFgdColour( COL_Black ); | 1816 dspl_SetFgdColour( COL_Black ); |
1833 dspl_SetBgdColour( COL_Magenta ); | 1817 dspl_SetBgdColour( COL_Magenta ); |
1834 | 1818 |
1835 } | 1819 } |
1836 } | 1820 } |
1837 } | 1821 } |
1838 | |
1839 | 1822 |
1840 | 1823 |
1841 /******************************************************************************* | 1824 /******************************************************************************* |
1842 | 1825 |
1843 $Function: | 1826 $Function: |
1851 $History | 1834 $History |
1852 | 1835 |
1853 *******************************************************************************/ | 1836 *******************************************************************************/ |
1854 int res_getTitleHeight( void ) | 1837 int res_getTitleHeight( void ) |
1855 { | 1838 { |
1856 if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) | 1839 if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) |
1857 { | 1840 { |
1858 return(TITLE_HEIGHT_LATIN); | 1841 return(TITLE_HEIGHT_LATIN); |
1859 } | 1842 } |
1860 else | 1843 else |
1861 { | 1844 { |
1862 return(TITLE_HEIGHT_CHINESE); | 1845 return(TITLE_HEIGHT_CHINESE); |
1863 } | 1846 } |
1864 } | 1847 } |
1865 /*Function added for SPr 1442*/ | 1848 /*Function added for SPr 1442*/ |
1866 /******************************************************************************* | 1849 /******************************************************************************* |
1867 $Function: string_len_in_bytes | 1850 $Function: string_len_in_bytes |
1868 | 1851 |
1869 $Description: internal function which returns th length of a string in bytes | 1852 $Description: internal function which returns th length of a string in bytes |
1870 | 1853 |
1871 $Returns: length of string | 1854 $Returns: length of string |
1872 | 1855 |
1873 $Arguments: string, maximum possibel length, whether unicode or not | 1856 $Arguments: string, maximum possibel length, whether unicode or not |
1874 | 1857 |
1875 *******************************************************************************/ | 1858 *******************************************************************************/ |
1876 int string_len_in_bytes(char* string, int max_len, int unicode) | 1859 int string_len_in_bytes(char* string, int max_len, int unicode) |
1877 { int i; | 1860 { int i; |
1878 int length=0; | 1861 int length=0; |
1879 /* if unicode, nee to check for double-NULL termination*/ | 1862 /* if unicode, nee to check for double-NULL termination*/ |
1880 if (string[0] == (char)0x80 || unicode== TRUE) /*a0393213 lint warnings removal - typecast done*/ | 1863 if (string[0] == (char)0x80 || unicode== TRUE) /*a0393213 lint warnings removal - typecast done*/ |
1881 { | 1864 { |
1882 for(i=0; i < max_len; i+=2) | 1865 for(i=0; i < max_len; i+=2) |
1883 { if (string[i] == 0 && string[i+1]==0) | 1866 { if (string[i] == 0 && string[i+1]==0) |
1884 { length = i; | 1867 { length = i; |
1885 break; | 1868 break; |
1886 } | 1869 } |
1887 } | 1870 } |
1888 return length; | 1871 return length; |
1889 | 1872 |
1890 } | 1873 } |
1891 | 1874 |
1892 else/*just use standard function*/ | 1875 else/*just use standard function*/ |
1893 { return strlen(string); | 1876 { return strlen(string); |
1894 } | 1877 } |
1895 | |
1896 } | 1878 } |
1897 | 1879 |
1898 #ifdef LSCREEN | 1880 #ifdef LSCREEN |
1899 #define TRUNC_LENGTH 3 /*... at end of string in D-sample*/ | 1881 #define TRUNC_LENGTH 3 /*... at end of string in D-sample*/ |
1900 #else | 1882 #else |
1901 #define TRUNC_LENGTH 1/* . at end of string in c-sample*/ | 1883 #define TRUNC_LENGTH 1/* . at end of string in c-sample*/ |
1902 #endif | 1884 #endif |
1903 | 1885 |
1904 /*Function added for SPr 1442*/ | 1886 /*Function added for SPr 1442*/ |
1905 /******************************************************************************* | 1887 /******************************************************************************* |
1906 $Function: resources_truncate_to_screen_width | 1888 $Function: resources_truncate_to_screen_width |
1907 | 1889 |
1908 $Description: Copies and truncates the input string to the passed screen width | 1890 $Description: Copies and truncates the input string to the passed screen width |
1909 and puts it into the output string. | 1891 and puts it into the output string. |
1910 Note: this function only works for Unicode strings which have a unicode | 1892 Note: this function only works for Unicode strings which have a unicode |
1911 tag at the beginning, or if the unicode parameter is set to TRUE. | 1893 tag at the beginning, or if the unicode parameter is set to TRUE. |
1912 If the input length is zero, then this function calculates | 1894 If the input length is zero, then this function calculates |
1913 the actual length of the input string. | 1895 the actual length of the input string. |
1914 | 1896 |
1915 $Returns: length of truncated string | 1897 $Returns: length of truncated string |
1916 | 1898 |
1917 $Arguments: input sctring and it's length, ouput string and it's length, | 1899 $Arguments: input sctring and it's length, ouput string and it's length, |
1918 screen width desired (pixels), unicode flag (TRUE/FALSE) | 1900 screen width desired (pixels), unicode flag (TRUE/FALSE) |
1919 | 1901 |
1920 *******************************************************************************/ | 1902 *******************************************************************************/ |
1921 //GW #1541 16/01/03 - Modified code to first test if string will fit and return string if it does. | 1903 //GW #1541 16/01/03 - Modified code to first test if string will fit and return string if it does. |
1922 int resources_truncate_to_screen_width(char* IpStr, int IpLen, char* OpStr, int OpLen, | 1904 int resources_truncate_to_screen_width(char* IpStr, int IpLen, char* OpStr, int OpLen, |
1923 int ScreenWidth, BOOL unicode) | 1905 int ScreenWidth, BOOL unicode) |
1924 | 1906 |
1925 { | 1907 { |
1926 int start_position = 0; | 1908 int start_position = 0; |
1927 #ifdef LSCREEN | 1909 #ifdef LSCREEN |
1928 char* ellipse_str = "..."; | 1910 char* ellipse_str = "..."; |
1929 #else | 1911 #else |
1930 char* ellipse_str = "."; | 1912 char* ellipse_str = "."; |
1931 #endif | 1913 #endif |
1932 int ellipsis_len = dspl_GetTextExtent(ellipse_str, 0); | 1914 int ellipsis_len = dspl_GetTextExtent(ellipse_str, 0); |
1933 int i; | 1915 int i; |
1934 int j; | 1916 int j; |
1935 int calc_input_len = 0; | 1917 int calc_input_len = 0; |
1936 int no_of_chars = 0; | 1918 int no_of_chars = 0; |
1937 int len; | 1919 int len; |
1938 | 1920 |
1939 memset(OpStr, 0, OpLen); | 1921 memset(OpStr, 0, OpLen); |
1940 | 1922 |
1941 /*if input string length 0, we calculate the string len ourselves*/ | 1923 /*if input string length 0, we calculate the string len ourselves*/ |
1942 if (IpLen == 0) | 1924 if (IpLen == 0) |
1943 { calc_input_len = string_len_in_bytes(IpStr, 256, unicode); | 1925 { calc_input_len = string_len_in_bytes(IpStr, 256, unicode); |
1944 } | 1926 } |
1945 else | 1927 else |
1946 { calc_input_len = IpLen; | 1928 { calc_input_len = IpLen; |
1947 } /*Test for string alrady fitting */ | 1929 } /*Test for string alrady fitting */ |
1948 | 1930 |
1949 if (dspl_GetTextExtent(IpStr, 0) < ScreenWidth) | 1931 if (dspl_GetTextExtent(IpStr, 0) < ScreenWidth) |
1950 { | 1932 { |
1951 for (i=0; i<OpLen && i<calc_input_len; ) | 1933 for (i=0; i<OpLen && i<calc_input_len; ) |
1952 { //if length of string less that width of screen | 1934 { //if length of string less that width of screen |
1953 //if unicode copy two chars | 1935 //if unicode copy two chars |
1954 if (IpStr[0] == (char)0x80 || unicode == TRUE)/*a0393213 lint warnings removal-typecasting done*/ | 1936 if (IpStr[0] == (char)0x80 || unicode == TRUE)/*a0393213 lint warnings removal-typecasting done*/ |
1955 { | 1937 { |
1956 OpStr[i] = IpStr[i]; | 1938 OpStr[i] = IpStr[i]; |
1957 OpStr[i+1] = IpStr[i+1]; | 1939 OpStr[i+1] = IpStr[i+1]; |
1958 i+=2; | 1940 i+=2; |
1959 } | 1941 } |
1960 else | 1942 else |
1961 { OpStr[i] = IpStr[i]; | 1943 { OpStr[i] = IpStr[i]; |
1962 i++; | 1944 i++; |
1963 } | 1945 } |
1964 } | 1946 } |
1965 return string_len_in_bytes(OpStr, OpLen, unicode); | 1947 return string_len_in_bytes(OpStr, OpLen, unicode); |
1966 } | 1948 } |
1967 /*SPR 1541, use function dspl_GetNcharToFit rather than loop to work | 1949 /*SPR 1541, use function dspl_GetNcharToFit rather than loop to work |
1968 out how many chars will fit in line*/ | 1950 out how many chars will fit in line*/ |
1969 no_of_chars = dspl_GetNcharToFit (IpStr, ScreenWidth - ellipsis_len); | 1951 no_of_chars = dspl_GetNcharToFit (IpStr, ScreenWidth - ellipsis_len); |
1970 /*copy characters*/ | 1952 /*copy characters*/ |
1971 if (no_of_chars < OpLen) | 1953 if (no_of_chars < OpLen) |
1972 memcpy(OpStr, IpStr, no_of_chars); | 1954 memcpy(OpStr, IpStr, no_of_chars); |
1973 else | 1955 else |
1974 memcpy(OpStr, IpStr, OpLen); | 1956 memcpy(OpStr, IpStr, OpLen); |
1975 | 1957 |
1976 /*SPR 1541, end*/ | 1958 /*SPR 1541, end*/ |
1977 TRACE_EVENT_P1("trunc string len:%d", dspl_GetTextExtent(OpStr, 0)); | 1959 TRACE_EVENT_P1("trunc string len:%d", dspl_GetTextExtent(OpStr, 0)); |
1978 /*we need to add the ellipsis if we've truncated the string*/ | 1960 /*we need to add the ellipsis if we've truncated the string*/ |
1979 if(string_len_in_bytes(OpStr, OpLen, unicode) < calc_input_len) | 1961 if(string_len_in_bytes(OpStr, OpLen, unicode) < calc_input_len) |
1980 { /*if unicode*/ | 1962 { /*if unicode*/ |
1981 if (OpStr[0] == (char)0x80|| unicode == TRUE) /*a0393213 lint warnings removal - typecasting done*/ | 1963 if (OpStr[0] == (char)0x80|| unicode == TRUE) /*a0393213 lint warnings removal - typecasting done*/ |
1982 { | 1964 { |
1983 if (string_len_in_bytes(OpStr, OpLen, TRUE) < (OpLen -2*TRUNC_LENGTH+2)) | 1965 if (string_len_in_bytes(OpStr, OpLen, TRUE) < (OpLen -2*TRUNC_LENGTH+2)) |
1984 { start_position = string_len_in_bytes(OpStr, OpLen, unicode); | 1966 { start_position = string_len_in_bytes(OpStr, OpLen, unicode); |
1985 } | 1967 } |
1986 else | 1968 else |
1987 { start_position = OpLen - 2*TRUNC_LENGTH+2;} | 1969 { start_position = OpLen - 2*TRUNC_LENGTH+2;} |
1988 TRACE_EVENT_P1("Adding chars at %d", start_position); | 1970 TRACE_EVENT_P1("Adding chars at %d", start_position); |
1989 for(j=start_position; j < start_position+2*TRUNC_LENGTH; j+=2) | 1971 for(j=start_position; j < start_position+2*TRUNC_LENGTH; j+=2) |
1990 { OpStr[j] = 0; | 1972 { OpStr[j] = 0; |
1991 OpStr[j + 1] = '.'; | 1973 OpStr[j + 1] = '.'; |
1992 } | 1974 } |
1993 /*add NULL termination*/ | 1975 /*add NULL termination*/ |
1994 OpStr[start_position+ 2*TRUNC_LENGTH] = NULL; | 1976 OpStr[start_position+ 2*TRUNC_LENGTH] = NULL; |
1995 OpStr[start_position+ 2*TRUNC_LENGTH+1] = NULL; | 1977 OpStr[start_position+ 2*TRUNC_LENGTH+1] = NULL; |
1996 } | 1978 } |
1997 else /*if ASCII*/ | 1979 else /*if ASCII*/ |
1998 { len = strlen(OpStr); | 1980 { len = strlen(OpStr); |
1999 if (len < (OpLen -(TRUNC_LENGTH+1))) | 1981 if (len < (OpLen -(TRUNC_LENGTH+1))) |
2000 { start_position = string_len_in_bytes(OpStr, OpLen, FALSE); | 1982 { start_position = string_len_in_bytes(OpStr, OpLen, FALSE); |
2001 } | 1983 } |
2002 else | 1984 else |
2003 { start_position = OpLen - TRUNC_LENGTH;} | 1985 { start_position = OpLen - TRUNC_LENGTH;} |
2004 memcpy(&OpStr[start_position], ellipse_str, TRUNC_LENGTH); | 1986 memcpy(&OpStr[start_position], ellipse_str, TRUNC_LENGTH); |
2005 | 1987 |
2006 } | 1988 } |
2007 } | 1989 } |
2008 | 1990 |
2009 TRACE_EVENT_P1("trunc string len post ellipsis:%d", dspl_GetTextExtent(OpStr, 0)); | 1991 TRACE_EVENT_P1("trunc string len post ellipsis:%d", dspl_GetTextExtent(OpStr, 0)); |
2010 | 1992 |
2011 return string_len_in_bytes(OpStr, OpLen, unicode); | 1993 return string_len_in_bytes(OpStr, OpLen, unicode); |
2012 | 1994 |
2013 } | 1995 } |
2014 | 1996 |
2015 /******************************************************************************* | 1997 /******************************************************************************* |
2016 | 1998 |
2031 //This function is used only for the Color build.Hence it is put under the | 2013 //This function is used only for the Color build.Hence it is put under the |
2032 //COLOURDISPLAY compiler switch | 2014 //COLOURDISPLAY compiler switch |
2033 #ifdef COLOURDISPLAY | 2015 #ifdef COLOURDISPLAY |
2034 int colMenuSelected(MfwMnu* mnu, MfwMnuItem* mnuItem) | 2016 int colMenuSelected(MfwMnu* mnu, MfwMnuItem* mnuItem) |
2035 { | 2017 { |
2036 T_MFW_HND win = mfw_parent(mfw_header()); | 2018 T_MFW_HND win = mfw_parent(mfw_header()); |
2037 int mnuId; | 2019 int mnuId; |
2038 int colDisplayType; | 2020 int colDisplayType; |
2039 int colType; | 2021 int colType; |
2040 int colFgdSelect = FALSE; | 2022 int colFgdSelect = FALSE; |
2041 int mnuColour; | 2023 int mnuColour; |
2042 int storedMenuId; | 2024 int storedMenuId; |
2043 | 2025 |
2044 //GW Read the stored menu Id from generic procedure | 2026 //GW Read the stored menu Id from generic procedure |
2045 storedMenuId = MmiBook_getStoredOption(); | 2027 storedMenuId = MmiBook_getStoredOption(); |
2046 mnuId = (int)mnuItem->str; | 2028 mnuId = (int)mnuItem->str; |
2047 | 2029 |
2048 mnuColour=resources_getColourFromText(mnuId); | 2030 mnuColour=resources_getColourFromText(mnuId); |
2049 | 2031 |
2050 getDisplayData(storedMenuId, &colDisplayType, &colType,&colFgdSelect); | 2032 getDisplayData(storedMenuId, &colDisplayType, &colType,&colFgdSelect); |
2051 | 2033 |
2052 setDataColour(colDisplayType, colType, colFgdSelect,mnuColour); | 2034 setDataColour(colDisplayType, colType, colFgdSelect,mnuColour); |
2053 | 2035 |
2054 info_screen(win, TxtColour, TxtSelected, 0); | 2036 info_screen(win, TxtColour, TxtSelected, 0); |
2055 | 2037 |
2056 // API/GW - Saved the selected colour so the flash file structure after selected | 2038 // API/GW - Saved the selected colour so the flash file structure after selected |
2057 flash_data_write(colourFileDir, colourFileName, colArray, sizeof(colArray)); | 2039 flash_data_write(colourFileDir, colourFileName, colArray, sizeof(colArray)); |
2058 | 2040 |
2059 return(0); | 2041 return(0); |
2060 } | 2042 } |
2061 | 2043 |
2062 #endif | 2044 #endif |
2063 /***************************Go-lite Optimization changes Start***********************/ | 2045 /***************************Go-lite Optimization changes Start***********************/ |
2064 | 2046 |
2065 | 2047 |
2066 /******************************************************************************* | 2048 /******************************************************************************* |
2067 $Function: set_SIMToolkit_title_string | 2049 $Function: set_SIMToolkit_title_string |
2068 | 2050 |
2069 $Description: Changes the value of the SAT main menu entry title. | 2051 $Description: Changes the value of the SAT main menu entry title. |
2070 | 2052 |
2071 $Returns: | 2053 $Returns: |
2072 | 2054 |
2073 $Arguments: New SAT Title. | 2055 $Arguments: New SAT Title. |
2074 | 2056 |
2075 *******************************************************************************/ | 2057 *******************************************************************************/ |
2076 | 2058 |
2077 | 2059 |
2078 void res_set_SIMToolkit_title_string(char* SAT_string) | 2060 void res_set_SIMToolkit_title_string(char* SAT_string) |
2080 SIMToolKitString = SAT_string; | 2062 SIMToolKitString = SAT_string; |
2081 } | 2063 } |
2082 | 2064 |
2083 /*API - 27/07/03 - CQ10203 - New function to reset the SMS VP in flash on factory reset*/ | 2065 /*API - 27/07/03 - CQ10203 - New function to reset the SMS VP in flash on factory reset*/ |
2084 /******************************************************************************* | 2066 /******************************************************************************* |
2085 $Function: resetSMSValidityPeriod | 2067 $Function: resetSMSValidityPeriod |
2086 | 2068 |
2087 $Description: Resets the value of the SMS VP in flash | 2069 $Description: Resets the value of the SMS VP in flash |
2088 | 2070 |
2089 $Returns: | 2071 $Returns: |
2090 | 2072 |
2091 $Arguments: None | 2073 $Arguments: None |
2092 | 2074 |
2093 *******************************************************************************/ | 2075 *******************************************************************************/ |
2094 void resetSMSValidityPeriod() | 2076 void resetSMSValidityPeriod() |
2095 { | 2077 { |
2096 /* x0045876, 14-Aug-2006 (WR - "sms_settings" was set but never used) */ | 2078 /* x0045876, 14-Aug-2006 (WR - "sms_settings" was set but never used) */ |
2097 #ifndef NEPTUNE_BOARD | 2079 #ifndef NEPTUNE_BOARD |
2098 T_MFW_SMS_INFO sms_settings; | 2080 T_MFW_SMS_INFO sms_settings; |
2099 #endif | 2081 #endif |
2100 | 2082 |
2101 TRACE_EVENT("resetSMSValidityPeriod()"); | 2083 TRACE_EVENT("resetSMSValidityPeriod()"); |
2102 | 2084 |
2103 if ( FFS_flashData.vp_rel != VP_REL_24_HOURS) | 2085 if ( FFS_flashData.vp_rel != VP_REL_24_HOURS) |
2104 FFS_flashData.vp_rel = VP_REL_24_HOURS; | 2086 FFS_flashData.vp_rel = VP_REL_24_HOURS; |
2105 | 2087 |
2106 /* x0045876, 14-Aug-2006 (WR - "sms_settings" was set but never used) */ | 2088 /* x0045876, 14-Aug-2006 (WR - "sms_settings" was set but never used) */ |
2107 #ifndef NEPTUNE_BOARD | 2089 #ifndef NEPTUNE_BOARD |
2108 /*NDH - 13/01/04 - CQ16753 - Propogate the Validity Period Settings to the ACI */ | 2090 /*NDH - 13/01/04 - CQ16753 - Propogate the Validity Period Settings to the ACI */ |
2109 sms_settings.vp_rel = FFS_flashData.vp_rel; | 2091 sms_settings.vp_rel = FFS_flashData.vp_rel; |
2110 #endif | 2092 #endif |
2111 | 2093 |
2112 #ifdef NEPTUNE_BOARD | 2094 #ifdef NEPTUNE_BOARD |
2113 //(void)sms_set_val_period(&sms_settings); /* NEPTUNE: Sumit: temp comment */ | 2095 //(void)sms_set_val_period(&sms_settings); /* NEPTUNE: Sumit: temp comment */ |
2114 #else | 2096 #else |
2115 (void)sms_set_val_period(&sms_settings); | 2097 (void)sms_set_val_period(&sms_settings); |
2116 #endif | 2098 #endif |
2117 /*NDH - 13/01/04 - CQ16753 - END */ | 2099 /*NDH - 13/01/04 - CQ16753 - END */ |
2118 | 2100 |
2119 } | 2101 } |
2120 /*API - CQ10203 - END*/ | 2102 /*API - CQ10203 - END*/ |
2103 | |
2121 /******************************************************************************* | 2104 /******************************************************************************* |
2122 | 2105 |
2123 End of File | 2106 End of File |
2124 | 2107 |
2125 *******************************************************************************/ | 2108 *******************************************************************************/ |
2126 |