menu.h File Reference


Detailed Description

Menu module C header file.

REVISION

Definition in file menu.h.

#include "../feature.h"
#include "../LCD/lcd.h"
#include "tmplt.h"

Include dependency graph for menu.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  st_SBAR
 Scroll bar structure definition. More...
struct  st_VBAR
 Value bar structure definition. More...
struct  st_BLINK_REGIST
 BLINK registration structure definition. More...
struct  st_SBAR_REGIST
 Scroll bar registration structure definition. More...
struct  st_VBAR_REGIST
 Value bar registration structure definition. More...
struct  st_LISTMENU
 List menu control structure. More...
struct  st_MSGBOX
 Message box control structure. More...
struct  st_VOLUMEMENU
 Volume window control structure. More...
struct  st_MYFIGAINMENU
 Myfi gain window control structure. More...
struct  st_MYFICHANNELMENU
 Myfi channel window control structure. More...
struct  st_XIMENU
 XIM window control structure. More...
struct  st_PLAYMENU
 Playback menu control structure. More...
struct  st_CONTRAST
 LCD contrast menu control strucure. More...
struct  st_EQMENU
 EQ control menu structure. More...
struct  st_DJMENU
 DJ control menu structure. More...
struct  st_DATETIMEMENU
 Datetime menu structure. More...
struct  st_MENUTMPLT
 Menu template structure definitions. More...
struct  st_MENU_REGIST
 Menu registration structure definition. More...
struct  st_MENU
 Menu module global data structure definition. More...

Defines

#define _MENU_ENABLE
 Define to enable/disable all menu code.

Enumerations

enum  DISPPATTERN
 MENU display pattern enumeration definition.
enum  MSGBX_ID
 Message box ID definition. More...
enum  XIMWIN_ID
 XIM window ID definition. More...
enum  MENUACTION {
  MENU_2PREV = 0, MENU_2NEXT = 1, MENU_SELECT = 2, MENU_BACK = 3, MENU_CLOSE = 4, MENU_TPREV = 5,
  MENU_TNEXT = 6, MENU_TSELECT = 7, MENU_TIME_UPDT = 8, MENU_FWD = 9, MENU_RWD = 10, MENU_TXTSCROLL = 11,
  MENU_STORE = 12, MENU_RECALL = 13, MENU_2TOP = 14, MENU_2BOTTOM = 15, MENU_JUMPDN = (int)0x8000, MENU_JUMPUP = (int)0xC000
}
 Menu action ID enumeration definition. More...
enum  STBAR_ACTION
 Status bar action enumeration definition.
enum  ITEMICONCTL
 List text menu item icon control enumeration definition.
enum  MBX_BUTTON
 Message box button enumeration. More...
enum  MBX_RETBUTTON {
  BTN_NULL, BTN_OK, BTN_CANCEL, BTN_YES, BTN_NO, BTN_PCDELETE,
  BTN_NEUROS
}
 Message box returned button. More...

Functions

void MENU_action (HMENU, MENUACTION)
 Function responds to various action request posted to the specified MENU.
HMENU MENU_create (void *)
 Function creates a menu handle.
void MENU_init (void)
 Function initialized the MENU module.
BOOL MENU_isValid (HMENU)
 Function checks to see if given menu handle is valid.
void MENU_update (HMENU, USHORT, ULONG, BOOL)
 Function sends message to update menu display.
st_FIELDMENU_getField (HMENU, USHORT)
 Function fetches the specified MENU field pointer.
void * MENU_getObj (HMENU)
 Function returns the menu control object.
void MENU_refresh (HMENU)
 Function sends message to refresh menu display.
void MENU_statusBar (STBAR_ACTION, USHORT)
 Function manages the status bar.
void MENU__nullAction (HMENU, MENUACTION)
 Function serves as the NULL action handle.
void MENU__preserve (HMENU)
 Function checks to preserve MENU to support over-lapped display.
void MENU__refresh (HMENU)
 Function sends message to refresh menu display.
void MENU__restore (HMENU)
 Function checks to restore MENU to support over-lapped display.
HMENU MENU__createHdl (int)
 Function creates a menu handle based on index.
void MENU__createContrastMenu (HMENU)
 Function creates the LCD contrast menu display.
void MENU__createPlayMenu (HMENU)
 Function creates a standard player display.
void MENU__createShadow (st_RECT *)
 Function creates shadowed window.
int MENU__getIdx (HMENU)
 Function returns the menu index from a given menu handle.
void MENU__deleteHdl (HMENU)
 Function removes a menu handle from the registration.
HSBAR MENU__sbarInit (HMENU, st_POINT *, st_RECT *, UINT, UINT, UINT, UINT, UINT)
 Function creates a scroll bar inside of a MENU.
void MENU__sbarDelete (HSBAR)
 Function disables the scroll bar and releases proper data object.
void MENU__sbarReposition (HSBAR, short)
 Function repositions the scroll bar.
void MENU__vbarDelete (HVBAR)
 Function disables the value bar and releases proper data object.
HVBAR MENU__vbarInit (HMENU, st_POINT *, st_RECT *, ULONG, ULONG, UINT, UINT)
 Function creates a value bar inside of a MENU.
void MENU__vbarReposition (HVBAR, ULONG)
 Function repositions the value bar.

Variables

unsigned int MENU_buf []
 Menu setup data buffer, which is used to pass menu template data.


Enumeration Type Documentation

enum MBX_BUTTON
 

Message box button enumeration.

NOTE: this definition has to match that in tmplt_msgbox.inc.

Definition at line 232 of file menu.h.

00233 {
00234     MBX_BTN_NULL            = 0,
00235     MBX_BTN_OK              = 1,
00236     MBX_BTN_OKCANCEL        = 2,
00237     MBX_BTN_YESNO           = 3,
00238     MBX_BTN_NEUROSCANCELPC  = 4,
00239     MBX_BTN_PCCANCEL        = 5
00240 } MBX_BUTTON;

enum MBX_RETBUTTON
 

Message box returned button.

Enumeration values:
BTN_NULL  0
BTN_OK  1
BTN_CANCEL  2
BTN_YES  3
BTN_NO  4
BTN_PCDELETE  5
BTN_NEUROS  6

Definition at line 244 of file menu.h.

00245 {
00246     BTN_NULL,       
00247     BTN_OK,         
00248     BTN_CANCEL,     
00249     BTN_YES,        
00250     BTN_NO,         
00251     BTN_PCDELETE,   
00252     BTN_NEUROS      
00253 } MBX_RETBUTTON;

enum MENUACTION
 

Menu action ID enumeration definition.

Enumeration values:
MENU_2PREV  Go to previous item.
MENU_2NEXT  Go to next item.
MENU_SELECT  Select current active item function.
MENU_BACK  Go back.
MENU_CLOSE  Close display.
MENU_TPREV  Go to previous but do not refresh display.
MENU_TNEXT  Go to next but do not refresh display.
MENU_TSELECT  Select current item but do not refreshing display.
MENU_TIME_UPDT  Specially handle time stamp in DJ menu.
MENU_FWD  Specially handle forward button in DJ menu.
MENU_RWD  Specially handle rewind button in DJ menu.
MENU_TXTSCROLL  Scroll menu text left by one character.
MENU_STORE  Store preset.
MENU_RECALL  Recall preset.
MENU_2TOP  Jump to top.
MENU_2BOTTOM  Jump to bottom.
MENU_JUMPDN  Jump up, LSB 14 bits specify the step.
MENU_JUMPUP  Jump down, LSB 14 bits specify the step.

Definition at line 182 of file menu.h.

Referenced by MENU__djControl(), and MENU__listMenuAction().

00183 {
00184     MENU_2PREV  = 0,            
00185     MENU_2NEXT  = 1,            
00186     MENU_SELECT = 2,            
00187     MENU_BACK   = 3,            
00188     MENU_CLOSE  = 4,            
00189     MENU_TPREV  = 5,            
00190     MENU_TNEXT  = 6,            
00191     MENU_TSELECT= 7,            
00192     MENU_TIME_UPDT  = 8,        
00193     MENU_FWD        = 9,        
00194     MENU_RWD        = 10,       
00195     MENU_TXTSCROLL  = 11,       
00196 //DeepB
00197     MENU_STORE      = 12,       
00198     MENU_RECALL     = 13,       
00199     MENU_2TOP       = 14,       
00200     MENU_2BOTTOM    = 15,       
00201     MENU_JUMPDN = (int)0x8000,  
00202     MENU_JUMPUP = (int)0xC000,  
00203     invalid_action
00204 } MENUACTION;

