Added SILC Thread Queue API
[runtime.git] / apps / irssi / src / fe-text / gui-entry.h
1 #ifndef __GUI_ENTRY_H
2 #define __GUI_ENTRY_H
3
4 typedef struct {
5         int text_len, text_alloc; /* as shorts, not chars */
6         unichar *text;
7
8         int cutbuffer_len;
9         unichar *cutbuffer;
10
11         /* all as shorts, not chars */
12         int xpos, ypos, width; /* entry position in screen */
13         int pos, scrstart, scrpos; /* cursor position */
14         int hidden; /* print the chars as spaces in input line (useful for passwords) */
15
16         int promptlen;
17         char *prompt;
18
19         int redraw_needed_from;
20         unsigned int utf8:1;
21 } GUI_ENTRY_REC;
22
23 extern GUI_ENTRY_REC *active_entry;
24
25 GUI_ENTRY_REC *gui_entry_create(int xpos, int ypos, int width, int utf8);
26 void gui_entry_destroy(GUI_ENTRY_REC *entry);
27
28 void gui_entry_move(GUI_ENTRY_REC *entry, int xpos, int ypos, int width);
29 void gui_entry_set_active(GUI_ENTRY_REC *entry);
30
31 void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str);
32 void gui_entry_set_hidden(GUI_ENTRY_REC *entry, int hidden);
33 void gui_entry_set_utf8(GUI_ENTRY_REC *entry, int utf8);
34
35 void gui_entry_set_text(GUI_ENTRY_REC *entry, const char *str);
36 char *gui_entry_get_text(GUI_ENTRY_REC *entry);
37 char *gui_entry_get_text_and_pos(GUI_ENTRY_REC *entry, int *pos);
38
39 void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str);
40 void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr);
41
42 char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry);
43 void gui_entry_erase_to(GUI_ENTRY_REC *entry, int pos, int update_cutbuffer);
44 void gui_entry_erase(GUI_ENTRY_REC *entry, int size, int update_cutbuffer);
45 void gui_entry_erase_word(GUI_ENTRY_REC *entry, int to_space);
46 void gui_entry_erase_next_word(GUI_ENTRY_REC *entry, int to_space);
47
48 void gui_entry_transpose_chars(GUI_ENTRY_REC *entry);
49 void gui_entry_transpose_words(GUI_ENTRY_REC *entry);
50
51 void gui_entry_capitalize_word(GUI_ENTRY_REC *entry);
52 void gui_entry_downcase_word(GUI_ENTRY_REC *entry);
53 void gui_entry_upcase_word(GUI_ENTRY_REC *entry);
54
55 int gui_entry_get_pos(GUI_ENTRY_REC *entry);
56 void gui_entry_set_pos(GUI_ENTRY_REC *entry, int pos);
57 void gui_entry_move_pos(GUI_ENTRY_REC *entry, int pos);
58 void gui_entry_move_words(GUI_ENTRY_REC *entry, int count, int to_space);
59
60 void gui_entry_redraw(GUI_ENTRY_REC *entry);
61
62 #endif