gfxwidgets.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* gfxwidgets.h - Widgets for the graphical menu (gfxmenu). */
  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. #ifndef GRUB_GFXWIDGETS_HEADER
  20. #define GRUB_GFXWIDGETS_HEADER 1
  21. #include <grub/video.h>
  22. typedef struct grub_gfxmenu_box *grub_gfxmenu_box_t;
  23. struct grub_gfxmenu_box
  24. {
  25. /* The size of the content. */
  26. int content_width;
  27. int content_height;
  28. struct grub_video_bitmap **raw_pixmaps;
  29. struct grub_video_bitmap **scaled_pixmaps;
  30. void (*draw) (grub_gfxmenu_box_t self, int x, int y);
  31. void (*set_content_size) (grub_gfxmenu_box_t self,
  32. int width, int height);
  33. int (*get_border_width) (grub_gfxmenu_box_t self);
  34. int (*get_left_pad) (grub_gfxmenu_box_t self);
  35. int (*get_top_pad) (grub_gfxmenu_box_t self);
  36. int (*get_right_pad) (grub_gfxmenu_box_t self);
  37. int (*get_bottom_pad) (grub_gfxmenu_box_t self);
  38. void (*destroy) (grub_gfxmenu_box_t self);
  39. };
  40. grub_gfxmenu_box_t grub_gfxmenu_create_box (const char *pixmaps_prefix,
  41. const char *pixmaps_suffix);
  42. #endif /* ! GRUB_GFXWIDGETS_HEADER */