diff src/ui/bmi/mmiBand.c @ 92:c0052fe355d3

src/ui/bmi/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 08 Nov 2020 06:39:16 +0000
parents 67bfe9f274f6
children 63dffa10b00a
line wrap: on
line diff
--- a/src/ui/bmi/mmiBand.c	Sun Nov 08 05:12:05 2020 +0000
+++ b/src/ui/bmi/mmiBand.c	Sun Nov 08 06:39:16 2020 +0000
@@ -2,34 +2,34 @@
 
 					CONDAT (UK)
 
-********************************************************************************                                                                              
+********************************************************************************
 
  This software product is the property of Condat (UK) Ltd and may not be
- disclosed to any third party without the express permission of the owner.                                 
-                                                                              
+ disclosed to any third party without the express permission of the owner.
+
 ********************************************************************************
 
- $Project name:	Basic MMI                                                      
- $Project code:	BMI                                                    
+ $Project name:	Basic MMI
+ $Project code:	BMI
  $Module:		Frequency band selection
  $File:		    MmiBand.c
- $Revision:		1.0                                                       
-                                                                              
- $Author:		Condat(UK)                                                         
- $Date:		    03/04/02                                                      
-                                                                               
+ $Revision:		1.0
+
+ $Author:		Condat(UK)
+ $Date:		    03/04/02
+
 ********************************************************************************
-                                                                              
+
  Description:
 
-    This provides the functionality for menu options to select and display the current 
+    This provides the functionality for menu options to select and display the current
     band used.
-                        
+
 ********************************************************************************
  $History: MmiBand.c
 
-	03/04/02			Original Condat(UK) BMI version.	
-	   
+	03/04/02			Original Condat(UK) BMI version.
+
  $End
 
 *******************************************************************************/
@@ -38,9 +38,9 @@
 
 
 /*******************************************************************************
-                                                                              
+
                                 Include files
-                                                                              
+
 *******************************************************************************/
 #define ENTITY_MFW
 
@@ -140,14 +140,14 @@
 	MNUATTRSPARE};
 
 /* List of all possible frequencies */
-	
+
 static const int band_list[MAX_NUMBER_OF_FREQS] = {
 	MFW_BAND_GSM_900,
 	MFW_BAND_DCS_1800,
 	MFW_BAND_PCS_1900,
 	MFW_BAND_E_GSM,
 	MFW_BAND_GSM_850
-};	
+};
 
 /* SPR#998 - SH - Static handle to allow callback functions to access data */
 static T_FREQ_INFO *current_data = NULL;
@@ -177,12 +177,12 @@
  $Function:    	mmi_band_radio_mode_change_auto
 
  $Description:	Changes multiband mode to automatic.  Selected from menu.
- 
+
  $Returns:		status int
 
  $Arguments:	menu and menu item (not used)
- 				
- 
+
+
 *******************************************************************************/
 
 int mmi_band_radio_mode_change_auto(MfwMnu* m, MfwMnuItem* i)
@@ -191,14 +191,14 @@
 //	T_MFW_BAND_MODE		mode;  // RAVI
 
 	TRACE_FUNCTION("mmi_band_radio_mode_change_auto");
-	
+
 	if (band_radio_mode_switch(MFW_BAND_MODE_Auto, 0) >= MFW_BAND_OK)
 	{
 		ShowMessage(parent, TxtDone, TxtNull);
 	}
 	else
 		ShowMessage(parent, TxtFailed, TxtNull);
-	
+
 	return MFW_EVENT_CONSUMED;
 }
 
@@ -208,12 +208,12 @@
  $Function:    	mmi_band_radio_mode_change_manual
 
  $Description:	Gets a list of available manual bands.  Selected from menu.
- 
+
  $Returns:		status int
 
  $Arguments:	menu and menu item (not used)
- 				
- 
+
+
 *******************************************************************************/
 
 int mmi_band_radio_mode_change_manual(MfwMnu* m, MfwMnuItem* i)
@@ -222,7 +222,7 @@
 	T_MFW_BAND_MODE		maxMode;
 	UBYTE				available_freqs;
 	T_MFW_HND			win;
