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
53#include "amiga/os3support.h"
54#include "amiga/bitmap.h"
55#include "amiga/icon.h"
56
57#define THUMBNAIL_WIDTH 100 /* Icon sizes for thumbnails, usually the same as */
58#define THUMBNAIL_HEIGHT 86 /* WIDTH/HEIGHT in desktop/thumbnail.c */
59
60static ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height,
61 ULONG trans, ULONG pals1, struct ColorRegister *pal1, int alpha);
62
63#ifdef WITH_AMIGA_ICON
64
65typedef struct amiga_icon_content {
66 struct content base;
67
68 struct bitmap *bitmap; /**< Created NetSurf bitmap */
69} amiga_icon_content;
70
71static nserror amiga_icon_create(const content_handler *handler,
72 lwc_string *imime_type, const struct http_parameter *params,
73 struct llcache_handle *llcache, const char *fallback_charset,
74 bool quirks, struct content **c);
75static bool amiga_icon_convert(struct content *c);
76static void amiga_icon_destroy(struct content *c);
77static bool amiga_icon_redraw(struct content *c,
78 struct content_redraw_data *data, const struct rect *clip,
79 const struct redraw_context *ctx);
80static nserror amiga_icon_clone(const struct content *old,
81 struct content **newc);
82static content_type amiga_icon_content_type(void);
83
84static void *amiga_icon_get_internal(const struct content *c, void *context)
85{
86 amiga_icon_content *icon_c = (amiga_icon_content *)c;
87
88 return icon_c->bitmap;
89}
90
91static bool amiga_icon_is_opaque(struct content *c)
92{
93 amiga_icon_content *icon_c = (amiga_icon_content *)c;
94
95 if (icon_c->bitmap != NULL) {
96 return guit->bitmap->get_opaque(icon_c->bitmap);
97 }
98
99 return false;
100}
101
102static const content_handler amiga_icon_content_handler = {
103 .create = amiga_icon_create,
104 .data_complete = amiga_icon_convert,
105 .destroy = amiga_icon_destroy,
106 .redraw = amiga_icon_redraw,
107 .clone = amiga_icon_clone,
108 .get_internal = amiga_icon_get_internal,
109 .type = amiga_icon_content_type,
110 .is_opaque = amiga_icon_is_opaque,
111 .no_share = false,
112};
113
114static const char *amiga_icon_types[] = {
115 "image/x-amiga-icon"
116};
117
118CONTENT_FACTORY_REGISTER_TYPES(amiga_icon, amiga_icon_types,
119 amiga_icon_content_handler)
120
121nserror amiga_icon_create(const content_handler *handler,
122 lwc_string *imime_type, const struct http_parameter *params,
123 struct llcache_handle *llcache, const char *fallback_charset,
124 bool quirks, struct content **c)
125{
126 amiga_icon_content *ai_content;
127 nserror error;
128
129 ai_content = calloc(1, sizeof(amiga_icon_content));
130 if (ai_content == NULL)
131 return NSERROR_NOMEM;
132
133 error = content__init(&ai_content->base, handler, imime_type, params,
134 llcache, fallback_charset, quirks);
135 if (error != NSERROR_OK) {
136 free(ai_content);
137 return error;
138 }
139
140 *c = (struct content *)ai_content;
141
142 return NSERROR_OK;
143}
144
145/**
146 * Convert a CONTENT_AMIGA_ICON for display.
147 *
148 * No conversion is necessary. We merely read the icon dimensions.
149 */
150
151bool amiga_icon_convert(struct content *c)
152{
153 amiga_icon_content *icon_c = (amiga_icon_content *)c;
154 union content_msg_data msg_data;
155 struct DiskObject *dobj;
156 ULONG *imagebuf;
157 unsigned char *imagebufptr = NULL;
158 ULONG size;
159 int width = 0, height = 0;
160 long format = 0;
161 uint8 r, g, b, a;
162 ULONG offset;
163 char *filename = NULL;
164 char *p;
165 ULONG trans, pals1;
166 struct ColorRegister *pal1;
167
169 /* This loader will only work on local files, so fail if not a local path */
170 if(filename == NULL)
171 {
172 msg_data.errordata.errorcode = NSERROR_NOMEM;
173 msg_data.errordata.errormsg = messages_get("NoMemory");
175 return false;
176 }
177
178 p = strstr(filename, ".info");
179 *p = '\0';
180
181 dobj = GetIconTagList(filename, NULL);
182
183 if(dobj == NULL)
184 {
185 msg_data.errordata.errorcode = NSERROR_NOMEM;
186 msg_data.errordata.errormsg = messages_get("NoMemory");
188 return false;
189 }
190
191 IconControl(dobj,
193 ICONCTRLA_GetWidth,&width,
194 ICONCTRLA_GetHeight,&height,
195 TAG_DONE);
196
197 /* Check icon is direct mapped (truecolour) or palette-mapped colour.
198 We need additional code to handle planar icons */
199 if((format != IDFMT_DIRECTMAPPED) && (format==IDFMT_PALETTEMAPPED)) {
200 if(dobj) FreeDiskObject(dobj);
201 return false;
202 }
203
204 icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NONE);
205 if (!icon_c->bitmap) {
206 msg_data.errordata.errorcode = NSERROR_NOMEM;
207 msg_data.errordata.errormsg = messages_get("NoMemory");
209 if(dobj) FreeDiskObject(dobj);
210 return false;
211 }
212 imagebuf = (ULONG *) amiga_bitmap_get_buffer(icon_c->bitmap);
213 if (!imagebuf) {
214 msg_data.errordata.errorcode = NSERROR_NOMEM;
215 msg_data.errordata.errormsg = messages_get("NoMemory");
217 if(dobj) FreeDiskObject(dobj);
218 return false;
219 }
220
221 IconControl(dobj,
222 ICONCTRLA_GetImageData1, &imagebufptr,
223 TAG_DONE);
224
225 if(format==IDFMT_PALETTEMAPPED)
226 {
227 IconControl(dobj, ICONCTRLA_GetTransparentColor1, &trans,
228 ICONCTRLA_GetPalette1, &pal1,
229 ICONCTRLA_GetPaletteSize1, &pals1,
230 TAG_DONE);
231
232 imagebufptr = (unsigned char *) amiga_icon_convertcolouricon32((UBYTE *)imagebufptr,
233 width, height, trans, pals1, pal1, 0xff);
234 }
235
236 /* Decoded data is ARGB, so ensure correct byte order */
237
238 size = width * height * 4;
239
240 for (offset = 0; offset < size; offset += 4) {
241 b = imagebufptr[offset+3];
242 g = imagebufptr[offset+2];
243 r = imagebufptr[offset+1];
244 a = imagebufptr[offset];
245
246 *imagebuf = r << 24 | g << 16 | b << 8 | a;
247 imagebuf++;
248 }
249
250 c->width = width;
251 c->height = height;
252
253 amiga_bitmap_modified(icon_c->bitmap);
256 content_set_status(c, "");
257
258 if(dobj) FreeDiskObject(dobj);
259
260 if(format==IDFMT_PALETTEMAPPED)
261 free(imagebufptr);
262
263 return true;
264}
265
266
267/**
268 * Destroy a CONTENT_AMIGA_ICON and free all resources it owns.
269 */
270
271void amiga_icon_destroy(struct content *c)
272{
273 amiga_icon_content *icon_c = (amiga_icon_content *)c;
274
275 if (icon_c->bitmap != NULL)
276 amiga_bitmap_destroy(icon_c->bitmap);
277}
278
279
280/**
281 * Redraw a CONTENT_AMIGA_ICON.
282 */
283
284bool amiga_icon_redraw(struct content *c,
285 struct content_redraw_data *data, const struct rect *clip,
286 const struct redraw_context *ctx)
287{
288 amiga_icon_content *icon_c = (amiga_icon_content *)c;
290
291 if (data->repeat_x)
292 flags |= BITMAPF_REPEAT_X;
293 if (data->repeat_y)
294 flags |= BITMAPF_REPEAT_Y;
295
296 return (ctx->plot->bitmap(ctx,
297 icon_c->bitmap,
298 data->x,
299 data->y,
300 data->width,
301 data->height,
302 data->background_colour,
303 flags) == NSERROR_OK);
304}
305
306
307nserror amiga_icon_clone(const struct content *old, struct content **newc)
308{
309 amiga_icon_content *ai;
310 nserror error;
311
312 ai = calloc(1, sizeof(amiga_icon_content));
313 if (ai == NULL)
314 return NSERROR_NOMEM;
315
316 error = content__clone(old, &ai->base);
317 if (error != NSERROR_OK) {
318 content_destroy(&ai->base);
319 return error;
320 }
321
322 /* Simply replay convert */
323 if (old->status == CONTENT_STATUS_READY ||
324 old->status == CONTENT_STATUS_DONE) {
325 if (amiga_icon_convert(&ai->base) == false) {
326 content_destroy(&ai->base);
328 }
329 }
330
331 *newc = (struct content *) ai;
332
333 return NSERROR_OK;
334}
335
336content_type amiga_icon_content_type(void)
337{
338 return CONTENT_IMAGE;
339}
340
341#endif /* WITH_AMIGA_ICON */
342
343static ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height,
344 ULONG trans, ULONG pals1, struct ColorRegister *pal1, int alpha)
345{
346 ULONG *argbicon;
347 struct ColorRegister *colour;
348 struct ColorMap *cmap;
349 ULONG i;
350 ULONG a,r,g,b;
351
352 if (alpha==0) alpha=0xff;
353
354 argbicon = (ULONG *)malloc(width * height * 4);
355 if (!argbicon) return(NULL);
356
357 cmap=GetColorMap(pals1);
358 if(!cmap) {
359 free(argbicon);
360 return(NULL);
361 }
362
363 for(i=0;i<(width*height);i++)
364 {
365 colour = &pal1[icondata[i]];
366
367 if(icondata[i] == trans)
368 {
369 a=0x00;
370 }
371 else
372 {
373 a=alpha;
374 }
375
376 r = colour->red;
377 g = colour->green;
378 b = colour->blue;
379
380 argbicon[i] = (a << 24) +
381 (r << 16) +
382 (g << 8) +
383 (b);
384 }
385
386 return(argbicon);
387
388}
389
390void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct DiskObject *dobj)
391{
392 struct BitMap *bm = NULL;
393 ULONG *icondata1, *icondata2;
394 ULONG width, height;
395 long format = 0;
396
397 if(dobj == NULL) return;
398
399 IconControl(dobj,
401 ICONCTRLA_GetImageData1,&icondata1,
402 ICONCTRLA_GetImageData2,&icondata2,
403 ICONCTRLA_GetWidth,&width,
404 ICONCTRLA_GetHeight,&height,
405 TAG_DONE);
406
407 if(format != IDFMT_DIRECTMAPPED) return;
408#ifdef __amigaos4__
409 if ((icon != NULL) && (content_get_bitmap(icon) != NULL)) {
410 bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16, false, NULL);
411 }
412
413 if(bm) {
414 BltBitMapTags(BLITA_SrcX, 0,
415 BLITA_SrcY, 0,
416 BLITA_DestX, width - 16,
417 BLITA_DestY, height - 16,
418 BLITA_Width, 16,
419 BLITA_Height, 16,
420 BLITA_Source, bm,
421 BLITA_Dest, icondata1,
422 BLITA_SrcType, BLITT_BITMAP,
423 BLITA_DestType, BLITT_ARGB32,
424 BLITA_DestBytesPerRow, width * 4,
425 BLITA_UseSrcAlpha, TRUE,
426 TAG_DONE);
427
428 BltBitMapTags(BLITA_SrcX, 0,
429 BLITA_SrcY, 0,
430 BLITA_DestX, width - 16,
431 BLITA_DestY, height - 16,
432 BLITA_Width, 16,
433 BLITA_Height, 16,
434 BLITA_Source, bm,
435 BLITA_Dest, icondata2,
436 BLITA_SrcType, BLITT_BITMAP,
437 BLITA_DestType, BLITT_ARGB32,
438 BLITA_DestBytesPerRow, width * 4,
439 BLITA_UseSrcAlpha, TRUE,
440 TAG_DONE);
441 }
442#endif
443}
444
446{
447 struct DiskObject *dobj = NULL;
448 ULONG *icondata1, *icondata2;
449 ULONG width, height;
450 long format = 0;
451 ULONG trans1, pals1;
452 ULONG trans2, pals2;
453 struct ColorRegister *pal1;
454 struct ColorRegister *pal2;
455
456 if(icon == NULL) return;
457
458 if(!type)
459 {
460 dobj = GetIconTags(NULL,
461 ICONGETA_GetDefaultType, WBDRAWER,
462 TAG_DONE);
463 }
464 else
465 {
466 dobj = GetIconTags(NULL, ICONGETA_GetDefaultName, type,
467 ICONGETA_GetDefaultType, WBPROJECT,
468 TAG_DONE);
469 }
470
471 if(dobj == NULL) return;
472
473 IconControl(dobj,
475 ICONCTRLA_GetImageData1,&icondata1,
476 ICONCTRLA_GetImageData2,&icondata2,
477 ICONCTRLA_GetWidth,&width,
478 ICONCTRLA_GetHeight,&height,
479 TAG_DONE);
480
481 /* If we have a palette-mapped icon, convert it to a 32-bit one */
482 if(format == IDFMT_PALETTEMAPPED)
483 {
484 IconControl(dobj, ICONCTRLA_GetTransparentColor1, &trans1,
485 ICONCTRLA_GetPalette1, &pal1,
486 ICONCTRLA_GetPaletteSize1, &pals1,
487 ICONCTRLA_GetTransparentColor2, &trans2,
488 ICONCTRLA_GetPalette2, &pal2,
489 ICONCTRLA_GetPaletteSize2, &pals2,
490 TAG_DONE);
491
492 icondata1 = amiga_icon_convertcolouricon32((UBYTE *)icondata1,
493 width, height, trans1, pals1, pal1, 0xff);
494
495 icondata2 = amiga_icon_convertcolouricon32((UBYTE *)icondata2,
496 width, height, trans2, pals2, pal2, 0xff);
497
498 IconControl(dobj,
500 ICONCTRLA_SetImageData1, icondata1,
501 ICONCTRLA_SetImageData2, icondata2,
502 TAG_DONE);
503 }
504
505 if((format == IDFMT_DIRECTMAPPED) || (format == IDFMT_PALETTEMAPPED))
507
508 PutIconTags(path, dobj,
509 ICONPUTA_NotifyWorkbench, TRUE, TAG_DONE);
510
511 FreeDiskObject(dobj);
512
513 if(format == IDFMT_PALETTEMAPPED)
514 {
515 /* Free the 32-bit data we created */
516 free(icondata1);
517 free(icondata2);
518 }
519}
520
521struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm)
522{
523 struct DiskObject *dobj;
524 struct BitMap *bitmap;
525 ULONG *icondata;
526
527#ifdef __amigaos4__
528 if(bm)
529 {
531 THUMBNAIL_HEIGHT, false, NULL);
532 icondata = malloc(THUMBNAIL_WIDTH * 4 * THUMBNAIL_HEIGHT);
533 ami_bitmap_set_icondata(bm, icondata);
534
535 if(bitmap) {
536 BltBitMapTags(BLITA_Width, THUMBNAIL_WIDTH,
537 BLITA_Height, THUMBNAIL_HEIGHT,
538 BLITA_SrcType, BLITT_BITMAP,
539 BLITA_Source, bitmap,
540 BLITA_DestType, BLITT_ARGB32,
541 BLITA_DestBytesPerRow, THUMBNAIL_WIDTH * 4,
542 BLITA_Dest, icondata,
543 TAG_DONE);
544 }
545 }
546#endif
547 dobj = GetIconTags(NULL, ICONGETA_GetDefaultType, WBPROJECT,
548 ICONGETA_GetDefaultName, "iconify",
549 TAG_DONE);
550#ifdef __amigaos4__
551 if(bm)
552 {
553 IconControl(dobj,
555 ICONCTRLA_SetWidth, THUMBNAIL_WIDTH,
556 ICONCTRLA_SetHeight, THUMBNAIL_HEIGHT,
557 ICONCTRLA_SetImageData1, icondata,
558 ICONCTRLA_SetImageData2, NULL,
559 TAG_DONE);
560 }
561#endif
562 dobj->do_Gadget.UserData = bm;
563
564 LayoutIconA(dobj, (struct Screen *)~0UL, NULL);
565
566 return dobj;
567}
568
569void amiga_icon_free(struct DiskObject *dobj)
570{
571 struct bitmap *bm = dobj->do_Gadget.UserData;
572
573 FreeDiskObject(dobj);
574 if(bm) ami_bitmap_free_icondata(bm);
575}
576
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:1051
nserror content__clone(const struct content *c, struct content *nc)
Clone a content's data members.
Definition: content.c:1382
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:111
struct BitMap * ami_bitmap_get_native(struct bitmap *bitmap, int width, int height, bool palette_mapped, struct BitMap *friendbm)
Definition: bitmap.c:666
void ami_bitmap_free_icondata(struct bitmap *bm)
Free an icondata pointer.
Definition: bitmap.c:751
void amiga_bitmap_modified(void *bitmap)
The bitmap image has changed, so flush any persistant cache.
Definition: bitmap.c:280
void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata)
Set an icondata pointer.
Definition: bitmap.c:746
unsigned char * amiga_bitmap_get_buffer(void *bitmap)
Return a pointer to the pixel data in a bitmap.
Definition: bitmap.c:174
void amiga_bitmap_destroy(void *bitmap)
Free a bitmap.
Definition: bitmap.c:213
struct netsurf_table * guit
The global interface table.
Definition: gui_factory.c:49
Interface to core interface table.
#define THUMBNAIL_HEIGHT
Definition: icon.c:58
struct DiskObject * amiga_icon_from_bitmap(struct bitmap *bm)
Definition: icon.c:521
void amiga_icon_free(struct DiskObject *dobj)
Definition: icon.c:569
static ULONG * amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height, ULONG trans, ULONG pals1, struct ColorRegister *pal1, int alpha)
Definition: icon.c:343
void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type)
Definition: icon.c:445
#define THUMBNAIL_WIDTH
Definition: icon.c:57
void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct DiskObject *dobj)
Definition: icon.c:390
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:1264
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:241
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:159
int height
Definition: gui.c:160
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:144
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:257
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.
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