Support dataloading of SVG files

Add internal filetype<->mimetype mapping for SVG files

svn path=/trunk/netsurf/; revision=3407
This commit is contained in:
John Mark Bell 2007-07-13 08:25:34 +00:00
parent afc9517fbd
commit 1ded087c6a
2 changed files with 9 additions and 1 deletions

View File

@ -27,6 +27,7 @@ static const struct type_entry type_map[] = {
{0x188, "application/x-shockwave-flash"},
{0x695, "image/gif"},
{0x69c, "image/x-ms-bmp"},
{0xaad, "image/svg+xml"},
{0xaff, "image/x-drawfile"},
{0xb60, "image/png"},
{0xc85, "image/jpeg"},
@ -289,6 +290,8 @@ int ro_content_filetype_from_type(content_type type) {
#ifdef WITH_ARTWORKS
case CONTENT_ARTWORKS: return 0xd94;
#endif
case CONTENT_SVG: return 0xaad;
default: break;
}
return 0;

View File

@ -126,6 +126,9 @@
#ifndef FILETYPE_ARTWORKS
#define FILETYPE_ARTWORKS 0xd94
#endif
#ifndef FILETYPE_SVG
#define FILETYPE_SVG 0xaad
#endif
extern bool ro_plot_patterned_lines;
@ -1467,6 +1470,7 @@ void ro_msg_dataload(wimp_message *message)
case osfile_TYPE_SPRITE:
case osfile_TYPE_TEXT:
case FILETYPE_ARTWORKS:
case FILETYPE_SVG:
/* display the actual file */
url = path_to_url(message->data.data_xfer.file_name);
break;
@ -1760,7 +1764,8 @@ void ro_msg_datasave(wimp_message *message)
case FILETYPE_JPEG:
case osfile_TYPE_SPRITE:
case osfile_TYPE_TEXT:
case FILETYPE_ARTWORKS: {
case FILETYPE_ARTWORKS:
case FILETYPE_SVG: {
os_error *error;
dataxfer->your_ref = dataxfer->my_ref;