1 | /*␊ |
2 | * gui.h␊ |
3 | * ␊ |
4 | *␊ |
5 | * Created by Jasmin Fazlic on 18.12.08.␊ |
6 | * Copyright 2008/09 Jasmin Fazlic All rights reserved.␊ |
7 | * Copyright 2008/09 iNDi All rights reserved.␊ |
8 | *␊ |
9 | */␊ |
10 | ␊ |
11 | /*␊ |
12 | * cparm : cleaned␊ |
13 | */␊ |
14 | #ifndef __BOOT2_GUI_H␊ |
15 | #define __BOOT2_GUI_H␊ |
16 | ␊ |
17 | #include "libsaio.h"␊ |
18 | #include "bootstruct.h"␊ |
19 | #include "graphic_utils.h"␊ |
20 | #include "picopng.h"␊ |
21 | #include "CoreHash.h"␊ |
22 | ␊ |
23 | int GUI_initGraphicsMode (void);␊ |
24 | int GUI_countdown( const char * msg, int row, int timeout , int *optionKey);␊ |
25 | ␊ |
26 | #define kGUIKey␉␉␉␉"GUI"␊ |
27 | #define kBootBannerKey␉␉"Boot Banner"␊ |
28 | #define envSelectIndex "GUISelIdx"␊ |
29 | ␊ |
30 | #define CHARACTERS_COUNT␉223␊ |
31 | ␊ |
32 | #define BOOT_NORMAL␉␉0␊ |
33 | #define BOOT_VERBOSE␉␉1␊ |
34 | #define BOOT_IGNORECACHE␉2␊ |
35 | #define BOOT_SINGLEUSER␉␉3␊ |
36 | #define DO_NOT_BOOT␉␉4␊ |
37 | #define CLOSE_INFO_MENU␉␉5␊ |
38 | ␊ |
39 | #define INFOMENU_NATIVEBOOT_START 1␊ |
40 | #define INFOMENU_NATIVEBOOT_END␉3␊ |
41 | ␊ |
42 | #define MENU_SHOW_MEMORY_INFO␉4␊ |
43 | #define MENU_SHOW_VIDEO_INFO␉5␊ |
44 | #define MENU_SHOW_HELP␉␉6␊ |
45 | ␊ |
46 | typedef struct {␊ |
47 | char name[80];␊ |
48 | void * param;␊ |
49 | } MenuItem;␊ |
50 | ␊ |
51 | ␊ |
52 | enum {␊ |
53 | ␉HorizontalLayout␉= 0,␊ |
54 | ␉VerticalLayout␉␉= 1,␊ |
55 | };␊ |
56 | ␊ |
57 | typedef struct themeList_t␊ |
58 | {␊ |
59 | ␉CoreHashHeader␊ |
60 | ␉unsigned char nb;␉␊ |
61 | } themeList_t;␊ |
62 | ␊ |
63 | /*␊ |
64 | * Menu item structure.␊ |
65 | */␊ |
66 | ␊ |
67 | typedef struct {␊ |
68 | ␉position_t␉pos;␊ |
69 | ␉char␉␉*text;␊ |
70 | ␉bool␉␉enabled;␊ |
71 | ␉bool␉␉expandable;␊ |
72 | } menuitem_t;␊ |
73 | ␊ |
74 | /*␊ |
75 | * Image structure.␊ |
76 | */␊ |
77 | typedef struct {␊ |
78 | ␉pixmap_t␉*image;␊ |
79 | ␉char␉␉name[32];␊ |
80 | } image_t;␊ |
81 | ␊ |
82 | /*␊ |
83 | * Font structure.␊ |
84 | */␊ |
85 | typedef struct {␊ |
86 | ␉uint16_t␉height;␉␉␉// Font Height ␊ |
87 | ␉uint16_t␉width;␉␉␉// Font Width for monospace font only␊ |
88 | ␉pixmap_t␉*chars[CHARACTERS_COUNT];␊ |
89 | ␉uint16_t count; // Number of chars in font␊ |
90 | } font_t;␊ |
91 | ␊ |
92 | /*␊ |
93 | * Window structure.␊ |
94 | */␊ |
95 | typedef struct␊ |
96 | {␊ |
97 | ␉position_t␉pos;␉␉␉// X,Y Position of window on screen␊ |
98 | ␉pixmap_t␉*pixmap;␉␉// Buffer␊ |
99 | ␉uint16_t␉width;␉␉␉// Width␊ |
100 | ␉uint16_t␉height;␉␉␉// Height␊ |
101 | ␉uint16_t␉hborder;␉␉// Horizontal border␊ |
102 | ␉uint16_t␉vborder;␉␉// Vertical border␊ |
103 | ␉uint16_t␉iconspacing;␉␉// Icon spacing␊ |
104 | ␉position_t␉cursor;␉␉␉// Text Cursor X,Y Position will be multiples of font width & height␊ |
105 | ␉uint32_t␉bgcolor;␉␉// Background color AARRGGBB␊ |
106 | ␉uint32_t␉fgcolor;␉␉// Foreground color AARRGGBB␊ |
107 | ␉uint32_t␉font_small_color;␉// Color for small font AARRGGBB␊ |
108 | ␉uint32_t␉font_console_color;␉// Color for consle font AARRGGBB␊ |
109 | ␉bool␉␉draw;␉␉␉// Draw flag␊ |
110 | } window_t;␊ |
111 | ␉␊ |
112 | /*␊ |
113 | * gui structure␊ |
114 | */␊ |
115 | typedef struct␊ |
116 | {␊ |
117 | ␉uint8_t␉␉maxdevices;␉␉//␊ |
118 | ␉uint8_t␉␉layout;␉␉␉// Horizontal or Vertical layout␊ |
119 | ␉␊ |
120 | ␉pixmap_t␉*backbuffer;␉␉// Off screen buffer␊ |
121 | ␊ |
122 | ␉window_t␉screen;␉␉␉// ␊ |
123 | ␉window_t␉background;␉␉// Position of background graphic within screen␊ |
124 | ␉window_t␉logo;␉␉␉// Logo␊ |
125 | ␉window_t␉bootprompt;␉␉// Bootprompt Window␊ |
126 | ␉window_t␉devicelist;␉␉// Devicelist Window␊ |
127 | ␉window_t␉infobox;␉␉// Infobox Window␊ |
128 | ␉window_t␉menu;␉␉␉// Menu␊ |
129 | ␊ |
130 | ␉window_t␉progressbar;␉␉// Progress bar␊ |
131 | ␉window_t␉countdown;␉␉// Countdown text␊ |
132 | ␉␊ |
133 | ␉window_t␉debug;␉␉␉// Debug␊ |
134 | ␊ |
135 | ␉bool␉␉initialised;␉␉// Initialised␊ |
136 | ␉bool␉␉redraw;␉␉␉// Redraw flag␊ |
137 | } gui_t;␊ |
138 | ␊ |
139 | ␊ |
140 | extern gui_t gui;␉␉␉␉␉// gui structure␊ |
141 | ␊ |
142 | ␊ |
143 | int initGUI();␊ |
144 | void drawBootGraphics(void);␊ |
145 | void drawBackground();␊ |
146 | void drawLogo();␊ |
147 | ␊ |
148 | ␊ |
149 | void drawDeviceList (int start, int end, int selection, MenuItem * menuItems);␊ |
150 | ␊ |
151 | void showInfoBox(char *title, char *text);␊ |
152 | ␊ |
153 | int gprintf( window_t * window, const char * fmt, ...);␊ |
154 | int␉ vprf(const char * fmt, va_list ap);␊ |
155 | ␊ |
156 | int drawInfoMenu();␊ |
157 | int updateInfoMenu(int key);␊ |
158 | ␊ |
159 | void showGraphicBootPrompt();␊ |
160 | void clearGraphicBootPrompt();␊ |
161 | void updateGraphicBootPrompt(int key);␊ |
162 | ␊ |
163 | void updateVRAM();␊ |
164 | ␊ |
165 | #endif /* !__BOOT2_GUI_H */␊ |
166 | |