mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +03:00
Textarea: Add API to access current textarea contents.
This commit is contained in:
parent
4d84222654
commit
2a294adfb1
@ -2073,6 +2073,17 @@ int textarea_get_text(struct textarea *ta, char *buf, unsigned int len)
|
||||
}
|
||||
|
||||
|
||||
/* exported interface, documented in textarea.h */
|
||||
const char * textarea_data(struct textarea *ta, unsigned int *len)
|
||||
{
|
||||
if (len != NULL) {
|
||||
*len = ta->text.len;
|
||||
}
|
||||
|
||||
return ta->text.data;
|
||||
}
|
||||
|
||||
|
||||
/* exported interface, documented in textarea.h */
|
||||
bool textarea_set_caret(struct textarea *ta, int caret)
|
||||
{
|
||||
|
@ -212,6 +212,16 @@ bool textarea_drop_text(struct textarea *ta, const char *text,
|
||||
int textarea_get_text(struct textarea *ta, char *buf, unsigned int len);
|
||||
|
||||
|
||||
/**
|
||||
* Access text data in a text area
|
||||
*
|
||||
* \param[in] ta Text area
|
||||
* \param[out] len Returns byte length of returned text, if passed non-NULL.
|
||||
* \return textarea string data.
|
||||
*/
|
||||
const char * textarea_data(struct textarea *ta, unsigned int *len);
|
||||
|
||||
|
||||
/**
|
||||
* Set the caret's position
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user