mirror of
https://github.com/Aigor44/ncursesw-morphos.git
synced 2024-12-27 07:49:06 +08:00
ncurses 5.9 - patch 20140809
+ modify declarations for user-data pointers in C++ binding to use reinterpret_cast to facilitate converting typed pointers to void* in user's application (patch by Adam Jiang). + regenerated html manpages. + add note regarding cause and effect for TERM in ncurses manpage, having noted clueless verbiage in Terminal.app's "help" file which reverses cause/effect. + remove special fallback definition for NCURSES_ATTR_T, since macros have resolved type-mismatches using casts (cf: 970412). + fixes for win_driver.c: + handle repainting on endwin/refresh combination. + implement beep(). + minor cleanup.
This commit is contained in:
parent
73b54c0812
commit
acc28c6418
17
NEWS
17
NEWS
@ -25,7 +25,7 @@
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: NEWS,v 1.2250 2014/08/02 20:51:48 tom Exp $
|
||||
-- $Id: NEWS,v 1.2257 2014/08/09 22:05:47 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This is a log of changes that ncurses has gone through since Zeyd started
|
||||
@ -45,6 +45,21 @@ See the AUTHORS file for the corresponding full names.
|
||||
Changes through 1.9.9e did not credit all contributions;
|
||||
it is not possible to add this information.
|
||||
|
||||
20140809
|
||||
+ modify declarations for user-data pointers in C++ binding to use
|
||||
reinterpret_cast to facilitate converting typed pointers to void*
|
||||
in user's application (patch by Adam Jiang).
|
||||
+ regenerated html manpages.
|
||||
+ add note regarding cause and effect for TERM in ncurses manpage,
|
||||
having noted clueless verbiage in Terminal.app's "help" file
|
||||
which reverses cause/effect.
|
||||
+ remove special fallback definition for NCURSES_ATTR_T, since macros
|
||||
have resolved type-mismatches using casts (cf: 970412).
|
||||
+ fixes for win_driver.c:
|
||||
+ handle repainting on endwin/refresh combination.
|
||||
+ implement beep().
|
||||
+ minor cleanup.
|
||||
|
||||
20140802
|
||||
+ minor portability fixes for MinGW:
|
||||
+ ensure WINVER is defined in makefiles rather than using headers
|
||||
|
@ -1,6 +1,6 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -31,7 +31,7 @@
|
||||
* Author: Juergen Pfeifer, 1997 *
|
||||
****************************************************************************/
|
||||
|
||||
// $Id: cursesf.h,v 1.31 2012/12/29 21:49:58 tom Exp $
|
||||
// $Id: cursesf.h,v 1.32 2014/08/09 22:06:11 Adam.Jiang Exp $
|
||||
|
||||
#ifndef NCURSES_CURSESF_H_incl
|
||||
#define NCURSES_CURSESF_H_incl 1
|
||||
@ -673,7 +673,8 @@ protected:
|
||||
const T* p_UserData = STATIC_CAST(T*)(0))
|
||||
: NCursesForm(nlines,ncols,begin_y,begin_x) {
|
||||
if (form)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>
|
||||
(p_UserData)));
|
||||
}
|
||||
|
||||
public:
|
||||
@ -683,7 +684,7 @@ public:
|
||||
bool autoDelete_Fields=FALSE)
|
||||
: NCursesForm (Fields, with_frame, autoDelete_Fields) {
|
||||
if (form)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
};
|
||||
|
||||
NCursesUserForm (NCursesFormField* Fields[],
|
||||
@ -697,19 +698,20 @@ public:
|
||||
: NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
|
||||
with_frame, autoDelete_Fields) {
|
||||
if (form)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>
|
||||
(p_UserData)));
|
||||
};
|
||||
|
||||
virtual ~NCursesUserForm() {
|
||||
};
|
||||
|
||||
inline T* UserData (void) const {
|
||||
inline T* UserData (void) {
|
||||
return reinterpret_cast<T*>(get_user ());
|
||||
};
|
||||
|
||||
inline virtual void setUserData (const T* p_UserData) {
|
||||
if (form)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -31,7 +31,7 @@
|
||||
* Author: Juergen Pfeifer, 1997 *
|
||||
****************************************************************************/
|
||||
|
||||
// $Id: cursesm.h,v 1.29 2012/12/29 21:48:33 tom Exp $
|
||||
// $Id: cursesm.h,v 1.30 2014/08/09 22:06:18 Adam.Jiang Exp $
|
||||
|
||||
#ifndef NCURSES_CURSESM_H_incl
|
||||
#define NCURSES_CURSESM_H_incl 1
|
||||
@ -632,7 +632,7 @@ protected:
|
||||
const T* p_UserData = STATIC_CAST(T*)(0))
|
||||
: NCursesMenu(nlines,ncols,begin_y,begin_x) {
|
||||
if (menu)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
}
|
||||
|
||||
public:
|
||||
@ -642,7 +642,7 @@ public:
|
||||
bool autoDelete_Items=FALSE)
|
||||
: NCursesMenu (Items, with_frame, autoDelete_Items) {
|
||||
if (menu)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
};
|
||||
|
||||
NCursesUserMenu (NCursesMenuItem* Items[],
|
||||
@ -654,19 +654,19 @@ public:
|
||||
bool with_frame=FALSE)
|
||||
: NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
|
||||
if (menu)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
};
|
||||
|
||||
virtual ~NCursesUserMenu() {
|
||||
};
|
||||
|
||||
inline T* UserData (void) const {
|
||||
inline T* UserData (void) {
|
||||
return reinterpret_cast<T*>(get_user ());
|
||||
};
|
||||
|
||||
inline virtual void setUserData (const T* p_UserData) {
|
||||
if (menu)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2008,2012 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -34,7 +34,7 @@
|
||||
#ifndef NCURSES_CURSESP_H_incl
|
||||
#define NCURSES_CURSESP_H_incl 1
|
||||
|
||||
// $Id: cursesp.h,v 1.30 2012/12/29 21:50:55 tom Exp $
|
||||
// $Id: cursesp.h,v 1.31 2014/08/09 22:06:26 Adam.Jiang Exp $
|
||||
|
||||
#include <cursesw.h>
|
||||
|
||||
@ -236,7 +236,8 @@ public:
|
||||
: NCursesPanel (nlines, ncols, begin_y, begin_x)
|
||||
{
|
||||
if (p)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>
|
||||
(p_UserData)));
|
||||
};
|
||||
// This creates an user panel of the requested size with associated
|
||||
// user data pointed to by p_UserData.
|
||||
@ -244,14 +245,14 @@ public:
|
||||
NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel()
|
||||
{
|
||||
if (p)
|
||||
set_user(const_cast<void *>(p_UserData));
|
||||
set_user(const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
};
|
||||
// This creates an user panel associated with the ::stdscr and user data
|
||||
// pointed to by p_UserData.
|
||||
|
||||
virtual ~NCursesUserPanel() {};
|
||||
|
||||
T* UserData (void) const
|
||||
T* UserData (void)
|
||||
{
|
||||
return reinterpret_cast<T*>(get_user ());
|
||||
};
|
||||
@ -260,7 +261,7 @@ public:
|
||||
virtual void setUserData (const T* p_UserData)
|
||||
{
|
||||
if (p)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
}
|
||||
// Associate the user panel with the user data pointed to by p_UserData.
|
||||
};
|
||||
|
4
dist.mk
4
dist.mk
@ -25,7 +25,7 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: dist.mk,v 1.999 2014/08/01 23:41:10 tom Exp $
|
||||
# $Id: dist.mk,v 1.1000 2014/08/09 00:33:11 tom Exp $
|
||||
# Makefile for creating ncurses distributions.
|
||||
#
|
||||
# This only needs to be used directly as a makefile by developers, but
|
||||
@ -37,7 +37,7 @@ SHELL = /bin/sh
|
||||
# These define the major/minor/patch versions of ncurses.
|
||||
NCURSES_MAJOR = 5
|
||||
NCURSES_MINOR = 9
|
||||
NCURSES_PATCH = 20140802
|
||||
NCURSES_PATCH = 20140809
|
||||
|
||||
# We don't append the patch to the version, since this only applies to releases
|
||||
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright (c) 2010,2011 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 2010-2011,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,7 +27,7 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: MKada_config.in,v 1.5 2011/03/26 14:44:51 tom Exp @
|
||||
* @Id: MKada_config.in,v 1.8 2014/06/07 19:32:52 tom Exp @
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
@ -78,12 +78,66 @@
|
||||
<STRONG>--help</STRONG> prints a list of the <STRONG>adacurses-config</STRONG> script's
|
||||
options.
|
||||
|
||||
If no options are given, <STRONG>adacurses-config</STRONG> prints the com-
|
||||
bination of <STRONG>--cflags</STRONG> and <STRONG>--libs</STRONG> that <STRONG>gnatmake</STRONG> expects (see
|
||||
example).
|
||||
|
||||
|
||||
</PRE>
|
||||
<H2>EXAMPLE</H2><PRE>
|
||||
For example, supposing that you want to compile the "Hello
|
||||
World!" program for AdaCurses. Make a file named
|
||||
"hello.adb":
|
||||
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
|
||||
|
||||
procedure Hello is
|
||||
|
||||
Visibility : Cursor_Visibility := Invisible;
|
||||
done : Boolean := False;
|
||||
c : Key_Code;
|
||||
|
||||
begin
|
||||
|
||||
Init_Screen;
|
||||
Set_Echo_Mode (False);
|
||||
|
||||
Set_Cursor_Visibility (Visibility);
|
||||
Set_Timeout_Mode (Standard_Window, Non_Blocking, 0);
|
||||
|
||||
Move_Cursor (Line => Lines / 2, Column => (Columns - 12) / 2);
|
||||
Add (Str => "Hello World!");
|
||||
|
||||
while not done loop
|
||||
|
||||
c := Get_Keystroke (Standard_Window);
|
||||
case c is
|
||||
when Character'Pos ('q') => done := True;
|
||||
when others => null;
|
||||
end case;
|
||||
|
||||
Nap_Milli_Seconds (50);
|
||||
|
||||
end loop;
|
||||
|
||||
End_Windows;
|
||||
|
||||
end Hello;
|
||||
|
||||
Then, using
|
||||
gnatmake `adacurses-config --cflags` hello -largs
|
||||
`adacurses-config --libs`
|
||||
|
||||
or (simpler):
|
||||
gnatmake hello `adacurses-config`
|
||||
|
||||
you will compile and link the program.
|
||||
|
||||
|
||||
</PRE>
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -205,7 +205,7 @@
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
</PRE>
|
||||
|
@ -71,7 +71,7 @@
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -243,7 +243,7 @@
|
||||
|
||||
</PRE>
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<!--
|
||||
* t
|
||||
****************************************************************************
|
||||
* Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2010,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -28,7 +28,7 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: form_field_opts.3x,v 1.16 2010/12/04 18:41:07 tom Exp @
|
||||
* @Id: form_field_opts.3x,v 1.17 2014/07/26 21:21:57 tom Exp @
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
@ -75,11 +75,8 @@
|
||||
The function <STRONG>field_opts</STRONG> returns the field's current option
|
||||
bits.
|
||||
|
||||
The following options are defined (all are on by default):
|
||||
|
||||
O_VISIBLE
|
||||
The field is displayed. If this option is off, dis-
|
||||
play of the field is suppressed.
|
||||
The following standard options are defined (all are on by
|
||||
default):
|
||||
|
||||
O_ACTIVE
|
||||
The field is visited during processing. If this
|
||||
@ -87,43 +84,54 @@
|
||||
navigation keys. Please notice that an invisible
|
||||
field appears to be inactive also.
|
||||
|
||||
O_PUBLIC
|
||||
The field contents are displayed as data is entered.
|
||||
O_AUTOSKIP
|
||||
Skip to the next field when this one fills.
|
||||
|
||||
O_BLANK
|
||||
The field is cleared whenever a character is entered
|
||||
at the first position.
|
||||
|
||||
O_EDIT
|
||||
The field can be edited.
|
||||
|
||||
O_WRAP
|
||||
Words that do not fit on a line are wrapped to the
|
||||
next line. Words are blank-separated.
|
||||
|
||||
O_BLANK
|
||||
The field is cleared whenever a character is entered
|
||||
at the first position.
|
||||
|
||||
O_AUTOSKIP
|
||||
Skip to the next field when this one fills.
|
||||
|
||||
O_NULLOK
|
||||
Allow a blank field.
|
||||
|
||||
O_STATIC
|
||||
Field buffers are fixed to field's original size.
|
||||
Turn this option off to create a dynamic field.
|
||||
|
||||
O_PASSOK
|
||||
Validate field only if modified by user.
|
||||
|
||||
O_PUBLIC
|
||||
The field contents are displayed as data is entered.
|
||||
|
||||
O_STATIC
|
||||
Field buffers are fixed to field's original size.
|
||||
Turn this option off to create a dynamic field.
|
||||
|
||||
O_VISIBLE
|
||||
The field is displayed. If this option is off, dis-
|
||||
play of the field is suppressed.
|
||||
|
||||
O_WRAP
|
||||
Words that do not fit on a line are wrapped to the
|
||||
next line. Words are blank-separated.
|
||||
|
||||
One extension option is defined (extensions are off by
|
||||
default):
|
||||
|
||||
O_DYNAMIC_JUSTIFY
|
||||
Permit dynamic fields to be justified, like static
|
||||
fields.
|
||||
|
||||
|
||||
</PRE>
|
||||
<H2>RETURN VALUE</H2><PRE>
|
||||
Except for <STRONG>field_opts</STRONG>, each routine returns one of the
|
||||
Except for <STRONG>field_opts</STRONG>, each routine returns one of the
|
||||
following:
|
||||
|
||||
<STRONG>E_OK</STRONG> The routine succeeded.
|
||||
|
||||
<STRONG>E_BAD_ARGUMENT</STRONG>
|
||||
Routine detected an incorrect or out-of-range argu-
|
||||
Routine detected an incorrect or out-of-range argu-
|
||||
ment.
|
||||
|
||||
<STRONG>E_CURRENT</STRONG>
|
||||
@ -135,7 +143,7 @@
|
||||
|
||||
</PRE>
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>.
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>. <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>.
|
||||
|
||||
|
||||
</PRE>
|
||||
@ -146,13 +154,13 @@
|
||||
|
||||
</PRE>
|
||||
<H2>PORTABILITY</H2><PRE>
|
||||
These routines emulate the System V forms library. They
|
||||
These routines emulate the System V forms library. They
|
||||
were not supported on Version 7 or BSD versions.
|
||||
|
||||
|
||||
</PRE>
|
||||
<H2>AUTHORS</H2><PRE>
|
||||
Juergen Pfeifer. Manual pages and adaptation for new
|
||||
Juergen Pfeifer. Manual pages and adaptation for new
|
||||
curses by Eric S. Raymond.
|
||||
|
||||
|
||||
|
@ -455,7 +455,7 @@
|
||||
|
||||
http://invisible-island.net/ncurses/tctest.html
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
</PRE>
|
||||
|
@ -94,7 +94,7 @@
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
</PRE>
|
||||
|
@ -226,7 +226,7 @@
|
||||
|
||||
</PRE>
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: ncurses.3x,v 1.117 2014/05/24 20:29:27 tom Exp @
|
||||
* @Id: ncurses.3x,v 1.119 2014/08/09 20:54:30 tom Exp @
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
@ -63,7 +63,7 @@
|
||||
sonable optimization. This implementation is "new curses"
|
||||
(ncurses) and is the approved replacement for 4.4BSD clas-
|
||||
sic curses, which has been discontinued. This describes
|
||||
<STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
<STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
The <STRONG>ncurses</STRONG> library emulates the curses library of System
|
||||
V Release 4 UNIX, and XPG4 (X/Open Portability Guide)
|
||||
@ -1041,6 +1041,22 @@
|
||||
TERM Denotes your terminal type. Each terminal type is
|
||||
distinct, though many are similar.
|
||||
|
||||
<STRONG>TERM</STRONG> is commonly set by terminal emulators to help
|
||||
applications find a workable terminal description.
|
||||
Some of those choose a popular approximation, e.g.,
|
||||
"ansi", "vt100", "xterm" rather than an exact fit.
|
||||
Not infrequently, your application will have problems
|
||||
with that approach, e.g., incorrect function-key def-
|
||||
initions.
|
||||
|
||||
If you set <STRONG>TERM</STRONG> in your environment, it has no effect
|
||||
on the operation of the terminal emulator. It only
|
||||
affects the way applications work within the termi-
|
||||
nal. Likewise, as a general rule (<STRONG>xterm</STRONG> being a rare
|
||||
exception), terminal emulators which allow you to
|
||||
specify <STRONG>TERM</STRONG> as a parameter or configuration value do
|
||||
not change their behavior to match that setting.
|
||||
|
||||
TERMCAP
|
||||
If the <STRONG>ncurses</STRONG> library has been configured with <EM>term-</EM>
|
||||
<EM>cap</EM> support, <STRONG>ncurses</STRONG> will check for a terminal's
|
||||
|
@ -119,7 +119,7 @@
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -218,7 +218,7 @@
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
</PRE>
|
||||
|
@ -160,7 +160,7 @@
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -78,7 +78,7 @@
|
||||
nals by giving a set of capabilities which they have, by
|
||||
specifying how to perform screen operations, and by speci-
|
||||
fying padding requirements and initialization sequences.
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
Entries in <EM>terminfo</EM> consist of a sequence of `,' separated
|
||||
fields (embedded commas may be escaped with a backslash or
|
||||
|
@ -389,7 +389,7 @@
|
||||
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
</PRE>
|
||||
|
@ -119,7 +119,7 @@
|
||||
<STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -338,7 +338,7 @@
|
||||
<H2>SEE ALSO</H2><PRE>
|
||||
<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>.
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -319,7 +319,7 @@
|
||||
<STRONG>csh(1)</STRONG>, <STRONG>sh(1)</STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG>tty(4)</STRONG>,
|
||||
<STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
|
||||
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140524).
|
||||
This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20140809).
|
||||
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
* and: Thomas E. Dickey 1996-on *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: curses.h.in,v 1.240 2014/08/02 16:01:30 tom Exp $ */
|
||||
/* $Id: curses.h.in,v 1.241 2014/08/09 20:39:44 tom Exp $ */
|
||||
|
||||
#ifndef __NCURSES_H
|
||||
#define __NCURSES_H
|
||||
@ -74,12 +74,6 @@
|
||||
* NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses
|
||||
* configured using --disable-macros.
|
||||
*/
|
||||
#ifdef NCURSES_NOMACROS
|
||||
#ifndef NCURSES_ATTR_T
|
||||
#define NCURSES_ATTR_T attr_t
|
||||
#endif
|
||||
#endif /* NCURSES_NOMACROS */
|
||||
|
||||
#ifndef NCURSES_ATTR_T
|
||||
#define NCURSES_ATTR_T int
|
||||
#endif
|
||||
|
@ -27,7 +27,7 @@
|
||||
.\" authorization. *
|
||||
.\"***************************************************************************
|
||||
.\"
|
||||
.\" $Id: ncurses.3x,v 1.117 2014/05/24 20:29:27 tom Exp $
|
||||
.\" $Id: ncurses.3x,v 1.119 2014/08/09 20:54:30 tom Exp $
|
||||
.hy 0
|
||||
.TH ncurses 3X ""
|
||||
.ie \n(.g .ds `` \(lq
|
||||
@ -1021,6 +1021,21 @@ file \fBtrace\fR to the current directory.
|
||||
TERM
|
||||
Denotes your terminal type.
|
||||
Each terminal type is distinct, though many are similar.
|
||||
.IP
|
||||
\fBTERM\fP is commonly set by terminal emulators to help
|
||||
applications find a workable terminal description.
|
||||
Some of those choose a popular approximation, e.g.,
|
||||
\*(``ansi\*('', \*(``vt100\*('', \*(``xterm\*('' rather than an exact fit.
|
||||
Not infrequently, your application will have problems with that approach,
|
||||
e.g., incorrect function-key definitions.
|
||||
.IP
|
||||
If you set \fBTERM\fP in your environment,
|
||||
it has no effect on the operation of the terminal emulator.
|
||||
It only affects the way applications work within the terminal.
|
||||
Likewise, as a general rule (\fBxterm\fP being a rare exception),
|
||||
terminal emulators which allow you to
|
||||
specify \fBTERM\fP as a parameter or configuration value do
|
||||
not change their behavior to match that setting.
|
||||
.TP 5
|
||||
TERMCAP
|
||||
If the \fBncurses\fR library has been configured with \fItermcap\fR
|
||||
|
@ -34,6 +34,9 @@
|
||||
/*
|
||||
* TODO - GetMousePos(POINT * result) from ntconio.c
|
||||
* TODO - implement nodelay
|
||||
* TODO - implement flash
|
||||
* TODO - improve screen-repainting, using implied wraparound
|
||||
* TODO - if non-buffered, change buffer size (temporarily) to window-size - SetConsoleScreenBufferSize
|
||||
*/
|
||||
|
||||
#include <curses.priv.h>
|
||||
@ -45,7 +48,7 @@
|
||||
|
||||
#define CUR my_term.type.
|
||||
|
||||
MODULE_ID("$Id: win_driver.c,v 1.39 2014/06/29 22:48:17 tom Exp $")
|
||||
MODULE_ID("$Id: win_driver.c,v 1.43 2014/08/09 20:31:40 tom Exp $")
|
||||
|
||||
#ifndef __GNUC__
|
||||
# error We need GCC to compile for MinGW
|
||||
@ -105,6 +108,8 @@ static struct {
|
||||
WORD pairs[NUMPAIRS];
|
||||
COORD origin;
|
||||
CHAR_INFO *save_screen;
|
||||
COORD save_size;
|
||||
SMALL_RECT save_region;
|
||||
CONSOLE_SCREEN_BUFFER_INFO SBI;
|
||||
} CON;
|
||||
|
||||
@ -161,12 +166,64 @@ MapAttr(WORD res, attr_t ch)
|
||||
return res;
|
||||
}
|
||||
|
||||
#if 0 /* def TRACE */
|
||||
static void
|
||||
dump_screen(const char *fn, int ln)
|
||||
{
|
||||
int max_cells = (CON.SBI.dwSize.Y * (1 + CON.SBI.dwSize.X)) + 1;
|
||||
char output[max_cells];
|
||||
CHAR_INFO save_screen[max_cells];
|
||||
COORD save_size;
|
||||
SMALL_RECT save_region;
|
||||
COORD bufferCoord;
|
||||
|
||||
T(("dump_screen %s@%d", fn, ln));
|
||||
|
||||
save_region.Top = CON.SBI.srWindow.Top;
|
||||
save_region.Left = CON.SBI.srWindow.Left;
|
||||
save_region.Bottom = CON.SBI.srWindow.Bottom;
|
||||
save_region.Right = CON.SBI.srWindow.Right;
|
||||
|
||||
save_size.X = (SHORT) (save_region.Right - save_region.Left + 1);
|
||||
save_size.Y = (SHORT) (save_region.Bottom - save_region.Top + 1);
|
||||
|
||||
bufferCoord.X = bufferCoord.Y = 0;
|
||||
|
||||
if (ReadConsoleOutput(CON.hdl,
|
||||
save_screen,
|
||||
save_size,
|
||||
bufferCoord,
|
||||
&save_region)) {
|
||||
int i, j;
|
||||
int ij = 0;
|
||||
int k = 0;
|
||||
|
||||
for (i = save_region.Top; i <= save_region.Bottom; ++i) {
|
||||
for (j = save_region.Left; j <= save_region.Right; ++j) {
|
||||
output[k++] = save_screen[ij++].Char.AsciiChar;
|
||||
}
|
||||
output[k++] = '\n';
|
||||
}
|
||||
output[k] = 0;
|
||||
|
||||
T(("DUMP: %d,%d - %d,%d",
|
||||
save_region.Top,
|
||||
save_region.Left,
|
||||
save_region.Bottom,
|
||||
save_region.Right));
|
||||
T(("%s", output));
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#define dump_screen(fn,ln) /* nothing */
|
||||
#endif
|
||||
|
||||
#if USE_WIDEC_SUPPORT
|
||||
/*
|
||||
* TODO: support surrogate pairs
|
||||
* TODO: support combining characters
|
||||
* TODO: support acsc
|
||||
* TODO: check wcwidth of base character, fill if needed for double-width
|
||||
* TODO: _nc_wacs should be part of sp.
|
||||
*/
|
||||
static BOOL
|
||||
@ -205,14 +262,14 @@ con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit)
|
||||
++actual;
|
||||
}
|
||||
|
||||
loc.X = (short) 0;
|
||||
loc.Y = (short) 0;
|
||||
siz.X = (short) actual;
|
||||
loc.X = (SHORT) 0;
|
||||
loc.Y = (SHORT) 0;
|
||||
siz.X = (SHORT) actual;
|
||||
siz.Y = 1;
|
||||
|
||||
rec.Left = (short) x;
|
||||
rec.Left = (SHORT) x;
|
||||
rec.Top = (SHORT) (y + AdjustY());
|
||||
rec.Right = (short) (x + limit - 1);
|
||||
rec.Right = (SHORT) (x + limit - 1);
|
||||
rec.Bottom = rec.Top;
|
||||
|
||||
return WriteConsoleOutputW(CON.hdl, ci, siz, loc, &rec);
|
||||
@ -351,34 +408,30 @@ static bool
|
||||
restore_original_screen(void)
|
||||
{
|
||||
COORD bufferCoord;
|
||||
SMALL_RECT writeRegion;
|
||||
bool result = FALSE;
|
||||
SMALL_RECT save_region = CON.save_region;
|
||||
|
||||
if (CON.window_only) {
|
||||
writeRegion.Top = CON.SBI.srWindow.Top;
|
||||
writeRegion.Left = CON.SBI.srWindow.Left;
|
||||
writeRegion.Bottom = CON.SBI.srWindow.Bottom;
|
||||
writeRegion.Right = CON.SBI.srWindow.Right;
|
||||
T(("... restoring window"));
|
||||
} else {
|
||||
writeRegion.Top = 0;
|
||||
writeRegion.Left = 0;
|
||||
writeRegion.Bottom = (SHORT) (CON.SBI.dwSize.Y - 1);
|
||||
writeRegion.Right = (SHORT) (CON.SBI.dwSize.X - 1);
|
||||
T(("... restoring entire buffer"));
|
||||
}
|
||||
T(("... restoring %s", CON.window_only ? "window" : "entire buffer"));
|
||||
|
||||
bufferCoord.X = bufferCoord.Y = 0;
|
||||
|
||||
if (WriteConsoleOutput(CON.hdl,
|
||||
CON.save_screen,
|
||||
CON.SBI.dwSize,
|
||||
CON.save_size,
|
||||
bufferCoord,
|
||||
&writeRegion)) {
|
||||
&save_region)) {
|
||||
result = TRUE;
|
||||
mvcur(-1, -1, LINES - 2, 0);
|
||||
T(("... restore original screen contents ok %dx%d (%d,%d - %d,%d)",
|
||||
CON.save_size.Y,
|
||||
CON.save_size.X,
|
||||
save_region.Top,
|
||||
save_region.Left,
|
||||
save_region.Bottom,
|
||||
save_region.Right));
|
||||
} else {
|
||||
T(("... restore original screen contents err"));
|
||||
}
|
||||
T(("... restore original screen contents %s", result ? "ok" : "err"));
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -406,6 +459,23 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
|
||||
Height = screen_lines(sp);
|
||||
nonempty = min(Height, NewScreen(sp)->_maxy + 1);
|
||||
|
||||
T(("... %dx%d clear cur:%d new:%d",
|
||||
Height, Width,
|
||||
CurScreen(sp)->_clear,
|
||||
NewScreen(sp)->_clear));
|
||||
|
||||
if (SP_PARM->_endwin) {
|
||||
|
||||
T(("coming back from shell mode"));
|
||||
NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG);
|
||||
|
||||
NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG);
|
||||
NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG);
|
||||
SP_PARM->_mouse_resume(SP_PARM);
|
||||
|
||||
SP_PARM->_endwin = FALSE;
|
||||
}
|
||||
|
||||
if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) {
|
||||
int x;
|
||||
#if USE_WIDEC_SUPPORT
|
||||
@ -433,6 +503,8 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
|
||||
CurScreen(sp)->_clear = FALSE;
|
||||
NewScreen(sp)->_clear = FALSE;
|
||||
touchwin(NewScreen(sp));
|
||||
T(("... cleared %dx%d lines @%d of screen", nonempty, Width,
|
||||
AdjustY()));
|
||||
}
|
||||
|
||||
for (y = 0; y < nonempty; y++) {
|
||||
@ -562,11 +634,12 @@ wcon_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB,
|
||||
int beepFlag GCC_UNUSED)
|
||||
{
|
||||
SCREEN *sp;
|
||||
int res = ERR;
|
||||
int res = OK;
|
||||
|
||||
AssertTCB();
|
||||
SetSP();
|
||||
|
||||
MessageBeep(MB_ICONWARNING); /* MB_OK might be better */
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -807,6 +880,7 @@ wcon_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag)
|
||||
code = OK;
|
||||
}
|
||||
}
|
||||
T(("... buffered:%d, clear:%d", CON.buffered, CurScreen(sp)->_clear));
|
||||
} else { /* shell mode */
|
||||
if (defFlag) {
|
||||
/* def_shell_mode */
|
||||
@ -827,7 +901,7 @@ wcon_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag)
|
||||
}
|
||||
}
|
||||
|
||||
return (code);
|
||||
returnCode(code);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -893,85 +967,78 @@ wcon_release(TERMINAL_CONTROL_BLOCK * TCB)
|
||||
returnVoid;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to save the screen contents. PDCurses does this if
|
||||
* PDC_RESTORE_SCREEN is set, giving the same visual appearance on restoration
|
||||
* as if the library had allocated a console buffer.
|
||||
*/
|
||||
static bool
|
||||
save_original_screen(void)
|
||||
read_screen_data(void)
|
||||
{
|
||||
bool result = FALSE;
|
||||
COORD bufferSize;
|
||||
COORD bufferCoord;
|
||||
SMALL_RECT readRegion;
|
||||
size_t want;
|
||||
|
||||
bufferSize.X = CON.SBI.dwSize.X;
|
||||
bufferSize.Y = CON.SBI.dwSize.Y;
|
||||
want = (size_t) (bufferSize.X * bufferSize.Y);
|
||||
CON.save_size.X = (SHORT) (CON.save_region.Right
|
||||
- CON.save_region.Left + 1);
|
||||
CON.save_size.Y = (SHORT) (CON.save_region.Bottom
|
||||
- CON.save_region.Top + 1);
|
||||
|
||||
want = (size_t) (CON.save_size.X * CON.save_size.Y);
|
||||
|
||||
if ((CON.save_screen = malloc(want * sizeof(CHAR_INFO))) != 0) {
|
||||
bufferCoord.X = bufferCoord.Y = 0;
|
||||
|
||||
readRegion.Top = 0;
|
||||
readRegion.Left = 0;
|
||||
readRegion.Bottom = (SHORT) (bufferSize.Y - 1);
|
||||
readRegion.Right = (SHORT) (bufferSize.X - 1);
|
||||
|
||||
T(("... reading console buffer %dx%d into %d,%d - %d,%d at %d,%d",
|
||||
bufferSize.Y, bufferSize.X,
|
||||
readRegion.Top,
|
||||
readRegion.Left,
|
||||
readRegion.Bottom,
|
||||
readRegion.Right,
|
||||
T(("... reading console %s %dx%d into %d,%d - %d,%d at %d,%d",
|
||||
CON.window_only ? "window" : "buffer",
|
||||
CON.save_size.Y, CON.save_size.X,
|
||||
CON.save_region.Top,
|
||||
CON.save_region.Left,
|
||||
CON.save_region.Bottom,
|
||||
CON.save_region.Right,
|
||||
bufferCoord.Y,
|
||||
bufferCoord.X));
|
||||
|
||||
if (ReadConsoleOutput(CON.hdl,
|
||||
CON.save_screen,
|
||||
bufferSize,
|
||||
CON.save_size,
|
||||
bufferCoord,
|
||||
&readRegion)) {
|
||||
&CON.save_region)) {
|
||||
result = TRUE;
|
||||
} else {
|
||||
T((" error %#lx", (unsigned long) GetLastError()));
|
||||
FreeAndNull(CON.save_screen);
|
||||
}
|
||||
}
|
||||
|
||||
bufferSize.X = (SHORT) (CON.SBI.srWindow.Right
|
||||
- CON.SBI.srWindow.Left + 1);
|
||||
bufferSize.Y = (SHORT) (CON.SBI.srWindow.Bottom
|
||||
- CON.SBI.srWindow.Top + 1);
|
||||
want = (size_t) (bufferSize.X * bufferSize.Y);
|
||||
return result;
|
||||
}
|
||||
|
||||
if ((CON.save_screen = malloc(want * sizeof(CHAR_INFO))) != 0) {
|
||||
bufferCoord.X = bufferCoord.Y = 0;
|
||||
/*
|
||||
* Attempt to save the screen contents. PDCurses does this if
|
||||
* PDC_RESTORE_SCREEN is set, giving the same visual appearance on
|
||||
* restoration as if the library had allocated a console buffer. MSDN
|
||||
* says that the data which can be read is limited to 64Kb (and may be
|
||||
* less).
|
||||
*/
|
||||
static bool
|
||||
save_original_screen(void)
|
||||
{
|
||||
bool result = FALSE;
|
||||
|
||||
readRegion.Top = CON.SBI.srWindow.Top;
|
||||
readRegion.Left = CON.SBI.srWindow.Left;
|
||||
readRegion.Bottom = CON.SBI.srWindow.Bottom;
|
||||
readRegion.Right = CON.SBI.srWindow.Right;
|
||||
CON.save_region.Top = 0;
|
||||
CON.save_region.Left = 0;
|
||||
CON.save_region.Bottom = (SHORT) (CON.SBI.dwSize.Y - 1);
|
||||
CON.save_region.Right = (SHORT) (CON.SBI.dwSize.X - 1);
|
||||
|
||||
T(("... reading console window %dx%d into %d,%d - %d,%d at %d,%d",
|
||||
bufferSize.Y, bufferSize.X,
|
||||
readRegion.Top,
|
||||
readRegion.Left,
|
||||
readRegion.Bottom,
|
||||
readRegion.Right,
|
||||
bufferCoord.Y,
|
||||
bufferCoord.X));
|
||||
if (read_screen_data()) {
|
||||
result = TRUE;
|
||||
} else {
|
||||
|
||||
if (ReadConsoleOutput(CON.hdl,
|
||||
CON.save_screen,
|
||||
bufferSize,
|
||||
bufferCoord,
|
||||
&readRegion)) {
|
||||
result = TRUE;
|
||||
CON.window_only = TRUE;
|
||||
} else {
|
||||
T((" error %#lx", (unsigned long) GetLastError()));
|
||||
}
|
||||
}
|
||||
CON.save_region.Top = CON.SBI.srWindow.Top;
|
||||
CON.save_region.Left = CON.SBI.srWindow.Left;
|
||||
CON.save_region.Bottom = CON.SBI.srWindow.Bottom;
|
||||
CON.save_region.Right = CON.SBI.srWindow.Right;
|
||||
|
||||
CON.window_only = TRUE;
|
||||
|
||||
if (read_screen_data()) {
|
||||
result = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1208,11 +1275,11 @@ tdiff(FILETIME fstart, FILETIME fend)
|
||||
static int
|
||||
Adjust(int milliseconds, int diff)
|
||||
{
|
||||
if (milliseconds == INFINITY)
|
||||
return milliseconds;
|
||||
milliseconds -= diff;
|
||||
if (milliseconds < 0)
|
||||
milliseconds = 0;
|
||||
if (milliseconds != INFINITY) {
|
||||
milliseconds -= diff;
|
||||
if (milliseconds < 0)
|
||||
milliseconds = 0;
|
||||
}
|
||||
return milliseconds;
|
||||
}
|
||||
|
||||
@ -1641,17 +1708,21 @@ _ismintty(int fd, LPHANDLE pMinTTY)
|
||||
#endif
|
||||
|
||||
/* Borrowed from ansicon project.
|
||||
Check wether or not a I/O handle is associated with
|
||||
Check whether or not an I/O handle is associated with
|
||||
a Windows console.
|
||||
*/
|
||||
static BOOL
|
||||
IsConsoleHandle(HANDLE hdl)
|
||||
{
|
||||
DWORD dwFlag = 0;
|
||||
BOOL result;
|
||||
|
||||
if (!GetConsoleMode(hdl, &dwFlag)) {
|
||||
return (int) WriteConsoleA(hdl, NULL, 0, &dwFlag, NULL);
|
||||
result = (int) WriteConsoleA(hdl, NULL, 0, &dwFlag, NULL);
|
||||
} else {
|
||||
result = (int) (dwFlag & ENABLE_PROCESSED_OUTPUT);
|
||||
}
|
||||
return (int) (dwFlag & ENABLE_PROCESSED_OUTPUT);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Our replacement for the systems _isatty to include also
|
||||
@ -1661,13 +1732,16 @@ IsConsoleHandle(HANDLE hdl)
|
||||
int
|
||||
_nc_mingw_isatty(int fd)
|
||||
{
|
||||
if (_isatty(fd))
|
||||
return 1;
|
||||
#if WINVER < 0x0600
|
||||
return 0;
|
||||
#else
|
||||
return _ismintty(fd, NULL);
|
||||
int result = 0;
|
||||
|
||||
if (_isatty(fd)) {
|
||||
result = 1;
|
||||
} else {
|
||||
#if WINVER >= 0x0600
|
||||
result = _ismintty(fd, NULL);
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* This is used when running in terminfo mode to discover,
|
||||
@ -1693,15 +1767,15 @@ _nc_mingw_isconsole(int fd)
|
||||
SCREEN *sp; \
|
||||
TERMINAL *term = 0; \
|
||||
int code = ERR; \
|
||||
if (_nc_screen_chain==0) \
|
||||
return 0; \
|
||||
if (_nc_screen_chain == 0) \
|
||||
return 0; \
|
||||
for (each_screen(sp)) { \
|
||||
if (sp->_term && sp->_term->Filedes==fd) { \
|
||||
term = sp->_term; \
|
||||
break; \
|
||||
if (sp->_term && (sp->_term->Filedes == fd)) { \
|
||||
term = sp->_term; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
assert(term!=0)
|
||||
assert(term != 0)
|
||||
|
||||
int
|
||||
_nc_mingw_tcsetattr(
|
||||
@ -1855,6 +1929,7 @@ __attribute__((constructor))
|
||||
BOOL buffered = TRUE;
|
||||
BOOL b;
|
||||
|
||||
START_TRACE();
|
||||
if (_nc_mingw_isatty(0)) {
|
||||
CON.isMinTTY = TRUE;
|
||||
}
|
||||
@ -1896,9 +1971,11 @@ __attribute__((constructor))
|
||||
b = AttachConsole(ATTACH_PARENT_PROCESS);
|
||||
|
||||
if (getenv("NCGDB") || getenv("NCURSES_CONSOLE2")) {
|
||||
CON.hdl = CON.out;
|
||||
T(("... will not buffer console"));
|
||||
buffered = FALSE;
|
||||
CON.hdl = CON.out;
|
||||
} else {
|
||||
T(("... creating console buffer"));
|
||||
CON.hdl = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -1,8 +1,8 @@
|
||||
ncurses6 (5.9-20140802) unstable; urgency=low
|
||||
ncurses6 (5.9-20140809) unstable; urgency=low
|
||||
|
||||
* latest weekly patch
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 01 Aug 2014 19:41:10 -0400
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 08 Aug 2014 20:33:11 -0400
|
||||
|
||||
ncurses6 (5.9-20131005) unstable; urgency=low
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
ncurses6 (5.9-20140802) unstable; urgency=low
|
||||
ncurses6 (5.9-20140809) unstable; urgency=low
|
||||
|
||||
* latest weekly patch
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 01 Aug 2014 19:41:10 -0400
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 08 Aug 2014 20:33:11 -0400
|
||||
|
||||
ncurses6 (5.9-20131005) unstable; urgency=low
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
ncurses6 (5.9-20140802) unstable; urgency=low
|
||||
ncurses6 (5.9-20140809) unstable; urgency=low
|
||||
|
||||
* latest weekly patch
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 01 Aug 2014 19:41:10 -0400
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 08 Aug 2014 20:33:11 -0400
|
||||
|
||||
ncurses6 (5.9-20120608) unstable; urgency=low
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
; $Id: mingw-ncurses.nsi,v 1.54 2014/08/01 23:41:10 tom Exp $
|
||||
; $Id: mingw-ncurses.nsi,v 1.55 2014/08/09 00:33:11 tom Exp $
|
||||
|
||||
; TODO add examples
|
||||
; TODO bump ABI to 6
|
||||
@ -10,7 +10,7 @@
|
||||
!define VERSION_MAJOR "5"
|
||||
!define VERSION_MINOR "9"
|
||||
!define VERSION_YYYY "2014"
|
||||
!define VERSION_MMDD "0802"
|
||||
!define VERSION_MMDD "0809"
|
||||
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
|
||||
|
||||
!define MY_ABI "5"
|
||||
|
@ -3,7 +3,7 @@
|
||||
Summary: shared libraries for terminal handling
|
||||
Name: mingw32-ncurses6
|
||||
Version: 5.9
|
||||
Release: 20140802
|
||||
Release: 20140809
|
||||
License: X11
|
||||
Group: Development/Libraries
|
||||
Source: ncurses-%{version}-%{release}.tgz
|
||||
|
@ -1,7 +1,7 @@
|
||||
Summary: shared libraries for terminal handling
|
||||
Name: ncurses6
|
||||
Version: 5.9
|
||||
Release: 20140802
|
||||
Release: 20140809
|
||||
License: X11
|
||||
Group: Development/Libraries
|
||||
Source: ncurses-%{version}-%{release}.tgz
|
||||
|
@ -26,7 +26,7 @@
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: background.c,v 1.14 2014/02/01 22:10:42 tom Exp $
|
||||
* $Id: background.c,v 1.15 2014/08/09 22:31:23 tom Exp $
|
||||
*/
|
||||
|
||||
#define NEED_COLOR_CODE 1
|
||||
@ -65,7 +65,7 @@ test_background(void)
|
||||
printw("Initializing pair 3 to %s/cyan (ACS_HLINE)\n", color_name(default_fg));
|
||||
init_pair(3, (NCURSES_COLOR_T) default_fg, COLOR_CYAN);
|
||||
printw("...and drawing a box which should be followed by lines\n");
|
||||
bkgdset(ACS_HLINE | COLOR_PAIR(3));
|
||||
bkgdset(ACS_HLINE | (attr_t) COLOR_PAIR(3));
|
||||
/*
|
||||
* Characters from vt100 line-drawing should be mapped to line-drawing,
|
||||
* since A_ALTCHARSET is set in the background, and the character part
|
||||
|
20
test/bs.c
20
test/bs.c
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -34,7 +34,7 @@
|
||||
* v2.0 featuring strict ANSI/POSIX conformance, November 1993.
|
||||
* v2.1 with ncurses mouse support, September 1995
|
||||
*
|
||||
* $Id: bs.c,v 1.62 2013/11/16 19:57:56 tom Exp $
|
||||
* $Id: bs.c,v 1.63 2014/08/09 22:27:12 tom Exp $
|
||||
*/
|
||||
|
||||
#include <test.priv.h>
|
||||
@ -369,7 +369,7 @@ initgame(void)
|
||||
MvAddCh(PYBASE + i, PXBASE - 3, (chtype) (i + 'A'));
|
||||
#ifdef A_COLOR
|
||||
if (has_colors())
|
||||
attron((attr_t) COLOR_PAIR(COLOR_BLUE));
|
||||
attron(COLOR_PAIR(COLOR_BLUE));
|
||||
#endif /* A_COLOR */
|
||||
(void) addch(' ');
|
||||
for (j = 0; j < BWIDTH; j++)
|
||||
@ -387,7 +387,7 @@ initgame(void)
|
||||
MvAddCh(CYBASE + i, CXBASE - 3, (chtype) (i + 'A'));
|
||||
#ifdef A_COLOR
|
||||
if (has_colors())
|
||||
attron((attr_t) COLOR_PAIR(COLOR_BLUE));
|
||||
attron(COLOR_PAIR(COLOR_BLUE));
|
||||
#endif /* A_COLOR */
|
||||
(void) addch(' ');
|
||||
for (j = 0; j < BWIDTH; j++)
|
||||
@ -771,7 +771,7 @@ hitship(int x, int y)
|
||||
cgoto(y1, x1);
|
||||
#ifdef A_COLOR
|
||||
if (has_colors())
|
||||
attron((attr_t) COLOR_PAIR(COLOR_GREEN));
|
||||
attron(COLOR_PAIR(COLOR_GREEN));
|
||||
#endif /* A_COLOR */
|
||||
(void) addch(MARK_MISS);
|
||||
#ifdef A_COLOR
|
||||
@ -797,7 +797,7 @@ hitship(int x, int y)
|
||||
pgoto(y1, x1);
|
||||
#ifdef A_COLOR
|
||||
if (has_colors())
|
||||
attron((attr_t) COLOR_PAIR(COLOR_RED));
|
||||
attron(COLOR_PAIR(COLOR_RED));
|
||||
#endif /* A_COLOR */
|
||||
(void) addch(SHOWHIT);
|
||||
#ifdef A_COLOR
|
||||
@ -836,9 +836,9 @@ plyturn(void)
|
||||
#ifdef A_COLOR
|
||||
if (has_colors()) {
|
||||
if (hit)
|
||||
attron((attr_t) COLOR_PAIR(COLOR_RED));
|
||||
attron(COLOR_PAIR(COLOR_RED));
|
||||
else
|
||||
attron((attr_t) COLOR_PAIR(COLOR_GREEN));
|
||||
attron(COLOR_PAIR(COLOR_GREEN));
|
||||
}
|
||||
#endif /* A_COLOR */
|
||||
(void) addch((chtype) hits[PLAYER][curx][cury]);
|
||||
@ -969,9 +969,9 @@ cpufire(int x, int y)
|
||||
#ifdef A_COLOR
|
||||
if (has_colors()) {
|
||||
if (hit)
|
||||
attron((attr_t) COLOR_PAIR(COLOR_RED));
|
||||
attron(COLOR_PAIR(COLOR_RED));
|
||||
else
|
||||
attron((attr_t) COLOR_PAIR(COLOR_GREEN));
|
||||
attron(COLOR_PAIR(COLOR_GREEN));
|
||||
}
|
||||
#endif /* A_COLOR */
|
||||
(void) addch((chtype) (hit ? SHOWHIT : SHOWSPLASH));
|
||||
|
@ -29,7 +29,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey
|
||||
*
|
||||
* $Id: dots_curses.c,v 1.2 2014/06/28 20:33:24 tom Exp $
|
||||
* $Id: dots_curses.c,v 1.3 2014/08/09 22:28:42 tom Exp $
|
||||
*
|
||||
* A simple demo of the curses interface used for comparison with termcap.
|
||||
*/
|
||||
@ -82,7 +82,7 @@ set_colors(int fg, int bg)
|
||||
{
|
||||
int pair = mypair(fg, bg);
|
||||
if (pair > 0) {
|
||||
attron((attr_t) COLOR_PAIR(mypair(fg, bg)));
|
||||
attron(COLOR_PAIR(mypair(fg, bg)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ main(int argc GCC_UNUSED,
|
||||
z = (int) (ranf() * COLORS);
|
||||
if (ranf() > 0.01) {
|
||||
set_colors(fg = z, bg);
|
||||
attron((attr_t) COLOR_PAIR(mypair(fg, bg)));
|
||||
attron(COLOR_PAIR(mypair(fg, bg)));
|
||||
} else {
|
||||
set_colors(fg, bg = z);
|
||||
napms(1);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 2006-2010,2012 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 2006-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -26,7 +26,7 @@
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: echochar.c,v 1.9 2012/06/09 20:30:32 tom Exp $
|
||||
* $Id: echochar.c,v 1.10 2014/08/09 22:35:51 tom Exp $
|
||||
*
|
||||
* Demonstrate the echochar function (compare to dots.c).
|
||||
* Thomas Dickey - 2006/11/4
|
||||
@ -74,7 +74,7 @@ set_color(char *my_pairs, int fg, int bg)
|
||||
(short) fg,
|
||||
(short) bg);
|
||||
}
|
||||
attron((attr_t) COLOR_PAIR(pair));
|
||||
attron(COLOR_PAIR(pair));
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -29,7 +29,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey <dickey@clark.net> 1998
|
||||
*
|
||||
* $Id: filter.c,v 1.15 2012/06/09 20:30:32 tom Exp $
|
||||
* $Id: filter.c,v 1.16 2014/08/09 22:35:51 tom Exp $
|
||||
*/
|
||||
#include <test.priv.h>
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
static int
|
||||
new_command(char *buffer, int length, attr_t underline)
|
||||
new_command(char *buffer, int length, int underline)
|
||||
{
|
||||
int code;
|
||||
|
||||
@ -99,7 +99,7 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int ch;
|
||||
char buffer[80];
|
||||
attr_t underline;
|
||||
int underline;
|
||||
bool i_option = FALSE;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
@ -133,7 +133,7 @@ main(int argc, char *argv[])
|
||||
background = -1;
|
||||
#endif
|
||||
init_pair(1, COLOR_CYAN, (short) background);
|
||||
underline = (attr_t) COLOR_PAIR(1);
|
||||
underline = COLOR_PAIR(1);
|
||||
} else {
|
||||
underline = A_UNDERLINE;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
* modified 10-18-89 for curses (jrl)
|
||||
* 10-18-89 added signal handling
|
||||
*
|
||||
* $Id: gdc.c,v 1.41 2014/08/02 16:36:20 tom Exp $
|
||||
* $Id: gdc.c,v 1.42 2014/08/09 22:28:42 tom Exp $
|
||||
*/
|
||||
|
||||
#include <test.priv.h>
|
||||
@ -121,13 +121,13 @@ standt(int on)
|
||||
{
|
||||
if (on) {
|
||||
if (hascolor) {
|
||||
attron((attr_t) COLOR_PAIR(PAIR_DIGITS));
|
||||
attron(COLOR_PAIR(PAIR_DIGITS));
|
||||
} else {
|
||||
attron(A_STANDOUT);
|
||||
}
|
||||
} else {
|
||||
if (hascolor) {
|
||||
attron((attr_t) COLOR_PAIR(PAIR_OTHERS));
|
||||
attron(COLOR_PAIR(PAIR_OTHERS));
|
||||
} else {
|
||||
attroff(A_STANDOUT);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ AUTHOR
|
||||
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
|
||||
Thomas E. Dickey (beginning revision 1.27 in 1996).
|
||||
|
||||
$Id: ncurses.c,v 1.414 2014/08/02 23:10:26 tom Exp $
|
||||
$Id: ncurses.c,v 1.415 2014/08/09 22:28:42 tom Exp $
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -2235,13 +2235,13 @@ color_test(void)
|
||||
NCURSES_COLOR_T bg = InxToBG(i);
|
||||
|
||||
init_pair(pair, fg, bg);
|
||||
attron((attr_t) COLOR_PAIR(pair));
|
||||
attron(COLOR_PAIR(pair));
|
||||
if (opt_acsc)
|
||||
attron((attr_t) A_ALTCHARSET);
|
||||
attron(A_ALTCHARSET);
|
||||
if (opt_bold)
|
||||
attron((attr_t) A_BOLD);
|
||||
attron(A_BOLD);
|
||||
if (opt_revs)
|
||||
attron((attr_t) A_REVERSE);
|
||||
attron(A_REVERSE);
|
||||
|
||||
if (opt_nums) {
|
||||
sprintf(numbered, "{%02X}", (int) i);
|
||||
@ -2446,11 +2446,11 @@ wide_color_test(void)
|
||||
init_pair(pair, InxToFG(i), InxToBG(i));
|
||||
(void) color_set(pair, NULL);
|
||||
if (opt_acsc)
|
||||
attr_on((attr_t) A_ALTCHARSET, NULL);
|
||||
attr_on(A_ALTCHARSET, NULL);
|
||||
if (opt_bold)
|
||||
attr_on((attr_t) A_BOLD, NULL);
|
||||
attr_on(A_BOLD, NULL);
|
||||
if (opt_revs)
|
||||
attr_on((attr_t) A_REVERSE, NULL);
|
||||
attr_on(A_REVERSE, NULL);
|
||||
|
||||
if (opt_nums) {
|
||||
sprintf(numbered, "{%02X}", i);
|
||||
|
Loading…
Reference in New Issue
Block a user