]> code.delx.au - refind/blob - refind/screen.h
Added "1024" as code to not change the mode to the "textmode" token.
[refind] / refind / screen.h
1 /*
2 * refit/screen.h
3 * Screen management header file
4 *
5 * Copyright (c) 2006-2009 Christoph Pfisterer
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
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
18 * distribution.
19 *
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.
23 *
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.
35 */
36
37 #ifndef __SCREEN_H_
38 #define __SCREEN_H_
39
40 #ifdef __MAKEWITH_GNUEFI
41 #include "efi.h"
42 #include "efilib.h"
43 #else
44 #include "../include/tiano_includes.h"
45 #endif
46
47 #include "libeg.h"
48
49 //
50 // screen module
51 //
52
53 #define DONT_CHANGE_TEXT_MODE 1024 /* textmode # that's a code to not change the text mode */
54
55 #define ATTR_BASIC (EFI_LIGHTGRAY | EFI_BACKGROUND_BLACK)
56 #define ATTR_ERROR (EFI_YELLOW | EFI_BACKGROUND_BLACK)
57 #define ATTR_BANNER (EFI_WHITE | EFI_BACKGROUND_BLUE)
58 #define ATTR_CHOICE_BASIC ATTR_BASIC
59 #define ATTR_CHOICE_CURRENT (EFI_WHITE | EFI_BACKGROUND_GREEN)
60 #define ATTR_SCROLLARROW (EFI_LIGHTGREEN | EFI_BACKGROUND_BLACK)
61
62 //#define LAYOUT_TEXT_WIDTH (512)
63 #define LAYOUT_TEXT_WIDTH (425)
64 #define LAYOUT_TOTAL_HEIGHT (368)
65 #define LAYOUT_BANNER_HEIGHT (32)
66 #define LAYOUT_BANNER_YOFFSET (LAYOUT_BANNER_HEIGHT + 32)
67
68 #define FONT_CELL_WIDTH (7)
69 #define FONT_CELL_HEIGHT (12)
70
71 extern UINTN ConWidth;
72 extern UINTN ConHeight;
73 extern CHAR16 *BlankLine;
74
75 extern UINTN UGAWidth;
76 extern UINTN UGAHeight;
77 extern BOOLEAN AllowGraphicsMode;
78
79 extern EG_PIXEL StdBackgroundPixel;
80 extern EG_PIXEL MenuBackgroundPixel;
81
82 VOID InitScreen(VOID);
83 VOID SetupScreen(VOID);
84 VOID BeginTextScreen(IN CHAR16 *Title);
85 VOID FinishTextScreen(IN BOOLEAN WaitAlways);
86 VOID BeginExternalScreen(IN BOOLEAN UseGraphicsMode, IN CHAR16 *Title);
87 VOID FinishExternalScreen(VOID);
88 VOID TerminateScreen(VOID);
89 #if REFIT_DEBUG > 0
90 VOID DebugPause(VOID);
91 #else
92 #define DebugPause()
93 #endif
94 VOID EndlessIdleLoop(VOID);
95 VOID PauseForKey(VOID);
96
97 BOOLEAN CheckFatalError(IN EFI_STATUS Status, IN CHAR16 *where);
98 BOOLEAN CheckError(IN EFI_STATUS Status, IN CHAR16 *where);
99
100 VOID SwitchToText(IN BOOLEAN CursorEnabled);
101 VOID SwitchToGraphics(VOID);
102
103 VOID SwitchToGraphicsAndClear(VOID);
104 VOID BltClearScreen(IN BOOLEAN ShowBanner);
105 VOID BltImage(IN EG_IMAGE *Image, IN UINTN XPos, IN UINTN YPos);
106 VOID BltImageAlpha(IN EG_IMAGE *Image, IN UINTN XPos, IN UINTN YPos, IN EG_PIXEL *BackgroundPixel);
107 //VOID BltImageComposite(IN EG_IMAGE *BaseImage, IN EG_IMAGE *TopImage, IN UINTN XPos, IN UINTN YPos);
108 VOID BltImageCompositeBadge(IN EG_IMAGE *BaseImage, IN EG_IMAGE *TopImage, IN EG_IMAGE *BadgeImage, IN UINTN XPos, IN UINTN YPos);
109
110 BOOLEAN line_edit(CHAR16 *line_in, CHAR16 **line_out, UINTN x_max);
111
112 #endif