summaryrefslogtreecommitdiff
path: root/content
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
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')
-rw-r--r--content/content.c18
-rw-r--r--content/content_protected.h7
-rw-r--r--content/content_type.h3
3 files changed, 27 insertions, 1 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]))
diff --git a/content/content_protected.h b/content/content_protected.h
index 38f381583..50ece50a5 100644
--- a/content/content_protected.h
+++ b/content/content_protected.h
@@ -81,7 +81,9 @@
#ifdef WITH_AMIGA_ICON
#include "amiga/icon.h"
#endif
-
+#ifdef WITH_APPLE_IMAGE
+#include "cocoa/apple_image.h"
+#endif
struct bitmap;
struct content;
@@ -159,6 +161,9 @@ struct content {
#ifdef WITH_AMIGA_ICON
struct content_amiga_icon_data amiga_icon;
#endif
+#ifdef WITH_APPLE_IMAGE
+ struct content_apple_image_data apple_image;
+#endif
} data;
/**< URL for refresh request, in standard form as from url_join. */
diff --git a/content/content_type.h b/content/content_type.h
index 9703c5616..0b086a599 100644
--- a/content/content_type.h
+++ b/content/content_type.h
@@ -74,6 +74,9 @@ typedef enum {
#ifdef WITH_AMIGA_ICON
CONTENT_AMIGA_ICON,
#endif
+#ifdef WITH_APPLE_IMAGE
+ CONTENT_APPLE_IMAGE,
+#endif
/* these must be the last two */
CONTENT_OTHER,
CONTENT_UNKNOWN /**< content-type not received yet */