NetSurf
|
#include <layout.h>
Data Fields | |
nserror(* | width )(const struct plot_font_style *fstyle, const char *string, size_t length, int *width) |
Measure the width of a string. More... | |
nserror(* | position )(const struct plot_font_style *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) |
Find the position in a string where an x coordinate falls. More... | |
nserror(* | split )(const struct plot_font_style *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) |
Find where to split a string to make it fit a width. More... | |
nserror(* gui_layout_table::position) (const struct plot_font_style *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) |
Find the position in a string where an x coordinate falls.
[in] | fstyle | style for this text |
[in] | string | UTF-8 string to measure |
[in] | length | length of string, in bytes |
[in] | x | coordinate to search for |
[out] | char_offset | updated to offset in string of actual_x, [0..length] |
[out] | actual_x | updated to x coordinate of character closest to x |
Definition at line 63 of file layout.h.
Referenced by default_mouse_action(), html_selection_drag_end(), mouse_action_drag_selection(), redraw_entry(), textarea_get_b_off_xy(), textplain_offset_from_coords(), and verify_layout_register().
nserror(* gui_layout_table::split) (const struct plot_font_style *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) |
Find where to split a string to make it fit a width.
[in] | fstyle | style for this text |
[in] | string | UTF-8 string to measure |
[in] | length | length of string, in bytes |
[in] | x | width available |
[out] | char_offset | updated to offset in string of actual_x, [1..length] |
[out] | actual_x | updated to x coordinate of character closest to x |
On exit, char_offset indicates first character after split point.
Returns: char_offset giving split point closest to x, where actual_x <= x else char_offset giving split point closest to x, where actual_x > x
Returning char_offset == length means no split possible
Definition at line 88 of file layout.h.
Referenced by layout_line(), textarea_reflow_multiline(), and verify_layout_register().
nserror(* gui_layout_table::width) (const struct plot_font_style *fstyle, const char *string, size_t length, int *width) |
Measure the width of a string.
[in] | fstyle | plot style for this text |
[in] | string | UTF-8 string to measure |
[in] | length | length of string, in bytes |
[out] | width | updated to width of string[0..length) |
Definition at line 49 of file layout.h.
Referenced by html_redraw_box(), html_redraw_file(), layout_line(), layout_minmax_line(), layout_text_box_split(), page_info__measure_text_entry(), text_draw(), text_redraw(), textarea_redraw(), textarea_reflow_multiline(), textarea_reflow_singleline(), textarea_set_caret_internal(), textplain_coord_from_offset(), textplain_offset_from_coords(), textplain_redraw(), textplain_reformat(), treeview_create(), treeview_insert_node(), treeview_node_expand_internal(), treeview_update_node_entry(), treeview_update_node_folder(), and verify_layout_register().