5 #include <Ecore_Evas.h>
10 /* XXX: replace hardcoded values with runtime information */
11 #define SCREEN_WIDTH 480
12 #define SCREEN_HEIGHT 640
14 /* drawing related stuff */
15 static Ecore_Evas
*ee
;
18 static void poweroff(void *data
, Evas
*evas
, Evas_Object
*obj
, void *event
);
19 static void bootitem_clicked(void *data
, Evas
*evas
, Evas_Object
*item
, void *event
);
24 void(*callback
)(void*, Evas
*, Evas_Object
*, void *);
28 { "Power Off", POWEROFF_LOGO
, poweroff
},
36 void(*show
)(Eina_List
*systems
);
37 void(*select
)(Evas_Object
*item
);
41 { 'l', gui_list
, gui_list_select_item
},
42 { 'g', gui_grid
, NULL
},
45 /* if no option is passed in then use the first entry */
46 static Gui
*gui
= &guis
[0];
48 static void poweroff(void *data
, Evas
*evas
, Evas_Object
*item
, void *event
) {
54 static void bootitem_clicked(void *data
, Evas
*evas
, Evas_Object
*item
, void *event
) {
57 boot_kernel((BootItem
*)data
);
58 /* XXX: shouldn't be reached, display an error message? */
61 static bool gui_init(){
62 if (!ecore_init() || !ecore_evas_init())
65 /* XXX: fixed dimensions */
66 ee
= ecore_evas_new(NULL
, 0, 0, SCREEN_WIDTH
, SCREEN_HEIGHT
, NULL
);
71 ecore_evas_title_set(ee
, APPNAME
);
72 ecore_evas_borderless_set(ee
, 0);
75 evas
= ecore_evas_get(ee
);
79 evas_font_path_append(evas
, FONT_PATH
);
84 int gui_show(int argc
, char **argv
) {
86 if (argc
> 1 && argv
[1][0] == '-') {
88 for (i
= 0; i
< countof(guis
); i
++) {
89 if (argv
[1][1] == guis
[i
].option
)
95 eprint("Couldn't init GUI\n");
99 /* search for system images to boot and display them */
100 gui
->show(scan_system());
102 ecore_main_loop_begin();