[layers] Updated from trunk: 'All formats' filter in file selectors

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1084 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2009-10-21 09:57:38 +00:00
6 changed files with 134 additions and 98 deletions

View File

@@ -40,17 +40,20 @@ void Save_image(byte image);
/// Data for an image file format.
typedef struct {
char *Extension; ///< Three-letter file extension
Func_action Test; ///< Function which tests if the file is of this format
Func_action Load; ///< Function which loads an image of this format
Func_action Save; ///< Function which saves an image of this format
byte Backup_done; ///< Boolean, true if this format saves all the image, and considers it backed up. Set false for formats which only save the palette.
byte Comment; ///< This file format allows a text comment
byte Identifier; ///< Identifier for this format in enum :FILE_FORMATS
char *Label; ///< Five-letter label
Func_action Test; ///< Function which tests if the file is of this format
Func_action Load; ///< Function which loads an image of this format
Func_action Save; ///< Function which saves an image of this format
byte Backup_done; ///< Boolean, true if this format saves all the image, and considers it backed up. Set false for formats which only save the palette.
byte Comment; ///< This file format allows a text comment
byte Supports_layers; ///< Boolean, true if this format preserves layers on saving
char *Default_extension; ///< Default file extension
char *Extensions; ///< List of semicolon-separated file extensions
} T_Format;
/// Array of the known file formats
extern T_Format File_formats[NB_KNOWN_FORMATS];
extern T_Format File_formats[];
///
/// Function which attempts to save backups of the images (main and spare),
@@ -59,3 +62,15 @@ void Image_emergency_backup(void);
/// Pixel ratio of last loaded image: one of :PIXEL_SIMPLE, :PIXEL_WIDE or :PIXEL_TALL
extern enum PIXEL_RATIO Ratio_of_loaded_image;
T_Format * Get_fileformat(byte format);
// -- File formats
#ifndef __no_pnglib__
#define NB_KNOWN_FORMATS 17 ///< Total number of known file formats.
#else
// Without pnglib
#define NB_KNOWN_FORMATS 16 ///< Total number of known file formats.
#endif