X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=inline;f=rote.h;h=76547843b3fe36a35e9c2aa18c54646c21f3aa28;hb=8e5831e371def4903b232c4e91962d2053cc6ce1;hp=8972a61f0dfc5f68993ba3beb537bdec71530e84;hpb=93c516d8991c4b6935fc03a24317ea0785e78a93;p=apps%2Fmadtty.git diff --git a/rote.h b/rote.h index 8972a61..7654784 100644 --- a/rote.h +++ b/rote.h @@ -5,10 +5,35 @@ * 2004-08-25 */ +/* +LICENSE INFORMATION: +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation. + +Please refer to the COPYING file for more information. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Copyright (c) 2004 Bruno T. C. de Oliveira +*/ + + #ifndef btco_ROTE_rote_h #define btco_ROTE_rote_h +#ifdef USE_NCURSES #include +#else +#include +#endif #include #include #include @@ -58,7 +83,7 @@ #define ROTE_ATTR_MOD_BOLD(attr, boldbit) \ attr &= 0x7F, attr |= (boldbit)?0x80:0x00 #define ROTE_ATTR_MOD_BLINK(attr, blinkbit) \ - attr &= 0xF7, attr |= (boldbit)?0x08:0x00 + attr &= 0xF7, attr |= (blinkbit)?0x08:0x00 /* these return non-zero for 'yes', zero for 'no'. Don't rely on them being * any more specific than that (e.g. being exactly 1 for 'yes' or whatever). */ @@ -105,6 +130,7 @@ typedef struct RoteTerm_ { RoteTermPrivate *pd; /* private state data */ + bool insert; /* insert or replace mode */ /* --- dirtiness flags: the following flags will be raised when the * corresponding items are modified. They can only be unset by YOU * (when, for example, you redraw the term or something) --- */ @@ -179,6 +205,7 @@ void rote_vt_write(RoteTerm *rt, const char *data, int length); */ void rote_vt_inject(RoteTerm *rt, const char *data, int length); +#ifdef USE_NCURSES /* Paints the virtual terminal screen on the given window, putting * the top-left corner at the given position. The cur_set_attr * function must set the curses attributes given a Rote attribute @@ -200,6 +227,7 @@ void rote_vt_inject(RoteTerm *rt, const char *data, int length); void rote_vt_draw(RoteTerm *rt, WINDOW *win, int startrow, int startcol, void (*cur_set_attr)(WINDOW *win, unsigned char attr)); +#endif /* Indicates to the terminal that the given key has been pressed. * This will cause the terminal to rote_vt_write() the appropriate * escape sequence for that key (that is, the escape sequence @@ -219,6 +247,15 @@ void *rote_vt_take_snapshot(RoteTerm *rt); * This function does NOT free() the passed buffer */ void rote_vt_restore_snapshot(RoteTerm *rt, void *snapbuf); +/* Returns the pseudo tty descriptor associated with the given terminal. + * Please don't do weird things with it (like close it for instance), + * or things will break + * + * This function returns -1 if the given terminal does not yet have + * an associated pty. A pty is only associated to a terminal when + * needed, e.g. on a call to rote_vt_forkpty. */ +int rote_vt_get_pty_fd(RoteTerm *rt); + /* Declaration of custom escape sequence callback type. See the * rote_vt_add_es_handler function for more info */ typedef int (*rote_es_handler_t)(RoteTerm *rt, const char *es);