Chameleon

Chameleon Svn Source Tree

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

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

Archive Download this file

Revision: 735