1 static void gui_show_error(const char *errstr
, ...) {
7 gui
->error(errstr
, ap
);
9 vfprintf(stderr
, errstr
, ap
);
10 fprintf(stderr
, "\n");
14 static void gui_item_clicked(void *data
, Evas
*evas
, Evas_Object
*item
, void *event
) {
15 MenuItem
*menu
= data
;
18 /* flush all changes of the whole canvas to the screen.
19 * normally this would be done once the event handler
20 * returns, however in our case this might never happen
21 * because the menu callback could kexec a kernel.
25 menu
->callback(menu
->data
);
30 static void poweroff(void *data
) {
35 static void boot_nand(void *data
) {
36 BootItem
*nand
= scan_partition((const char *)data
);
38 gui_show_error("No kernel found in NAND Flash");
45 static void gui_bootitem_clicked(void *data
) {
46 boot_kernel((BootItem
*)data
);
49 static bool gui_init(){
50 if (!ecore_init() || !ecore_evas_init())
53 /* XXX: fixed dimensions */
54 ee
= ecore_evas_new(NULL
, 0, 0, SCREEN_WIDTH
, SCREEN_HEIGHT
, NULL
);
59 ecore_evas_title_set(ee
, APPNAME
);
60 ecore_evas_borderless_set(ee
, 0);
63 evas
= ecore_evas_get(ee
);
67 evas_font_path_append(evas
, FONT_PATH
);