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//Azi:include
12//#include "boot.h" - included on graphics.h
13//#include "bootstruct.h" - same as above
14//#include "graphic_utils.h" - same as above
15#include "graphics.h"
16#include "picopng.h"
17
18#ifndef __BOOT2_GUI_H
19#define __BOOT2_GUI_H
20
21#define CHARACTERS_COUNT223
22
23#define BOOT_NORMAL0
24#define BOOT_VERBOSE1
25#define BOOT_IGNORECACHE2
26#define BOOT_SINGLEUSER3
27#define DO_NOT_BOOT4
28#define CLOSE_INFO_MENU5
29
30#define INFOMENU_NATIVEBOOT_START 1
31#define INFOMENU_NATIVEBOOT_END3
32
33#define MENU_SHOW_MEMORY_INFO4
34#define MENU_SHOW_VIDEO_INFO5
35#define MENU_SHOW_HELP6
36
37enum {
38HorizontalLayout= 0,
39VerticalLayout= 1,
40};
41
42enum {
43kBackspaceKey= 0x08,
44kTabKey= 0x09,
45kReturnKey= 0x0d,
46kEscapeKey= 0x1b,
47kUpArrowkey= 0x4800,
48kDownArrowkey= 0x5000,
49kASCIIKeyMask= 0x7f,
50kF2Key= 0x3c00,
51kF5Key= 0x3f00,
52kF10Key= 0x4400
53};
54
55/*
56 * Menu item structure.
57 */
58
59typedef struct {
60position_tpos;
61char*text;
62boolenabled;
63boolexpandable;
64} menuitem_t;
65
66/*
67 * Image structure.
68 */
69typedef struct {
70pixmap_t*image;
71charname[32];
72} image_t;
73
74/*
75 * Font structure.
76 */
77typedef struct {
78uint16_theight;// Font Height
79uint16_twidth;// Font Width for monospace font only
80pixmap_t*chars[CHARACTERS_COUNT];
81} font_t;
82
83/*
84 * Window structure.
85 */
86typedef struct
87{
88position_tpos;// X,Y Position of window on screen
89pixmap_t*pixmap;// Buffer
90uint16_twidth;// Width
91uint16_theight;// Height
92uint16_thborder;// Horizontal border
93uint16_tvborder;// Vertical border
94uint16_ticonspacing;// Icon spacing
95position_tcursor;// Text Cursor X,Y Position will be multiples of font width & height
96uint32_tbgcolor;// Background color AARRGGBB
97uint32_tfgcolor;// Foreground color AARRGGBB
98uint32_tfont_small_color;// Color for small font AARRGGBB
99uint32_tfont_console_color;// Color for consle font AARRGGBB
100booldraw;// Draw flag
101//resolution specifics
102uint16_thtotal;
103uint16_tvtotal;
104uint16_thsyncstart;
105uint16_thsyncend;
106uint16_tvsyncstart;
107uint16_tvsyncend;
108uint8_tmm;// Azi:autoresolution - debuginfo
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(int key);
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: 470