Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/trunkAutoResolution/i386/boot2/gui.h

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_COUNT223
21
22#define BOOT_NORMAL0
23#define BOOT_VERBOSE1
24#define BOOT_IGNORECACHE2
25#define BOOT_SINGLEUSER3
26#define DO_NOT_BOOT4
27#define CLOSE_INFO_MENU5
28
29#define INFOMENU_NATIVEBOOT_START1
30#define INFOMENU_NATIVEBOOT_END3
31
32#define MENU_SHOW_MEMORY_INFO4
33#define MENU_SHOW_VIDEO_INFO5
34#define MENU_SHOW_HELP6
35
36enum {
37HorizontalLayout= 0,
38VerticalLayout= 1
39};
40
41enum {
42kBackspaceKey= 0x08,
43kTabKey= 0x09,
44kReturnKey= '\r',
45kEscapeKey= 0x1b,
46kUpArrowkey= 0x4800,
47kDownArrowkey= 0x5000,
48kASCIIKeyMask= 0x7f,
49kF2Key= 0x3c00, //Azi:autoresolution
50kF5Key= 0x3f00,
51kF10Key= 0x4400
52};
53
54/*
55 * Menu item structure.
56 */
57
58typedef struct {
59position_tpos;
60char*text;
61boolenabled;
62boolexpandable;
63} menuitem_t;
64
65/*
66 * Image structure.
67 */
68typedef struct {
69pixmap_t*image;
70charname[32];
71} image_t;
72
73/*
74 * Font structure.
75 */
76typedef struct {
77uint16_theight;// Font Height
78uint16_twidth;// Font Width for monospace font only
79pixmap_t*chars[CHARACTERS_COUNT];
80} font_t;
81
82/*
83 * Window structure.
84 */
85typedef struct
86{
87position_tpos;// X,Y Position of window on screen
88pixmap_t*pixmap;// Buffer
89uint16_twidth;// Width
90uint16_theight;// Height
91uint16_thborder;// Horizontal border
92uint16_tvborder;// Vertical border
93uint16_ticonspacing;// Icon spacing
94position_tcursor;// Text Cursor X,Y Position will be multiples of font width & height
95uint32_tbgcolor;// Background color AARRGGBB
96uint32_tfgcolor;// Foreground color AARRGGBB
97uint32_tfont_small_color;// Color for small font AARRGGBB
98uint32_tfont_console_color;// Color for consle font AARRGGBB
99booldraw;// Draw flag
100// Azi:autoresolution
101//resolution specifics
102uint16_thtotal;
103uint16_tvtotal;
104uint16_thsyncstart;
105uint16_thsyncend;
106uint16_tvsyncstart;
107uint16_tvsyncend;
108uint8_tmm;
109uint16_tattr;
110} window_t;
111
112/*
113 * gui structure
114 */
115typedef struct
116{
117uint8_tmaxdevices;//
118uint8_tlayout;// Horizontal or Vertical layout
119
120pixmap_t*backbuffer;// Off screen buffer
121
122window_tscreen;//
123window_tbackground;// Position of background graphic within screen
124window_tlogo;// Logo
125window_tbootprompt;// Bootprompt Window
126window_tdevicelist;// Devicelist Window
127window_tinfobox;// Infobox Window
128window_tmenu;// Menu
129
130window_tprogressbar;// Progress bar
131window_tcountdown;// Countdown text
132
133window_tdebug;// Debug
134
135boolinitialised;// Initialised
136boolredraw;// Redraw flag
137} gui_t;
138
139
140gui_t gui;// gui structure
141
142font_t font_small;
143font_t font_console;
144
145int initGUI();
146void drawBackground();
147
148void setupDeviceList(config_file_t *theme);
149void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected);
150void drawDeviceList(int start, int end, int selection);
151void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress);
152
153void showInfoBox(char *title, char *text);
154
155int dprintf( window_t * window, const char * fmt, ...);
156int gprintf( window_t * window, const char * fmt, ...);
157int vprf(const char * fmt, va_list ap);
158
159int drawInfoMenu();
160int updateInfoMenu(int key);
161void drawInfoMenuItems();
162
163void showGraphicBootPrompt();
164void clearGraphicBootPrompt();
165void updateGraphicBootPrompt();
166
167void updateVRAM();
168
169void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
170void drawStrCenteredAt(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
171
172#endif /* !__BOOT2_GUI_H */
173

Archive Download this file

Revision: 1039