00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #ifndef _h_el_term
00050 #define _h_el_term
00051
00052 #include "histedit.h"
00053
00054 typedef struct {
00055 const char* fName;
00056 int fKey;
00057 KeyValue_t fFun;
00058 int fType;
00059 } FKey_t;
00060
00061 typedef struct {
00062 ElCoord_t fSize;
00063 int fFlags;
00064 #define TERM_CAN_INSERT 0x001
00065 #define TERM_CAN_DELETE 0x002
00066 #define TERM_CAN_CEOL 0x004
00067 #define TERM_CAN_TAB 0x008
00068 #define TERM_CAN_ME 0x010
00069 #define TERM_CAN_UP 0x020
00070 #define TERM_HAS_META 0x040
00071 #define TERM_HAS_AUTO_MARGINS 0x080
00072 #define TERM_HAS_MAGIC_MARGINS 0x100
00073 char* fBuf;
00074 int fLoc;
00075 char** fStr;
00076 int* fVal;
00077 char* fCap;
00078 FKey_t* fFKey;
00079 } ElTerm_t;
00080
00081
00082
00083
00084 #define A_K_DN 0
00085 #define A_K_UP 1
00086 #define A_K_LT 2
00087 #define A_K_RT 3
00088 #define A_K_HO 4
00089 #define A_K_EN 5
00090 #define A_K_DE 6
00091 #define A_K_NKEYS 7
00092
00093 el_protected void term_move_to_line(EditLine_t*, int);
00094 el_protected void term_move_to_char(EditLine_t*, int);
00095 el_protected void term_clear_EOL(EditLine_t*, int);
00096 el_protected void term_overwrite(EditLine_t*, const char*, ElColor_t*, int);
00097 el_protected void term_insertwrite(EditLine_t*, const char*, ElColor_t*, int);
00098 el_protected void term_deletechars(EditLine_t*, int);
00099 el_protected void term_clear_screen(EditLine_t*);
00100 el_protected void term_beep(EditLine_t*);
00101 el_protected int term_change_size(EditLine_t*, int, int);
00102 el_protected int term_get_size(EditLine_t*, int*, int*);
00103 el_protected int term_init(EditLine_t*);
00104 el_protected void term_bind_arrow(EditLine_t*);
00105 el_protected void term_print_arrow(EditLine_t*, const char*);
00106 el_protected int term_clear_arrow(EditLine_t*, char*);
00107 el_protected int term_set_arrow(EditLine_t*, char*, KeyValue_t*, int);
00108 el_protected void term_end(EditLine_t*);
00109 el_protected int term_set(EditLine_t*, const char*);
00110 el_protected int term_settc(EditLine_t*, int, const char**);
00111 el_protected int term_telltc(EditLine_t*, int, const char**);
00112 el_protected int term_echotc(EditLine_t*, int, const char**);
00113 el_protected extern "C" int term__putc(int);
00114 el_protected int term__putcolorch(int, ElColor_t*);
00115 el_protected void term__setcolor(int fgcol);
00116 el_protected int term__atocolor(const char* name);
00117 el_protected void term__resetcolor(void);
00118 el_protected void term__repaint(EditLine_t* el, int index);
00119 el_protected void term__flush(void);
00120
00121
00122
00123
00124 #define EL_FLAGS (el)->fTerm.fFlags
00125
00126 #define EL_CAN_UP (EL_FLAGS & TERM_CAN_UP)
00127 #define EL_CAN_INSERT (EL_FLAGS & TERM_CAN_INSERT)
00128 #define EL_CAN_DELETE (EL_FLAGS & TERM_CAN_DELETE)
00129 #define EL_CAN_CEOL (EL_FLAGS & TERM_CAN_CEOL)
00130 #define EL_CAN_TAB (EL_FLAGS & TERM_CAN_TAB)
00131 #define EL_CAN_ME (EL_FLAGS & TERM_CAN_ME)
00132 #define EL_HAS_META (EL_FLAGS & TERM_HAS_META)
00133 #define EL_HAS_AUTO_MARGINS (EL_FLAGS & TERM_HAS_AUTO_MARGINS)
00134 #define EL_HAS_MAGIC_MARGINS (EL_FLAGS & TERM_HAS_MAGIC_MARGINS)
00135
00136 #endif