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 "libsaio.h"
18#include "bootstruct.h"
19#include "graphic_utils.h"
20#include "picopng.h"
21#include "CoreHash.h"
22
23int GUI_initGraphicsMode (void);
24int GUI_countdown( const char * msg, int row, int timeout , int *optionKey);
25
26#define kGUIKey"GUI"
27#define kBootBannerKey"Boot Banner"
28#define envSelectIndex "GUISelIdx"
29
30#define CHARACTERS_COUNT223
31
32#define BOOT_NORMAL0
33#define BOOT_VERBOSE1
34#define BOOT_IGNORECACHE2
35#define BOOT_SINGLEUSER3
36#define DO_NOT_BOOT4
37#define CLOSE_INFO_MENU5
38
39#define INFOMENU_NATIVEBOOT_START 1
40#define INFOMENU_NATIVEBOOT_END3
41
42#define MENU_SHOW_MEMORY_INFO4
43#define MENU_SHOW_VIDEO_INFO5
44#define MENU_SHOW_HELP6
45
46typedef struct {
47 char name[80];
48 void * param;
49} MenuItem;
50
51
52enum {
53HorizontalLayout= 0,
54VerticalLayout= 1,
55};
56
57typedef struct themeList_t
58{
59CoreHashHeader
60unsigned char nb;
61} themeList_t;
62
63/*
64 * Menu item structure.
65 */
66
67typedef struct {
68position_tpos;
69char*text;
70boolenabled;
71boolexpandable;
72} menuitem_t;
73
74/*
75 * Image structure.
76 */
77typedef struct {
78pixmap_t*image;
79charname[32];
80} image_t;
81
82/*
83 * Font structure.
84 */
85typedef struct {
86uint16_theight;// Font Height
87uint16_twidth;// Font Width for monospace font only
88pixmap_t*chars[CHARACTERS_COUNT];
89uint16_t count; // Number of chars in font
90} font_t;
91
92/*
93 * Window structure.
94 */
95typedef struct
96{
97position_tpos;// X,Y Position of window on screen
98pixmap_t*pixmap;// Buffer
99uint16_twidth;// Width
100uint16_theight;// Height
101uint16_thborder;// Horizontal border
102uint16_tvborder;// Vertical border
103uint16_ticonspacing;// Icon spacing
104position_tcursor;// Text Cursor X,Y Position will be multiples of font width & height
105uint32_tbgcolor;// Background color AARRGGBB
106uint32_tfgcolor;// Foreground color AARRGGBB
107uint32_tfont_small_color;// Color for small font AARRGGBB
108uint32_tfont_console_color;// Color for consle font AARRGGBB
109booldraw;// Draw flag
110} window_t;
111
112/*
113 * gui structure
114 */
115typedef struct
116{
117uint8_tmaxdevices;//
118uint8_tlayout;// Horizontal or Vertical layout
119
120pixmap_t*backbuffer;// Off screen buffer
121
122window_tscreen;//
123window_tbackground;// Position of background graphic within screen
124window_tlogo;// Logo
125window_tbootprompt;// Bootprompt Window
126window_tdevicelist;// Devicelist Window
127window_tinfobox;// Infobox Window
128window_tmenu;// Menu
129
130window_tprogressbar;// Progress bar
131window_tcountdown;// Countdown text
132
133window_tdebug;// Debug
134
135boolinitialised;// Initialised
136boolredraw;// Redraw flag
137} gui_t;
138
139
140extern gui_t gui;// gui structure
141
142
143int initGUI();
144void drawBootGraphics(void);
145void drawBackground();
146void drawLogo();
147
148
149void drawDeviceList (int start, int end, int selection, MenuItem * menuItems);
150
151void showInfoBox(char *title, char *text);
152
153int gprintf( window_t * window, const char * fmt, ...);
154int vprf(const char * fmt, va_list ap);
155
156int drawInfoMenu();
157int updateInfoMenu(int key);
158
159void showGraphicBootPrompt();
160void clearGraphicBootPrompt();
161void updateGraphicBootPrompt(int key);
162
163void updateVRAM();
164
165#endif /* !__BOOT2_GUI_H */
166

Archive Download this file

Revision: 2067