Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 1540