mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-10 21:12:01 +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 */
|
/* exported interface, documented in textarea.h */
|
||||||
bool textarea_set_caret(struct textarea *ta, int caret)
|
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);
|
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
|
* Set the caret's position
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user