enum MSGBX_ID
 

Message box ID definition.

NOTE: definition has to match that in tmplt_table.inc.

Definition at line 116 of file menu.h.

00117 {
00118     MSGBX_HEADPHONEPLUG     = 0,
00119     MSGBX_DBRECORDNA        = 1,
00120     MSGBX_SYSBUSY           = 2,
00121     MSGBX_SHUTDOWN          = 3,
00122     MSGBX_BKPKSWAPQUERY     = 4,
00123     MSGBX_NANDBAKWAIT       = 5,
00124     MSGBX_NANDRESTOREQUERY  = 6,
00125     MSGBX_NANDRESTOREWAIT   = 7,
00126     MSGBX_NONANDBAKFILE     = 8,
00127     MSGBX_NANDSAVEFAILED    = 9,
00128     MSGBX_SYSWAIT           = 10,   
00129     MSGBX_TIP_PRESET        = 11,
00130     MSGBX_CONTENTSNA        = 12,
00131     MSGBX_CANCELHISI        = 13,
00132     MSGBX_DELETEHISICLIP    = 14,
00133     MSGBX_DELETERECORDFILE  = 15,
00134     MSGBX_ADD2MYMIXDONE     = 16,
00135     MSGBX_REMOVERECORD      = 17,
00136     MSGBX_DELETERECORD      = 18,
00137     MSGBX_DELETEONSYNC      = 19,
00138     MSGBX_RESTOREDEFAULT    = 20,
00139     MSGBX_PLAYLIST_PRESETDONE   = 21,
00140     MSGBX_ARTIST_PRESETDONE     = 22,
00141     MSGBX_ALBUM_PRESETDONE      = 23,
00142     MSGBX_GENRE_PRESETDONE      = 24, 
00143     MSGBX_RECORDING_PRESETDONE  = 25,
00144     MSGBX_SONGS_PRESETDONE      = 26,
00145     MSGBX_PCREQUESTSENT         = 27,
00146     MSGBX_DISKFULL              = 28,
00147     MSGBX_HDDMOUNTFAILURE       = 29,
00148     MSGBX_BATTERYLOW            = 30,
00149     MSGBX_REMOVEQALL            = 31,
00150     MSGBX_REMOVEQRECORD         = 32,
00151     MSGBX_EMPTYQ                = 33,
00152     MSGBX_TIP_PRESETNA          = 34,
00153 //
00154     MSGBX_NOTIMPLEMENTED            = 35,
00155     
00156     MSGBX_DIAG_FORMATDISK,
00157     MSGBX_DIAG_FORMATWAIT,
00158     MSGBX_ASSERT,
00159     MSGBX_ASSERTHW,
00160     InvalidMsgbx
00161 } MSGBX_ID;

enum XIMWIN_ID
 

XIM window ID definition.

LSB8 bits are reserved to support DB XIM.

Definition at line 165 of file menu.h.

00166 {
00167     XIMWIN_DB                       = 0x0000,
00168     XIMWIN_RADIO                    = 0x0100,
00169     XIMWIN_PLAYER                   = 0x0200,
00170     XIMWIN_RECORDDONE               = 0x0300,
00171     XIMWIN_HISIDONE                 = 0x0400,
00172     XIMWIN_PLAYER_MYFI              = 0x0500,
00173     XIMWIN_PLAYQ                    = 0x0600,
00174     XIMWIN_PLAYER_MYFIQ             = 0x0700,
00175     XIMWIN_PLAYERQ                  = 0x0800,
00176     XIMWIN_PLAYER_MYFI_ADD2MYMIX    = 0x0900,
00177     XIMWIN_PLAYER_ADD2MYMIX         = 0x0A00    
00178 } XIMWIN_ID;


Function Documentation

void MENU__createContrastMenu HMENU  menu  ) 
 

Function creates the LCD contrast menu display.

Parameters:
menu Menu handle.

Definition at line 35 of file MENU__contrast.c.

References st_RECT::br, st_MENUTMPLT::fld, MENU__create(), MENU__vbarInit(), st_CONTRAST::pContrast, st_FIELD::rc, st_MENUTMPLT::share, st_MENU_REGIST::tmplt, st_RECT::ul, st_CONTRAST::vbar, st_POINT::x, and st_POINT::y.

00036 {
00037     st_MENUTMPLT *  pTmplt;
00038     st_FIELD *      pFld;
00039     st_CONTRAST *   pCont;
00040     st_RECT         rect;
00041     
00042     /* Load display pattern template. -----------------------------------------*/
00043     pTmplt = &MENU_regist[menu].tmplt;
00044     pCont  = (st_CONTRAST*)&pTmplt->share; 
00045     
00046     /* Create the generic part. -----------------------------------------------*/
00047     MENU__create(menu);
00048         
00049     /* Create value bar to display contrast value. ----------------------------*/
00050     pFld = &pTmplt->fld[2];
00051     
00052     rect.ul.x =     
00053     rect.ul.y = 0;
00054     rect.br.x = pFld->rc.br.x - pFld->rc.ul.x + 1;
00055     rect.br.y = pFld->rc.br.y - pFld->rc.ul.y + 1;
00056     
00057     pCont->vbar = MENU__vbarInit( menu, 
00058                                 &pFld->rc.ul, 
00059                                 &rect, 
00060                                 *(pCont->pContrast), 
00061                                 MAX_CONTRAST, 
00062                                 3, 
00063                                 0);
00064 }

Here is the call graph for this function:

HMENU MENU__createHdl int  idx  ) 
 

Function creates a menu handle based on index.

Parameters:
idx Current menu index.
Returns:
Valid menu handle if successful, otherwise INVALID_MENU_HDL.

Definition at line 53 of file MENU_handle.c.

Referenced by MENU_create().

00054 {
00055     UINT ii = MENU_id[MENU_MAXMENU]+1;
00056     
00057     //if(idx < 0) return INVALID_MENU_HDL;
00058     if(ii == 0xfff)    ii = 1;
00059     MENU_id[MENU_MAXMENU] = ii;
00060     ii              <<= 4;
00061     MENU_id[idx]      = ii;
00062     return (ii|idx);
00063 }

void MENU__createPlayMenu HMENU  menu  ) 
 

Function creates a standard player display.

Parameters:
menu Menu handle.

Definition at line 38 of file MENU__playMenu.c.

References st_RECT::br, st_FIELD::dptr, st_MENUTMPLT::fld, GEN_createTimeString(), LCD_printFld(), MENU__create(), MENU__vbarInit(), st_LCDINFO::num, st_FIELD::rc, st_PLAYMENU::scroll, st_MENUTMPLT::share, st_PLAYMENU::time, st_MENU_REGIST::tmplt, TMR_create(), TMR_delete(), TMR_TXTSCROLL, st_RECT::ul, st_PLAYMENU::vbar, st_POINT::x, and st_POINT::y.

