Chameleon

Chameleon Svn Source Tree

Root/trunk/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];
67} font_t;
68
69/*
70 * Window structure.
71 */
72typedef struct
73{
74position_tpos;// X,Y Position of window on screen
75pixmap_t*pixmap;// Buffer
76uint16_twidth;// Width
77uint16_theight;// Height
78uint16_thborder;// Horizontal border
79uint16_tvborder;// Vertical border
80uint16_ticonspacing;// Icon spacing
81position_tcursor;// Text Cursor X,Y Position will be multiples of font width & height
82uint32_tbgcolor;// Background color AARRGGBB
83uint32_tfgcolor;// Foreground color AARRGGBB
84uint32_tfont_small_color;// Color for small font AARRGGBB
85uint32_tfont_console_color;// Color for consle font AARRGGBB
86booldraw;// Draw flag
87} window_t;
88
89/*
90 * gui structure
91 */
92typedef struct
93{
94uint8_tmaxdevices;//
95uint8_tlayout;// Horizontal or Vertical layout
96
97pixmap_t*backbuffer;// Off screen buffer
98
99window_tscreen;//
100window_tbackground;// Position of background graphic within screen
101window_tlogo;// Logo
102window_tbootprompt;// Bootprompt Window
103window_tdevicelist;// Devicelist Window
104window_tinfobox;// Infobox Window
105window_tmenu;// Menu
106
107window_tprogressbar;// Progress bar
108window_tcountdown;// Countdown text
109
110window_tdebug;// Debug
111
112boolinitialised;// Initialised
113boolredraw;// Redraw flag
114} gui_t;
115
116
117gui_t gui;// gui structure
118
119font_t font_small;
120font_t font_console;
121
122int initGUI();
123void drawBackground();
124
125void setupDeviceList(config_file_t *theme);
126void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected);
127void drawDeviceList(int start, int end, int selection);
128void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress);
129
130void showInfoBox(char *title, char *text);
131
132int dprintf( window_t * window, const char * fmt, ...);
133int gprintf( window_t * window, const char * fmt, ...);
134int vprf(const char * fmt, va_list ap);
135
136int drawInfoMenu();
137int updateInfoMenu(int key);
138void drawInfoMenuItems();
139
140void showGraphicBootPrompt();
141void clearGraphicBootPrompt();
142void updateGraphicBootPrompt();
143
144void updateVRAM();
145
146void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
147void drawStrCenteredAt(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
148
149#endif /* !__BOOT2_GUI_H */
150

Archive Download this file

Revision: 1528