summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Kendrick <rjek@netsurf-browser.org>2021-02-24 16:12:39 +0000
committerRob Kendrick <rjek@netsurf-browser.org>2021-02-24 16:12:39 +0000
commit937446b95beb40f9f641ee27bffbeb24509cbc73 (patch)
tree1ae98b40287f6f923226dd427a07d01d6cc9b48a
parent84ec9c2b2a8884c7bdb7e0fa461c8b2d9c495cb3 (diff)
downloadnetsurf-937446b95beb40f9f641ee27bffbeb24509cbc73.tar.gz
netsurf-937446b95beb40f9f641ee27bffbeb24509cbc73.tar.bz2
Allow drag-and-drop loading of WebP images on RISC OS
-rw-r--r--frontends/riscos/filetype.c2
-rw-r--r--frontends/riscos/filetype.h3
-rw-r--r--frontends/riscos/gui.c4
3 files changed, 8 insertions, 1 deletions
diff --git a/frontends/riscos/filetype.c b/frontends/riscos/filetype.c
index 73651cd63..d75214191 100644
--- a/frontends/riscos/filetype.c
+++ b/frontends/riscos/filetype.c
@@ -39,6 +39,7 @@ static const struct type_entry type_map[] = {
{0x188, "application/x-shockwave-flash"},
{0x695, "image/gif"},
{0x69c, "image/x-ms-bmp"},
+ {0xa66, "image/webp"},
{0xaad, "image/svg+xml"},
{0xaff, "image/x-drawfile"},
{0xb60, "image/png"},
@@ -269,6 +270,7 @@ int ro_content_native_type(struct hlcache_handle *c)
case FILETYPE_BMP: /* bmp */
case FILETYPE_ICO: /* ico */
case FILETYPE_PNG: /* png */
+ case FILETYPE_WEBP: /* webp */
case 0xff9: /* sprite */
return osfile_TYPE_SPRITE;
case FILETYPE_SVG: /* svg */
diff --git a/frontends/riscos/filetype.h b/frontends/riscos/filetype.h
index 4c45e7bd0..b9fca4d49 100644
--- a/frontends/riscos/filetype.h
+++ b/frontends/riscos/filetype.h
@@ -67,6 +67,9 @@
#ifndef FILETYPE_SVG
#define FILETYPE_SVG 0xaad
#endif
+#ifndef FILETYPE_WEBP
+#define FILETYPE_WEBP 0xa66
+#endif
/**
* Determine the MIME type of a local file.
diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c
index b0eb23256..cc12eaccb 100644
--- a/frontends/riscos/gui.c
+++ b/frontends/riscos/gui.c
@@ -827,6 +827,7 @@ static void ro_msg_dataload(wimp_message *message)
case osfile_TYPE_TEXT:
case FILETYPE_ARTWORKS:
case FILETYPE_SVG:
+ case FILETYPE_WEBP:
/* display the actual file */
error = netsurf_path_to_nsurl(message->data.data_xfer.file_name, &url);
break;
@@ -929,7 +930,8 @@ static void ro_msg_datasave(wimp_message *message)
case osfile_TYPE_SPRITE:
case osfile_TYPE_TEXT:
case FILETYPE_ARTWORKS:
- case FILETYPE_SVG: {
+ case FILETYPE_SVG:
+ case FILETYPE_WEBP: {
os_error *error;
dataxfer->your_ref = dataxfer->my_ref;