Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 399