Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/modules/GUI/gui.h

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

Archive Download this file

Revision: 521