view.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /* view.c - Graphical menu interface MVC view. */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2008 Free Software Foundation, Inc.
  5. *
  6. * GRUB 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.
  10. *
  11. * GRUB 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.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <grub/types.h>
  20. #include <grub/file.h>
  21. #include <grub/misc.h>
  22. #include <grub/mm.h>
  23. #include <grub/err.h>
  24. #include <grub/dl.h>
  25. #include <grub/normal.h>
  26. #include <grub/video.h>
  27. #include <grub/gfxterm.h>
  28. #include <grub/bitmap.h>
  29. #include <grub/bitmap_scale.h>
  30. #include <grub/term.h>
  31. #include <grub/gfxwidgets.h>
  32. #include <grub/time.h>
  33. #include <grub/menu.h>
  34. #include <grub/menu_viewer.h>
  35. #include <grub/gfxmenu_view.h>
  36. #include <grub/gui_string_util.h>
  37. #include <grub/icon_manager.h>
  38. #include <grub/i18n.h>
  39. static void
  40. init_terminal (grub_gfxmenu_view_t view);
  41. static void
  42. init_background (grub_gfxmenu_view_t view);
  43. static grub_gfxmenu_view_t term_view;
  44. /* Create a new view object, loading the theme specified by THEME_PATH and
  45. associating MODEL with the view. */
  46. grub_gfxmenu_view_t
  47. grub_gfxmenu_view_new (const char *theme_path,
  48. int width, int height)
  49. {
  50. grub_gfxmenu_view_t view;
  51. grub_font_t default_font;
  52. grub_video_rgba_color_t default_fg_color;
  53. grub_video_rgba_color_t default_bg_color;
  54. view = grub_malloc (sizeof (*view));
  55. if (! view)
  56. return 0;
  57. while (grub_gfxmenu_timeout_notifications)
  58. {
  59. struct grub_gfxmenu_timeout_notify *p;
  60. p = grub_gfxmenu_timeout_notifications;
  61. grub_gfxmenu_timeout_notifications = grub_gfxmenu_timeout_notifications->next;
  62. grub_free (p);
  63. }
  64. view->screen.x = 0;
  65. view->screen.y = 0;
  66. view->screen.width = width;
  67. view->screen.height = height;
  68. view->need_to_check_sanity = 1;
  69. view->terminal_border = 3;
  70. view->terminal_rect.width = view->screen.width * 7 / 10;
  71. view->terminal_rect.height = view->screen.height * 7 / 10;
  72. view->terminal_rect.x = view->screen.x + (view->screen.width
  73. - view->terminal_rect.width) / 2;
  74. view->terminal_rect.y = view->screen.y + (view->screen.height
  75. - view->terminal_rect.height) / 2;
  76. default_font = grub_font_get ("Unknown Regular 16");
  77. default_fg_color = grub_video_rgba_color_rgb (0, 0, 0);
  78. default_bg_color = grub_video_rgba_color_rgb (255, 255, 255);
  79. view->canvas = 0;
  80. view->title_font = default_font;
  81. view->message_font = default_font;
  82. view->terminal_font_name = grub_strdup ("Fixed 10");
  83. view->title_color = default_fg_color;
  84. view->message_color = default_bg_color;
  85. view->message_bg_color = default_fg_color;
  86. view->raw_desktop_image = 0;
  87. view->scaled_desktop_image = 0;
  88. view->desktop_image_scale_method = GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH;
  89. view->desktop_image_h_align = GRUB_VIDEO_BITMAP_H_ALIGN_CENTER;
  90. view->desktop_image_v_align = GRUB_VIDEO_BITMAP_V_ALIGN_CENTER;
  91. view->desktop_color = default_bg_color;
  92. view->terminal_box = grub_gfxmenu_create_box (0, 0);
  93. view->title_text = grub_strdup (_("GRUB Boot Menu"));
  94. view->progress_message_text = 0;
  95. view->theme_path = 0;
  96. /* Set the timeout bar's frame. */
  97. view->progress_message_frame.width = view->screen.width * 4 / 5;
  98. view->progress_message_frame.height = 50;
  99. view->progress_message_frame.x = view->screen.x
  100. + (view->screen.width - view->progress_message_frame.width) / 2;
  101. view->progress_message_frame.y = view->screen.y
  102. + view->screen.height - 90 - 20 - view->progress_message_frame.height;
  103. if (grub_gfxmenu_view_load_theme (view, theme_path) != 0)
  104. {
  105. grub_gfxmenu_view_destroy (view);
  106. return 0;
  107. }
  108. return view;
  109. }
  110. /* Destroy the view object. All used memory is freed. */
  111. void
  112. grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view)
  113. {
  114. if (!view)
  115. return;
  116. while (grub_gfxmenu_timeout_notifications)
  117. {
  118. struct grub_gfxmenu_timeout_notify *p;
  119. p = grub_gfxmenu_timeout_notifications;
  120. grub_gfxmenu_timeout_notifications = grub_gfxmenu_timeout_notifications->next;
  121. grub_free (p);
  122. }
  123. grub_video_bitmap_destroy (view->raw_desktop_image);
  124. grub_video_bitmap_destroy (view->scaled_desktop_image);
  125. if (view->terminal_box)
  126. view->terminal_box->destroy (view->terminal_box);
  127. grub_free (view->terminal_font_name);
  128. grub_free (view->title_text);
  129. grub_free (view->progress_message_text);
  130. grub_free (view->theme_path);
  131. if (view->canvas)
  132. view->canvas->component.ops->destroy (view->canvas);
  133. grub_free (view);
  134. }
  135. static void
  136. redraw_background (grub_gfxmenu_view_t view,
  137. const grub_video_rect_t *bounds)
  138. {
  139. if (view->scaled_desktop_image)
  140. {
  141. struct grub_video_bitmap *img = view->scaled_desktop_image;
  142. grub_video_blit_bitmap (img, GRUB_VIDEO_BLIT_REPLACE,
  143. bounds->x, bounds->y,
  144. bounds->x - view->screen.x,
  145. bounds->y - view->screen.y,
  146. bounds->width, bounds->height);
  147. }
  148. else
  149. {
  150. grub_video_fill_rect (grub_video_map_rgba_color (view->desktop_color),
  151. bounds->x, bounds->y,
  152. bounds->width, bounds->height);
  153. }
  154. }
  155. static void
  156. draw_title (grub_gfxmenu_view_t view)
  157. {
  158. if (! view->title_text)
  159. return;
  160. /* Center the title. */
  161. int title_width = grub_font_get_string_width (view->title_font,
  162. view->title_text);
  163. int x = (view->screen.width - title_width) / 2;
  164. int y = 40 + grub_font_get_ascent (view->title_font);
  165. grub_font_draw_string (view->title_text,
  166. view->title_font,
  167. grub_video_map_rgba_color (view->title_color),
  168. x, y);
  169. }
  170. struct progress_value_data
  171. {
  172. int visible;
  173. int start;
  174. int end;
  175. int value;
  176. };
  177. struct grub_gfxmenu_timeout_notify *grub_gfxmenu_timeout_notifications;
  178. static void
  179. update_timeouts (int visible, int start, int value, int end)
  180. {
  181. struct grub_gfxmenu_timeout_notify *cur;
  182. for (cur = grub_gfxmenu_timeout_notifications; cur; cur = cur->next)
  183. cur->set_state (cur->self, visible, start, value, end);
  184. }
  185. static void
  186. redraw_timeouts (struct grub_gfxmenu_view *view)
  187. {
  188. struct grub_gfxmenu_timeout_notify *cur;
  189. for (cur = grub_gfxmenu_timeout_notifications; cur; cur = cur->next)
  190. {
  191. grub_video_rect_t bounds;
  192. cur->self->ops->get_bounds (cur->self, &bounds);
  193. grub_video_set_area_status (GRUB_VIDEO_AREA_ENABLED);
  194. grub_gfxmenu_view_redraw (view, &bounds);
  195. }
  196. }
  197. void
  198. grub_gfxmenu_print_timeout (int timeout, void *data)
  199. {
  200. struct grub_gfxmenu_view *view = data;
  201. if (view->first_timeout == -1)
  202. view->first_timeout = timeout;
  203. update_timeouts (1, -view->first_timeout, -timeout, 0);
  204. redraw_timeouts (view);
  205. grub_video_swap_buffers ();
  206. if (view->double_repaint)
  207. redraw_timeouts (view);
  208. }
  209. void
  210. grub_gfxmenu_clear_timeout (void *data)
  211. {
  212. struct grub_gfxmenu_view *view = data;
  213. update_timeouts (0, 1, 0, 0);
  214. redraw_timeouts (view);
  215. grub_video_swap_buffers ();
  216. if (view->double_repaint)
  217. redraw_timeouts (view);
  218. }
  219. static void
  220. update_menu_visit (grub_gui_component_t component,
  221. void *userdata)
  222. {
  223. grub_gfxmenu_view_t view;
  224. view = userdata;
  225. if (component->ops->is_instance (component, "list"))
  226. {
  227. grub_gui_list_t list = (grub_gui_list_t) component;
  228. list->ops->set_view_info (list, view);
  229. }
  230. }
  231. /* Update any boot menu components with the current menu model and
  232. theme path. */
  233. static void
  234. update_menu_components (grub_gfxmenu_view_t view)
  235. {
  236. grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas,
  237. update_menu_visit, view);
  238. }
  239. static void
  240. refresh_menu_visit (grub_gui_component_t component,
  241. void *userdata)
  242. {
  243. grub_gfxmenu_view_t view;
  244. view = userdata;
  245. if (component->ops->is_instance (component, "list"))
  246. {
  247. grub_gui_list_t list = (grub_gui_list_t) component;
  248. list->ops->refresh_list (list, view);
  249. }
  250. }
  251. /* Refresh list information (useful for submenus) */
  252. static void
  253. refresh_menu_components (grub_gfxmenu_view_t view)
  254. {
  255. grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas,
  256. refresh_menu_visit, view);
  257. }
  258. static void
  259. draw_message (grub_gfxmenu_view_t view)
  260. {
  261. char *text = view->progress_message_text;
  262. grub_video_rect_t f = view->progress_message_frame;
  263. if (! text)
  264. return;
  265. grub_font_t font = view->message_font;
  266. grub_video_color_t color = grub_video_map_rgba_color (view->message_color);
  267. /* Border. */
  268. grub_video_fill_rect (color,
  269. f.x-1, f.y-1, f.width+2, f.height+2);
  270. /* Fill. */
  271. grub_video_fill_rect (grub_video_map_rgba_color (view->message_bg_color),
  272. f.x, f.y, f.width, f.height);
  273. /* Center the text. */
  274. int text_width = grub_font_get_string_width (font, text);
  275. int x = f.x + (f.width - text_width) / 2;
  276. int y = (f.y + (f.height - grub_font_get_descent (font)) / 2
  277. + grub_font_get_ascent (font) / 2);
  278. grub_font_draw_string (text, font, color, x, y);
  279. }
  280. void
  281. grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view,
  282. const grub_video_rect_t *region)
  283. {
  284. if (grub_video_have_common_points (&view->terminal_rect, region))
  285. grub_gfxterm_schedule_repaint ();
  286. grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
  287. grub_video_area_status_t area_status;
  288. grub_video_get_area_status (&area_status);
  289. if (area_status == GRUB_VIDEO_AREA_ENABLED)
  290. grub_video_set_region (region->x, region->y,
  291. region->width, region->height);
  292. redraw_background (view, region);
  293. if (view->canvas)
  294. view->canvas->component.ops->paint (view->canvas, region);
  295. draw_title (view);
  296. if (grub_video_have_common_points (&view->progress_message_frame, region))
  297. draw_message (view);
  298. if (area_status == GRUB_VIDEO_AREA_ENABLED)
  299. grub_video_set_area_status (GRUB_VIDEO_AREA_ENABLED);
  300. }
  301. void
  302. grub_gfxmenu_view_draw (grub_gfxmenu_view_t view)
  303. {
  304. init_terminal (view);
  305. init_background (view);
  306. /* Clear the screen; there may be garbage left over in video memory. */
  307. grub_video_fill_rect (grub_video_map_rgb (0, 0, 0),
  308. view->screen.x, view->screen.y,
  309. view->screen.width, view->screen.height);
  310. grub_video_swap_buffers ();
  311. if (view->double_repaint)
  312. grub_video_fill_rect (grub_video_map_rgb (0, 0, 0),
  313. view->screen.x, view->screen.y,
  314. view->screen.width, view->screen.height);
  315. refresh_menu_components (view);
  316. update_menu_components (view);
  317. grub_video_set_area_status (GRUB_VIDEO_AREA_DISABLED);
  318. grub_gfxmenu_view_redraw (view, &view->screen);
  319. grub_video_swap_buffers ();
  320. if (view->double_repaint)
  321. {
  322. grub_video_set_area_status (GRUB_VIDEO_AREA_DISABLED);
  323. grub_gfxmenu_view_redraw (view, &view->screen);
  324. }
  325. }
  326. static void
  327. redraw_menu_visit (grub_gui_component_t component,
  328. void *userdata)
  329. {
  330. grub_gfxmenu_view_t view;
  331. view = userdata;
  332. if (component->ops->is_instance (component, "list"))
  333. {
  334. grub_video_rect_t bounds;
  335. component->ops->get_bounds (component, &bounds);
  336. grub_video_set_area_status (GRUB_VIDEO_AREA_ENABLED);
  337. grub_gfxmenu_view_redraw (view, &bounds);
  338. }
  339. }
  340. void
  341. grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view)
  342. {
  343. update_menu_components (view);
  344. grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas,
  345. redraw_menu_visit, view);
  346. grub_video_swap_buffers ();
  347. if (view->double_repaint)
  348. {
  349. grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas,
  350. redraw_menu_visit, view);
  351. }
  352. }
  353. void
  354. grub_gfxmenu_set_chosen_entry (int entry, void *data)
  355. {
  356. grub_gfxmenu_view_t view = data;
  357. view->selected = entry;
  358. grub_gfxmenu_redraw_menu (view);
  359. }
  360. static void
  361. grub_gfxmenu_draw_terminal_box (void)
  362. {
  363. grub_gfxmenu_box_t term_box;
  364. term_box = term_view->terminal_box;
  365. if (!term_box)
  366. return;
  367. grub_video_set_area_status (GRUB_VIDEO_AREA_DISABLED);
  368. term_box->set_content_size (term_box, term_view->terminal_rect.width,
  369. term_view->terminal_rect.height);
  370. term_box->draw (term_box,
  371. term_view->terminal_rect.x - term_box->get_left_pad (term_box),
  372. term_view->terminal_rect.y - term_box->get_top_pad (term_box));
  373. }
  374. static void
  375. get_min_terminal (grub_font_t terminal_font,
  376. unsigned int border_width,
  377. unsigned int *min_terminal_width,
  378. unsigned int *min_terminal_height)
  379. {
  380. struct grub_font_glyph *glyph;
  381. glyph = grub_font_get_glyph (terminal_font, 'M');
  382. *min_terminal_width = (glyph? glyph->device_width : 8) * 80
  383. + 2 * border_width;
  384. *min_terminal_height = grub_font_get_max_char_height (terminal_font) * 24
  385. + 2 * border_width;
  386. }
  387. static void
  388. terminal_sanity_check (grub_gfxmenu_view_t view)
  389. {
  390. if (!view->need_to_check_sanity)
  391. return;
  392. /* terminal_font was checked before in the init_terminal function. */
  393. grub_font_t terminal_font = grub_font_get (view->terminal_font_name);
  394. /* Non-negative numbers below. */
  395. int scr_x = view->screen.x;
  396. int scr_y = view->screen.y;
  397. int scr_width = view->screen.width;
  398. int scr_height = view->screen.height;
  399. int term_x = view->terminal_rect.x;
  400. int term_y = view->terminal_rect.y;
  401. int term_width = view->terminal_rect.width;
  402. int term_height = view->terminal_rect.height;
  403. /* Check that border_width isn't too big. */
  404. unsigned int border_width = view->terminal_border;
  405. unsigned int min_terminal_width;
  406. unsigned int min_terminal_height;
  407. get_min_terminal (terminal_font, border_width,
  408. &min_terminal_width, &min_terminal_height);
  409. if (border_width > 3 && ((int) min_terminal_width >= scr_width
  410. || (int) min_terminal_height >= scr_height))
  411. {
  412. border_width = 3;
  413. get_min_terminal (terminal_font, border_width,
  414. &min_terminal_width, &min_terminal_height);
  415. }
  416. /* Sanity checks. */
  417. if (term_width > scr_width)
  418. term_width = scr_width;
  419. if (term_height > scr_height)
  420. term_height = scr_height;
  421. if (scr_width <= (int) min_terminal_width
  422. || scr_height <= (int) min_terminal_height)
  423. {
  424. /* The screen resulution is too low. Use all space, except a small border
  425. to show the user, that it is a window. Then center the window. */
  426. term_width = scr_width - 6 * border_width;
  427. term_height = scr_height - 6 * border_width;
  428. term_x = scr_x + (scr_width - term_width) / 2;
  429. term_y = scr_y + (scr_height - term_height) / 2;
  430. }
  431. else if (term_width < (int) min_terminal_width
  432. || term_height < (int) min_terminal_height)
  433. {
  434. /* The screen resolution is big enough. Make sure, that terminal screen
  435. dimensions aren't less than minimal values. Then center the window. */
  436. term_width = (int) min_terminal_width;
  437. term_height = (int) min_terminal_height;
  438. term_x = scr_x + (scr_width - term_width) / 2;
  439. term_y = scr_y + (scr_height - term_height) / 2;
  440. }
  441. /* At this point w and h are satisfying. */
  442. if (term_x + term_width > scr_width)
  443. term_x = scr_width - term_width;
  444. if (term_y + term_height > scr_height)
  445. term_y = scr_height - term_height;
  446. /* Write down corrected data. */
  447. view->terminal_rect.x = (unsigned int) term_x;
  448. view->terminal_rect.y = (unsigned int) term_y;
  449. view->terminal_rect.width = (unsigned int) term_width;
  450. view->terminal_rect.height = (unsigned int) term_height;
  451. view->terminal_border = border_width;
  452. view->need_to_check_sanity = 0;
  453. }
  454. static void
  455. init_terminal (grub_gfxmenu_view_t view)
  456. {
  457. grub_font_t terminal_font;
  458. terminal_font = grub_font_get (view->terminal_font_name);
  459. if (!terminal_font)
  460. {
  461. grub_error (GRUB_ERR_BAD_FONT, "no font loaded");
  462. return;
  463. }
  464. /* Check that terminal window size and position are sane. */
  465. terminal_sanity_check (view);
  466. term_view = view;
  467. /* Note: currently there is no API for changing the gfxterm font
  468. on the fly, so whatever font the initially loaded theme specifies
  469. will be permanent. */
  470. grub_gfxterm_set_window (GRUB_VIDEO_RENDER_TARGET_DISPLAY,
  471. view->terminal_rect.x,
  472. view->terminal_rect.y,
  473. view->terminal_rect.width,
  474. view->terminal_rect.height,
  475. view->double_repaint,
  476. terminal_font,
  477. view->terminal_border);
  478. grub_gfxterm_decorator_hook = grub_gfxmenu_draw_terminal_box;
  479. }
  480. static void
  481. init_background (grub_gfxmenu_view_t view)
  482. {
  483. if (view->scaled_desktop_image)
  484. return;
  485. struct grub_video_bitmap *scaled_bitmap;
  486. if (view->desktop_image_scale_method ==
  487. GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH)
  488. grub_video_bitmap_create_scaled (&scaled_bitmap,
  489. view->screen.width,
  490. view->screen.height,
  491. view->raw_desktop_image,
  492. GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST);
  493. else
  494. grub_video_bitmap_scale_proportional (&scaled_bitmap,
  495. view->screen.width,
  496. view->screen.height,
  497. view->raw_desktop_image,
  498. GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST,
  499. view->desktop_image_scale_method,
  500. view->desktop_image_v_align,
  501. view->desktop_image_h_align);
  502. if (! scaled_bitmap)
  503. return;
  504. view->scaled_desktop_image = scaled_bitmap;
  505. }
  506. /* FIXME: previously notifications were displayed in special case.
  507. Is it necessary?
  508. */
  509. #if 0
  510. /* Sets MESSAGE as the progress message for the view.
  511. MESSAGE can be 0, in which case no message is displayed. */
  512. static void
  513. set_progress_message (grub_gfxmenu_view_t view, const char *message)
  514. {
  515. grub_free (view->progress_message_text);
  516. if (message)
  517. view->progress_message_text = grub_strdup (message);
  518. else
  519. view->progress_message_text = 0;
  520. }
  521. static void
  522. notify_booting (grub_menu_entry_t entry, void *userdata)
  523. {
  524. grub_gfxmenu_view_t view = (grub_gfxmenu_view_t) userdata;
  525. char *s = grub_malloc (100 + grub_strlen (entry->title));
  526. if (!s)
  527. return;
  528. grub_sprintf (s, "Booting '%s'", entry->title);
  529. set_progress_message (view, s);
  530. grub_free (s);
  531. grub_gfxmenu_view_redraw (view, &view->progress_message_frame);
  532. grub_video_swap_buffers ();
  533. if (view->double_repaint)
  534. grub_gfxmenu_view_redraw (view, &view->progress_message_frame);
  535. }
  536. static void
  537. notify_fallback (grub_menu_entry_t entry, void *userdata)
  538. {
  539. grub_gfxmenu_view_t view = (grub_gfxmenu_view_t) userdata;
  540. char *s = grub_malloc (100 + grub_strlen (entry->title));
  541. if (!s)
  542. return;
  543. grub_sprintf (s, "Falling back to '%s'", entry->title);
  544. set_progress_message (view, s);
  545. grub_free (s);
  546. grub_gfxmenu_view_redraw (view, &view->progress_message_frame);
  547. grub_video_swap_buffers ();
  548. if (view->double_repaint)
  549. grub_gfxmenu_view_redraw (view, &view->progress_message_frame);
  550. }
  551. static void
  552. notify_execution_failure (void *userdata __attribute__ ((unused)))
  553. {
  554. }
  555. static struct grub_menu_execute_callback execute_callback =
  556. {
  557. .notify_booting = notify_booting,
  558. .notify_fallback = notify_fallback,
  559. .notify_failure = notify_execution_failure
  560. };
  561. #endif