Changeset View
Changeset View
Standalone View
Standalone View
lib/libedit/terminal.h
/* $NetBSD: terminal.h,v 1.7 2016/02/16 15:53:48 christos Exp $ */ | /* $NetBSD: terminal.h,v 1.9 2016/05/09 21:46:56 christos Exp $ */ | ||||
/*- | /*- | ||||
* Copyright (c) 1992, 1993 | * Copyright (c) 1992, 1993 | ||||
* The Regents of the University of California. All rights reserved. | * The Regents of the University of California. All rights reserved. | ||||
* | * | ||||
* This code is derived from software contributed to Berkeley by | * This code is derived from software contributed to Berkeley by | ||||
* Christos Zoulas of Cornell University. | * Christos Zoulas of Cornell University. | ||||
* | * | ||||
Show All 27 Lines | |||||
/* | /* | ||||
* el.term.h: Termcap header | * el.term.h: Termcap header | ||||
*/ | */ | ||||
#ifndef _h_el_terminal | #ifndef _h_el_terminal | ||||
#define _h_el_terminal | #define _h_el_terminal | ||||
typedef struct { /* Symbolic function key bindings */ | typedef struct { /* Symbolic function key bindings */ | ||||
const Char *name; /* name of the key */ | const wchar_t *name; /* name of the key */ | ||||
int key; /* Index in termcap table */ | int key; /* Index in termcap table */ | ||||
keymacro_value_t fun; /* Function bound to it */ | keymacro_value_t fun; /* Function bound to it */ | ||||
int type; /* Type of function */ | int type; /* Type of function */ | ||||
} funckey_t; | } funckey_t; | ||||
typedef struct { | typedef struct { | ||||
const char *t_name; /* the terminal name */ | const char *t_name; /* the terminal name */ | ||||
coord_t t_size; /* # lines and cols */ | coord_t t_size; /* # lines and cols */ | ||||
Show All 22 Lines | |||||
#define A_K_UP 1 | #define A_K_UP 1 | ||||
#define A_K_LT 2 | #define A_K_LT 2 | ||||
#define A_K_RT 3 | #define A_K_RT 3 | ||||
#define A_K_HO 4 | #define A_K_HO 4 | ||||
#define A_K_EN 5 | #define A_K_EN 5 | ||||
#define A_K_DE 6 | #define A_K_DE 6 | ||||
#define A_K_NKEYS 7 | #define A_K_NKEYS 7 | ||||
protected void terminal_move_to_line(EditLine *, int); | libedit_private void terminal_move_to_line(EditLine *, int); | ||||
protected void terminal_move_to_char(EditLine *, int); | libedit_private void terminal_move_to_char(EditLine *, int); | ||||
protected void terminal_clear_EOL(EditLine *, int); | libedit_private void terminal_clear_EOL(EditLine *, int); | ||||
protected void terminal_overwrite(EditLine *, const Char *, size_t); | libedit_private void terminal_overwrite(EditLine *, const wchar_t *, size_t); | ||||
protected void terminal_insertwrite(EditLine *, Char *, int); | libedit_private void terminal_insertwrite(EditLine *, wchar_t *, int); | ||||
protected void terminal_deletechars(EditLine *, int); | libedit_private void terminal_deletechars(EditLine *, int); | ||||
protected void terminal_clear_screen(EditLine *); | libedit_private void terminal_clear_screen(EditLine *); | ||||
protected void terminal_beep(EditLine *); | libedit_private void terminal_beep(EditLine *); | ||||
protected int terminal_change_size(EditLine *, int, int); | libedit_private int terminal_change_size(EditLine *, int, int); | ||||
protected int terminal_get_size(EditLine *, int *, int *); | libedit_private int terminal_get_size(EditLine *, int *, int *); | ||||
protected int terminal_init(EditLine *); | libedit_private int terminal_init(EditLine *); | ||||
protected void terminal_bind_arrow(EditLine *); | libedit_private void terminal_bind_arrow(EditLine *); | ||||
protected void terminal_print_arrow(EditLine *, const Char *); | libedit_private void terminal_print_arrow(EditLine *, const wchar_t *); | ||||
protected int terminal_clear_arrow(EditLine *, const Char *); | libedit_private int terminal_clear_arrow(EditLine *, const wchar_t *); | ||||
protected int terminal_set_arrow(EditLine *, const Char *, keymacro_value_t *, int); | libedit_private int terminal_set_arrow(EditLine *, const wchar_t *, | ||||
protected void terminal_end(EditLine *); | keymacro_value_t *, int); | ||||
protected void terminal_get(EditLine *, const char **); | libedit_private void terminal_end(EditLine *); | ||||
protected int terminal_set(EditLine *, const char *); | libedit_private void terminal_get(EditLine *, const char **); | ||||
protected int terminal_settc(EditLine *, int, const Char **); | libedit_private int terminal_set(EditLine *, const char *); | ||||
protected int terminal_gettc(EditLine *, int, char **); | libedit_private int terminal_settc(EditLine *, int, const wchar_t **); | ||||
protected int terminal_telltc(EditLine *, int, const Char **); | libedit_private int terminal_gettc(EditLine *, int, char **); | ||||
protected int terminal_echotc(EditLine *, int, const Char **); | libedit_private int terminal_telltc(EditLine *, int, const wchar_t **); | ||||
protected void terminal_writec(EditLine *, wint_t); | libedit_private int terminal_echotc(EditLine *, int, const wchar_t **); | ||||
protected int terminal__putc(EditLine *, wint_t); | libedit_private void terminal_writec(EditLine *, wint_t); | ||||
protected void terminal__flush(EditLine *); | libedit_private int terminal__putc(EditLine *, wint_t); | ||||
libedit_private void terminal__flush(EditLine *); | |||||
/* | /* | ||||
* Easy access macros | * Easy access macros | ||||
*/ | */ | ||||
#define EL_FLAGS (el)->el_terminal.t_flags | #define EL_FLAGS (el)->el_terminal.t_flags | ||||
#define EL_CAN_INSERT (EL_FLAGS & TERM_CAN_INSERT) | #define EL_CAN_INSERT (EL_FLAGS & TERM_CAN_INSERT) | ||||
#define EL_CAN_DELETE (EL_FLAGS & TERM_CAN_DELETE) | #define EL_CAN_DELETE (EL_FLAGS & TERM_CAN_DELETE) | ||||
Show All 9 Lines |