* Christmas edition *; fixed irc /os command; small cleanup in fd.c; improvements...
[ZeXOS.git] / apps / zde / main.c
blobfd3f15b066cde663765fae37265380a7707e0a00
1 /*
2 * ZeX/OS
3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <stdio.h>
21 #include <string.h>
22 #include <stdlib.h>
23 #include <libx/base.h>
24 #include <libx/object.h>
25 #include <libx/image.h>
26 #include <libx/cursor.h>
27 #include <libx/text.h>
29 #include "window.h"
30 #include "cursor.h"
31 #include "icon.h"
33 #define ESC 1
34 #define ARROWLEFT 75
35 #define ARROWRIGHT 77
36 #define ARROWUP 72
37 #define ARROWDOWN 80
40 unsigned key_pressed (int keycode)
42 int scancode = getkey ();
44 if (scancode == keycode)
45 return 1;
47 if (scancode == keycode+128)
48 return 2;
49 else
50 return 0;
53 int init_zde ()
55 init_cursor ();
56 init_icon ();
57 init_window ();
59 return 0;
62 int draw_zde ()
64 draw_icon_desktop ();
65 draw_window ();
66 draw_cursor ();
68 return 0;
71 int main (int argc, char **argv)
73 /* Switch to VGA graphics mode */
74 xinit ();
76 /* Clean screen */
77 xcls (0);
79 init_zde ();
81 while (1) {
82 draw_zde ();
84 xfbswap ();
85 schedule ();
88 /* Go back to textual mode */
89 xexit ();
91 /* Exit app */
92 return 0;