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

Archive Download this file

Revision: 2006