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

Archive Download this file

Revision: 469