78 for (next_input = gadget->
next;
84 next_input = next_input->
next)
87 if (next_input != NULL) {
99 for (prev_input = gadget->
prev;
105 prev_input = prev_input->
prev)
108 if (prev_input != NULL) {
175 "Drag type %d not handled.",
219 sel_owner.
none =
true;
227 if (html->
bw == NULL)
234 focus_owner,
true, 0, 0, 0, NULL);
258 struct box *
box,
struct dom_node *node)
260 dom_string *dom_text = NULL;
272 bool read_only =
false;
273 bool disabled =
false;
277 assert(gadget != NULL);
283 dom_html_text_area_element *
textarea =
284 (dom_html_text_area_element *)
node;
287 err = dom_html_text_area_element_get_read_only(
289 if (err != DOM_NO_ERR)
292 err = dom_html_text_area_element_get_disabled(
294 if (err != DOM_NO_ERR)
298 err = dom_html_text_area_element_get_value(
textarea, &dom_text);
299 if (err != DOM_NO_ERR)
303 dom_html_input_element *input = (dom_html_input_element *)
node;
305 err = dom_html_input_element_get_read_only(
307 if (err != DOM_NO_ERR)
310 err = dom_html_input_element_get_disabled(
312 if (err != DOM_NO_ERR)
321 err = dom_html_input_element_get_value(input, &dom_text);
322 if (err != DOM_NO_ERR)
326 if (dom_text != NULL) {
327 text = dom_string_data(dom_text);
340 ta_setup.
width = 200;
350 ta_setup.
text = fstyle;
358 gadget->
data.text.initial = dom_text;
363 if (gadget->
data.text.ta == NULL) {
void box_coords(struct box *box, int *x, int *y)
Find the absolute coordinates of a box.
HTML Box tree inspection interface.
bool box_textarea_create_textarea(html_content *html, struct box *box, struct dom_node *node)
Create textarea widget for a form element.
nserror box_textarea_keypress(html_content *html, struct box *box, uint32_t key)
Handle form textarea keypress input.
static void box_textarea_callback(void *data, struct textarea_msg *msg)
Callback for html form textareas.
Box tree treeview box replacement (interface).
char * strndup(const char *s, size_t n)
Duplicate up to n characters of a string.
Internal font handling interfaces.
void content__request_redraw(struct content *c, int x, int y, int width, int height)
Request a redraw of an area of a content.
nsurl * content_get_url(struct content *c)
Retrieve URL associated with content.
struct textarea * textarea_create(const textarea_flags flags, const textarea_setup *setup, textarea_client_callback callback, void *data)
Create a text area.
bool textarea_set_caret(struct textarea *ta, int caret)
Set the caret's position.
bool textarea_set_text(struct textarea *ta, const char *text)
Set the text in a text area, discarding any current text.
bool textarea_keypress(struct textarea *ta, uint32_t key)
Key press handling for text areas.
Single/Multi-line UTF-8 text area interface.
textarea_flags
Text area flags.
@ TEXTAREA_PASSWORD
Obscured display.
@ TEXTAREA_DEFAULT
Standard input.
@ TEXTAREA_READONLY
Non-editable.
@ TEXTAREA_MULTILINE
Multiline area.
@ TEXTAREA_DRAG_SCROLLBAR
@ TEXTAREA_DRAG_SELECTION
@ TEXTAREA_MSG_SELECTION_REPORT
Textarea text selection presence.
@ TEXTAREA_MSG_TEXT_MODIFIED
Textarea text modified.
@ TEXTAREA_MSG_DRAG_REPORT
Textarea drag start/end report.
@ TEXTAREA_MSG_REDRAW_REQUEST
Textarea redraw request.
@ TEXTAREA_MSG_CARET_UPDATE
Textarea caret.
nserror
Enumeration of error codes.
@ NSERROR_INVALID
Invalid data.
Interface to platform-specific miscellaneous browser operation table.
void html_set_drag_type(html_content *html, html_drag_type drag_type, union html_drag_owner drag_owner, const struct rect *rect)
Set our drag status, and inform whatever owns the content.
void html_set_focus(html_content *html, html_focus_type focus_type, union html_focus_owner focus_owner, bool hide_caret, int x, int y, int height, const struct rect *clip)
Set our input focus, and inform whatever owns the content.
void html_set_selection(html_content *html, html_selection_type selection_type, union html_selection_owner selection_owner, bool read_only)
Set our selection status, and inform whatever owns the content.
HTML content user interaction handling.
Interface to key press operations.
#define NSLOG(catname, level, logmsg, args...)
Localised message support (interface).
#define colour_to_bw_furthest(c0)
@ PLOT_FONT_FAMILY_SANS_SERIF
#define NS_TRANSPARENT
Transparent colour value.
#define PLOT_STYLE_SCALE
Scaling factor for plot styles.
Private data for text/html content.
@ HTML_DRAG_TEXTAREA_SELECTION
Not own; drag in scrollbar widget.
@ HTML_DRAG_TEXTAREA_SCROLLBAR
Not own; drag in textarea widget.
@ HTML_FOCUS_TEXTAREA
Focus belongs to textarea.
@ HTML_SELECTION_TEXTAREA
No selection.
Interface to utility string handling.
struct form_control * gadget
Form control data, or NULL if not a form control.
Content which corresponds to a single URL.
struct form_control * gadget
Data specific to CONTENT_HTML.
struct browser_window * bw
Browser window containing this document, or NULL if not open.
bool reflowing
Whether a layout (reflow) is in progress.
plot_font_generic_family_t family
Generic family to plot with.
colour foreground
Colour of text.
colour background
Background colour to blend to, if appropriate.
struct textarea_msg::@79::@81 caret
With _CARET_UPDATE.
unsigned int len
Byte length of text.
struct textarea_msg::@79::@80 selection
With _SELECTION_REPORT.
struct textarea_msg::@79::@81::@84 pos
With _CARET_SET_POS.
bool read_only
Selection can't be cut.
const char * text
UTF8 text.
textarea_msg_type type
Indicates message data type.
struct rect redraw
With _REDRAW_REQUEST.
struct textarea_msg::@79::@82 modified
With _TEXT_MODIFIED.
union textarea_msg::@79 data
Depends on msg type.
bool have_selection
Selection exists.
textarea_drag_type drag
With _DRAG_REPORT.
struct rect * clip
Caret clip rect.
textarea setup parameters
int pad_top
Textarea top padding.
colour border_col
Textarea border colour.
int height
Textarea height.
int border_width
Textarea border width.
int pad_right
Textarea right padding.
int pad_left
Textarea left padding.
plot_font_style_t text
Textarea background colour and font.
int pad_bottom
Textarea bottom padding.
colour selected_text
Textarea selected text colour.
colour selected_bg
Textarea selection background colour.
For getting at selections in this content or things in this content.
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.