45 struct ico_collection *
ico;
62 bitmap_state |= (bmp_state & BMP_CLEAR_MEMORY) ?
71 bmp_bitmap_callback_vt bmp_bitmap_callbacks = {
77 c->
ico = calloc(1,
sizeof(ico_collection));
82 ico_collection_create(c->
ico, &bmp_bitmap_callbacks);
90 bool quirks,
struct content **c)
100 llcache, fallback_charset, quirks);
122 struct bmp_image *bmp;
132 res = ico_analyse(ico->
ico, size, (
unsigned char *) data);
137 case BMP_INSUFFICIENT_MEMORY:
140 case BMP_INSUFFICIENT_DATA:
149 c->
size += (ico->
ico->width * ico->
ico->height * 4) + 16 + 44;
161 bmp = ico_find(ico->
ico, 255, 255);
164 NSLOG(netsurf, INFO,
"Failed to select icon");
178 if (ico->decoded ==
false) {
179 NSLOG(netsurf, DEBUG,
"Decoding ICO %p", ico);
180 if (bmp_decode(ico) != BMP_OK) {
185 .layout = BITMAP_LAYOUT_R8G8B8A8,
198 struct bmp_image *bmp;
204 NSLOG(netsurf, INFO,
"Failed to select icon");
221 ico_finalise(ico->
ico);
255 *newc = (
struct content *) ico;
265 struct bmp_image *bmp;
267 bmp = ico_find(ico->
ico, 16, 16);
270 NSLOG(netsurf, INFO,
"Failed to select icon");
289 struct bmp_image *bmp;
295 bmp = ico_find(ico->
ico, 16, 16);
298 NSLOG(netsurf, INFO,
"Failed to select icon");
325 "image/vnd.microsoft.icon",
bool image_bitmap_plot(struct bitmap *bitmap, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
Common image content handler bitmap plot call.
Initialisation/finalisation of image handlers.
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_ICO_ERROR
A ICO 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.
struct nsico_content nsico_content
static nserror nsico_create(const 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 bool nsico_redraw(struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
CONTENT_FACTORY_REGISTER_TYPES(nsico, nsico_types, nsico_content_handler)
static content_type nsico_content_type(void)
static bool nsico__decode(struct bmp_image *ico)
static bool nsico_is_opaque(struct content *c)
static const char * nsico_types[]
static void nsico_destroy(struct content *c)
static const content_handler nsico_content_handler
static nserror nsico_create_ico_data(nsico_content *c)
static nserror nsico_clone(const struct content *old, struct content **newc)
static void * nsico_get_internal(const struct content *c, void *context)
static void * nsico_bitmap_create(int width, int height, unsigned int bmp_state)
Callback for libnsbmp; forwards the call to bitmap_create()
static bool nsico_convert(struct content *c)
Content for image/ico (interface).
Generic bitmap handling interface.
@ BITMAP_CLEAR
memory should be wiped to 0
@ BITMAP_OPAQUE
image is opaque
Public content interface.
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)
#define NSLOG(catname, level, logmsg, args...)
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.
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
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.
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 ico_collection * ico
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.