summaryrefslogtreecommitdiff
path: root/content/content.c
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-03-05 09:49:15 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-03-05 09:49:15 +0000
commit208b98bb44b986e62ff0f80b7e50c9da3e12cb8f (patch)
tree83620f97ee05ddf3a4852607e465b2c1ae114175 /content/content.c
parent323d5f3ba1b8ea700215616e42a5fb158ee7006f (diff)
downloadnetsurf-208b98bb44b986e62ff0f80b7e50c9da3e12cb8f.tar.gz
netsurf-208b98bb44b986e62ff0f80b7e50c9da3e12cb8f.tar.bz2
Created content handler CONTENT_APPLE_IMAGE for Mac OS X that can handle all image file formats supported by Apples ImageIO framework. Right now used only for JPEG to get rid of libjpeg dependency.
svn path=/trunk/netsurf/; revision=11911
Diffstat (limited to 'content/content.c')
-rw-r--r--content/content.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c
index cac5c97e7..41d922d62 100644
--- a/content/content.c
+++ b/content/content.c
@@ -83,6 +83,10 @@
#ifdef WITH_AMIGA_ICON
#include "amiga/icon.h"
#endif
+#ifdef WITH_APPLE_IMAGE
+#include "cocoa/apple_image.h"
+#endif
+
#include "utils/http.h"
#include "utils/log.h"
#include "utils/messages.h"
@@ -140,6 +144,10 @@ static const struct mime_entry mime_map[] = {
{"image/jpeg", CONTENT_JPEG},
{"image/jpg", CONTENT_JPEG},
#endif
+#ifdef WITH_APPLE_IMAGE
+ {"image/jpeg", CONTENT_APPLE_IMAGE},
+ {"image/jpg", CONTENT_APPLE_IMAGE},
+#endif
#ifdef WITH_MNG
{"image/mng", CONTENT_MNG},
#endif
@@ -149,6 +157,9 @@ static const struct mime_entry mime_map[] = {
#ifdef WITH_JPEG
{"image/pjpeg", CONTENT_JPEG},
#endif
+#ifdef WITH_APPLE_IMAGE
+ {"image/pjpeg", CONTENT_APPLE_IMAGE},
+#endif
#if defined(WITH_MNG) || defined(WITH_PNG)
{"image/png", CONTENT_PNG},
#endif
@@ -249,6 +260,9 @@ const char * const content_type_name[] = {
#ifdef WITH_AMIGA_ICON
"AMIGA_ICON",
#endif
+#ifdef WITH_APPLE_IMAGE
+ "APPLE_IMAGE",
+#endif
"OTHER",
"UNKNOWN"
};
@@ -385,6 +399,10 @@ static const struct handler_entry handler_map[] = {
0, amiga_icon_destroy, 0, 0, 0, amiga_icon_redraw, 0,
0, 0, amiga_icon_clone, false},
#endif
+#ifdef WITH_APPLE_IMAGE
+ {0, 0, apple_image_convert, 0, apple_image_destroy, 0, 0, 0,
+ apple_image_redraw, apple_image_redraw_tiled, 0, 0, apple_image_clone, false},
+#endif
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false}
};
#define HANDLER_MAP_COUNT (sizeof(handler_map) / sizeof(handler_map[0]))