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

Archive Download this file

Revision: 1810