Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 2347