00039 {
00040     st_MENUTMPLT *  pTmplt;
00041     st_FIELD *      pFld;
00042     st_RECT         rect;
00043     st_PLAYMENU *   pPlay;
00044     char            str[16];
00045     
00046     /* Create the generic part. -----------------------------------------------*/
00047     MENU__create(menu);
00048 
00049     /* Load display pattern template. -----------------------------------------*/
00050     pTmplt = &MENU_regist[menu].tmplt;
00051     pPlay  = (st_PLAYMENU*)&pTmplt->share;
00052 
00053     #ifndef NO_TEXT_SCROLLING
00054     {
00055         st_LCDINFO      info;
00056 //DeepB
00057         UINT            scrollField;
00058         int             doScroll = 0;
00059         
00060         for (scrollField=0; scrollField<3; scrollField++)
00061         {
00062             pFld = &pTmplt->fld[scrollField+2];
00063             
00064             LCD_printFld(pFld, &info);
00065             if(info.num + 1 < LCD__dataLen(pFld->dptr) )
00066             {
00067                 // Scroll needed.
00068                 doScroll = 1;
00069                 pPlay->scroll[scrollField] = 7;
00070 //              TMR_create(TMR_TXTSCROLL, 12, TTXTSCROLL, 0, AUTO_RELOAD);
00071             }
00072             else
00073                 pPlay->scroll[scrollField] = -1;
00074         }
00075 
00076         if (doScroll == 1)
00077             TMR_create(TMR_TXTSCROLL, 20, TTXTSCROLL, 0, AUTO_RELOAD);
00078         else
00079             TMR_delete(TMR_TXTSCROLL);
00080     }
00081     #endif // NO_TEXT_SCROLLING
00082     
00083     GEN_createTimeString(pPlay->time, str);
00084     pFld       = &pTmplt->fld[14];
00085     pFld->dptr = (ULONG)str;
00086     LCD_printFld(pFld, NULL);
00087         
00088     /* Create value bar to display time remained. -----------------------------*/
00089     pFld = &pTmplt->fld[10];
00090     
00091     rect.ul.x = 
00092     rect.ul.y = 0;
00093     rect.br.x = pFld->rc.br.x - pFld->rc.ul.x + 1;
00094     rect.br.y = pFld->rc.br.y - pFld->rc.ul.y + 1;
00095     
00096     pPlay->vbar = MENU__vbarInit(menu, 
00097                                 &pFld->rc.ul, 
00098                                 &rect, 
00099                                 0, 
00100                                 pPlay->time, 
00101                                 3, 
00102                                 0);
00103     
00104 }

Here is the call graph for this function:

void MENU__createShadow st_RECT pRect  ) 
 

Function creates shadowed window.

Parameters:
pRect Window display area rectangle.

Definition at line 35 of file MENU__createShadow.c.

References st_RECT::br, st_BRUSH::clr, st_PEN::clr, LCD_drawRect(), LCD_setBrush(), LCD_setPen(), st_PEN::shp, st_PEN::sz, st_RECT::ul, st_POINT::x, and st_POINT::y.

Referenced by MENU__createMyfiChannelMenu(), MENU__createMyfiGainMenu(), MENU__createVolumeMenu(), and MENU__createXIM().

00036 {   
00037     st_PEN          pen;
00038     st_BRUSH        brush;
00039     st_RECT         rect;
00040     
00041     /* Set brush. */
00042     brush.clr = CLR_03;     
00043     LCD_setBrush(&brush);   
00044     LCD_setPen(NULL);
00045     
00046     rect.ul.x = pRect->ul.x + SHADOW_WIDTH + SHADOW_BGD_SPACE + SHADOW_SPACE;       
00047     rect.br.x = pRect->br.x - SHADOW_BGD_SPACE;     
00048     rect.ul.y = pRect->ul.y + SHADOW_HEIGHT + SHADOW_BGD_SPACE + SHADOW_SPACE;
00049     rect.br.y = pRect->br.y - SHADOW_BGD_SPACE;
00050         
00051     LCD_drawRect(&rect);
00052 
00053     LCD_setBrush(NULL);     
00054     rect.ul.x = pRect->ul.x + SHADOW_BGD_SPACE;
00055     rect.br.x = pRect->br.x - SHADOW_WIDTH - SHADOW_BGD_SPACE;
00056     rect.ul.y = pRect->ul.y + SHADOW_BGD_SPACE;
00057     rect.br.y = pRect->br.y - SHADOW_HEIGHT - SHADOW_BGD_SPACE;
00058     LCD_drawRect(&rect);
00059 
00060 
00061     /* Set pen. */
00062     pen.sz.x = pen.sz.y = 1;
00063     pen.shp = PEN_RECT;
00064     pen.clr = 3;
00065     LCD_setPen(&pen);
00066         
00067     rect.br.x -= SHADOW_SPACE;      
00068     rect.br.y -= SHADOW_SPACE;      
00069     LCD_drawRect(&rect);        
00070 }

Here is the call graph for this function:

void MENU__deleteHdl HMENU  menu  ) 
 

Function removes a menu handle from the registration.

Parameters:
menu Menu handle.

Definition at line 73 of file MENU_handle.c.

Referenced by MENU_action().

00074 {
00075     UINT ii  = menu&0xfff0;
00076     UINT idx = menu&0x0f;
00077     
00078     if( ii == MENU_id[idx])
00079     {
00080         MENU_id[idx] = 0;
00081     }
00082 }

int MENU__getIdx HMENU  menu  ) 
 

Function returns the menu index from a given menu handle.

Parameters:
menu Menu handle.
Returns:
Menu index if successful, otherwise -1.

Definition at line 93 of file MENU_handle.c.

Referenced by MENU_action(), MENU_getField(), MENU_getObj(), MENU_refresh(), and MENU_update().

00094 {
00095     UINT ii  = menu&0xfff0;
00096     UINT idx = menu&0x0f;
00097     
00098     if( (ii == MENU_id[idx])&&(ii != 0) )   return idx;
00099     else                                    return -1;
00100 }

void MENU__preserve HMENU  menu  ) 
 

Function checks to preserve MENU to support over-lapped display.

Parameters:
menu Menu handle.

Definition at line 36 of file MENU__overlap.c.

References st_MENU_REGIST::dptr, GEN_malloc(), LCD_rdRect(), LCD_wrRect(), st_MENU::level, st_MENU::ovlpDptr, st_MENUTMPLT::rect, and st_MENU_REGIST::tmplt.

Referenced by MENU__sbarInit(), MENU__sbarReposition(), MENU__vbarInit(), MENU__vbarReposition(), MENU_action(), and MENU_update().

00037 {   
00038     UINT *              pData;
00039     UINT                len;
00040     st_MENU_REGIST *    pReg;
00041     
00042     if(Menu.level <= menu )
00043     {
00044         /* Top level, nothing needs to be preserved. */
00045         return;
00046     }
00047     
00048     pReg = &MENU_regist[Menu.level];
00049 
00050     /* Preserve top level displayed contents. */
00051 #ifndef LCD_USEXDATA
00052     pData = (UINT *)LCD_rdRect(&pReg->tmplt.rect);
00053     if(!pData) return;
00054 
00055     len = *pData + 1;
00056     Menu.ovlpDptr = GEN_malloc(len);
00057     MENU_assert(Menu.ovlpDptr != 0, MENU__OVERLAP);
00058     GEN_wrSRAM(Menu.ovlpDptr, (unsigned short *)pData, len);
00059     free(pData);
00060 #else
00061     Menu.ovlpDptr = (USHORT*)LCD_rdRect(&pReg->tmplt.rect, NULL);
00062 #endif
00063     
00064     
00065     /* Write back previously preserved for current level. */    
00066     pReg = &MENU_regist[menu];
00067 #ifndef LCD_USEXDATA
00068     GEN_rdSRAM(pReg->dptr, (unsigned short *)&len, 1);
00069     len++;
00070     pData = (UINT *)mmalloc(len);
00071     GEN_rdSRAM(pReg->dptr, (unsigned short *)pData, len);
00072     LCD_wrRect( &pReg->tmplt.rect, (USHORT *)pData );
00073     free(pData);    
00074 #else
00075     LCD_wrRect( &pReg->tmplt.rect, (USHORT *)pReg->dptr );
00076 #endif
00077 
00078 }

Here is the call graph for this function:

void MENU__refresh HMENU  menu  ) 
 

Function sends message to refresh menu display.

Parameters:
menu Menu handle.

Definition at line 50 of file MENU_refresh.c.

References st_RECT::br, st_MENUTMPLT::rect, st_MENU_REGIST::tmplt, st_RECT::ul, st_POINT::x, and st_POINT::y.

Referenced by MENU_action(), MENU_create(), and MENU_refresh().

00051 {
00052     st_MENUTMPLT *  pTmplt = &MENU_regist[menu].tmplt;
00053     
00054     mMSG_send(  lcdMsgQ, LCD_MSG_ID, 
00055                 pTmplt->rect.ul.x<<8|pTmplt->rect.ul.y, 
00056                 pTmplt->rect.br.x<<8|pTmplt->rect.br.y, 
00057                 0);
00058 }