-	
+
 	if (band_get_radio_modes(&maxMode, &available_freqs) >= MFW_BAND_OK)
 	{
 		if (maxMode >= MFW_BAND_MODE_Manual)		/* Make sure manual is an accepted mode */
@@ -236,7 +236,7 @@
 			ShowMessage(parent, TxtManual, TxtNotSupported);
 		}
 	}
-	
+
 	return MFW_EVENT_CONSUMED;
 }
 
@@ -246,19 +246,19 @@
  $Function:    	mmi_band_radio_mode_info
 
  $Description:	Get current band setting
- 
+
  $Returns:		status int
 
  $Arguments:	menu and menu item (not used)
- 				
- 
+
+
 *******************************************************************************/
 
 int mmi_band_radio_mode_info(MfwMnu* m, MfwMnuItem* i)
 {	T_MFW_HND			parent = mfwParent( mfw_header());
 
 	mmi_band_display_status(parent);
-			
+
 	return MFW_EVENT_CONSUMED;
 }
 
@@ -272,12 +272,12 @@
  $Function:    	Freq2Str
 
  $Description:	Converts the band enum into an appropraite string
- 
+
  $Returns:		string
 
  $Arguments:	Band (integer)
- 				
- 
+
+
 *******************************************************************************/
 
 char* Freq2Str(int freq)
@@ -299,12 +299,12 @@
  $Function:    	Freq2Str
 
  $Description:	Converts the band enum into an appropraite string ID
- 
+
  $Returns:		string ID
 
  $Arguments:	Band (integer)
- 				
- 
+
+
 *******************************************************************************/
 
 int Freq2StrID(int freq)
@@ -327,7 +327,7 @@
  $Description:	Displays the current band status
  $Returns:		none
  $Arguments:	parent - parent window
- 
+
 *******************************************************************************/
 
 static int mmi_band_display_status(T_MFW_HND parent)
@@ -335,7 +335,7 @@
 	/* SPR#998 - SH - Now store mode in data->mode */
     T_MFW_WIN		*win_data = ((T_MFW_HDR *) parent)->data;
     T_FREQ_INFO		*data = (T_FREQ_INFO *)win_data->user;
-	
+
 	if (band_get_current_radio_mode(&data->mode, &data->selected_freqs) >= MFW_BAND_OK)
 	{
 		if (data->mode == MFW_BAND_MODE_Auto)
@@ -351,7 +351,7 @@
 	{
 		ShowMessage(parent, TxtReadError, TxtNull);
 	}
-		
+
 	return 1;  // RAVI - Changed return to return 1.
 }
 
@@ -364,7 +364,7 @@
  $Arguments:	parent - parent window
  				identifier - length of status string
  				reason - not used
- 
+
 *******************************************************************************/
 
 static int mmi_band_display_status_cb(T_MFW_HND parent, USHORT identifier, USHORT reason)
@@ -379,7 +379,7 @@
  $Description:	Creates window for frequency list
  $Returns:		window created
  $Arguments:	parent window
- 
+
 *******************************************************************************/
 
 static T_MFW_HND  mmi_band_build_freq_list( MfwHnd parent_window, UBYTE available_freqs)
@@ -400,8 +400,8 @@
 	}
 
 	current_data = data;	/* SPR#998 - SH - Store handle for data; used by callbacks */
-	
-    /* 
+
+    /*
      * connect the dialog data to the MFW-window
      */
 
@@ -411,7 +411,7 @@
     win->user					= (void *)data;
     data->parent				= parent_window;
 	data->available_freqs		= available_freqs;
-		
+
 	winShow(data->freq_win);
     /*
      * return window handle
@@ -426,13 +426,13 @@
  $Function:    	mmi_band_freq_exec_cb
 
  $Description:	Exec callback function of the information Numbers window
- 
+
  $Returns:		none
 
  $Arguments:	win - window handler
  				event - mfw event
  				parameter - optional data.
- 
+
 *******************************************************************************/
 
 void mmi_band_freq_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
@@ -445,9 +445,9 @@
 //	char			*menuItem;  // RAVI
 	/* SPR#998 - SH - Remove code that implements custom checkbox implementaton,
 	 * as checkboxes now handled by mfw */
-	
+
     TRACE_FUNCTION ("mmi_band_freq_exec_cb()");
