Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 515