Avoid potential conflict with ncurses by having apps define PDC_NCMOUSE

before including curses.h, to invoke the ncurses-style mouse interface,
instead of NCURSES_MOUSE_VERSION. (The old way will also still work.)
After Simon Sobisch (see PR #33).
This commit is contained in:
William McBrine
2018-12-28 10:42:15 -05:00
parent 83105e85de
commit 2b9bb5d0c8
3 changed files with 18 additions and 14 deletions

View File

@@ -16,8 +16,8 @@ PDCurses definitions list: (Only define those needed)
(Red = 1, Green = 2, Blue = 4) instead of BGR.
PDC_WIDE True if building wide-character support.
PDC_DLL_BUILD True if building a Windows DLL.
NCURSES_MOUSE_VERSION Use the ncurses mouse API instead
of PDCurses' traditional mouse API.
PDC_NCMOUSE Use the ncurses mouse API instead
of PDCurses' traditional mouse API.
PDCurses portable platform definitions list:
@@ -216,6 +216,10 @@ typedef struct
in the same format as used for mousemask() */
} MEVENT;
#if defined(PDC_NCMOUSE) && !defined(NCURSES_MOUSE_VERSION)
# define NCURSES_MOUSE_VERSION 2
#endif
#ifdef NCURSES_MOUSE_VERSION
# define BUTTON_SHIFT BUTTON_MODIFIER_SHIFT
# define BUTTON_CONTROL BUTTON_MODIFIER_CONTROL

View File

@@ -8,8 +8,8 @@ PDCurses definitions list: (Only define those needed)
(Red = 1, Green = 2, Blue = 4) instead of BGR.
PDC_WIDE True if building wide-character support.
PDC_DLL_BUILD True if building a Windows DLL.
NCURSES_MOUSE_VERSION Use the ncurses mouse API instead
of PDCurses' traditional mouse API.
PDC_NCMOUSE Use the ncurses mouse API instead
of PDCurses' traditional mouse API.
PDCurses portable platform definitions list:
@@ -1782,11 +1782,11 @@ mouse
nc_getmouse() returns the current mouse status in an MEVENT
struct. This is equivalent to ncurses' getmouse(), renamed to
avoid conflict with PDCurses' getmouse(). But if you define
NCURSES_MOUSE_VERSION (preferably as 2) before including
curses.h, it defines getmouse() to nc_getmouse(), along with a
few other redefintions needed for compatibility with ncurses
code. nc_getmouse() calls request_mouse_pos(), which (not
getmouse()) is the classic equivalent.
PDC_NCMOUSE before including curses.h, it defines getmouse() to
nc_getmouse(), along with a few other redefintions needed for
compatibility with ncurses code. nc_getmouse() calls
request_mouse_pos(), which (not getmouse()) is the classic
equivalent.
ungetmouse() is the mouse equivalent of ungetch(). However,
PDCurses doesn't maintain a queue of mouse events; only one can

View File

@@ -120,11 +120,11 @@ mouse
nc_getmouse() returns the current mouse status in an MEVENT
struct. This is equivalent to ncurses' getmouse(), renamed to
avoid conflict with PDCurses' getmouse(). But if you define
NCURSES_MOUSE_VERSION (preferably as 2) before including
curses.h, it defines getmouse() to nc_getmouse(), along with a
few other redefintions needed for compatibility with ncurses
code. nc_getmouse() calls request_mouse_pos(), which (not
getmouse()) is the classic equivalent.
PDC_NCMOUSE before including curses.h, it defines getmouse() to
nc_getmouse(), along with a few other redefintions needed for
compatibility with ncurses code. nc_getmouse() calls
request_mouse_pos(), which (not getmouse()) is the classic
equivalent.
ungetmouse() is the mouse equivalent of ungetch(). However,
PDCurses doesn't maintain a queue of mouse events; only one can