3 * Screen management header file
5 * Copyright (c) 2006-2009 Christoph Pfisterer
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the
20 * * Neither the name of Christoph Pfisterer nor the names of the
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 #define ATTR_BASIC (EFI_LIGHTGRAY | EFI_BACKGROUND_BLACK)
50 #define ATTR_ERROR (EFI_YELLOW | EFI_BACKGROUND_BLACK)
51 #define ATTR_BANNER (EFI_WHITE | EFI_BACKGROUND_BLUE)
52 #define ATTR_CHOICE_BASIC ATTR_BASIC
53 #define ATTR_CHOICE_CURRENT (EFI_WHITE | EFI_BACKGROUND_GREEN)
54 #define ATTR_SCROLLARROW (EFI_LIGHTGREEN | EFI_BACKGROUND_BLACK)
56 //#define LAYOUT_TEXT_WIDTH (512)
57 #define LAYOUT_TEXT_WIDTH (425)
58 #define LAYOUT_TOTAL_HEIGHT (368)
59 #define LAYOUT_BANNER_HEIGHT (32)
60 #define LAYOUT_BANNER_YOFFSET (LAYOUT_BANNER_HEIGHT + 32)
62 #define FONT_CELL_WIDTH (7)
63 #define FONT_CELL_HEIGHT (12)
65 extern UINTN ConWidth
;
66 extern UINTN ConHeight
;
67 extern CHAR16
*BlankLine
;
69 extern UINTN UGAWidth
;
70 extern UINTN UGAHeight
;
71 extern BOOLEAN AllowGraphicsMode
;
73 extern EG_PIXEL StdBackgroundPixel
;
74 extern EG_PIXEL MenuBackgroundPixel
;
76 VOID
InitScreen(VOID
);
77 VOID
SetupScreen(VOID
);
78 VOID
BeginTextScreen(IN CHAR16
*Title
);
79 VOID
FinishTextScreen(IN BOOLEAN WaitAlways
);
80 VOID
BeginExternalScreen(IN BOOLEAN UseGraphicsMode
, IN CHAR16
*Title
);
81 VOID
FinishExternalScreen(VOID
);
82 VOID
TerminateScreen(VOID
);
84 VOID
DebugPause(VOID
);
88 VOID
EndlessIdleLoop(VOID
);
89 VOID
PauseForKey(VOID
);
91 BOOLEAN
CheckFatalError(IN EFI_STATUS Status
, IN CHAR16
*where
);
92 BOOLEAN
CheckError(IN EFI_STATUS Status
, IN CHAR16
*where
);
94 VOID
SwitchToGraphicsAndClear(VOID
);
95 VOID
BltClearScreen(IN BOOLEAN ShowBanner
);
96 VOID
BltImage(IN EG_IMAGE
*Image
, IN UINTN XPos
, IN UINTN YPos
);
97 VOID
BltImageAlpha(IN EG_IMAGE
*Image
, IN UINTN XPos
, IN UINTN YPos
, IN EG_PIXEL
*BackgroundPixel
);
98 //VOID BltImageComposite(IN EG_IMAGE *BaseImage, IN EG_IMAGE *TopImage, IN UINTN XPos, IN UINTN YPos);
99 VOID
BltImageCompositeBadge(IN EG_IMAGE
*BaseImage
, IN EG_IMAGE
*TopImage
, IN EG_IMAGE
*BadgeImage
, IN UINTN XPos
, IN UINTN YPos
);