1 /* gfxmenu_view.h - gfxmenu view interface. */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2008,2009 Free Software Foundation, Inc.
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.
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.
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/>.
20 #ifndef GRUB_GFXMENU_VIEW_HEADER
21 #define GRUB_GFXMENU_VIEW_HEADER 1
23 #include <grub/types.h>
25 #include <grub/menu.h>
26 #include <grub/font.h>
27 #include <grub/gfxwidgets.h>
29 struct grub_gfxmenu_view
; /* Forward declaration of opaque type. */
30 typedef struct grub_gfxmenu_view
*grub_gfxmenu_view_t
;
33 grub_gfxmenu_view_t
grub_gfxmenu_view_new (const char *theme_path
,
34 int width
, int height
);
36 void grub_gfxmenu_view_destroy (grub_gfxmenu_view_t view
);
38 /* Set properties on the view based on settings from the specified
40 grub_err_t
grub_gfxmenu_view_load_theme (grub_gfxmenu_view_t view
,
41 const char *theme_path
);
43 grub_err_t
grub_gui_recreate_box (grub_gfxmenu_box_t
*boxptr
,
44 const char *pattern
, const char *theme_dir
);
46 void grub_gfxmenu_view_draw (grub_gfxmenu_view_t view
);
49 grub_gfxmenu_redraw_menu (grub_gfxmenu_view_t view
);
52 grub_gfxmenu_redraw_timeout (grub_gfxmenu_view_t view
);
55 grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view
,
56 const grub_video_rect_t
*region
);
59 grub_gfxmenu_clear_timeout (void *data
);
61 grub_gfxmenu_print_timeout (int timeout
, void *data
);
63 grub_gfxmenu_set_chosen_entry (int entry
, void *data
);
65 grub_gfxmenu_scroll_chosen_entry (void *data
, int diren
);
67 grub_err_t
grub_font_draw_string (const char *str
,
69 grub_video_color_t color
,
70 int left_x
, int baseline_y
);
71 int grub_font_get_string_width (grub_font_t font
,
75 /* Implementation details -- this should not be used outside of the
78 #include <grub/video.h>
79 #include <grub/bitmap.h>
80 #include <grub/bitmap_scale.h>
82 #include <grub/gfxwidgets.h>
83 #include <grub/icon_manager.h>
85 /* Definition of the private representation of the view. */
86 struct grub_gfxmenu_view
88 grub_video_rect_t screen
;
90 int need_to_check_sanity
;
91 grub_video_rect_t terminal_rect
;
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
;
108 char *progress_message_text
;
111 grub_gui_container_t canvas
;
117 grub_video_rect_t progress_message_frame
;
125 int *menu_title_offset
;
128 #endif /* ! GRUB_GFXMENU_VIEW_HEADER */