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.
40 #ifdef __MAKEWITH_GNUEFI
44 #include "../include/tiano_includes.h"
53 #define ATTR_BASIC (EFI_LIGHTGRAY | EFI_BACKGROUND_BLACK)
54 #define ATTR_ERROR (EFI_YELLOW | EFI_BACKGROUND_BLACK)
55 #define ATTR_BANNER (EFI_WHITE | EFI_BACKGROUND_BLUE)
56 #define ATTR_CHOICE_BASIC ATTR_BASIC
57 #define ATTR_CHOICE_CURRENT (EFI_WHITE | EFI_BACKGROUND_GREEN)
58 #define ATTR_SCROLLARROW (EFI_LIGHTGREEN | EFI_BACKGROUND_BLACK)
60 //#define LAYOUT_TEXT_WIDTH (512)
61 #define LAYOUT_TEXT_WIDTH (425)
62 #define LAYOUT_TOTAL_HEIGHT (368)
63 #define LAYOUT_BANNER_HEIGHT (32)
64 #define LAYOUT_BANNER_YOFFSET (LAYOUT_BANNER_HEIGHT + 32)
66 #define FONT_CELL_WIDTH (7)
67 #define FONT_CELL_HEIGHT (12)
69 extern UINTN ConWidth
;
70 extern UINTN ConHeight
;
71 extern CHAR16
*BlankLine
;
73 extern UINTN UGAWidth
;
74 extern UINTN UGAHeight
;
75 extern BOOLEAN AllowGraphicsMode
;
77 extern EG_PIXEL StdBackgroundPixel
;
78 extern EG_PIXEL MenuBackgroundPixel
;
80 VOID
InitScreen(VOID
);
81 VOID
SetupScreen(VOID
);
82 VOID
BeginTextScreen(IN CHAR16
*Title
);
83 VOID
FinishTextScreen(IN BOOLEAN WaitAlways
);
84 VOID
BeginExternalScreen(IN BOOLEAN UseGraphicsMode
, IN CHAR16
*Title
);
85 VOID
FinishExternalScreen(VOID
);
86 VOID
TerminateScreen(VOID
);
88 VOID
DebugPause(VOID
);
92 VOID
EndlessIdleLoop(VOID
);
93 VOID
PauseForKey(VOID
);
95 BOOLEAN
CheckFatalError(IN EFI_STATUS Status
, IN CHAR16
*where
);
96 BOOLEAN
CheckError(IN EFI_STATUS Status
, IN CHAR16
*where
);
98 VOID
SwitchToText(IN BOOLEAN CursorEnabled
);
99 VOID
SwitchToGraphics(VOID
);
101 VOID
SwitchToGraphicsAndClear(VOID
);
102 VOID
BltClearScreen(IN BOOLEAN ShowBanner
);
103 VOID
BltImage(IN EG_IMAGE
*Image
, IN UINTN XPos
, IN UINTN YPos
);
104 VOID
BltImageAlpha(IN EG_IMAGE
*Image
, IN UINTN XPos
, IN UINTN YPos
, IN EG_PIXEL
*BackgroundPixel
);
105 //VOID BltImageComposite(IN EG_IMAGE *BaseImage, IN EG_IMAGE *TopImage, IN UINTN XPos, IN UINTN YPos);
106 VOID
BltImageCompositeBadge(IN EG_IMAGE
*BaseImage
, IN EG_IMAGE
*TopImage
, IN EG_IMAGE
*BadgeImage
, IN UINTN XPos
, IN UINTN YPos
);
108 BOOLEAN
line_edit(CHAR16
*line_in
, CHAR16
**line_out
, UINTN x_max
, UINTN y_pos
);