void MENU__restore HMENU  menu  ) 
 

Function checks to restore MENU to support over-lapped display.

Parameters:
menu Menu handle.

Definition at line 88 of file MENU__overlap.c.

References st_MENU_REGIST::dptr, GEN_free(), LCD_rdRect(), LCD_wrRect(), st_MENU::level, st_MENU::ovlpDptr, st_MENUTMPLT::rect, and st_MENU_REGIST::tmplt.

Referenced by MENU__sbarInit(), MENU__sbarReposition(), MENU__vbarInit(), MENU__vbarReposition(), MENU_action(), and MENU_update().

00089 {   
00090     UINT *              pData;
00091     UINT                len;
00092     HMENU               level;
00093     st_MENU_REGIST *    pReg;
00094         
00095     if(Menu.level <= menu )
00096     {
00097         /* Top level, nothing needs to be restored. */
00098         return;
00099     }
00100 
00101 
00102     /* Preserve displayed contents for current level. */
00103     pReg = &MENU_regist[menu];
00104 
00105 #ifndef LCD_USEXDATA
00106     pData = (UINT *)LCD_rdRect(&pReg->tmplt.rect, NULL);
00107     if(!pData) return;
00108     
00109     len = *pData + 1;           
00110     //MENU_regist[menu].dptr = GEN_malloc(len);     
00111     GEN_wrSRAM(pReg->dptr, (unsigned short *)pData, len);
00112     free(pData);        
00113 #else
00114     LCD_rdRect(&pReg->tmplt.rect, (USHORT*)pReg->dptr);
00115 #endif  
00116     
00117     
00118     /* Restore all levels that is above. */
00119     pReg = &MENU_regist[menu+1];    
00120     for( level = menu + 1; level < Menu.level; level++)
00121     {   
00122 #ifndef LCD_USEXDATA
00123         GEN_rdSRAM(pReg->dptr, (unsigned short *)&len, 1);
00124         len++;
00125         
00126         pData = (UINT *)malloc(len);
00127         GEN_rdSRAM(pReg->dptr, (unsigned short *)pData, len);
00128         LCD_wrRect( &pReg->tmplt.rect, (USHORT *)pData );
00129         free(pData);
00130 #else
00131         LCD_wrRect(&pReg->tmplt.rect, (USHORT*)pReg->dptr);
00132 #endif      
00133         pReg++;
00134     }
00135     
00136     /* Restore the top levlel display. */
00137 #ifndef LCD_USEXDATA    
00138     GEN_rdSRAM(Menu.ovlpDptr, (unsigned short *)&len, 1);
00139     len++;
00140     
00141     pData = (UINT *)malloc(len);
00142     GEN_rdSRAM(Menu.ovlpDptr, (unsigned short *)pData, len);
00143     LCD_wrRect( &MENU_regist[Menu.level].tmplt.rect, (USHORT *)pData );
00144     free(pData);
00145     GEN_free(Menu.ovlpDptr);    
00146 #else
00147     LCD_wrRect(&MENU_regist[Menu.level].tmplt.rect, (USHORT*)Menu.ovlpDptr);
00148     nfree((Ptr)Menu.ovlpDptr);
00149 #endif
00150 }

Here is the call graph for this function:

void MENU__sbarDelete HSBAR  bar  ) 
 

Function disables the scroll bar and releases proper data object.

Parameters:
bar Scroll bar handle.

Definition at line 214 of file MENU_scrollBar.c.

References st_SBAR_REGIST::free.

Referenced by MENU__listMenuAction(), and MENU_action().

00215 {
00216     SBAR_regist[bar].free = TRUE;
00217 }

HSBAR MENU__sbarInit HMENU  menu,
st_POINT pPnt,
st_RECT pRect,
UINT  space,
UINT  initVal,
UINT  range,
UINT  szScreen,
UINT  orient
 

Function creates a scroll bar inside of a MENU.

NOTE: One scrolling step might take several pixels.

Parameters:
menu Owner menu handle.
pPnt Upper left start point.
pRect Bar envelope rectangle.
space Space between frame and bar.
initVal Initial position value.
range Range in steps.
szScreen Screen size in steps.
orient Bar orientation.
Returns:
Scroll bar handle if successfully created a scroll bar, otherwise return INVALID_SBAR_HDL.

Definition at line 54 of file MENU_scrollBar.c.

References st_SBAR::actVal, st_SBAR::attr, st_SBAR_REGIST::bar, st_RECT::br, st_PEN::clr, st_SBAR::cur, st_SBAR_REGIST::free, st_SBAR::initVal, LCD_drawRect(), LCD_setBrush(), LCD_setPen(), st_SBAR::len, st_SBAR_REGIST::menu, MENU__preserve(), MENU__restore(), st_SBAR::range, st_SBAR::rect, st_PEN::shp, st_SBAR::slideLen, st_SBAR::space, st_PEN::sz, st_SBAR::szScreen, st_RECT::ul, st_POINT::x, and st_POINT::y.

Referenced by MENU__createListMenu().

00062 {
00063     UINT                ii;
00064     HSBAR               bar;
00065     st_PEN              pen;
00066     st_SBAR *           pBar;
00067     st_SBAR_REGIST *    pReg;
00068     
00069     //menu = MENU__getIdx(menu);
00070     //if( menu == INVALID_MENU_HDL) return INVALID_SBAR_HDL;
00071     
00072     pReg = &SBAR_regist[0];
00073     
00074     /* Check to generate and set up BAR handle. ------------------------------*/
00075     for(ii = 0; ii < MENU_MAXSBAR; ii++)
00076     {
00077         if(pReg->free == TRUE) 
00078         {
00079             pReg->free = FALSE;
00080             pReg->menu = menu;      
00081             break;
00082         }
00083         pReg++;
00084     }
00085 
00086     if(ii == MENU_MAXSBAR) return INVALID_SBAR_HDL;
00087     
00088     bar = ii;
00089     
00090 
00091     /* Copy bar controls over. -----------------------------------------------*/
00092     pBar = &pReg->bar;
00093     
00094     pBar->attr     = orient;
00095     pBar->szScreen = szScreen;
00096     pBar->initVal  =
00097     pBar->actVal   = initVal;
00098     pBar->cur      = (initVal > pBar->szScreen)? initVal - pBar->szScreen: 0;
00099 
00100     pBar->rect.ul.x = pPnt->x + pRect->ul.x;
00101     pBar->rect.ul.y = pPnt->y + pRect->ul.y;
00102     pBar->rect.br.x = pPnt->x + pRect->br.x;
00103     pBar->rect.br.y = pPnt->y + pRect->br.y;
00104 
00105     pBar->range = range - szScreen;
00106     pBar->space = space;
00107 
00108 
00109     /* Check to preserve. ----------------------------------------------------*/
00110     MENU__preserve(menu);
00111     
00112 
00113     /* Start to create scroll bar. -------------------------------------------*/
00114 
00115     /* Create a pen. */
00116     pen.clr = 3;
00117     pen.shp = PEN_RECT; 
00118     pen.sz.x = 1;
00119     pen.sz.y = 1;
00120 
00121     LCD_setPen(&pen);
00122     
00123     /* Draw bar rectangle. */
00124     LCD_setBrush(NULL);
00125     LCD_drawRect(&pBar->rect);  
00126     
00127 
00128     /* Set up bar controls. */
00129     if( (pBar->attr & SB_ORIENTATION) == VERT_SBAR )
00130     {   
00131         /* Reserve one pixel at the start and end of bar. */
00132         pBar->rect.ul.y++;      
00133         pBar->rect.br.y--;
00134         pBar->slideLen = pBar->rect.br.y - pBar->rect.ul.y - 1;
00135     }
00136     else
00137     {   
00138         /* Reserve one pixel at the start and end of bar. */
00139         pBar->rect.ul.x++;      
00140         pBar->rect.br.x--;  
00141         pBar->slideLen = pBar->rect.br.x - pBar->rect.ul.x - 1;
00142     }
00143 
00144     pBar->len = (pBar->slideLen*szScreen)/range;
00145     pBar->len = (pBar->len > SB_MINLENGTH)? pBar->len : SB_MINLENGTH;
00146 
00147     pBar->slideLen -= pBar->len;
00148 
00149     /* Draw positioning rectangle. */
00150     _sbarPosition(bar, pBar->cur, FALSE);
00151 
00152     
00153     /* Before return, check to restore. --------------------------------------*/
00154     MENU__restore(menu);
00155 
00156     return bar;
00157 }

