Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / bitmap.h
blob5728f8ca3a7e56711d2d753eb2fc1581d8ecd7d0
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2006,2007 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_BITMAP_HEADER
20 #define GRUB_BITMAP_HEADER 1
22 #include <grub/err.h>
23 #include <grub/symbol.h>
24 #include <grub/types.h>
25 #include <grub/video.h>
27 struct grub_video_bitmap
29 /* Bitmap format description. */
30 struct grub_video_mode_info mode_info;
32 /* Pointer to bitmap data formatted according to mode_info. */
33 void *data;
36 struct grub_video_bitmap_reader
38 /* File extension for this bitmap type (including dot). */
39 const char *extension;
41 /* Reader function to load bitmap. */
42 grub_err_t (*reader) (struct grub_video_bitmap **bitmap,
43 const char *filename);
45 /* Next reader. */
46 struct grub_video_bitmap_reader *next;
48 typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t;
50 void EXPORT_FUNC (grub_video_bitmap_reader_register) (grub_video_bitmap_reader_t reader);
51 void EXPORT_FUNC (grub_video_bitmap_reader_unregister) (grub_video_bitmap_reader_t reader);
53 grub_err_t EXPORT_FUNC (grub_video_bitmap_create) (struct grub_video_bitmap **bitmap,
54 unsigned int width, unsigned int height,
55 enum grub_video_blit_format blit_format);
57 grub_err_t EXPORT_FUNC (grub_video_bitmap_destroy) (struct grub_video_bitmap *bitmap);
59 grub_err_t EXPORT_FUNC (grub_video_bitmap_load) (struct grub_video_bitmap **bitmap,
60 const char *filename);
62 /* Return bitmap width. */
63 static inline unsigned int
64 grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap)
66 if (!bitmap)
67 return 0;
69 return bitmap->mode_info.width;
72 /* Return bitmap height. */
73 static inline unsigned int
74 grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap)
76 if (!bitmap)
77 return 0;
79 return bitmap->mode_info.height;
82 void EXPORT_FUNC (grub_video_bitmap_get_mode_info) (struct grub_video_bitmap *bitmap,
83 struct grub_video_mode_info *mode_info);
85 void *EXPORT_FUNC (grub_video_bitmap_get_data) (struct grub_video_bitmap *bitmap);
87 #endif /* ! GRUB_BITMAP_HEADER */