gfxmenu_view.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /* gfxmenu_view.h - gfxmenu view interface. */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2008,2009 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. #ifndef GRUB_GFXMENU_VIEW_HEADER
  20. #define GRUB_GFXMENU_VIEW_HEADER 1
  21. #include <grub/types.h>
  22. #include <grub/err.h>
  23. #include <grub/menu.h>
  24. #include <grub/font.h>
  25. #include <grub/gfxwidgets.h>
  26. struct grub_gfxmenu_view; /* Forward declaration of opaque type. */
  27. typedef struct grub_gfxmenu_view *grub_gfxmenu_view_t;
  28. grub_gfxmenu_view_t grub_gfxmenu_view_new (const char *theme_path,
  29. int width, int height);
  30. void grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view);
  31. /* Set properties on the view based on settings from the specified
  32. theme file. */
  33. grub_err_t grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view,
  34. const char *theme_path);
  35. grub_err_t grub_gui_recreate_box (grub_gfxmenu_box_t *boxptr,
  36. const char *pattern, const char *theme_dir);
  37. void grub_gfxmenu_view_draw (grub_gfxmenu_view_t view);
  38. void
  39. grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view);
  40. void
  41. grub_gfxmenu_redraw_timeout (grub_gfxmenu_view_t view);
  42. void
  43. grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view,
  44. const grub_video_rect_t *region);
  45. void
  46. grub_gfxmenu_clear_timeout (void *data);
  47. void
  48. grub_gfxmenu_print_timeout (int timeout, void *data);
  49. void
  50. grub_gfxmenu_set_chosen_entry (int entry, void *data);
  51. grub_err_t grub_font_draw_string (const char *str,
  52. grub_font_t font,
  53. grub_video_color_t color,
  54. int left_x, int baseline_y);
  55. int grub_font_get_string_width (grub_font_t font,
  56. const char *str);
  57. /* Implementation details -- this should not be used outside of the
  58. view itself. */
  59. #include <grub/video.h>
  60. #include <grub/bitmap.h>
  61. #include <grub/bitmap_scale.h>
  62. #include <grub/gui.h>
  63. #include <grub/gfxwidgets.h>
  64. #include <grub/icon_manager.h>
  65. /* Definition of the private representation of the view. */
  66. struct grub_gfxmenu_view
  67. {
  68. grub_video_rect_t screen;
  69. int need_to_check_sanity;
  70. grub_video_rect_t terminal_rect;
  71. int terminal_border;
  72. grub_font_t title_font;
  73. grub_font_t message_font;
  74. char *terminal_font_name;
  75. grub_video_rgba_color_t title_color;
  76. grub_video_rgba_color_t message_color;
  77. grub_video_rgba_color_t message_bg_color;
  78. struct grub_video_bitmap *raw_desktop_image;
  79. struct grub_video_bitmap *scaled_desktop_image;
  80. grub_video_bitmap_selection_method_t desktop_image_scale_method;
  81. grub_video_bitmap_h_align_t desktop_image_h_align;
  82. grub_video_bitmap_v_align_t desktop_image_v_align;
  83. grub_video_rgba_color_t desktop_color;
  84. grub_gfxmenu_box_t terminal_box;
  85. char *title_text;
  86. char *progress_message_text;
  87. char *theme_path;
  88. grub_gui_container_t canvas;
  89. int double_repaint;
  90. int selected;
  91. grub_video_rect_t progress_message_frame;
  92. grub_menu_t menu;
  93. int nested;
  94. int first_timeout;
  95. };
  96. #endif /* ! GRUB_GFXMENU_VIEW_HEADER */