diff options
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/dt_picture.c | 24 | ||||
-rwxr-xr-x | amiga/pkg/makereslinks | 1 | ||||
-rw-r--r-- | amiga/resources/MIME/dt.picture | 66 |
3 files changed, 91 insertions, 0 deletions
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c index 315b3f2e1..1906af9d1 100644 --- a/amiga/dt_picture.c +++ b/amiga/dt_picture.c @@ -33,6 +33,7 @@ #include "utils/talloc.h" #include <proto/datatypes.h> +#include <proto/DOS.h> #include <proto/intuition.h> #include <datatypes/pictureclass.h> #include <intuition/classusr.h> @@ -90,6 +91,7 @@ nserror amiga_dt_picture_init(void) lwc_string *type; lwc_error lerror; nserror error; + BPTR fh = 0; while((dt = ObtainDataType(DTST_RAM, NULL, DTA_DataType, prevdt, @@ -118,6 +120,28 @@ nserror amiga_dt_picture_init(void) ReleaseDataType(prevdt); + if(fh = FOpen("PROGDIR:Resources/MIME/dt.picture", MODE_OLDFILE, 0)) + { + while(FGets(fh, &dt_mime, 50) != 0) + { + dt_mime[strlen(dt_mime) - 1] = '\0'; + if((dt_mime[0] == '\0') || (dt_mime[0] == '#')) + continue; /* Skip blank lines and comments */ + + lerror = lwc_intern_string(dt_mime, strlen(dt_mime), &type); + if (lerror != lwc_error_ok) + return NSERROR_NOMEM; + + error = content_factory_register_handler(type, + &amiga_dt_picture_content_handler); + + lwc_string_unref(type); + + if (error != NSERROR_OK) + return error; + } + FClose(fh); + } return NSERROR_OK; } diff --git a/amiga/pkg/makereslinks b/amiga/pkg/makereslinks index 25682b55d..c995eeb76 100755 --- a/amiga/pkg/makereslinks +++ b/amiga/pkg/makereslinks @@ -19,3 +19,4 @@ makelink Pointers /amiga/resources/Pointers soft makelink quirks.css /!NetSurf/Resources/Quirks,f79 soft makelink SearchEngines /amiga/resources/SearchEngines soft makelink Themes /amiga/resources/Themes soft +makelink MIME /amiga/resources/MIME soft diff --git a/amiga/resources/MIME/dt.picture b/amiga/resources/MIME/dt.picture new file mode 100644 index 000000000..5292f5381 --- /dev/null +++ b/amiga/resources/MIME/dt.picture @@ -0,0 +1,66 @@ +# This file contains a list of MIME types that can be handled by +# picture class datatypes (subclasses of picture.datatype) +# +# It does not matter if this file contains MIME Types for formats +# that a DataType is not installed for, unless a different +# subclass handles this type. + +# BMP +application/bmp +application/preview +application/x-bmp +application/x-win-bitmap +image/bmp +image/ms-bmp +image/x-bitmap +image/x-bmp +image/x-ms-bmp +image/x-win-bitmap +image/x-windows-bmp +image/x-xbitmap + +# GIF +# Expect this to cause problems with GIF anims if GIFANIM datatype installed +image/gif + +# ICO +application/ico +application/x-ico +image/ico +image/vnd.microsoft.icon +image/x-icon + +# .info +image/x-amiga-icon + +# JNG +image/jng +image/x-jng + +# JPEG +image/jpeg +image/jpg +image/pjpeg + +# JPEG2000 +image/jp2 +image/jpeg2000 + +# MNG +image/mng +image/x-mng +video/mng +video/x-mng + +# PNG +image/png + +# RISC OS Sprite +image/x-riscos-sprite + +# SVG +image/svg +image/svg+xml + +# WebP +image/webp |