setup_show_page.c
资源名称:8202s.rar [点击查看]
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:24k
源码类别:
DVD
开发平台:
C/C++
- /***************************************************************
- * setup_show_page.c
- * include in setup_tab_ui1.c when defined DVD_SETUP_REENG
- *
- * Creator: JSLin
- * Date: 2004/07/28
- *
- * Description :
- * setup menu precentation engine,
- * 1. transform content into GUI
- *
- ****************************************************************/
- void setup_ShowPage(void);
- void setup_ShowPageL1(void);
- void setup_ShowPageL2(void);
- void setup_ShowPageL3(void);
- void setup_ExitPage(void);
- void setup_ShowPageCUSTM(void);
- void setup_ShowCUSTMMsg(void);
- void setup_ShowPage(void)
- {
- //printf("nnsetup_show_pagen");
- // setup position has no changed, no need to re-draw
- if((setup_pos[0] == setup_last_pos[0]) && (setup_pos[1] == setup_last_pos[1])
- &&(setup_pos[2] == setup_last_pos[2]) && (setup_pos[3] == setup_last_pos[3]))
- {
- return;
- }
- if(full_scrn&CUSTM)
- {
- setup_ShowPageCUSTM();
- return;
- }
- // level 1, show page title and icon bar
- if(((setup_pos[SETUP_ML0] == 1) && (setup_last_pos[SETUP_ML0] <= 1 ))||(setup_pos[1]!=setup_last_pos[1]))
- {
- setup_ShowPageL1();
- #ifdef SHOW_SETUPMENU_SETUP //denghangao 20040929
- show_setupmenu();
- #endif
- }
- // level 2, show page items
- if(!((setup_pos[SETUP_ML0] == SETUP_ML3) && (setup_last_pos[SETUP_ML0] == SETUP_ML3)))
- {
- setup_ShowPageL2();
- }
- // level 3, show item selections
- if(setup_pos[SETUP_ML0] > SETUP_ML1)
- {
- setup_ShowPageL3();
- }
- }//end of setup_show_menu
- //====================================================================
- void setup_ShowPageL1(void)
- {
- int i;
- #ifdef SETUP_COLOR_TYPE1 //wangfeng 2003-08-29 17:28
- UINT16 line=SETUP_MAX_WIDTH*16;
- #else
- UINT16 line=SETUP_MAX_WIDTH*16-20;
- #endif
- #ifndef SETUPMENU_16Mb_NO_ICON
- //printf("nnsetup_show_page_L1n");
- //draw rectangulars
- osd_draw_rect(0, 0, (SETUP_MAX_WIDTH*16), 10+SETUP_BUTTON_HEIGHT+12, setupBGcolorH);
- osd_draw_rect(10, 10, line, SETUP_BUTTON_HEIGHT+12,setupBGcolorI);
- osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT+12, line+20, SETUP_BUTTON_HEIGHT+8, setupBGcolorT);
- osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+20, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT), setupBGcolorB);
- osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+20, (SETUP_MAX_WIDTH*16), 2, setupBGcolorSL);
- osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+10+(SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT)-100, (SETUP_MAX_WIDTH*16), 18, setupBGcolorF);
- // show page title
- const char *str;
- str = _OsdMessegeFont1[osd_font_mode][setup_item[setup_pos[SETUP_ML1]][0][1]];
- osd_DrawString(setup_item[setup_pos[1]][0][3], 2, str, setupFcolorT, setupBGcolorT);
- #else//denghg draw rectangulars 2004-9-28 13:50
- osd_draw_rect(0, 0, (SETUP_MAX_WIDTH*16), 10+SETUP_BUTTON_HEIGHT+12, setupBGcolorH);
- osd_draw_rect(10, 10, line, SETUP_BUTTON_HEIGHT+12,setupBGcolorI);
- osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT+12, line+20, SETUP_BUTTON_HEIGHT+8, setupBGcolorT);
- osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+20, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT),setupBGcolorB);
- // osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+20, (SETUP_MAX_WIDTH*16), 2, setupBGcolorSL);
- osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+10+(SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT)-100, (SETUP_MAX_WIDTH*16), 18, setupBGcolorF);
- //DENGHG SHOW CURSOR 2004-9-28 16:13
- osd_draw_rect((setup_pos[SETUP_ML1])*line/setup_max_icon, 10, line/setup_max_icon+10,SETUP_BUTTON_HEIGHT+12, setupCURSOR);
- #endif//
- // draw icon bar or setupIconString //denghg 2004-9-28 20:18
- for(i=0; i<setup_max_icon; i++)
- {
- #ifdef SETUPMENU_16Mb_NO_ICON
- const char *setupIconString[MAX_SETUP_PAGE]={"SYS","LAN","AUD","VID","SPE","DIG"};
- osd_DrawSetupIconString(setup_item[i][0][4], 13,setupIconString[setup_item[i][0][2]],IconStringTCOLOR,IconStringBGCOLOR);
- #else
- osd_DrawIcon(setup_item[i][0][4], 13, setup_item[i][0][2], setup_item[setup_pos[SETUP_ML1]][0][2]);
- //printf("setup_pos[SETUP_ML1]=%4dn",setup_pos[SETUP_ML1]);
- #endif
- }
- }
- //====================================================================
- void setup_ShowPageL2(void)
- {
- int i;
- BYTE xStart, yStart, xLen;//, xOffset, fColor, bgColor, upDown;
- //const char *str;
- //printf("nnsetup_show_page_L2n");
- yStart = 0;
- //for setup_level = 1, left/right walking on page(1st) level, just list all items of this page
- if(((setup_pos[SETUP_ML2] == 0) && (setup_pos[SETUP_ML0] == SETUP_ML1))
- ||setup_refresh)
- {
- //clear level 2 area
- osd_draw_rect(10, 10+SETUP_BUTTON_HEIGHT*2+22, (SETUP_MAX_WIDTH*8)-16, (MAX_PAGE_ITEM*SETUP_BUTTON_HEIGHT)+10, setupBGcolorL2);
- //clear level 3 area
- #ifndef SHOW_SETUPMENU_SETUP//denghangao 20040929
- osd_draw_rect((SETUP_MAX_WIDTH*8)-8, 10+SETUP_BUTTON_HEIGHT*2+22, (SETUP_MAX_WIDTH*8)-10, (MAX_PAGE_ITEM*SETUP_BUTTON_HEIGHT)+10, setupBGcolorL3);
- #endif
- xStart = SETUP_MENU_XSTART;
- xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
- setup_itemType= SETUP_itemNormal;
- for(i=1; i<=MAX_PAGE_ITEM; i++)
- {
- if((setup_item[setup_pos[1]][i][0]!=SET_NE)&&(setup_item[setup_pos[1]][i][0]!=SET_SPACE))
- {
- yStart = SETUP_MENU_YSTART + i;
- id = setup_item[setup_pos[SETUP_ML1]][i][1];
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- }
- }
- //for setup_level =2, up/down walking on item(2nd) level, highlight the corresponding item
- if(setup_pos[SETUP_ML0] == SETUP_ML2)
- {
- //clear level 3 area
- osd_draw_rect((SETUP_MAX_WIDTH*8)-8, 10+SETUP_BUTTON_HEIGHT*2+22, (SETUP_MAX_WIDTH*8)-10, (MAX_PAGE_ITEM*SETUP_BUTTON_HEIGHT)+10, setupBGcolorL3);
- xStart = SETUP_MENU_XSTART;
- xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
- //unmark last located item
- if(setup_last_pos[SETUP_ML2] != 0)
- {
- yStart = SETUP_MENU_YSTART + setup_last_pos[SETUP_ML2];
- id = setup_item[setup_last_pos[SETUP_ML1]][setup_last_pos[SETUP_ML2]][1];
- setup_itemType= SETUP_itemNormal;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- // mark current located item
- if(setup_pos[SETUP_ML2] != 0)
- {
- yStart = SETUP_MENU_YSTART + setup_pos[SETUP_ML2];
- id = setup_item[setup_pos[SETUP_ML1]][setup_pos[SETUP_ML2]][1];
- setup_itemType= SETUP_itemMark;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- //draw arrow
- if((setup_item[setup_pos[1]][setup_pos[2]][0]!=SET_SH)&&(setup_item[setup_pos[1]][setup_pos[2]][0]!=SET_LINK))
- {
- osd_DrawString(SETUP_SUB_XSTART-1, yStart, Ch_arrorR, setupFcolorAL2, setupBGcolorAL2);
- }
- }
- // for setup_level from 2 to 3, change the color of selected item
- if((setup_pos[0] == SETUP_ML3) && (setup_last_pos[0] == SETUP_ML2))
- {
- xStart = SETUP_MENU_XSTART;
- xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
- yStart = SETUP_MENU_YSTART + setup_pos[SETUP_ML2];
- id = setup_item[setup_pos[1]][setup_pos[2]][1];
- setup_itemType = SETUP_itemSelected;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- //draw arrow
- osd_DrawString(SETUP_SUB_XSTART-1, yStart, Ch_arrorR, setupFcolorAL3, setupBGcolorAL3);
- }
- }
- //====================================================================
- void setup_ShowPageL3(void)
- {
- int i;//, j;
- BYTE xStart, yStart, xLen;//, xOffset, fColor, bgColor, upDown;
- UINT8 itemType, itemSel;
- //printf("nnsetup_show_page_L3n");
- itemType = setup_item[setup_pos[1]][setup_pos[2]][0];
- xStart = SETUP_SUB_XSTART;
- xLen = SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2;
- //for setup_level = 2, up/down walking on item(2nd) level, just list all selection of this item
- if(setup_pos[0] == SETUP_ML2)
- {
- switch(itemType)
- {
- case SET_FUNC:
- itemSel = setup_sel[setup_pos[1]][setup_pos[2]];
- for(i=2; i<MAX_ITEM_SEL; i++)
- {
- id = setup_item[setup_pos[1]][setup_pos[2]][i];
- if (id == 0) break;
- yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+i+1;
- if(itemSel==i)
- setup_itemType= SETUP_itemSelected;
- else
- setup_itemType= SETUP_itemNormal;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- break;
- case SET_SCALE:
- id = setup_item[setup_pos[1]][setup_pos[2]][1];
- setup_DrawScaleForm( id, 0);
- setup_DrawScaleCursor(id, 0);
- break;
- case SET_NM:
- setup_pos[3] = setup_sel[setup_pos[1]][setup_pos[2]];
- id = setup_item[setup_pos[1]][setup_pos[2]][setup_pos[3]];
- yStart = setup_pos[2]+SETUP_MENU_YSTART;
- setup_itemType = SETUP_itemSelected;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- break;
- case SET_SH:
- case SET_NE:
- case SET_SPACE:
- break;
- }
- }
- //for setup_level from 2 to 3
- if((setup_pos[0] == SETUP_ML3) && (setup_last_pos[0] == SETUP_ML2))
- {
- switch(itemType)
- {
- case SET_FUNC:
- id = setup_item[setup_pos[1]][setup_pos[2]][setup_pos[3]];
- yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+setup_pos[3]+1;
- setup_itemType= SETUP_itemMark;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- break;
- case SET_SCALE:
- id = setup_item[setup_pos[1]][setup_pos[2]][1];
- setup_DrawScaleForm( id, 1);
- setup_DrawScaleCursor(id, 1);
- break;
- case SET_NM:
- id = setup_item[setup_pos[1]][setup_pos[2]][setup_pos[3]];
- yStart = setup_pos[2]+SETUP_MENU_YSTART;
- setup_itemType= SETUP_itemMark;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- break;
- }
- }
- //for setup_level =3, up/down walking on selection(3rd) level, highlight the corresponding selection
- if((setup_pos[0] == SETUP_ML3) && (setup_last_pos[0] == SETUP_ML3))
- {
- switch(itemType)
- {
- case SET_FUNC:
- //unmark last selection
- {
- itemSel = setup_sel[setup_pos[1]][setup_pos[2]];
- if(itemSel == setup_last_pos[3])
- setup_itemType = SETUP_itemSelected;
- else
- setup_itemType = SETUP_itemNormal;
- id = setup_item[setup_last_pos[1]][setup_last_pos[2]][setup_last_pos[3]];
- yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+setup_last_pos[3]+1;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- //mark current selection
- {
- id = setup_item[setup_pos[1]][setup_pos[2]][setup_pos[3]];
- yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+setup_pos[3]+1;
- setup_itemType = SETUP_itemMark;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- break;
- case SET_SCALE:
- id = setup_item[setup_last_pos[1]][setup_last_pos[2]][setup_last_pos[3]];
- setup_DrawScaleCursor(id, 1);
- break;
- }
- }
- }
- void setup_ExitPage(void)
- {
- ExitSetupPage(1);
- run_save_total_sel();
- //printf("run_save_total_sel()n");
- }
- //====================================================================
- void setup_ShowPageCUSTM(void)
- {
- int i;//, j;
- BYTE xStart, yStart, xLen;//, xOffset, fColor, bgColor, upDown;
- UINT8 itemType, itemSel;
- char buf[8];
- yStart=0;
- itemType = setup_item[setup_pos[1]][setup_pos[2]][0];
- //draw CUSTM page level_1 and level_2
- if(setup_last_pos[0]==0)
- {
- osd_draw_rect(0, 0, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT), setupBGcolorCUSTM);
- //level_2
- xStart = SETUP_MENU_XSTART;
- xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
- setup_itemType= SETUP_itemNormal;
- for(i=1; i<=MAX_PAGE_ITEM; i++)
- {
- yStart = SETUP_MENU_YSTART + i;
- id = setup_item[setup_pos[SETUP_ML1]][i][1];
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- setup_ShowCUSTMMsg();
- }
- //====================================================================
- //for setup_level =2, up/down walking on item(2nd) level, highlight the corresponding item
- if(setup_pos[SETUP_ML0] == SETUP_ML2)
- {
- //clear level 3 area
- osd_draw_rect((SETUP_SUB_XSTART-1)*16,
- (SETUP_MENU_YSTART+2)*SETUP_BUTTON_HEIGHT+31,
- (SETUP_MAX_WIDTH-SETUP_SUB_XSTART-1)*16,
- (SETUP_MAX_LINE-SETUP_MENU_YSTART)*SETUP_BUTTON_HEIGHT-68,
- setupBGcolorCUSTM);
- xStart = SETUP_MENU_XSTART;
- xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
- //unmark last located item
- if(setup_last_pos[SETUP_ML1] == setup_page_CUS)
- {
- yStart = SETUP_MENU_YSTART + setup_last_pos[SETUP_ML2];
- id = setup_item[setup_last_pos[SETUP_ML1]][setup_last_pos[SETUP_ML2]][1];
- setup_itemType = SETUP_itemNormal;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- // mark current located item
- if(setup_pos[SETUP_ML2] != MAX_PAGE_ITEM)
- {
- yStart = SETUP_MENU_YSTART + setup_pos[SETUP_ML2];
- id = setup_item[setup_pos[SETUP_ML1]][setup_pos[SETUP_ML2]][1];
- setup_itemType = SETUP_itemMark;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- //draw ">>" between located item and it's corresponding selection area
- if((setup_item[setup_pos[1]][setup_pos[2]][0]!=SET_SH)&&(setup_item[setup_pos[1]][setup_pos[2]][0]!=SET_LINK))
- {
- osd_DrawString(SETUP_SUB_XSTART-1, yStart, Ch_arrorR, setupFcolorAL2, setupBGcolorAL2);
- }
- //level_3
- xStart = SETUP_SUB_XSTART;
- xLen = SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2;
- switch(itemType)
- {
- case SET_FUNC:
- itemSel = setup_sel[setup_pos[1]][setup_pos[2]];
- for(i=2; i<MAX_ITEM_SEL; i++)
- {
- id = setup_item[setup_pos[1]][setup_pos[2]][i];
- if (id == 0) break;
- yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+i+1;
- if(itemSel==i)
- setup_itemType= SETUP_itemSelected;
- else
- setup_itemType= SETUP_itemNormal;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- break;
- case SET_NM:
- setup_pos[3] = setup_sel[setup_pos[1]][setup_pos[2]];
- yStart = setup_pos[2]+SETUP_MENU_YSTART;
- #ifdef SETUP_6_DIGIT_PASSWORD
- psprintf(buf, "%06d", UserSet.parent_passwd);
- #else
- psprintf(buf, "%04d", UserSet.parent_passwd);
- #endif
- osd_DrawString(xStart+1, yStart, buf, setupFcolorSS, setupBGcolorCUSTM);
- break;
- case SET_SH:
- case SET_NE:
- case SET_SPACE:
- break;
- }
- }
- //==========================================================================
- // for setup_level from 2 to 3, change the color of selected item
- if((setup_pos[0] == SETUP_ML3) && (setup_last_pos[0] == SETUP_ML2))
- {
- xStart = SETUP_MENU_XSTART;
- xLen = SETUP_SUB_XSTART-SETUP_MENU_XSTART-1;
- yStart = SETUP_MENU_YSTART + setup_pos[SETUP_ML2];
- id = setup_item[setup_pos[1]][setup_pos[2]][1];
- setup_itemType = SETUP_itemSelected;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- osd_DrawString(SETUP_SUB_XSTART-1, yStart, Ch_arrorR, setupFcolorAL3, setupBGcolorAL2);
- //level_3
- xStart = SETUP_SUB_XSTART;
- xLen = SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2;
- switch(itemType)
- {
- case SET_FUNC:
- id = setup_item[setup_pos[1]][setup_pos[2]][setup_pos[3]];
- yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+setup_pos[3]+1;
- setup_itemType = SETUP_itemMark;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- break;
- case SET_NM:
- setup_pos[3] = setup_sel[setup_pos[1]][setup_pos[2]];
- id = setup_item[setup_pos[1]][setup_pos[2]][setup_pos[3]];
- yStart = setup_pos[2]+SETUP_MENU_YSTART;
- #ifdef SETUP_6_DIGIT_PASSWORD
- psprintf(buf, "%06d", UserSet.parent_passwd);
- #else
- psprintf(buf, "%04d", UserSet.parent_passwd);
- #endif
- osd_draw_setup_button(xStart,yStart,xLen, setupBGcolorSM, 1);
- osd_DrawString(xStart+1, yStart, buf, setupFcolorSM, setupBGcolorSM);
- break;
- }
- }
- //================================================================================
- //for setup_level =3, up/down walking on selection(3rd) level, highlight the corresponding selection
- if((setup_pos[0] == SETUP_ML3) && (setup_last_pos[0] == SETUP_ML3))
- {
- xStart = SETUP_SUB_XSTART;
- xLen = SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2;
- //xOffset = 1;
- switch(itemType)
- {
- case SET_FUNC:
- //unmark last selection
- if(setup_last_pos[SETUP_ML1] == setup_page_CUS)
- {
- itemSel = setup_sel[setup_pos[1]][setup_pos[2]];
- if(itemSel == setup_last_pos[3])
- setup_itemType= SETUP_itemSelected;
- else
- setup_itemType = SETUP_itemNormal;
- id = setup_item[setup_last_pos[1]][setup_last_pos[2]][setup_last_pos[3]];
- yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+setup_last_pos[3]+1;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- //mark current selection
- {
- id = setup_item[setup_pos[1]][setup_pos[2]][setup_pos[3]];
- yStart = setup_item[setup_pos[1]][setup_pos[2]][MAX_ITEM_SEL]+setup_pos[3]+1;
- setup_itemType= SETUP_itemMark;
- setup_draw_item(xStart, yStart, xLen, id, setup_itemType);
- }
- break;
- }
- }
- if(setup_item[setup_pos[SETUP_ML1]][setup_pos[SETUP_ML2]][1]!=STR_OS_RATING) //dengh add FOR RATING_8 2004-10-13 8:46
- setup_ShowCUSTMMsg();
- }
- //====================================================================
- void setup_ShowCUSTMMsg(void)
- {
- BYTE buf[40];
- BYTE *pVersion;
- #ifdef DVD_SERVO
- extern const UINT8 ServoVersion[];
- #endif
- extern const UINT8 KernelVersion[]; // moved to libkern.a, leochen 2004/4/19 09:43