63#define MAX_SELECT_HEIGHT 210
64#define SELECT_LINE_SPACING 0.2
65#define SELECT_BORDER_WIDTH 1
66#define SELECT_SELECTED_COLOUR 0xDB9370
88 .background = 0xffffff,
89 .foreground = 0x000000,
110 const char *fallback)
116 if (!item || !charset)
119 snprintf(cset,
sizeof cset,
"%s//TRANSLIT", charset);
124 snprintf(cset,
sizeof cset,
"%s", charset);
130 snprintf(cset,
sizeof cset,
131 "%s//TRANSLIT", fallback);
136 snprintf(cset,
sizeof cset,
165#define FETCH_DATA_INT_VALUE_SIZE 20
185 fetch_data = calloc(1,
sizeof(*fetch_data));
186 if (fetch_data == NULL) {
187 NSLOG(netsurf, INFO,
"failed allocation for fetch data");
192 keysize = snprintf(fetch_data->
name, 0,
"%s%s",
name, ksfx);
193 fetch_data->
name = malloc(keysize + 1);
194 if (fetch_data->
name == NULL) {
197 "keyname allocation failure for %s%s",
name, ksfx);
200 snprintf(fetch_data->
name, keysize + 1,
"%s%s",
name, ksfx);
204 if (fetch_data->
value == NULL) {
205 free(fetch_data->
name);
207 NSLOG(netsurf, INFO,
"value allocation failure");
213 **fetch_data_next_ptr = fetch_data;
214 *fetch_data_next_ptr = &fetch_data->
next;
235 const char *form_charset,
236 const char *docu_charset,
241 assert(
name != NULL);
243 fetch_data = calloc(1,
sizeof(*fetch_data));
244 if (fetch_data == NULL) {
245 NSLOG(netsurf, INFO,
"failed allocation for fetch data");
250 dom_string_byte_length(
name),
253 if (fetch_data->
name == NULL) {
254 NSLOG(netsurf, INFO,
"Could not encode name for fetch data");
260 fetch_data->
value = strdup(
"");
263 dom_string_byte_length(
value),
267 if (fetch_data->
value == NULL) {
268 NSLOG(netsurf, INFO,
"Could not encode value for fetch data");
269 free(fetch_data->
name);
276 fetch_data->
file =
true;
278 if (fetch_data->
rawfile == NULL) {
280 "Could not encode rawfile value for fetch data");
281 free(fetch_data->
value);
282 free(fetch_data->
name);
289 **fetch_data_next_ptr = fetch_data;
290 *fetch_data_next_ptr = &fetch_data->
next;
307 const char *form_charset,
308 const char *doc_charset,
312 bool element_disabled;
313 dom_string *inputname;
314 dom_string *inputvalue;
318 exp = dom_html_text_area_element_get_disabled(text_area_element,
320 if (exp != DOM_NO_ERR) {
322 "Could not get text area disabled property. exp %d", exp);
326 if (element_disabled) {
332 exp = dom_html_text_area_element_get_name(text_area_element,
334 if (exp != DOM_NO_ERR) {
336 "Could not get text area name property. exp %d", exp);
340 if (inputname == NULL) {
346 exp = dom_html_text_area_element_get_value(text_area_element,
348 if (exp != DOM_NO_ERR) {
350 "Could not get text area content. exp %d", exp);
351 dom_string_unref(inputname);
361 fetch_data_next_ptr);
363 dom_string_unref(inputvalue);
364 dom_string_unref(inputname);
373 const char *form_charset,
374 const char *docu_charset,
382 exp = dom_html_option_element_get_selected(option_element, &selected);
383 if (exp != DOM_NO_ERR) {
384 NSLOG(netsurf, INFO,
"Could not get option selected property");
393 exp = dom_html_option_element_get_value(option_element, &
value);
394 if (exp != DOM_NO_ERR) {
395 NSLOG(netsurf, INFO,
"Could not get option value");
405 fetch_data_next_ptr);
407 dom_string_unref(
value);
424 const char *form_charset,
425 const char *doc_charset,
430 bool element_disabled;
431 dom_string *inputname;
432 dom_html_options_collection *
options = NULL;
433 uint32_t options_count;
434 uint32_t option_index;
435 dom_node *option_element = NULL;
438 exp = dom_html_select_element_get_disabled(select_element,
440 if (exp != DOM_NO_ERR) {
442 "Could not get select disabled property. exp %d", exp);
446 if (element_disabled) {
452 exp = dom_html_select_element_get_name(select_element, &inputname);
453 if (exp != DOM_NO_ERR) {
455 "Could not get select name property. exp %d", exp);
459 if (inputname == NULL) {
465 exp = dom_html_select_element_get_options(select_element, &
options);
466 if (exp != DOM_NO_ERR) {
468 "Could not get select options collection");
469 dom_string_unref(inputname);
474 exp = dom_html_options_collection_get_length(
options, &options_count);
475 if (exp != DOM_NO_ERR) {
477 "Could not get select options collection length");
478 dom_html_options_collection_unref(
options);
479 dom_string_unref(inputname);
484 for (option_index = 0; option_index < options_count; ++option_index) {
485 exp = dom_html_options_collection_item(
options,
488 if (exp != DOM_NO_ERR) {
490 "Could not get options item %"PRId32, option_index);
494 (dom_html_option_element *)option_element,
498 fetch_data_next_ptr);
500 dom_node_unref(option_element);
508 dom_html_options_collection_unref(
options);
509 dom_string_unref(inputname);
517 dom_string *inputname,
519 const char *document_charset,
520 dom_html_element **submit_button,
524 dom_string *inputvalue;
527 if (*submit_button == NULL) {
529 *submit_button = (dom_html_element *)input_element;
530 }
else if (*submit_button != (dom_html_element *)input_element) {
535 exp = dom_html_input_element_get_value(input_element, &inputvalue);
536 if (exp != DOM_NO_ERR) {
537 NSLOG(netsurf, INFO,
"Could not get submit button value");
547 fetch_data_next_ptr);
549 dom_string_unref(inputvalue);
557 dom_string *inputname,
559 const char *document_charset,
560 dom_html_element **submit_button,
569 if (*submit_button != (dom_html_element *)input_element) {
573 exp = dom_node_get_user_data((dom_node *)input_element,
574 corestring_dom___ns_key_image_coords_node_data,
576 if (exp != DOM_NO_ERR) {
577 NSLOG(netsurf, INFO,
"Could not get image XY data");
581 if (coords == NULL) {
582 NSLOG(netsurf, INFO,
"No XY data on the image input");
588 dom_string_byte_length(inputname),
591 if (basename == NULL) {
592 NSLOG(netsurf, INFO,
"Could not encode basename");
598 fetch_data_next_ptr);
603 fetch_data_next_ptr);
614 dom_string *inputname,
616 const char *document_charset,
622 dom_string *inputvalue;
624 exp = dom_html_input_element_get_checked(input_element, &checked);
625 if (exp != DOM_NO_ERR) {
627 "Could not get input element checked");
636 exp = dom_html_input_element_get_value(input_element, &inputvalue);
637 if (exp != DOM_NO_ERR) {
639 "Could not get input element value");
644 if (inputvalue == NULL) {
645 inputvalue = dom_string_ref(corestring_dom_on);
654 fetch_data_next_ptr);
656 dom_string_unref(inputvalue);
664 dom_string *inputname,
666 const char *document_charset,
671 dom_string *inputvalue;
672 const char *rawfile = NULL;
674 exp = dom_html_input_element_get_value(input_element, &inputvalue);
675 if (exp != DOM_NO_ERR) {
676 NSLOG(netsurf, INFO,
"Could not get file value");
680 exp = dom_node_get_user_data((dom_node *)input_element,
681 corestring_dom___ns_key_file_name_node_data,
683 if (exp != DOM_NO_ERR) {
684 NSLOG(netsurf, INFO,
"Could not get file rawname");
688 if (rawfile == NULL) {
698 fetch_data_next_ptr);
700 dom_string_unref(inputvalue);
708 dom_string *inputname,
710 const char *document_charset,
715 dom_string *inputvalue;
717 exp = dom_html_input_element_get_value(input_element, &inputvalue);
718 if (exp != DOM_NO_ERR) {
719 NSLOG(netsurf, INFO,
"Could not get input value");
729 fetch_data_next_ptr);
731 dom_string_unref(inputvalue);
752 const char *document_charset,
753 dom_html_element **submit_button,
757 bool element_disabled;
758 dom_string *inputname;
759 dom_string *inputtype;
763 exp = dom_html_input_element_get_disabled(input_element,
765 if (exp != DOM_NO_ERR) {
767 "Could not get input disabled property. exp %d", exp);
771 if (element_disabled) {
777 exp = dom_html_input_element_get_name(input_element, &inputname);
778 if (exp != DOM_NO_ERR) {
780 "Could not get input name property. exp %d", exp);
784 if (inputname == NULL) {
790 exp = dom_html_input_element_get_type(input_element, &inputtype);
791 if (exp != DOM_NO_ERR) {
792 NSLOG(netsurf, INFO,
"Could not get input element type");
793 dom_string_unref(inputname);
798 if (dom_string_caseless_isequal(inputtype, corestring_dom_submit)) {
805 fetch_data_next_ptr);
807 }
else if (dom_string_caseless_isequal(inputtype,
808 corestring_dom_image)) {
815 fetch_data_next_ptr);
817 }
else if (dom_string_caseless_isequal(inputtype,
818 corestring_dom_radio) ||
819 dom_string_caseless_isequal(inputtype,
820 corestring_dom_checkbox)) {
826 fetch_data_next_ptr);
828 }
else if (dom_string_caseless_isequal(inputtype,
829 corestring_dom_file)) {
835 fetch_data_next_ptr);
837 }
else if (dom_string_caseless_isequal(inputtype,
838 corestring_dom_reset) ||
839 dom_string_caseless_isequal(inputtype,
840 corestring_dom_button)) {
842 NSLOG(netsurf, INFO,
"Skipping RESET and BUTTON");
851 fetch_data_next_ptr);
855 dom_string_unref(inputtype);
856 dom_string_unref(inputname);
876 const char *form_charset,
877 const char *doc_charset,
878 dom_html_element **submit_button,
882 bool element_disabled;
883 dom_string *inputname;
884 dom_string *inputvalue;
885 dom_string *inputtype;
889 exp = dom_html_button_element_get_disabled(button_element,
891 if (exp != DOM_NO_ERR) {
893 "Unable to get disabled property. exp %d", exp);
897 if (element_disabled) {
903 exp = dom_html_button_element_get_type(button_element, &inputtype);
904 if (exp != DOM_NO_ERR) {
905 NSLOG(netsurf, INFO,
"Could not get button element type");
914 if (dom_string_caseless_isequal(inputtype, corestring_dom_reset)) {
916 dom_string_unref(inputtype);
919 if (dom_string_caseless_isequal(inputtype, corestring_dom_button)) {
921 dom_string_unref(inputtype);
924 dom_string_unref(inputtype);
927 if (*submit_button == NULL) {
929 *submit_button = (dom_html_element *)button_element;
931 if (*submit_button != (dom_html_element *)button_element) {
936 exp = dom_html_button_element_get_name(button_element, &inputname);
937 if (exp != DOM_NO_ERR) {
939 "Could not get button name property. exp %d", exp);
943 if (inputname == NULL) {
949 exp = dom_html_button_element_get_value(button_element, &inputvalue);
950 if (exp != DOM_NO_ERR) {
951 NSLOG(netsurf, INFO,
"Could not get submit button value");
959 fetch_data_next_ptr);
961 dom_string_unref(inputvalue);
964 dom_string_unref(inputname);
987 return strdup(
"ISO-8859-1");
997 for (c = temp; *c; c++) {
1002 c = strstr(temp,
"UTF-8");
1005 return strdup(
"UTF-8");
1061 dom_html_collection *elements = NULL;
1062 uint32_t element_count;
1063 uint32_t element_idx;
1064 dom_node *element = NULL;
1065 dom_string *nodename = NULL;
1068 dom_html_element *submit_button;
1071 if (submit_control != NULL) {
1072 submit_button = submit_control->
node;
1074 submit_button = NULL;
1079 if (charset == NULL) {
1080 NSLOG(netsurf, INFO,
"failed to find charset");
1085 exp = dom_html_form_element_get_elements(
form->
node, &elements);
1086 if (exp != DOM_NO_ERR) {
1087 NSLOG(netsurf, INFO,
"Could not get form elements");
1092 exp = dom_html_collection_get_length(elements, &element_count);
1093 if (exp != DOM_NO_ERR) {
1094 NSLOG(netsurf, INFO,
"Could not get form element count");
1096 goto form_dom_to_data_error;
1099 for (element_idx = 0; element_idx < element_count; element_idx++) {
1101 exp = dom_html_collection_item(elements, element_idx, &element);
1102 if (exp != DOM_NO_ERR) {
1103 NSLOG(netsurf, INFO,
1104 "retrieving form element %"PRIu32
" failed with %d",
1107 goto form_dom_to_data_error;
1111 exp = dom_node_get_node_name(element, &nodename);
1112 if (exp != DOM_NO_ERR) {
1113 NSLOG(netsurf, INFO,
1114 "getting element node name %"PRIu32
" failed with %d",
1116 dom_node_unref(element);
1118 goto form_dom_to_data_error;
1121 if (dom_string_isequal(nodename, corestring_dom_TEXTAREA)) {
1124 (dom_html_text_area_element *)element,
1129 }
else if (dom_string_isequal(nodename, corestring_dom_SELECT)) {
1132 (dom_html_select_element *)element,
1137 }
else if (dom_string_isequal(nodename, corestring_dom_INPUT)) {
1140 (dom_html_input_element *)element,
1146 }
else if (dom_string_isequal(nodename, corestring_dom_BUTTON)) {
1149 (dom_html_button_element *)element,
1157 NSLOG(netsurf, INFO,
1158 "Unhandled element type: %*s",
1159 (
int)dom_string_byte_length(nodename),
1160 dom_string_data(nodename));
1165 dom_string_unref(nodename);
1166 dom_node_unref(element);
1170 goto form_dom_to_data_error;
1174 *fetch_data_out = fetch_data;
1175 dom_html_collection_unref(elements);
1180form_dom_to_data_error:
1182 dom_html_collection_unref(elements);
1203 unsigned int len, len1, len_init;
1215 for (; control; control = control->
next) {
1232 len1 = len + strlen(
name) + strlen(
value) + 2;
1233 s2 = realloc(s, len1 + 1);
1242 snprintf(s + len, (len1 + 1) - len,
"%s=%s&",
name,
value);
1248 if (len > len_init) {
1270 switch (scrollbar_data->
msg) {
1280 .
x0 = scrollbar_data->
x0,
1281 .y0 = scrollbar_data->
y0,
1282 .x1 = scrollbar_data->
x1,
1283 .y1 = scrollbar_data->
y1
1317 struct box *inline_box;
1322 assert(control != NULL);
1323 assert(html != NULL);
1332 for (
count = 0, o = control->
data.select.items;
1337 dom_html_option_element_set_selected(o->
node,
false);
1340 if (
count == item) {
1341 if (control->
data.select.multiple) {
1344 dom_html_option_element_set_selected(
1346 control->
data.select.num_selected--;
1349 dom_html_option_element_set_selected(
1351 control->
data.select.num_selected++;
1354 dom_html_option_element_set_selected(
1361 control->
data.select.current = o;
1366 inline_box->
text = 0;
1368 if (control->
data.select.num_selected == 0) {
1371 }
else if (control->
data.select.num_selected == 1) {
1373 control->
data.select.current->text);
1379 if (!inline_box->
text) {
1383 inline_box->
length = strlen(inline_box->
text);
1415 option = control->
data.select.items;
1416 item_bottom_y = line_height_with_spacing;
1418 while (option && item_bottom_y < scroll + y) {
1419 item_bottom_y += line_height_with_spacing;
1420 option = option->
next;
1424 if (option != NULL) {
1446 control->
next = NULL;
1458 assert(control != NULL);
1460 NSLOG(netsurf, INFO,
"Control:%p name:%p value:%p initial:%p",
1462 free(control->
name);
1463 free(control->
value);
1472 for (option = control->
data.select.items; option;
1475 NSLOG(netsurf, INFO,
1476 "select option:%p text:%p value:%p", option,
1479 free(option->
value);
1482 if (control->
data.select.menu != NULL) {
1491 if (control->
data.text.initial != NULL) {
1492 dom_string_unref(control->
data.text.initial);
1495 if (control->
data.text.ta != NULL) {
1501 if (control->
form != NULL) {
1503 if (c->
next == control) {
1537 option = calloc(1,
sizeof *option);
1545 if (control->
data.select.items == 0)
1546 control->
data.select.items = option;
1548 control->
data.select.last_item->next = option;
1549 control->
data.select.last_item = option;
1552 if (
selected && (control->
data.select.num_selected == 0 ||
1553 control->
data.select.multiple)) {
1555 control->
data.select.num_selected++;
1556 control->
data.select.current = option;
1559 control->
data.select.num_items++;
1574 int line_height_with_spacing;
1583 if (control->
data.select.menu == NULL) {
1590 control->
data.select.menu = menu;
1602 menu->
line_height = FIXTOINT(FDIV((FMUL(FLTTOFIX(1.2),
1611 total_height = control->
data.select.num_items *
1612 line_height_with_spacing;
1613 menu->
height = total_height;
1629 control->
data.select.menu = NULL;
1635 menu = control->
data.select.menu;
1647 if (control->
data.select.menu->scrollbar != NULL)
1649 free(control->
data.select.menu);
1650 control->
data.select.menu = NULL;
1667 int x0, y0, x1, scrollbar_x, y1, y2, y3;
1669 int text_pos_offset, text_x;
1695 scrollbar_width *= scale;
1697 i = scroll / line_height_with_spacing;
1698 scroll -= i * line_height_with_spacing;
1700 line_height_with_spacing *= scale;
1702 scroll += i * line_height_with_spacing;
1710 scrollbar_x =
x1 - scrollbar_width;
1750 option = control->
data.select.items;
1751 item_y = line_height_with_spacing;
1753 while (item_y < scroll) {
1754 option = option->
next;
1755 item_y += line_height_with_spacing;
1757 item_y -= line_height_with_spacing;
1758 text_pos_offset = y - scroll +
1764 while (option && item_y - scroll <
height) {
1767 y2 = y + item_y - scroll;
1768 y3 = y + item_y + line_height_with_spacing - scroll;
1772 rect.
x1 = scrollbar_x + 1;
1780 y2 = text_pos_offset + item_y;
1784 option->
text, strlen(option->
text));
1789 item_y += line_height_with_spacing;
1790 option = option->
next;
1823 if (
clip->x0 >= 0 &&
1836 assert(control != NULL);
1848 opt = control->
data.select.items;
1849 while ((opt != NULL) && (item > 0)) {
1860 return control->
name;
1879 int x0, y0, x1, y1, scrollbar_x;
1880 const char *status = NULL;
1881 bool multiple = control->
data.select.multiple;
1890 (x > scrollbar_x && x < x1 && y > y0 && y < y1)) {
1901 if (x > x0 && x < scrollbar_x && y > y0 && y < y1) {
1912 "SelectMClick" :
"SelectClick");
1957 if (x > x0 && x < x1 - SCROLLBAR_WIDTH && y > y0 && y < y1) {
1968 *
width = control->
data.select.menu->width;
2009 control = control->
next) {
2015 if (control == radio)
2023 if ((control->
name == NULL) ||
2024 (radio->
name == NULL) ||
2025 (control->
name[0] ==
'\0') ||
2026 (radio->
name[0] ==
'\0') ||
2027 strcmp(control->
name, radio->
name) != 0)
2034 dom_html_input_element_set_checked(control->
node,
false);
2040 dom_html_input_element_set_checked(radio->
node,
true);
2058 assert(
form != NULL);
2130 switch (control->
type) {
2136 if (control->
value != NULL) {
2137 free(control->
value);
2140 if (control->
node != NULL) {
2143 err = dom_string_create((uint8_t *)
value,
2144 strlen(
value), &str);
2145 if (err == DOM_NO_ERR) {
2147 err = dom_html_text_area_element_set_value(
2148 (dom_html_text_area_element *)(control->
node),
2151 err = dom_html_input_element_set_value(
2152 (dom_html_input_element *)(control->
node),
2154 dom_string_unref(str);
2173 dom_string *
value = NULL;
2174 bool changed_dom =
false;
2191 control->
value != NULL &&
2192 control->
value[0] !=
'\0') ||
2194 control->
value != NULL &&
2196 char *dup = strdup(control->
value);
2204 exc = dom_string_create((uint8_t *)(control->
value),
2206 if (exc != DOM_NO_ERR) {
2215 exc = dom_html_text_area_element_set_value(control->
node, control->
node_value);
2217 exc = dom_html_input_element_set_value(control->
node, control->
node_value);
2219 if (exc != DOM_NO_ERR) {
2227 exc = dom_html_text_area_element_get_value(control->
node, &
value);
2229 exc = dom_html_input_element_get_value(control->
node, &
value);
2232 if (exc != DOM_NO_ERR) {
2242 dom_string_data(
value),
2243 dom_string_byte_length(
value));
2245 if (value_s == NULL) {
2248 dup = strdup(value_s);
2253 free(control->
value);
2254 control->
value = value_s;
2258 control->
data.text.ta != NULL) {
2269 dom_string_unref(
value);
2280 const char *charset,
2281 const char *doc_charset)
2353 control = calloc(1,
sizeof *control);
2354 if (control == NULL)
Helpers for ASCII string handling.
static char ascii_to_upper(char c)
Convert a lower case character to upper case.
static bool ascii_is_space(char c)
Test whether a character is a whitespace character.
void box_coords(struct box *box, int *x, int *y)
Find the absolute coordinates of a box.
void box_bounds(struct box *box, struct rect *r)
Find the bounds of a box.
HTML Box tree inspection interface.
Browser window creation and manipulation interface.
@ DRAGGING_CONTENT_SCROLLBAR
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
void browser_window_set_drag_type(struct browser_window *bw, browser_drag_type type, const struct rect *rect)
Set drag type for a browser window, and inform front end.
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
static uint32_t count(const http_directive *list, lwc_string *key)
char * strndup(const char *s, size_t n)
Duplicate up to n characters of a string.
void fetch_multipart_data_destroy(struct fetch_multipart_data *list)
Free a linked list of fetch_multipart_data.
Fetching of data from a URL (interface).
void font_plot_style_from_css(const css_unit_ctx *unit_len_ctx, const css_computed_style *css, plot_font_style_t *fstyle)
Populate a font style using data from a computed CSS style.
Internal font handling interfaces.
static int line_height(const css_unit_ctx *unit_len_ctx, const css_computed_style *style)
Calculate line height from a style.
interface to HTML layout.
void content__request_redraw(struct content *c, int x, int y, int width, int height)
Request a redraw of an area of a content.
Useful interned string pointers (interface).
void textarea_destroy(struct textarea *ta)
Destroy a text area.
bool textarea_set_text(struct textarea *ta, const char *text)
Set the text in a text area, discarding any current text.
Single/Multi-line UTF-8 text area interface.
nserror
Enumeration of error codes.
@ NSERROR_BAD_ENCODING
The character set is unknown.
@ NSERROR_DOM
DOM call returned error.
@ NSERROR_NOMEM
Memory exhaustion.
High-level resource cache interface.
void html__redraw_a_box(struct html_content *html, struct box *box)
Redraw a box.
Interface to text/html content handler.
Interface to platform-specific miscellaneous browser operation table.
Core mouse and pointer states.
browser_mouse_state
Mouse state: 1 is primary mouse button.
@ BROWSER_MOUSE_CLICK_2
button 2 clicked.
@ BROWSER_MOUSE_CLICK_1
button 1 clicked.
Target independent plotting interface.
Netsurf additional integer type formatting macros.
Knockout rendering (interface).
#define NSLOG(catname, level, logmsg, args...)
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Localised message support (interface).
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
nserror nsurl_replace_query(const nsurl *url, const char *query, nsurl **new_url)
Create a NetSurf URL object, with query string replaced.
struct nsurl nsurl
NetSurf URL object.
plot_style_t * plot_style_stroke_darkwbasec
@ PLOT_OP_TYPE_SOLID
Solid colour.
@ PLOT_FONT_FAMILY_SANS_SERIF
#define PLOT_STYLE_SCALE
Scaling factor for plot styles.
plot_style_t * plot_style_fill_lightwbasec
Private data for text/html content.
Interface to utility string handling.
int width
border-width (pixels)
struct box_border border[4]
Border: TOP, RIGHT, BOTTOM, LEFT.
int width
Width of content box (excluding padding etc.).
struct box * children
First child box, or NULL.
int height
Height of content box (excluding padding etc.).
css_computed_style * style
Style for this box.
size_t length
Length of text.
char * text
Text, or NULL if none.
int padding[4]
Padding: TOP, RIGHT, BOTTOM, LEFT.
int x
Coordinate of left padding edge relative to parent box, or relative to ancestor that contains this bo...
int y
Coordinate of top padding edge, relative as for x.
Content which corresponds to a single URL.
Fetch POST multipart data.
char * rawfile
Raw filename if file is true.
struct fetch_multipart_data * next
Next in linked list.
Data specific to CONTENT_HTML.
int * bctx
A talloc context purely for the render box tree.
struct browser_window * bw
Browser window containing this document, or NULL if not open.
struct form_control * visible_select_menu
Open core-handled form SELECT menu, or NULL if none currently open.
css_unit_ctx unit_len_ctx
CSS length conversion context for document.
plot_font_generic_family_t family
Generic family to plot with.
plot_style_fixed size
Font size, in pt.
Plot style for stroke/fill plotters.
plot_operation_type_t fill_type
Fill plot type.
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.
nserror(* rectangle)(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *rectangle)
Plots a rectangle.
nserror(* clip)(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
const struct plotter_table * plot
Current plot operation table.
int talloc_free(void *ptr)
char * talloc_strdup(const void *t, const char *p)
nserror url_escape(const char *unescaped, bool sptoplus, const char *escexceptions, char **result)
Escape a string suitable for inclusion in an URL.
Interface to URL parsing and joining operations.
nserror utf8_to_enc(const char *string, const char *encname, size_t len, char **result)
Convert a UTF8 string into the named encoding.
UTF-8 manipulation functions (interface).
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.
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.