Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 676