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