Print ${LIBS} at the beginning of the build
[qi-bootmenu.git] / gui.c
blob2482660487452ef20b089ce63d920e344fa11a51
1 static void gui_show_error(const char *errstr, ...) {
2 va_list ap;
4 va_start(ap, errstr);
6 if (gui->error)
7 gui->error(errstr, ap);
9 vfprintf(stderr, errstr, ap);
10 va_end(ap);
13 static void poweroff(void *data, Evas *evas, Evas_Object *item, void *event) {
14 Eina_List *l;
15 BootItem *s;
17 if (gui->select)
18 gui->select(item);
20 EINA_LIST_FOREACH(systems, l, s) {
21 umount(s->dev + sstrlen("/dev/"));
23 system("poweroff");
26 static void boot_nand(void *data, Evas *evas, Evas_Object *item, void *event) {
28 if (gui->select)
29 gui->select(item);
31 BootItem *nand = scan_partition((const char *)data);
32 if (!nand) {
33 gui_show_error("No kernel found in NAND Flash.\n");
34 return;
37 boot_kernel(nand);
40 static void gui_bootitem_clicked(void *data, Evas *evas, Evas_Object *item, void *event) {
41 if (gui->select)
42 gui->select(item);
43 boot_kernel((BootItem*)data);
44 /* XXX: shouldn't be reached, display an error message? */
47 static bool gui_init(){
48 if (!ecore_init() || !ecore_evas_init())
49 return false;
51 /* XXX: fixed dimensions */
52 ee = ecore_evas_new(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL);
54 if (!ee)
55 return false;
57 ecore_evas_title_set(ee, APPNAME);
58 ecore_evas_borderless_set(ee, 0);
59 ecore_evas_show(ee);
61 evas = ecore_evas_get(ee);
62 if (!evas)
63 return false;
65 evas_font_path_append(evas, FONT_PATH);
67 return true;