65 bitmap_state |= (bmp_state & BMP_CLEAR_MEMORY) ?
74 bmp_bitmap_callback_vt bmp_bitmap_callbacks = {
80 bmp->
bmp = calloc(1,
sizeof(
struct bmp_image));
81 if (bmp->
bmp == NULL) {
86 bmp_create(bmp->
bmp, &bmp_bitmap_callbacks);
93 lwc_string *imime_type,
96 const char *fallback_charset,
108 llcache, fallback_charset, quirks);
138 res = bmp_analyse(bmp->
bmp,
size, (
unsigned char *) data);
142 case BMP_INSUFFICIENT_MEMORY:
145 case BMP_INSUFFICIENT_DATA:
154 swidth =
sizeof(uint32_t) * bmp->
bmp->width;
155 c->
size += (swidth * bmp->
bmp->height) + 16 + 44;
183 if (bmp->
bmp->decoded ==
false) {
185 res = bmp_decode(bmp->
bmp);
187 if ((res != BMP_OK) &&
188 (res != BMP_INSUFFICIENT_DATA) &&
189 (res != BMP_DATA_ERROR)) {
194 .layout = BITMAP_LAYOUT_R8G8B8A8,
217 bmp_finalise(bmp->
bmp);
252 *newc = (
struct content *) new_bmp;
273 if (bmp->
bitmap != NULL) {
294 "application/preview",
296 "application/x-win-bitmap",
302 "image/x-win-bitmap",
303 "image/x-windows-bmp",
static void * nsbmp_get_internal(const struct content *c, void *context)
CONTENT_FACTORY_REGISTER_TYPES(nsbmp, nsbmp_types, nsbmp_content_handler)
static nserror nsbmp_create_bmp_data(nsbmp_content *bmp)
static bool nsbmp_convert(struct content *c)
static bool nsbmp_content_is_opaque(struct content *c)
struct nsbmp_content nsbmp_content
bmp context.
static void * nsbmp_bitmap_create(int width, int height, unsigned int bmp_state)
Callback for libnsbmp; forwards the call to bitmap_create()
static void nsbmp_destroy(struct content *c)
static const content_handler nsbmp_content_handler
static bool nsbmp_redraw(struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
static nserror nsbmp_create(const struct content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c)
static content_type nsbmp_content_type(void)
static const char * nsbmp_types[]
static nserror nsbmp_clone(const struct content *old, struct content **newc)
interface to image/bmp content handler initialisation.
void content_destroy(struct content *c)
Destroy and free a content.
void content_set_done(struct content *c)
Put a content in status CONTENT_STATUS_DONE.
bool content__set_title(struct content *c, const char *title)
Set title associated with content.
nserror content__init(struct content *c, const content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks)
const uint8_t * content__get_source_data(struct content *c, size_t *size)
Retrieve source of content.
nserror content__clone(const struct content *c, struct content *nc)
Clone a content's data members.
void content_set_ready(struct content *c)
Put a content in status CONTENT_STATUS_READY and unlock the content.
void content_set_status(struct content *c, const char *status_message)
Updates content with new status.
void content_broadcast_error(struct content *c, nserror errorcode, const char *msg)
Send an error message to all users.
Protected interface to Content handling.
@ CONTENT_STATUS_READY
Some parts of content still being loaded, but can be displayed.
@ CONTENT_STATUS_DONE
Content has completed all processing.
content_type
The type of a content.
@ CONTENT_IMAGE
All images.
Internal core bitmap interface.
static void bitmap_format_to_client(void *bitmap, const bitmap_fmt_t *current_fmt)
Convert a bitmap to the client bitmap format.
nserror
Enumeration of error codes.
@ NSERROR_BMP_ERROR
A BMP error occurred.
@ NSERROR_NOMEM
Memory exhaustion.
@ NSERROR_CLONE_FAILED
Failed to clone handle.
struct netsurf_table * guit
The global interface table.
Interface to core interface table.
Generic bitmap handling interface.
@ BITMAP_CLEAR
memory should be wiped to 0
@ BITMAP_OPAQUE
image is opaque
Public content interface.
Target independent plotting interface.
unsigned long bitmap_flags_t
static struct llcache_s * llcache
low level cache state
nsurl * llcache_handle_get_url(const llcache_handle *handle)
Retrieve the post-redirect URL of a low-level cache object.
Low-level resource cache (interface)
char * messages_get_buff(const char *key,...)
Formatted message from a key in the global message hash.
Localised message support (interface).
const char * nsurl_access_leaf(const nsurl *url)
Access a URL's path leaf as a string.
RISC OS wimp toolkit bitmap.
Content operation function table.
nserror(* create)(const struct content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, struct llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c)
parameters to content redraw
int height
vertical dimension
bool repeat_y
whether content is tiled in y direction
bool repeat_x
whether content is tiled in x direction
int y
coordinate for top-left of redraw
int x
coordinate for top-left of redraw
colour background_colour
The background colour.
int width
dimensions to render content at (for scaling contents with intrinsic dimensions)
Content which corresponds to a single URL.
int height
Height dimension, if applicable.
int width
Width dimension, if applicable.
struct llcache_handle * llcache
Low-level cache object.
struct textsearch_context * context
content_status status
Current status.
unsigned int size
Estimated size of all data associated with this content.
char * title
Title for browser window.
void(* destroy)(void *bitmap)
Destroy a bitmap.
void *(* create)(int width, int height, enum gui_bitmap_flags flags)
Create a new bitmap.
bool(* get_opaque)(void *bitmap)
Get the opacity of a bitmap.
void(* modified)(void *bitmap)
Marks a bitmap as modified.
unsigned char *(* get_buffer)(void *bitmap)
Get the image buffer from a bitmap.
Representation of an HTTP parameter.
Handle to low-level cache object.
struct gui_bitmap_table * bitmap
Bitmap table.
struct bitmap * bitmap
BMP image data.
nserror(* bitmap)(const struct redraw_context *ctx, struct bitmap *bitmap, int x, int y, int width, int height, colour bg, bitmap_flags_t flags)
Plot a bitmap.
const struct plotter_table * plot
Current plot operation table.
Interface to a number of general purpose functionality.
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.