Here is the call graph for this function:

void MENU__sbarReposition HSBAR  bar,
short  value
 

Function repositions the scroll bar.

Parameters:
bar Scroll bar handle.
value Scroll bar value size in steps.

Definition at line 169 of file MENU_scrollBar.c.

References st_SBAR::actVal, st_SBAR_REGIST::bar, st_SBAR::cur, st_SBAR_REGIST::menu, MENU__preserve(), MENU__restore(), st_SBAR::range, and st_SBAR::szScreen.

Referenced by MENU__listMenuAction().

00170 {
00171     st_SBAR *   pBar;
00172     HMENU       menu;
00173 
00174     
00175     pBar = &SBAR_regist[bar].bar;
00176 
00177     /* Check if value is out of range. ---------------------------------------*/
00178     if( (value > (pBar->range + pBar->szScreen) )||(value < 0 ) ) return;
00179 
00180     /* SBAR records its own position. ----------------------------------------*/
00181     pBar->actVal = value;
00182 
00183 
00184     /* Check to see if bar needs to be repositioned. */
00185     if( (value <= pBar->cur + pBar->szScreen )&&(value >= pBar->cur ) ) return;
00186 
00187 
00188     /* Check to preserve. -----------------------------------------------------*/
00189     menu = SBAR_regist[bar].menu;
00190     MENU__preserve(menu);
00191     
00192 
00193     /* Clear the previous position. -------------------------------------------*/
00194     _sbarPosition(bar, pBar->cur, TRUE);
00195 
00196     /* Sets the new positon. --------------------------------------------------*/
00197     pBar->cur = ( value > (pBar->cur + pBar->szScreen) )? 
00198         value - pBar->szScreen : value;
00199 
00200     _sbarPosition(bar, pBar->cur, FALSE);
00201     
00202     
00203     /* Before return, check to restore. ---------------------------------------*/
00204     MENU__restore(menu);
00205 }

Here is the call graph for this function:

void MENU__vbarDelete HVBAR  bar  ) 
 

Function disables the value bar and releases proper data object.

Parameters:
bar Value bar handle.

Definition at line 178 of file MENU_valueBar.c.

References st_VBAR_REGIST::free.

Referenced by MENU_action().

00179 {
00180     VBAR_regist[bar].free = TRUE;
00181 }

HVBAR MENU__vbarInit HMENU  menu,
st_POINT pPnt,
st_RECT pRect,
ULONG  initVal,
ULONG  range,
UINT  color,
UINT  orient
 

Function creates a value bar inside of a MENU.

Parameters:
menu Owner menu handle.
pPnt Upper left start point.
pRect Bar envelope rectangle.
initVal Initial bar value.
range Range in pixels.
color Bar color.
orient Bar orientation.
Returns:
Value bar handle if successfully created a value bar, otherwise return INVALID_VBAR_HDL.

Definition at line 50 of file MENU_valueBar.c.

References st_VBAR::attr, st_VBAR_REGIST::bar, st_RECT::br, st_PEN::clr, st_VBAR::color, st_VBAR::cur, st_VBAR::curPnt, st_VBAR_REGIST::free, LCD_drawRect(), LCD_setBrush(), LCD_setPen(), st_VBAR::len, st_VBAR_REGIST::menu, MENU__preserve(), MENU__restore(), st_VBAR::origin, st_VBAR::range, st_PEN::shp, st_PEN::sz, st_RECT::ul, st_VBAR::width, st_POINT::x, and st_POINT::y.

Referenced by MENU__createContrastMenu(), MENU__createEqMenu(), and MENU__createPlayMenu().

00058 {
00059     UINT                ii;
00060     HVBAR               bar;
00061     st_PEN              pen;
00062     st_VBAR *           pBar;
00063     st_RECT             rect;
00064     st_VBAR_REGIST *    pReg;
00065     
00066     //menu = MENU__getIdx(menu);
00067     //if( menu == INVALID_MENU_HDL) return INVALID_VBAR_HDL;
00068     
00069     pReg = &VBAR_regist[0];
00070     
00071     /* Check to generate and set up VBAR handle. -----------------------------*/
00072     for(ii = 0; ii < MENU_MAXVBAR; ii++)
00073     {
00074         if(pReg->free == TRUE) 
00075         {
00076             pReg->free = FALSE;
00077             pReg->menu = menu;      
00078             break;
00079         }
00080         pReg++;
00081     }
00082 
00083     if(ii == MENU_MAXVBAR) return INVALID_VBAR_HDL;
00084     
00085     bar = ii;
00086     
00087 
00088     /* Copy bar controls over. -----------------------------------------------*/
00089     pBar = &VBAR_regist[bar].bar;
00090     
00091     pBar->attr = orient;
00092     pBar->color = color;
00093     pBar->cur = 0;
00094     pBar->range = range;
00095 
00096     rect.ul.x = pPnt->x + pRect->ul.x;
00097     rect.ul.y = pPnt->y + pRect->ul.y;
00098     rect.br.x = pPnt->x + pRect->br.x;
00099     rect.br.y = pPnt->y + pRect->br.y;
00100 
00101 
00102     if( (pBar->attr & VB_ORIENTATION) == VERT_VBAR )
00103     {
00104         pBar->len = rect.br.y - rect.ul.y - 2;
00105         pBar->width = rect.br.x - rect.ul.x - 1;
00106         pBar->origin = rect.br.y - 1;
00107         pBar->curPnt.x = rect.ul.x + 1;     
00108         pBar->curPnt.y = rect.br.y - 1;
00109     }
00110     else
00111     {
00112         pBar->len = rect.br.x - rect.ul.x - 2;
00113         pBar->width = rect.br.y - rect.ul.y - 1;
00114         pBar->origin = rect.ul.x + 1;
00115         pBar->curPnt.x = rect.ul.x + 1;     
00116         pBar->curPnt.y = rect.ul.y + 1;
00117     }
00118 
00119     /* Check to preserve. ----------------------------------------------------*/
00120     MENU__preserve(menu);
00121     
00122     /* Start to create scroll bar. -------------------------------------------*/
00123 
00124     /* Create a pen. */
00125     pen.clr = 3;
00126     pen.shp = PEN_RECT; 
00127     pen.sz.x = 1;   
00128     pen.sz.y = 1;
00129     LCD_setPen(&pen);
00130     
00131     /* Draw bar rectangle. */
00132     LCD_setBrush(NULL);
00133     LCD_drawRect(&rect);
00134 
00135     /* Draw positioning rectangle. */
00136     _vbarPosition(bar, initVal);    
00137     
00138     /* Before return, check to restore. --------------------------------------*/
00139     MENU__restore(menu);
00140 
00141     return bar;
00142 }

Here is the call graph for this function:

void MENU__vbarReposition HVBAR  bar,
ULONG  value
 

Function repositions the value bar.

Parameters:
bar Value bar handle.
value Value bar value.

Definition at line 153 of file MENU_valueBar.c.

References st_VBAR_REGIST::bar, st_VBAR_REGIST::menu, MENU__preserve(), MENU__restore(), and st_VBAR::range.

Referenced by MENU__setContrast(), and MENU__setEq().

00154 {
00155     HMENU       menu = VBAR_regist[bar].menu;
00156     
00157     /* Check to preserve. -----------------------------------------------------*/
00158     MENU__preserve(menu);
00159     
00160     /* Reposition value bar. --------------------------------------------------*/
00161     if(value <= VBAR_regist[bar].bar.range) 
00162     {       
00163         _vbarPosition(bar, value);
00164     }
00165     
00166     /* Before return, check to restore. ---------------------------------------*/
00167     MENU__restore(menu);
00168 }

Here is the call graph for this function:

