NetSurf
textarea.h
Go to the documentation of this file.
1/*
2 * Copyright 2006 John-Mark Bell <jmb202@ecs.soton.ac.uk>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/** \file
20 * Single/Multi-line UTF-8 text area (interface)
21 */
22
23#ifndef _NETSURF_RISCOS_TEXTAREA_H_
24#define _NETSURF_RISCOS_TEXTAREA_H_
25#include <stdbool.h>
26#include <stdint.h>
27#include "rufl.h"
28#include "oslib/wimp.h"
29
30/* Text area flags */
31#define TEXTAREA_MULTILINE 0x01 /**< Text area is multiline */
32#define TEXTAREA_READONLY 0x02 /**< Text area is read only */
33
34uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags,
35 const char *font_family, unsigned int font_size,
36 rufl_style font_style);
37bool ro_textarea_update(uintptr_t self);
38void ro_textarea_destroy(uintptr_t self);
39bool ro_textarea_set_text(uintptr_t self, const char *text);
40int ro_textarea_get_text(uintptr_t self, char *buf, unsigned int len);
41void ro_textarea_insert_text(uintptr_t self, unsigned int index,
42 const char *text);
43void ro_textarea_replace_text(uintptr_t self, unsigned int start,
44 unsigned int end, const char *text);
45void ro_textarea_set_caret(uintptr_t self, unsigned int caret);
46void ro_textarea_set_caret_xy(uintptr_t self, int x, int y);
47unsigned int ro_textarea_get_caret(uintptr_t self);
48
49
50#endif
wimp_w parent
Definition: dialog.c:88
void ro_textarea_replace_text(uintptr_t self, unsigned int start, unsigned int end, const char *text)
Replace text in a text area.
Definition: textarea.c:458
bool ro_textarea_update(uintptr_t self)
Update the a text area following a change in the parent icon.
Definition: textarea.c:218
bool ro_textarea_set_text(uintptr_t self, const char *text)
Set the text in a text area, discarding any current text.
Definition: textarea.c:334
int ro_textarea_get_text(uintptr_t self, char *buf, unsigned int len)
Extract the text from a text area.
Definition: textarea.c:372
unsigned int ro_textarea_get_caret(uintptr_t self)
Get the caret's position.
Definition: textarea.c:677
void ro_textarea_set_caret(uintptr_t self, unsigned int caret)
Set the caret's position.
Definition: textarea.c:529
void ro_textarea_destroy(uintptr_t self)
Destroy a text area.
Definition: textarea.c:305
void ro_textarea_set_caret_xy(uintptr_t self, int x, int y)
Set the caret's position.
Definition: textarea.c:609
uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags, const char *font_family, unsigned int font_size, rufl_style font_style)
Create a text area.
Definition: textarea.c:133
void ro_textarea_insert_text(uintptr_t self, unsigned int index, const char *text)
Insert text into the text area.
Definition: textarea.c:404
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.
Definition: plot.c:978