3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #include <libx/base.h>
27 #include <libx/object.h>
28 #include <libx/image.h>
29 #include <libx/cursor.h>
30 #include <libx/text.h>
37 #include "filemanager.h"
42 extern wmcursor
*cursor
;
46 char sec
[2], min
[2], hour
[2];
48 time_t ret
= time (&t
);
53 struct tm
*ct
= localtime (&t
);
55 itoa (sec
, ct
->tm_sec
, 10);
57 xtext_puts (0, 0, 3, sec
);
67 int main (int argc
, char **argv
)
69 /* ERROR message :( */
70 printf ("Please start this program under VESA mode, because it can crash\n");
72 if (!init_config ()) {
73 printf ("Something is wrong with init_config () sequence !\n");
78 if (!init_cursor ()) {
79 printf ("Your mouse is crappy, try it again :P\n");
84 if (!init_window ()) {
89 if (!init_button ()) {
99 if (!init_dialog ()) {
108 /*if (!init_filemanager ()) {
115 wmbutton
*btn_menu
= button_create (0, 588, 0, 0, 0, "ZeX/OS");
117 wmmenu
*mainmenu
= menu_create (0, 0, "Menu");
122 wmmenuitem
*item_filemanager
= menu_additem (mainmenu
, "Filemanager", 0);
123 wmmenuitem
*item_terminal
= menu_additem (mainmenu
, "Terminal", 0);
124 wmmenuitem
*item_authors
= menu_additem (mainmenu
, "Authors", 0);
125 menu_additem (mainmenu
, "-----------", 0);
126 wmmenuitem
*item_exit
= menu_additem (mainmenu
, "Exit", 0);
128 mainmenu
->y
= btn_menu
->y
-mainmenu
->size_y
;
130 if (!init_terminal ()) {
134 if (!init_authors ()) {
143 if (button_flags (btn_menu
) & BUTTON_FLAG_CLICKED
)
144 menu_show (mainmenu
);
146 //if (menuitem_flags (item_filemanager) & MENUITEM_FLAG_CLICKED)
149 if (menuitem_flags (item_terminal
) & MENUITEM_FLAG_CLICKED
)
152 if (menuitem_flags (item_authors
) & MENUITEM_FLAG_CLICKED
)
155 if (menuitem_flags (item_exit
) & MENUITEM_FLAG_CLICKED
)
174 //draw_clock (); /* FIXME: freeze */