// * This makes emacs happy -*-Mode: C++;-*-
// vile:cppmode
/****************************************************************************
- * Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 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 *
#ifndef NCURSES_CURSESW_H_incl
#define NCURSES_CURSESW_H_incl 1
-// $Id: cursesw.h,v 1.49 2011/09/17 22:12:10 tom Exp $
-
-#include <etip.h>
+// $Id: cursesw.h,v 1.53 2017/11/21 00:37:23 tom Exp $
extern "C" {
# include <curses.h>
}
+#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
#endif
#ifdef chgat
-inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) {
+inline int UNDEF(chgat)(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
return chgat(n, attr, color, opts); }
#undef chgat
#define chgat UNDEF(chgat)
#endif
#ifdef color_set
-inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, opts); }
+inline chtype UNDEF(color_set)(NCURSES_PAIRS_T p, void* opts) { return color_set(p, opts); }
#undef color_set
#define color_set UNDEF(color_set)
#endif
#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
#ifdef mvchgat
inline int UNDEF(mvchgat)(int y, int x, int n,
- attr_t attr, short color, const void *opts) {
+ attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
return mvchgat(y, x, n, attr, color, opts); }
#undef mvchgat
#define mvchgat UNDEF(mvchgat)
#ifdef mvwchgat
inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n,
- attr_t attr, short color, const void *opts) {
+ attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
return mvwchgat(win, y, x, n, attr, color, opts); }
#undef mvwchgat
#define mvwchgat UNDEF(mvwchgat)
void set_keyboard();
- short getcolor(int getback) const;
- short getPair() const;
+ NCURSES_COLOR_T getcolor(int getback) const;
+ NCURSES_PAIRS_T getPair() const;
- static int setpalette(short fore, short back, short pair);
+ static int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back, NCURSES_PAIRS_T pair);
static int colorInitialized;
// This private constructor is only used during the initialization
int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; }
// Largest y coord in window
- short getcolor() const;
+ NCURSES_PAIRS_T getcolor() const;
// Actual color pair
- short foreground() const { return getcolor(0); }
+ NCURSES_COLOR_T foreground() const { return getcolor(0); }
// Actual foreground color
- short background() const { return getcolor(1); }
+ NCURSES_COLOR_T background() const { return getcolor(1); }
// Actual background color
- int setpalette(short fore, short back);
+ int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back);
// Set color palette entry
- int setcolor(short pair);
+ int setcolor(NCURSES_PAIRS_T pair);
// Set actually used palette entry
// -------------------------------------------------------------------------
chtype attrget() { return ::getattrs(w); }
// Get the window attributes;
- int color_set(short color_pair_number, void* opts=NULL) {
+ int color_set(NCURSES_PAIRS_T color_pair_number, void* opts=NULL) {
return ::wcolor_set(w, color_pair_number, opts); }
// Set the window color attribute;
- int chgat(int n, attr_t attr, short color, const void *opts=NULL) {
+ int chgat(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) {
return ::wchgat(w, n, attr, color, opts); }
// Change the attributes of the next n characters in the current line. If
// n is negative or greater than the number of remaining characters in the
// line, the attributes will be changed up to the end of the line.
int chgat(int y, int x,
- int n, attr_t attr, short color, const void *opts=NULL) {
+ int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) {
return ::mvwchgat(w, y, x, n, attr, color, opts); }
// Move the cursor to the requested position and then perform chgat() as
// described above.
// 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 {