summaryrefslogtreecommitdiff
path: root/frontends/amiga/dt_picture.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/amiga/dt_picture.c')
-rw-r--r--frontends/amiga/dt_picture.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/frontends/amiga/dt_picture.c b/frontends/amiga/dt_picture.c
index 88ce1c834..e13790d5c 100644
--- a/frontends/amiga/dt_picture.c
+++ b/frontends/amiga/dt_picture.c
@@ -25,6 +25,7 @@
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
#include <proto/datatypes.h>
#include <proto/dos.h>
#include <proto/intuition.h>
@@ -36,7 +37,9 @@
#include "netsurf/plotters.h"
#include "netsurf/bitmap.h"
#include "content/llcache.h"
+#include "content/content.h"
#include "content/content_protected.h"
+#include "content/content_factory.h"
#include "content/handlers/image/image_cache.h"
#include "amiga/bitmap.h"
@@ -131,11 +134,11 @@ nserror amiga_dt_picture_create(const content_handler *handler,
static Object *amiga_dt_picture_newdtobject(struct amiga_dt_picture_content *adt)
{
- const uint8 *data;
- ULONG size;
+ const uint8_t *data;
+ size_t size;
if(adt->dto == NULL) {
- data = (uint8 *)content__get_source_data((struct content *)adt, &size);
+ data = content__get_source_data((struct content *)adt, &size);
adt->dto = NewDTObject(NULL,
DTA_SourceType, DTST_MEMORY,
@@ -152,12 +155,12 @@ static Object *amiga_dt_picture_newdtobject(struct amiga_dt_picture_content *adt
static char *amiga_dt_picture_datatype(struct content *c)
{
- const uint8 *data;
- ULONG size;
+ const uint8_t *data;
+ size_t size;
struct DataType *dt;
char *filetype = NULL;
- data = (uint8 *)content__get_source_data(c, &size);
+ data = content__get_source_data(c, &size);
if((dt = ObtainDataType(DTST_MEMORY, NULL,
DTA_SourceAddress, data,
@@ -184,9 +187,10 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
if((dto = amiga_dt_picture_newdtobject(adt)))
{
- bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NEW);
+ bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NONE);
if (!bitmap) {
- msg_data.error = messages_get("NoMemory");
+ msg_data.errordata.errorcode = NSERROR_NOMEM;
+ msg_data.errordata.errormsg = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
return NULL;
}
@@ -198,7 +202,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
amiga_bitmap_get_rowstride(bitmap),
0, 0, c->width, c->height);
- amiga_bitmap_set_opaque(bitmap, amiga_bitmap_test_opaque(bitmap));
+ amiga_bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap));
DisposeDTObject(dto);
adt->dto = NULL;