Chameleon

Chameleon Svn Source Tree

Root/branches/valv/branch/i386/boot2/gui.h

  • Property svn:executable set to
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#include "boot.h"
12#include "bootstruct.h"
13#include "graphics.h"
14#include "graphic_utils.h"
15#include "picopng.h"
16
17#ifndef __BOOT2_GUI_H
18#define __BOOT2_GUI_H
19
20#define CHARACTERS_COUNT223
21
22#define BOOT_NORMAL0
23#define BOOT_VERBOSE1
24#define BOOT_IGNORECACHE2
25#define BOOT_SINGLEUSER3
26#define DO_NOT_BOOT4
27#define CLOSE_INFO_MENU5
28
29#define INFOMENU_NATIVEBOOT_START 1
30#define INFOMENU_NATIVEBOOT_END3
31
32#define MENU_SHOW_MEMORY_INFO4
33#define MENU_SHOW_VIDEO_INFO5
34#define MENU_SHOW_HELP6
35
36enum {
37HorizontalLayout= 0,
38VerticalLayout= 1,
39};
40
41enum {
42kBackspaceKey= 0x08,
43kTabKey= 0x09,
44kReturnKey= 0x0d,
45kEscapeKey= 0x1b,
46kUpArrowkey= 0x4800,
47kDownArrowkey= 0x5000,
48kASCIIKeyMask= 0x7f,
49kF2Key= 0x3c00,
50kF5Key= 0x3f00,
51kF10Key= 0x4400
52};
53
54/*
55 * Menu item structure.
56 */
57
58typedef struct {
59position_tpos;
60char*text;
61boolenabled;
62boolexpandable;
63} menuitem_t;
64
65/*
66 * Image structure.
67 */
68typedef struct {
69pixmap_t*image;
70charname[32];
71} image_t;
72
73/*
74 * Font structure.
75 */
76typedef struct {
77uint16_theight;// Font Height
78uint16_twidth;// Font Width for monospace font only
79pixmap_t*chars[CHARACTERS_COUNT];
80} font_t;
81
82/*
83 * Window structure.
84 */
85typedef struct
86{
87position_tpos;// X,Y Position of window on screen
88pixmap_t*pixmap;// Buffer
89uint16_twidth;// Width
90uint16_theight;// Height
91uint16_thborder;// Horizontal border
92uint16_tvborder;// Vertical border
93uint16_ticonspacing;// Icon spacing
94position_tcursor;// Text Cursor X,Y Position will be multiples of font width & height
95uint32_tbgcolor;// Background color AARRGGBB
96uint32_tfgcolor;// Foreground color AARRGGBB
97uint32_tfont_small_color;// Color for small font AARRGGBB
98uint32_tfont_console_color;// Color for consle font AARRGGBB
99booldraw;// Draw flag
100//resolution specifics
101uint16_thtotal;
102uint16_tvtotal;
103uint16_thsyncstart;
104uint16_thsyncend;
105uint16_tvsyncstart;
106uint16_tvsyncend;
107uint8_tmm;
108uint16_tattr;
109} window_t;
110
111/*
112 * gui structure
113 */
114typedef struct
115{
116uint8_tmaxdevices;//
117uint8_tlayout;// Horizontal or Vertical layout
118
119pixmap_t*backbuffer;// Off screen buffer
120
121window_tscreen;//
122window_tbackground;// Position of background graphic within screen
123window_tlogo;// Logo
124window_tbootprompt;// Bootprompt Window
125window_tdevicelist;// Devicelist Window
126window_tinfobox;// Infobox Window
127window_tmenu;// Menu
128
129window_tprogressbar;// Progress bar
130window_tcountdown;// Countdown text
131
132window_tdebug;// Debug
133
134boolinitialised;// Initialised
135boolredraw;// Redraw flag
136} gui_t;
137
138
139gui_t gui;// gui structure
140
141font_t font_small;
142font_t font_console;
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(int key);
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: 661