]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - GRUB2/MOD_SRC/grub-2.04/include/grub/gfxmenu_view.h
1.1.01
[Ventoy.git] / GRUB2 / MOD_SRC / grub-2.04 / include / grub / gfxmenu_view.h
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
20 #ifndef GRUB_GFXMENU_VIEW_HEADER
21 #define GRUB_GFXMENU_VIEW_HEADER 1
22
23 #include <grub/types.h>
24 #include <grub/err.h>
25 #include <grub/menu.h>
26 #include <grub/font.h>
27 #include <grub/gfxwidgets.h>
28
29 struct grub_gfxmenu_view; /* Forward declaration of opaque type. */
30 typedef struct grub_gfxmenu_view *grub_gfxmenu_view_t;
31
32
33 grub_gfxmenu_view_t grub_gfxmenu_view_new (const char *theme_path,
34 int width, int height);
35
36 void grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view);
37
38 /* Set properties on the view based on settings from the specified
39 theme file. */
40 grub_err_t grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view,
41 const char *theme_path);
42
43 grub_err_t grub_gui_recreate_box (grub_gfxmenu_box_t *boxptr,
44 const char *pattern, const char *theme_dir);
45
46 void grub_gfxmenu_view_draw (grub_gfxmenu_view_t view);
47
48 void
49 grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view);
50
51 void
52 grub_gfxmenu_redraw_timeout (grub_gfxmenu_view_t view);
53
54 void
55 grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view,
56 const grub_video_rect_t *region);
57
58 void
59 grub_gfxmenu_clear_timeout (void *data);
60 void
61 grub_gfxmenu_print_timeout (int timeout, void *data);
62 void
63 grub_gfxmenu_set_chosen_entry (int entry, void *data);
64 void
65 grub_gfxmenu_scroll_chosen_entry (void *data, int diren);
66
67 grub_err_t grub_font_draw_string (const char *str,
68 grub_font_t font,
69 grub_video_color_t color,
70 int left_x, int baseline_y);
71 int grub_font_get_string_width (grub_font_t font,
72 const char *str);
73
74
75 /* Implementation details -- this should not be used outside of the
76 view itself. */
77
78 #include <grub/video.h>
79 #include <grub/bitmap.h>
80 #include <grub/bitmap_scale.h>
81 #include <grub/gui.h>
82 #include <grub/gfxwidgets.h>
83 #include <grub/icon_manager.h>
84
85 /* Definition of the private representation of the view. */
86 struct grub_gfxmenu_view
87 {
88 grub_video_rect_t screen;
89
90 int need_to_check_sanity;
91 grub_video_rect_t terminal_rect;
92 int terminal_border;
93
94 grub_font_t title_font;
95 grub_font_t message_font;
96 char *terminal_font_name;
97 grub_video_rgba_color_t title_color;
98 grub_video_rgba_color_t message_color;
99 grub_video_rgba_color_t message_bg_color;
100 struct grub_video_bitmap *raw_desktop_image;
101 struct grub_video_bitmap *scaled_desktop_image;
102 grub_video_bitmap_selection_method_t desktop_image_scale_method;
103 grub_video_bitmap_h_align_t desktop_image_h_align;
104 grub_video_bitmap_v_align_t desktop_image_v_align;
105 grub_video_rgba_color_t desktop_color;
106 grub_gfxmenu_box_t terminal_box;
107 char *title_text;
108 char *progress_message_text;
109 char *theme_path;
110
111 grub_gui_container_t canvas;
112
113 int double_repaint;
114
115 int selected;
116
117 grub_video_rect_t progress_message_frame;
118
119 grub_menu_t menu;
120
121 int nested;
122
123 int first_timeout;
124
125 int *menu_title_offset;
126 };
127
128 #endif /* ! GRUB_GFXMENU_VIEW_HEADER */