364f92da3a6700042fb2abb778410daa529277b1
[crypto.git] / apps / irssi / src / fe-text / gui-entry.h
1 #ifndef __GUI_ENTRY_H
2 #define __GUI_ENTRY_H
3
4 typedef struct {
5         GString *text;
6         int xpos, ypos, width; /* entry position in screen */
7         int pos, scrstart, scrpos; /* cursor position */
8         int hidden; /* print the chars as spaces in input line (useful for passwords) */
9
10         int promptlen;
11         char *prompt;
12
13         int redraw_needed_from;
14         unsigned int utf8:1;
15 } GUI_ENTRY_REC;
16
17 extern GUI_ENTRY_REC *active_entry;
18
19 GUI_ENTRY_REC *gui_entry_create(int xpos, int ypos, int width, int utf8);
20 void gui_entry_destroy(GUI_ENTRY_REC *entry);
21
22 void gui_entry_move(GUI_ENTRY_REC *entry, int xpos, int ypos, int width);
23 void gui_entry_set_active(GUI_ENTRY_REC *entry);
24
25 void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str);
26 void gui_entry_set_hidden(GUI_ENTRY_REC *entry, int hidden);
27 void gui_entry_set_utf8(GUI_ENTRY_REC *entry, int utf8);
28
29 void gui_entry_set_text(GUI_ENTRY_REC *entry, const char *str);
30 char *gui_entry_get_text(GUI_ENTRY_REC *entry);
31
32 void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str);
33 void gui_entry_insert_char(GUI_ENTRY_REC *entry, char chr);
34
35 void gui_entry_erase(GUI_ENTRY_REC *entry, int size);
36 void gui_entry_erase_word(GUI_ENTRY_REC *entry, int to_space);
37 void gui_entry_erase_next_word(GUI_ENTRY_REC *entry, int to_space);
38
39 int gui_entry_get_pos(GUI_ENTRY_REC *entry);
40 void gui_entry_set_pos(GUI_ENTRY_REC *entry, int pos);
41 void gui_entry_move_pos(GUI_ENTRY_REC *entry, int pos);
42 void gui_entry_move_words(GUI_ENTRY_REC *entry, int count, int to_space);
43
44 void gui_entry_redraw(GUI_ENTRY_REC *entry);
45
46 #endif