2000-04-26 04:03:38 -04:00
|
|
|
#ifndef __GUI_ENTRY_H
|
|
|
|
#define __GUI_ENTRY_H
|
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
typedef struct {
|
|
|
|
GString *text;
|
|
|
|
int xpos, ypos, width; /* entry position in screen */
|
|
|
|
int pos, scrstart, scrpos; /* cursor position */
|
|
|
|
int hidden; /* print the chars as spaces in input line (useful for passwords) */
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
int promptlen;
|
2001-10-28 13:40:12 -05:00
|
|
|
char *prompt;
|
|
|
|
|
|
|
|
int redraw_needed_from;
|
2001-10-13 12:11:13 -04:00
|
|
|
} GUI_ENTRY_REC;
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
extern GUI_ENTRY_REC *active_entry;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
GUI_ENTRY_REC *gui_entry_create(int xpos, int ypos, int width);
|
|
|
|
void gui_entry_destroy(GUI_ENTRY_REC *entry);
|
|
|
|
void gui_entry_move(GUI_ENTRY_REC *entry, int xpos, int ypos, int width);
|
2000-06-14 14:02:13 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
void gui_entry_set_active(GUI_ENTRY_REC *entry);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str);
|
|
|
|
void gui_entry_set_hidden(GUI_ENTRY_REC *entry, int hidden);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
void gui_entry_set_text(GUI_ENTRY_REC *entry, const char *str);
|
|
|
|
char *gui_entry_get_text(GUI_ENTRY_REC *entry);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str);
|
|
|
|
void gui_entry_insert_char(GUI_ENTRY_REC *entry, char chr);
|
|
|
|
|
|
|
|
void gui_entry_erase(GUI_ENTRY_REC *entry, int size);
|
2001-10-14 07:32:06 -04:00
|
|
|
void gui_entry_erase_word(GUI_ENTRY_REC *entry, int to_space);
|
|
|
|
void gui_entry_erase_next_word(GUI_ENTRY_REC *entry, int to_space);
|
2001-10-13 12:11:13 -04:00
|
|
|
|
|
|
|
int gui_entry_get_pos(GUI_ENTRY_REC *entry);
|
|
|
|
void gui_entry_set_pos(GUI_ENTRY_REC *entry, int pos);
|
|
|
|
void gui_entry_move_pos(GUI_ENTRY_REC *entry, int pos);
|
2001-10-25 10:39:36 -04:00
|
|
|
void gui_entry_move_words(GUI_ENTRY_REC *entry, int count, int to_space);
|
2001-10-13 12:11:13 -04:00
|
|
|
|
|
|
|
void gui_entry_redraw(GUI_ENTRY_REC *entry);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
#endif
|