void MENU_action HMENU  menu,
MENUACTION  actID
 

Function responds to various action request posted to the specified MENU.

Parameters:
menu Menu handle.
actID Menu action ID.

Definition at line 38 of file MENU_action.c.

References st_MENUTMPLT::action, st_MENUTMPLT::contrast, st_MENU_REGIST::dptr, st_MENUTMPLT::eq, GEN_free(), LCD_wrRect(), st_MENU::level, MENU__deleteHdl(), MENU__getIdx(), MENU__preserve(), MENU__refresh(), MENU__restore(), MENU__sbarDelete(), MENU__vbarDelete(), MENU_TNEXT, MENU_TPREV, MENU_TSELECT, st_MENUTMPLT::pattern, st_MENUTMPLT::play, st_MENUTMPLT::rect, st_MENUTMPLT::sbar, st_MENUTMPLT::share, st_MENU_REGIST::tmplt, TMR_delete(), TMR_TXTSCROLL, st_PLAYMENU::vbar, st_CONTRAST::vbar, and st_EQMENU::vbars.

Referenced by UI_SF_dbmenu().

00039 {
00040     
00041     HMENU           hmenu = menu;
00042     UINT *          pData;
00043     UINT            len;
00044     short           ii, jj;
00045     st_MENUTMPLT *  pTmplt;
00046     st_MENU_REGIST *pReg;
00047     
00048     menu = MENU__getIdx(menu);
00049     if( menu == INVALID_MENU_HDL) return;
00050 
00051     pReg = &MENU_regist[menu];
00052     pTmplt = &pReg->tmplt;
00053     
00054     if(actID == MENU_CLOSE )
00055     {
00056         LCD_OVLPDISABLE(pTmplt);
00057 
00058         // Check to close any related blinking items if any.
00059         /*
00060         for(jj = 0; jj < MENU_MAXBLINK; jj++)
00061         {               
00062             if(BLINK_regist[jj].menu == ii) MENU_blinkStop(jj);
00063         }           
00064         */
00065         
00066         // Refresh display.
00067         pReg = &MENU_regist[0];
00068         for(ii = 0; ii < menu; ii++)
00069         {       
00070             if(pReg->dptr)
00071             {
00072 #ifndef LCD_USEXDATA
00073                 // Restore the previous level display.
00074                 GEN_rdSRAM(pReg->dptr, (unsigned short *)&len, 1);
00075                 len++;
00076                 pData = (UINT *)malloc(len);
00077                 GEN_rdSRAM(pReg->dptr, (unsigned short *)pData, len);
00078                 LCD_wrRect( &pReg->tmplt.rect, (USHORT *)pData );
00079                 free(pData);
00080                 GEN_free(pReg->dptr);
00081 #else
00082                 LCD_wrRect(&pReg->tmplt.rect, (USHORT*)pReg->dptr);
00083                 nfree((Ptr)pReg->dptr);
00084 #endif
00085             }
00086             
00087             pReg++;
00088         }   
00089         
00090         /* Reset the menu level control. */
00091         Menu.level = menu - 1;
00092 
00093         /* If scroll bar present, release it. */
00094         if(pTmplt->sbar != INVALID_SBAR_HDL)
00095         {           
00096             MENU__sbarDelete(pTmplt->sbar);
00097         }
00098 
00099         // Check to do pattern dependent clean-up.
00100         switch(pTmplt->pattern)
00101         {
00102         case DP_EQ:
00103             // Delete the value bars.
00104             for(ii=0;ii<EQBAR_MAXNUM;ii++)
00105             {
00106                 MENU__vbarDelete(pTmplt->share.eq.vbars[ii]);
00107             }
00108             break;
00109         case DP_PLAYER:
00110             MENU__vbarDelete(pTmplt->share.play.vbar); 
00111             // Run through.
00112         case DP_LISTMENU:
00113             TMR_delete(TMR_TXTSCROLL);
00114             break;
00115         case DP_CONTRAST:
00116             MENU__vbarDelete(pTmplt->share.contrast.vbar); 
00117             break;
00118         case DP_XIMTXT:
00119             pTmplt->action(menu, actID);
00120             break;
00121         }
00122 
00123         // Reset MENU registration. 
00124         pTmplt->sbar = INVALID_SBAR_HDL;
00125         
00126         // Delete menu handle.
00127         MENU__deleteHdl(hmenu);
00128         
00129         // Refresh upper level menu if available.
00130         if(Menu.level>-1) MENU__refresh(Menu.level);
00131     }
00132     else
00133     {   
00134         if( (MENU_TPREV == actID)||
00135             (MENU_TNEXT == actID)||
00136             (MENU_TSELECT == actID) )
00137         {
00138             pTmplt->action(menu, actID);
00139         }
00140         else
00141         {
00142             MENU__preserve(menu);
00143             
00144             pTmplt->action(menu, actID);
00145             
00146             MENU__restore(menu);
00147             
00148             MENU__refresh(menu);
00149         }
00150     }
00151 }

Here is the call graph for this function:

void* MENU_getObj HMENU  menu  ) 
 

Function returns the menu control object.

Parameters:
menu Menu handle.
Returns:
Control object address, otherwise NULL.

Definition at line 36 of file MENU_getObj.c.

References MENU__getIdx(), st_MENUTMPLT::share, and st_MENU_REGIST::tmplt.

00037 {
00038     menu = MENU__getIdx(menu);
00039     if( menu == INVALID_MENU_HDL) return NULL;  
00040     
00041     else return (void *)&MENU_regist[menu].tmplt.share;
00042 }   

Here is the call graph for this function:

BOOL MENU_isValid HMENU  menu  ) 
 

Function checks to see if given menu handle is valid.

Parameters:
menu Test menu handle.
Returns:
TRUE if handle if valid, otherwise FALSE.

Definition at line 36 of file MENU_handle.c.

Referenced by UI_PSF_play().

00037 {
00038     if( (menu&0xfff0) == MENU_id[menu&0x0f]) return TRUE;
00039     
00040     return FALSE;
00041 }

void MENU_refresh HMENU  menu  ) 
 

Function sends message to refresh menu display.

Parameters:
menu Menu handle.

Definition at line 35 of file MENU_refresh.c.

References MENU__getIdx(), and MENU__refresh().

00036 {
00037     menu = MENU__getIdx(menu);
00038     if( menu == INVALID_MENU_HDL) return;
00039     
00040     MENU__refresh(menu);
00041 }

Here is the call graph for this function:

void MENU_statusBar STBAR_ACTION  eID,
USHORT  data
 

Function manages the status bar.

Status bar does not belong to any MENU, since this bar will present all the time.

If there is over-lapped display on status bar, we'll leave the active MENU to handle it.

Parameters:
eID Status bar action ID.
data Status bar action support data.

Definition at line 67 of file MENU_statusBar.c.

References st_FIELD::attr, st_RECT::br, st_BRUSH::clr, battery::CurVoltage, st_FIELD::dptr, GEN_createTimeString(), GEN_int2ASCII(), LCD_drawRect(), LCD_invRect(), LCD_printFld(), LCD_setBrush(), LCD_setFrame(), LCD_setPen(), st_FIELD::rc, RTC_BCD2INT(), RTC_readTime(), st_SYSPARAM::sleepCount, st_SYSPARAM::sleepTimer, st_FIELD::txtattr, st_RECT::ul, st_POINT::x, and st_POINT::y.

