| 1 |
#ifndef IMAGER_MSICON_H_ |
| 2 |
#define IMAGER_MSICON_H_ |
| 3 |
|
| 4 |
#include "iolayert.h" |
| 5 |
|
| 6 |
typedef struct ico_reader_tag ico_reader_t; |
| 7 |
|
| 8 |
#define ICON_ICON 1 |
| 9 |
#define ICON_CURSOR 2 |
| 10 |
|
| 11 |
typedef struct { |
| 12 |
unsigned char r, g, b, a; |
| 13 |
} ico_color_t; |
| 14 |
|
| 15 |
typedef struct { |
| 16 |
int width; |
| 17 |
int height; |
| 18 |
int direct; |
| 19 |
int bit_count; |
| 20 |
void *image_data; |
| 21 |
int palette_size; |
| 22 |
ico_color_t *palette; |
| 23 |
unsigned char *mask_data; |
| 24 |
int hotspot_x, hotspot_y; |
| 25 |
} ico_image_t; |
| 26 |
|
| 27 |
extern ico_reader_t *ico_reader_open(i_io_glue_t *ig, int *error); |
| 28 |
extern int ico_image_count(ico_reader_t *file); |
| 29 |
extern int ico_type(ico_reader_t *file); |
| 30 |
extern ico_image_t *ico_image_read(ico_reader_t *file, int index, int *error); |
| 31 |
extern void ico_image_release(ico_image_t *image); |
| 32 |
extern void ico_reader_close(ico_reader_t *file); |
| 33 |
|
| 34 |
extern int ico_write(i_io_glue_t *ig, ico_image_t const *images, |
| 35 |
int image_count, int type, int *error); |
| 36 |
|
| 37 |
extern size_t ico_error_message(int error, char *buffer, size_t buffer_size); |
| 38 |
|
| 39 |
#define ICO_MAX_MESSAGE 80 |
| 40 |
|
| 41 |
#define ICOERR_Short_File 100 |
| 42 |
#define ICOERR_File_Error 101 |
| 43 |
#define ICOERR_Write_Failure 102 |
| 44 |
|
| 45 |
#define ICOERR_Invalid_File 200 |
| 46 |
#define ICOERR_Unknown_Bits 201 |
| 47 |
|
| 48 |
#define ICOERR_Bad_Image_Index 300 |
| 49 |
#define ICOERR_Bad_File_Type 301 |
| 50 |
#define ICOERR_Invalid_Width 302 |
| 51 |
#define ICOERR_Invalid_Height 303 |
| 52 |
#define ICOERR_Invalid_Palette 304 |
| 53 |
#define ICOERR_No_Data 305 |
| 54 |
|
| 55 |
#define ICOERR_Out_Of_Memory 400 |
| 56 |
|
| 57 |
#endif |