-	
+
     switch (event)
 	{
 		case BAND_INIT:
@@ -469,9 +469,9 @@
 			/* Run through the list of possible frequencies first to obtain
 			 the number of frequencies permitted (how many will be in the menu) */
 			/* SPR#998 - SH - Removed custom checkbox implementation */
-			
+
 			numberOfEntries = 0;
-			
+
 			for (index=0; index<MAX_NUMBER_OF_FREQS; index++)
 			{
 				if (data->available_freqs & band_list[index])
@@ -482,7 +482,7 @@
 			}
 
 			/* If there are no entries, show "Empty List" message and exit */
-			
+
 			if (numberOfEntries==0)
 			{
 				ShowMessage(data->parent, TxtEmptyList, TxtNull);
@@ -492,21 +492,21 @@
 
 			/* Get the status of all the frequencies */
 			/* SPR#998 - SH - Use data->mode */
-			
+
 			if (band_get_current_radio_mode(&data->mode, &data->selected_freqs) >= MFW_BAND_OK)
 			{
 				/* If we're not in manual choose manual */
-				
+
 				if (data->mode!=MFW_BAND_MODE_Manual)
 				{
 					data->selected_freqs = data->available_freqs;	/* SH - default when choosing manual is all */
 					band_radio_mode_switch(MFW_BAND_MODE_Manual, data->selected_freqs);
 				}
-			
+
 				/* Allocate the memory for the list structure */
-				
+
 				data->no_of_entries = numberOfEntries;
-				
+
 				data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( numberOfEntries * sizeof(T_MFW_MNU_ITEM) );
 
 				if(!data->menu_list_data->List)
@@ -516,17 +516,17 @@
 				}
 
 				/* Allocate memory for the menu texts, and populate the list structure */
-				
+
 				numberOfEntries = 0;
-				
+
 				for (index=0; index<MAX_NUMBER_OF_FREQS; index++)
-				{					
+				{
 					if (data->available_freqs & band_list[index])
 					{
 						/* SPR#998 - SH - Removed code, checkboxes now handled by MFW */
 						mnuInitDataItem(&data->menu_list_data->List[numberOfEntries]);
 						/* Here we specify the function that checks and unchecks the checkboxes */
-						data->menu_list_data->List[numberOfEntries].func = mmi_band_menu_func;	
+						data->menu_list_data->List[numberOfEntries].func = mmi_band_menu_func;
 						data->menu_list_data->List[numberOfEntries].str  = (char *)Freq2StrID(band_list[index]);
 						/* Here we specify the function that returns the checkbox status of any menu item */
 						data->menu_list_data->List[numberOfEntries].flagFunc = mmi_band_menu_flag;
@@ -546,7 +546,7 @@
 				data->menu_list_data->Strings = FALSE;		/* SPR#998 - SH - We no longer alter the menu strings */
 		 		data->menu_list_data->Attr   = (MfwMnuAttr*)&Freq_menuAttrib;
 				data->menu_list_data->autoDestroy    = FALSE;
-				
+
 		 		/* Create the dynamic menu window */
 		  	    listDisplayListMenu(win, data->menu_list_data,(ListCbFunc)mmi_band_freq_list_cb,0);
 			}
@@ -554,28 +554,28 @@
 			{
 				ShowMessage(win, TxtReadError, TxtNull);
 			}
-		
+
 			break;
 
 		case BAND_DESTROY:
 			TRACE_EVENT("mmi_band_freq_exec_cb() Event:BAND_DESTROY");
-		    /*     
+		    /*
 		     * Free Memory
 		     */
 
 		     /* SPR#998 - SH - No longer free allocated strings here */
-		     
+
 			numberOfEntries = data->no_of_entries;
 
 			if (data->menu_list_data != NULL)
 			{
 				FREE_MEMORY ((void *)data->menu_list_data->List, numberOfEntries * sizeof (T_MFW_MNU_ITEM));
-			    FREE_MEMORY ((void *)data->menu_list_data, sizeof (ListMenuData));			    
+			    FREE_MEMORY ((void *)data->menu_list_data, sizeof (ListMenuData));
 			}
 
 			FREE_MEMORY ((void *)data, sizeof (T_FREQ_INFO));
 			break;
-			
+
 		default:
 		    break;
 	}
@@ -587,9 +587,9 @@
  $Function:    	mmi_band_freq_list_cb
 
  $Description:	Callback function for the info num list.
- 
+
  $Returns:		none
- 
+
  $Arguments:	Parent - parent window.
  				ListData - Menu item list
 *******************************************************************************/
@@ -598,12 +598,12 @@
 {
 	/* SPR#998 - SH - Selecting a checkbox is handled now by the checkbox functions,
 	 * so much less is required here */
-	 
+
     T_MFW_WIN			*win_data	= ((T_MFW_HDR *)Parent)->data;
     T_FREQ_INFO 		*data		= (T_FREQ_INFO *)win_data->user;
 
 	TRACE_FUNCTION("mmi_band_freq_list_cb");
-	
+
 	if ((ListData->Reason EQ LISTS_REASON_BACK) || (ListData->Reason EQ LISTS_REASON_CLEAR))
 	{
 		listsDestroy(ListData->win);
@@ -621,7 +621,7 @@
  $Function:    	mmi_band_freq_list_destroy
 
  $Description:	Destroy the info num window.
- 			
+
  $Returns:		none
 
  $Arguments:	own_window- current window
@@ -631,9 +631,9 @@
 {
     T_MFW_WIN		*win_data;
     T_FREQ_INFO		*data;
-	
+
     TRACE_FUNCTION ("mmi_band_freq_list_destroy()");
-	
+
     if (own_window)
 	{
 	    win_data = ((T_MFW_HDR *)own_window)->data;
@@ -641,15 +641,15 @@
 
 	    if (data)
 		{
-		    /*     
+		    /*
 		     * Free Memory
 		     */
 			SEND_EVENT (own_window, BAND_DESTROY, 0, 0);
 		    /*
 		     * Delete WIN handler
-		     */ 
+		     */
 		    win_delete (own_window);
-		    
+
 		    current_data = NULL;	/* SPR#998 - SH - Set the data handle to NULL */
 		}
 	    else
@@ -665,12 +665,12 @@
  $Function:    	mmi_band_freq_win_cb
 
  $Description:	Window callback function for the info numbers window.
- 
+
  $Returns:		none
 
  $Arguments:	w - mfw window handler
  				e - mfw event
- 				
+
 *******************************************************************************/
 
 static int mmi_band_freq_win_cb (MfwEvt e, MfwWin *w)    /* yyy window event handler */
@@ -680,10 +680,10 @@
 	{
 		case MfwWinVisible:  /* window is visible  */
 			break;
-		case MfwWinFocussed: /* input focus / selected   */	
-		case MfwWinDelete:   /* window will be deleted   */   
-			
-		default:	    
+		case MfwWinFocussed: /* input focus / selected   */
+		case MfwWinDelete:   /* window will be deleted   */
+
+		default:
 			return MFW_EVENT_REJECTED;
 	}
 	return MFW_EVENT_CONSUMED;
@@ -706,13 +706,13 @@
 *******************************************************************************/
 
 int mmi_band_menu_func(MfwMnu* menu, MfwMnuItem* item)
-{	
+{
     T_FREQ_INFO *data = current_data;
-    
+
 	TRACE_FUNCTION("mmi_band_menu_func");
-	
+
 	data->selected_freqs ^= data->type[menu->lCursor[menu->level]];	/* Toggle this band */
-		
+
 	if (band_radio_mode_switch(MFW_BAND_MODE_Manual, data->selected_freqs) >= MFW_BAND_OK)
 	{
 		mnuUpdate(menu);
@@ -721,7 +721,7 @@
 	{
 		data->selected_freqs ^= data->type[menu->lCursor[menu->level]]; /* Undo change */
 		ShowMessage(data->freq_win, TxtFailed, TxtNull);
-	}	   
+	}
 
 	return 1;
 }
@@ -746,13 +746,13 @@
 
 	TRACE_FUNCTION("mmi_band_menu_flag()");
  	TRACE_EVENT_P1("Freq info data: %x", data);
- 	
+
 	/* Identify current menu option */
 
 	currentOption = mnuIdentify(attr, item);
 
 	/* If we find it, work out if it's checked or not */
-	
+
 	if (currentOption>-1)
 	{
 		if (data->selected_freqs & data->type[currentOption])