NetSurf
icon.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 Chris Young <chris@unsatisfactorysoftware.co.uk>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * \file
21 * Content for image/x-amiga-icon (icon.library implementation).
22 *
23 */
24
25#include "utils/config.h"
26
27#include <assert.h>
28#include <string.h>
29#include <stdlib.h>
30#include <stdbool.h>
31
32#include <proto/exec.h>
33#include <proto/icon.h>
34
35#include <datatypes/pictureclass.h>
36#ifdef __amigaos4__
37#include <graphics/blitattr.h>
38#endif
39#include <workbench/icon.h>
40
41#include "utils/log.h"
42#include "utils/messages.h"
43#include "utils/utils.h"
44#include "utils/file.h"
45#include "netsurf/plotters.h"
46#include "netsurf/bitmap.h"
47#include "netsurf/content.h"
48#include "content/content.h"
52#include "utils/nsoption.h"
53
54#include "amiga/os3support.h"
55#include "amiga/bitmap.h"
56#include "amiga/icon.h"
57
58#define THUMBNAIL_WIDTH 100 /* Icon sizes for thumbnails, usually the same as */
59#define THUMBNAIL_HEIGHT 86 /* WIDTH/HEIGHT in desktop/thumbnail.c */
60
61static ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height,
62 ULONG trans, ULONG pals1, struct ColorRegister *pal1, int alpha);
63
64#ifdef WITH_AMIGA_ICON
65
66typedef struct amiga_icon_content {
67 struct content base;
68
69 struct bitmap *bitmap; /**< Created NetSurf bitmap */
70} amiga_icon_content;
71
72static nserror amiga_icon_create(const content_handler *handler,
73 lwc_string *imime_type, const struct http_parameter *params,
74 struct llcache_handle *llcache, const char *fallback_charset,
75 bool quirks, struct content **c);
76static bool amiga_icon_convert(struct content *c);
77static void amiga_icon_destroy(struct content *c);
78static bool amiga_icon_redraw(struct content *c,
79 struct content_redraw_data *data, const struct rect *clip,
80 const struct redraw_context *ctx);
81static nserror amiga_icon_clone(const struct content *old,
82 struct content **newc);
83static content_type amiga_icon_content_type(void);
84
85static void *amiga_icon_get_internal(const struct content *c, void *context)
86{
87 amiga_icon_content *icon_c = (amiga_icon_content *)c;
88
89 return icon_c->bitmap;
90}
91
92static bool amiga_icon_is_opaque(struct content *c)
93{
94 amiga_icon_content *icon_c = (amiga_icon_content *)c;
95
96 if (icon_c->bitmap != NULL) {
97 return guit->bitmap->get_opaque(icon_c->bitmap);
98 }
99
100 return false;
101}
102
103static const content_handler amiga_icon_content_handler = {
104 .create = amiga_icon_create,
105 .data_complete = amiga_icon_convert,
106 .destroy = amiga_icon_destroy,
107 .redraw = amiga_icon_redraw,
108 .clone = amiga_icon_clone,
109 .get_internal = amiga_icon_get_internal,
110 .type = amiga_icon_content_type,
111 .is_opaque = amiga_icon_is_opaque,
112 .no_share = false,
113};
114
115static const char *amiga_icon_types[] = {
116 "image/x-amiga-icon"
117};
118
119CONTENT_FACTORY_REGISTER_TYPES(amiga_icon, amiga_icon_types,
120 amiga_icon_content_handler)
121
122nserror amiga_icon_create(const content_handler *handler,
123 lwc_string *imime_type, const struct http_parameter *params,
124 struct llcache_handle *llcache, const char *fallback_charset,
125 bool quirks, struct content **c)
126{
127 amiga_icon_content *ai_content;
128 nserror error;
129
130 ai_content = calloc(1, sizeof(amiga_icon_content));
131 if (ai_content == NULL)
132 return NSERROR_NOMEM;
133
134 error = content__init(&ai_content->base, handler, imime_type, params,
135 llcache, fallback_charset, quirks);
136 if (error != NSERROR_OK) {
137 free(ai_content);
138 return error;
139 }
140
141 *c = (struct content *)ai_content;
142
143 return NSERROR_OK;
144}
145
146/**
147 * Convert a CONTENT_AMIGA_ICON for display.
148 *
149 * No conversion is necessary. We merely read the icon dimensions.
150 */
151
152bool amiga_icon_convert(struct content *c)
153{
154 amiga_icon_content *icon_c = (amiga_icon_content *)c;
155 union content_msg_data msg_data;
156 struct DiskObject *dobj;
157 ULONG *imagebuf;
158 unsigned char *imagebufptr = NULL;
159 ULONG size;
160 int width = 0, height = 0;
161 long format = 0;
162 uint8 r, g, b, a;
163 ULONG offset;
164 char *filename = NULL;
165 char *p;
166 ULONG trans, pals1;
167 struct ColorRegister *pal1;
168
170 /* This loader will only work on local files, so fail if not a local path */
171 if(filename == NULL)
172 {
173 msg_data.errordata.errorcode = NSERROR_NOMEM;
174 msg_data.errordata.errormsg = messages_get("NoMemory");
176 return false;
177 }
178
179 p = strstr(filename, ".info");
180 *p = '\0';
181
182 dobj = GetIconTagList(filename, NULL);
183
184 if(dobj == NULL)
185 {
186 msg_data.errordata.errorcode = NSERROR_NOMEM;
187 msg_data.errordata.errormsg = messages_get("NoMemory");
189 return false;
190 }
191
192 IconControl(dobj,
194 ICONCTRLA_GetWidth,&width,
195 ICONCTRLA_GetHeight,&height,
196 TAG_DONE);
197
198 /* Check icon is direct mapped (truecolour) or palette-mapped colour.
199 We need additional code to handle planar icons */
200 if((format != IDFMT_DIRECTMAPPED) && (format==IDFMT_PALETTEMAPPED)) {
201 if(dobj) FreeDiskObject(dobj);
202 return false;
203 }
204
205 icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NONE);
206 if (!icon_c->bitmap) {
207 msg_data.errordata.errorcode = NSERROR_NOMEM;
208 msg_data.errordata.errormsg = messages_get("NoMemory");
210 if(dobj) FreeDiskObject(dobj);
211 return false;
212 }
213 imagebuf = (ULONG *) amiga_bitmap_get_buffer(icon_c->bitmap);
214 if (!imagebuf) {
215 msg_data.errordata.errorcode = NSERROR_NOMEM;
216 msg_data.errordata.errormsg = messages_get("NoMemory");
218 if(dobj) FreeDiskObject(dobj);
219 return false;
220 }
221
222 IconControl(dobj,
223 ICONCTRLA_GetImageData1, &imagebufptr,
224 TAG_DONE);
225
226 if(format==IDFMT_PALETTEMAPPED)
227 {
228 IconControl(dobj, ICONCTRLA_GetTransparentColor1, &trans,
229 ICONCTRLA_GetPalette1, &pal1,
230 ICONCTRLA_GetPaletteSize1, &pals1,
231 TAG_DONE);
232
233 imagebufptr = (unsigned char *) amiga_icon_convertcolouricon32((UBYTE *)imagebufptr,
234 width, height, trans, pals1, pal1, 0xff);
235 }
236
237 /* Decoded data is ARGB, so ensure correct byte order */
238
239 size = width * height * 4;
240
241 for (offset = 0; offset < size; offset += 4) {
242 b = imagebufptr[offset+3];
243 g = imagebufptr[offset+2];
244 r = imagebufptr[offset+1];
245 a = imagebufptr[offset];
246
247 *imagebuf = r << 24 | g << 16 | b << 8 | a;
248 imagebuf++;
249 }
250
251 c->width = width;
252 c->height = height;
253
254 amiga_bitmap_modified(icon_c->bitmap);
257 content_set_status(c, "");
258
259 if(dobj) FreeDiskObject(dobj);
260
261 if(format==IDFMT_PALETTEMAPPED)
262 free(imagebufptr);
263
264 return true;
265}
266
267
268/**
269 * Destroy a CONTENT_AMIGA_ICON and free all resources it owns.
270 */
271
272void amiga_icon_destroy(struct content *c)
273{
274 amiga_icon_content *icon_c = (amiga_icon_content *)c;
275
276 if (icon_c->bitmap != NULL)
277 amiga_bitmap_destroy(icon_c->bitmap);
278}
279
280
281/**
282 * Redraw a CONTENT_AMIGA_ICON.
283 */
284
285bool amiga_icon_redraw(struct content *c,
286 struct content_redraw_data *data, const struct rect *clip,
287 const struct redraw_context *ctx)
288{
289 amiga_icon_content *icon_c = (amiga_icon_content *)c;
291
292 if (data->repeat_x)
293 flags |= BITMAPF_REPEAT_X;
294 if (data->repeat_y)
295 flags |= BITMAPF_REPEAT_Y;
296
297 return (ctx->plot->bitmap(ctx,
298 icon_c->bitmap,
299 data->x,
300 data->y,
301 data->width,
302 data->height,
303 data->background_colour,
304 flags) == NSERROR_OK);
305}
306
307
308nserror amiga_icon_clone(const struct content *old, struct content **newc)
309{
310 amiga_icon_content *ai;
311 nserror error;
312
313 ai = calloc(1, sizeof(amiga_icon_content));
314 if (ai == NULL)
315 return NSERROR_NOMEM;
316
317 error = content__clone(old, &ai->base);
318 if (error != NSERROR_OK) {
319 content_destroy(&ai->base);
320 return error;
321 }
322
323 /* Simply replay convert */
324 if (old->status == CONTENT_STATUS_READY ||
325 old->status == CONTENT_STATUS_DONE) {
326 if (amiga_icon_convert(&ai->base) == false) {
327 content_destroy(&ai->base);
329 }
330 }
331
332 *newc = (struct content *) ai;
333
334 return NSERROR_OK;
335}
336
337content_type amiga_icon_content_type(void)
338{
339 return CONTENT_IMAGE;
340}
341
342#endif /* WITH_AMIGA_ICON */
343
344static ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height,
345 ULONG trans, ULONG pals1, struct ColorRegister *pal1, int alpha)
346{
347 ULONG *argbicon;
348 struct ColorRegister *colour;
349 struct ColorMap *cmap;
350 ULONG i;
351 ULONG a,r,g,b;
352
353 if (alpha==0) alpha=0xff;
354
355 argbicon = (ULONG *)malloc(width * height * 4);
356 if (!argbicon) return(NULL);
357
358 cmap=GetColorMap(pals1);
359 if(!cmap) {
360 free(argbicon);
361 return(NULL);
362 }
363
364 for(i=0;i<(width*height);i++)
365 {
366 colour = &pal1[icondata[i]];
367
368 if(icondata[i] == trans)
369 {
370 a=0x00;
371 }
372 else
373 {
374 a=alpha;
375 }
376
377 r = colour->red;
378 g = colour->green;
379 b = colour->blue;
380
381 argbicon[i] = (a << 24) +
382 (r << 16) +
383 (g << 8) +
384 (b);
385 }
386
387 return(argbicon);
388
389}
390
391void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct DiskObject *dobj)
392{
393 struct BitMap *bm = NULL;
394 ULONG *icondata1, *icondata2;
395 ULONG width, height;
396 long format = 0;
397
398 if(dobj == NULL) return;
399
400 IconControl(dobj,
402 ICONCTRLA_GetImageData1,&icondata1,
403 ICONCTRLA_GetImageData2,&icondata2,
404 ICONCTRLA_GetWidth,&width,
405 ICONCTRLA_GetHeight,&height,
406 TAG_DONE);
407
408 if(format != IDFMT_DIRECTMAPPED) return;
409#ifdef __amigaos4__
410 if ((icon != NULL) && (content_get_bitmap(icon) != NULL)) {
411 bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16, false, NULL, nsoption_colour(sys_colour_ButtonFace));
412 }
413
414 if(bm) {
415 BltBitMapTags(BLITA_SrcX, 0,
416 BLITA_SrcY, 0,
417 BLITA_DestX, width - 16,
418 BLITA_DestY, height - 16,
419 BLITA_Width, 16,
420 BLITA_Height, 16,
421 BLITA_Source, bm,
422 BLITA_Dest, icondata1,
423 BLITA_SrcType, BLITT_BITMAP,
424 BLITA_DestType, BLITT_ARGB32,
425 BLITA_DestBytesPerRow, width * 4,
426 BLITA_UseSrcAlpha, TRUE,
427 TAG_DONE);
428
429 BltBitMapTags(BLITA_SrcX, 0,
430 BLITA_SrcY, 0,
431 BLITA_DestX, width - 16,
432 BLITA_DestY, height - 16,
433 BLITA_Width, 16,
434 BLITA_Height, 16,
435 BLITA_Source, bm,
436 BLITA_Dest, icondata2,
437 BLITA_SrcType, BLITT_BITMAP,
438 BLITA_DestType, BLITT_ARGB32,
439 BLITA_DestBytesPerRow, width * 4,
440 BLITA_UseSrcAlpha, TRUE,
441 TAG_DONE);
442 }
443#endif
444}
445
447{
448 struct DiskObject *dobj = NULL;
449 ULONG *icondata1, *icondata2;
450 ULONG width, height;
451 long format = 0;
452 ULONG trans1, pals1;
453 ULONG trans2, pals2;
454 struct ColorRegister *pal1;
455 struct ColorRegister *pal2;
456
457 if(icon == NULL) return;
458
459 if(!type)
460 {
461 dobj = GetIconTags(NULL,
462 ICONGETA_GetDefaultType, WBDRAWER,
463 TAG_DONE);
464 }
465 else
466 {
467 dobj = GetIconTags(NULL, ICONGETA_GetDefaultName, type,
468 ICONGETA_GetDefaultType, WBPROJECT,
469 TAG_DONE);
470 }
471
472 if(dobj == NULL) return;
473
474 IconControl(dobj,
476 ICONCTRLA_GetImageData1,&icondata1,
477 ICONCTRLA_GetImageData2,&icondata2,
478 ICONCTRLA_GetWidth,&width,
479 ICONCTRLA_GetHeight,&height,
480 TAG_DONE);
481
482 /* If we have a palette-mapped icon, convert it to a 32-bit one */
483 if(format == IDFMT_PALETTEMAPPED)
484 {
485 IconControl(dobj, ICONCTRLA_GetTransparentColor1, &trans1,
486 ICONCTRLA_GetPalette1, &pal1,
487 ICONCTRLA_GetPaletteSize1, &pals1,
488 ICONCTRLA_GetTransparentColor2, &trans2,
489 ICONCTRLA_GetPalette2, &pal2,
490 ICONCTRLA_GetPaletteSize2, &pals2,
491 TAG_DONE);
492
493 icondata1 = amiga_icon_convertcolouricon32((UBYTE *)icondata1,
494 width, height, trans1, pals1, pal1, 0xff);
495
496 icondata2 = amiga_icon_convertcolouricon32((UBYTE *)icondata2,
497 width, height, trans2, pals2, pal2, 0xff);
498
499 IconControl(dobj,
501 ICONCTRLA_SetImageData1, icondata1,
502 ICONCTRLA_SetImageData2, icondata2,
503 TAG_DONE);
504 }
505
506 if((format == IDFMT_DIRECTMAPPED) || (format == IDFMT_PALETTEMAPPED))
508
509 PutIconTags(path, dobj,
510 ICONPUTA_NotifyWorkbench, TRUE, TAG_DONE);
511
512 FreeDiskObject(dobj);
513
514 if(format == IDFMT_PALETTEMAPPED)
515 {
516 /* Free the 32-bit data we created */
517 free(icondata1);
518 free(icondata2);
519 }
520}
521
522struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm)
523{
524 struct DiskObject *dobj;
525 struct BitMap *bitmap;
526 ULONG *icondata;
527
528#ifdef __amigaos4__
529 if(bm)
530 {
532 THUMBNAIL_HEIGHT, false, NULL,
533 nsoption_colour(sys_colour_ButtonFace));
534 icondata = malloc(THUMBNAIL_WIDTH * 4 * THUMBNAIL_HEIGHT);
535 ami_bitmap_set_icondata(bm, icondata);
536
537 if(bitmap) {
538 BltBitMapTags(BLITA_Width, THUMBNAIL_WIDTH,
539 BLITA_Height, THUMBNAIL_HEIGHT,
540 BLITA_SrcType, BLITT_BITMAP,
541 BLITA_Source, bitmap,
542 BLITA_DestType, BLITT_ARGB32,
543 BLITA_DestBytesPerRow, THUMBNAIL_WIDTH * 4,
544 BLITA_Dest, icondata,
545 TAG_DONE);
546 }
547 }
548#endif
549 dobj = GetIconTags(NULL, ICONGETA_GetDefaultType, WBPROJECT,
550 ICONGETA_GetDefaultName, "iconify",
551 TAG_DONE);
552#ifdef __amigaos4__
553 if(bm)
554 {
555 IconControl(dobj,
557 ICONCTRLA_SetWidth, THUMBNAIL_WIDTH,
558 ICONCTRLA_SetHeight, THUMBNAIL_HEIGHT,
559 ICONCTRLA_SetImageData1, icondata,
560 ICONCTRLA_SetImageData2, NULL,
561 TAG_DONE);
562 }
563#endif
564 dobj->do_Gadget.UserData = bm;
565
566 LayoutIconA(dobj, (struct Screen *)~0UL, NULL);
567
568 return dobj;
569}
570
571void amiga_icon_free(struct DiskObject *dobj)
572{
573 struct bitmap *bm = dobj->do_Gadget.UserData;
574
575 FreeDiskObject(dobj);
576 if(bm) ami_bitmap_free_icondata(bm);
577}
578
Content handling interface.
void content_destroy(struct content *c)
Destroy and free a content.
Definition: content.c:354
void content_broadcast(struct content *c, content_msg msg, const union content_msg_data *data)
Send a message to all users.
Definition: content.c:752
void content_set_done(struct content *c)
Put a content in status CONTENT_STATUS_DONE.
Definition: content.c:299
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)
Definition: content.c:190
nsurl * content_get_url(struct content *c)
Retrieve URL associated with content.
Definition: content.c:1043
nserror content__clone(const struct content *c, struct content *nc)
Clone a content's data members.
Definition: content.c:1374
void content_set_ready(struct content *c)
Put a content in status CONTENT_STATUS_READY and unlock the content.
Definition: content.c:285
void content_set_status(struct content *c, const char *status_message)
Updates content with new status.
Definition: content.c:270
#define CONTENT_FACTORY_REGISTER_TYPES(HNAME, HTYPELIST, HHANDLER)
Protected interface to Content handling.
@ CONTENT_STATUS_READY
Some parts of content still being loaded, but can be displayed.
Definition: content_type.h:92
@ CONTENT_STATUS_DONE
Content has completed all processing.
Definition: content_type.h:95
content_type
The type of a content.
Definition: content_type.h:53
@ CONTENT_IMAGE
All images.
Definition: content_type.h:67
@ CONTENT_MSG_ERROR
error occurred
Definition: content_type.h:122
nserror
Enumeration of error codes.
Definition: errors.h:29
@ NSERROR_NOMEM
Memory exhaustion.
Definition: errors.h:32
@ NSERROR_CLONE_FAILED
Failed to clone handle.
Definition: errors.h:37
@ NSERROR_OK
No error.
Definition: errors.h:30
const char * type
Definition: filetype.cpp:44
void * amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags)
Create a bitmap.
Definition: bitmap.c:112
void ami_bitmap_free_icondata(struct bitmap *bm)
Free an icondata pointer.
Definition: bitmap.c:807
struct BitMap * ami_bitmap_get_native(struct bitmap *bitmap, int width, int height, bool palette_mapped, struct BitMap *friendbm, colour bg)
Definition: bitmap.c:736
void amiga_bitmap_modified(void *bitmap)
The bitmap image has changed, so flush any persistant cache.
Definition: bitmap.c:282
void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata)
Set an icondata pointer.
Definition: bitmap.c:802
unsigned char * amiga_bitmap_get_buffer(void *bitmap)
Return a pointer to the pixel data in a bitmap.
Definition: bitmap.c:175
void amiga_bitmap_destroy(void *bitmap)
Free a bitmap.
Definition: bitmap.c:214
struct netsurf_table * guit
The global interface table.
Definition: gui_factory.c:50
Interface to core interface table.
#define THUMBNAIL_HEIGHT
Definition: icon.c:59
struct DiskObject * amiga_icon_from_bitmap(struct bitmap *bm)
Definition: icon.c:522
void amiga_icon_free(struct DiskObject *dobj)
Definition: icon.c:571
static ULONG * amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height, ULONG trans, ULONG pals1, struct ColorRegister *pal1, int alpha)
Definition: icon.c:344
void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type)
Definition: icon.c:446
#define THUMBNAIL_WIDTH
Definition: icon.c:58
void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct DiskObject *dobj)
Definition: icon.c:391
Content for image/x-amiga-icon (icon.library interface).
Generic bitmap handling interface.
@ BITMAP_NONE
Definition: bitmap.h:37
Public content interface.
struct bitmap * content_get_bitmap(struct hlcache_handle *h)
Retrieve the bitmap contained in an image content.
Definition: content.c:1256
Target independent plotting interface.
#define BITMAPF_REPEAT_X
Definition: plotters.h:38
#define BITMAPF_REPEAT_Y
Definition: plotters.h:39
unsigned long bitmap_flags_t
Definition: plotters.h:36
#define BITMAPF_NONE
Definition: plotters.h:37
static struct llcache_s * llcache
low level cache state
Definition: llcache.c:267
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Definition: messages.c:256
Localised message support (interface).
Minimal compatibility header for AmigaOS 3.
#define ICONCTRLA_GetImageDataFormat
Definition: os3support.h:218
#define ICONCTRLA_SetImageDataFormat
Definition: os3support.h:217
uint8_t uint8
Definition: os3support.h:180
#define IDFMT_PALETTEMAPPED
Definition: os3support.h:221
#define BLITA_UseSrcAlpha
Definition: os3support.h:67
#define IDFMT_DIRECTMAPPED
Definition: os3support.h:222
@ base
Definition: punycode.c:19
int width
Definition: gui.c:161
int height
Definition: gui.c:162
Interface to utility string handling.
RISC OS wimp toolkit bitmap.
Definition: bitmap.c:68
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
Definition: content.h:40
int height
vertical dimension
Definition: content.h:48
bool repeat_y
whether content is tiled in y direction
Definition: content.h:59
bool repeat_x
whether content is tiled in x direction
Definition: content.h:58
int y
coordinate for top-left of redraw
Definition: content.h:42
int x
coordinate for top-left of redraw
Definition: content.h:41
colour background_colour
The background colour.
Definition: content.h:51
int width
dimensions to render content at (for scaling contents with intrinsic dimensions)
Definition: content.h:47
Content which corresponds to a single URL.
int height
Height dimension, if applicable.
int width
Width dimension, if applicable.
content_status status
Current status.
bool(* get_opaque)(void *bitmap)
Get the opacity of a bitmap.
Definition: bitmap.h:159
High-level cache handle.
Definition: hlcache.c:66
Representation of an HTTP parameter.
Definition: parameter.c:31
Handle to low-level cache object.
Definition: llcache.c:76
struct gui_bitmap_table * bitmap
Bitmap table.
Definition: gui_table.h:153
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.
Definition: plotters.h:269
Rectangle coordinates.
Definition: types.h:40
Redraw context.
Definition: plotters.h:51
const struct plotter_table * plot
Current plot operation table.
Definition: plotters.h:73
uint32_t colour
Colour type: XBGR.
Definition: types.h:35
Extra data for some content_msg messages.
Definition: content.h:60
nserror netsurf_nsurl_to_path(struct nsurl *url, char **path_out)
Create a path from a nsurl.
Definition: file.c:301
Default operations table for files.
Option reading and saving interface.
#define nsoption_colour(OPTION)
Get the value of a netsurf colour option.
Definition: nsoption.h:344
Interface to a number of general purpose functionality.
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.
Definition: plot.c:821
static 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.
Definition: plot.c:857
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
Definition: plot.c:357