00068 {
00069     static USHORT   counter = 0;
00070     st_RECT         rect;
00071     st_BRUSH        brush;
00072     st_FIELD        fld;
00073     ULONG           status[2] = {   (ULONG)graf_icon_status1,
00074                                     (ULONG)graf_icon_status2 };
00075     if( SYS_isBatteryAnimation() )
00076     {
00077         if(eID == STBAR_BATTERY)
00078         {
00079             // Code to do full screeen battery animation.
00080             ULONG batteryIcon[4] ={ (ULONG)graf_icon_anim_batteryNull,
00081                                     (ULONG)graf_icon_anim_batteryLevel1,
00082                                     (ULONG)graf_icon_anim_batteryLevel2,
00083                                     (ULONG)graf_icon_anim_batteryFull};
00084             
00085             /* Clear previous display. */
00086             fld.rc.ul.x = 0;
00087             fld.rc.ul.y = 0;
00088             fld.rc.br.x = 127;
00089             fld.rc.br.y = 127;  
00090                 
00091             LCD_setBrush(NULL);
00092             LCD_setPen(NULL);
00093             LCD_drawRect(&fld.rc);
00094             
00095             if(0x1234 == data)
00096             {
00097                 char strVoltage[8];
00098                 
00099                 fld.rc.ul.x = 15;
00100                 fld.rc.ul.y = 30;   
00101                 fld.dptr = (ULONG)graf_icon_anim_batteryClear;
00102                 fld.attr = 0;
00103                 LCD_printFld(&fld, NULL);
00104                     
00105                 fld.rc.ul.x = 55;
00106                 fld.rc.ul.y = 70;       
00107                 fld.rc.br.x = 90;
00108                 fld.rc.br.y = 90;   
00109                     
00110                 // Display voltage.         
00111                 fld.txtattr = ALIGN_LEFT | WRAP_OFF | ALIGN_VCENT | TXT_ATTR_PARTDSP;
00112                 fld.attr = FLD_ATTR_TXTFLD | FONT_BR17;     
00113                 fld.dptr = (ULONG)strVoltage;
00114                 GEN_int2ASCII((ULONG)BatteryData.CurVoltage*100/4096, strVoltage, FALSE, 0);
00115             }
00116             else
00117             {                   
00118                 fld.rc.ul.x = 15;
00119                 fld.rc.ul.y = 30;                       
00120         
00121                 if(DONTCARE == data)
00122                 {
00123                     //LCD_setPen(NULL);
00124                     //LCD_setBrush(NULL);
00125                     //LCD_drawRect(&fld.rc);
00126                     fld.dptr = (ULONG)graf_icon_anim_batteryClear;
00127                     fld.attr = 0;
00128                 }
00129                 else
00130                 {
00131                     data = (data>3)? 3: data;
00132                     fld.dptr = batteryIcon[data];
00133                     fld.attr = 0;                   
00134                 }
00135             }               
00136             LCD_printFld(&fld, NULL);       
00137             mMSG_send(lcdMsgQ, LCD_MSG_ID, 0x0000, 0x7F7F, 0);
00138         }
00139         return;
00140     }
00141 
00142 
00143     switch ( eID ) 
00144     {   
00145     case STBAR_CREATE: /* Create the status bar frame work. */      
00146         rect.ul.x = STBAR_DLMT_LEFTx;       
00147         rect.ul.y = STBAR_DLMT_LEFTy;       
00148         rect.br.x = STBAR_DLMT_RIGHTx;      
00149         rect.br.y = 127;        
00150         LCD_setBrush(NULL);
00151         LCD_drawRect(&rect);
00152         
00153         /* Draw delimiter line. */
00154         rect.ul.x = STBAR_DLMT_LEFTx;       
00155         rect.ul.y = STBAR_DLMT_LEFTy;       
00156         rect.br.x = STBAR_DLMT_RIGHTx;      
00157         rect.br.y = STBAR_DLMT_RIGHTy;
00158         brush.clr = STBAR_DLMT_BRUSHCLR;
00159         LCD_setBrush(&brush);
00160         LCD_drawRect(&rect);
00161         
00162         /* Display MEM. */      
00163         fld.txtattr = ALIGN_LEFT | WRAP_OFF | ALIGN_VCENT | TXT_ATTR_PARTDSP;       
00164         fld.attr = FLD_ATTR_TXTFLD | FONT_MODE6;                
00165         fld.rc.ul.x = 0;        
00166         fld.rc.ul.y = 121;      
00167         fld.rc.br.x = 18;       
00168         fld.rc.br.y = 127;      
00169         fld.dptr = (ULONG)text_mem; 
00170         LCD_printFld(&fld, NULL);
00171         
00172         // Draw full membar.
00173         /* Draw memory bar envelope. */     
00174         //rect.ul.x = MEMBAR_ULx;
00175         //rect.ul.y = MEMBAR_ULy;
00176         //rect.br.x = MEMBAR_BRx;
00177         rect.ul.x = MEMBAR_ULx-2;
00178         rect.ul.y = MEMBAR_ULy-3;
00179         rect.br.x = MEMBAR_BRx+2;
00180         rect.br.y = MEMBAR_BRy;
00181         LCD_setFrame(&rect);
00182         LCD_loadGraph(&rect.ul, (ULONG)graf_icon_membar);
00183 
00184         return;
00185         
00186     case STBAR_MEMORY: /* Memory bar control. */        
00187     {
00188         // data contains the memory percentage in a format of XXYY.
00189         // XX: memory percentage after potential sync.
00190         // YY: current memory percentage.
00191         MENU_assert(((data>>8)&0x0ff)<=100, MENU_STATUSBAR);
00192         MENU_assert((data&0x0ff)<=100, MENU_STATUSBAR2);
00193         
00194         /* Draw memory bar envelope. */     
00195         //rect.ul.x = MEMBAR_ULx;
00196         //rect.ul.y = MEMBAR_ULy;
00197         //rect.br.x = MEMBAR_BRx;
00198         rect.ul.x = MEMBAR_ULx-2;
00199         rect.ul.y = MEMBAR_ULy-3;
00200         rect.br.x = MEMBAR_BRx+2;
00201         rect.br.y = MEMBAR_BRy;
00202         LCD_setFrame(&rect);
00203         LCD_loadGraph(&rect.ul, (ULONG)graf_icon_membar);
00204         
00205         rect.ul.x = MEMBAR_ULx-2+(MEMBAR_BRx-MEMBAR_ULx-1)*(100-((data>>8)&0x0ff))/100;
00206         LCD_loadGraph(&rect.ul, (ULONG)graf_icon_memindicator);
00207         
00208         rect.ul.y += 4;
00209         rect.ul.x += 3;
00210         rect.br.y--;
00211         rect.br.x-= 4;
00212         if(rect.ul.x <= rect.br.x )
00213         {
00214             LCD_setBrush(NULL);
00215             LCD_setPen(NULL);
00216             LCD_drawRect(&rect);
00217         }
00218         
00219         rect.ul.x = MEMBAR_ULx;
00220         rect.br.x = MEMBAR_ULx+(MEMBAR_BRx-MEMBAR_ULx-1)*(100-(data&0x0ff))/100;
00221         if(rect.ul.x < rect.br.x )
00222         {
00223             st_BRUSH brush;
00224             brush.clr = 3;
00225             LCD_setBrush(&brush);
00226             LCD_setPen(NULL);
00227             LCD_drawRect(&rect);
00228         }
00229 
00230         break;
00231     }
00232     case STBAR_TIME:    /* Load current time. */
00233     {
00234         USHORT  minutes;
00235         st_TIME Time;
00236         char    strTime[8];
00237         
00238         if(SYS_HF_sleepTimer())
00239         {
00240             if(sysParam.sleepCount)
00241             {
00242                 static int odd = 0;
00243                 odd ^= 1;
00244                 if((0 == odd)&&(0 != data) ) sysParam.sleepCount--;
00245                 minutes = sysParam.sleepCount;
00246             }
00247             else
00248             {
00249                 sysParam.sleepCount = sysParam.sleepTimer;
00250                 mMSG_send(sysMsgQ, TMR_MSG_ID, TSHUTDOWN, DONTCARE, SYS_FOREVER);
00251             }           
00252         }
00253         else
00254         {
00255             RTC_readTime(&Time);
00256             Time.Hour = RTC_BCD2INT(HOUR, Time.Hour);
00257 //DeepB
00258 //          if(Time.Hour > 12) Time.Hour -= 12;
00259             
00260             // 00:00 in 24 hr is 12:00am in 12 hr
00261 //          if ( Time.Hour == 0 ) Time.Hour = 12;
00262                 
00263             Time.Minute = RTC_BCD2INT(MINUTE, Time.Minute);
00264             minutes = Time.Hour*60 + Time.Minute;
00265         }
00266         GEN_createTimeString(minutes, strTime);
00267         
00268         /* Display time string. */      
00269         fld.txtattr = ALIGN_HCENT | WRAP_OFF | ALIGN_VCENT | TXT_ATTR_PARTDSP;
00270         fld.attr = FLD_ATTR_TXTFLD | FONT_CLOCK8;       
00271         fld.rc.ul.x = 70;
00272         fld.rc.ul.y = 118;
00273         fld.rc.br.x = 98;
00274         fld.rc.br.y = 127;  
00275         fld.dptr = (ULONG)strTime;
00276     
00277         /* Clear previous display. */
00278         LCD_setBrush(NULL);
00279         LCD_setPen(NULL);
00280         LCD_drawRect(&fld.rc);
00281         fld.rc.ul.y = 119;
00282         if(SYS_HF_sleepTimer()) fld.rc.br.y = 126;
00283         LCD_printFld(&fld, NULL);
00284         
00285         if(SYS_HF_sleepTimer())
00286         {
00287             fld.rc.ul.x = 73;
00288             fld.rc.ul.y = 118;
00289             fld.rc.br.x = 95;
00290             fld.rc.br.y = 127;  
00291             LCD_invRect(&fld.rc);
00292         }
00293         break;
00294     }
00295     
00296     case STBAR_MYFI:    /* MyFi icon control. */
00297     {
00298         fld.rc.ul.x = 100;
00299         fld.rc.ul.y = 117;
00300         fld.rc.br.x = 110;
00301         fld.rc.br.y = 127;
00302         fld.dptr = (ULONG)graf_icon_myfi;
00303         fld.attr = 0;
00304         LCD_printFld(&fld, NULL);       
00305         break;
00306     }
00307         
00308     case STBAR_BATTERY: /* Battery icon control. */
00309     {
00310         ULONG batteryIcon[4] ={ (ULONG)graf_icon_batteryNull,
00311                                 (ULONG)graf_icon_batteryLevel1,
00312                                 (ULONG)graf_icon_batteryLevel2,
00313                                 (ULONG)graf_icon_batteryFull};
00314             
00315         /* Clear previous display. */
00316         fld.rc.ul.x = 110;
00317         fld.rc.ul.y = 118;
00318         fld.rc.br.x = 127;
00319         fld.rc.br.y = 127;  
00320     
00321         LCD_setBrush(NULL);
00322         LCD_setPen(NULL);
00323         LCD_drawRect(&fld.rc);
00324             
00325         if(0x1234 == data)
00326         {
00327             char strVoltage[8];
00328                 
00329             // Display voltage.         
00330             fld.txtattr = ALIGN_RIGHT | WRAP_OFF | ALIGN_VCENT | TXT_ATTR_PARTDSP;
00331             fld.attr = FLD_ATTR_TXTFLD | FONT_CLOCK8;       
00332             fld.dptr = (ULONG)strVoltage;
00333             GEN_int2ASCII((ULONG)BatteryData.CurVoltage*100/4096, strVoltage, FALSE, 0);
00334             LCD_printFld(&fld, NULL);
00335             break;
00336         }
00337             
00338         fld.rc.ul.x = 114;      
00339 
00340         if(DONTCARE == data)
00341         {
00342             //LCD_setPen(NULL);
00343             //LCD_setBrush(NULL);
00344             //LCD_drawRect(&fld.rc);
00345         }
00346         else
00347         {
00348             data = (data>3)? 3: data;
00349             fld.dptr = batteryIcon[data];
00350             fld.attr = 0;
00351             LCD_printFld(&fld, NULL);       
00352         }
00353         break;
00354     }
00355     case STBAR_SYSBUSY:
00356         fld.rc.ul.x = 100;      
00357         fld.rc.ul.y = 117;      
00358         fld.rc.br.x = 110;      
00359         fld.rc.br.y = 127;
00360         counter ^= 1;
00361         fld.dptr = status[counter];
00362         fld.attr = 0;
00363         LCD_printFld(&fld, NULL);       
00364         break;
00365         
00366     case STBAR_SYSIDLE:
00367         if(SYS_isPlayActive()&&AUDIO_isMyfiActive())
00368         {
00369             fld.rc.ul.x = 100;
00370             fld.rc.ul.y = 117;
00371             fld.rc.br.x = 110;
00372             fld.rc.br.y = 127;
00373             fld.dptr = (ULONG)graf_icon_myfi;
00374             fld.attr = 0;
00375             LCD_printFld(&fld, NULL);       
00376         }
00377         else
00378         {
00379             rect.ul.x = 100;        
00380             rect.ul.y = 117;        
00381             rect.br.x = 110;        
00382             rect.br.y = 127;
00383             LCD_setPen(NULL);
00384             LCD_setBrush(NULL);
00385             LCD_drawRect(&rect);
00386         }
00387         break;
00388     }
00389     
00390     mMSG_send(  lcdMsgQ, LCD_MSG_ID, 
00391                 STBAR_DLMT_LEFTx<<8|STBAR_DLMT_LEFTy, 
00392                 STBAR_DLMT_RIGHTx<<8|127, 
00393                 0);
00394 }

