Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/CleanCut/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#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,
49kF5Key= 0x3f00,
50kF10Key= 0x4400
51};
52
53/*
54 * Menu item structure.
55 */
56
57typedef struct {
58position_tpos;
59char*text;
60boolenabled;
61boolexpandable;
62} menuitem_t;
63
64/*
65 * Image structure.
66 */
67typedef struct {
68pixmap_t*image;
69charname[32];
70} image_t;
71
72/*
73 * Font structure.
74 */
75typedef struct {
76uint16_theight;// Font Height
77uint16_twidth;// Font Width for monospace font only
78pixmap_t*chars[CHARACTERS_COUNT];
79} font_t;
80
81/*
82 * Window structure.
83 */
84typedef struct
85{
86position_tpos;// X,Y Position of window on screen
87pixmap_t*pixmap;// Buffer
88uint16_twidth;// Width
89uint16_theight;// Height
90uint16_thborder;// Horizontal border
91uint16_tvborder;// Vertical border
92uint16_ticonspacing;// Icon spacing
93position_tcursor;// Text Cursor X,Y Position will be multiples of font width & height
94uint32_tbgcolor;// Background color AARRGGBB
95uint32_tfgcolor;// Foreground color AARRGGBB
96uint32_tfont_small_color;// Color for small font AARRGGBB
97uint32_tfont_console_color;// Color for consle font AARRGGBB
98booldraw;// Draw flag
99//resolution specifics
100uint8_tmm;// Azi: debuginfo
101uint16_tattr;
102} window_t;
103
104/*
105 * gui structure
106 */
107typedef struct
108{
109uint8_tmaxdevices;//
110uint8_tlayout;// Horizontal or Vertical layout
111
112pixmap_t*backbuffer;// Off screen buffer
113
114window_tscreen;//
115window_tbackground;// Position of background graphic within screen
116window_tlogo;// Logo
117window_tbootprompt;// Bootprompt Window
118window_tdevicelist;// Devicelist Window
119window_tinfobox;// Infobox Window
120window_tmenu;// Menu
121
122window_tprogressbar;// Progress bar
123window_tcountdown;// Countdown text
124
125window_tdebug;// Debug
126
127boolinitialised;// Initialised
128boolredraw;// Redraw flag
129} gui_t;
130
131
132gui_t gui;// gui structure
133
134font_t font_small;
135font_t font_console;
136
137int initGUI();
138void drawBackground();
139
140void setupDeviceList(config_file_t *theme);
141void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected);
142void drawDeviceList(int start, int end, int selection);
143void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress);
144
145void showInfoBox(char *title, char *text);
146
147int dprintf( window_t * window, const char * fmt, ...);
148int gprintf( window_t * window, const char * fmt, ...);
149int vprf(const char * fmt, va_list ap);
150
151int drawInfoMenu();
152int updateInfoMenu(int key);
153void drawInfoMenuItems();
154
155void showGraphicBootPrompt();
156void clearGraphicBootPrompt();
157void updateGraphicBootPrompt(int key);
158
159void updateVRAM();
160
161void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
162void drawStrCenteredAt(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
163
164#endif /* !__BOOT2_GUI_H */
165

Archive Download this file

Revision: 460