libncurses: Import https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz changes
Change-Id: I3433d30ca01359fd2e3623ede96b531f0b39cbfa
Signed-off-by: micky387 <mickaelsaibi@free.fr>
diff --git a/c++/cursesw.h b/c++/cursesw.h
index ca07b04..eef5a63 100644
--- a/c++/cursesw.h
+++ b/c++/cursesw.h
@@ -1,7 +1,8 @@
// * This makes emacs happy -*-Mode: C++;-*-
// vile:cppmode
/****************************************************************************
- * Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. *
+ * Copyright 2019-2021,2022 Thomas E. Dickey *
+ * Copyright 1998-2014,2017 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,14 +32,25 @@
#ifndef NCURSES_CURSESW_H_incl
#define NCURSES_CURSESW_H_incl 1
-// $Id: cursesw.h,v 1.50 2014/02/01 22:17:37 tom Exp $
-
-#include <etip.h>
+// $Id: cursesw.h,v 1.59 2022/08/20 20:52:15 tom Exp $
extern "C" {
# include <curses.h>
}
+#if defined(BUILDING_NCURSES_CXX)
+# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
+#else
+# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
+#endif
+
+#define NCURSES_CXX_WRAPPED_VAR(type,name) extern NCURSES_CXX_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
+
+#define NCURSES_CXX_EXPORT(type) NCURSES_CXX_IMPEXP type NCURSES_API
+#define NCURSES_CXX_EXPORT_VAR(type) NCURSES_CXX_IMPEXP type
+
+#include <etip.h>
+
/* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro.
Undefine it here, because NCursesWindow uses lines as a method. */
#undef lines
@@ -324,6 +336,12 @@
#define intrflush UNDEF(intrflush)
#endif
+#ifdef is_linetouched
+inline int UNDEF(is_linetouched)(WINDOW *w, int l) { return is_linetouched(w,l); }
+#undef is_linetouched
+#define is_linetouched UNDEF(is_linetouched)
+#endif
+
#ifdef leaveok
inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); }
#undef leaveok
@@ -750,7 +768,7 @@
extern "C" int _nc_xx_ripoff_init(WINDOW *, int);
extern "C" int _nc_has_mouse(void);
-class NCURSES_IMPEXP NCursesWindow
+class NCURSES_CXX_IMPEXP NCursesWindow
{
friend class NCursesMenu;
friend class NCursesForm;
@@ -798,7 +816,7 @@
NCursesWindow();
public:
- NCursesWindow(WINDOW* window); // useful only for stdscr
+ explicit NCursesWindow(WINDOW* window); // useful only for stdscr
NCursesWindow(int nlines, // number of lines
int ncols, // number of columns
@@ -831,7 +849,7 @@
{
}
- virtual ~NCursesWindow();
+ virtual ~NCursesWindow() THROWS(NCursesException);
NCursesWindow Clone();
// Make an exact copy of the window.
@@ -1241,7 +1259,7 @@
// on the value of the changed flag.
bool is_linetouched(int line) const {
- return (::is_linetouched(w, line) ? TRUE:FALSE); }
+ return (::is_linetouched(w, line) == TRUE ? TRUE:FALSE); }
// Return TRUE if line is marked as changed, FALSE otherwise
bool is_wintouched() const {
@@ -1249,7 +1267,7 @@
// Return TRUE if window is marked as changed, FALSE otherwise
int leaveok(bool bf) { return ::leaveok(w, bf); }
- // If bf is TRUE, curses will leave the cursor after an update whereever
+ // If bf is TRUE, curses will leave the cursor after an update wherever
// it is after the update.
int redrawln(int from, int n) { return ::wredrawln(w, from, n); }
@@ -1364,10 +1382,10 @@
// -------------------------------------------------------------------------
// We leave this here for compatibility reasons.
// -------------------------------------------------------------------------
-class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow
+class NCURSES_CXX_IMPEXP NCursesColorWindow : public NCursesWindow
{
public:
- NCursesColorWindow(WINDOW* &window) // useful only for stdscr
+ explicit NCursesColorWindow(WINDOW* &window) // useful only for stdscr
: NCursesWindow(window) {
useColors(); }
@@ -1410,7 +1428,7 @@
// Pad Support. We allow an association of a pad with a "real" window
// through which the pad may be viewed.
// -------------------------------------------------------------------------
-class NCURSES_IMPEXP NCursesPad : public NCursesWindow
+class NCURSES_CXX_IMPEXP NCursesPad : public NCursesWindow
{
private:
NCursesWindow* viewWin; // the "viewport" window
@@ -1479,13 +1497,13 @@
{
}
- virtual ~NCursesPad() {}
+ virtual ~NCursesPad() THROWS(NCursesException) {}
int echochar(const chtype ch) { return ::pechochar(w, ch); }
// Put the attributed character onto the pad and immediately do a
// prefresh().
- int refresh();
+ int refresh() NCURSES_OVERRIDE;
// If a viewport is defined the pad is displayed in this window, otherwise
// this is a noop.
@@ -1499,7 +1517,7 @@
// on the screen. <b>refresh</b> copies a rectangle of this size beginning
// with top left corner pminrow,pmincol onto the screen and calls doupdate().
- int noutrefresh();
+ int noutrefresh() NCURSES_OVERRIDE;
// If a viewport is defined the pad is displayed in this window, otherwise
// this is a noop.
@@ -1526,10 +1544,10 @@
// A FramedPad is constructed always with a viewport window. This viewport
// will be framed (by a box() command) and the interior of the box is the
// viewport subwindow. On the frame we display scrollbar sliders.
-class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad
+class NCURSES_CXX_IMPEXP NCursesFramedPad : public NCursesPad
{
protected:
- virtual void OnOperation(int pad_req);
+ virtual void OnOperation(int pad_req) NCURSES_OVERRIDE;
public:
NCursesFramedPad(NCursesWindow& win, int nlines, int ncols,
@@ -1540,11 +1558,11 @@
}
// Construct the FramedPad with the given Window win as viewport.
- virtual ~NCursesFramedPad() {
+ virtual ~NCursesFramedPad() THROWS(NCursesException) {
delete getSubWindow();
}
- void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) {
+ void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) NCURSES_OVERRIDE {
(void) view;
(void) v_grid;
(void) h_grid;
@@ -1552,7 +1570,7 @@
}
// Disable this call; the viewport is already defined
- void setSubWindow(NCursesWindow& sub) {
+ void setSubWindow(NCursesWindow& sub) NCURSES_OVERRIDE {
(void) sub;
err_handler("Operation not allowed");
}