diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-05-12 18:12:20 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-07-26 00:39:22 +0200 |
commit | 903548005c2141b9c67f80412a20522c163c5fb9 (patch) | |
tree | 1aa9cd962de8ad48fe5c369120608b829d2f9e60 /src/dicache.c | |
parent | 8f67d6e0cea4629ae2e1ca6962224aae0be15092 (diff) |
Merge SVG support from mobilized Dillo fork
Uses the nanosvg library to add SVG support.
See: https://www.toomanyatoms.com/software/mobilized_dillo.html
Authored-By: dogma
Diffstat (limited to 'src/dicache.c')
-rw-r--r-- | src/dicache.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dicache.c b/src/dicache.c index 48e8e9fc..1419ff7a 100644 --- a/src/dicache.c +++ b/src/dicache.c @@ -20,12 +20,14 @@ #include "dpng.h" #include "dgif.h" #include "djpeg.h" +#include "dsvg.h" enum { DIC_Gif, DIC_Png, - DIC_Jpeg + DIC_Jpeg, + DIC_Svg }; @@ -391,6 +393,10 @@ static void *Dicache_image(int ImgType, const char *MimeType, void *Ptr, DicEntry->Decoder = (CA_Callback_t)a_Png_callback; DicEntry->DecoderData = a_Png_new(web->Image, DicEntry->url, DicEntry->version); + } else if (ImgType == DIC_Svg) { + DicEntry->Decoder = (CA_Callback_t)a_Svg_callback; + DicEntry->DecoderData = + a_Svg_new(web->Image, DicEntry->url, DicEntry->version); } } else { /* Repeated image */ @@ -433,6 +439,15 @@ void *a_Dicache_jpeg_image(const char *Type, void *Ptr, CA_Callback_t *Call, } /** + * SVG wrapper for Dicache_image() + */ +void *a_Dicache_svg_image(const char *Type, void *Ptr, CA_Callback_t *Call, + void **Data) +{ + return Dicache_image(DIC_Svg, Type, Ptr, Call, Data); +} + +/** * This function is a cache client; (but feeds its clients from dicache) */ void a_Dicache_callback(int Op, CacheClient_t *Client) |