libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
lws-dlo.h
Go to the documentation of this file.
1/*
2 * lws abstract display
3 *
4 * Copyright (C) 2019 - 2022 Andy Green <andy@warmcat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
23 *
24 * lws display_list and display_list objects (dlo)
25 */
26
27#if !defined(__LWS_DLO_H__)
28#define __LWS_DLO_H__
29
30#include <stdint.h>
31
33struct lws_surface_info;
35struct lws_display_font;
36struct lws_dlo_text;
37struct lws_display;
38struct lws_dlo_text;
39struct lws_dlo;
40
41#define LWSDC_RGBA(_r, _g, _b, _a) (((uint32_t)(_r) & 0xff) | \
42 (((uint32_t)(_g) & 0xff) << 8) | \
43 (((uint32_t)(_b) & 0xff) << 16) | \
44 (((uint32_t)(_a) & 0xff) << 24))
45
46#define LWSDC_R(_c) ((_c) & 0xff)
47#define LWSDC_G(_c) ((_c >> 8) & 0xff)
48#define LWSDC_B(_c) ((_c >> 16) & 0xff)
49#define LWSDC_ALPHA(_c) ((_c >> 24) & 0xff)
50
51#define RGB_TO_Y(_r, _g, _b) ((((_r) * 299) + ((_g) * 587) + ((_b) * 114)) / 1000)
52/* stores Y in RGBY */
53#define PALETTE_RGBY(_r, _g, _b) LWSDC_RGBA(_r, _g, _b, (RGB_TO_Y(_r, _g, _b)))
54
55typedef struct {
59
60/*
61 * When using RGBA to describe native greyscale, R is Y and A is A, GB is ignored
62 */
63
64/* composed at start of larger, font-specific glyph struct */
65
66typedef struct lws_font_glyph {
68
73
74 int8_t x; /* x offset inside the glyph */
75
76 void *pin; /* font-private: what to unpin on free */
78
80typedef lws_font_glyph_t * (*lws_dlo_image_glyph_t)(
81 struct lws_dlo_text *text,
82 uint32_t unicode, char attach);
83typedef void (*lws_dlo_destroy_t)(struct lws_dlo *dlo);
84
85typedef struct lws_display_id {
87
88 char id[16];
89 lws_box_t box; /* taken from DLO after layout */
90
91 void *priv_user;
93
94 char exists;
95 char iframe; /* 1 = render html as if partial
96 * is the origin, otherwise
97 * render html with surface
98 * (0,0) as origin and rs->box
99 * is a viewport on to that */
101
102/*
103 * Common dlo object that joins the display list, composed into a subclass
104 * object like lws_dlo_rect_t etc
105 */
106
107typedef struct lws_dlo {
109
110 lws_dll2_t col_list; /* lws_dlo_t: column-mates */
111 lws_dll2_t row_list; /* lws_dlo_t: row-mates */
112
113 /* children are rendered "inside" the parent DLO box after allowing
114 * for parent padding */
116
117 /* only used for dlo rect representing whole table */
118
119 lws_dll2_owner_t table_cols; /* lhp_table_col_t */
120 lws_dll2_owner_t table_rows; /* lhp_table_row_t */
121
122 /* may point to dlo whose width or height decides our x or y:
123 * abut_y is the positioned ancestor a bottom-anchored absolute
124 * box waits on, box.y meanwhile holding the offset up from its
125 * bottom edge (layout) */
126
129
130 lws_dlo_destroy_t _destroy; /* dlo-type specific cb */
131 lws_dlo_renderer_t render; /* dlo-type specific cb */
132
134 lws_fx_t padding[4]; /* child origin */
135
136 lws_display_id_t *id; /* only valid until ids destroyed */
137
140
141 uint8_t budget; /* limit spinning */
142 int16_t base_up; /* baseline: distance up from the
143 * box bottom, 0 = bottom edge
144 * (layout) */
145
146 uint8_t flag_toplevel:1; /* don't scan up with me (different owner) */
147 uint8_t flag_block:1; /* block-level box (layout) */
148 uint8_t flag_row:1; /* table row box (layout) */
149 uint8_t flag_cell:1; /* table cell box (layout) */
150 uint8_t flag_abs:1; /* positioned box (layout) */
151 uint8_t flag_float:1; /* floated box (layout) */
152 uint8_t flag_zraise:1; /* positioned, z-index > 0 */
153 uint8_t flag_online:1; /* item of the line being ended (layout) */
154 uint8_t flag_bg_homed:1; /* css background image moved into
155 * its element's own dlo (layout) */
156 uint8_t flag_inline_bg:1; /* background rect of the text
157 * run that follows it (layout) */
158 uint8_t flag_flex_item:1; /* item of a row flex container
159 * (layout) */
160 uint8_t flag_fixed_h:1; /* has a css height: not
161 * stretched (layout) */
162 uint8_t flag_abs_stretch:1; /* waiting on abut_y
163 * to stretch between top and
164 * bottom, box.h meanwhile the
165 * bottom offset (layout) */
166 uint8_t flex_grow; /* flex-grow, for flag_flex_item */
167 uint8_t align_self; /* LCSP_PROPVAL_* or 0 = auto */
168
169 /* render-specific members ... */
171
172typedef struct lws_circle {
174
175 /* rasterization temps */
176 lws_fx_t orx; /* abs pixel x for centre */
177 lws_fx_t ory; /* abs pixel y for centre */
181
182typedef struct lws_dlo_rect {
184 lws_circle_t c[4]; /* t-l, t-r, b-l, b-r */
185 lws_fx_t b[4]; /* border width on t/r/b/l */
186 lws_display_colour_t dcb; /* border colour */
187
188 /* rasterization temps */
189
193
196 /* 0 = full box, else fill the triangle at the named corner: the css
197 * border-triangle idiom (transparent adjacent borders on an empty
198 * box) */
199 uint8_t tri; /* 1 t-l, 2 t-r, 3 b-l, 4 b-r */
201
205
206/*
207 * Non-printing hit region: renders nothing, but marks the area of its box
208 * as belonging to something, eg, the link whose url it carries. Being a
209 * dlo it is placed and moved by the layout with the things around it, and
210 * its position in the paint order decides which of several overlapping
211 * regions a point belongs to (the last, as a viewer sees it on top).
212 */
213
214/*
215 * The pointer shape a hit region asks for while the pointer is over it, in
216 * platform-neutral terms: a windowing backend maps these to whatever it
217 * has (X11 font cursors, NSCursor, LoadCursor...). A link asks for the
218 * pointing hand, editable text for the I-beam, css cursor: for the rest.
219 */
231
232typedef struct lws_dlo_hit {
234 const char *url; /* as written in the document, in
235 * the same allocation; NULL for a
236 * region that only sets the
237 * cursor */
238 uint8_t fill; /* takes its parent's size */
239 uint8_t cursor; /* lws_dlo_cursor_t */
241
242typedef struct lws_font_choice {
243 const char *family_name;
244 const char *generic_name;
246 uint16_t style; /* normal, italic, oblique */
249
250typedef struct lws_display_font {
252
254
255 const uint8_t *data; /* may be cast to imp struct */
256 uint8_t *priv; /* only used by implementation */
257 size_t data_len;
260
261 lws_fx_t em; /* 1 em in pixels */
262 lws_fx_t ex; /* 1 ex in pixels */
264
265typedef struct lws_dlo_filesystem {
267
268 const char *name;
269 const void *data;
270 size_t len;
272
273#define LWSDLO_TEXT_FLAG_WRAP (1 << 0)
274
275typedef struct lws_dlo_text {
279 lws_box_t bounding_box; /* { 0, 0, w, h } relative
280 * to and subject to
281 * clipping by .dlo.box */
282
283 /* referred to by glyphs */
284 const struct lws_surface_info *ic;
285 struct lwsac *ac_glyphs;
288 uint16_t glyph_row; /* rows the glyph run decoders
289 * have produced since attach */
290
291 char *text;
293 size_t text_len;
296
298
301 int16_t font_height;
303
306
309
315
316typedef struct lws_dlo_png {
317 lws_dlo_t dlo; /* ordering: first */
318 lws_flow_t flow; /* ordering: second */
319 char name[25];
321 uint32_t emitted; /* decoded rows issued so far,
322 * for viewport re-scans */
323 uint8_t *row; /* copy of the last row issued, for
324 * repeating it when scaled up */
326 lws_reclaimable_t rc; /* payload + decoder, once complete */
327 uint8_t evicted; /* renew from the asset cache
328 * before the next render */
329 uint8_t yields; /* consecutive OOM yields */
331
332typedef struct lws_dlo_jpeg {
333 lws_dlo_t dlo; /* ordering: first */
334 lws_flow_t flow; /* ordering: second */
335 char name[25];
337 uint32_t emitted; /* decoded rows issued so far,
338 * for viewport re-scans */
339 uint8_t *row; /* copy of the last row issued, for
340 * repeating it when scaled up */
342 lws_reclaimable_t rc; /* payload + decoder, once complete */
343 uint8_t evicted; /* renew from the asset cache
344 * before the next render */
346
347typedef struct lws_dlo_svg {
348 lws_dlo_t dlo; /* ordering: first */
349 lws_flow_t flow; /* ordering: second */
350 char name[25];
353
354/*
355 * Unlike the png and jpeg dlos, the gif dlo keeps the whole asset payload
356 * retained in one buffer: interlaced gifs must be re-decoded to reach rows
357 * out of stream order, and a linewise renderer without a framebuffer can
358 * only get interlaced rows that way. Progressive gifs free it again once
359 * the frame has decoded.
360 */
361
362typedef struct lws_dlo_gif {
363 lws_dlo_t dlo; /* ordering: first */
364 lws_flow_t flow; /* ordering: second */
365 char name[25];
367 uint8_t *whole; /* retained asset payload */
368 size_t whole_len;
370 size_t pos; /* decode feed cursor in whole */
371 char whole_done; /* whole fully decoded */
373
381
392
397
398typedef struct lws_dl_rend {
400 int w;
401 int h;
402 char clipped; /* the layout dropped content that
403 * landed below h */
405
407 lws_dlo_t *dlo; /* position in dlo owner */
408 lws_box_t co; /* our origin as parent */
410
412 lws_sorted_usec_list_t sul; /* return to event loop statefully */
413 struct lws_display_state *lds; /* optional, if using lws_display */
414
416
417 const struct lws_surface_info *ic; /* display dimensions, palette */
418
419#if defined(LWS_ESP_PLATFORM)
420 lws_display_render_stack_t st[16]; /* DLO child stack */
421#else
422 lws_display_render_stack_t st[64]; /* DLO child stack */
423#endif
424 int sp; /* DLO child stack level */
425
426 uint8_t *line; /* Y or RGB line comp buffer */
427
429
430 /* the html document ss currently bound to this render state, when
431 * browsed with lws_lhp_ss_browse(); used by lws_lhp_ss_cancel() */
432
433 struct lws_ss_handle *hss_html;
434
437
438 char html;
439 char retained; /* nonzero: keep DLOs when the
440 * render cursor passes them, so
441 * the display list can be re-
442 * scanned at other offsets */
443 char layout_clipped; /* set when the html
444 * completes if the layout dropped
445 * content below the surface: a
446 * taller surface would show more */
447 int32_t viewport_h; /* 0, or the height css
448 * viewport units and the root
449 * element's height resolve
450 * against, when the layout
451 * surface is taller than what is
452 * shown at once (a scrolling
453 * window) */
454
456
457
460
463
466
469
472
475
486
487//#if defined(_DEBUG)
490//#endif
491
501lws_display_list_destroy(struct lws_context *cx, lws_displaylist_t *dl);
502
505
508
511
512/*
513 * lws_display_list_render_line() - render a single raster line of the list
514 *
515 * \param rs: prepared render state object
516 *
517 * Allocates a line pair buffer into ds->line if necessary, and renders the
518 * current line (set by ds->curr) of the display list rasterization into it
519 */
522
525
526/*
527 * rect
528 */
529
532 lws_box_t *box, const lws_fx_t *radii,
534
537
538/*
539 * hit region
540 */
541
557 const lws_box_t *box, const char *url, size_t url_len);
558
561
564
579
593
594/*
595 * dlo text
596 */
597
600 lws_box_t *box, const lws_display_font_t *font);
601
604 lws_fx_t indent, const char *utf8, size_t text_len);
605
617 size_t text_len, lws_fx_t *total,
618 lws_fx_t *longest_word);
619
622
623/*
624 * PNG
625 */
626
629 lws_box_t *box, const char *name, size_t len);
630
633
636
639
640/*
641 * JPEG
642 */
643
646 lws_box_t *box, const char *name, size_t len);
647
650
653
656
657/*
658 * SVG
659 */
660
663 lws_box_t *box, const char *name, size_t len);
664
667
670
673
674/*
675 * GIF
676 */
677
680 lws_box_t *box, const char *name, size_t len);
681
684
687
690
691/*
692 * Take rx payload for a gif dlo into its retained buffer; the gif flow
693 * keeps the payload rather than consuming it from the flow buflist.
694 * Returns 0, or nonzero on allocation failure or over the retention cap.
695 */
696
698lws_display_dlo_gif_rx(lws_dlo_gif_t *dlo_gif, const uint8_t *buf, size_t len);
699
700/*
701 * SS / dlo images
702 */
703
704struct lhp_ctx;
705
720
723
725lws_dlo_ss_find(struct lws_context *cx, const char *url, lws_dlo_image_t *u);
726
737lws_dlo_ss_assets_active(struct lws_context *cx);
738
748lws_dlo_ss_stop_any_active(struct lws_context *cx);
749
765lws_dlo_ss_detach_lhp(struct lws_context *cx, struct lhp_ctx *lhp);
766
780lws_dlo_ss_renew_images(struct lws_context *cx);
781
792lws_dlo_ss_renew_image(struct lws_context *cx, lws_dlo_t *dlo);
793
794
795/*
796 * The context dlo asset cache (see the dlo_asset_cache_dir member of
797 * lws_context_creation_info) stores fetched image assets in a self-maintaining
798 * file-backed cache, so still-valid assets are reused instead of refetched.
799 */
800
801#if !defined(LWS_DLO_ASSET_BLOB_DEFAULT_MAX_FOOTPRINT)
802#define LWS_DLO_ASSET_BLOB_DEFAULT_MAX_FOOTPRINT (64 * 1024 * 1024)
805#endif
806
807#if !defined(LWS_DLO_ASSET_BLOB_MAX_PAYLOAD)
808#define LWS_DLO_ASSET_BLOB_MAX_PAYLOAD (16 * 1024 * 1024)
810#endif
811
812#if !defined(LWS_DLO_ASSET_L1_MAX_FOOTPRINT)
813#define LWS_DLO_ASSET_L1_MAX_FOOTPRINT (8 * 1024 * 1024)
815#endif
816
817#if !defined(LWS_DLO_ASSET_L1_MAX_ITEMS)
818#define LWS_DLO_ASSET_L1_MAX_ITEMS 256
820#endif
821
822#if !defined(LWS_DLO_ASSET_CACHE_EXPIRY_S)
823#define LWS_DLO_ASSET_CACHE_EXPIRY_S (24 * 60 * 60)
826#endif
827
838LWS_VISIBLE LWS_EXTERN struct lws_cache_ttl_lru *
839lws_dlo_asset_cache(struct lws_context *cx);
840
842lhp_displaylist_layout(struct lhp_ctx *ctx, char reason);
843
844/*
845 * These image accessor macros adapt to the image types that were built in.
846 * Because they are macros, the svg arms have to be selected at compile time
847 * or they would reference svg apis that were not built.
848 */
849
850#if defined(LWS_WITH_SVG) && defined(LWS_WITH_GIF)
851
852#define lws_dlo_image_width(_u) ((_u)->failed ? -1 : \
853 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
854 (int)lws_jpeg_get_width((_u)->u.dlo_jpeg->j) : \
855 (_u)->type == LWSDLOSS_TYPE_SVG ? \
856 (int)lws_svg_get_width((_u)->u.dlo_svg->svg) : \
857 (_u)->type == LWSDLOSS_TYPE_GIF ? \
858 (int)lws_gif_get_width((_u)->u.dlo_gif->gif) : \
859 (int)lws_upng_get_width((_u)->u.dlo_png->png)))
860#define lws_dlo_image_height(_u) ((_u)->failed ? -1 : \
861 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
862 (int)lws_jpeg_get_height((_u)->u.dlo_jpeg->j) : \
863 (_u)->type == LWSDLOSS_TYPE_SVG ? \
864 (int)lws_svg_get_height((_u)->u.dlo_svg->svg) : \
865 (_u)->type == LWSDLOSS_TYPE_GIF ? \
866 (int)lws_gif_get_height((_u)->u.dlo_gif->gif) : \
867 (int)lws_upng_get_height((_u)->u.dlo_png->png)))
868
869#define lws_dlo_image_metadata_scan(_u) ((_u)->failed ? LWS_SRET_FATAL : \
870 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
871 lws_display_dlo_jpeg_metadata_scan((_u)->u.dlo_jpeg) : \
872 (_u)->type == LWSDLOSS_TYPE_SVG ? \
873 lws_display_dlo_svg_metadata_scan((_u)->u.dlo_svg) : \
874 (_u)->type == LWSDLOSS_TYPE_GIF ? \
875 lws_display_dlo_gif_metadata_scan((_u)->u.dlo_gif) : \
876 lws_display_dlo_png_metadata_scan((_u)->u.dlo_png)))
877
878#elif defined(LWS_WITH_SVG)
879
880#define lws_dlo_image_width(_u) ((_u)->failed ? -1 : \
881 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
882 (int)lws_jpeg_get_width((_u)->u.dlo_jpeg->j) : \
883 (_u)->type == LWSDLOSS_TYPE_SVG ? \
884 (int)lws_svg_get_width((_u)->u.dlo_svg->svg) : \
885 (int)lws_upng_get_width((_u)->u.dlo_png->png)))
886#define lws_dlo_image_height(_u) ((_u)->failed ? -1 : \
887 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
888 (int)lws_jpeg_get_height((_u)->u.dlo_jpeg->j) : \
889 (_u)->type == LWSDLOSS_TYPE_SVG ? \
890 (int)lws_svg_get_height((_u)->u.dlo_svg->svg) : \
891 (int)lws_upng_get_height((_u)->u.dlo_png->png)))
892
893#define lws_dlo_image_metadata_scan(_u) ((_u)->failed ? LWS_SRET_FATAL : \
894 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
895 lws_display_dlo_jpeg_metadata_scan((_u)->u.dlo_jpeg) : \
896 (_u)->type == LWSDLOSS_TYPE_SVG ? \
897 lws_display_dlo_svg_metadata_scan((_u)->u.dlo_svg) : \
898 lws_display_dlo_png_metadata_scan((_u)->u.dlo_png)))
899
900#elif defined(LWS_WITH_GIF)
901
902#define lws_dlo_image_width(_u) ((_u)->failed ? -1 : \
903 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
904 (int)lws_jpeg_get_width((_u)->u.dlo_jpeg->j) : \
905 (_u)->type == LWSDLOSS_TYPE_GIF ? \
906 (int)lws_gif_get_width((_u)->u.dlo_gif->gif) : \
907 (int)lws_upng_get_width((_u)->u.dlo_png->png)))
908#define lws_dlo_image_height(_u) ((_u)->failed ? -1 : \
909 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
910 (int)lws_jpeg_get_height((_u)->u.dlo_jpeg->j) : \
911 (_u)->type == LWSDLOSS_TYPE_GIF ? \
912 (int)lws_gif_get_height((_u)->u.dlo_gif->gif) : \
913 (int)lws_upng_get_height((_u)->u.dlo_png->png)))
914
915#define lws_dlo_image_metadata_scan(_u) ((_u)->failed ? LWS_SRET_FATAL : \
916 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
917 lws_display_dlo_jpeg_metadata_scan((_u)->u.dlo_jpeg) : \
918 (_u)->type == LWSDLOSS_TYPE_GIF ? \
919 lws_display_dlo_gif_metadata_scan((_u)->u.dlo_gif) : \
920 lws_display_dlo_png_metadata_scan((_u)->u.dlo_png)))
921
922#else
923
924#define lws_dlo_image_width(_u) ((_u)->failed ? -1 : \
925 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
926 (int)lws_jpeg_get_width((_u)->u.dlo_jpeg->j) : \
927 (int)lws_upng_get_width((_u)->u.dlo_png->png)))
928#define lws_dlo_image_height(_u) ((_u)->failed ? -1 : \
929 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
930 (int)lws_jpeg_get_height((_u)->u.dlo_jpeg->j) : \
931 (int)lws_upng_get_height((_u)->u.dlo_png->png)))
932
933#define lws_dlo_image_metadata_scan(_u) ((_u)->failed ? LWS_SRET_FATAL : \
934 ((_u)->type == LWSDLOSS_TYPE_JPEG ? \
935 lws_display_dlo_jpeg_metadata_scan((_u)->u.dlo_jpeg) : \
936 lws_display_dlo_png_metadata_scan((_u)->u.dlo_png)))
937
938#endif
939
940/*
941 * Font registry
942 *
943 * Register fonts (currently, psfu) to the lws_context, and select the closest
944 * matching. Used to pick fonts from whatever CSS information is available.
945 */
946
948lws_font_register(struct lws_context *cx, const uint8_t *data, size_t data_len);
949
962lws_font_register_file(struct lws_context *cx, const char *path);
963
974lws_fonts_register_dir(struct lws_context *cx, const char *dirpath);
975
977lws_font_choose(struct lws_context *cx, const lws_font_choice_t *hints);
978
980lws_fonts_destroy(struct lws_context *cx);
981
982/*
983 * Static blob registry (built-in, name-accessible blobs)
984 */
985
987lws_dlo_file_register(struct lws_context *cx, const lws_dlo_filesystem_t *f);
988
989/* only needed if f dynamically heap-allocated... doesn't free data; data
990 * is typically overallocated after the lws_dlo_filesystem_t and freed when
991 * that is freed by this. */
992
995
997lws_dlo_file_unregister_by_name(struct lws_context *cx, const char *name);
998
1000lws_dlo_file_choose(struct lws_context *cx, const char *name);
1001
1003lws_dlo_file_destroy(struct lws_context *cx);
1004
1006#endif
struct lws_dll2 lws_dll2_t
struct lws_dll2_owner lws_dll2_owner_t
struct lws_flow lws_flow_t
struct lws_reclaimable lws_reclaimable_t
#define LWS_EXTERN_FOR_DATA
unsigned short uint16_t
unsigned int uint32_t
#define LWS_EXTERN
unsigned char uint8_t
struct lws_fixed3232 lws_fx_t
lws_stateful_ret_t
#define LWS_VISIBLE
uint32_t lws_display_colour_t
Definition lws-display.h:31
int16_t lws_display_list_coord_t
Definition lws-display.h:28
uint16_t lws_display_scalar
Definition lws-display.h:29
struct lws_box lws_box_t
lws_flow_t flow
Definition lws-dlo.h:334
uint8_t flag_abs_stretch
Definition lws-dlo.h:162
uint8_t init
Definition lws-dlo.h:194
LWS_VISIBLE LWS_EXTERN int lws_display_dlo_text_update(lws_dlo_text_t *text, lws_display_colour_t dc, lws_fx_t indent, const char *utf8, size_t text_len)
LWS_VISIBLE LWS_EXTERN lws_dlo_cursor_t lws_display_dl_cursor_at(lws_displaylist_t *dl, int x, int y)
int16_t font_line_height
Definition lws-dlo.h:302
lws_display_colour_t dc
Definition lws-dlo.h:139
LWS_VISIBLE LWS_EXTERN int lws_dlo_ss_renew_image(struct lws_context *cx, lws_dlo_t *dlo)
LWS_VISIBLE LWS_EXTERN lws_dlo_filesystem_t * lws_dlo_file_register(struct lws_context *cx, const lws_dlo_filesystem_t *f)
uint8_t flag_block
Definition lws-dlo.h:147
char whole_done
Definition lws-dlo.h:371
uint8_t * kern
Definition lws-dlo.h:292
LWS_VISIBLE LWS_EXTERN const lws_display_font_t * lws_font_choose(struct lws_context *cx, const lws_font_choice_t *hints)
lws_font_glyph_t *(* lws_dlo_image_glyph_t)(struct lws_dlo_text *text, uint32_t unicode, char attach)
Definition lws-dlo.h:80
struct lws_dlo_hit lws_dlo_hit_t
LWS_VISIBLE LWS_EXTERN int lws_dlo_ss_find(struct lws_context *cx, const char *url, lws_dlo_image_t *u)
uint8_t tri
Definition lws-dlo.h:199
lws_fx_t em
Definition lws-dlo.h:261
lws_dlo_cursor_t
Definition lws-dlo.h:220
@ LWS_DLO_CURSOR_NONE
Definition lws-dlo.h:229
@ LWS_DLO_CURSOR_WAIT
Definition lws-dlo.h:226
@ LWS_DLO_CURSOR_HELP
Definition lws-dlo.h:227
@ LWS_DLO_CURSOR_CROSSHAIR
Definition lws-dlo.h:224
@ LWS_DLO_CURSOR_DEFAULT
Definition lws-dlo.h:221
@ LWS_DLO_CURSOR_POINTER
Definition lws-dlo.h:222
@ LWS_DLO_CURSOR_NOT_ALLOWED
Definition lws-dlo.h:228
@ LWS_DLO_CURSOR_TEXT
Definition lws-dlo.h:223
@ LWS_DLO_CURSOR_MOVE
Definition lws-dlo.h:225
lws_displaylist_t * dl
Definition lws-dlo.h:399
uint16_t curr
Definition lws-dlo.h:287
LWS_VISIBLE LWS_EXTERN void lws_display_dl_init(lws_displaylist_t *dl, struct lws_display_state *ds)
lws_display_render_stack_t st[64]
Definition lws-dlo.h:422
lws_flow_t flow
Definition lws-dlo.h:349
void * priv_user
Definition lws-dlo.h:91
LWS_VISIBLE LWS_EXTERN void lws_dlo_contents(lws_dlo_t *parent, lws_dlo_dim_t *dim)
lws_displaylist_t displaylist
Definition lws-dlo.h:428
uint8_t flag_online
Definition lws-dlo.h:153
size_t text_len
Definition lws-dlo.h:293
struct lws_dlo * abut_x
Definition lws-dlo.h:127
LWS_VISIBLE LWS_EXTERN void lws_display_dl_dump(lws_displaylist_t *dl)
LWS_VISIBLE LWS_EXTERN int lws_display_dlo_gif_rx(lws_dlo_gif_t *dlo_gif, const uint8_t *buf, size_t len)
LWS_VISIBLE LWS_EXTERN struct lws_cache_ttl_lru * lws_dlo_asset_cache(struct lws_context *cx)
uint32_t emitted
Definition lws-dlo.h:321
const char * name
Definition lws-dlo.h:268
lws_box_t box
Definition lws-dlo.h:89
LWS_VISIBLE LWS_EXTERN lws_dlo_png_t * lws_display_dlo_png_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box, const char *name, size_t len)
lws_reclaimable_t rc
Definition lws-dlo.h:342
struct lhp_ctx * lhp
Definition lws-dlo.h:714
uint8_t cursor
Definition lws-dlo.h:239
struct lws_dlo_jpeg lws_dlo_jpeg_t
lws_upng_t * png
Definition lws-dlo.h:320
lws_display_scalar lowest_id_y
Definition lws-dlo.h:436
lws_fx_t height
Definition lws-dlo.h:71
LWS_VISIBLE LWS_EXTERN int lws_dlo_ss_stop_any_active(struct lws_context *cx)
lws_fx_t indent
Definition lws-dlo.h:297
struct lwsac * ac_glyphs
Definition lws-dlo.h:285
lws_dlo_image_type_t
Definition lws-dlo.h:374
@ LWSDLOSS_TYPE_JPEG
Definition lws-dlo.h:375
@ LWSDLOSS_TYPE_SVG
Definition lws-dlo.h:377
@ LWSDLOSS_TYPE_CSS
Definition lws-dlo.h:379
@ LWSDLOSS_TYPE_PNG
Definition lws-dlo.h:376
@ LWSDLOSS_TYPE_GIF
Definition lws-dlo.h:378
uint16_t style
Definition lws-dlo.h:246
lws_dll2_t list
Definition lws-dlo.h:266
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_jpeg_destroy(struct lws_dlo *dlo)
size_t whole_size
Definition lws-dlo.h:369
lws_sorted_usec_list_t sul
Definition lws-dlo.h:412
lws_fx_t btm
Definition lws-dlo.h:190
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_get_ids_boxes(lws_display_render_state_t *rs)
lws_dll2_t list
Definition lws-dlo.h:251
uint16_t glyph_row
Definition lws-dlo.h:288
size_t whole_len
Definition lws-dlo.h:368
LWS_VISIBLE LWS_EXTERN int lws_dlo_ensure_err_diff(lws_dlo_t *dlo)
lws_fx_t r
Definition lws-dlo.h:173
int16_t group_height
Definition lws-dlo.h:304
lws_dlo_renderer_t render
Definition lws-dlo.h:131
int16_t font_height
Definition lws-dlo.h:301
struct lws_dlo_gif lws_dlo_gif_t
uint8_t flag_toplevel
Definition lws-dlo.h:146
lws_flow_t flow
Definition lws-dlo.h:364
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_text_destroy(struct lws_dlo *dlo)
lws_display_list_coord_t clkernpx
Definition lws-dlo.h:294
lws_dlo_t dlo
Definition lws-dlo.h:233
LWS_VISIBLE LWS_EXTERN lws_dlo_gif_t * lws_display_dlo_gif_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box, const char *name, size_t len)
lws_dlo_t dlo
Definition lws-dlo.h:183
lws_dll2_owner_t dl
Definition lws-dlo.h:394
lws_dll2_owner_t glyphs
Definition lws-dlo.h:278
lws_display_id_t * id
Definition lws-dlo.h:136
const void * data
Definition lws-dlo.h:269
const struct lws_surface_info * ic
Definition lws-dlo.h:417
uint8_t * row
Definition lws-dlo.h:323
struct lws_display_id lws_display_id_t
uint8_t evicted
Definition lws-dlo.h:327
const char * url
Definition lws-dlo.h:234
LWS_VISIBLE LWS_EXTERN void lws_display_render_dump_ids(lws_dll2_owner_t *ids)
struct lws_context * cx
Definition lws-dlo.h:707
LWS_VISIBLE LWS_EXTERN lws_dlo_rect_t * lws_display_dlo_rect_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box, const lws_fx_t *radii, lws_display_colour_t dc)
lws_jpeg_t * j
Definition lws-dlo.h:336
lws_dlo_svg_t * dlo_svg
lws_dlo_gif_t * dlo_gif
void(* lws_dlo_destroy_t)(struct lws_dlo *dlo)
Definition lws-dlo.h:83
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_gif_destroy(struct lws_dlo *dlo)
lws_fx_t ex
Definition lws-dlo.h:262
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_text_measure(lws_dlo_text_t *text, const char *utf8, size_t text_len, lws_fx_t *total, lws_fx_t *longest_word)
const char * generic_name
Definition lws-dlo.h:244
LWS_VISIBLE LWS_EXTERN void lws_dlo_ss_renew_images(struct lws_context *cx)
size_t pos
Definition lws-dlo.h:370
uint32_t row_len
Definition lws-dlo.h:325
size_t data_len
Definition lws-dlo.h:257
LWS_VISIBLE LWS_EXTERN int lws_dlo_ss_assets_active(struct lws_context *cx)
uint8_t * whole
Definition lws-dlo.h:367
LWS_VISIBLE LWS_EXTERN int lws_font_register(struct lws_context *cx, const uint8_t *data, size_t data_len)
const uint8_t * data
Definition lws-dlo.h:255
lws_dlo_jpeg_t * dlo_jpeg
struct lws_font_choice lws_font_choice_t
uint8_t flag_fixed_h
Definition lws-dlo.h:160
uint16_t fixed_height
Definition lws-dlo.h:247
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_destroy(lws_dlo_t **r)
lws_displaylist_t * dl
Definition lws-dlo.h:708
lws_dlo_t * dlo_parent
Definition lws-dlo.h:709
uint32_t emitted
Definition lws-dlo.h:337
lws_dlo_t dlo
Definition lws-dlo.h:333
lws_sorted_usec_list_t sul
Definition lws-dlo.h:312
lws_dll2_t col_list
Definition lws-dlo.h:110
uint8_t flag_float
Definition lws-dlo.h:151
lws_dll2_owner_t table_rows
Definition lws-dlo.h:120
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_dlo_svg_metadata_scan(lws_dlo_svg_t *ds)
lws_sorted_usec_list_t * on_rx_sul
Definition lws-dlo.h:712
lws_fx_t rsq
Definition lws-dlo.h:178
struct lws_dlo_filesystem lws_dlo_filesystem_t
struct lws_display_font lws_display_font_t
int16_t group_y_baseline
Definition lws-dlo.h:305
LWS_VISIBLE LWS_EXTERN lws_display_id_t * lws_display_render_get_id(lws_display_render_state_t *rs, const char *id)
LWS_VISIBLE LWS_EXTERN void lws_dlo_file_unregister(lws_dlo_filesystem_t **f)
lws_fx_t cwidth
Definition lws-dlo.h:72
LWS_VISIBLE LWS_EXTERN lws_dlo_hit_t * lws_display_dlo_hit_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, const lws_box_t *box, const char *url, size_t url_len)
uint8_t flag_bg_homed
Definition lws-dlo.h:154
uint8_t flex_grow
Definition lws-dlo.h:166
struct lws_dlo_png lws_dlo_png_t
char name[25]
Definition lws-dlo.h:365
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_list_render_line(lws_display_render_state_t *rs)
lws_fx_t _cwidth
Definition lws-dlo.h:307
LWS_VISIBLE LWS_EXTERN lws_dlo_text_t * lws_display_dlo_text_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box, const lws_display_font_t *font)
uint32_t flags
Definition lws-dlo.h:299
struct lws_dlo_rect lws_dlo_rect_t
lws_dll2_owner_t ids
Definition lws-dlo.h:415
uint16_t weight
Definition lws-dlo.h:245
lws_dlo_t dlo
Definition lws-dlo.h:203
LWS_VISIBLE LWS_EXTERN lws_dlo_svg_t * lws_display_dlo_svg_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box, const char *name, size_t len)
LWS_VISIBLE LWS_EXTERN void lws_dlo_file_unregister_by_name(struct lws_context *cx, const char *name)
lws_dll2_t list
Definition lws-dlo.h:67
const struct lws_surface_info * ic
Definition lws-dlo.h:284
struct lws_display_state * ds
Definition lws-dlo.h:395
uint8_t flag_flex_item
Definition lws-dlo.h:158
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_dlo_png_metadata_scan(lws_dlo_png_t *dp)
uint8_t * row
Definition lws-dlo.h:339
uint8_t align_self
Definition lws-dlo.h:167
uint8_t alt
Definition lws-dlo.h:195
lws_dlo_t dlo
Definition lws-dlo.h:276
lws_fx_t w
Definition lws-dlo.h:56
lws_dlo_image_t * u
Definition lws-dlo.h:715
uint8_t flag_abs
Definition lws-dlo.h:150
int16_t base_up
Definition lws-dlo.h:142
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_dlo_gif_metadata_scan(lws_dlo_gif_t *dg)
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_hit(struct lws_display_render_state *rs)
LWS_VISIBLE LWS_EXTERN int lws_dlo_ss_create(lws_dlo_ss_create_info_t *i, lws_dlo_t **pdlo)
lws_box_t bounding_box
Definition lws-dlo.h:279
lws_fx_t right
Definition lws-dlo.h:191
LWS_VISIBLE LWS_EXTERN_FOR_DATA const struct lws_plat_file_ops lws_dlo_fops
Definition lws-dlo.h:1005
lws_fx_t b[4]
Definition lws-dlo.h:185
lws_box_t db
Definition lws-dlo.h:192
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_gif(struct lws_display_render_state *rs)
lws_display_list_coord_t cwidth
Definition lws-dlo.h:295
const lws_display_font_t * font
Definition lws-dlo.h:277
lws_fx_t padding[4]
Definition lws-dlo.h:134
LWS_VISIBLE LWS_EXTERN const lws_dlo_filesystem_t * lws_dlo_file_choose(struct lws_context *cx, const char *name)
struct lws_dlo_svg lws_dlo_svg_t
char clipped
Definition lws-dlo.h:402
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_adjust_dims(lws_dlo_t *dlo, lws_dlo_dim_t *dim)
lws_display_scalar curr
Definition lws-dlo.h:435
lws_circle_t c[4]
Definition lws-dlo.h:184
lws_dlo_destroy_t _destroy
Definition lws-dlo.h:130
struct lws_display_state * lds
Definition lws-dlo.h:413
LWS_VISIBLE LWS_EXTERN void lws_dlo_ss_detach_lhp(struct lws_context *cx, struct lhp_ctx *lhp)
lws_fx_t xpx
Definition lws-dlo.h:70
LWS_VISIBLE LWS_EXTERN int lws_display_dlo_add(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_dlo_t *dlo)
lws_dlo_t dlo
Definition lws-dlo.h:363
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_png(struct lws_display_render_state *rs)
uint8_t evicted
Definition lws-dlo.h:343
lws_dlo_t dlo
Definition lws-dlo.h:348
uint8_t flag_row
Definition lws-dlo.h:148
lws_dlo_renderer_t renderer
Definition lws-dlo.h:258
LWS_VISIBLE LWS_EXTERN void lws_fonts_destroy(struct lws_context *cx)
struct lws_dlo_circle lws_dlo_circle_t
lws_dlo_t dlo
Definition lws-dlo.h:317
uint8_t flag_zraise
Definition lws-dlo.h:152
uint8_t budget
Definition lws-dlo.h:141
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_png_destroy(struct lws_dlo *dlo)
uint8_t yields
Definition lws-dlo.h:329
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_svg(struct lws_display_render_state *rs)
LWS_VISIBLE LWS_EXTERN lws_dlo_jpeg_t * lws_display_dlo_jpeg_new(lws_displaylist_t *dl, lws_dlo_t *dlo_parent, lws_box_t *box, const char *name, size_t len)
lws_dlo_image_glyph_t image_glyph
Definition lws-dlo.h:259
lws_font_choice_t choice
Definition lws-dlo.h:253
uint8_t flag_cell
Definition lws-dlo.h:149
int16_t font_y_baseline
Definition lws-dlo.h:300
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_dlo_jpeg_metadata_scan(lws_dlo_jpeg_t *dj)
char name[25]
Definition lws-dlo.h:335
lws_reclaimable_t rc
Definition lws-dlo.h:326
lws_flow_t flow
Definition lws-dlo.h:318
uint8_t flag_inline_bg
Definition lws-dlo.h:156
lws_display_colour_t dcb
Definition lws-dlo.h:186
LWS_VISIBLE LWS_EXTERN lws_dlo_hit_t * lws_display_dl_hit_test(lws_displaylist_t *dl, int x, int y, lws_box_t *abox)
uint32_t row_len
Definition lws-dlo.h:341
struct lws_circle lws_circle_t
lws_dll2_owner_t children
Definition lws-dlo.h:115
lws_stateful_ret_t(* lws_dlo_renderer_t)(struct lws_display_render_state *rs)
Definition lws-dlo.h:79
lws_fx_t margin[4]
Definition lws-dlo.h:133
char * text
Definition lws-dlo.h:291
char name[25]
Definition lws-dlo.h:350
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_jpeg(struct lws_display_render_state *rs)
struct lws_ss_handle * hss_html
Definition lws-dlo.h:433
lws_dll2_t list
Definition lws-dlo.h:108
lws_fx_t orx
Definition lws-dlo.h:176
lws_gif_t * gif
Definition lws-dlo.h:366
LWS_VISIBLE LWS_EXTERN int lws_fonts_register_dir(struct lws_context *cx, const char *dirpath)
void * priv_driver
Definition lws-dlo.h:92
lws_dll2_owner_t owner
Definition lws-dlo.h:311
char name[25]
Definition lws-dlo.h:319
lws_dlo_png_t * dlo_png
lws_dll2_t row_list
Definition lws-dlo.h:111
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_hit_destroy(struct lws_dlo *dlo)
LWS_VISIBLE LWS_EXTERN void lws_display_dlo_svg_destroy(struct lws_dlo *dlo)
struct lws_dl_rend lws_dl_rend_t
lws_fx_t ys
Definition lws-dlo.h:179
lws_svg_t * svg
Definition lws-dlo.h:351
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_display_render_rect(struct lws_display_render_state *rs)
LWS_VISIBLE LWS_EXTERN int lws_font_register_file(struct lws_context *cx, const char *path)
const char * family_name
Definition lws-dlo.h:243
LWS_VISIBLE LWS_EXTERN void lws_display_list_destroy(struct lws_context *cx, lws_displaylist_t *dl)
struct lws_font_glyph lws_font_glyph_t
void * pin
Definition lws-dlo.h:76
lws_fx_t ory
Definition lws-dlo.h:177
LWS_VISIBLE LWS_EXTERN lws_display_id_t * lws_display_render_add_id(lws_display_render_state_t *rs, const char *id, void *priv)
lws_box_t box
Definition lws-dlo.h:138
struct lws_dlo lws_dlo_t
struct lws_dlo_rasterize lws_dlo_rasterize_t
lws_dll2_owner_t table_cols
Definition lws-dlo.h:119
lws_dll2_t list
Definition lws-dlo.h:86
uint8_t fill
Definition lws-dlo.h:238
uint8_t * priv
Definition lws-dlo.h:256
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lhp_displaylist_layout(struct lhp_ctx *ctx, char reason)
lws_fx_t h
Definition lws-dlo.h:57
struct lws_dlo * abut_y
Definition lws-dlo.h:128
LWS_VISIBLE LWS_EXTERN void lws_display_render_free_ids(lws_display_render_state_t *rs)
struct lws_dlo_text lws_dlo_text_t
struct lws_displaylist lws_displaylist_t
struct lws_display_render_stack lws_display_render_stack_t
uint8_t * line
Definition lws-dlo.h:286
LWS_VISIBLE LWS_EXTERN void lws_dlo_file_destroy(struct lws_context *cx)
struct lws_display_render_state lws_display_render_state_t
lws_fx_t xorg
Definition lws-dlo.h:69
struct lws_gif lws_gif_t
Definition lws-gif.h:44
struct lws_jpeg lws_jpeg_t
Definition lws-jpeg.h:36
struct lws_svg lws_svg_t
Definition lws-svg.h:39
void(* sul_cb_t)(struct lws_sorted_usec_list *sul)
struct lws_sorted_usec_list lws_sorted_usec_list_t
struct lws_upng_t lws_upng_t
Definition lws-upng.h:51
union lhp_ctx::@311003342135116017074105067137247155112136133110 u
lws_dlo_image_type_t type
Definition lws-dlo.h:389