Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/modules/GUI/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/*
12 * cparm : cleaned
13 */
14#ifndef __BOOT2_GUI_H
15#define __BOOT2_GUI_H
16
17#include "boot.h"
18#include "bootstruct.h"
19#include "graphics.h"
20#include "graphic_utils.h"
21#include "picopng.h"
22#include "options.h"
23
24void showTextBuffer(char *buf, int size);
25int GUI_initGraphicsMode ();
26int GUI_countdown( const char * msg, int row, int timeout );
27
28#define kGUIKey"GUI"
29#define kBootBannerKey"Boot Banner"
30
31#define CHARACTERS_COUNT223
32
33#define BOOT_NORMAL0
34#define BOOT_VERBOSE1
35#define BOOT_IGNORECACHE2
36#define BOOT_SINGLEUSER3
37#define DO_NOT_BOOT4
38#define CLOSE_INFO_MENU5
39
40#define INFOMENU_NATIVEBOOT_START 1
41#define INFOMENU_NATIVEBOOT_END3
42
43#define MENU_SHOW_MEMORY_INFO4
44#define MENU_SHOW_VIDEO_INFO5
45#define MENU_SHOW_HELP6
46
47enum {
48HorizontalLayout= 0,
49VerticalLayout= 1,
50};
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 * Volume structure.
74 */
75typedef struct volume_t {
76charversion[8];
77BVRefbvr;
78struct volume_t* next;
79} volume_t;
80
81/*
82 * Font structure.
83 */
84typedef struct {
85uint16_theight;// Font Height
86uint16_twidth;// Font Width for monospace font only
87pixmap_t*chars[CHARACTERS_COUNT];
88uint16_t count; // Number of chars in font
89} font_t;
90
91/*
92 * Window structure.
93 */
94typedef struct
95{
96position_tpos;// X,Y Position of window on screen
97pixmap_t*pixmap;// Buffer
98uint16_twidth;// Width
99uint16_theight;// Height
100uint16_thborder;// Horizontal border
101uint16_tvborder;// Vertical border
102uint16_ticonspacing;// Icon spacing
103position_tcursor;// Text Cursor X,Y Position will be multiples of font width & height
104uint32_tbgcolor;// Background color AARRGGBB
105uint32_tfgcolor;// Foreground color AARRGGBB
106uint32_tfont_small_color;// Color for small font AARRGGBB
107uint32_tfont_console_color;// Color for consle font AARRGGBB
108booldraw;// Draw flag
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
139extern gui_t gui;// gui structure
140
141
142int initGUI();
143void drawBootGraphics(void);
144void drawBackground();
145void drawLogo();
146
147
148void drawDeviceList(int start, int end, int selection);
149
150void showInfoBox(char *title, char *text);
151
152int gprintf( window_t * window, const char * fmt, ...);
153int vprf(const char * fmt, va_list ap);
154
155int drawInfoMenu();
156int updateInfoMenu(int key);
157
158void showGraphicBootPrompt();
159void clearGraphicBootPrompt();
160void updateGraphicBootPrompt(int key);
161
162void updateVRAM();
163
164#endif /* !__BOOT2_GUI_H */
165

Archive Download this file

Revision: 1724