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_START1
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= '\r',
42kEscapeKey= 0x1b,
43kUpArrowkey= 0x4800,
44kDownArrowkey= 0x5000,
45kASCIIKeyMask= 0x7f,
46kF2Key= 0x3c00, //Azi:autoresolution
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// Azi:autoresolution
98//resolution specifics
99uint16_thtotal;
100uint16_tvtotal;
101uint16_thsyncstart;
102uint16_thsyncend;
103uint16_tvsyncstart;
104uint16_tvsyncend;
105uint8_tmm;// Azi:autoresolution - debuginfo
106uint16_tattr;
107} window_t;
108
109/*
110 * gui structure
111 */
112typedef struct
113{
114uint8_tmaxdevices;//
115uint8_tlayout;// Horizontal or Vertical layout
116
117pixmap_t*backbuffer;// Off screen buffer
118
119window_tscreen;//
120window_tbackground;// Position of background graphic within screen
121window_tlogo;// Logo
122window_tbootprompt;// Bootprompt Window
123window_tdevicelist;// Devicelist Window
124window_tinfobox;// Infobox Window
125window_tmenu;// Menu
126
127window_tprogressbar;// Progress bar
128window_tcountdown;// Countdown text
129
130window_tdebug;// Debug
131
132boolinitialised;// Initialised
133boolredraw;// Redraw flag
134} gui_t;
135
136
137gui_t gui;// gui structure
138
139font_t font_small;
140font_t font_console;
141
142extern intgDeviceCount;
143
144int initGUI();
145void drawBackground();
146
147void setupDeviceList(config_file_t *theme);
148void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected);
149void drawDeviceList(int start, int end, int selection);
150void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress);
151
152void showInfoBox(char *title, char *text);
153
154int dprintf( window_t * window, const char * fmt, ...);
155int gprintf( window_t * window, const char * fmt, ...);
156int vprf(const char * fmt, va_list ap);
157
158int drawInfoMenu();
159int updateInfoMenu(int key);
160void drawInfoMenuItems();
161
162void showGraphicBootPrompt();
163void clearGraphicBootPrompt();
164void updateGraphicBootPrompt();
165
166void updateVRAM();
167
168void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
169void drawStrCenteredAt(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
170
171#endif /* !__BOOT2_GUI_H */
172

Archive Download this file

Revision: 1047