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 "options.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 | ␉char* theme;␊ |
60 | ␉unsigned char nb;␊ |
61 | ␉struct themeList_t* next;␊ |
62 | } themeList_t;␊ |
63 | ␊ |
64 | /*␊ |
65 | * Menu item structure.␊ |
66 | */␊ |
67 | ␊ |
68 | typedef struct {␊ |
69 | ␉position_t␉pos;␊ |
70 | ␉char␉␉*text;␊ |
71 | ␉bool␉␉enabled;␊ |
72 | ␉bool␉␉expandable;␊ |
73 | } menuitem_t;␊ |
74 | ␊ |
75 | /*␊ |
76 | * Image structure.␊ |
77 | */␊ |
78 | typedef struct {␊ |
79 | ␉pixmap_t␉*image;␊ |
80 | ␉char␉␉name[32];␊ |
81 | } image_t;␊ |
82 | ␊ |
83 | /*␊ |
84 | * Font structure.␊ |
85 | */␊ |
86 | typedef struct {␊ |
87 | ␉uint16_t␉height;␉␉␉// Font Height ␊ |
88 | ␉uint16_t␉width;␉␉␉// Font Width for monospace font only␊ |
89 | ␉pixmap_t␉*chars[CHARACTERS_COUNT];␊ |
90 | ␉uint16_t count; // Number of chars in font␊ |
91 | } font_t;␊ |
92 | ␊ |
93 | /*␊ |
94 | * Window structure.␊ |
95 | */␊ |
96 | typedef struct␊ |
97 | {␊ |
98 | ␉position_t␉pos;␉␉␉// X,Y Position of window on screen␊ |
99 | ␉pixmap_t␉*pixmap;␉␉// Buffer␊ |
100 | ␉uint16_t␉width;␉␉␉// Width␊ |
101 | ␉uint16_t␉height;␉␉␉// Height␊ |
102 | ␉uint16_t␉hborder;␉␉// Horizontal border␊ |
103 | ␉uint16_t␉vborder;␉␉// Vertical border␊ |
104 | ␉uint16_t␉iconspacing;␉␉// Icon spacing␊ |
105 | ␉position_t␉cursor;␉␉␉// Text Cursor X,Y Position will be multiples of font width & height␊ |
106 | ␉uint32_t␉bgcolor;␉␉// Background color AARRGGBB␊ |
107 | ␉uint32_t␉fgcolor;␉␉// Foreground color AARRGGBB␊ |
108 | ␉uint32_t␉font_small_color;␉// Color for small font AARRGGBB␊ |
109 | ␉uint32_t␉font_console_color;␉// Color for consle font AARRGGBB␊ |
110 | ␉bool␉␉draw;␉␉␉// Draw flag␊ |
111 | } window_t;␊ |
112 | ␉␊ |
113 | /*␊ |
114 | * gui structure␊ |
115 | */␊ |
116 | typedef struct␊ |
117 | {␊ |
118 | ␉uint8_t␉␉maxdevices;␉␉//␊ |
119 | ␉uint8_t␉␉layout;␉␉␉// Horizontal or Vertical layout␊ |
120 | ␉␊ |
121 | ␉pixmap_t␉*backbuffer;␉␉// Off screen buffer␊ |
122 | ␊ |
123 | ␉window_t␉screen;␉␉␉// ␊ |
124 | ␉window_t␉background;␉␉// Position of background graphic within screen␊ |
125 | ␉window_t␉logo;␉␉␉// Logo␊ |
126 | ␉window_t␉bootprompt;␉␉// Bootprompt Window␊ |
127 | ␉window_t␉devicelist;␉␉// Devicelist Window␊ |
128 | ␉window_t␉infobox;␉␉// Infobox Window␊ |
129 | ␉window_t␉menu;␉␉␉// Menu␊ |
130 | ␊ |
131 | ␉window_t␉progressbar;␉␉// Progress bar␊ |
132 | ␉window_t␉countdown;␉␉// Countdown text␊ |
133 | ␉␊ |
134 | ␉window_t␉debug;␉␉␉// Debug␊ |
135 | ␊ |
136 | ␉bool␉␉initialised;␉␉// Initialised␊ |
137 | ␉bool␉␉redraw;␉␉␉// Redraw flag␊ |
138 | } gui_t;␊ |
139 | ␊ |
140 | ␊ |
141 | extern gui_t gui;␉␉␉␉␉// gui structure␊ |
142 | ␊ |
143 | ␊ |
144 | int initGUI();␊ |
145 | void drawBootGraphics(void);␊ |
146 | void drawBackground();␊ |
147 | void drawLogo();␊ |
148 | ␊ |
149 | ␊ |
150 | void drawDeviceList (int start, int end, int selection, MenuItem * menuItems);␊ |
151 | ␊ |
152 | void showInfoBox(char *title, char *text);␊ |
153 | ␊ |
154 | int gprintf( window_t * window, const char * fmt, ...);␊ |
155 | int␉ vprf(const char * fmt, va_list ap);␊ |
156 | ␊ |
157 | int drawInfoMenu();␊ |
158 | int updateInfoMenu(int key);␊ |
159 | ␊ |
160 | void showGraphicBootPrompt();␊ |
161 | void clearGraphicBootPrompt();␊ |
162 | void updateGraphicBootPrompt(int key);␊ |
163 | ␊ |
164 | void updateVRAM();␊ |
165 | ␊ |
166 | #endif /* !__BOOT2_GUI_H */␊ |
167 | |