void OSDDrawList(void) { TRACEENTER(); int i; dword XStart, XEnd, Y; tMenu *pMenu; tItem *pItem; dword ItemColor; char s[4]; dword MaxNameIconWidth, MaxValueIconWidth; pMenu = &Menu[CurrentMenuLevel]; //Get maximum width of icons MaxNameIconWidth = 0; MaxValueIconWidth = 0; for(i = 0; i < pMenu->NrItems; i++) { if(pMenu->Item[i].pNameIconGd && (pMenu->Item[i].pNameIconGd->width > MaxNameIconWidth)) MaxNameIconWidth = pMenu->Item[i].pNameIconGd->width; if(pMenu->Item[i].pValueIconGd && (pMenu->Item[i].pValueIconGd->width > MaxValueIconWidth)) MaxValueIconWidth = pMenu->Item[i].pValueIconGd->width; if(pMenu->Item[i].ColorPatch && (MaxValueIconWidth < 50)) MaxValueIconWidth = 50; } if(MaxNameIconWidth) MaxNameIconWidth += 8; if(MaxValueIconWidth) MaxValueIconWidth += 8; //The background TAP_Osd_Draw3dBoxFill(OSDRgn, 60, 96, 600, 367, RGB(30, 30, 30), RGB(30, 30, 30), RGB(30, 30, 30)); for(i = 0; i < 10; i++) { pItem = &pMenu->Item[i + pMenu->CurrentTopIndex]; //Draw the background or selection bar and the optional value arrows if((i + pMenu->CurrentTopIndex) == pMenu->CurrentSelection) { OSDMenuDrawCursor(60, 95 + (i * 37), 600); if(pMenu->HasValueColumn && pItem->ValueArrows) { TAP_Osd_PutGd(OSDRgn, pMenu->ValueXPos + 20 , 95 + 10 +(i * 37), (MenuCursorType == CT_Standard ? &_pfeil_l_Gd : &_pfeil_l_bright_Gd), TRUE); TAP_Osd_PutGd(OSDRgn, 640 , 95 + 10 +(i * 37), (MenuCursorType == CT_Standard ? &_pfeil_r_Gd : &_pfeil_r_bright_Gd), TRUE); } } else { TAP_Osd_DrawRectangle(OSDRgn, 60, 130 + (i * 37), 600, 2, 1, RGB(16, 16, 16)); } XEnd = (pMenu->HasValueColumn ? pMenu->ValueXPos : 645); Y = 99 + (i * 37); if(pItem->Selectable) ItemColor = pItem->TextColor; else ItemColor = RGB(128, 128, 140); //Line numbers if(pMenu->NumberedItems) { int MaxX = 100; XStart = 101; if(pItem->CustomIndex >= 0) { TAP_SPrint(s, "%2.2d", pItem->CustomIndex); if(pItem->CustomIndex > 99) { XStart += 10; MaxX += 10; } if(pItem->CustomIndex > 999) { XStart += 10; MaxX += 10; } } else { TAP_SPrint(s, "%2.2d", i + pMenu->CurrentTopIndex + 1); if(i + pMenu->CurrentTopIndex + 1 > 99) { XStart += 10; MaxX += 10; } if(i + pMenu->CurrentTopIndex + 1 > 999) { XStart += 10; MaxX += 10; } } FMUC_PutStringAA(OSDRgn, 71, Y + 5 + FONTYOFFSET, MaxX, s, ItemColor, COLOR_None, pMenu->FontListLineNumber, FALSE, ALIGN_LEFT, 1); } else { XStart = 76; } //Icons on the left column if(pItem->pNameIconGd) TAP_Osd_PutGd(OSDRgn, XStart, Y + 13 - (pItem->pNameIconGd->height >> 1), pItem->pNameIconGd, TRUE); //The text of the left column FMUC_PutStringAA(OSDRgn, XStart + MaxNameIconWidth, Y + 5 + FONTYOFFSET, XEnd, pItem->Name, ItemColor, COLOR_None, pMenu->FontListNameColumn, TRUE, ALIGN_LEFT, 1); if(pMenu->HasValueColumn) { //The text of the right column FMUC_PutStringAA(OSDRgn, pMenu->ValueXPos + 45 + MaxValueIconWidth, Y + 5 + FONTYOFFSET, 645, pItem->Value, ItemColor, COLOR_None, pMenu->FontListValueColumn, TRUE, ALIGN_LEFT, 1); //The color patch or icon of the right column. The former has priority if(pItem->ColorPatch) { TAP_Osd_FillBox(OSDRgn, pMenu->ValueXPos + 45, Y + 5, 50, 18, (pItem->ColorPatch & 0x00ffffff) | 0xff000000); TAP_Osd_DrawRectangle(OSDRgn, pMenu->ValueXPos + 45, Y + 5, 50, 18, 1, RGB(192,192,192)); } else { if(pItem->pValueIconGd) TAP_Osd_PutGd(OSDRgn, pMenu->ValueXPos + 45 , Y + 13 - (pItem->pValueIconGd->height >> 1), pItem->pValueIconGd, TRUE); } } }
void Rect::DrawRightBorder(word regionIndex, short int thickness, word color) const { (thickness); TAP_Osd_DrawRectangle(regionIndex, x + w -2, y , 2, h, 1, color); }
void Rect::DrawBox(word regionIndex, short int thickness, word color) const { TAP_Osd_DrawRectangle(regionIndex, x , y , w, h , thickness, color); }
void Rect::DrawLowerBorder(word regionIndex, short int thickness, word color) const { (thickness); TAP_Osd_DrawRectangle(regionIndex, x, y + h - 2 , w, 2, 1, color); }
void ShowPictureWindows( int window ) { switch (window) { case 1: // Main Window. TAP_Osd_FillBox( rgn, SCREEN_X_MIN, SCREEN_Y_MIN, SCREEN_W_MAX, SCREEN_H_MAX, 0 ); // Clear the entire Main window area. TAP_Channel_Scale( CHANNEL_Main, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, FALSE ); if (guideWindowDisplayed) DisplayGuideWindow( currentSvcType, currentSvcNum ); UpdateClock( rgn, CLOCK_X, CLOCK_Y ); // Draw the clock. TAP_Osd_DrawRectangle( rgn, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, BASE_X-10, BASE_Y-HEADER_H, LOGO_WINDOW_W-BASE_X+10, LOGO_WINDOW_H-BASE_Y+HEADER_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_X-1, GDE_Y, GDE_W, GDE_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, EVENT_X, EVENT_Y, EVENT_W, EVENT_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, CLOCK_X-CLOCK_W, CLOCK_Y, CLOCK_W, CLOCK_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_SCREEN_X, GDE_SCREEN_Y, GDE_SCREEN_W, GDE_SCREEN_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, 2, COLOR_Red ); break; case 2: // PiP Window. TAP_Osd_FillBox( rgn, 0, PIP_SCRY-1, PIP_X_MAX, OSD_MAX_Y-(PIP_SCRY-1), 0 ); // Clear the entire PIP window area. TAP_Channel_Scale( CHANNEL_Sub, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, FALSE ); // define the PIP window UpdateClock( rgn, CLOCK_X, CLOCK_Y ); // Draw the clock. TAP_Osd_DrawRectangle( rgn, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, 2, COLOR_Red ); TAP_Osd_DrawRectangle( rgn, BASE_X-10, BASE_Y-HEADER_H, LOGO_WINDOW_W-BASE_X+10, LOGO_WINDOW_H-BASE_Y+HEADER_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_X-1, GDE_Y, GDE_W, GDE_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, EVENT_X, EVENT_Y, EVENT_W, EVENT_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, CLOCK_X-CLOCK_W, CLOCK_Y, CLOCK_W, CLOCK_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_SCREEN_X, GDE_SCREEN_Y, GDE_SCREEN_W, GDE_SCREEN_H, 2, COLOR_Yellow ); break; case 3: // Logo Window. TAP_Osd_FillBox( rgn, SCREEN_X_MIN, SCREEN_Y_MIN, SCREEN_W_MAX, SCREEN_H_MAX, 0 ); // Clear the entire Main window area. ActivateLogos( currentSvcType, currentSvcNum ); // draw the logos if (guideWindowDisplayed) { CloseGuideWindow(); // Close current Guide window ActivateGuideWindow(); // Reactivate with new coordinates. DisplayGuideWindow( currentSvcType, currentSvcNum ); } UpdateClock( rgn, CLOCK_X, CLOCK_Y ); // Draw the clock. TAP_Osd_DrawRectangle( rgn, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, BASE_X-10, BASE_Y-HEADER_H, LOGO_WINDOW_W-BASE_X+10, LOGO_WINDOW_H-BASE_Y+HEADER_H, 2, COLOR_Red ); TAP_Osd_DrawRectangle( rgn, BASE_X-10, LOGO_WINDOW_H, LOGO_WINDOW_W-BASE_X+10, 2, 1, COLOR_Black ); TAP_Osd_DrawRectangle( rgn, GDE_X-1, GDE_Y, GDE_W, GDE_H, 2, COLOR_Red ); TAP_Osd_DrawRectangle( rgn, EVENT_X, EVENT_Y, EVENT_W, EVENT_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, CLOCK_X-CLOCK_W, CLOCK_Y, CLOCK_W, CLOCK_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_SCREEN_X, GDE_SCREEN_Y, GDE_SCREEN_W, GDE_SCREEN_H, 2, COLOR_Yellow ); break; case 4: // Event Info Window DisplayScreenConfigWindow(window); // Redraw Event Window with new coordinates. UpdateClock( rgn, CLOCK_X, CLOCK_Y ); // Draw the clock. TAP_Osd_DrawRectangle( rgn, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, BASE_X-10, BASE_Y-HEADER_H, LOGO_WINDOW_W-BASE_X+10, LOGO_WINDOW_H-BASE_Y+HEADER_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_X-1, GDE_Y, GDE_W, GDE_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, EVENT_X, EVENT_Y, EVENT_W, EVENT_H, 2, COLOR_Red ); TAP_Osd_DrawRectangle( rgn, CLOCK_X-CLOCK_W, CLOCK_Y, CLOCK_W, CLOCK_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_SCREEN_X, GDE_SCREEN_Y, GDE_SCREEN_W, GDE_SCREEN_H, 2, COLOR_Yellow ); break; case 5: // Clock Window UpdateClock( rgn, CLOCK_X, CLOCK_Y ); // Draw the clock. TAP_Osd_DrawRectangle( rgn, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, BASE_X-10, BASE_Y-HEADER_H, LOGO_WINDOW_W-BASE_X+10, LOGO_WINDOW_H-BASE_Y+HEADER_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_X-1, GDE_Y, GDE_W, GDE_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, EVENT_X, EVENT_Y, EVENT_W, EVENT_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, CLOCK_X-CLOCK_W, CLOCK_Y, CLOCK_W, CLOCK_H, 2, COLOR_Red ); TAP_Osd_DrawRectangle( rgn, GDE_SCREEN_X, GDE_SCREEN_Y, GDE_SCREEN_W, GDE_SCREEN_H, 2, COLOR_Yellow ); break; case 6: // Main Window with Guide Window Active TAP_Osd_FillBox( rgn, LOGO_WINDOW_W+GDE_W, 0, OSD_MAX_X-(LOGO_WINDOW_W+GDE_W), EVENT_Y-1, 0 ); // Clear the entire Main window area. TAP_Channel_Scale( CHANNEL_Main, GDE_SCREEN_X, GDE_SCREEN_Y, GDE_SCREEN_W, GDE_SCREEN_H, FALSE ); if (guideWindowDisplayed) DisplayGuideWindow( currentSvcType, currentSvcNum ); UpdateClock( rgn, CLOCK_X, CLOCK_Y ); // Draw the clock. TAP_Osd_DrawRectangle( rgn, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, BASE_X-10, BASE_Y-HEADER_H, LOGO_WINDOW_W-BASE_X+10, LOGO_WINDOW_H-BASE_Y+HEADER_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_X-1, GDE_Y, GDE_W, GDE_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, EVENT_X, EVENT_Y, EVENT_W, EVENT_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, CLOCK_X-CLOCK_W, CLOCK_Y, CLOCK_W, CLOCK_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_SCREEN_X, GDE_SCREEN_Y, GDE_SCREEN_W, GDE_SCREEN_H, 2, COLOR_Red ); break; case OVERSCAN_WINDOW: // Overscan window SetOverScanSizes(); TAP_Osd_FillBox( rgn, 0, 0, OSD_MAX_X, OSD_MAX_Y, 0 ); // Clear the entire window area. ActivateLogos( currentSvcType, currentSvcNum ); // draw the logos DisplayScreenConfigWindow(window); // Redraw Event Window with new coordinates. TAP_Channel_Scale( CHANNEL_Main, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, FALSE ); TAP_Channel_Scale( CHANNEL_Sub, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, FALSE ); // define the PIP window if (guideWindowDisplayed) DisplayGuideWindow( currentSvcType, currentSvcNum ); UpdateClock( rgn, CLOCK_X, CLOCK_Y ); // Draw the clock. TAP_Osd_DrawRectangle( rgn, PIP_SCRX, PIP_SCRY, PIP_SCRW, PIP_SCRH, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, BASE_X-10, BASE_Y-HEADER_H, LOGO_WINDOW_W-BASE_X+10, LOGO_WINDOW_H-BASE_Y+HEADER_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_X-1, GDE_Y, GDE_W, GDE_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, EVENT_X, EVENT_Y, EVENT_W, EVENT_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, CLOCK_X-CLOCK_W, CLOCK_Y, CLOCK_W, CLOCK_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, SCREEN_X, SCREEN_Y, SCREEN_W, SCREEN_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, GDE_SCREEN_X, GDE_SCREEN_Y, GDE_SCREEN_W, GDE_SCREEN_H, 2, COLOR_Yellow ); TAP_Osd_DrawRectangle( rgn, OVERSCAN_X, OVERSCAN_Y, OVERSCAN_W, OVERSCAN_H, 2, COLOR_Red ); break; } }