Classes | |
struct | _PWTHeader |
The header for the PWT file format. More... | |
Typedefs | |
typedef struct _PWTHeader | PWTHeader |
Enumerations | |
enum | Code { CODE_OK = 1, CODE_OPEN_FAILED = 0, CODE_WRONG_MAGIC_NUM = -1, CODE_WRONG_VERSION = -2, CODE_VALIDATE_FAILED = -3 } |
Various error codes that are used to identify if something went wrong. | |
Functions | |
IO::Code | save_case_to_file (const Glib::ustring &path, const Case::Case &pcase, const BufferMap &buffers, std::map< Glib::ustring, Glib::ustring > &bufferDescriptions) |
Save a case and its associated data to file. | |
IO::Code | export_case_to_file (const Glib::ustring &path, const Case::Case &pcase, const BufferMap &buffers) |
Export a case to file. | |
IO::Code | load_case_from_file (const Glib::ustring &path, Case::Case &pcase, BufferMap &buffers, std::map< Glib::ustring, Glib::ustring > &bufferDescriptions) |
Load a case from file. | |
IO::Code | save_sprite_to_file (const Glib::ustring &path, const Sprite &spr) |
Save a sprite to file. | |
IO::Code | export_sprite_to_file (const Glib::ustring &path, const Sprite &spr) |
Export a sprite to file. | |
IO::Code | load_sprite_from_file (const Glib::ustring &path, Sprite &spr) |
Load a sprite from file. | |
void | write_string (FILE *f, const Glib::ustring &str) |
Write a string to file. | |
Glib::ustring | read_string (FILE *f) |
Read a string from file. | |
void | write_export_image (FILE *f, const Glib::RefPtr< Gdk::Pixbuf > &pixbuf) |
Write a pixbuf to compressed, internal format. | |
void | write_pixbuf (FILE *f, const Glib::RefPtr< Gdk::Pixbuf > &pixbuf) |
Write a pixbuf in uncompressed format to file. | |
Glib::RefPtr < Gdk::Pixbuf > | read_pixbuf (FILE *f) |
Read an uncompressed pixbuf from file. | |
void | add_recent_file (const Glib::ustring &uri, const Glib::ustring &display) |
Add a file to the recent files record. | |
IO::Code | read_recent_files (std::vector< StringPair > &vec) |
Read the recent files record. | |
IO::Code | unpack_resource_file (const Glib::ustring &file) |
Unpack the resource file. | |
IO::Code | read_icons_from_file (IconMap &icons) |
Read icons from a theme file. | |
Variables | |
const int | FILE_MAGIC_NUM = (('T' << 16) + ('W' << 8) + 'P') |
Magic number for PWT file format. | |
const int | FILE_VERSION = 10 |
Supported version for PWT file. | |
const Glib::ustring | SPR_MAGIC_NUM = "SPR" |
Magic number for SPR file format. | |
const int | SPR_VERSION = 10 |
Supported SPR file version. | |
const long | RESOURCE_FILE_SIZE = 192434 |
The expected size in bytes of the resource file. |
void IO::add_recent_file | ( | const Glib::ustring & | uri, | |
const Glib::ustring & | display | |||
) |
Add a file to the recent files record.
uri | The path to the recent file | |
display | The display string |
IO::Code IO::export_case_to_file | ( | const Glib::ustring & | path, | |
const Case::Case & | pcase, | |||
const BufferMap & | buffers | |||
) |
Export a case to file.
path | The path to export to | |
pcase | The case to export | |
buffers | The buffers in this case |
Export a sprite to file.
path | The path to export to | |
spr | The Sprite to export |
IO::Code IO::load_case_from_file | ( | const Glib::ustring & | path, | |
Case::Case & | pcase, | |||
BufferMap & | buffers, | |||
std::map< Glib::ustring, Glib::ustring > & | bufferDescriptions | |||
) |
Load a case from file.
path | The path to the case file to load | |
pcase | Empty Case object to populate | |
buffers | Empty buffer map to populate | |
bufferDescriptions | Empty map of descriptions to populate |
Load a sprite from file.
path | The path to the sprite to load | |
spr | Empty Sprite object to populate |
IO::Code IO::read_icons_from_file | ( | IconMap & | icons | ) |
Read icons from a theme file.
icons | Empty map of icons to populate |
Glib::RefPtr< Gdk::Pixbuf > IO::read_pixbuf | ( | FILE * | f | ) |
Read an uncompressed pixbuf from file.
f | Pointer to open FILE handle |
IO::Code IO::read_recent_files | ( | std::vector< StringPair > & | vec | ) |
Read the recent files record.
vec | Empty vector to populate with files |
Glib::ustring IO::read_string | ( | FILE * | f | ) |
Read a string from file.
f | Pointer to open FILE handle |
IO::Code IO::save_case_to_file | ( | const Glib::ustring & | path, | |
const Case::Case & | pcase, | |||
const BufferMap & | buffers, | |||
std::map< Glib::ustring, Glib::ustring > & | bufferDescriptions | |||
) |
Save a case and its associated data to file.
path | The path to save to | |
pcase | The case to save | |
buffers | The buffers in this case | |
bufferDescriptions | Descriptions of buffers |
Save a sprite to file.
path | The path to save to | |
spr | The Sprite object to save |
IO::Code IO::unpack_resource_file | ( | const Glib::ustring & | file | ) |
Unpack the resource file.
file | The path to the resource file |
void IO::write_export_image | ( | FILE * | f, | |
const Glib::RefPtr< Gdk::Pixbuf > & | pixbuf | |||
) |
Write a pixbuf to compressed, internal format.
f | Pointer to open FILE handle | |
pixbuf | The actual image data to write |
void IO::write_pixbuf | ( | FILE * | f, | |
const Glib::RefPtr< Gdk::Pixbuf > & | pixbuf | |||
) |
Write a pixbuf in uncompressed format to file.
f | Pointer to open FILE handle | |
pixbuf | The image data to write |
void IO::write_string | ( | FILE * | f, | |
const Glib::ustring & | str | |||
) |
Write a string to file.
f | Pointer to open FILE handle | |
str | The string to write |