2000-04-26 08:03:38 +00:00
|
|
|
#ifndef __GUI_ENTRY_H
|
|
|
|
|
#define __GUI_ENTRY_H
|
|
|
|
|
|
2016-03-21 09:14:01 +01:00
|
|
|
typedef struct {
|
|
|
|
|
int cutbuffer_len;
|
|
|
|
|
unichar *cutbuffer;
|
|
|
|
|
} GUI_ENTRY_CUTBUFFER_REC;
|
|
|
|
|
|
2001-10-13 16:11:13 +00:00
|
|
|
typedef struct {
|
2002-02-15 13:38:24 +00:00
|
|
|
int text_len, text_alloc; /* as shorts, not chars */
|
|
|
|
|
unichar *text;
|
|
|
|
|
|
2016-03-21 09:14:01 +01:00
|
|
|
GSList *kill_ring;
|
2002-02-15 13:38:24 +00:00
|
|
|
|
|
|
|
|
/* all as shorts, not chars */
|
2001-10-13 16:11:13 +00:00
|
|
|
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 08:03:38 +00:00
|
|
|
|
2001-10-13 16:11:13 +00:00
|
|
|
int promptlen;
|
2001-10-28 18:40:12 +00:00
|
|
|
char *prompt;
|
|
|
|
|
|
|
|
|
|
int redraw_needed_from;
|
2002-01-29 03:13:06 +00:00
|
|
|
unsigned int utf8:1;
|
2016-03-21 09:14:01 +01:00
|
|
|
|
|
|
|
|
unsigned int previous_append_next_kill:1;
|
|
|
|
|
unsigned int append_next_kill:1;
|
|
|
|
|
unsigned int yank_preceded:1;
|
2001-10-13 16:11:13 +00:00
|
|
|
} GUI_ENTRY_REC;
|
2000-05-04 10:32:42 +00:00
|
|
|
|
2015-11-13 13:42:28 -05:00
|
|
|
typedef enum {
|
|
|
|
|
CUTBUFFER_UPDATE_NOOP,
|
|
|
|
|
CUTBUFFER_UPDATE_REPLACE,
|
2016-01-30 09:34:46 -05:00
|
|
|
CUTBUFFER_UPDATE_APPEND,
|
2015-11-13 13:42:28 -05:00
|
|
|
CUTBUFFER_UPDATE_PREPEND
|
|
|
|
|
} CUTBUFFER_UPDATE_OP;
|
|
|
|
|
|
2001-10-13 16:11:13 +00:00
|
|
|
extern GUI_ENTRY_REC *active_entry;
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2002-01-29 03:13:06 +00:00
|
|
|
GUI_ENTRY_REC *gui_entry_create(int xpos, int ypos, int width, int utf8);
|
2001-10-13 16:11:13 +00:00
|
|
|
void gui_entry_destroy(GUI_ENTRY_REC *entry);
|
2000-06-14 18:02:13 +00:00
|
|
|
|
2002-01-29 03:13:06 +00:00
|
|
|
void gui_entry_move(GUI_ENTRY_REC *entry, int xpos, int ypos, int width);
|
2001-10-13 16:11:13 +00:00
|
|
|
void gui_entry_set_active(GUI_ENTRY_REC *entry);
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2001-10-13 16:11:13 +00:00
|
|
|
void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str);
|
|
|
|
|
void gui_entry_set_hidden(GUI_ENTRY_REC *entry, int hidden);
|
2002-01-29 03:13:06 +00:00
|
|
|
void gui_entry_set_utf8(GUI_ENTRY_REC *entry, int utf8);
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2001-10-13 16:11:13 +00:00
|
|
|
void gui_entry_set_text(GUI_ENTRY_REC *entry, const char *str);
|
|
|
|
|
char *gui_entry_get_text(GUI_ENTRY_REC *entry);
|
2006-01-29 22:37:24 +00:00
|
|
|
char *gui_entry_get_text_and_pos(GUI_ENTRY_REC *entry, int *pos);
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2001-10-13 16:11:13 +00:00
|
|
|
void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str);
|
2002-02-15 13:38:24 +00:00
|
|
|
void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr);
|
2001-10-13 16:11:13 +00:00
|
|
|
|
2002-02-15 13:38:24 +00:00
|
|
|
char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry);
|
2016-03-21 09:14:01 +01:00
|
|
|
char *gui_entry_get_next_cutbuffer(GUI_ENTRY_REC *entry);
|
2015-11-13 13:42:28 -05:00
|
|
|
void gui_entry_erase_to(GUI_ENTRY_REC *entry, int pos, CUTBUFFER_UPDATE_OP update_cutbuffer);
|
|
|
|
|
void gui_entry_erase(GUI_ENTRY_REC *entry, int size, CUTBUFFER_UPDATE_OP update_cutbuffer);
|
2007-05-25 22:21:39 +00:00
|
|
|
void gui_entry_erase_cell(GUI_ENTRY_REC *entry);
|
2015-11-13 13:42:28 -05:00
|
|
|
void gui_entry_erase_word(GUI_ENTRY_REC *entry, int to_space, CUTBUFFER_UPDATE_OP cutbuffer_op);
|
2016-03-21 09:14:01 +01:00
|
|
|
void gui_entry_erase_next_word(GUI_ENTRY_REC *entry, int to_space, CUTBUFFER_UPDATE_OP cutbuffer_op);
|
2001-10-13 16:11:13 +00:00
|
|
|
|
2002-02-15 16:02:14 +00:00
|
|
|
void gui_entry_transpose_chars(GUI_ENTRY_REC *entry);
|
2005-08-27 22:06:34 +00:00
|
|
|
void gui_entry_transpose_words(GUI_ENTRY_REC *entry);
|
|
|
|
|
|
|
|
|
|
void gui_entry_capitalize_word(GUI_ENTRY_REC *entry);
|
|
|
|
|
void gui_entry_downcase_word(GUI_ENTRY_REC *entry);
|
|
|
|
|
void gui_entry_upcase_word(GUI_ENTRY_REC *entry);
|
2002-02-15 16:02:14 +00:00
|
|
|
|
2001-10-13 16:11:13 +00: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 14:39:36 +00:00
|
|
|
void gui_entry_move_words(GUI_ENTRY_REC *entry, int count, int to_space);
|
2001-10-13 16:11:13 +00:00
|
|
|
|
|
|
|
|
void gui_entry_redraw(GUI_ENTRY_REC *entry);
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2015-11-13 13:42:28 -05:00
|
|
|
|
2000-04-26 08:03:38 +00:00
|
|
|
#endif
|