125 lines
3.8 KiB
C
125 lines
3.8 KiB
C
/* gfxmenu_view.h - gfxmenu view interface. */
|
|
/*
|
|
* VasEBoot -- GRand Unified Bootloader
|
|
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
|
|
*
|
|
* VasEBoot is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* VasEBoot is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with VasEBoot. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef VasEBoot_GFXMENU_VIEW_HEADER
|
|
#define VasEBoot_GFXMENU_VIEW_HEADER 1
|
|
|
|
#include <VasEBoot/types.h>
|
|
#include <VasEBoot/err.h>
|
|
#include <VasEBoot/menu.h>
|
|
#include <VasEBoot/font.h>
|
|
#include <VasEBoot/gfxwidgets.h>
|
|
|
|
struct VasEBoot_gfxmenu_view; /* Forward declaration of opaque type. */
|
|
typedef struct VasEBoot_gfxmenu_view *VasEBoot_gfxmenu_view_t;
|
|
|
|
|
|
VasEBoot_gfxmenu_view_t VasEBoot_gfxmenu_view_new (const char *theme_path,
|
|
int width, int height);
|
|
|
|
void VasEBoot_gfxmenu_view_destroy (VasEBoot_gfxmenu_view_t view);
|
|
|
|
/* Set properties on the view based on settings from the specified
|
|
theme file. */
|
|
VasEBoot_err_t VasEBoot_gfxmenu_view_load_theme (VasEBoot_gfxmenu_view_t view,
|
|
const char *theme_path);
|
|
|
|
VasEBoot_err_t VasEBoot_gui_recreate_box (VasEBoot_gfxmenu_box_t *boxptr,
|
|
const char *pattern, const char *theme_dir);
|
|
|
|
void VasEBoot_gfxmenu_view_draw (VasEBoot_gfxmenu_view_t view);
|
|
|
|
void
|
|
VasEBoot_gfxmenu_redraw_menu (VasEBoot_gfxmenu_view_t view);
|
|
|
|
void
|
|
VasEBoot_gfxmenu_redraw_timeout (VasEBoot_gfxmenu_view_t view);
|
|
|
|
void
|
|
VasEBoot_gfxmenu_view_redraw (VasEBoot_gfxmenu_view_t view,
|
|
const VasEBoot_video_rect_t *region);
|
|
|
|
void
|
|
VasEBoot_gfxmenu_clear_timeout (void *data);
|
|
void
|
|
VasEBoot_gfxmenu_print_timeout (int timeout, void *data);
|
|
void
|
|
VasEBoot_gfxmenu_set_chosen_entry (int entry, void *data);
|
|
|
|
VasEBoot_err_t VasEBoot_font_draw_string (const char *str,
|
|
VasEBoot_font_t font,
|
|
VasEBoot_video_color_t color,
|
|
int left_x, int baseline_y);
|
|
int VasEBoot_font_get_string_width (VasEBoot_font_t font,
|
|
const char *str);
|
|
|
|
|
|
/* Implementation details -- this should not be used outside of the
|
|
view itself. */
|
|
|
|
#include <VasEBoot/video.h>
|
|
#include <VasEBoot/bitmap.h>
|
|
#include <VasEBoot/bitmap_scale.h>
|
|
#include <VasEBoot/gui.h>
|
|
#include <VasEBoot/gfxwidgets.h>
|
|
#include <VasEBoot/icon_manager.h>
|
|
|
|
/* Definition of the private representation of the view. */
|
|
struct VasEBoot_gfxmenu_view
|
|
{
|
|
VasEBoot_video_rect_t screen;
|
|
|
|
int need_to_check_sanity;
|
|
VasEBoot_video_rect_t terminal_rect;
|
|
int terminal_border;
|
|
|
|
VasEBoot_font_t title_font;
|
|
VasEBoot_font_t message_font;
|
|
char *terminal_font_name;
|
|
VasEBoot_video_rgba_color_t title_color;
|
|
VasEBoot_video_rgba_color_t message_color;
|
|
VasEBoot_video_rgba_color_t message_bg_color;
|
|
struct VasEBoot_video_bitmap *raw_desktop_image;
|
|
struct VasEBoot_video_bitmap *scaled_desktop_image;
|
|
VasEBoot_video_bitmap_selection_method_t desktop_image_scale_method;
|
|
VasEBoot_video_bitmap_h_align_t desktop_image_h_align;
|
|
VasEBoot_video_bitmap_v_align_t desktop_image_v_align;
|
|
VasEBoot_video_rgba_color_t desktop_color;
|
|
VasEBoot_gfxmenu_box_t terminal_box;
|
|
char *title_text;
|
|
char *progress_message_text;
|
|
char *theme_path;
|
|
|
|
VasEBoot_gui_container_t canvas;
|
|
|
|
int double_repaint;
|
|
|
|
int selected;
|
|
|
|
VasEBoot_video_rect_t progress_message_frame;
|
|
|
|
VasEBoot_menu_t menu;
|
|
|
|
int nested;
|
|
|
|
int first_timeout;
|
|
};
|
|
|
|
#endif /* ! VasEBoot_GFXMENU_VIEW_HEADER */
|