Root/
Source at commit 2381 created 10 years 21 days ago. By ifabio, Apply patch: (Credits to Thomas Jansen aka tja) - Reading options from all devices during boot. The options for the boot menu are only read from the devices rd(0,0) or bt(0,0). Consequently, boot menu options (e.g. "Quiet Boot", "Timeout", etc.) in plists on other devices (like most users have) are ignored. This patch extends the list of paths to search for the options plist on all devices that can be found. | |
---|---|
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 | #ifndef __BOOT2_GUI_H␊ |
12 | #define __BOOT2_GUI_H␊ |
13 | ␊ |
14 | #include "boot.h"␊ |
15 | #include "bootstruct.h"␊ |
16 | #include "graphics.h"␊ |
17 | #include "graphic_utils.h"␊ |
18 | #include "picopng.h"␊ |
19 | ␊ |
20 | #define CHARACTERS_COUNT␉␉223␊ |
21 | ␊ |
22 | #define BOOT_NORMAL␉␉␉0␊ |
23 | #define BOOT_VERBOSE␉␉␉1␊ |
24 | #define BOOT_IGNORECACHE␉␉2␊ |
25 | #define BOOT_SINGLEUSER␉␉␉3␊ |
26 | #define DO_NOT_BOOT␉␉␉4␊ |
27 | #define CLOSE_INFO_MENU␉␉␉5␊ |
28 | ␊ |
29 | #define INFOMENU_NATIVEBOOT_START␉1␊ |
30 | #define INFOMENU_NATIVEBOOT_END␉␉3␊ |
31 | ␊ |
32 | #define MENU_SHOW_MEMORY_INFO␉␉4␊ |
33 | #define MENU_SHOW_VIDEO_INFO␉␉5␊ |
34 | #define MENU_SHOW_HELP␉␉␉6␊ |
35 | ␊ |
36 | enum {␊ |
37 | ␉HorizontalLayout␉= 0,␊ |
38 | ␉VerticalLayout␉␉= 1,␊ |
39 | };␊ |
40 | ␊ |
41 | /*␊ |
42 | * Menu item structure.␊ |
43 | */␊ |
44 | ␊ |
45 | typedef struct {␊ |
46 | ␉position_t␉pos;␊ |
47 | ␉char␉␉*text;␊ |
48 | ␉bool␉␉enabled;␊ |
49 | ␉bool␉␉expandable;␊ |
50 | } menuitem_t;␊ |
51 | ␊ |
52 | /*␊ |
53 | * Image structure.␊ |
54 | */␊ |
55 | typedef struct {␊ |
56 | ␉pixmap_t␉*image;␊ |
57 | ␉char␉␉name[32];␊ |
58 | } image_t;␊ |
59 | ␊ |
60 | /*␊ |
61 | * Font structure.␊ |
62 | */␊ |
63 | typedef struct {␊ |
64 | ␉uint16_t␉height;␉␉␉// Font Height ␊ |
65 | ␉uint16_t␉width;␉␉␉// Font Width for monospace font only␊ |
66 | ␉pixmap_t␉*chars[CHARACTERS_COUNT];␊ |
67 | ␉uint16_t count; // Number of chars in font␊ |
68 | } font_t;␊ |
69 | ␊ |
70 | /*␊ |
71 | * Window structure.␊ |
72 | */␊ |
73 | typedef struct␊ |
74 | {␊ |
75 | ␉position_t␉pos;␉␉␉// X,Y Position of window on screen␊ |
76 | ␉pixmap_t␉*pixmap;␉␉// Buffer␊ |
77 | ␉uint16_t␉width;␉␉␉// Width␊ |
78 | ␉uint16_t␉height;␉␉␉// Height␊ |
79 | ␉uint16_t␉hborder;␉␉// Horizontal border␊ |
80 | ␉uint16_t␉vborder;␉␉// Vertical border␊ |
81 | ␉uint16_t␉iconspacing;␉␉// Icon spacing␊ |
82 | ␉position_t␉cursor;␉␉␉// Text Cursor X,Y Position will be multiples of font width & height␊ |
83 | ␉uint32_t␉bgcolor;␉␉// Background color AARRGGBB␊ |
84 | ␉uint32_t␉fgcolor;␉␉// Foreground color AARRGGBB␊ |
85 | ␉uint32_t␉font_small_color;␉// Color for small font AARRGGBB␊ |
86 | ␉uint32_t␉font_console_color;␉// Color for consle font AARRGGBB␊ |
87 | ␉bool␉␉draw;␉␉␉// Draw flag␊ |
88 | } window_t;␊ |
89 | ␉␊ |
90 | /*␊ |
91 | * gui structure␊ |
92 | */␊ |
93 | typedef struct␊ |
94 | {␊ |
95 | ␉uint8_t␉␉maxdevices;␉␉//␊ |
96 | ␉uint8_t␉␉layout;␉␉␉// Horizontal or Vertical layout␊ |
97 | ␉␊ |
98 | ␉pixmap_t␉*backbuffer;␉␉// Off screen buffer␊ |
99 | ␊ |
100 | ␉window_t␉screen;␉␉␉// ␊ |
101 | ␉window_t␉background;␉␉// Position of background graphic within screen␊ |
102 | ␉window_t␉logo;␉␉␉// Logo␊ |
103 | ␉window_t␉bootprompt;␉␉// Bootprompt Window␊ |
104 | ␉window_t␉devicelist;␉␉// Devicelist Window␊ |
105 | ␉window_t␉infobox;␉␉// Infobox Window␊ |
106 | ␉window_t␉menu;␉␉␉// Menu␊ |
107 | ␊ |
108 | ␉window_t␉progressbar;␉␉// Progress bar␊ |
109 | ␉window_t␉countdown;␉␉// Countdown text␊ |
110 | ␉␊ |
111 | ␉window_t␉debug;␉␉␉// Debug␊ |
112 | ␊ |
113 | ␉bool␉␉initialised;␉␉// Initialised␊ |
114 | ␉bool␉␉redraw;␉␉␉// Redraw flag␊ |
115 | } gui_t;␊ |
116 | ␊ |
117 | ␊ |
118 | gui_t gui;␉␉␉␉␉// gui structure␊ |
119 | ␊ |
120 | font_t font_small;␊ |
121 | font_t font_console;␊ |
122 | ␊ |
123 | int initGUI();␊ |
124 | void drawBackground();␊ |
125 | ␊ |
126 | void setupDeviceList(config_file_t *theme);␊ |
127 | bool is_image_loaded(int i);␊ |
128 | void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected);␊ |
129 | void drawDeviceList(int start, int end, int selection);␊ |
130 | void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress);␊ |
131 | ␊ |
132 | void showInfoBox(char *title, char *text);␊ |
133 | ␊ |
134 | int dprintf( window_t * window, const char * fmt, ...);␊ |
135 | int gprintf( window_t * window, const char * fmt, ...);␊ |
136 | int␉ vprf(const char * fmt, va_list ap);␊ |
137 | ␊ |
138 | int drawInfoMenu();␊ |
139 | int updateInfoMenu(int key);␊ |
140 | void drawInfoMenuItems();␊ |
141 | ␊ |
142 | void showGraphicBootPrompt();␊ |
143 | void clearGraphicBootPrompt();␊ |
144 | void updateGraphicBootPrompt();␊ |
145 | ␊ |
146 | void updateVRAM();␊ |
147 | ␊ |
148 | position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p);␊ |
149 | void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p);␊ |
150 | void drawStrCenteredAt(char *ch, font_t *font, pixmap_t *blendInto, position_t p);␊ |
151 | ␊ |
152 | #endif /* !__BOOT2_GUI_H */␊ |
153 |