1 | /*␊ |
2 | *␊ |
3 | * Copyright (c) 2012-2013 Cadet-Petit Armel␊ |
4 | * All rights reserved.␊ |
5 | *␊ |
6 | * Redistribution and use in source and binary forms, with or without␊ |
7 | * modification, are permitted provided that the following conditions are␊ |
8 | * met:␊ |
9 | *␊ |
10 | * * Redistributions of source code must retain the above copyright␊ |
11 | * notice, this list of conditions and the following disclaimer.␊ |
12 | *␊ |
13 | * * Redistributions in binary form must reproduce the above copyright␊ |
14 | * notice, this list of conditions and the following disclaimer in the␊ |
15 | * documentation and/or other materials provided with the␊ |
16 | * distribution.␊ |
17 | *␊ |
18 | * * Neither the name of Cadet-Petit Armel nor the names of the␊ |
19 | * contributors may be used to endorse or promote products derived␊ |
20 | * from this software without specific prior written permission.␊ |
21 | *␊ |
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS␊ |
23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT␊ |
24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR␊ |
25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT␊ |
26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,␊ |
27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT␊ |
28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,␊ |
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY␊ |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT␊ |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE␊ |
32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.␊ |
33 | */␊ |
34 | ␊ |
35 | #include "libegint.h"␊ |
36 | #include <xml.h>␊ |
37 | #include <IOGraphics.h>␊ |
38 | #include <pexpert/i386/modules.h>␊ |
39 | #include <sys/time.h>␊ |
40 | #include <ctype.h>␊ |
41 | #include <string.h>␊ |
42 | #include "pngfile.h"␊ |
43 | ␊ |
44 | //#include "art.h"␊ |
45 | ␊ |
46 | ␊ |
47 | #ifndef DEBUG_TRYME␊ |
48 | #define DEBUG_TRYME 0␊ |
49 | #endif␊ |
50 | ␊ |
51 | #if DEBUG_TRYME␊ |
52 | #define DBG(x...)␉␉printf(x)␊ |
53 | #else␊ |
54 | #define DBG(x...)␊ |
55 | #endif␊ |
56 | ␊ |
57 | #ifndef MIN␊ |
58 | #define MIN(x, y) ((x) < (y) ? (x) : (y))␊ |
59 | #endif␊ |
60 | ␊ |
61 | #ifndef MAX␊ |
62 | #define MAX(x, y) ((x) > (y) ? (x) : (y))␊ |
63 | #endif␊ |
64 | ␊ |
65 | #define VIDEO(x) (((boot_args*)getBootArgs())->Video.v_ ## x)␊ |
66 | ␊ |
67 | #define vram VIDEO(baseAddr)␊ |
68 | ␊ |
69 | #define arc4random_unirange(lo,hi) arc4random_uniform(hi - lo + 1) + lo␊ |
70 | #define arc4random_range(lo,hi) (arc4random() % (hi - lo + 1)) + lo␊ |
71 | ␊ |
72 | EG_PIXEL StdBackgroundPixel = { 0xbf, 0xbf, 0xbf, 0 };␊ |
73 | EG_PIXEL MenuBackgroundPixel = { 0xbf, 0xbf, 0xbf, 0 };␊ |
74 | EG_PIXEL BlackColor = { 0xff, 0xff, 0xff, 0 };␊ |
75 | ␊ |
76 | extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name,␊ |
77 | long *flags, long *time);␊ |
78 | extern long GetFileInfo(const char *dirSpec, const char *name,␊ |
79 | long *flags, long *time);␊ |
80 | ␊ |
81 | extern int getc(void);␊ |
82 | ␊ |
83 | #define DEFAULT_SCREEN_WIDTH 1024␊ |
84 | #define DEFAULT_SCREEN_HEIGHT 768␊ |
85 | ␊ |
86 | #define VGA_TEXT_MODE␉␉ 0␊ |
87 | #define GRAPHICS_MODE 1␊ |
88 | #define FB_TEXT_MODE 2␊ |
89 | ␊ |
90 | unsigned long screen_params[4] = {DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, 32, 0};␉// here we store the used screen resolution␊ |
91 | config_file_t themeConfig;␉␉␉␉ // theme.plist␊ |
92 | ␊ |
93 | bool LoadEmbedGui(void);␊ |
94 | ␊ |
95 | #define CHARACTERS_COUNT␉223␊ |
96 | ␊ |
97 | /*␊ |
98 | * Font structure.␊ |
99 | */␊ |
100 | typedef struct {␊ |
101 | ␉UINTN␉Height;␉␉␉// Font Height␊ |
102 | ␉UINTN␉Width;␉␉␉// Font Width for monospace font only␊ |
103 | ␉EG_IMAGE␉*chars[CHARACTERS_COUNT];␊ |
104 | ␉UINTN count; // Number of chars in font␊ |
105 | } EG_FONT;␊ |
106 | ␊ |
107 | typedef union {␊ |
108 | struct {␊ |
109 | UINT8 b;␊ |
110 | UINT8 g;␊ |
111 | UINT8 r;␊ |
112 | UINT8 a;␊ |
113 | } ch;␊ |
114 | UINT8 channel[4];␊ |
115 | UINT32 value;␊ |
116 | } EG_LEGACY_PIXEL;␊ |
117 | ␊ |
118 | typedef struct {␊ |
119 | UINT16␉height;␊ |
120 | UINT16␉width;␊ |
121 | EG_LEGACY_PIXEL*␉pixels;␊ |
122 | } EG_LEGACY_IMAGE;␊ |
123 | ␊ |
124 | typedef struct {␊ |
125 | UINT32 x;␊ |
126 | UINT32 y;␊ |
127 | } EG_POSITION;␊ |
128 | ␊ |
129 | #define PIXEL(p,x,y) ((p)->PixelData[(x) + (y) * (p)->Width])␊ |
130 | #define LEGACY_PIXEL(p,x,y,w) (((EG_LEGACY_PIXEL*)(p))[(x) + (y) * (w)])␊ |
131 | ␊ |
132 | // File Permissions and Types␊ |
133 | enum {␊ |
134 | kPermOtherExecute = 1 << 0,␊ |
135 | kPermOtherWrite = 1 << 1,␊ |
136 | kPermOtherRead = 1 << 2,␊ |
137 | kPermGroupExecute = 1 << 3,␊ |
138 | kPermGroupWrite = 1 << 4,␊ |
139 | kPermGroupRead = 1 << 5,␊ |
140 | kPermOwnerExecute = 1 << 6,␊ |
141 | kPermOwnerWrite = 1 << 7,␊ |
142 | kPermOwnerRead = 1 << 8,␊ |
143 | kPermMask = 0x1FF,␊ |
144 | kOwnerNotRoot = 1 << 9,␊ |
145 | kFileTypeUnknown = 0x0 << 16,␊ |
146 | kFileTypeFlat = 0x1 << 16,␊ |
147 | kFileTypeDirectory = 0x2 << 16,␊ |
148 | kFileTypeLink = 0x3 << 16,␊ |
149 | kFileTypeMask = 0x3 << 16␊ |
150 | };␊ |
151 | ␊ |
152 | static long long␊ |
153 | timeval_diff(struct timeval *difference,␊ |
154 | struct timeval *end_time,␊ |
155 | struct timeval *start_time␊ |
156 | )␊ |
157 | {␊ |
158 | struct timeval temp_diff;␊ |
159 | ␊ |
160 | if(difference==NULL)␊ |
161 | {␊ |
162 | difference=&temp_diff;␊ |
163 | }␊ |
164 | ␊ |
165 | difference->tv_sec =end_time->tv_sec -start_time->tv_sec ;␊ |
166 | difference->tv_usec=end_time->tv_usec-start_time->tv_usec;␊ |
167 | ␊ |
168 | /* Using while instead of if below makes the code slightly more robust. */␊ |
169 | ␊ |
170 | while(difference->tv_usec<0)␊ |
171 | {␊ |
172 | difference->tv_usec+=1000000;␊ |
173 | difference->tv_sec -=1;␊ |
174 | }␊ |
175 | ␊ |
176 | return 1000000LL*difference->tv_sec+␊ |
177 | difference->tv_usec;␊ |
178 | ␊ |
179 | } ␊ |
180 | ␊ |
181 | extern const char *getToken(const char *line, const char **begin, int *len);␊ |
182 | ␊ |
183 | bool getValueForConfigTableKey(config_file_t *config, const char *key, const char **val, int *size)␊ |
184 | {␊ |
185 | ␊ |
186 | ␉if (config->dictionary != 0 ) {␊ |
187 | ␉␉// Look up key in XML dictionary␊ |
188 | ␉␉TagPtr value;␊ |
189 | ␉␉value = XMLGetProperty(config->dictionary, key);␊ |
190 | ␉␉if (value != 0) {␊ |
191 | ␉␉␉if (value->type != kTagTypeString) {␊ |
192 | ␉␉␉␉printf("Non-string tag '%s' found in config file\n",␊ |
193 | ␉␉␉␉␉ key);␊ |
194 | ␉␉␉␉abort();␊ |
195 | ␉␉␉␉return false;␊ |
196 | ␉␉␉}␊ |
197 | ␉␉␉*val = value->string;␊ |
198 | ␉␉␉*size = strlen(value->string);␊ |
199 | ␉␉␉return true;␊ |
200 | ␉␉}␊ |
201 | ␉} else {␊ |
202 | ␉␉␊ |
203 | ␉␉// Legacy plist-style table␊ |
204 | ␉␉␊ |
205 | ␉}␊ |
206 | ␉␊ |
207 | ␉return false;␊ |
208 | }␊ |
209 | ␊ |
210 | extern bool getValueForBootKey(const char *line, const char *match, const char **matchval, int *len);␊ |
211 | extern bool getValueForKey( const char *key, const char **val, int *size, config_file_t *config );␊ |
212 | extern bool getIntForKey(const char *key, int *val, config_file_t *configBuff);␊ |
213 | extern int loadConfigFile(const char *configFile, config_file_t *configBuff);␊ |
214 | ␊ |
215 | static bool getDimensionForKey( const char *key, unsigned int *value, config_file_t *config, unsigned int dimension_max, unsigned int object_size )␊ |
216 | {␊ |
217 | ␉const char *val;␊ |
218 | ␉␊ |
219 | int size = 0;␊ |
220 | ␉int sum = 0;␊ |
221 | ␊ |
222 | ␉bool negative = false;␊ |
223 | ␉bool percentage = false; ␊ |
224 | ␉␊ |
225 | if (getValueForKey(key, &val, &size, config))␊ |
226 | ␉{␊ |
227 | ␉␉if ( size )␊ |
228 | ␉␉{␊ |
229 | ␉␉␉if (*val == '-')␊ |
230 | ␉␉␉{␊ |
231 | ␉␉␉␉negative = true;␊ |
232 | ␉␉␉␉val++;␊ |
233 | ␉␉␉␉size--;␊ |
234 | ␉␉␉}␊ |
235 | ␉␉␉␊ |
236 | ␉␉␉if (val[size-1] == '%')␊ |
237 | ␉␉␉{␊ |
238 | ␉␉␉␉percentage = true;␊ |
239 | ␉␉␉␉size--;␊ |
240 | ␉␉␉}␊ |
241 | ␉␉␉␊ |
242 | ␉␉␉// convert string to integer␊ |
243 | ␉␉␉for (sum = 0; size > 0; size--)␊ |
244 | ␉␉␉{␊ |
245 | ␉␉␉␉if (*val < '0' || *val > '9')␊ |
246 | ␉␉␉␉␉return false;␊ |
247 | ␉␉␉␉␊ |
248 | ␉␉␉␉sum = (sum * 10) + (*val++ - '0');␊ |
249 | ␉␉␉}␊ |
250 | ␉␉␉␊ |
251 | ␉␉␉if (percentage)␊ |
252 | ␉␉␉␉sum = ( dimension_max * sum ) / 100;␊ |
253 | ␉␉␉␊ |
254 | ␉␉␉// calculate offset from opposite origin␊ |
255 | ␉␉␉if (negative)␊ |
256 | ␉␉␉␉sum = ( ( dimension_max - object_size ) - sum );␊ |
257 | ␉␉␉␊ |
258 | ␉␉} else {␊ |
259 | ␉␉␉␊ |
260 | ␉␉␉// null value calculate center␊ |
261 | ␉␉␉sum = ( dimension_max - object_size ) / 2;␊ |
262 | ␉␉␉␊ |
263 | ␉␉}␊ |
264 | ␉␉␊ |
265 | ␉␉*value = (uint16_t) sum;␊ |
266 | ␉␉return true;␊ |
267 | ␉}␊ |
268 | ␉␊ |
269 | ␉// key not found␊ |
270 | return false;␊ |
271 | }␊ |
272 | ␊ |
273 | static bool getColorForKey( const char *key, unsigned int *value, config_file_t *config )␊ |
274 | {␊ |
275 | const char *val;␊ |
276 | int size;␊ |
277 | ␊ |
278 | if (getValueForKey(key, &val, &size, config))␊ |
279 | ␉{␊ |
280 | ␉␉if (*val == '#')␊ |
281 | ␉␉{␊ |
282 | val++;␊ |
283 | ␉␉␉*value = strtol(val, NULL, 16);␊ |
284 | ␉␉␉return true;␊ |
285 | }␊ |
286 | }␊ |
287 | return false;␊ |
288 | }␊ |
289 | ␊ |
290 | BOOLEAN LoadGui(VOID)␊ |
291 | {␊ |
292 | ␉␊ |
293 | ␉int␉␉␉␉␉val;␊ |
294 | ␉long long␉ index = 0;␉␊ |
295 | ␉uint32_t color = 0 ;␉␉␉// color value formatted RRGGBB␊ |
296 | ␉unsigned int pixel;␊ |
297 | EG_IMAGE_VIEW * deviceView = NULL;␊ |
298 | //EG_IMAGE_VIEW *PoofImageView[5] ;␊ |
299 | EG_IMAGE_VIEW * iconeRef = NULL;␊ |
300 | ␉EG_VIEW * screen = NULL;␊ |
301 | ␊ |
302 | ␉UINT8␉ImagesType = 0;␊ |
303 | ␉␊ |
304 | ␉long ret, length, flags, time;␊ |
305 | ␉CONST␉CHAR8 * name;␊ |
306 | ␊ |
307 | ␉CHAR8 dirspec[512];␊ |
308 | ␉BOOLEAN THEMEDIR_FOUND = FALSE;␊ |
309 | ␉␊ |
310 | ␉ret = GetFileInfo("rd(0,0)/Extra/Themes/", "Default", &flags, &time);␊ |
311 | ␉if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) ␊ |
312 | ␉{␊ |
313 | ␉␉snprintf(dirspec, sizeof(dirspec),"rd(0,0)/Extra/Themes/Default/");␊ |
314 | ␉␉THEMEDIR_FOUND = TRUE;␊ |
315 | ␉␉␊ |
316 | ␉}␊ |
317 | ␉else␊ |
318 | ␉{␊ |
319 | ␉␉␊ |
320 | ␉␉ret = GetFileInfo("/Extra/Themes/", "Default", &flags, &time);␊ |
321 | ␉␉if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory))␊ |
322 | ␉␉{␊ |
323 | ␉␉␉snprintf(dirspec, sizeof(dirspec), "/Extra/Themes/Default/");␊ |
324 | ␉␉␉THEMEDIR_FOUND = TRUE;␊ |
325 | ␉␉␉␊ |
326 | ␉␉}␊ |
327 | ␉␉else␊ |
328 | ␉␉{␊ |
329 | ␉␉␉ret = GetFileInfo("bt(0,0)/Extra/Themes/", "Default", &flags, &time);␊ |
330 | ␉␉␉if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory))␊ |
331 | ␉␉␉{␊ |
332 | ␉␉␉␉snprintf(dirspec, sizeof(dirspec),"bt(0,0)/Extra/Themes/Default/");␊ |
333 | ␉␉␉␉THEMEDIR_FOUND = TRUE;␊ |
334 | ␉␉␉␉␊ |
335 | ␉␉␉} ␊ |
336 | ␉␉}␊ |
337 | ␉}␊ |
338 | ␉␊ |
339 | ␉if (THEMEDIR_FOUND == FALSE)␊ |
340 | ␉{␊ |
341 | ␉␉return FALSE;␊ |
342 | ␉}␊ |
343 | ␉␊ |
344 | ␉{␊ |
345 | ␉␉// parse themeconfig file␊ |
346 | ␉␉CHAR8 configdirspec[1024];␊ |
347 | ␉␉snprintf(configdirspec, sizeof(configdirspec), "%stheme.plist",dirspec);␊ |
348 | ␉␉␊ |
349 | ␉␉if (loadConfigFile (configdirspec, &themeConfig) != 0)␊ |
350 | ␉␉{␊ |
351 | ␉␉␉DBG("Unable to load embed theme plist datas.\n");␊ |
352 | ␉␉␉␊ |
353 | ␉␉␉return FALSE;␊ |
354 | ␉␉}␉␉␉␉␊ |
355 | ␉␉␊ |
356 | ␉␉DBG("themeconfig file parsed\n");␊ |
357 | ␉␉␊ |
358 | ␉␉// parse display size parameters (if any)␊ |
359 | ␉␉if (getIntForKey("screen_width", &val, &themeConfig) && val > 0) {␊ |
360 | ␉␉␉screen_params[0] = val;␊ |
361 | ␉␉}␊ |
362 | ␉␉if (getIntForKey("screen_height", &val, &themeConfig) && val > 0) {␊ |
363 | ␉␉␉screen_params[1] = val;␊ |
364 | ␉␉}␉␊ |
365 | ␉␉␊ |
366 | ␉␉screen = egCreateView(screen_params[0], screen_params[1], TRUE);␊ |
367 | ␉␉if (!screen) {␉␉␊ |
368 | ␉␉␉␊ |
369 | ␉␉␉return FALSE;␊ |
370 | ␉␉} ␊ |
371 | ␉␉DBG("screen buffer created\n");␊ |
372 | ␉␉␊ |
373 | ␉␉if(getColorForKey("screen_bgcolor", &color, &themeConfig) && color)␊ |
374 | ␉␉{␊ |
375 | ␉␉␉color = (color & 0x00FFFFFF);␉␉␊ |
376 | ␉␉␉EG_PIXEL Color;␊ |
377 | ␉␉␉␊ |
378 | ␉␉␉Color.r = ((color >> 16) & 0xFF) ; ␊ |
379 | ␉␉␉Color.g = ((color >> 8) & 0xFF) ; ␊ |
380 | ␉␉␉Color.b = ((color) & 0xFF) ;␊ |
381 | ␉␉␉Color.a = 255;␊ |
382 | ␉␉␉egViewSetBackgroundColor(screen,&Color); ␊ |
383 | ␉␉␉␊ |
384 | ␉␉}␊ |
385 | ␉␉else␊ |
386 | ␉␉{␊ |
387 | ␉␉␉// flush CompImage␊ |
388 | ␉␉␉EG_PIXEL Color;␊ |
389 | ␉␉␉Color.r = 0 ;␊ |
390 | ␉␉␉Color.g = 0 ;␊ |
391 | ␉␉␉Color.b = 0 ;␊ |
392 | ␉␉␉Color.a = 0;␊ |
393 | ␉␉␉egViewSetBackgroundColor(screen,&Color); ␊ |
394 | ␉␉␉␊ |
395 | ␉␉}␊ |
396 | ␉}␊ |
397 | ␉␊ |
398 | ␉while (1) {␊ |
399 | ␉␉ret = GetDirEntry(dirspec, &index, &name, &flags, &time);␊ |
400 | ␉␉if (ret == -1) break;␊ |
401 | ␊ |
402 | ␉␉if (!name) continue;␊ |
403 | ␉␉␊ |
404 | ␉␉DBG("testing %s\n", name);␊ |
405 | ␉␉␊ |
406 | ␉␉// Make sure this is a not directory.␊ |
407 | ␉␉if ((flags & kFileTypeMask) != kFileTypeFlat) continue;␉␉␊ |
408 | ␉␉␊ |
409 | ␉␉length = AsciiStrLen(name);␊ |
410 | ␉␉␊ |
411 | ␉␉if (!length) continue;␊ |
412 | ␊ |
413 | ␉␉// Make sure the image file is supported.␊ |
414 | ␉␉{␊ |
415 | ␉␉␉if (AsciiStriCmp(name + length - 4, ".png") == 0)␊ |
416 | ␉␉␉{␊ |
417 | ␉␉␉␉ImagesType = 1 ;//"PNG"␊ |
418 | ␉␉␉}␊ |
419 | ␉␉␉else if (AsciiStriCmp(name + length - 4, ".bmp") == 0) ␊ |
420 | ␉␉␉{␊ |
421 | ␉␉␉␉ImagesType = 2 ;//"BMP"␊ |
422 | ␉␉␉␉␊ |
423 | ␉␉␉}␊ |
424 | ␉␉␉else if (AsciiStriCmp(name + length - 4, ".icns") == 0)␊ |
425 | ␉␉␉{␊ |
426 | ␉␉␉␉ImagesType = 3 ;//"ICNS"␊ |
427 | ␉␉␉}␉␉␉␊ |
428 | ␉␉␉else␊ |
429 | ␉␉␉{␊ |
430 | ␉␉␉␉DBG("Image %s format is not supported and will be ignored\n", name);␊ |
431 | ␉␉␉␉continue;␊ |
432 | ␉␉␉}␊ |
433 | ␉␉}␊ |
434 | ␉␉␉␉␊ |
435 | ␉␉if (!(ImagesType > 0)) {␊ |
436 | ␉␉␉continue;␊ |
437 | ␉␉}␊ |
438 | ␉␉␊ |
439 | ␉␉CHAR8 FilePath8[1024];␉␉␊ |
440 | ␉␉snprintf(FilePath8, sizeof(FilePath8), "%s%s",dirspec,name);␊ |
441 | ␉␉␊ |
442 | ␉␉//CHAR16 FilePath[1024];␊ |
443 | ␉␉//AsciiStrToUnicodeStr(FilePath8, FilePath);␉␉␊ |
444 | ␉␉␊ |
445 | ␉␉DBG("loading %s\n", name);␊ |
446 | ␉␉EG_IMAGE * image = NULL/*egLoadImage(FilePath, TRUE)*/;␊ |
447 | ␉␉␊ |
448 | ␉␉//if (!image) continue;␊ |
449 | ␉␉␊ |
450 | ␉␉{␊ |
451 | ␉␉␉void *BkgColor = NULL;␊ |
452 | ␉␉␉const char*pstrFileName = FilePath8;␊ |
453 | ␉␉␉int piWidth = 0;␊ |
454 | ␉␉␉int piHeight = 0;␊ |
455 | ␉␉␉unsigned char *ppbImageData = NULL ;␊ |
456 | ␉␉␉int piChannels = 0;␊ |
457 | ␉␉␉bool ret ;␊ |
458 | ␉␉␉ret = PngLoadImage (pstrFileName, &ppbImageData,␊ |
459 | ␉␉␉␉␉␉␉␉&piWidth, &piHeight, &piChannels, BkgColor);␊ |
460 | ␉␉␉␊ |
461 | ␉␉␉if (ret != FALSE) {␊ |
462 | ␉␉␉␉␊ |
463 | ␉␉␉␉image = egCreateImageFromData((EG_PIXEL *)ppbImageData, piWidth, piHeight, (piChannels == 4) ? TRUE : FALSE, TRUE);␊ |
464 | ␉␉␉␉␊ |
465 | ␉␉␉␉if (!image) continue;␊ |
466 | ␉␉␉}␊ |
467 | ␉␉}␊ |
468 | ␉␉␊ |
469 | ␉␉DBG("Creating view for %s\n", name);␊ |
470 | ␉␉␊ |
471 | ␉␉CHAR16 name16[128];␊ |
472 | ␉␉AsciiStrToUnicodeStr(name, name16);␊ |
473 | ␊ |
474 | ␉␉if (ImagesType == 1 ) //"PNG"␊ |
475 | ␉␉{␊ |
476 | ␉␉␉DBG("png file detected\n");␊ |
477 | ␊ |
478 | ␉␉␉if (strcmp(name,"logo.png") == 0)␊ |
479 | ␉␉␉{␊ |
480 | ␉␉␉␉DBG("computing logo.png\n");␊ |
481 | ␊ |
482 | ␉␉␉␉EG_POSITION pos ;␊ |
483 | ␉␉␉␉/*␊ |
484 | ␉␉␉␉pos.x = (screen_params[0] - MIN(image->Width, screen_params[0])) /2;␊ |
485 | ␉␉␉␉pos.y = (screen_params[1] - MIN(image->Height, screen_params[1])) /2;␊ |
486 | ␉␉␉␉␊ |
487 | ␉␉␉␉if(getDimensionForKey("logo_pos_x", &pixel, &themeConfig, screen_params[0] , image->Width ) )␊ |
488 | ␉␉␉␉␉pos.x = pixel;␊ |
489 | ␉␉␉␉␊ |
490 | ␉␉␉␉if(getDimensionForKey("logo_pos_y", &pixel, &themeConfig, screen_params[1] , image->Height ) )␊ |
491 | ␉␉␉␉␉pos.y = pixel;␉␉␉␉␊ |
492 | ␉␉␉␉*/␊ |
493 | ␉␉␉␉pos.y = 20;␉␉␉␉␊ |
494 | ␉␉␉␉pos.x = 20;␊ |
495 | ␊ |
496 | ␉␉␉␉␊ |
497 | ␉␉␉␉EG_IMAGE_VIEW * TopImageView = egCreateImageViewFromData((EG_PIXEL *)image->PixelData, image->Width, image->Height, TRUE , pos.x, pos.y, name16, TRUE);␊ |
498 | ␉␉␉␉␊ |
499 | ␉␉␉␉if (TopImageView) {␉␉␉␉␊ |
500 | ␉␉␉␉␉egViewAddImageView(screen, TopImageView);␊ |
501 | ␉␉␉␉␉egFreeImageView(TopImageView);␊ |
502 | ␉␉␉␉}␉␉␉␊ |
503 | ␉␉␉␉␊ |
504 | ␉␉␉␉egFreeImage(image);␊ |
505 | ␉␉␉␉␊ |
506 | ␉␉␉␉␊ |
507 | ␉␉␉} ␊ |
508 | ␉␉␉else if (strcmp(name,"device_hfsplus.png")==0)␊ |
509 | ␉␉␉{␊ |
510 | ␉␉␉␉DBG("computing device_hfsplus.png\n");␊ |
511 | ␊ |
512 | ␉␉␉␉EG_POSITION pos ;␊ |
513 | ␉␉␉␉pos.x = 0;␊ |
514 | ␉␉␉␉pos.y = 0;␊ |
515 | ␉␉␉␉␊ |
516 | ␉␉␉␉if(getDimensionForKey("devices_pos_x", &pixel, &themeConfig, screen_params[0] , image->Width ) )␊ |
517 | ␉␉␉␉␉pos.x = pixel;␊ |
518 | ␉␉␉␉else␊ |
519 | ␉␉␉␉␉pos.x = (screen_params[0] - MIN(image->Width, screen_params[0])) /2;␊ |
520 | ␉␉␉␉␊ |
521 | ␉␉␉␉if(getDimensionForKey("devices_pos_y", &pixel, &themeConfig, screen_params[1] , image->Height ) )␊ |
522 | ␉␉␉␉␉pos.y = pixel;␊ |
523 | ␉␉␉␉else␊ |
524 | ␉␉␉␉␉pos.y = (screen_params[1] - MIN(image->Height, screen_params[1])) /2;␉␉␉␊ |
525 | ␉␉␉␉␉␉␉␉␉␉␉␉␊ |
526 | ␉␉␉␉EG_IMAGE_VIEW * TopImageView = egCreateImageViewFromData((EG_PIXEL *)image->PixelData, image->Width, image->Height, TRUE , pos.x, pos.y, name16, TRUE);␉␉␉␊ |
527 | ␉␉␉␉␊ |
528 | ␉␉␉␉if (TopImageView) {␉␉␉␉␊ |
529 | ␉␉␉␉␉deviceView = egViewAddImageView(screen, TopImageView);␉␉␉␉␊ |
530 | ␉␉␉␉␉egFreeImageView(TopImageView);␊ |
531 | ␉␉␉␉}␉␊ |
532 | ␉␉␉␉␊ |
533 | ␉␉␉␉egFreeImage(image);␊ |
534 | ␉␉␉␉␊ |
535 | ␉␉␉␉␊ |
536 | ␉␉␉} ␊ |
537 | ␉␉␉else ␊ |
538 | ␉␉␉␉DBG("file not handled\n");␊ |
539 | ␉␉␉␊ |
540 | ␉␉} ␊ |
541 | ␉␉else if (ImagesType == 3 ) //"ICNS"␊ |
542 | ␉␉{␊ |
543 | ␉␉␉DBG("icns file detected\n");␊ |
544 | ␊ |
545 | ␉␉␉EG_IMAGE * icnsImage = NULL;␊ |
546 | ␉␉␉if ((icnsImage = egDecodeICNS((UINT8 *)image->PixelData, image->Width * image->Height * 4, 128, TRUE)))␊ |
547 | ␉␉␉{␉␉␉␉␊ |
548 | ␉␉␉␉␊ |
549 | ␉␉␉␉EG_IMAGE_VIEW * iconeView = egCreateImageViewFromData((EG_PIXEL *)image->PixelData, image->Width, image->Height, TRUE , 20, 20, name16, TRUE);␉␊ |
550 | ␉␉␉␉␊ |
551 | ␉␉␉␉if (iconeView) {␊ |
552 | ␉␉␉␉␉iconeRef = egViewAddImageView(screen, iconeView);␊ |
553 | ␉␉␉␉␉egFreeImageView(iconeView);␊ |
554 | ␉␉␉␉}␉␉␉␉␊ |
555 | ␉␉␉␉␊ |
556 | ␉␉␉␉egFreeImage(icnsImage);␊ |
557 | ␉␉␉␉egFreeImage(image);␊ |
558 | ␊ |
559 | ␊ |
560 | ␉␉␉} ␊ |
561 | ␉␉}␉␉␉␊ |
562 | ␉␉␊ |
563 | ␉}␉␊ |
564 | ␉␊ |
565 | ␊ |
566 | ␉if (!screen) {␊ |
567 | ␉␉return FALSE;␊ |
568 | ␉}␊ |
569 | ␉␊ |
570 | __setVideoMode( GRAPHICS_MODE );␊ |
571 | egViewUpdate(screen);␊ |
572 | ␊ |
573 | getc();␊ |
574 | ␉DBG("LETS HAVE SOME FUN\n"); // you should never see this message␊ |
575 | ␊ |
576 | ␉␊ |
577 | ␉/********************************␊ |
578 | ␉ *␉␉␉␉␉␉␉␉*␉␉␉␉␉␉␉␉␊ |
579 | ␉ *␉␉LETS HAVE SOME FUN␉ *␉␉␉␊ |
580 | ␉ *␉␉␉␉␉␉␉␉*␉␊ |
581 | ␉ *␉␉␉␉␉␉␉␉*␉␊ |
582 | ␉ ********************************/␊ |
583 | ␊ |
584 | #define TEXT_YMARGIN (2)␊ |
585 | #define LAYOUT_TEXT_WIDTH (512)␊ |
586 | #define LAYOUT_TOTAL_HEIGHT (368)␊ |
587 | #define FONT_CELL_HEIGHT (12)␊ |
588 | #define TEXT_LINE_HEIGHT (FONT_CELL_HEIGHT + TEXT_YMARGIN * 2)␊ |
589 | ␊ |
590 | ␊ |
591 | UINTN px = (screen_params[0] - MIN(((LAYOUT_TEXT_WIDTH *2 )/ 10) , screen_params[0])) /2, i;␊ |
592 | UINTN py = (screen_params[1] - MIN(((TEXT_LINE_HEIGHT * 8) / 10) , screen_params[1])) /2;␊ |
593 | EG_IMAGE_VIEW * ConsoleImageView = egCreateImageView(LAYOUT_TEXT_WIDTH / 10, (TEXT_LINE_HEIGHT * 8) / 10, FALSE, px , py, L"SCREEN_Console");␊ |
594 | assert(ConsoleImageView);␊ |
595 | assert(ConsoleImageView->Image);␊ |
596 | ␊ |
597 | egFillImage(ConsoleImageView->Image, &MenuBackgroundPixel);␊ |
598 | ␊ |
599 | EG_IMAGE_VIEW * ConsoleImageViewRef = egViewAddImageView(screen, ConsoleImageView);␊ |
600 | egFreeImageView(ConsoleImageView);␊ |
601 | egViewUpdate(screen);␊ |
602 | ␊ |
603 | // ios/osx style window bounce effect␊ |
604 | for (i = 1; ConsoleImageViewRef->Image->Width <= LAYOUT_TEXT_WIDTH *2*2; i++) {␊ |
605 | ␊ |
606 | if (ConsoleImageViewRef->Image->Height > TEXT_LINE_HEIGHT * 8 *2)␊ |
607 | break;␊ |
608 | #define soustraction(x,y) ((x) - (y))␊ |
609 | ConsoleImageViewRef->Image->Width += soustraction(i, (i==1)?0:1);␊ |
610 | ConsoleImageViewRef->Image->Height += soustraction(i, (i==1)?0:1);␊ |
611 | px = (screen_params[0] - MIN(ConsoleImageViewRef->Image->Width , screen_params[0])) /2;␊ |
612 | py = (screen_params[1] - MIN(ConsoleImageViewRef->Image->Height , screen_params[1])) /2;␊ |
613 | ␊ |
614 | ConsoleImageViewRef->PosY = py ;␊ |
615 | ConsoleImageViewRef->PosX = px ;␊ |
616 | ␊ |
617 | free(ConsoleImageViewRef->Image->PixelData);␊ |
618 | ␊ |
619 | ConsoleImageViewRef->Image->PixelData = (EG_PIXEL*)malloc(ConsoleImageViewRef->Image->Width * ConsoleImageViewRef->Image->Height * sizeof(EG_PIXEL));␊ |
620 | ␊ |
621 | egFillImage(ConsoleImageViewRef->Image, &MenuBackgroundPixel);␊ |
622 | screen->isDirty = TRUE;␊ |
623 | egViewUpdate(screen);␊ |
624 | ␊ |
625 | ␊ |
626 | }␊ |
627 | ␊ |
628 | for (i = 0; i < 10; i++) {␊ |
629 | ␊ |
630 | ␊ |
631 | #define soustraction(x,y) ((x) - (y))␊ |
632 | ConsoleImageViewRef->Image->Width -= i;␊ |
633 | ConsoleImageViewRef->Image->Height -= i;␊ |
634 | px = (screen_params[0] - MIN(ConsoleImageViewRef->Image->Width , screen_params[0])) /2;␊ |
635 | py = (screen_params[1] - MIN(ConsoleImageViewRef->Image->Height , screen_params[1])) /2;␊ |
636 | ␊ |
637 | ConsoleImageViewRef->PosY = py ;␊ |
638 | ConsoleImageViewRef->PosX = px ;␊ |
639 | ␊ |
640 | free(ConsoleImageViewRef->Image->PixelData);␊ |
641 | ␊ |
642 | ConsoleImageViewRef->Image->PixelData = (EG_PIXEL*)malloc(ConsoleImageViewRef->Image->Width * ConsoleImageViewRef->Image->Height * sizeof(EG_PIXEL));␊ |
643 | ␊ |
644 | egFillImage(ConsoleImageViewRef->Image, &MenuBackgroundPixel);␊ |
645 | ␊ |
646 | screen->isDirty = TRUE;␊ |
647 | egViewUpdate(screen);␊ |
648 | ␊ |
649 | ␊ |
650 | }␊ |
651 | ␉egViewRemoveImageView(screen, ConsoleImageViewRef);␊ |
652 | ␊ |
653 | /*␊ |
654 | UINTN TextWidth;␊ |
655 | ␊ |
656 | EG_POSITION pos ;␊ |
657 | pos.x = (screen_params[0] - MIN(LAYOUT_TEXT_WIDTH, screen_params[0])) /2;␊ |
658 | pos.y = (screen_params[1] - MIN(TEXT_LINE_HEIGHT, screen_params[1])) /2;␊ |
659 | if (deviceView) {␊ |
660 | pos.y = deviceView->PosY - 10;␊ |
661 | ␊ |
662 | }␊ |
663 | ␊ |
664 | EG_IMAGE_VIEW * TextImageView = egCreateImageView(LAYOUT_TEXT_WIDTH, TEXT_LINE_HEIGHT, FALSE, pos.x, pos.y , L"SCREEN_HEADER");␊ |
665 | ␊ |
666 | assert(TextImageView);␊ |
667 | assert(TextImageView->Image);␊ |
668 | ␊ |
669 | egFillImage(TextImageView->Image, &MenuBackgroundPixel);␊ |
670 | ␊ |
671 | // render the text␊ |
672 | egMeasureText(L"WELCOME TO THE EG GRAPHIC TEST... PRESS ANY KEY TO CONTINUE.", &TextWidth, NULL);␊ |
673 | egRenderText(L"WELCOME TO THE EG GRAPHIC TEST... PRESS ANY KEY TO CONTINUE.", TextImageView->Image, (TextImageView->Image->Width - TextWidth) >> 1, 2);␊ |
674 | ␊ |
675 | egViewAddImageView(screen, TextImageView);␊ |
676 | egFreeImageView(TextImageView);␊ |
677 | egViewUpdate(screen);␊ |
678 | getc();␊ |
679 | egViewRemoveImageViewByName(screen, L"SCREEN_HEADER", sizeof(L"SCREEN_HEADER"));␊ |
680 | */␊ |
681 | egViewUpdate(screen);␊ |
682 | getc();␊ |
683 | deviceView = deviceView ? deviceView : iconeRef;␊ |
684 | if (deviceView) {␊ |
685 | struct timeval earlier;␊ |
686 | struct timeval later;␊ |
687 | ␊ |
688 | uint32_t c;␊ |
689 | uint32_t i;␊ |
690 | uint32_t x,y;␊ |
691 | uint32_t x2,y2;␊ |
692 | ␊ |
693 | for (c = 0; c < 5; c++) {␊ |
694 | if(gettimeofday(&earlier,NULL))␊ |
695 | { ␊ |
696 | assert(1);␊ |
697 | }␊ |
698 | int inc = 1,count = 0;␊ |
699 | x = deviceView->PosX;␊ |
700 | y = deviceView->PosY;␊ |
701 | ␊ |
702 | int inc2 = 1,count2 = 0;␊ |
703 | x2 = iconeRef->PosX;␊ |
704 | y2 = iconeRef->PosY;␊ |
705 | ␊ |
706 | // bounce left to right test (aka say NO)␊ |
707 | for (i = 0; i<100; i++) {␊ |
708 | ␊ |
709 | if (count >= 5 && count2 >= 5) break;␊ |
710 | ␊ |
711 | if (count < 5) {␊ |
712 | if (deviceView->PosX >= x )␊ |
713 | {␊ |
714 | if (deviceView->PosX == x )␊ |
715 | {␊ |
716 | count++;␊ |
717 | if (count == 5) {␊ |
718 | screen->isDirty = TRUE;␊ |
719 | egViewUpdate(screen);␊ |
720 | inc = -1;␊ |
721 | } else inc = 1;␊ |
722 | }␊ |
723 | ␊ |
724 | if (inc >= 0)␊ |
725 | {␊ |
726 | if (deviceView->PosX >= x+10 ) {␊ |
727 | deviceView->PosX-=2;␊ |
728 | inc = 0;␊ |
729 | screen->isDirty = TRUE;␊ |
730 | ␊ |
731 | }␊ |
732 | else␊ |
733 | {␊ |
734 | if (inc == 1) {␊ |
735 | deviceView->PosX+=2;␊ |
736 | ␊ |
737 | } else deviceView->PosX-=2;␊ |
738 | screen->isDirty = TRUE;␊ |
739 | ␊ |
740 | ␊ |
741 | }␊ |
742 | }␊ |
743 | ␊ |
744 | ␊ |
745 | ␊ |
746 | ␊ |
747 | }␊ |
748 | }␊ |
749 | ␊ |
750 | egViewUpdate(screen);␊ |
751 | ␊ |
752 | if (count2 < 5 && deviceView != iconeRef) {␊ |
753 | if (iconeRef->PosX >= x2 )␊ |
754 | {␊ |
755 | if (iconeRef->PosX == x2 )␊ |
756 | {␊ |
757 | count2++;␊ |
758 | if (count2 == 5) {␊ |
759 | screen->isDirty = TRUE;␊ |
760 | egViewUpdate(screen);␊ |
761 | inc2 = -1;␊ |
762 | } else inc2 = 1;␊ |
763 | }␊ |
764 | ␊ |
765 | if (inc2 >= 0)␊ |
766 | {␊ |
767 | if (iconeRef->PosX >= x2+10 ) {␊ |
768 | iconeRef->PosX-=2;␊ |
769 | inc2 = 0;␊ |
770 | screen->isDirty = TRUE;␊ |
771 | ␊ |
772 | }␊ |
773 | else␊ |
774 | {␊ |
775 | if (inc2 == 1) {␊ |
776 | iconeRef->PosX+=2;␊ |
777 | ␊ |
778 | } else iconeRef->PosX-=2;␊ |
779 | screen->isDirty = TRUE;␊ |
780 | ␊ |
781 | }␊ |
782 | } ␊ |
783 | ␊ |
784 | ␊ |
785 | }␊ |
786 | }␊ |
787 | ␊ |
788 | }␊ |
789 | if(gettimeofday(&later,NULL))␊ |
790 | {␊ |
791 | ␊ |
792 | exit(1);␊ |
793 | }␊ |
794 | ␊ |
795 | CHAR16 Destination[512]; ␊ |
796 | ␊ |
797 | SPrint (␊ |
798 | Destination,␊ |
799 | sizeof(Destination),␊ |
800 | L"animation %d took %lld microseconds to finish", c,␊ |
801 | timeval_diff(NULL,&later,&earlier));␊ |
802 | ␊ |
803 | UINTN TextWidth;␊ |
804 | ␊ |
805 | EG_POSITION pos ;␊ |
806 | pos.x = (screen_params[0] - MIN(LAYOUT_TEXT_WIDTH, screen_params[0])) /2;␊ |
807 | pos.y = (screen_params[1] - MIN(TEXT_LINE_HEIGHT, screen_params[1])) /2;␊ |
808 | if (deviceView) {␊ |
809 | pos.y = deviceView->PosY + 10;␊ |
810 | ␊ |
811 | }␊ |
812 | ␊ |
813 | EG_IMAGE_VIEW * TextImageView = egCreateImageView(300, TEXT_LINE_HEIGHT, FALSE, pos.x, pos.y , L"SCREEN_NOTIFICATION");␊ |
814 | ␊ |
815 | assert(TextImageView);␊ |
816 | assert(TextImageView->Image);␊ |
817 | MenuBackgroundPixel.a -=50;␊ |
818 | egFillImage(TextImageView->Image, &MenuBackgroundPixel);␊ |
819 | ␊ |
820 | // render the text␊ |
821 | egMeasureText(Destination, &TextWidth, NULL);␊ |
822 | egRenderText(Destination, TextImageView->Image, (TextImageView->Image->Width - TextWidth) >> 1, 2);␊ |
823 | ␊ |
824 | egViewAddImageView(screen, TextImageView);␊ |
825 | egFreeImageView(TextImageView);␊ |
826 | egViewUpdate(screen);␊ |
827 | ␊ |
828 | getc();␊ |
829 | egViewRemoveImageViewByName(screen, L"SCREEN_NOTIFICATION", sizeof(L"SCREEN_NOTIFICATION"));␊ |
830 | ␊ |
831 | }␊ |
832 | ␊ |
833 | ␊ |
834 | // change background test␊ |
835 | EG_PIXEL *bColor = egViewGetBackgroundColor(screen); // save original color␊ |
836 | for (i = 0; i<15; i++) {␊ |
837 | EG_PIXEL Color;␊ |
838 | Color.r = arc4random_unirange(0,255) ;␊ |
839 | Color.g = arc4random_unirange(0,255) ;␊ |
840 | Color.b = arc4random_unirange(0,255) ;␊ |
841 | Color.a = arc4random_unirange(0,255);␊ |
842 | ␊ |
843 | egViewSetBackgroundColor(screen, &Color); ␊ |
844 | delay(100000);␊ |
845 | egViewUpdate(screen);␊ |
846 | }␊ |
847 | sleep(1); ␊ |
848 | egViewSetBackgroundColor(screen,bColor); // restore color␊ |
849 | free(bColor);␊ |
850 | ␊ |
851 | // move image test␊ |
852 | for (i = 0; i<100; i++) {␊ |
853 | ␊ |
854 | ␊ |
855 | ␊ |
856 | deviceView->PosX +=2;␊ |
857 | deviceView->PosY +=2;␊ |
858 | ␊ |
859 | screen->isDirty = TRUE;␊ |
860 | ␊ |
861 | egViewUpdate(screen);␊ |
862 | }␊ |
863 | ␊ |
864 | int incx , incy ;␊ |
865 | int bxpl , bypl ;␊ |
866 | ␊ |
867 | ␊ |
868 | incx = arc4random_unirange(0,1);␊ |
869 | incy = arc4random_unirange(0,1);␊ |
870 | ␊ |
871 | bxpl = arc4random_unirange(3,6);␊ |
872 | bypl = arc4random_unirange(3,6);␊ |
873 | ␊ |
874 | ␊ |
875 | for (i = 0; i<5000; i++) {␊ |
876 | ␊ |
877 | ␊ |
878 | ␊ |
879 | if (deviceView->PosX >= bxpl && incx <= 0) {␊ |
880 | deviceView->PosX -=bxpl;␊ |
881 | incx = 0;␊ |
882 | ␊ |
883 | }␊ |
884 | else if (deviceView->PosX + deviceView->Image->Width + bxpl < screen->CompImage->Width )␊ |
885 | {␊ |
886 | deviceView->PosX +=bxpl;␊ |
887 | if (incx != 1) {␊ |
888 | // will exit rect␊ |
889 | bxpl = arc4random_unirange(3,6);␊ |
890 | ␊ |
891 | }␊ |
892 | incx = 1;␊ |
893 | }␊ |
894 | else if (deviceView->PosX + deviceView->Image->Width + bxpl >= screen->CompImage->Width && incx != 0)␊ |
895 | {␊ |
896 | incx = -1;␊ |
897 | bxpl = arc4random_unirange(3,6);␊ |
898 | ␊ |
899 | //continue;␊ |
900 | }␊ |
901 | ␊ |
902 | ␊ |
903 | if (deviceView->PosY >= bypl && incy <= 0) {␊ |
904 | deviceView->PosY -=bypl;␊ |
905 | incy = 0;␊ |
906 | ␊ |
907 | }␊ |
908 | else if (deviceView->PosY + deviceView->Image->Height + bypl < screen->CompImage->Height )␊ |
909 | {␊ |
910 | deviceView->PosY += bypl;␊ |
911 | ␊ |
912 | if (incy != 1) {␊ |
913 | // will exit rect (top)␊ |
914 | bypl = arc4random_unirange(3,6);␊ |
915 | ␊ |
916 | }␊ |
917 | ␊ |
918 | incy = 1;␊ |
919 | }␊ |
920 | else if (deviceView->PosY + deviceView->Image->Height + bypl >= screen->CompImage->Height && incy != 0)␊ |
921 | {␊ |
922 | // will exit rect ( bottom)␊ |
923 | ␊ |
924 | incy = -1;␊ |
925 | bypl = arc4random_unirange(3,6);␊ |
926 | ␊ |
927 | //continue;␊ |
928 | } ␊ |
929 | ␊ |
930 | if (incy>= 0 && incx>=0) {␊ |
931 | screen->isDirty = TRUE;␊ |
932 | ␊ |
933 | egViewUpdate(screen);␊ |
934 | }␊ |
935 | ␊ |
936 | ␊ |
937 | ␊ |
938 | }␊ |
939 | ␊ |
940 | getc();␊ |
941 | ␊ |
942 | egViewRemoveImageViewByName(screen, L"plug_in_Icon", sizeof(L"plug_in_Icon"));␊ |
943 | egViewUpdate(screen);␊ |
944 | getc(); ␊ |
945 | ␊ |
946 | } ␊ |
947 | ␊ |
948 | __setVideoMode(VGA_TEXT_MODE);␊ |
949 | ␊ |
950 | egFreeView(screen);␊ |
951 | ␊ |
952 | ␉return TRUE;␊ |
953 | ␉␊ |
954 | }␊ |
955 | |