FreeCalypso > hg > fc-tourmaline
changeset 160:2d19a232f9eb
mmiResources.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 18 Nov 2020 05:55:32 +0000 |
parents | 368f10ebcc64 |
children | b89fc69b96e1 |
files | src/ui/bmi/mmiResources.c |
diffstat | 1 files changed, 944 insertions(+), 962 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ui/bmi/mmiResources.c Wed Nov 18 04:53:44 2020 +0000 +++ b/src/ui/bmi/mmiResources.c Wed Nov 18 05:55:32 2020 +0000 @@ -1,6 +1,6 @@ /******************************************************************************* - CONDAT (UK) + CONDAT (UK) ******************************************************************************** @@ -9,14 +9,14 @@ ******************************************************************************** - $Project name: Basic MMI - $Project code: BMI (6349) - $Module: Resource Manager - $File: MmiResources.c - $Revision: 1.0 + $Project name: Basic MMI + $Project code: BMI (6349) + $Module: Resource Manager + $File: MmiResources.c + $Revision: 1.0 - $Author: Condat(UK) - $Date: 25/10/00 + $Author: Condat(UK) + $Date: 25/10/00 ******************************************************************************** @@ -43,45 +43,45 @@ ******************************************************************************** $History: MmiResources.c - Sep 14, 2007 REF: OMAPS00145860 Adrian Salido - Description: FT - MMI: Wrong trace class of new_getDataColour - Solution: changed event traces to function traces because the information content of - this is low for non-MMI people and against TI coding convention. + Sep 14, 2007 REF: OMAPS00145860 Adrian Salido + Description: FT - MMI: Wrong trace class of new_getDataColour + Solution: changed event traces to function traces because the information content of + this is low for non-MMI people and against TI coding convention. - Nov 07, 2006 ER:OMAPS00070661 R.Prabakar(a0393213) - R99 network compliancy : Implemented Language Notification and Provide Local Information (Language setting) - SAT proactive commands and Language Selection SAT event + Nov 07, 2006 ER:OMAPS00070661 R.Prabakar(a0393213) + R99 network compliancy : Implemented Language Notification and Provide Local Information (Language setting) + SAT proactive commands and Language Selection SAT event - May 30, 2006 DR: OMAPS00070657 x0pleela - Description: CPHS feature on Locosto-Lite - Solution: For ALS feature, - a) Modified "MmiRsrcGetText" function to return the string from FFS for the current active line + May 30, 2006 DR: OMAPS00070657 x0pleela + Description: CPHS feature on Locosto-Lite + Solution: For ALS feature, + a) Modified "MmiRsrcGetText" function to return the string from FFS for the current active line - March 01, 2005 REF: ENH 29313 Deepa M.D - Isolating colour build related changes from MMI LITE flag. - The proper Feature flag COLORDISPLAY was used for all color - related changes. + March 01, 2005 REF: ENH 29313 Deepa M.D + Isolating colour build related changes from MMI LITE flag. + The proper Feature flag COLORDISPLAY was used for all color + related changes. - Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu. - Issue description: Golite booting problem. - Solution: If the FFS is not formatted, prevent writing into the FFS. + Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu. + Issue description: Golite booting problem. + Solution: If the FFS is not formatted, prevent writing into the FFS. - Aug 25, 2004 REF: CRR 24904 Deepa M.D - Bug:cleanup compile switches used for Go-lite - Fix:COLOURDISPLAY compiler switch has been added to the functions which are - used only for the normal color build. + Aug 25, 2004 REF: CRR 24904 Deepa M.D + Bug:cleanup compile switches used for Go-lite + Fix:COLOURDISPLAY compiler switch has been added to the functions which are + used only for the normal color build. - Aug 25, 2004 REF: CRR 24297 Deepa M.D - Bug:Reduction of the size of the variable ColArray - Fix:The size of the structure T_COLDATA has been reduced for the Go-lite version. - For Go-lite only two colors are being used(Black&White), hence the members of the - T_COLDATA structure can be reduced to U8. + Aug 25, 2004 REF: CRR 24297 Deepa M.D + Bug:Reduction of the size of the variable ColArray + Fix:The size of the structure T_COLDATA has been reduced for the Go-lite version. + For Go-lite only two colors are being used(Black&White), hence the members of the + T_COLDATA structure can be reduced to U8. - 25/10/00 Original Condat(UK) BMI version. - 03/10/02 Replaced most of the file with version on branch for issue 1150 (MC, SPR 1242) + 25/10/00 Original Condat(UK) BMI version. + 03/10/02 Replaced most of the file with version on branch for issue 1150 (MC, SPR 1242) $End *******************************************************************************/ @@ -171,7 +171,7 @@ #include "MmiDialogs.h" #include "MmiLists.h" #include "MmiDialogs.h" -#include "Mmiicons.h" //GW +#include "Mmiicons.h" //GW #include "mfw_ffs.h" // this is for traces #include "cus_aci.h" @@ -182,7 +182,6 @@ #endif - #include "MmiLists.h" #include "mmiColours.h" @@ -220,31 +219,31 @@ //x33x-end*/ #ifndef LSCREEN -#define SK_HEIGHT_LATIN (LINE_HEIGHT_LATIN) -#define SK_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE) -#define TITLE_HEIGHT_LATIN (LINE_HEIGHT_LATIN) -#define TITLE_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE) +#define SK_HEIGHT_LATIN (LINE_HEIGHT_LATIN) +#define SK_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE) +#define TITLE_HEIGHT_LATIN (LINE_HEIGHT_LATIN) +#define TITLE_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE) -#define NLINES_LATIN (SCREEN_SIZE_Y/LINE_HEIGHT_LATIN) //6 -#define NLINES_CHINESE (SCREEN_SIZE_Y/LINE_HEIGHT_CHINESE) //4 -#define CHINESE_MENU_VERTICAL_SIZE ((NLINES_CHINESE-1)*LINE_HEIGHT_CHINESE) +#define NLINES_LATIN (SCREEN_SIZE_Y/LINE_HEIGHT_LATIN) //6 +#define NLINES_CHINESE (SCREEN_SIZE_Y/LINE_HEIGHT_CHINESE) //4 +#define CHINESE_MENU_VERTICAL_SIZE ((NLINES_CHINESE-1)*LINE_HEIGHT_CHINESE) #define STANDARD_MENU_VERTICAL_SIZE ((NLINES_LATIN-1)*LINE_HEIGHT_LATIN) -#define ICON_HEIGHT (6) +#define ICON_HEIGHT (6) #else -#define SK_HEIGHT_LATIN (LINE_HEIGHT+8) -#define SK_HEIGHT_CHINESE (LINE_HEIGHT+8) -#define TITLE_HEIGHT_LATIN (LINE_HEIGHT_LATIN+4) -#define TITLE_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE+4) -#define ALLOFFSET (LINE_HEIGHT*2) -#define MNUOFFSET (LINE_HEIGHT) +#define SK_HEIGHT_LATIN (LINE_HEIGHT+8) +#define SK_HEIGHT_CHINESE (LINE_HEIGHT+8) +#define TITLE_HEIGHT_LATIN (LINE_HEIGHT_LATIN+4) +#define TITLE_HEIGHT_CHINESE (LINE_HEIGHT_CHINESE+4) +#define ALLOFFSET (LINE_HEIGHT*2) +#define MNUOFFSET (LINE_HEIGHT) -#define NLINES_LATIN (SCREEN_SIZE_Y/LINE_HEIGHT_LATIN) -#define NLINES_CHINESE (SCREEN_SIZE_Y/LINE_HEIGHT_CHINESE) -#define CHINESE_MENU_VERTICAL_SIZE ((NLINES_CHINESE*LINE_HEIGHT_CHINESE)-SK_HEIGHT_CHINESE) +#define NLINES_LATIN (SCREEN_SIZE_Y/LINE_HEIGHT_LATIN) +#define NLINES_CHINESE (SCREEN_SIZE_Y/LINE_HEIGHT_CHINESE) +#define CHINESE_MENU_VERTICAL_SIZE ((NLINES_CHINESE*LINE_HEIGHT_CHINESE)-SK_HEIGHT_CHINESE) #define STANDARD_MENU_VERTICAL_SIZE ((NLINES_LATIN*LINE_HEIGHT_LATIN)-SK_HEIGHT_LATIN) -#define ICON_HEIGHT (22) +#define ICON_HEIGHT (22) #endif @@ -260,7 +259,7 @@ system */ static tBlkHandle BlkManager = NULL; -UBYTE currentLanguage = NULL; +UBYTE currentLanguage = NULL; static tBlkHandle Language = NULL; static long int ModuleKey = -1; @@ -296,27 +295,27 @@ #ifdef CHINESE_MMI static const CountryLangEntry LanguageTableEntries[7]= { - {"001", ENGLISH_LANGUAGE}, /*USA*/ - {"044", ENGLISH_LANGUAGE}, /*UK*/ - {"061", ENGLISH_LANGUAGE}, /*Australia*/ - {"353", ENGLISH_LANGUAGE}, /*Ireland*/ - {"064", ENGLISH_LANGUAGE}, /*New Zealand*/ - {"086", CHINESE_LANGUAGE}, /*PRChina*/ - {"065", CHINESE_LANGUAGE} /*Singapore*/ + {"001", ENGLISH_LANGUAGE}, /*USA*/ + {"044", ENGLISH_LANGUAGE}, /*UK*/ + {"061", ENGLISH_LANGUAGE}, /*Australia*/ + {"353", ENGLISH_LANGUAGE}, /*Ireland*/ + {"064", ENGLISH_LANGUAGE}, /*New Zealand*/ + {"086", CHINESE_LANGUAGE}, /*PRChina*/ + {"065", CHINESE_LANGUAGE} /*Singapore*/ }; static const CountryLanguageTable LanguageTable = { 7, (CountryLangEntry*)LanguageTableEntries}; -#else /*MC, if English and German Available*/ +#else /*MC, if English and German Available*/ static const CountryLangEntry LanguageTableEntries[7]= { - {"001", ENGLISH_LANGUAGE}, /*USA*/ - {"044", ENGLISH_LANGUAGE}, /*UK*/ - {"061", ENGLISH_LANGUAGE}, /*Australia*/ - {"353", ENGLISH_LANGUAGE}, /*Ireland*/ - {"064", ENGLISH_LANGUAGE}, /*New Zealand*/ - {"043", GERMAN_LANGUAGE}, /*Austria*/ - {"049", GERMAN_LANGUAGE} /*Germany*/ + {"001", ENGLISH_LANGUAGE}, /*USA*/ + {"044", ENGLISH_LANGUAGE}, /*UK*/ + {"061", ENGLISH_LANGUAGE}, /*Australia*/ + {"353", ENGLISH_LANGUAGE}, /*Ireland*/ + {"064", ENGLISH_LANGUAGE}, /*New Zealand*/ + {"043", GERMAN_LANGUAGE}, /*Austria*/ + {"049", GERMAN_LANGUAGE} /*Germany*/ }; static const CountryLanguageTable LanguageTable = @@ -327,21 +326,19 @@ typedef struct { - // cp_resource_file_t rf; - RESOURCE_DIRECTORY_HEADER language_table; - RESOURCE_DIRECTORY_HEADER melody_table; - RESOURCE_DIRECTORY_HEADER glyph_table; - RESOURCE_DIRECTORY_HEADER zone_table; + // cp_resource_file_t rf; + RESOURCE_DIRECTORY_HEADER language_table; + RESOURCE_DIRECTORY_HEADER melody_table; + RESOURCE_DIRECTORY_HEADER glyph_table; + RESOURCE_DIRECTORY_HEADER zone_table; - UBYTE langid; // current language_table - UBYTE fontid; // current font - ST_DIMENSION fontHeight; // current font height + UBYTE langid; // current language_table + UBYTE fontid; // current font + ST_DIMENSION fontHeight; // current font height } res_ResMgr_type; - - typedef struct { T_MMI_CONTROL mmi_control; @@ -351,11 +348,11 @@ T_resources resources_data; enum { - COL_TYPE_SCREEN=0, - COL_TYPE_SK, - COL_TYPE_HL, - COL_TYPE_TITLE, - COL_TYPE_MAX + COL_TYPE_SCREEN=0, + COL_TYPE_SK, + COL_TYPE_HL, + COL_TYPE_TITLE, + COL_TYPE_MAX }; /***************************Go-lite Optimization changes Start***********************/ //Aug 25, 2004 REF: CRR 24297 Deepa M.D @@ -366,13 +363,13 @@ //related changes. #ifdef COLOURDISPLAY typedef struct { - U32 fgd; - U32 bgd; + U32 fgd; + U32 bgd; } T_COLDATA; #else typedef struct { - U8 fgd; - U8 bgd; + U8 fgd; + U8 bgd; } T_COLDATA; #endif /***************************Go-lite Optimization changes end***********************/ @@ -394,29 +391,29 @@ #endif /*Data should be reset */ -MfwRect menuArea = {0,0,10,10}; -MfwRect menuNamesArea = {0,0,10,10}; -MfwRect menuListArea = {0,0,10,10}; -MfwRect editor_menuArea = {0,0,10,10}; /* menus display area */ -MfwRect network_menuArea = {0,0,10,10}; /* menus display area */ -MfwRect sat_setup_menuArea = {0,0,10,10}; /* menus display area */ -MfwRect sat_select_menuArea = {0,0,10,10}; /* menus display area */ -MfwRect smscb_M_CBArea = {0,0,10,10}; /* menus display area */ -MfwRect smscb_M_CB_ACTArea = {0,0,10,10}; /* menus display area */ -MfwRect smscb_M_CB_TOPArea = {0,0,10,10};/* menus display area */ -MfwRect smscb_M_CB_TOP_CONSArea = {0,0,10,10}; /* menus display area */ -MfwRect smscb_M_CB_TOP_CONS_SELArea = {0,0,10,10}; /* menus display area */ -MfwRect smscb_CBArea = {0,0,10,10}; /* menus display area */ -MfwRect smscb_CB_OPTArea = {0,0,10,10}; /* menus display area */ -MfwRect readSMS_menuArea = {0,0,10,10}; /* menus display area */ +MfwRect menuArea = {0,0,10,10}; +MfwRect menuNamesArea = {0,0,10,10}; +MfwRect menuListArea = {0,0,10,10}; +MfwRect editor_menuArea = {0,0,10,10}; /* menus display area */ +MfwRect network_menuArea = {0,0,10,10}; /* menus display area */ +MfwRect sat_setup_menuArea = {0,0,10,10}; /* menus display area */ +MfwRect sat_select_menuArea = {0,0,10,10}; /* menus display area */ +MfwRect smscb_M_CBArea = {0,0,10,10}; /* menus display area */ +MfwRect smscb_M_CB_ACTArea = {0,0,10,10}; /* menus display area */ +MfwRect smscb_M_CB_TOPArea = {0,0,10,10};/* menus display area */ +MfwRect smscb_M_CB_TOP_CONSArea = {0,0,10,10}; /* menus display area */ +MfwRect smscb_M_CB_TOP_CONS_SELArea = {0,0,10,10}; /* menus display area */ +MfwRect smscb_CBArea = {0,0,10,10}; /* menus display area */ +MfwRect smscb_CB_OPTArea = {0,0,10,10}; /* menus display area */ +MfwRect readSMS_menuArea = {0,0,10,10}; /* menus display area */ #ifdef FF_MMI_FILEMANAGER -MfwRect FileType_menuArea = {0,0,10,10}; /* menus display area */ // RAVI - 19-05-2005 +MfwRect FileType_menuArea = {0,0,10,10}; /* menus display area */ // RAVI - 19-05-2005 #endif -MfwRect SmsRead_R_OPTArea = {0,0,10,10};/* menus display area */ -MfwRect SmsSend_R_OPTArea = {0,0,10,10}; /* menus display area */ -MfwRect melody_menuArea = {0,0,10,10}; /* menus display area */ -MfwRect MAINICONarea = {0,0,10,10}; -MfwRect MAINICONareaColour = {0,0,10,10}; //For the larger colour main icons +MfwRect SmsRead_R_OPTArea = {0,0,10,10};/* menus display area */ +MfwRect SmsSend_R_OPTArea = {0,0,10,10}; /* menus display area */ +MfwRect melody_menuArea = {0,0,10,10}; /* menus display area */ +MfwRect MAINICONarea = {0,0,10,10}; +MfwRect MAINICONareaColour = {0,0,10,10}; //For the larger colour main icons static int resources_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); static void resources_language_confirm(void); @@ -433,7 +430,6 @@ // END - RAVI - /******************************************************************************* Private Routines @@ -444,22 +440,22 @@ { /* Initialise if required */ - currentLanguage = newLanguage; - if ( ModuleKey != KEYVALUE ) - { - /* Nope, then go do it, If the mmibm_* routines fail to initialise - they will return NULL, and they both deal with bad input values - cleanly, so we don't need error checking here. - */ + currentLanguage = newLanguage; + if ( ModuleKey != KEYVALUE ) + { + /* Nope, then go do it, If the mmibm_* routines fail to initialise + they will return NULL, and they both deal with bad input values + cleanly, so we don't need error checking here. + */ BlkManager = mmibm_Initialise( Mmir_BaseAddress(), Mmir_NumberOfEntries() ); - ModuleKey = KEYVALUE; - } + ModuleKey = KEYVALUE; + } /* Set up the new language based on the incoming value */ /*MC, SPR 1150, simplified for easier addition of new languages*/ if (newLanguage> 0 && newLanguage <= NO_OF_LANGUAGES) - Language = mmibm_SupplyResourceHandler( BlkManager, newLanguage ); + Language = mmibm_SupplyResourceHandler( BlkManager, newLanguage ); } @@ -470,28 +466,28 @@ *******************************************************************************/ /******************************************************************************* - $Function: MmiRsrcGetText + $Function: MmiRsrcGetText - $Description: Define access routine for the actual get text + $Description: Define access routine for the actual get text routine. In order to make sure the routine can - be invoked and will automatically start, we will - use the key value above to ensure we detect the - startup conditions. + be invoked and will automatically start, we will + use the key value above to ensure we detect the + startup conditions. - The calling routine for this function should check - for NULL values which will be returned if the + The calling routine for this function should check + for NULL values which will be returned if the - $Returns: Pointer to resource indicated by Id (Or NULL) + $Returns: Pointer to resource indicated by Id (Or NULL) - $Arguments: Id of requested resource + $Arguments: Id of requested resource *******************************************************************************/ char *MmiRsrcGetText( int Id ) { - /* Check if we have already initialised - */ - if ( ModuleKey != KEYVALUE ) + /* Check if we have already initialised + */ + if ( ModuleKey != KEYVALUE ) LanguageEnable( ENGLISH_LANGUAGE ); /* JVJ #1576 SAT is an exception, since the Menu string is variable depending on the SIM*/ @@ -503,40 +499,39 @@ //x0pleela 23 May, 2006 DR: OMAPS00070657 #ifdef FF_CPHS if( (Id==TxtLine1) && strlen(FFS_flashData.line1)) - return (char*)FFS_flashData.line1; + return (char*)FFS_flashData.line1; else if( (Id==TxtLine2) && strlen(FFS_flashData.line2)) - return (char*)FFS_flashData.line2; + return (char*)FFS_flashData.line2; #endif /* use the currently set up resource handler for the English - language to get the text associaed with the Id, again if - there has been a problem with the initialisation of the - English handler, then the fetch routine will deal with it - cleanly and return NULL. - */ - return (char *) mmibr_Fetch( Language, Id ); + language to get the text associaed with the Id, again if + there has been a problem with the initialisation of the + English handler, then the fetch routine will deal with it + cleanly and return NULL. + */ + return (char *) mmibr_Fetch( Language, Id ); } /*MC, SPR 1150 new function, don't need to write a new function for each new langauge now*/ void MmiRsrcSetLang( int lang ) -{ if (lang == CHINESE_LANGUAGE) - dspl_set_char_type(DSPL_TYPE_UNICODE); - else - dspl_set_char_type(DSPL_TYPE_ASCII); +{ if (lang == CHINESE_LANGUAGE) + dspl_set_char_type(DSPL_TYPE_UNICODE); + else + dspl_set_char_type(DSPL_TYPE_ASCII); LanguageEnable( lang ); - Mmi_layout_areas(); - FFS_flashData.language = lang; + Mmi_layout_areas(); + FFS_flashData.language = lang; // Oct 19, 2004 REF: CRR MMI-SPR-26002 xkundadu // Issue description: Golite booting problem. // Solution: If the FFS is not formatted, prevent writing into the FFS. - if(flash_formatted() == TRUE) - { - flash_write(); - } + if(flash_formatted() == TRUE) + { + flash_write(); + } +} - -} /*MC SPR 1150, Simplified menu interface functions. It should be simpler to add new functions for new languages We still need to write individual functions for each language to interface with the menus as @@ -585,209 +580,213 @@ { T_MFW_HND win = mfw_parent(mfw_header()); #ifndef FF_MMI_R99_SAT_LANG /*OMAPS00070661(SAT-lang notify) a0393213(R.Prabakar)*/ - resources_Init(win); - MmiRsrcSetLang(lang); - SEND_EVENT (resources_data.resources_win, SHOW_CONFIRM, 0, 0); + resources_Init(win); + MmiRsrcSetLang(lang); + SEND_EVENT (resources_data.resources_win, SHOW_CONFIRM, 0, 0); #else - /*OMAPS00070661 The sequence is changed to prevent the crash when the language is changed in quick succession*/ - MmiRsrcSetLang(lang); - if(!resources_data.resources_win) - { - resources_Init(win); - SEND_EVENT (resources_data.resources_win, SHOW_CONFIRM, 0, 0); - } - #endif - + /*OMAPS00070661 The sequence is changed to prevent the crash when the language is changed in quick succession*/ + MmiRsrcSetLang(lang); + if(!resources_data.resources_win) + { + resources_Init(win); + SEND_EVENT (resources_data.resources_win, SHOW_CONFIRM, 0, 0); + } + #endif } UBYTE Mmi_getCurrentLanguage(void) { - return currentLanguage; + return currentLanguage; } //GW Created to return height of a line with just numbers on it UBYTE numberLineHeight(void) { #ifndef LSCREEN - //All numbers are 8 bits high (whether chinese or latin chars) - return (8); + //All numbers are 8 bits high (whether chinese or latin chars) + return (8); #else - //all text is 12 bits high - return (12); + //all text is 12 bits high + return (12); #endif } + //GW Created UBYTE Mmi_layout_line(int lineNo) { #ifndef LSCREEN - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - { - switch (lineNo) - { - case 1: return FIRST_LINE_CHINESE; + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + { + switch (lineNo) + { + case 1: return FIRST_LINE_CHINESE; - case SECOND_LAST_LINE_TOP: - case 2: return SECOND_LINE_CHINESE; + case SECOND_LAST_LINE_TOP: + case 2: return SECOND_LINE_CHINESE; - case LAST_LINE_TOP: - case 3: return THIRD_LINE_CHINESE; + case LAST_LINE_TOP: + case 3: return THIRD_LINE_CHINESE; - case LAST_LINE: - case 4: return FOURTH_LINE_CHINESE; - //We are now asking for an invalid line - default: return FOURTH_LINE_CHINESE; + case LAST_LINE: + case 4: return FOURTH_LINE_CHINESE; + //We are now asking for an invalid line + default: return FOURTH_LINE_CHINESE; - } - } - else - { - switch (lineNo) - { - case 1: return FIRST_LINE; - case 2: return SECOND_LINE; - case 3: return THIRD_LINE; + } + } + else + { + switch (lineNo) + { + case 1: return FIRST_LINE; + case 2: return SECOND_LINE; + case 3: return THIRD_LINE; - case SECOND_LAST_LINE_TOP: - case 4: return FOURTH_LINE; + case SECOND_LAST_LINE_TOP: + case 4: return FOURTH_LINE; - case LAST_LINE_TOP: //y-coord of the top of last line - case 5: return FIFTH_LINE; + case LAST_LINE_TOP: //y-coord of the top of last line + case 5: return FIFTH_LINE; - case LAST_LINE: - case 6: return SIXTH_LINE; - //We are now asking for an invalid line - default: return SIXTH_LINE; - } - } + case LAST_LINE: + case 6: return SIXTH_LINE; + //We are now asking for an invalid line + default: return SIXTH_LINE; + } + } #else - //assume both fonts are now the same height. - switch (lineNo) - { - case SECOND_LAST_LINE_TOP: return ( (UBYTE)(SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()-LINE_HEIGHT)); - case LAST_LINE_TOP: return ( (UBYTE)(SCREEN_SIZE_Y-Mmi_layout_softkeyHeight())); - case LAST_LINE: return ( (UBYTE) SCREEN_SIZE_Y); + //assume both fonts are now the same height. + switch (lineNo) + { + case SECOND_LAST_LINE_TOP: return ( (UBYTE)(SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()-LINE_HEIGHT)); + case LAST_LINE_TOP: return ( (UBYTE)(SCREEN_SIZE_Y-Mmi_layout_softkeyHeight())); + case LAST_LINE: return ( (UBYTE) SCREEN_SIZE_Y); - default: return (lineNo*LINE_HEIGHT); - } + default: return (lineNo*LINE_HEIGHT); + } #endif } + UBYTE Mmi_layout_line_icons(int lineNo) { #ifndef LSCREEN - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - { - switch (lineNo) - { - case 1: return FIRST_LINE_CHINESE; + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + { + switch (lineNo) + { + case 1: return FIRST_LINE_CHINESE; - case SECOND_LAST_LINE_TOP: - case 2: return SECOND_LINE_CHINESE; + case SECOND_LAST_LINE_TOP: + case 2: return SECOND_LINE_CHINESE; - case LAST_LINE_TOP: - case 3: return THIRD_LINE_CHINESE; + case LAST_LINE_TOP: + case 3: return THIRD_LINE_CHINESE; - case LAST_LINE: - case 4: return FOURTH_LINE_CHINESE; - //We are now asking for an invalid line - default: return FOURTH_LINE_CHINESE; + case LAST_LINE: + case 4: return FOURTH_LINE_CHINESE; + //We are now asking for an invalid line + default: return FOURTH_LINE_CHINESE; - } - } - else - { - switch (lineNo) - { - case 1: //nobreak; - case 2: //nobreak; - case 3: //nobreak; - default: return (FIRST_LINE_ICON+(lineNo-1)*LINE_HEIGHT); + } + } + else + { + switch (lineNo) + { + case 1: //nobreak; + case 2: //nobreak; + case 3: //nobreak; + default: return (FIRST_LINE_ICON+(lineNo-1)*LINE_HEIGHT); - case SECOND_LAST_LINE_TOP: - case 4: return FOURTH_LINE; + case SECOND_LAST_LINE_TOP: + case 4: return FOURTH_LINE; - case LAST_LINE_TOP: //y-coord of the top of last line - case 5: return FIFTH_LINE; + case LAST_LINE_TOP: //y-coord of the top of last line + case 5: return FIFTH_LINE; - case LAST_LINE: - case 6: return SIXTH_LINE; - } + case LAST_LINE: + case 6: return SIXTH_LINE; + } - } + } #else - switch (lineNo) - { - case SECOND_LAST_LINE_TOP: return((UBYTE)(SCREEN_SIZE_Y-(Mmi_layout_softkeyHeight()+Mmi_layout_line_height()))); - case LAST_LINE_TOP: return((UBYTE)(SCREEN_SIZE_Y-(Mmi_layout_softkeyHeight()))); - case LAST_LINE: return((UBYTE)(SCREEN_SIZE_Y)); - default: return(Mmi_layout_IconHeight()+Mmi_layout_line_height()*lineNo); + switch (lineNo) + { + case SECOND_LAST_LINE_TOP: return((UBYTE)(SCREEN_SIZE_Y-(Mmi_layout_softkeyHeight()+Mmi_layout_line_height()))); + case LAST_LINE_TOP: return((UBYTE)(SCREEN_SIZE_Y-(Mmi_layout_softkeyHeight()))); + case LAST_LINE: return((UBYTE)(SCREEN_SIZE_Y)); + default: return(Mmi_layout_IconHeight()+Mmi_layout_line_height()*lineNo); - } + } #endif } UBYTE Mmi_layout_line_height(void) { #ifndef LSCREEN - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - return LINE_HEIGHT_CHINESE; - else - return LINE_HEIGHT; + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + return LINE_HEIGHT_CHINESE; + else + return LINE_HEIGHT; #else - return (LINE_HEIGHT); + return (LINE_HEIGHT); #endif } UBYTE Mmi_layout_softkeyHeight( void ) { #ifndef LSCREEN - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - return SK_HEIGHT_CHINESE; - else - return SK_HEIGHT_LATIN; + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + return SK_HEIGHT_CHINESE; + else + return SK_HEIGHT_LATIN; #else - return (SK_HEIGHT_LATIN); + return (SK_HEIGHT_LATIN); #endif } + UBYTE Mmi_layout_softkeyArea( MfwRect* rect ) { - if (!rect) - return (0); - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - rect->sy = SK_HEIGHT_CHINESE; - else - rect->sy = SK_HEIGHT_LATIN; - rect->px = 0; - rect->sx = SCREEN_SIZE_X; - rect->py = SCREEN_SIZE_Y-rect->sy; - return(1); + if (!rect) + return (0); + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + rect->sy = SK_HEIGHT_CHINESE; + else + rect->sy = SK_HEIGHT_LATIN; + rect->px = 0; + rect->sx = SCREEN_SIZE_X; + rect->py = SCREEN_SIZE_Y-rect->sy; + return(1); } + UBYTE Mmi_layout_TitleHeight( void ) { #ifndef LSCREEN - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - return TITLE_HEIGHT_CHINESE; - else - return TITLE_HEIGHT_LATIN; + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + return TITLE_HEIGHT_CHINESE; + else + return TITLE_HEIGHT_LATIN; #else - return (TITLE_HEIGHT_LATIN); + return (TITLE_HEIGHT_LATIN); #endif } + UBYTE Mmi_layout_IconHeight( void ) { - return (ICON_HEIGHT); + return (ICON_HEIGHT); } UBYTE Mmi_number_of_lines_with_icons_on_top(void) { #ifndef LSCREEN { - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - return 2; - else - return 4; + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + return 2; + else + return 4; } #else - return NLINES_MAX-1; + return NLINES_MAX-1; #endif } @@ -796,70 +795,68 @@ { #ifndef LSCREEN { - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - return 3; - else - return 5; + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + return 3; + else + return 5; } #else //assume a single font of 12 pixels high 10 lines x 12 pixels - return NLINES_MAX; + return NLINES_MAX; #endif } -//GW 10/02/03 Modified code - icon position is now sorted out by 'iconsMainIconsAreaSet' - the code -// here only supplies the available screen size +//GW 10/02/03 Modified code - icon position is now sorted out by 'iconsMainIconsAreaSet' - the code +// here only supplies the available screen size void Mmi_layout_areas(void) { - MAINICONarea.px = 0; - MAINICONarea.py =Mmi_layout_line_height(); + MAINICONarea.px = 0; + MAINICONarea.py =Mmi_layout_line_height(); - MAINICONarea.sx = SCREEN_SIZE_X; - MAINICONarea.sy =SCREEN_SIZE_Y-Mmi_layout_line_height()*2-1; + MAINICONarea.sx = SCREEN_SIZE_X; + MAINICONarea.sy =SCREEN_SIZE_Y-Mmi_layout_line_height()*2-1; - Mmi_set_area_attr(&menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&menuNamesArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-LINE_HEIGHT-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&menuListArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&editor_menuArea,Mmi_layout_line(1),0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - 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 */ - Mmi_set_area_attr(&sat_setup_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&sat_select_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&smscb_M_CBArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&smscb_M_CB_ACTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&smscb_M_CB_TOPArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&smscb_M_CB_TOP_CONSArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&smscb_M_CB_TOP_CONS_SELArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&smscb_CBArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&smscb_CB_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&readSMS_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&menuNamesArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-LINE_HEIGHT-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&menuListArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&editor_menuArea,Mmi_layout_line(1),0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + 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 */ + Mmi_set_area_attr(&sat_setup_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&sat_select_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&smscb_M_CBArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&smscb_M_CB_ACTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&smscb_M_CB_TOPArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&smscb_M_CB_TOP_CONSArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&smscb_M_CB_TOP_CONS_SELArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&smscb_CBArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&smscb_CB_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&readSMS_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); #ifdef FF_MMI_FILEMANAGER - Mmi_set_area_attr(&FileType_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); // RAVI - 27-05-2005 + Mmi_set_area_attr(&FileType_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); // RAVI - 27-05-2005 #endif - Mmi_set_area_attr(&SmsRead_R_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&SmsSend_R_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - Mmi_set_area_attr(&melody_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); - iconsMainIconsAreaSet (MAINICONarea); - + Mmi_set_area_attr(&SmsRead_R_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&SmsSend_R_OPTArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + Mmi_set_area_attr(&melody_menuArea, 0,0,SCREEN_SIZE_X,SCREEN_SIZE_Y-Mmi_layout_softkeyHeight()); + iconsMainIconsAreaSet (MAINICONarea); } void Mmi_set_area_attr(MfwRect* area,U16 px,U16 py,U16 sx,U16 sy) { - - /* pass in top-left/bottom-right coordinates*/ - area->px = px; - area->py = py; - area->sx = sx-px; - area->sy = sy-py; + /* pass in top-left/bottom-right coordinates*/ + area->px = px; + area->py = py; + area->sx = sx-px; + area->sy = sy-py; } /******************************************************************************* - $Function: resources_Init + $Function: resources_Init $Description: - $Returns: window + $Returns: window - $Arguments: parent window + $Arguments: parent window *******************************************************************************/ T_MFW_HND resources_Init(T_MFW_HND parent_window) @@ -870,52 +867,53 @@ // API - 1550 - 13-01-03 - Add this function to reset the backgrounds of Idle and Main Menus. void resetFactoryBackground ( void ) { - idle_setBgdBitmap(BGD_TI_LOGO); - FFS_flashData.IdleScreenBgd = BGD_TI_LOGO; + idle_setBgdBitmap(BGD_TI_LOGO); + FFS_flashData.IdleScreenBgd = BGD_TI_LOGO; - icon_setMainBgdBitmap(BGD_SQUARE); - FFS_flashData.MainMenuBgd = BGD_SQUARE; + icon_setMainBgdBitmap(BGD_SQUARE); + FFS_flashData.MainMenuBgd = BGD_SQUARE; - FFS_flashData.ProviderNetworkShow = TRUE; + FFS_flashData.ProviderNetworkShow = TRUE; } void resetFactoryColour ( void ) { - initDefaultDataColour(); - if(flash_data_write(colourFileDir, colourFileName, colArray, sizeof(colArray)) >= EFFS_OK) - { - TRACE_EVENT("File Created in FFS"); - } - else - { - TRACE_EVENT("File Not Created in FFS"); - } + initDefaultDataColour(); + if(flash_data_write(colourFileDir, colourFileName, colArray, sizeof(colArray)) >= EFFS_OK) + { + TRACE_EVENT("File Created in FFS"); + } + else + { + TRACE_EVENT("File Not Created in FFS"); + } +} -} void colour_initial_colours (void) { /* API/GW - Added to read the flash structure to see if the file structure to save the colour data in has been created - and if so save the initialised data to flash or load the saved values out of flash + and if so save the initialised data to flash or load the saved values out of flash */ if (flash_data_read(colourFileDir, colourFileName, colArray, sizeof(colArray)) == sizeof(colArray)) /* Marcus: Issue 1719: 11/02/2003: Altered comparison in condition */ { - TRACE_EVENT("Correctly Read in!"); + TRACE_EVENT("Correctly Read in!"); } else { - resetFactoryColour(); + resetFactoryColour(); } } + /******************************************************************************* - $Function: resources_Exit + $Function: resources_Exit - $Description: exit network handling (Backward Compatibility interface) + $Description: exit network handling (Backward Compatibility interface) - $Returns: none + $Returns: none - $Arguments: window + $Arguments: window *******************************************************************************/ void resources_Exit (T_MFW_HND own_window) @@ -928,17 +926,15 @@ } - - /******************************************************************************* - $Function: resources_create + $Function: resources_create - $Description: create network top window + $Description: create network top window - $Returns: window + $Returns: window - $Arguments: parent_window + $Arguments: parent_window *******************************************************************************/ T_MFW_HND resources_create (T_MFW_HND parent_window) @@ -961,7 +957,6 @@ win = ((T_MFW_HDR *)data->resources_win)->data; win->user = (void *) data; - winShow(data->resources_win); /* * return window handle @@ -970,16 +965,15 @@ } - /******************************************************************************* - $Function: resources_destroy + $Function: resources_destroy $Description: - $Returns: none + $Returns: none - $Arguments: window + $Arguments: window *******************************************************************************/ void resources_destroy (T_MFW_HND own_window) @@ -1009,13 +1003,13 @@ /******************************************************************************* - $Function: resources_win_cb + $Function: resources_win_cb - $Description: network top window + $Description: network top window - $Returns: status int + $Returns: status int - $Arguments: event, window + $Arguments: event, window *******************************************************************************/ static int resources_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) @@ -1027,18 +1021,15 @@ } - - - /******************************************************************************* - $Function: resources_language_confirm + $Function: resources_language_confirm $Description: - $Returns: void + $Returns: void - $Arguments: void + $Arguments: void *******************************************************************************/ static void resources_language_confirm(void) @@ -1047,30 +1038,29 @@ TRACE_FUNCTION ("resources_language_confirm()"); - dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtDone, TxtNull , COLOUR_STATUS_PINS); - dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)resources_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT ); + dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtDone, TxtNull , COLOUR_STATUS_PINS); + dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)resources_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT ); /* * Call Info Screen */ info_dialog (resources_data.resources_win, &display_info); - } /******************************************************************************* - $Function: resources_dialog_cb + $Function: resources_dialog_cb $Description: - $Returns: void + $Returns: void - $Arguments: window, identifier, reason + $Arguments: window, identifier, reason *******************************************************************************/ void resources_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) { - TRACE_FUNCTION ("resources_dialog_cb()"); + TRACE_FUNCTION ("resources_dialog_cb()"); switch (reason) { @@ -1087,16 +1077,15 @@ } - /******************************************************************************* - $Function: resources + $Function: resources $Description: - $Returns: void + $Returns: void - $Arguments: window, event, value, parameter + $Arguments: window, event, value, parameter *******************************************************************************/ void resources (T_MFW_HND win, USHORT event, SHORT value, void * parameter) @@ -1109,46 +1098,46 @@ switch (event) { case SHOW_CONFIRM: - resources_language_confirm(); + resources_language_confirm(); break; } +} -} /*MC added for SPR 1111*/ /******************************************************************************* - $Function: resources_reset_language + $Function: resources_reset_language - $Description: Reset language using Pseudo-SS string + $Description: Reset language using Pseudo-SS string - $Returns: TRUE if reset successful, FALSE otherwise + $Returns: TRUE if reset successful, FALSE otherwise - $Arguments: Pseudo-SS string + $Arguments: Pseudo-SS string *******************************************************************************/ BOOL resources_reset_language(char* string) { - char country_code[4]; - int i; - /*extract country code from input string*/ - memcpy(country_code, &string[3], 3); - country_code[3] = NULL; + char country_code[4]; + int i; + /*extract country code from input string*/ + memcpy(country_code, &string[3], 3); + country_code[3] = NULL; - /*for each entry in Language table*/ - for(i=0; i<LanguageTable.no_of_entries; i++) - { /*if country matches that of entry*/ + /*for each entry in Language table*/ + for(i=0; i<LanguageTable.no_of_entries; i++) + { /*if country matches that of entry*/ - if (!strcmp(country_code, LanguageTable.entries[i].country_dialling_code)) - { /*MC SPR 1150, check language fits in allowed range, rather than checking for each - and every language (easier to add more languages this way)*/ - if (LanguageTable.entries[i].language>0 && LanguageTable.entries[i].language <= NO_OF_LANGUAGES) - { MmiRsrcSetLang(LanguageTable.entries[i].language); - return TRUE; - } - } - } - /*if no matches found*/ - return FALSE; + if (!strcmp(country_code, LanguageTable.entries[i].country_dialling_code)) + { /*MC SPR 1150, check language fits in allowed range, rather than checking for each + and every language (easier to add more languages this way)*/ + if (LanguageTable.entries[i].language>0 && LanguageTable.entries[i].language <= NO_OF_LANGUAGES) + { MmiRsrcSetLang(LanguageTable.entries[i].language); + return TRUE; + } + } + } + /*if no matches found*/ + return FALSE; } /******************************************************************************* @@ -1172,165 +1161,164 @@ #ifdef COLOURDISPLAY void init_getDataColour(int screenType, int colType, U32 *fgd, U32 *bgd) { - U32 fgColor; - U32 bgColor; - U32 fgHLColor = NO_COLOUR_DEFINED; - U32 bgHLColor = NO_COLOUR_DEFINED; - U32 fgSKColor = NO_COLOUR_DEFINED; - U32 bgSKColor = NO_COLOUR_DEFINED; - U32 fgTColor = NO_COLOUR_DEFINED; - U32 bgTColor = NO_COLOUR_DEFINED; + U32 fgColor; + U32 bgColor; + U32 fgHLColor = NO_COLOUR_DEFINED; + U32 bgHLColor = NO_COLOUR_DEFINED; + U32 fgSKColor = NO_COLOUR_DEFINED; + U32 bgSKColor = NO_COLOUR_DEFINED; + U32 fgTColor = NO_COLOUR_DEFINED; + U32 bgTColor = NO_COLOUR_DEFINED; - TRACE_EVENT("init_getDataColour"); + TRACE_EVENT("init_getDataColour"); - switch (screenType) - { - case COLOUR_STATUS_WELCOME: //start screen - case COLOUR_STATUS_GOODBYE: //end screen - fgColor = COL_Black; - bgColor = COL_White; - fgSKColor = COL_Blue; - bgSKColor = COL_Yellow; - break; + switch (screenType) + { + case COLOUR_STATUS_WELCOME: //start screen + case COLOUR_STATUS_GOODBYE: //end screen + fgColor = COL_Black; + bgColor = COL_White; + fgSKColor = COL_Blue; + bgSKColor = COL_Yellow; + break; - /* GW#2294 Use a more legible colour as default background colour.*/ - case COLOUR_POPUP: - case COLOUR_STATUS: //generic status window - fgColor = COL_Red; //0x0000FF00; - bgColor = COL_Yellow;//0x00FFFFFF; - fgSKColor = COL_Red; - bgSKColor = COL_TRANSPARENT; - break; + /* GW#2294 Use a more legible colour as default background colour.*/ + case COLOUR_POPUP: + case COLOUR_STATUS: //generic status window + fgColor = COL_Red; //0x0000FF00; + bgColor = COL_Yellow;//0x00FFFFFF; + fgSKColor = COL_Red; + bgSKColor = COL_TRANSPARENT; + break; - case COLOUR_EDITOR: - fgTColor = COL_White; - bgTColor = COL_Blue; - fgColor = COL_Blue; // 0x00FFFF00; - bgColor = COL_Yellow;//COL_White;//0x00FFFFFF; - fgSKColor = COL_Blue; - bgSKColor = COL_PaleYellow; //0x00FFFF00; - break; + case COLOUR_EDITOR: + fgTColor = COL_White; + bgTColor = COL_Blue; + fgColor = COL_Blue; // 0x00FFFF00; + bgColor = COL_Yellow;//COL_White;//0x00FFFFFF; + fgSKColor = COL_Blue; + bgSKColor = COL_PaleYellow; //0x00FFFF00; + break; - case COLOUR_LIST_MAIN: - fgTColor = COL_White; - bgTColor = COL_BLK; - fgColor = COL_Yellow ; - bgColor = COL_Blue; - fgColor = COL_Black ; - bgColor = COL_White; - fgSKColor = COL_W; - bgSKColor = COL_BLK; //0x00FFFF00; - bgHLColor = COL_MidGrey; - break; + case COLOUR_LIST_MAIN: + fgTColor = COL_White; + bgTColor = COL_BLK; + fgColor = COL_Yellow ; + bgColor = COL_Blue; + fgColor = COL_Black ; + bgColor = COL_White; + fgSKColor = COL_W; + bgSKColor = COL_BLK; //0x00FFFF00; + bgHLColor = COL_MidGrey; + break; - case COLOUR_LIST_SUBMENU: - case COLOUR_LIST_SUBMENU1: - case COLOUR_LIST_SUBMENU2: - case COLOUR_LIST_SUBMENU3: - case COLOUR_LIST_SUBMENU4: - fgTColor = COL_Blue; - bgTColor = COL_PaleYellow; - fgColor = COL_Black ; - bgColor = COL_White; - bgHLColor = COL_MidGrey; - fgSKColor = COL_Blue; - bgSKColor = COL_PaleYellow; //0x00FFFF00; - break; + case COLOUR_LIST_SUBMENU: + case COLOUR_LIST_SUBMENU1: + case COLOUR_LIST_SUBMENU2: + case COLOUR_LIST_SUBMENU3: + case COLOUR_LIST_SUBMENU4: + fgTColor = COL_Blue; + bgTColor = COL_PaleYellow; + fgColor = COL_Black ; + bgColor = COL_White; + bgHLColor = COL_MidGrey; + fgSKColor = COL_Blue; + bgSKColor = COL_PaleYellow; //0x00FFFF00; + break; - case COLOUR_LIST_COLOUR: - fgColor = COL_RG2; - bgColor = COL_W2; - fgSKColor = COL_W; - bgSKColor = COL_B; - fgTColor = COL_RG; - bgTColor = COL_B; - fgHLColor = dspl_GetBgdColour(); - bgHLColor = dspl_GetFgdColour(); - break; + case COLOUR_LIST_COLOUR: + fgColor = COL_RG2; + bgColor = COL_W2; + fgSKColor = COL_W; + bgSKColor = COL_B; + fgTColor = COL_RG; + bgTColor = COL_B; + fgHLColor = dspl_GetBgdColour(); + bgHLColor = dspl_GetFgdColour(); + break; - //Colours for specific displays - case COLOUR_GAME: - fgColor = COL_BLK ; - bgColor = COL_W; - fgSKColor = COL_BLK ; - bgSKColor = COL_Orange; - fgHLColor = COL_B; - bgHLColor = COL_W; - fgTColor = COL_RB; - bgTColor = COL_G; - break; + //Colours for specific displays + case COLOUR_GAME: + fgColor = COL_BLK ; + bgColor = COL_W; + fgSKColor = COL_BLK ; + bgSKColor = COL_Orange; + fgHLColor = COL_B; + bgHLColor = COL_W; + fgTColor = COL_RB; + bgTColor = COL_G; + break; - case COLOUR_IDLE: - fgColor = COL_BLK;//Green ; - bgColor = COL_TRANSPARENT;//White ; - fgSKColor = COL_Blue; - bgSKColor = COL_TRANSPARENT; - //Colours are for the icons - fgTColor = COL_RB; - bgTColor = COL_G; - break; + case COLOUR_IDLE: + fgColor = COL_BLK;//Green ; + bgColor = COL_TRANSPARENT;//White ; + fgSKColor = COL_Blue; + bgSKColor = COL_TRANSPARENT; + //Colours are for the icons + fgTColor = COL_RB; + bgTColor = COL_G; + break; - case COLOUR_INCALL: - fgColor = COL_RG ; - bgColor = COL_BLK; - fgSKColor = COL_B ; /* SPR#1699 - SH - Modified so softkeys visible */ - bgSKColor = COL_TRANSPARENT; - fgHLColor = COL_B; - bgHLColor = COL_W; - fgTColor = COL_RB; - bgTColor = COL_G; - break; + case COLOUR_INCALL: + fgColor = COL_RG ; + bgColor = COL_BLK; + fgSKColor = COL_B ; /* SPR#1699 - SH - Modified so softkeys visible */ + bgSKColor = COL_TRANSPARENT; + fgHLColor = COL_B; + bgHLColor = COL_W; + fgTColor = COL_RB; + bgTColor = COL_G; + break; - - default: - fgColor = 0x002020FF; - bgColor = COL_GR;//0x00FFFFFF; - fgSKColor = 0x0000FF01; - bgSKColor = COL_GR;//0x00FF0000; - break; - } + default: + fgColor = 0x002020FF; + bgColor = COL_GR;//0x00FFFFFF; + fgSKColor = 0x0000FF01; + bgSKColor = COL_GR;//0x00FF0000; + break; + } - /*If we have no preference for the other colours - set to default*/ - if (fgHLColor == NO_COLOUR_DEFINED) - fgHLColor = bgColor; - if (bgHLColor == NO_COLOUR_DEFINED) - bgHLColor = fgColor; + /*If we have no preference for the other colours - set to default*/ + if (fgHLColor == NO_COLOUR_DEFINED) + fgHLColor = bgColor; + if (bgHLColor == NO_COLOUR_DEFINED) + bgHLColor = fgColor; - if (fgSKColor == NO_COLOUR_DEFINED) - fgSKColor = fgColor; - if (bgSKColor == NO_COLOUR_DEFINED) - bgSKColor = bgColor; - if (fgTColor == NO_COLOUR_DEFINED) - fgTColor = fgColor; - if (bgTColor == NO_COLOUR_DEFINED) - bgTColor = bgColor; + if (fgSKColor == NO_COLOUR_DEFINED) + fgSKColor = fgColor; + if (bgSKColor == NO_COLOUR_DEFINED) + bgSKColor = bgColor; + if (fgTColor == NO_COLOUR_DEFINED) + fgTColor = fgColor; + if (bgTColor == NO_COLOUR_DEFINED) + bgTColor = bgColor; - switch (colType) - { - case COL_TYPE_SCREEN: - default: - *fgd = fgColor; - *bgd = bgColor; - break; - case COL_TYPE_SK: - *fgd = fgSKColor; - *bgd = bgSKColor; - break; - case COL_TYPE_HL: - *fgd = fgHLColor; - *bgd = bgHLColor; - break; - case COL_TYPE_TITLE: - *fgd = fgTColor; - *bgd = bgTColor; - break; + switch (colType) + { + case COL_TYPE_SCREEN: + default: + *fgd = fgColor; + *bgd = bgColor; + break; + case COL_TYPE_SK: + *fgd = fgSKColor; + *bgd = bgSKColor; + break; + case COL_TYPE_HL: + *fgd = fgHLColor; + *bgd = bgHLColor; + break; + case COL_TYPE_TITLE: + *fgd = fgTColor; + *bgd = bgTColor; + break; - } - if (*fgd == *bgd) - { - if (*fgd != COL_B) - *fgd = COL_B; - } + } + if (*fgd == *bgd) + { + if (*fgd != COL_B) + *fgd = COL_B; + } } #endif /***************************Go-lite Optimization changes end***********************/ @@ -1358,26 +1346,26 @@ void setDataColour(int screenType, int colType, U32 fgdORbgd, U32 newColour) { - TRACE_EVENT("setDataColour"); + TRACE_EVENT("setDataColour"); - if ((newColour == NO_COLOUR_DEFINED) || (fgdORbgd ==NO_COL)) - return; - if ((screenType < LAST_COLOUR_DEF) && - (screenType >=0) && - (colType < LAST_COLOUR_DEF) && - (colType >=0)) - { - if (fgdORbgd == FGD_COL) - { - //Do not allow transparent foreground colours - if ((newColour & 0xFF000000) != 0xFF000000) - colArray[screenType][colType].fgd = newColour; - } - else - { - colArray[screenType][colType].bgd = newColour; - } - } + if ((newColour == NO_COLOUR_DEFINED) || (fgdORbgd ==NO_COL)) + return; + if ((screenType < LAST_COLOUR_DEF) && + (screenType >=0) && + (colType < LAST_COLOUR_DEF) && + (colType >=0)) + { + if (fgdORbgd == FGD_COL) + { + //Do not allow transparent foreground colours + if ((newColour & 0xFF000000) != 0xFF000000) + colArray[screenType][colType].fgd = newColour; + } + else + { + colArray[screenType][colType].bgd = newColour; + } + } } #endif /***************************Go-lite Optimization changes Start***********************/ @@ -1398,103 +1386,100 @@ *******************************************************************************/ void initDefaultDataColour (void) { - - int i,j; + int i,j; - for (i=0; i<LAST_COLOUR_DEF;i++) - { - for (j=0; j<COL_TYPE_MAX;j++) - { - /***************************Go-lite Optimization changes Start***********************/ - //Aug 25, 2004 REF: CRR 24297 Deepa M.D - //For Go-lite build, do the initialization of the colArray with black and white. - //March 01, 2005 REF: ENH 29313 Deepa M.D - // Isolating colour build related changes from MMI LITE flag. - // The proper Feature flag COLORDISPLAY was used for all color - //related changes. + for (i=0; i<LAST_COLOUR_DEF;i++) + { + for (j=0; j<COL_TYPE_MAX;j++) + { + /***************************Go-lite Optimization changes Start***********************/ + //Aug 25, 2004 REF: CRR 24297 Deepa M.D + //For Go-lite build, do the initialization of the colArray with black and white. + //March 01, 2005 REF: ENH 29313 Deepa M.D + // Isolating colour build related changes from MMI LITE flag. + // The proper Feature flag COLORDISPLAY was used for all color + //related changes. #ifdef COLOURDISPLAY - init_getDataColour(i, j, &colArray[i][j].fgd, &colArray[i][j].bgd); + init_getDataColour(i, j, &colArray[i][j].fgd, &colArray[i][j].bgd); #else - colArray[i][j].fgd = COL_Lite_Black; - colArray[i][j].bgd = COL_Lite_White; + colArray[i][j].fgd = COL_Lite_Black; + colArray[i][j].bgd = COL_Lite_White; #endif - /***************************Go-lite Optimization changes end***********************/ - } - } + /***************************Go-lite Optimization changes end***********************/ + } + } } void getDataColour(int screenType, int colType, U32 *fgd, U32 *bgd) { - - - TRACE_EVENT("getDataColour"); + TRACE_EVENT("getDataColour"); - if ((screenType == COLOUR_LIST_COLOUR) && (colType ==COL_TYPE_HL)) - { - /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ - MMI_TRACE_EVENT("new_getDataColour IF"); + if ((screenType == COLOUR_LIST_COLOUR) && (colType ==COL_TYPE_HL)) + { + /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ + MMI_TRACE_EVENT("new_getDataColour IF"); - *fgd = dspl_GetBgdColour(); - *bgd = dspl_GetFgdColour(); - } - else if ((screenType < LAST_COLOUR_DEF) && - (screenType >=0) && - (colType < COL_TYPE_MAX) && - (colType >=0)) - { - /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ - MMI_TRACE_EVENT("new_getDataColour ELSE IF"); - *fgd = colArray[screenType][colType].fgd; - *bgd = colArray[screenType][colType].bgd; - /***************************Go-lite Optimization changes Start***********************/ - //Aug 25, 2004 REF: CRR 24297 Deepa M.D - //Set the fgd and bgd color for Go-lite version based - //on the value stored in the colArray - //March 01, 2005 REF: ENH 29313 Deepa M.D - // Isolating colour build related changes from MMI LITE flag. - // The proper Feature flag COLORDISPLAY was used for all color - //related changes. + *fgd = dspl_GetBgdColour(); + *bgd = dspl_GetFgdColour(); + } + else if ((screenType < LAST_COLOUR_DEF) && + (screenType >=0) && + (colType < COL_TYPE_MAX) && + (colType >=0)) + { + /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ + MMI_TRACE_EVENT("new_getDataColour ELSE IF"); + *fgd = colArray[screenType][colType].fgd; + *bgd = colArray[screenType][colType].bgd; + /***************************Go-lite Optimization changes Start***********************/ + //Aug 25, 2004 REF: CRR 24297 Deepa M.D + //Set the fgd and bgd color for Go-lite version based + //on the value stored in the colArray + //March 01, 2005 REF: ENH 29313 Deepa M.D + // Isolating colour build related changes from MMI LITE flag. + // The proper Feature flag COLORDISPLAY was used for all color + //related changes. #ifndef COLOURDISPLAY - if(*fgd==COL_Lite_Black) - *fgd=COL_Black; - else - *fgd=COL_White; - if(*bgd==COL_Lite_Black) - *bgd=COL_Black; - else - *bgd=COL_White; + if(*fgd==COL_Lite_Black) + *fgd=COL_Black; + else + *fgd=COL_White; + if(*bgd==COL_Lite_Black) + *bgd=COL_Black; + else + *bgd=COL_White; #endif - /***************************Go-lite Optimization changes end***********************/ - } - else - { - /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ - MMI_TRACE_EVENT("new_getDataColour ELSE"); - *fgd = colArray[0][0].fgd; - *bgd = colArray[0][0].bgd; - /***************************Go-lite Optimization changes Start***********************/ - //Aug 25, 2004 REF: CRR 24297 Deepa M.D - //Set the fgd and bgd color for Go-lite version based - //on the value stored in the colArray - //March 01, 2005 REF: ENH 29313 Deepa M.D - // Isolating colour build related changes from MMI LITE flag. - // The proper Feature flag COLORDISPLAY was used for all color - //related changes. + /***************************Go-lite Optimization changes end***********************/ + } + else + { + /* x0083025 on Sep 14, 2007 for OMAPS00145860 (adrian) */ + MMI_TRACE_EVENT("new_getDataColour ELSE"); + *fgd = colArray[0][0].fgd; + *bgd = colArray[0][0].bgd; + /***************************Go-lite Optimization changes Start***********************/ + //Aug 25, 2004 REF: CRR 24297 Deepa M.D + //Set the fgd and bgd color for Go-lite version based + //on the value stored in the colArray + //March 01, 2005 REF: ENH 29313 Deepa M.D + // Isolating colour build related changes from MMI LITE flag. + // The proper Feature flag COLORDISPLAY was used for all color + //related changes. #ifndef COLOURDISPLAY - if(*fgd==COL_Lite_Black) - *fgd=COL_Black; - else - *fgd=COL_White; - if(*bgd==COL_Lite_Black) - *bgd=COL_Black; - else - *bgd=COL_White; + if(*fgd==COL_Lite_Black) + *fgd=COL_Black; + else + *fgd=COL_White; + if(*bgd==COL_Lite_Black) + *bgd=COL_Black; + else + *bgd=COL_White; #endif - /***************************Go-lite Optimization changes end***********************/ + /***************************Go-lite Optimization changes end***********************/ TRACE_EVENT_P1("fdg color is %d",*fgd); - TRACE_EVENT_P1("bdg color is %d",*bgd); + TRACE_EVENT_P1("bdg color is %d",*bgd); - } + } } /******************************************************************************* @@ -1514,16 +1499,16 @@ static U32 oldmnuFgdCol,oldmnuBgdCol; void resources_setColour(unsigned int colIndex) { - U32 fgdColour,bgdColour; - getDataColour(colIndex, COL_TYPE_SCREEN, &fgdColour, &bgdColour); - oldFgdCol = dspl_SetFgdColour( fgdColour); - oldBgdCol = dspl_SetBgdColour( bgdColour); - if (colIndex==0xFFFF) - {//disabled for the moment - char str[50]; - sprintf(str,"Id=%d (%x,%x)",colIndex,fgdColour,bgdColour); - dspl_ScrText (0, 180, str, 0); - } + U32 fgdColour,bgdColour; + getDataColour(colIndex, COL_TYPE_SCREEN, &fgdColour, &bgdColour); + oldFgdCol = dspl_SetFgdColour( fgdColour); + oldBgdCol = dspl_SetBgdColour( bgdColour); + if (colIndex==0xFFFF) + {//disabled for the moment + char str[50]; + sprintf(str,"Id=%d (%x,%x)",colIndex,fgdColour,bgdColour); + dspl_ScrText (0, 180, str, 0); + } } /******************************************************************************* @@ -1540,10 +1525,10 @@ *******************************************************************************/ void resources_setSKColour(unsigned int colIndex) { - U32 fgdSKColour,bgdSKColour; - getDataColour(colIndex, COL_TYPE_SK, &fgdSKColour, &bgdSKColour ); - oldmnuFgdCol = dspl_SetFgdColour( fgdSKColour); - oldmnuBgdCol = dspl_SetBgdColour( bgdSKColour); + U32 fgdSKColour,bgdSKColour; + getDataColour(colIndex, COL_TYPE_SK, &fgdSKColour, &bgdSKColour ); + oldmnuFgdCol = dspl_SetFgdColour( fgdSKColour); + oldmnuBgdCol = dspl_SetBgdColour( bgdSKColour); } /******************************************************************************* @@ -1560,31 +1545,31 @@ *******************************************************************************/ void resources_setHLColour(unsigned int colIndex) { - U32 fgdColour,bgdColour; + U32 fgdColour,bgdColour; #ifdef COLOURDISPLAY - getDataColour(colIndex, COL_TYPE_HL, &fgdColour, &bgdColour ); + getDataColour(colIndex, COL_TYPE_HL, &fgdColour, &bgdColour ); #else - //For b+w highlight, get fgd colour as bgd and vice versa - fgdColour = dspl_GetBgdColour(); - bgdColour = dspl_GetFgdColour(); - //If one colour is black/white, make other colour the opposite - if (fgdColour == COL_Black) - bgdColour = COL_White; - else if (bgdColour == COL_Black) - fgdColour = COL_White; - else if (fgdColour == COL_White) - bgdColour = COL_Black; - else if (bgdColour == COL_White) - fgdColour = COL_Black; - else - { //Default : assume the rest of the display is black on white=> highlight is white on black. - fgdColour = COL_White; - bgdColour = COL_Black; - } + //For b+w highlight, get fgd colour as bgd and vice versa + fgdColour = dspl_GetBgdColour(); + bgdColour = dspl_GetFgdColour(); + //If one colour is black/white, make other colour the opposite + if (fgdColour == COL_Black) + bgdColour = COL_White; + else if (bgdColour == COL_Black) + fgdColour = COL_White; + else if (fgdColour == COL_White) + bgdColour = COL_Black; + else if (bgdColour == COL_White) + fgdColour = COL_Black; + else + { //Default : assume the rest of the display is black on white=> highlight is white on black. + fgdColour = COL_White; + bgdColour = COL_Black; + } #endif - oldmnuFgdCol = dspl_SetFgdColour( fgdColour); - oldmnuBgdCol = dspl_SetBgdColour( bgdColour); + oldmnuFgdCol = dspl_SetFgdColour( fgdColour); + oldmnuBgdCol = dspl_SetBgdColour( bgdColour); } /******************************************************************************* @@ -1601,10 +1586,10 @@ *******************************************************************************/ void resources_setTitleColour(unsigned int colIndex) { - U32 fgdColour,bgdColour; - getDataColour(colIndex, COL_TYPE_TITLE, &fgdColour, &bgdColour ); - oldmnuFgdCol = dspl_SetFgdColour( fgdColour); - oldmnuBgdCol = dspl_SetBgdColour( bgdColour); + U32 fgdColour,bgdColour; + getDataColour(colIndex, COL_TYPE_TITLE, &fgdColour, &bgdColour ); + oldmnuFgdCol = dspl_SetFgdColour( fgdColour); + oldmnuBgdCol = dspl_SetBgdColour( bgdColour); } /******************************************************************************* @@ -1621,8 +1606,8 @@ *******************************************************************************/ void resources_restoreColour(void) { - dspl_SetFgdColour( oldFgdCol); - dspl_SetBgdColour( oldBgdCol); + dspl_SetFgdColour( oldFgdCol); + dspl_SetBgdColour( oldBgdCol); } /******************************************************************************* @@ -1640,8 +1625,8 @@ *******************************************************************************/ void resources_restoreMnuColour(void) { - dspl_SetFgdColour( oldmnuFgdCol); - dspl_SetBgdColour( oldmnuBgdCol); + dspl_SetFgdColour( oldmnuFgdCol); + dspl_SetBgdColour( oldmnuBgdCol); } @@ -1661,89 +1646,89 @@ *******************************************************************************/ void getDisplayData(int txtId,int *colDisplayType, int *colType, int *colFgdSelect) { - *colFgdSelect = NO_COL; + *colFgdSelect = NO_COL; /**/ - switch (txtId) - { + switch (txtId) + { default: - *colFgdSelect = NO_COL; - break; + *colFgdSelect = NO_COL; + break; case TxtIdleScreenBackground: - *colDisplayType = COLOUR_IDLE; - *colType = COL_TYPE_SCREEN; - *colFgdSelect = BGD_COL; - break; -case TxtIdleScreenSoftKey: - *colDisplayType = COLOUR_IDLE; - *colType = COL_TYPE_SK; - *colFgdSelect = FGD_COL; - break; -case TxtIdleScreenText: - *colDisplayType = COLOUR_IDLE; - *colType = COL_TYPE_SCREEN; - *colFgdSelect = FGD_COL; - break; -case TxtIdleScreenNetworkName: - *colDisplayType = COLOUR_IDLE; - *colType = COL_TYPE_SCREEN; - *colFgdSelect = FGD_COL; - break; -case TxtGeneralBackground: - *colDisplayType = COLOUR_LIST_MAIN; - *colType = COL_TYPE_SCREEN; - *colFgdSelect = BGD_COL; - break; -case TxtMenuSoftKeyForeground: - *colDisplayType = COLOUR_LIST_MAIN; - *colType = COL_TYPE_SK; - *colFgdSelect = FGD_COL; - break; -case TxtMenuSoftKeyBackground: - *colDisplayType = COLOUR_LIST_MAIN; - *colType = COL_TYPE_SK; - *colFgdSelect = BGD_COL; - break; -case TxtSubMenuHeadingText: - *colDisplayType = COLOUR_LIST_SUBMENU; - *colType = COL_TYPE_TITLE; - *colFgdSelect = FGD_COL; - break; + *colDisplayType = COLOUR_IDLE; + *colType = COL_TYPE_SCREEN; + *colFgdSelect = BGD_COL; + break; +case TxtIdleScreenSoftKey: + *colDisplayType = COLOUR_IDLE; + *colType = COL_TYPE_SK; + *colFgdSelect = FGD_COL; + break; +case TxtIdleScreenText: + *colDisplayType = COLOUR_IDLE; + *colType = COL_TYPE_SCREEN; + *colFgdSelect = FGD_COL; + break; +case TxtIdleScreenNetworkName: + *colDisplayType = COLOUR_IDLE; + *colType = COL_TYPE_SCREEN; + *colFgdSelect = FGD_COL; + break; +case TxtGeneralBackground: + *colDisplayType = COLOUR_LIST_MAIN; + *colType = COL_TYPE_SCREEN; + *colFgdSelect = BGD_COL; + break; +case TxtMenuSoftKeyForeground: + *colDisplayType = COLOUR_LIST_MAIN; + *colType = COL_TYPE_SK; + *colFgdSelect = FGD_COL; + break; +case TxtMenuSoftKeyBackground: + *colDisplayType = COLOUR_LIST_MAIN; + *colType = COL_TYPE_SK; + *colFgdSelect = BGD_COL; + break; +case TxtSubMenuHeadingText: + *colDisplayType = COLOUR_LIST_SUBMENU; + *colType = COL_TYPE_TITLE; + *colFgdSelect = FGD_COL; + break; -case TxtSubMenuHeadingBackground: - *colDisplayType = COLOUR_LIST_SUBMENU; - *colType = COL_TYPE_TITLE; - *colFgdSelect = BGD_COL; - break; -case TxtSubMenuTextForeground: - *colDisplayType = COLOUR_LIST_SUBMENU; - *colType = COL_TYPE_SCREEN; - *colFgdSelect = FGD_COL; - break; +case TxtSubMenuHeadingBackground: + *colDisplayType = COLOUR_LIST_SUBMENU; + *colType = COL_TYPE_TITLE; + *colFgdSelect = BGD_COL; + break; +case TxtSubMenuTextForeground: + *colDisplayType = COLOUR_LIST_SUBMENU; + *colType = COL_TYPE_SCREEN; + *colFgdSelect = FGD_COL; + break; -case TxtSubMenuTextBackground: - *colDisplayType = COLOUR_LIST_SUBMENU; - *colType = COL_TYPE_SCREEN; - *colFgdSelect = BGD_COL; - break; -case TxtSubMenuSelectionBar: - *colDisplayType = COLOUR_LIST_SUBMENU; - *colType = COL_TYPE_HL; - *colFgdSelect = BGD_COL; - break; -case TxtPopUpTextForeground: /* GW#2294 COLOUR_STATUS has been used for all popups - change this colour instead of COLOUR_POPUP .*/ - *colDisplayType = COLOUR_STATUS; - *colType = COL_TYPE_SCREEN; - *colFgdSelect = FGD_COL; - break; -case TxtPopUpTextBackground: /* GW#2294 COLOUR_STATUS has been used for all popups - change this colour instead of COLOUR_POPUP .*/ - *colDisplayType = COLOUR_STATUS; - *colType = COL_TYPE_SCREEN; - *colFgdSelect = BGD_COL; - break; - } +case TxtSubMenuTextBackground: + *colDisplayType = COLOUR_LIST_SUBMENU; + *colType = COL_TYPE_SCREEN; + *colFgdSelect = BGD_COL; + break; +case TxtSubMenuSelectionBar: + *colDisplayType = COLOUR_LIST_SUBMENU; + *colType = COL_TYPE_HL; + *colFgdSelect = BGD_COL; + break; +case TxtPopUpTextForeground: /* GW#2294 COLOUR_STATUS has been used for all popups - change this colour instead of COLOUR_POPUP .*/ + *colDisplayType = COLOUR_STATUS; + *colType = COL_TYPE_SCREEN; + *colFgdSelect = FGD_COL; + break; +case TxtPopUpTextBackground: /* GW#2294 COLOUR_STATUS has been used for all popups - change this colour instead of COLOUR_POPUP .*/ + *colDisplayType = COLOUR_STATUS; + *colType = COL_TYPE_SCREEN; + *colFgdSelect = BGD_COL; + break; + } /**/ } /******************************************************************************* @@ -1762,30 +1747,29 @@ //This is called to set the colour of menu items controlled by the text id's int resources_getColourFromText(int txtId) { - U32 col; - switch (txtId) - { -case TxtColourBlack: col = COL_Black; break; -case TxtColourBlue: col = COL_Blue; break; -case TxtColourCyan: col = COL_Cyan; break; -case TxtColourGreen: col = COL_Green; break; -case TxtColourMagenta: col = COL_Magenta; break; -case TxtColourYellow: col = COL_Yellow; break; -case TxtColourRed: col = COL_Red; break; -case TxtColourWhite: col = COL_White; break; -case TxtColourPink: col = COL_Pink; break;// 0x00FF4040; break; -case TxtColourOrange: col = COL_Orange; break; -case TxtColourLightBlue: col = COL_LightBlue; break;// 0x004040FF; break; -case TxtColourLightGreen: col = COL_LightGreen; break;// 0x0040FF40; break; -case TxtColourPaleYellow: col = COL_PaleYellow; break;// 0x00FFFF40; break; -case TxtColourTransparent: col = COL_Transparent; break; -default: col = NO_COLOUR_DEFINED; - } - return (col); + U32 col; + switch (txtId) + { +case TxtColourBlack: col = COL_Black; break; +case TxtColourBlue: col = COL_Blue; break; +case TxtColourCyan: col = COL_Cyan; break; +case TxtColourGreen: col = COL_Green; break; +case TxtColourMagenta: col = COL_Magenta; break; +case TxtColourYellow: col = COL_Yellow; break; +case TxtColourRed: col = COL_Red; break; +case TxtColourWhite: col = COL_White; break; +case TxtColourPink: col = COL_Pink; break;// 0x00FF4040; break; +case TxtColourOrange: col = COL_Orange; break; +case TxtColourLightBlue: col = COL_LightBlue; break;// 0x004040FF; break; +case TxtColourLightGreen: col = COL_LightGreen; break;// 0x0040FF40; break; +case TxtColourPaleYellow: col = COL_PaleYellow; break;// 0x00FFFF40; break; +case TxtColourTransparent: col = COL_Transparent; break; +default: col = NO_COLOUR_DEFINED; + } + return (col); } - /******************************************************************************* $Function: @@ -1808,36 +1792,35 @@ int colDisplayType; U32 fgd,bgd; - col = resources_getColourFromText(txtId); - if (col == NO_COLOUR_DEFINED) - { - getDisplayData(txtId, &colDisplayType, &colType,&colFgdSelect); - getDataColour(colDisplayType, colType, &fgd, &bgd); - switch (colFgdSelect) - { - case FGD_COL: col = fgd; break; - case BGD_COL: col = bgd; break; - default: break; - } - } - if (col != NO_COLOUR_DEFINED) - { - if (col!=COL_Transparent) - { - dspl_SetFgdColour( col ); - dspl_SetBgdColour( (~col) & 0x00FFFFFF ); - } - else - { - dspl_SetFgdColour( COL_Black ); - dspl_SetBgdColour( COL_Magenta ); + col = resources_getColourFromText(txtId); + if (col == NO_COLOUR_DEFINED) + { + getDisplayData(txtId, &colDisplayType, &colType,&colFgdSelect); + getDataColour(colDisplayType, colType, &fgd, &bgd); + switch (colFgdSelect) + { + case FGD_COL: col = fgd; break; + case BGD_COL: col = bgd; break; + default: break; + } + } + if (col != NO_COLOUR_DEFINED) + { + if (col!=COL_Transparent) + { + dspl_SetFgdColour( col ); + dspl_SetBgdColour( (~col) & 0x00FFFFFF ); + } + else + { + dspl_SetFgdColour( COL_Black ); + dspl_SetBgdColour( COL_Magenta ); - } - } + } + } } - /******************************************************************************* $Function: @@ -1853,46 +1836,45 @@ *******************************************************************************/ int res_getTitleHeight( void ) { - if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) - { - return(TITLE_HEIGHT_LATIN); - } - else - { - return(TITLE_HEIGHT_CHINESE); - } + if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) + { + return(TITLE_HEIGHT_LATIN); + } + else + { + return(TITLE_HEIGHT_CHINESE); + } } /*Function added for SPr 1442*/ /******************************************************************************* - $Function: string_len_in_bytes + $Function: string_len_in_bytes - $Description: internal function which returns th length of a string in bytes + $Description: internal function which returns th length of a string in bytes - $Returns: length of string + $Returns: length of string - $Arguments: string, maximum possibel length, whether unicode or not + $Arguments: string, maximum possibel length, whether unicode or not *******************************************************************************/ int string_len_in_bytes(char* string, int max_len, int unicode) -{ int i; - int length=0; - /* if unicode, nee to check for double-NULL termination*/ - if (string[0] == (char)0x80 || unicode== TRUE) /*a0393213 lint warnings removal - typecast done*/ - { - for(i=0; i < max_len; i+=2) - { if (string[i] == 0 && string[i+1]==0) - { length = i; - break; - } - } - return length; +{ int i; + int length=0; + /* if unicode, nee to check for double-NULL termination*/ + if (string[0] == (char)0x80 || unicode== TRUE) /*a0393213 lint warnings removal - typecast done*/ + { + for(i=0; i < max_len; i+=2) + { if (string[i] == 0 && string[i+1]==0) + { length = i; + break; + } + } + return length; - } + } - else/*just use standard function*/ - { return strlen(string); - } - + else/*just use standard function*/ + { return strlen(string); + } } #ifdef LSCREEN @@ -1903,112 +1885,112 @@ /*Function added for SPr 1442*/ /******************************************************************************* - $Function: resources_truncate_to_screen_width + $Function: resources_truncate_to_screen_width - $Description: Copies and truncates the input string to the passed screen width - and puts it into the output string. - Note: this function only works for Unicode strings which have a unicode - tag at the beginning, or if the unicode parameter is set to TRUE. - If the input length is zero, then this function calculates - the actual length of the input string. + $Description: Copies and truncates the input string to the passed screen width + and puts it into the output string. + Note: this function only works for Unicode strings which have a unicode + tag at the beginning, or if the unicode parameter is set to TRUE. + If the input length is zero, then this function calculates + the actual length of the input string. - $Returns: length of truncated string + $Returns: length of truncated string - $Arguments: input sctring and it's length, ouput string and it's length, - screen width desired (pixels), unicode flag (TRUE/FALSE) + $Arguments: input sctring and it's length, ouput string and it's length, + screen width desired (pixels), unicode flag (TRUE/FALSE) *******************************************************************************/ //GW #1541 16/01/03 - Modified code to first test if string will fit and return string if it does. int resources_truncate_to_screen_width(char* IpStr, int IpLen, char* OpStr, int OpLen, - int ScreenWidth, BOOL unicode) + int ScreenWidth, BOOL unicode) { - int start_position = 0; - #ifdef LSCREEN - char* ellipse_str = "..."; - #else - char* ellipse_str = "."; - #endif - int ellipsis_len = dspl_GetTextExtent(ellipse_str, 0); - int i; - int j; - int calc_input_len = 0; - int no_of_chars = 0; - int len; + int start_position = 0; + #ifdef LSCREEN + char* ellipse_str = "..."; + #else + char* ellipse_str = "."; + #endif + int ellipsis_len = dspl_GetTextExtent(ellipse_str, 0); + int i; + int j; + int calc_input_len = 0; + int no_of_chars = 0; + int len; - memset(OpStr, 0, OpLen); + memset(OpStr, 0, OpLen); - /*if input string length 0, we calculate the string len ourselves*/ - if (IpLen == 0) - { calc_input_len = string_len_in_bytes(IpStr, 256, unicode); - } - else - { calc_input_len = IpLen; - } /*Test for string alrady fitting */ + /*if input string length 0, we calculate the string len ourselves*/ + if (IpLen == 0) + { calc_input_len = string_len_in_bytes(IpStr, 256, unicode); + } + else + { calc_input_len = IpLen; + } /*Test for string alrady fitting */ - if (dspl_GetTextExtent(IpStr, 0) < ScreenWidth) - { - for (i=0; i<OpLen && i<calc_input_len; ) - { //if length of string less that width of screen - //if unicode copy two chars - if (IpStr[0] == (char)0x80 || unicode == TRUE)/*a0393213 lint warnings removal-typecasting done*/ - { - OpStr[i] = IpStr[i]; - OpStr[i+1] = IpStr[i+1]; - i+=2; - } - else - { OpStr[i] = IpStr[i]; - i++; - } - } - return string_len_in_bytes(OpStr, OpLen, unicode); - } - /*SPR 1541, use function dspl_GetNcharToFit rather than loop to work - out how many chars will fit in line*/ - no_of_chars = dspl_GetNcharToFit (IpStr, ScreenWidth - ellipsis_len); - /*copy characters*/ - if (no_of_chars < OpLen) - memcpy(OpStr, IpStr, no_of_chars); - else - memcpy(OpStr, IpStr, OpLen); + if (dspl_GetTextExtent(IpStr, 0) < ScreenWidth) + { + for (i=0; i<OpLen && i<calc_input_len; ) + { //if length of string less that width of screen + //if unicode copy two chars + if (IpStr[0] == (char)0x80 || unicode == TRUE)/*a0393213 lint warnings removal-typecasting done*/ + { + OpStr[i] = IpStr[i]; + OpStr[i+1] = IpStr[i+1]; + i+=2; + } + else + { OpStr[i] = IpStr[i]; + i++; + } + } + return string_len_in_bytes(OpStr, OpLen, unicode); + } + /*SPR 1541, use function dspl_GetNcharToFit rather than loop to work + out how many chars will fit in line*/ + no_of_chars = dspl_GetNcharToFit (IpStr, ScreenWidth - ellipsis_len); + /*copy characters*/ + if (no_of_chars < OpLen) + memcpy(OpStr, IpStr, no_of_chars); + else + memcpy(OpStr, IpStr, OpLen); - /*SPR 1541, end*/ - TRACE_EVENT_P1("trunc string len:%d", dspl_GetTextExtent(OpStr, 0)); - /*we need to add the ellipsis if we've truncated the string*/ - if(string_len_in_bytes(OpStr, OpLen, unicode) < calc_input_len) - { /*if unicode*/ - if (OpStr[0] == (char)0x80|| unicode == TRUE) /*a0393213 lint warnings removal - typecasting done*/ - { - if (string_len_in_bytes(OpStr, OpLen, TRUE) < (OpLen -2*TRUNC_LENGTH+2)) - { start_position = string_len_in_bytes(OpStr, OpLen, unicode); - } - else - { start_position = OpLen - 2*TRUNC_LENGTH+2;} - TRACE_EVENT_P1("Adding chars at %d", start_position); - for(j=start_position; j < start_position+2*TRUNC_LENGTH; j+=2) - { OpStr[j] = 0; - OpStr[j + 1] = '.'; - } - /*add NULL termination*/ - OpStr[start_position+ 2*TRUNC_LENGTH] = NULL; - OpStr[start_position+ 2*TRUNC_LENGTH+1] = NULL; - } - else /*if ASCII*/ - { len = strlen(OpStr); - if (len < (OpLen -(TRUNC_LENGTH+1))) - { start_position = string_len_in_bytes(OpStr, OpLen, FALSE); - } - else - { start_position = OpLen - TRUNC_LENGTH;} - memcpy(&OpStr[start_position], ellipse_str, TRUNC_LENGTH); + /*SPR 1541, end*/ + TRACE_EVENT_P1("trunc string len:%d", dspl_GetTextExtent(OpStr, 0)); + /*we need to add the ellipsis if we've truncated the string*/ + if(string_len_in_bytes(OpStr, OpLen, unicode) < calc_input_len) + { /*if unicode*/ + if (OpStr[0] == (char)0x80|| unicode == TRUE) /*a0393213 lint warnings removal - typecasting done*/ + { + if (string_len_in_bytes(OpStr, OpLen, TRUE) < (OpLen -2*TRUNC_LENGTH+2)) + { start_position = string_len_in_bytes(OpStr, OpLen, unicode); + } + else + { start_position = OpLen - 2*TRUNC_LENGTH+2;} + TRACE_EVENT_P1("Adding chars at %d", start_position); + for(j=start_position; j < start_position+2*TRUNC_LENGTH; j+=2) + { OpStr[j] = 0; + OpStr[j + 1] = '.'; + } + /*add NULL termination*/ + OpStr[start_position+ 2*TRUNC_LENGTH] = NULL; + OpStr[start_position+ 2*TRUNC_LENGTH+1] = NULL; + } + else /*if ASCII*/ + { len = strlen(OpStr); + if (len < (OpLen -(TRUNC_LENGTH+1))) + { start_position = string_len_in_bytes(OpStr, OpLen, FALSE); + } + else + { start_position = OpLen - TRUNC_LENGTH;} + memcpy(&OpStr[start_position], ellipse_str, TRUNC_LENGTH); - } - } + } + } TRACE_EVENT_P1("trunc string len post ellipsis:%d", dspl_GetTextExtent(OpStr, 0)); - return string_len_in_bytes(OpStr, OpLen, unicode); + return string_len_in_bytes(OpStr, OpLen, unicode); } @@ -2033,30 +2015,30 @@ #ifdef COLOURDISPLAY int colMenuSelected(MfwMnu* mnu, MfwMnuItem* mnuItem) { - T_MFW_HND win = mfw_parent(mfw_header()); - int mnuId; - int colDisplayType; - int colType; - int colFgdSelect = FALSE; - int mnuColour; - int storedMenuId; + T_MFW_HND win = mfw_parent(mfw_header()); + int mnuId; + int colDisplayType; + int colType; + int colFgdSelect = FALSE; + int mnuColour; + int storedMenuId; - //GW Read the stored menu Id from generic procedure - storedMenuId = MmiBook_getStoredOption(); - mnuId = (int)mnuItem->str; + //GW Read the stored menu Id from generic procedure + storedMenuId = MmiBook_getStoredOption(); + mnuId = (int)mnuItem->str; - mnuColour=resources_getColourFromText(mnuId); + mnuColour=resources_getColourFromText(mnuId); - getDisplayData(storedMenuId, &colDisplayType, &colType,&colFgdSelect); + getDisplayData(storedMenuId, &colDisplayType, &colType,&colFgdSelect); - setDataColour(colDisplayType, colType, colFgdSelect,mnuColour); + setDataColour(colDisplayType, colType, colFgdSelect,mnuColour); - info_screen(win, TxtColour, TxtSelected, 0); + info_screen(win, TxtColour, TxtSelected, 0); - // API/GW - Saved the selected colour so the flash file structure after selected - flash_data_write(colourFileDir, colourFileName, colArray, sizeof(colArray)); + // API/GW - Saved the selected colour so the flash file structure after selected + flash_data_write(colourFileDir, colourFileName, colArray, sizeof(colArray)); - return(0); + return(0); } #endif @@ -2064,13 +2046,13 @@ /******************************************************************************* - $Function: set_SIMToolkit_title_string + $Function: set_SIMToolkit_title_string - $Description: Changes the value of the SAT main menu entry title. + $Description: Changes the value of the SAT main menu entry title. $Returns: - $Arguments: New SAT Title. + $Arguments: New SAT Title. *******************************************************************************/ @@ -2082,45 +2064,45 @@ /*API - 27/07/03 - CQ10203 - New function to reset the SMS VP in flash on factory reset*/ /******************************************************************************* - $Function: resetSMSValidityPeriod + $Function: resetSMSValidityPeriod - $Description: Resets the value of the SMS VP in flash + $Description: Resets the value of the SMS VP in flash $Returns: - $Arguments: None + $Arguments: None *******************************************************************************/ void resetSMSValidityPeriod() { /* x0045876, 14-Aug-2006 (WR - "sms_settings" was set but never used) */ #ifndef NEPTUNE_BOARD - T_MFW_SMS_INFO sms_settings; + T_MFW_SMS_INFO sms_settings; #endif - TRACE_EVENT("resetSMSValidityPeriod()"); + TRACE_EVENT("resetSMSValidityPeriod()"); - if ( FFS_flashData.vp_rel != VP_REL_24_HOURS) - FFS_flashData.vp_rel = VP_REL_24_HOURS; + if ( FFS_flashData.vp_rel != VP_REL_24_HOURS) + FFS_flashData.vp_rel = VP_REL_24_HOURS; /* x0045876, 14-Aug-2006 (WR - "sms_settings" was set but never used) */ #ifndef NEPTUNE_BOARD - /*NDH - 13/01/04 - CQ16753 - Propogate the Validity Period Settings to the ACI */ - sms_settings.vp_rel = FFS_flashData.vp_rel; + /*NDH - 13/01/04 - CQ16753 - Propogate the Validity Period Settings to the ACI */ + sms_settings.vp_rel = FFS_flashData.vp_rel; #endif #ifdef NEPTUNE_BOARD - //(void)sms_set_val_period(&sms_settings); /* NEPTUNE: Sumit: temp comment */ + //(void)sms_set_val_period(&sms_settings); /* NEPTUNE: Sumit: temp comment */ #else - (void)sms_set_val_period(&sms_settings); + (void)sms_set_val_period(&sms_settings); #endif - /*NDH - 13/01/04 - CQ16753 - END */ + /*NDH - 13/01/04 - CQ16753 - END */ } /*API - CQ10203 - END*/ + /******************************************************************************* End of File *******************************************************************************/ -