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

Archive Download this file

Revision: 1735