Here is the call graph for this function:

void MENU_update HMENU  menu,
USHORT  item,
ULONG  dptr,
BOOL  bReverse
 

Function sends message to update menu display.

Parameters:
menu Menu handle.
item Menu item that is going to be updated.
bReverse Reverse display.
dptr Updated menu data pointer.

Definition at line 41 of file MENU_update.c.

References st_FIELD::dptr, st_MENUTMPLT::fld, LCD_drawRect(), LCD_invRect(), LCD_printFld(), LCD_setBrush(), LCD_setPen(), st_MENU::level, MENU__getIdx(), MENU__preserve(), MENU__restore(), st_FIELD::rc, and st_MENU_REGIST::tmplt.

00042 {
00043     UINT                ii;
00044     st_MENU_REGIST *    pReg;
00045     st_FIELD *          pFld;
00046     
00047     if(Menu.level<0)    return; 
00048     
00049     menu = MENU__getIdx(menu);
00050     if( menu == INVALID_MENU_HDL) return;
00051 
00052     MENU__preserve(menu);
00053     
00054     pReg = &MENU_regist[menu];
00055     pFld = &pReg->tmplt.fld[item];
00056     
00057     /* Clear display area. */
00058     LCD_setPen(NULL);
00059     LCD_setBrush(NULL);
00060     LCD_drawRect(&pFld->rc);
00061     
00062     if(dptr) pFld->dptr = dptr;     
00063     LCD_printFld(pFld, NULL);
00064     
00065     if(bReverse == TRUE) LCD_invRect(&pFld->rc);    
00066 
00067     /*
00068     for(ii = 0; ii < MENU_MAXBLINK; ii++){
00069                 
00070         if(BLINK_regist[ii].menu == menu){
00071                     
00072             if(BLINK_regist[ii].pData) free(BLINK_regist[ii].pData);
00073 
00074             BLINK_regist[ii].pData = (UINT *)LCD_rdRect(&BLINK_regist[ii].rect);
00075         }
00076     }
00077     */
00078 
00079     MENU__restore(menu);
00080 }

Here is the call graph for this function:


Variable Documentation

unsigned int MENU_buf[]
 

Menu setup data buffer, which is used to pass menu template data.

First cell always contains the display pattern definition. Note that this is a scratch buffer.

Definition at line 36 of file MENU_globals.c.

Referenced by SYS_die(), UI_CSF_msgbox(), UI_CSF_myfiChannel(), UI_CSF_volume(), UI_CSF_xim(), UI_MENU_contrast(), UI_MENU_dateTime(), UI_MENU_dbRecordInfo(), UI_MENU_dj(), UI_MENU_myfiGain(), UI_MENU_playQueue(), UI_MENU_presets(), UI_MENU_properties(), UI_MENU_seteq(), UI_MENU_synclog(), UI_PSF_autosync(), UI_PSF_hisi(), UI_PSF_hisidone(), UI_PSF_play(), UI_PSF_record(), UI_PSF_recorddone(), UI_setupTextMenu(), UI_SF_autoscan(), UI_SF_dbmenu(), and UI_SF_menu().


Generated on Wed Jan 19 01:13:08 2005 for neuros-firmware by  doxygen 1.3.9.1