New version of ncurses port applied, fixed memory leak in gutlgrp.cpp.
This commit is contained in:
parent
c3909b39c9
commit
69b146f956
170
docs/ncurses.txt
170
docs/ncurses.txt
@ -1,73 +1,97 @@
|
|||||||
|
|
||||||
Random remarks about the ncurses support for GoldEd+
|
Random remarks about the ncurses support for GoldEd+
|
||||||
by Jacobo Tarrio, 2:348/102.11@fidonet <jtarrio@iname.com>
|
by Jacobo Tarrio, 2:348/102.11@fidonet <jtarrio@iname.com>
|
||||||
|
|
||||||
This version of GoldEd+ bears the second public release of the ncurses
|
This version of GoldEd+ bears the third public release of the ncurses
|
||||||
implementation of its video code; it's still considered beta, so expect some
|
implementation of its video code; it's still considered beta, so expect some
|
||||||
strange behaviour while it is being completed.
|
strange behaviour while it is being completed.
|
||||||
|
|
||||||
It is being done in order to allow any Unix clone with ncurses installed
|
It is being done in order to allow any Unix clone with ncurses installed
|
||||||
(and, probably, any implementation of curses) to run GoldEd+, independently
|
(and, probably, any implementation of curses) to run GoldEd+, independently
|
||||||
of the character set used by the system and of the terminal type; GoldEd+
|
of the character set used by the system and of the terminal type; GoldEd+
|
||||||
will run fine from the console with a cyrillic character set, from a xterm
|
will run fine from the console with a cyrillic character set, from a xterm
|
||||||
with the iso-8859-1 character set, or from a monochrome VT-100 dumb
|
with the iso-8859-1 character set, or from a monochrome VT-100 dumb
|
||||||
terminal. It might even be possible in the near future to use GoldEd+
|
terminal. It might even be possible in the near future to use GoldEd+
|
||||||
compiled for DOS, Win32 or OS/2, and linked with PDCurses.
|
compiled for DOS, Win32 or OS/2, and linked with PDCurses.
|
||||||
|
|
||||||
This file tries to list some already known bugs along with other nasty
|
This file tries to list some already known bugs along with other nasty
|
||||||
"features" of the code. Expect most of these bugs to disappear and a lot of
|
"features" of the code. Expect most of these bugs to disappear and a lot of
|
||||||
fresh new ones to show up in the next public release of the ncurses support
|
fresh new ones to show up in the next public release of the ncurses support
|
||||||
:-) However, I do not always succeed, so old, already existing bugs are
|
:-) However, I do not always succeed, so old, already existing bugs are
|
||||||
marked with '!', whilst new ones are marked with '*'.
|
marked with '!', whilst new ones are marked with '*'.
|
||||||
|
|
||||||
If you find any bug not listed here, please report to Jacobo Tarrio,
|
If you find any bug not listed here, please report to Jacobo Tarrio,
|
||||||
2:348/102.11@fidonet <jtarrio@iname.com> ASAP to get it fixed soon, or,
|
2:348/102.11@fidonet <jtarrio@iname.com> ASAP to get it fixed soon, or,
|
||||||
better, fix it yourself and send me the patch :-)
|
better, fix it yourself and send me the patch :-)
|
||||||
|
|
||||||
=== 2000-02-25: Second public release
|
=== 2000-02-17: Third public release
|
||||||
Known bugs:
|
Known bugs:
|
||||||
|
|
||||||
! The splash screen looks a bit ugly :-)
|
! Statusline displays a couple of odd characters (after GoldEd+'s name and
|
||||||
! The cursor disappears every 30 seconds when editing a message
|
before the current time)
|
||||||
* Statusline displays a couple of odd characters (after GoldEd+'s name and
|
! Screen may become corrupted if someone other than GoldEd+ writes on the
|
||||||
before the current time)
|
terminal
|
||||||
* Screen may become corrupted if someone other than GoldEd+ writes on the
|
! Messages from the program viewed before entering full-screen are not
|
||||||
terminal
|
displayed properly
|
||||||
* Messages from the program viewed before entering full-screen are not
|
* The cursor grows very big every 30 seconds when editing a message
|
||||||
displayed properly
|
(possible reincarnation of a similar bug in former versions)
|
||||||
|
* The splash screen looks ugly, but not as much as before :)
|
||||||
Notes:
|
|
||||||
|
Notes:
|
||||||
* I have "ment" the escape key affair (see below) by using some sort of
|
|
||||||
ncurses version detection and the so. If this misfeature (for I'm sure it
|
* ESCDELAY is now set by default to 50ms. If it is too short for you, you
|
||||||
is going to give more trouble than good) annoys you, you can change the
|
can set the ESCDELAY environment variable to override it (under ncurses).
|
||||||
delay after escape by modifying the "ESCDELAY = 50;" assignment at the
|
It must hold an integer value representing the delay in milliseconds.
|
||||||
file 'goldlib/gall/gkbdbase.cpp', or by commenting it out.
|
Quite useful over wide area network links or on very-very-i-really-mean-it
|
||||||
|
slow terminals. Undocumented in ncurses 4, but functional. Documented
|
||||||
Anyway, you should perhaps be able, with this default setting, to "press"
|
in ncurses 5 and above (I believe).
|
||||||
ALT on terminals that don't have this, by pressing ESC and the desired key
|
|
||||||
very quickly :-)
|
|
||||||
|
=== 2000-02-05: Second public release
|
||||||
|
Known bugs:
|
||||||
=== 2000-01-25: First public release
|
|
||||||
Known bugs:
|
! The splash screen looks a bit ugly :-)
|
||||||
|
! The cursor disappears every 30 seconds when editing a message
|
||||||
* Tab key does not work properly
|
* Statusline displays a couple of odd characters (after GoldEd+'s name and
|
||||||
* Boxes are seen fine (at least with Latin-1) but lines are still drawn
|
before the current time)
|
||||||
with hyphens (-), plus signs (+), vertical lines (|) and the so.
|
* Screen may become corrupted if someone other than GoldEd+ writes on the
|
||||||
* The splash screen looks a bit ugly :-)
|
terminal
|
||||||
* The box in the screensaver leaves traces when moving
|
* Messages from the program viewed before entering full-screen are not
|
||||||
* The cursor disappears every 30 seconds when editing a message
|
displayed properly
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
* When pressing the escape key, you must wait for 1 second for GoldEd+ to
|
* I have "ment" the escape key affair (see below) by using some sort of
|
||||||
take action. This is due to the way most terminals send function keys and
|
ncurses version detection and the so. If this misfeature (for I'm sure it
|
||||||
keypad presses; they send ESC followed by some characters, and curses
|
is going to give more trouble than good) annoys you, you can change the
|
||||||
waits for these characters to arrive. There is a way to shorten the
|
delay after escape by modifying the "ESCDELAY = 50;" assignment at the
|
||||||
timeout to, say, 30ms, which is suitable for a 300-baud terminal and still
|
file 'goldlib/gall/gkbdbase.cpp', or by commenting it out.
|
||||||
too fast for humans to notice, but it would make GoldEd+ dependant of a
|
|
||||||
particular implementation of curses, and of a particular version of that
|
Anyway, you should perhaps be able, with this default setting, to "press"
|
||||||
implementation; also, it would make GoldEd+ unusable over a network or
|
ALT on terminals that don't have this, by pressing ESC and the desired key
|
||||||
with some dumb terminals or terminal emulators; this way you can press
|
very quickly :-)
|
||||||
ESC followed immediately by an A to "press" ALT-A.
|
|
||||||
|
|
||||||
|
=== 2000-01-25: First public release
|
||||||
|
Known bugs:
|
||||||
|
|
||||||
|
* Tab key does not work properly
|
||||||
|
* Boxes are seen fine (at least with Latin-1) but lines are still drawn
|
||||||
|
with hyphens (-), plus signs (+), vertical lines (|) and the so.
|
||||||
|
* The splash screen looks a bit ugly :-)
|
||||||
|
* The box in the screensaver leaves traces when moving
|
||||||
|
* The cursor disappears every 30 seconds when editing a message
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
* When pressing the escape key, you must wait for 1 second for GoldEd+ to
|
||||||
|
take action. This is due to the way most terminals send function keys and
|
||||||
|
keypad presses; they send ESC followed by some characters, and curses
|
||||||
|
waits for these characters to arrive. There is a way to shorten the
|
||||||
|
timeout to, say, 30ms, which is suitable for a 300-baud terminal and still
|
||||||
|
too fast for humans to notice, but it would make GoldEd+ dependant of a
|
||||||
|
particular implementation of curses, and of a particular version of that
|
||||||
|
implementation; also, it would make GoldEd+ unusable over a network or
|
||||||
|
with some dumb terminals or terminal emulators; this way you can press
|
||||||
|
ESC followed immediately by an A to "press" ALT-A.
|
||||||
|
|
||||||
|
@ -7,6 +7,18 @@ ______________________________________________________________________
|
|||||||
--- === *** === ---
|
--- === *** === ---
|
||||||
|
|
||||||
|
|
||||||
|
______________________________________________________________________
|
||||||
|
|
||||||
|
Notes for GoldED+ 1.1.4.4, March xx 2000
|
||||||
|
______________________________________________________________________
|
||||||
|
|
||||||
|
- Fixed sound support under DOS (GSNDAPI).
|
||||||
|
|
||||||
|
- From the previous version GoldED+ does not read goldrand.cfg
|
||||||
|
separately. Just include it with INCLUDE if not yet ;-)
|
||||||
|
|
||||||
|
- Fixed some memory leaks.
|
||||||
|
|
||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
Notes for GoldED+ 1.1.4.3, February xx 2000
|
Notes for GoldED+ 1.1.4.3, February xx 2000
|
||||||
|
@ -374,6 +374,14 @@ static void w_brag() {
|
|||||||
char buf[200];
|
char buf[200];
|
||||||
char* logo[6];
|
char* logo[6];
|
||||||
|
|
||||||
|
#if defined(__USE_NCURSES__)
|
||||||
|
logo[0] = throw_strdup(" 88 88 88 ");
|
||||||
|
logo[1] = throw_strdup(" oooooo oooooo 88 oooo88 oooooo oooo88 ");
|
||||||
|
logo[2] = throw_strdup(" 88 88 88 88 88 88 88 88oo88 88 88 ");
|
||||||
|
logo[3] = throw_strdup(" 88oo88 88oo88 88 88oo88 88oooo 88oo88 ");
|
||||||
|
logo[4] = throw_strdup(" oo 88 ");
|
||||||
|
logo[5] = throw_strdup(" 88oooooo88 ");
|
||||||
|
#else
|
||||||
if(W_BBRAG == 7) {
|
if(W_BBRAG == 7) {
|
||||||
logo[0] = throw_strdup(" ** ** ** ");
|
logo[0] = throw_strdup(" ** ** ** ");
|
||||||
logo[1] = throw_strdup(" ****** ****** ** ****** ****** ****** ");
|
logo[1] = throw_strdup(" ****** ****** ** ****** ****** ****** ");
|
||||||
@ -383,7 +391,7 @@ static void w_brag() {
|
|||||||
logo[5] = throw_strdup(" ********** ");
|
logo[5] = throw_strdup(" ********** ");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if defined(__UNIX__) and not defined(__USE_NCURSES__)
|
#if defined(__UNIX__)
|
||||||
if(gvid_xterm) {
|
if(gvid_xterm) {
|
||||||
logo[0] = throw_strdup(" Ú¿ Ú¿ Ú¿ ");
|
logo[0] = throw_strdup(" Ú¿ Ú¿ Ú¿ ");
|
||||||
logo[1] = throw_strdup(" ÚÂÄÄ¿ ÚÂÄÄ¿ ³³ ÚÂÄÄ´³ ÚÂÄÄ¿ ÚÂÄÄ´³ ");
|
logo[1] = throw_strdup(" ÚÂÄÄ¿ ÚÂÄÄ¿ ³³ ÚÂÄÄ´³ ÚÂÄÄ¿ ÚÂÄÄ´³ ");
|
||||||
@ -400,7 +408,7 @@ static void w_brag() {
|
|||||||
logo[3] = throw_strdup(" ÈÊÍ͹º ÈÊÍÍʼ ȼ ÈÊÍÍʼ ÈÊÍÍʼ ÈÊÍÍʼ ");
|
logo[3] = throw_strdup(" ÈÊÍ͹º ÈÊÍÍʼ ȼ ÈÊÍÍʼ ÈÊÍÍʼ ÈÊÍÍʼ ");
|
||||||
logo[4] = throw_strdup(" É» ºº ");
|
logo[4] = throw_strdup(" É» ºº ");
|
||||||
logo[5] = throw_strdup(" ÈÊÍÍÍÍÍÍʼ ");
|
logo[5] = throw_strdup(" ÈÊÍÍÍÍÍÍʼ ");
|
||||||
#if defined(__UNIX__) and not defined(__USE_NCURSES__)
|
#if defined(__UNIX__)
|
||||||
}
|
}
|
||||||
gvid_boxcvt(logo[0]);
|
gvid_boxcvt(logo[0]);
|
||||||
gvid_boxcvt(logo[1]);
|
gvid_boxcvt(logo[1]);
|
||||||
@ -410,6 +418,7 @@ static void w_brag() {
|
|||||||
gvid_boxcvt(logo[5]);
|
gvid_boxcvt(logo[5]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
W_READ = wopen_(1, 2, MAXROW-4, MAXCOL-5, W_BBRAG, C_BRAGB, C_BRAGW);
|
W_READ = wopen_(1, 2, MAXROW-4, MAXCOL-5, W_BBRAG, C_BRAGB, C_BRAGW);
|
||||||
w_shadow();
|
w_shadow();
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
#include <gkbdbase.h>
|
#include <gkbdbase.h>
|
||||||
#include <gmemall.h>
|
#include <gmemall.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if defined(__OS2__)
|
#if defined(__OS2__)
|
||||||
#define INCL_BASE
|
#define INCL_BASE
|
||||||
#include <os2.h>
|
#include <os2.h>
|
||||||
@ -98,12 +100,13 @@ void GKbd::Init() {
|
|||||||
intrflush(stdscr, FALSE);
|
intrflush(stdscr, FALSE);
|
||||||
keypad(stdscr, TRUE);
|
keypad(stdscr, TRUE);
|
||||||
|
|
||||||
// WARNING: this might break with another version of ncurses, or
|
// WARNING: this might break with an old version of ncurses, or
|
||||||
// with another implementation of curses. I'm putting it here because
|
// with another implementation of curses. I'm putting it here because
|
||||||
// it is quote useful most of the time :-) For other implementations of
|
// it is quote useful most of the time :-) For other implementations of
|
||||||
// curses, you might have to compile curses yourself to achieve this. -jt
|
// curses, you might have to compile curses yourself to achieve this. -jt
|
||||||
#if defined(NCURSES_VERSION)
|
#if defined(NCURSES_VERSION)
|
||||||
ESCDELAY = 50; // ms, slow for a 300bps terminal, fast for humans :-)
|
if(not getenv("ESCDELAY")) // If not specified by user via environment, set
|
||||||
|
ESCDELAY = 50; // ms, slow for a 300bps terminal, fast for humans :-)
|
||||||
#endif
|
#endif
|
||||||
// For more ncurses-dependent code, look at the gkbd_curstable array
|
// For more ncurses-dependent code, look at the gkbd_curstable array
|
||||||
// and at the kbxget_raw() function -jt
|
// and at the kbxget_raw() function -jt
|
||||||
|
@ -52,7 +52,7 @@ Grp::~Grp() {
|
|||||||
|
|
||||||
multimap<int, grp_stock>::iterator i;
|
multimap<int, grp_stock>::iterator i;
|
||||||
for(currgrp = container.begin(); currgrp != container.end(); currgrp++)
|
for(currgrp = container.begin(); currgrp != container.end(); currgrp++)
|
||||||
for(i = currgrp->second.find(GRP_MEMBER); i != currgrp->second.end(); i++) {
|
for(i = currgrp->second.begin(); i != currgrp->second.end(); i++) {
|
||||||
if(i->second.type == TYPE_OBJECT)
|
if(i->second.type == TYPE_OBJECT)
|
||||||
throw_free(i->second.data.object_item);
|
throw_free(i->second.data.object_item);
|
||||||
else if(i->second.type == TYPE_STRING)
|
else if(i->second.type == TYPE_STRING)
|
||||||
|
@ -1361,9 +1361,10 @@ void vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) {
|
|||||||
// Does anyone know a better solution?
|
// Does anyone know a better solution?
|
||||||
|
|
||||||
if(lines >= 0) {
|
if(lines >= 0) {
|
||||||
if (lines <= 1 + erow - srow) {
|
if(lines <= 1 + erow - srow) {
|
||||||
vatch *buf = vsave (srow + lines, scol, erow, ecol);
|
vatch *buf = vsave(srow + lines, scol, erow, ecol);
|
||||||
vrestore (buf, srow, scol, erow - lines, ecol);
|
vrestore(buf, srow, scol, erow - lines, ecol);
|
||||||
|
throw_xfree(buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lines = 1 + erow - srow;
|
lines = 1 + erow - srow;
|
||||||
@ -1374,9 +1375,10 @@ void vscroll(int srow, int scol, int erow, int ecol, int atr, int lines) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lines*=-1;
|
lines*=-1;
|
||||||
if (lines <= 1 + erow - srow) {
|
if(lines <= 1 + erow - srow) {
|
||||||
vatch *buf = vsave (srow, scol, erow - lines, ecol);
|
vatch *buf = vsave(srow, scol, erow - lines, ecol);
|
||||||
vrestore (buf, srow + lines, scol, erow, ecol);
|
vrestore(buf, srow + lines, scol, erow, ecol);
|
||||||
|
throw_xfree(buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lines = 1 + erow - srow;
|
lines = 1 + erow - srow;
|
||||||
|
Reference in New Issue
Block a user