mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-23 09:54:19 +03:00
Fix up amiga content handlers.
svn path=/trunk/netsurf/; revision=12541
This commit is contained in:
parent
673a51a0e5
commit
8577895dc1
@ -60,10 +60,8 @@ static nserror amiga_dt_anim_create(const content_handler *handler,
|
||||
static bool amiga_dt_anim_convert(struct content *c);
|
||||
static void amiga_dt_anim_reformat(struct content *c, int width, int height);
|
||||
static void amiga_dt_anim_destroy(struct content *c);
|
||||
static bool amiga_dt_anim_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y);
|
||||
static bool amiga_dt_anim_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip);
|
||||
static void amiga_dt_anim_open(struct content *c, struct browser_window *bw,
|
||||
struct content *page, struct box *box,
|
||||
struct object_params *params);
|
||||
@ -251,10 +249,8 @@ void amiga_dt_anim_destroy(struct content *c)
|
||||
return;
|
||||
}
|
||||
|
||||
bool amiga_dt_anim_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y)
|
||||
bool amiga_dt_anim_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip)
|
||||
{
|
||||
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
|
||||
|
||||
@ -262,13 +258,13 @@ bool amiga_dt_anim_redraw(struct content *c, int x, int y,
|
||||
|
||||
bitmap_flags_t flags = BITMAPF_NONE;
|
||||
|
||||
if (repeat_x)
|
||||
if (data->repeat_x)
|
||||
flags |= BITMAPF_REPEAT_X;
|
||||
if (repeat_y)
|
||||
if (data->repeat_y)
|
||||
flags |= BITMAPF_REPEAT_Y;
|
||||
|
||||
return plot.bitmap(x, y, width, height,
|
||||
c->bitmap, background_colour, flags);
|
||||
return plot.bitmap(data->x, data->y, data->width, data->height,
|
||||
c->bitmap, data->background_colour, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,10 +53,8 @@ static nserror amiga_dt_picture_create(const content_handler *handler,
|
||||
bool quirks, struct content **c);
|
||||
static bool amiga_dt_picture_convert(struct content *c);
|
||||
static void amiga_dt_picture_destroy(struct content *c);
|
||||
static bool amiga_dt_picture_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y);
|
||||
static bool amiga_dt_picture_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip);
|
||||
static nserror amiga_dt_picture_clone(const struct content *old, struct content **newc);
|
||||
static content_type amiga_dt_picture_content_type(lwc_string *mime_type);
|
||||
|
||||
@ -221,21 +219,19 @@ void amiga_dt_picture_destroy(struct content *c)
|
||||
return;
|
||||
}
|
||||
|
||||
bool amiga_dt_picture_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y)
|
||||
bool amiga_dt_picture_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip)
|
||||
{
|
||||
LOG(("amiga_dt_picture_redraw"));
|
||||
bitmap_flags_t flags = BITMAPF_NONE;
|
||||
|
||||
if (repeat_x)
|
||||
if (data->repeat_x)
|
||||
flags |= BITMAPF_REPEAT_X;
|
||||
if (repeat_y)
|
||||
if (data->repeat_y)
|
||||
flags |= BITMAPF_REPEAT_Y;
|
||||
|
||||
return plot.bitmap(x, y, width, height,
|
||||
c->bitmap, background_colour, flags);
|
||||
return plot.bitmap(data->x, data->y, data->width, data->height,
|
||||
c->bitmap, data->background_colour, flags);
|
||||
}
|
||||
|
||||
nserror amiga_dt_picture_clone(const struct content *old, struct content **newc)
|
||||
|
@ -49,10 +49,8 @@ static nserror amiga_dt_sound_create(const content_handler *handler,
|
||||
bool quirks, struct content **c);
|
||||
static bool amiga_dt_sound_convert(struct content *c);
|
||||
static void amiga_dt_sound_destroy(struct content *c);
|
||||
static bool amiga_dt_sound_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y);
|
||||
static bool amiga_dt_sound_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip);
|
||||
static void amiga_dt_sound_open(struct content *c, struct browser_window *bw,
|
||||
struct content *page, struct box *box,
|
||||
struct object_params *params);
|
||||
@ -194,10 +192,8 @@ void amiga_dt_sound_destroy(struct content *c)
|
||||
return;
|
||||
}
|
||||
|
||||
bool amiga_dt_sound_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y)
|
||||
bool amiga_dt_sound_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip)
|
||||
{
|
||||
plot_style_t pstyle = {
|
||||
.fill_type = PLOT_OP_TYPE_SOLID,
|
||||
@ -210,9 +206,13 @@ bool amiga_dt_sound_redraw(struct content *c, int x, int y,
|
||||
|
||||
/* this should be some sort of play/stop control */
|
||||
|
||||
plot.rectangle(x, y, x + width, y + height, &pstyle);
|
||||
return plot.text(x, y+20, lwc_string_data(content__get_mime_type(c)),
|
||||
lwc_string_length(content__get_mime_type(c)), plot_style_font);
|
||||
plot.rectangle(data->x, data->y, data->x + data->width,
|
||||
data->y + data->height, &pstyle);
|
||||
|
||||
return plot.text(data->x, data->y+20,
|
||||
lwc_string_data(content__get_mime_type(c)),
|
||||
lwc_string_length(content__get_mime_type(c)),
|
||||
plot_style_font);
|
||||
|
||||
}
|
||||
|
||||
|
20
amiga/icon.c
20
amiga/icon.c
@ -63,10 +63,8 @@ static nserror amiga_icon_create(const content_handler *handler,
|
||||
bool quirks, struct content **c);
|
||||
static bool amiga_icon_convert(struct content *c);
|
||||
static void amiga_icon_destroy(struct content *c);
|
||||
static bool amiga_icon_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y);
|
||||
static bool amiga_icon_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip);
|
||||
static nserror amiga_icon_clone(const struct content *old,
|
||||
struct content **newc);
|
||||
static content_type amiga_icon_content_type(lwc_string *mime_type);
|
||||
@ -287,20 +285,18 @@ void amiga_icon_destroy(struct content *c)
|
||||
* Redraw a CONTENT_AMIGA_ICON.
|
||||
*/
|
||||
|
||||
bool amiga_icon_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y)
|
||||
bool amiga_icon_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip)
|
||||
{
|
||||
bitmap_flags_t flags = BITMAPF_NONE;
|
||||
|
||||
if (repeat_x)
|
||||
if (data->repeat_x)
|
||||
flags |= BITMAPF_REPEAT_X;
|
||||
if (repeat_y)
|
||||
if (data->repeat_y)
|
||||
flags |= BITMAPF_REPEAT_Y;
|
||||
|
||||
return plot.bitmap(x, y, width, height,
|
||||
c->bitmap, background_colour, flags);
|
||||
return plot.bitmap(data->x, data->y, data->width, data->height,
|
||||
c->bitmap, data->background_colour, flags);
|
||||
}
|
||||
|
||||
|
||||
|
@ -45,10 +45,8 @@ static nserror amiga_plugin_hack_create(const content_handler *handler,
|
||||
static bool amiga_plugin_hack_convert(struct content *c);
|
||||
static void amiga_plugin_hack_reformat(struct content *c, int width, int height);
|
||||
static void amiga_plugin_hack_destroy(struct content *c);
|
||||
static bool amiga_plugin_hack_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y);
|
||||
static bool amiga_plugin_hack_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip);
|
||||
static void amiga_plugin_hack_open(struct content *c, struct browser_window *bw,
|
||||
struct content *page, struct box *box,
|
||||
struct object_params *params);
|
||||
@ -144,10 +142,8 @@ void amiga_plugin_hack_destroy(struct content *c)
|
||||
return;
|
||||
}
|
||||
|
||||
bool amiga_plugin_hack_redraw(struct content *c, int x, int y,
|
||||
int width, int height, const struct rect *clip,
|
||||
float scale, colour background_colour,
|
||||
bool repeat_x, bool repeat_y)
|
||||
bool amiga_plugin_hack_redraw(struct content *c,
|
||||
struct content_redraw_data *data, const struct rect *clip)
|
||||
{
|
||||
plot_style_t pstyle = {
|
||||
.fill_type = PLOT_OP_TYPE_SOLID,
|
||||
@ -158,10 +154,13 @@ bool amiga_plugin_hack_redraw(struct content *c, int x, int y,
|
||||
|
||||
LOG(("amiga_plugin_hack_redraw"));
|
||||
|
||||
plot.rectangle(x, y, x + width, y + height, &pstyle);
|
||||
return plot.text(x, y+20, lwc_string_data(content__get_mime_type(c)),
|
||||
lwc_string_length(content__get_mime_type(c)), plot_style_font);
|
||||
plot.rectangle(data->x, data->y, data->x + data->width,
|
||||
data->y + data->height, &pstyle);
|
||||
|
||||
return plot.text(data->x, data->y+20,
|
||||
lwc_string_data(content__get_mime_type(c)),
|
||||
lwc_string_length(content__get_mime_type(c)),
|
||||
plot_style_font);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user