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
15#include "boot.h"
16#include "bootstruct.h"
17#include "graphics.h"
18#include "graphic_utils.h"
19#include "picopng.h"
20#include "options.h"
21
22#ifndef __BOOT2_GUI_H
23#define __BOOT2_GUI_H
24
25void showTextBuffer(char *buf, int size);
26int GUI_initGraphicsMode ();
27int GUI_countdown( const char * msg, int row, int timeout );
28
29#define kGUIKey"GUI"
30#define kBootBannerKey"Boot Banner"
31
32#define CHARACTERS_COUNT223
33
34#define BOOT_NORMAL0
35#define BOOT_VERBOSE1
36#define BOOT_IGNORECACHE2
37#define BOOT_SINGLEUSER3
38#define DO_NOT_BOOT4
39#define CLOSE_INFO_MENU5
40
41#define INFOMENU_NATIVEBOOT_START 1
42#define INFOMENU_NATIVEBOOT_END3
43
44#define MENU_SHOW_MEMORY_INFO4
45#define MENU_SHOW_VIDEO_INFO5
46#define MENU_SHOW_HELP6
47
48enum {
49HorizontalLayout= 0,
50VerticalLayout= 1,
51};
52
53
54/*
55 * Menu item structure.
56 */
57
58typedef struct {
59position_tpos;
60char*text;
61boolenabled;
62boolexpandable;
63} menuitem_t;
64
65/*
66 * Image structure.
67 */
68typedef struct {
69pixmap_t*image;
70charname[32];
71} image_t;
72
73/*
74 * Font structure.
75 */
76typedef struct {
77uint16_theight;// Font Height
78uint16_twidth;// Font Width for monospace font only
79pixmap_t*chars[CHARACTERS_COUNT];
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();
134int startGUI();
135void drawBootGraphics(void);
136void drawBackground();
137void drawLogo();
138
139void setupDeviceList(config_file_t *theme);
140void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected);
141void drawDeviceList(int start, int end, int selection);
142void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress);
143
144void showInfoBox(char *title, char *text);
145
146int dprintf( window_t * window, const char * fmt, ...);
147int gprintf( window_t * window, const char * fmt, ...);
148int vprf(const char * fmt, va_list ap);
149
150int drawInfoMenu();
151int updateInfoMenu(int key);
152void drawInfoMenuItems();
153
154void showGraphicBootPrompt();
155void clearGraphicBootPrompt();
156void updateGraphicBootPrompt(int key);
157
158void updateVRAM();
159
160void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
161void drawStrCenteredAt(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
162
163#endif /* !__BOOT2_GUI_H */
164

Archive Download this file

Revision: 789