79 if (box->
style != NULL) {
82 css_computed_background_color(box->
style, &colour);
109 if (box->
parent == NULL) {
172 bool highlighted =
false;
177 plot_fstyle.
size *= scale;
181 unsigned len = utf8_len + (space ? 1 : 0);
187 offset, offset + len,
188 &start_idx, &end_idx)) {
193 if (!highlighted && (search != NULL) &&
195 offset, offset + len,
196 &start_idx, &end_idx,
204 unsigned endtxt_idx = end_idx;
205 bool clip_changed =
false;
206 bool text_visible =
true;
211 if (end_idx > utf8_len) {
214 assert(end_idx == utf8_len + 1);
215 endtxt_idx = utf8_len;
219 utf8_text, start_idx,
226 utf8_text, endtxt_idx,
234 if (end_idx > utf8_len) {
244 if ((start_idx > 0) &&
248 y + (
int)(height * 0.75 * scale),
259 r.
y1 = y + height * scale;
266 int px0 =
max(x + startx, clip->
x0);
267 int px1 =
min(x + endx, clip->
x1);
281 text_visible =
false;
294 y + (
int)(height * 0.75 * scale),
301 if (endtxt_idx < utf8_len) {
302 int px0 =
max(x + endx, clip->
x0);
303 if (px0 < clip->
x1) {
319 y + (
int)(height * 0.75 * scale),
339 y + (
int) (height * 0.75 * scale),
415 if (width < 12 || height < 12) {
419 rect.
x1 = x + width - z;
420 rect.
y1 = y + height - z;
427 rect.
x0 = x + width - z;
429 rect.
x1 = x + (z * 3);
430 rect.
y1 = y + height - z;
436 rect.
x0 = x + (z * 3);
437 rect.
y0 = y + height - z;
439 rect.
y1 = y + (height / 2);
550 length = strlen(text);
557 if (width < text_width + 8) {
558 x = x + width - text_width - 4;
563 res = ctx->
plot->
text(ctx, &fstyle, x, y + height * 0.75, text, length);
592 struct box *background,
596 bool repeat_x =
false;
597 bool repeat_y =
false;
598 bool plot_colour =
true;
600 bool clip_to_children =
false;
601 struct box *clip_box = box;
604 css_fixed hpos = 0, vpos = 0;
605 css_unit hunit = CSS_UNIT_PX, vunit = CSS_UNIT_PX;
611 .fill_colour = *background_colour,
618 plot_content = (background->
background != NULL);
639 switch (css_computed_background_repeat(background->
style)) {
640 case CSS_BACKGROUND_REPEAT_REPEAT:
641 repeat_x = repeat_y =
true;
647 case CSS_BACKGROUND_REPEAT_REPEAT_X:
651 case CSS_BACKGROUND_REPEAT_REPEAT_Y:
655 case CSS_BACKGROUND_REPEAT_NO_REPEAT:
663 css_computed_background_position(background->
style,
664 &hpos, &hunit, &vpos, &vunit);
665 if (hunit == CSS_UNIT_PCT) {
668 scale * FIXTOFLT(hpos) / 100.;
671 background->
style)) * scale);
674 if (vunit == CSS_UNIT_PCT) {
677 scale * FIXTOFLT(vpos) / 100.;
680 background->
style)) * scale);
687 css_fixed h = 0, v = 0;
688 css_unit hu = CSS_UNIT_PX, vu = CSS_UNIT_PX;
690 for (parent = box->
parent;
693 assert(parent && (parent->
style));
695 css_computed_border_spacing(parent->
style, &h, &hu, &v, &vu);
697 clip_to_children = (h > 0) || (v > 0);
699 if (clip_to_children)
703 for (; clip_box; clip_box = clip_box->
next) {
705 if (clip_to_children) {
709 r.
x0 = ox + (clip_box->
x * scale);
710 r.
y0 = oy + (clip_box->
y * scale);
718 if (r.
x0 < clip->
x0) r.
x0 = clip->
x0;
719 if (r.
y0 < clip->
y0) r.
y0 = clip->
y0;
720 if (r.
x1 > clip->
x1) r.
x1 = clip->
x1;
721 if (r.
y1 > clip->
y1) r.
y1 = clip->
y1;
723 css_computed_background_color(clip_box->
style, &bgcol);
729 if ((r.
x0 >= r.
x1) ||
738 css_computed_background_color(background->
style, &bgcol);
759 if (r.
x1 > x + width * scale)
760 r.
x1 = x + width * scale;
765 if (r.
y1 > y + height * scale)
766 r.
y1 = y + height * scale;
769 if ((r.
x0 < r.
x1) && (r.
y0 < r.
y1)) {
779 bg_data.
width = ceilf(width * scale);
780 bg_data.
height = ceilf(height * scale);
793 if (!clip_to_children)
824 bool repeat_x =
false;
825 bool repeat_y =
false;
826 bool plot_colour =
true;
828 css_fixed hpos = 0, vpos = 0;
829 css_unit hunit = CSS_UNIT_PX, vunit = CSS_UNIT_PX;
833 .fill_colour = *background_colour,
844 switch (css_computed_background_repeat(box->
style)) {
845 case CSS_BACKGROUND_REPEAT_REPEAT:
846 repeat_x = repeat_y =
true;
853 case CSS_BACKGROUND_REPEAT_REPEAT_X:
857 case CSS_BACKGROUND_REPEAT_REPEAT_Y:
861 case CSS_BACKGROUND_REPEAT_NO_REPEAT:
869 css_computed_background_position(box->
style,
870 &hpos, &hunit, &vpos, &vunit);
871 if (hunit == CSS_UNIT_PCT) {
874 scale) * FIXTOFLT(hpos) / 100.;
876 if (!repeat_x && ((hpos < 2 && !first) ||
877 (hpos > 98 && !last))){
878 plot_content =
false;
882 box->
style)) * scale);
885 if (vunit == CSS_UNIT_PCT) {
888 scale) * FIXTOFLT(vpos) / 100.;
891 box->
style)) * scale);
896 css_computed_background_color(box->
style, &bgcol);
917 if (r.
x1 > x + width * scale)
918 r.
x1 = x + width * scale;
923 if (r.
y1 > y + height * scale)
924 r.
y1 = y + height * scale;
927 if ((r.
x0 < r.
x1) && (r.
y0 < r.
y1)) {
937 bg_data.
width = ceilf(width * scale);
938 bg_data.
height = ceilf(height * scale);
988 rect.
x0 = (x + c->
x) * scale;
989 rect.
y0 = (y + c->
y + c->
height * ratio) * scale;
990 rect.
x1 = (x + c->
x + c->
width) * scale;
991 rect.
y1 = (y + c->
y + c->
height * ratio) * scale;
992 res = ctx->
plot->
line(ctx, &plot_style_box, &rect);
1033 rect.
x0 = (x + c->
x) * scale;
1034 rect.
y0 = (y + c->
y + c->
height * ratio) * scale;
1035 rect.
x1 = (x + c->
x + c->
width) * scale;
1036 rect.
y1 = (y + c->
y + c->
height * ratio) * scale;
1037 res = ctx->
plot->
line(ctx, &plot_style_box, &rect);
1044 scale, colour, ratio, ctx))
1065 int x_parent,
int y_parent,
float scale,
1068 static const enum css_text_decoration_e decoration[] = {
1069 CSS_TEXT_DECORATION_UNDERLINE, CSS_TEXT_DECORATION_OVERLINE,
1070 CSS_TEXT_DECORATION_LINE_THROUGH };
1071 static const float line_ratio[] = { 0.9, 0.1, 0.5 };
1076 css_computed_color(box->
style, &col);
1087 if (css_computed_text_decoration(box->
style) &
1090 x_parent, y_parent, scale,
1091 fgcol, line_ratio[i], ctx))
1095 if (css_computed_text_decoration(box->
style) &
1101 fgcol, line_ratio[i], ctx))
1125 int x,
int y,
const struct rect *
clip,
float scale,
1126 colour current_background_color,
1129 bool excluded = (box->
object != NULL);
1133 fstyle.
background = current_background_color;
1136 box->
space, &fstyle, x, y,
1137 clip, box->
height, scale, excluded,
1138 (
struct content *)html, &html->sel,
1146 int x_parent,
int y_parent,
1147 const struct rect *
clip,
float scale,
1148 colour current_background_color,
1166 int x_parent,
int y_parent,
1167 const struct rect *clip,
float scale,
1168 colour current_background_color,
1181 clip, scale, current_background_color,
1191 clip, scale, current_background_color,
1215 int x_parent,
int y_parent,
1216 const struct rect *clip,
const float scale,
1217 colour current_background_color,
1223 int padding_left, padding_top, padding_width, padding_height;
1224 int border_left, border_top, border_right, border_bottom;
1227 int x_scrolled, y_scrolled;
1228 struct box *bg_box = NULL;
1229 css_computed_clip_rect css_rect;
1230 enum css_overflow_e overflow_x = CSS_OVERFLOW_VISIBLE;
1231 enum css_overflow_e overflow_y = CSS_OVERFLOW_VISIBLE;
1236 if (box->
style != NULL) {
1237 overflow_x = css_computed_overflow_x(box->
style);
1238 overflow_y = css_computed_overflow_y(box->
style);
1243 x = x_parent + box->
x;
1244 y = y_parent + box->
y;
1250 padding_height = padding_top + box->
height +
1257 x = (x_parent + box->
x) * scale;
1258 y = (y_parent + box->
y) * scale;
1259 width = box->
width * scale;
1260 height = box->
height * scale;
1278 if (box->
style && overflow_x != CSS_OVERFLOW_VISIBLE &&
1281 r.
x0 = x - border_left;
1282 r.
x1 = x + padding_width + border_right;
1294 int margin_left, margin_right;
1302 r.
x0 = x - border_left - margin_left < r.
x0 ?
1303 x - border_left - margin_left : r.
x0;
1304 r.
x1 = x + padding_width + border_right +
1305 margin_right > r.
x1 ?
1306 x + padding_width + border_right +
1307 margin_right : r.
x1;
1312 if (box->
style && overflow_y != CSS_OVERFLOW_VISIBLE &&
1315 r.
y0 = y - border_top;
1316 r.
y1 = y + padding_height + border_bottom;
1328 int margin_top, margin_bottom;
1336 r.
y0 = y - border_top - margin_top < r.
y0 ?
1337 y - border_top - margin_top : r.
y0;
1338 r.
y1 = y + padding_height + border_bottom +
1339 margin_bottom > r.
y1 ?
1340 y + padding_height + border_bottom +
1341 margin_bottom : r.
y1;
1346 if (clip->
y1 < r.
y0 || r.
y1 < clip->
y0 ||
1347 clip->
x1 < r.
x0 || r.
x1 < clip->
x0)
1369 if (box->
style && css_computed_visibility(box->
style) ==
1370 CSS_VISIBILITY_HIDDEN) {
1375 &r, scale, current_background_color, ctx))
1385 if (box->
style != NULL &&
1386 css_computed_position(box->
style) ==
1387 CSS_POSITION_ABSOLUTE &&
1388 css_computed_clip(box->
style, &css_rect) ==
1391 if (css_rect.left_auto ==
false)
1394 css_rect.left, css_rect.lunit,
1397 if (css_rect.top_auto ==
false)
1400 css_rect.top, css_rect.tunit,
1403 if (css_rect.right_auto ==
false)
1406 css_rect.right, css_rect.runit,
1409 if (css_rect.bottom_auto ==
false)
1412 css_rect.bottom, css_rect.bunit,
1416 if (r.
x0 < clip->
x0) r.
x0 = clip->
x0;
1417 if (r.
y0 < clip->
y0) r.
y0 = clip->
y0;
1418 if (clip->
x1 < r.
x1) r.
x1 = clip->
x1;
1419 if (clip->
y1 < r.
y1) r.
y1 = clip->
y1;
1432 if (r.
x0 < clip->
x0) r.
x0 = clip->
x0;
1433 if (r.
y0 < clip->
y0) r.
y0 = clip->
y0;
1434 if (clip->
x1 < r.
x1) r.
x1 = clip->
x1;
1435 if (clip->
y1 < r.
y1) r.
y1 = clip->
y1;
1465 (bg_box->
gadget != NULL &&
1471 p.
x0 = x - border_left < r.
x0 ? r.
x0 : x - border_left;
1472 p.
y0 = y - border_top < r.
y0 ? r.
y0 : y - border_top;
1473 p.
x1 = x + padding_width + border_right < r.
x1 ?
1474 x + padding_width + border_right : r.
x1;
1475 p.
y1 = y + padding_height + border_bottom < r.
y1 ?
1476 y + padding_height + border_bottom : r.
y1;
1480 int m_left, m_top, m_right, m_bottom;
1492 p.
x0 = p.
x0 - m_left < r.
x0 ? r.
x0 : p.
x0 - m_left;
1493 p.
y0 = p.
y0 - m_top < r.
y0 ? r.
y0 : p.
y0 - m_top;
1494 p.
x1 = p.
x1 + m_right < r.
x1 ? p.
x1 + m_right : r.
x1;
1495 p.
y1 = p.
y1 + m_bottom < r.
y1 ? p.
y1 + m_bottom : r.
y1;
1498 if ((p.
x0 < p.
x1) && (p.
y0 < p.
y1)) {
1501 ¤t_background_color, bg_box,
1520 (border_top || border_right || border_bottom || border_left)) {
1522 padding_width, padding_height, &r,
1530 border_top || border_right ||
1531 border_bottom || border_left)) {
1541 int ib_b_left, ib_b_right;
1543 b.
x0 = x - border_left;
1544 b.
x1 = x + padding_width + border_right;
1545 b.
y0 = y - border_top;
1546 b.
y1 = y + padding_height + border_bottom;
1552 for (ib = box; ib; ib = ib->
next) {
1560 ib_x = x_parent + ib->
x;
1561 ib_y = y_parent + ib->
y;
1567 ib_x = (x_parent + ib->
x) * scale;
1568 ib_y = (y_parent + ib->
y) * scale;
1579 x, y, box, scale, &p, b,
1581 ¤t_background_color,
1588 scale, first,
false, ctx))
1591 b.
x0 = ib_x - ib_b_left;
1592 b.
y0 = ib_y - border_top - padding_top;
1593 b.
y1 = ib_y + padding_height - padding_top +
1604 b.
x1 = ib_x + ib_p_width + ib_b_right;
1614 first,
true, ¤t_background_color,
1628 int margin_left, margin_right;
1629 int margin_top, margin_bottom;
1643 rect.
x0 = x + padding_left;
1644 rect.
y0 = y + padding_top;
1645 rect.
x1 = x + padding_left +
width;
1646 rect.
y1 = y + padding_top +
height;
1653 rect.
x1 = x + padding_width;
1654 rect.
y1 = y + padding_height;
1659 rect.
x0 = x - border_left - margin_left;
1660 rect.
y0 = y - border_top - margin_top;
1661 rect.
x1 = x + padding_width + border_right + margin_right;
1662 rect.
y1 = y + padding_height + border_bottom + margin_bottom;
1669 if (box->
parent != NULL) {
1670 bool need_clip =
false;
1672 (overflow_x != CSS_OVERFLOW_VISIBLE &&
1673 overflow_y != CSS_OVERFLOW_VISIBLE)) {
1676 r.
x1 = x + padding_width;
1677 r.
y1 = y + padding_height;
1678 if (r.
x0 < clip->
x0) r.
x0 = clip->
x0;
1679 if (r.
y0 < clip->
y0) r.
y0 = clip->
y0;
1680 if (clip->
x1 < r.
x1) r.
x1 = clip->
x1;
1681 if (clip->
y1 < r.
y1) r.
y1 = clip->
y1;
1682 if (r.
x1 <= r.
x0 || r.
y1 <= r.
y0) {
1688 }
else if (overflow_x != CSS_OVERFLOW_VISIBLE) {
1691 r.
x1 = x + padding_width;
1693 if (r.
x0 < clip->
x0) r.
x0 = clip->
x0;
1694 if (clip->
x1 < r.
x1) r.
x1 = clip->
x1;
1701 }
else if (overflow_y != CSS_OVERFLOW_VISIBLE) {
1705 r.
y1 = y + padding_height;
1706 if (r.
y0 < clip->
y0) r.
y0 = clip->
y0;
1707 if (clip->
y1 < r.
y1) r.
y1 = clip->
y1;
1727 css_computed_text_decoration(box->
style) != CSS_TEXT_DECORATION_NONE) {
1729 scale, current_background_color, ctx))
1733 if (box->
object && width != 0 && height != 0) {
1739 obj_data.
x = x_scrolled + padding_left;
1740 obj_data.
y = y_scrolled + padding_top;
1756 const char *obj =
"\xef\xbf\xbc";
1758 int obj_x = x + padding_left;
1761 rect.
x0 = x + padding_left;
1762 rect.
y0 = y + padding_top;
1763 rect.
x1 = x + padding_left + width - 1;
1764 rect.
y1 = y + padding_top + height - 1;
1777 obj_x += width / 2 - obj_width / 2;
1782 obj_x, y + padding_top + (
int)(height * 0.75),
1787 }
else if (box->
iframe) {
1791 y + padding_top, &r, ctx);
1805 width, height, box, scale,
1806 current_background_color, &html->
len_ctx, ctx))
1809 }
else if (box->
gadget &&
1814 current_background_color, scale, &r, ctx);
1816 }
else if (box->
text) {
1818 current_background_color, ctx))
1823 scale, current_background_color, ctx))
1839 clip, scale, current_background_color, ctx))
1847 (overflow_x == CSS_OVERFLOW_SCROLL ||
1848 overflow_x == CSS_OVERFLOW_AUTO ||
1849 overflow_y == CSS_OVERFLOW_SCROLL ||
1850 overflow_y == CSS_OVERFLOW_AUTO)) ||
1854 bool has_x_scroll = (overflow_x == CSS_OVERFLOW_SCROLL);
1855 bool has_y_scroll = (overflow_y == CSS_OVERFLOW_SCROLL);
1857 has_x_scroll |= (overflow_x == CSS_OVERFLOW_AUTO) &&
1859 has_y_scroll |= (overflow_y == CSS_OVERFLOW_AUTO) &&
1863 box, has_x_scroll, has_y_scroll);
1880 y_parent + box->
y, clip, scale, ctx);
1910 bool select, select_only;
1923 select_only =
false;
1955 data->
x + menu_x, data->
y + menu_y,
1956 data->
scale, clip, ctx);
struct form_control * gadget
Form control data, or NULL if not a form control.
Target independent plotting interface.
bool box_hscrollbar_present(const struct box *const box)
Determine if a box has a horizontal scrollbar.
static bool html_redraw_text_decoration(struct box *box, int x_parent, int y_parent, float scale, colour background_colour, const struct redraw_context *ctx)
Plot text decoration for a box.
bool content_redraw(struct hlcache_handle *h, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
Display content on screen with optional tiling.
int descendant_x1
right edge of descendants
const struct plotter_table * plot
Current plot operation table.
bool browser_window_redraw(struct browser_window *bw, int x, int y, const struct rect *clip, const struct redraw_context *ctx)
Redraw an area of a window.
plot_style_t * plot_style_stroke_lightwbasec
plot_operation_type_t stroke_type
Stroke plot type.
struct box_border border[4]
Border: TOP, RIGHT, BOTTOM, LEFT.
static struct box * html_redraw_find_bg_box(struct box *box)
Find the background box for a box.
Interface to utility string handling.
nserror(* disc)(const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius)
Plots a circle.
Localised message support (interface).
plot_style_t const *const plot_style_broken_object
box_flags flags
Box flags.
Interface to platform-specific layout operation table.
Public content interface.
bool html_redraw(struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
Draw a CONTENT_HTML using the current set of plotters (plot).
int padding[4]
Padding: TOP, RIGHT, BOTTOM, LEFT.
struct form_control * visible_select_menu
Open core-handled form SELECT menu, or NULL if none currently open.
nserror(* group_end)(const struct redraw_context *ctx)
End of the most recently started group.
static bool html_redraw_background(int x, int y, struct box *box, float scale, const struct rect *clip, colour *background_colour, struct box *background, const nscss_len_ctx *len_ctx, const struct redraw_context *ctx)
Plot background images.
size_t byte_offset
Byte offset within a textual representation of this content.
int descendant_y0
top edge of descendants
struct scrollbar * scroll_x
Horizontal scroll.
#define selection_defined(s)
int descendant_x0
left edge of descendants
bool html_redraw_debug
Render padding and margin box outlines in html_redraw().
nserror(* clip)(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
void textarea_redraw(struct textarea *ta, int x, int y, colour bg, float scale, const struct rect *clip, const struct redraw_context *ctx)
Handle redraw requests for text areas.
void box_coords(struct box *box, int *x, int *y)
Find the absolute coordinates of a box.
int x
Coordinate of left padding edge relative to parent box, or relative to ancestor that contains this bo...
struct box * layout
Box tree, or NULL.
Length conversion context data.
HTML Box tree inspection interface.
struct box * float_children
First float child box, or NULL.
colour fill_colour
Colour of fill.
int y
Coordinate of top padding edge, relative as for x.
struct scrollbar * scroll_y
Vertical scroll.
bool html_redraw_printing
#define colour_to_bw_furthest(c0)
bool background_images
Render background images.
plot_style_t * plot_style_fill_white
plot_font_style_t const *const plot_fstyle_broken_object
bool interactive
Redraw to show interactive features.
Option reading and saving interface.
static bool text_redraw(const char *utf8_text, size_t utf8_len, size_t offset, int space, const plot_font_style_t *fstyle, int x, int y, const struct rect *clip, int height, float scale, bool excluded, struct content *c, const struct selection *sel, struct search_context *search, const struct redraw_context *ctx)
Redraw a short text string, complete with highlighting (for selection/search)
int space
Width of space after current text (depends on font and size).
int y
coordinate for top-left of redraw
colour foreground
Colour of text.
nserror
Enumeration of error codes.
struct box * next_float
Next sibling float box.
bool html_redraw_inline_borders(struct box *box, struct rect b, const struct rect *clip, float scale, bool first, bool last, const struct redraw_context *ctx)
Draw an inline's borders.
size_t length
Length of text.
plot_style_t * plot_style_fill_wbasec
Corresponds to a single URL.
Private data for text/html content.
#define NS_TRANSPARENT
Transparent colour value.
static bool html_redraw_checkbox(int x, int y, int width, int height, bool selected, const struct redraw_context *ctx)
Plot a checkbox.
plot_style_t const *const plot_style_padding_edge
plot_style_t * plot_style_fill_darkwbasec
#define NSLOG(catname, level, logmsg, args...)
Internal font handling interfaces.
Conception: Generalized output-in-pages.
Single/Multi-line UTF-8 text area interface.
static bool html_redraw_radio(int x, int y, int width, int height, bool selected, const struct redraw_context *ctx)
Plot a radio icon.
static bool html_redraw_box_has_background(struct box *box)
Determine if a box has a background that needs drawing.
uint32_t colour
Colour type: XBGR.
struct box * list_marker
List marker box if this is a list-item, or NULL.
bool html_redraw_borders(struct box *box, int x_parent, int y_parent, int p_width, int p_height, const struct rect *clip, float scale, const struct redraw_context *ctx)
Draw borders for a box.
int height
vertical dimension
int content_get_height(struct hlcache_handle *h)
Retrieve height of content.
bool html_redraw_box(const html_content *html, struct box *box, int x_parent, int y_parent, const struct rect *clip, float scale, colour current_background_color, const struct redraw_context *ctx)
Recursively draw a box.
interface to HTML layout.
int html_redraw_printing_top_cropped
int width
dimensions to render content at (for scaling contents with intrinsic dimensions)
plot_style_t * plot_style_stroke_wblobc
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.
bool selection_highlighted(const struct selection *s, unsigned start, unsigned end, unsigned *start_idx, unsigned *end_idx)
Tests whether a text range lies partially within the selection, if there is a selection defined...
colour background
Background colour to blend to, if appropriate.
Box tree manipulation interface.
static bool html_redraw_inline_background(int x, int y, struct box *box, float scale, const struct rect *clip, struct rect b, bool first, bool last, colour *background_colour, const nscss_len_ctx *len_ctx, const struct redraw_context *ctx)
Plot an inline's background and/or background image.
bool box_vscrollbar_present(const struct box *const box)
Determine if a box has a vertical scrollbar.
plot_operation_type_t fill_type
Fill plot type.
parameters to content redraw
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
struct box * children
First child box, or NULL.
colour background_colour
The background colour.
Plotter operations table.
Plot style for stroke/fill plotters.
int width
border-width (pixels)
int height
Height of content box (excluding padding etc.).
box_type type
Type of box.
css_fixed nscss_len2px(const nscss_len_ctx *ctx, css_fixed length, css_unit unit, const css_computed_style *style)
Convert a CSS length to pixels.
int descendant_y1
bottom edge of descendants
static bool html_redraw_text_decoration_inline(struct box *box, int x, int y, float scale, colour colour, float ratio, const struct redraw_context *ctx)
Plot text decoration for an inline box.
plot_style_fixed size
Font size, in pt.
struct hlcache_handle * background
Background image for this box, or NULL if none.
char * text
Text, or NULL if none.
content_type content_get_type(struct hlcache_handle *h)
Retrieve computed type of content.
int width
Width of content box (excluding padding etc.).
struct hlcache_handle * object
Object in this box (usually an image), or NULL if none.
Interface to HTML searching.
int content_get_width(struct hlcache_handle *h)
Retrieve width of content.
#define nscss_color_to_ns(c)
Convert a CSS color to a NetSurf colour primitive.
Interface to a number of general purpose functionality.
Browser window creation and manipulation interface.
#define blend_colour(c0, c1)
Generic bitmap handling interface.
static bool html_redraw_box_children(const html_content *html, struct box *box, int x_parent, int y_parent, const struct rect *clip, float scale, colour current_background_color, const struct redraw_context *ctx)
Draw the various children of a box.
nserror(* width)(const struct plot_font_style *fstyle, const char *string, size_t length, int *width)
Measure the width of a string.
nserror(* group_start)(const struct redraw_context *ctx, const char *name)
Start of a group of objects.
int margin[4]
Margin: TOP, RIGHT, BOTTOM, LEFT.
bool search_term_highlighted(struct content *c, unsigned start_offset, unsigned end_offset, unsigned *start_idx, unsigned *end_idx, struct search_context *context)
Determines whether any portion of the given text box should be selected because it matches the curren...
Text selection within browser windows (interface).
struct box * next
Next sibling box, or NULL.
struct box * parent
Parent box, or NULL.
nscss_len_ctx len_ctx
CSS length conversion context for document.
nserror(* rectangle)(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *rectangle)
Plots a rectangle.
int x
coordinate for top-left of redraw
plot_style_t * plot_style_stroke_darkwbasec
nserror(* line)(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *line)
Plots a line.
plot_style_t const *const plot_style_margin_edge
const char * messages_get_errorcode(nserror code)
lookup of a message by errorcode from the standard Messages hash.
nserror box_handle_scrollbars(struct content *c, struct box *box, bool bottom, bool right)
Applies the given scroll setup to a box.
bool content_get_opaque(hlcache_handle *h)
Determine if a content is opaque from handle.
plot_style_t const *const plot_style_content_edge
plot_style_t * plot_style_fill_lightwbasec
bool repeat_x
whether content is tiled in x direction
int html_redraw_printing_border
nserror(* arc)(const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius, int angle1, int angle2)
Plots an arc.
plot_style_t * plot_style_fill_wblobc
static bool html_redraw_file(int x, int y, int width, int height, struct box *box, float scale, colour background_colour, const nscss_len_ctx *len_ctx, const struct redraw_context *ctx)
Plot a file upload input.
Data specific to CONTENT_HTML.
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
Interface to core interface table.
nserror(* text)(const struct redraw_context *ctx, const plot_font_style_t *fstyle, int x, int y, const char *text, size_t length)
Text plotting.
css_computed_style * style
Style for this box.
float scale
Scale for redraw (for scaling contents without intrinsic dimensions)
colour background_colour
Document background colour.
struct netsurf_table * guit
The global interface table.
#define NOF_ELEMENTS(array)
Protected interface to Content handling.
static bool html_redraw_text_decoration_block(struct box *box, int x, int y, float scale, colour colour, float ratio, const struct redraw_context *ctx)
Plot text decoration for an non-inline box.
bool repeat_y
whether content is tiled in y direction
struct box * inline_end
INLINE_END box corresponding to this INLINE box, or INLINE box corresponding to this INLINE_END box...
#define nsoption_bool(OPTION)
Get the value of a boolean option.
void font_plot_style_from_css(const nscss_len_ctx *len_ctx, const css_computed_style *css, plot_font_style_t *fstyle)
Populate a font style using data from a computed CSS style.
static bool html_redraw_text_box(const html_content *html, struct box *box, int x, int y, const struct rect *clip, float scale, colour current_background_color, const struct redraw_context *ctx)
Redraw the text content of a box, possibly partially highlighted because the text has been selected...
struct browser_window * iframe
Iframe's browser_window, or NULL if none.
struct gui_layout_table * layout
Layout table.
#define nscss_color_is_transparent(color)
Determine if a CSS color primitive is transparent.