mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 06:32:36 +00:00
Merge branch 'master' of github.com:clangen/musikcube
This commit is contained in:
commit
df6a69b50e
2
src/3rdparty/bin
vendored
2
src/3rdparty/bin
vendored
@ -1 +1 @@
|
||||
Subproject commit f77857c24dec5e4d6d900995ed3d140088657eb6
|
||||
Subproject commit 31cd7109785075fc18ddb6319440c5cbb305e702
|
15
src/3rdparty/win32_include/curses.h
vendored
15
src/3rdparty/win32_include/curses.h
vendored
@ -42,7 +42,7 @@ PDCurses portable platform definitions list:
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#ifdef NO_STDINT_H
|
||||
#define uint64_t unsigned long long
|
||||
#define uint64_t unsigned __int64
|
||||
#define uint32_t unsigned long
|
||||
#define uint16_t unsigned short
|
||||
#else
|
||||
@ -56,7 +56,7 @@ PDCurses portable platform definitions list:
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION >= 199901L && \
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
|
||||
!defined(__bool_true_false_are_defined)
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
@ -116,11 +116,11 @@ typedef chtype attr_t;
|
||||
/* Don't forget to update 'version.mif' if MAJOR/MINOR changes! */
|
||||
|
||||
#define PDC_VER_MAJOR 4
|
||||
#define PDC_VER_MINOR 0
|
||||
#define PDC_VER_CHANGE 4
|
||||
#define PDC_VER_MINOR 1
|
||||
#define PDC_VER_CHANGE 0
|
||||
#define PDC_VER_YEAR 2019
|
||||
#define PDC_VER_MONTH 1
|
||||
#define PDC_VER_DAY 20
|
||||
#define PDC_VER_MONTH 5
|
||||
#define PDC_VER_DAY 8
|
||||
|
||||
#define PDC_BUILD (PDC_VER_MAJOR*1000 + PDC_VER_MINOR *100 + PDC_VER_CHANGE)
|
||||
|
||||
@ -1725,6 +1725,7 @@ PDCEX bool has_key(int);
|
||||
PDCEX int use_default_colors(void);
|
||||
PDCEX int wresize(WINDOW *, int, int);
|
||||
|
||||
PDCEX bool has_mouse(void);
|
||||
PDCEX int mouseinterval(int);
|
||||
PDCEX mmask_t mousemask(mmask_t, mmask_t *);
|
||||
PDCEX bool mouse_trafo(int *, int *, bool);
|
||||
@ -1789,8 +1790,8 @@ PDCEX int PDC_set_function_key( const unsigned function,
|
||||
const int new_key);
|
||||
|
||||
PDCEX int PDC_set_preferred_fontface( const wchar_t* fontface);
|
||||
PDCEX void PDC_set_default_menu_visibility( int visible);
|
||||
PDCEX void PDC_set_color_intensify_enabled( bool enabled);
|
||||
PDCEX void PDC_set_default_menu_visibility(int visible);
|
||||
PDCEX WINDOW *Xinitscr(int, char **);
|
||||
|
||||
#ifdef XCURSES
|
||||
|
1
src/3rdparty/win32_include/curspriv.h
vendored
1
src/3rdparty/win32_include/curspriv.h
vendored
@ -71,6 +71,7 @@ int PDC_get_cursor_mode(void);
|
||||
int PDC_get_key(void);
|
||||
int PDC_get_rows(void);
|
||||
void PDC_gotoyx(int, int);
|
||||
bool PDC_has_mouse(void);
|
||||
int PDC_init_color(short, short, short, short);
|
||||
void PDC_init_pair(short, short, short);
|
||||
int PDC_modifiers_set(void);
|
||||
|
88
src/3rdparty/win32_src/pdcurses/README.md
vendored
88
src/3rdparty/win32_src/pdcurses/README.md
vendored
@ -1,25 +1,93 @@
|
||||
PDCurses Portable Core
|
||||
======================
|
||||
|
||||
This directory contains core PDCurses source code files common to all
|
||||
platforms.
|
||||
PDCurses for WinGUI
|
||||
==================
|
||||
|
||||
This directory contains PDCurses source code files specific to Win32
|
||||
graphics mode (Win95 and all subsequent forks of Windows).
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
These modules are built by the platform-specific makefiles, in the
|
||||
platform directories.
|
||||
(Note that the following is almost identical to the instructions
|
||||
for the Win32 console flavor of PDCurses.)
|
||||
|
||||
- Choose the appropriate makefile for your compiler:
|
||||
|
||||
Makefile.bcc - Borland C++ 4.0.2+
|
||||
Makefile.dmc - Digital Mars
|
||||
Makefile.lcc - LCC-Win32
|
||||
Makefile.mng - MinGW, Cygnus GNU Compiler
|
||||
Makefile.vc - Microsoft Visual C++ 2.0+ or later & Intel(R) compiler
|
||||
Makefile.wcc - Watcom 10.6+ or OpenWATCOM
|
||||
|
||||
- Optionally, you can build in a different directory than the platform
|
||||
directory by setting PDCURSES_SRCDIR to point to the directory where
|
||||
you unpacked PDCurses, and changing to your target directory:
|
||||
|
||||
set PDCURSES_SRCDIR=c:\pdcurses
|
||||
|
||||
This won't work with the LCC or Digital Mars makefiles, nor will the
|
||||
options described below.
|
||||
|
||||
- Build it:
|
||||
|
||||
make -f makefilename
|
||||
|
||||
(For Watcom, use "wmake" instead of "make"; for MSVC, "nmake".) You'll
|
||||
get the libraries (pdcurses.lib or .a, depending on your compiler; and
|
||||
panel.lib or .a), the demos (*.exe), and a lot of object files. Note
|
||||
that the panel library is just a copy of the main library, provided
|
||||
for convenience; both panel and curses functions are in the main
|
||||
library.
|
||||
|
||||
You can also give the optional parameter "WIDE=Y", to build the
|
||||
library with wide-character (Unicode) support:
|
||||
|
||||
make -f Makefile.mng WIDE=Y
|
||||
|
||||
When built this way, the library is not compatible with Windows 9x,
|
||||
unless you also link with the Microsoft Layer for Unicode (not
|
||||
tested).
|
||||
|
||||
For the Intel(R) compiler, use Makefile.vc and add ICC=Y.
|
||||
|
||||
By default, Makefile.vc results in 64-bit code for both VC and Intel(R).
|
||||
Add IX86=Y to generate 32-bit code. (Other builds are 32-bit only.)
|
||||
|
||||
Another option, "UTF8=Y", makes PDCurses ignore the system locale, and
|
||||
treat all narrow-character strings as UTF-8. This option has no effect
|
||||
unless WIDE=Y is also set. This was originally provided to get around
|
||||
poor support for UTF-8 in the Win32 console:
|
||||
|
||||
make -f Makefile.mng WIDE=Y UTF8=Y
|
||||
|
||||
WinGUI doesn't have the same limitations as the Win32 console flavor,
|
||||
but UTF-8 and non-UTF-8 versions are still available. If nothing else,
|
||||
this means that if you've built a Win32 console PDCurses DLL with any
|
||||
configuration, you can build a matching WinGUI DLL and swap between
|
||||
console or GUI PDCurses just by swapping DLLs.
|
||||
|
||||
You can also use the optional parameter "DLL=Y" with Visual C++,
|
||||
MinGW or Cygwin, to build the library as a DLL:
|
||||
|
||||
nmake -f Makefile.vc WIDE=Y DLL=Y
|
||||
|
||||
When you build the library as a Windows DLL, you must always define
|
||||
PDC_DLL_BUILD when linking against it. (Or, if you only want to use
|
||||
the DLL, you could add this definition to your curses.h.)
|
||||
|
||||
If cross-compiling from Linux, add the parameter `_w64=1` to get
|
||||
64-bit code (default will be 32-bit).
|
||||
|
||||
make -f Makefile.mng _w64=1 [WIDE=Y UTF8=Y DLL=Y]
|
||||
|
||||
Distribution Status
|
||||
-------------------
|
||||
|
||||
The files in this directory are released to the Public Domain.
|
||||
|
||||
|
||||
Acknowledgements
|
||||
----------------
|
||||
|
||||
The panel library was originally provided by
|
||||
Warren Tucker <wht@n4hgf.mt-park.ga.us>
|
||||
Based heavily on the Win32 console flavor of PDCurses by Chris Szurgot
|
||||
<szurgot[at]itribe.net>, ported to Win32 GUI by Bill Gray
|
||||
<pluto[at]projectpluto.com>.
|
||||
|
6
src/3rdparty/win32_src/pdcurses/addch.c
vendored
6
src/3rdparty/win32_src/pdcurses/addch.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -362,7 +362,7 @@ int PDC_expand_combined_characters( const cchar_t c, cchar_t *added)
|
||||
combos = NULL;
|
||||
return( 0);
|
||||
}
|
||||
assert( c >= COMBINED_CHAR_START && c < COMBINED_CHAR_START + n_combos);
|
||||
assert( (int)c >= COMBINED_CHAR_START && (int)c < COMBINED_CHAR_START + n_combos);
|
||||
*added = combos[c - COMBINED_CHAR_START].added;
|
||||
return( combos[c - COMBINED_CHAR_START].root);
|
||||
}
|
||||
@ -435,6 +435,8 @@ int waddch( WINDOW *win, const chtype ch)
|
||||
if (!SP->raw_out)
|
||||
x = 0;
|
||||
|
||||
/* Had this commented out. I think it matters in */
|
||||
/* wide, non-UTF8 mode on some platforms. */
|
||||
wclrtoeol(win);
|
||||
|
||||
if (++y > win->_bmarg)
|
||||
|
4
src/3rdparty/win32_src/pdcurses/addchstr.c
vendored
4
src/3rdparty/win32_src/pdcurses/addchstr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -100,7 +100,7 @@ int waddchnstr(WINDOW *win, const chtype *ch, int n)
|
||||
|
||||
PDC_LOG(("y %d x %d minx %d maxx %d *ptr %x *ch"
|
||||
" %x firstch: %d lastch: %d\n",
|
||||
y, x, minx, maxx, *ptr, *ch,
|
||||
y, x, minx, maxx, *ptr, *ch,
|
||||
win->_firstch[y], win->_lastch[y]));
|
||||
|
||||
*ptr = *ch;
|
||||
|
2
src/3rdparty/win32_src/pdcurses/addstr.c
vendored
2
src/3rdparty/win32_src/pdcurses/addstr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/attr.c
vendored
2
src/3rdparty/win32_src/pdcurses/attr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/beep.c
vendored
2
src/3rdparty/win32_src/pdcurses/beep.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
14
src/3rdparty/win32_src/pdcurses/bkgd.c
vendored
14
src/3rdparty/win32_src/pdcurses/bkgd.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -89,7 +89,7 @@ int wbkgd(WINDOW *win, chtype ch)
|
||||
|
||||
newch = win->_bkgd & A_CHARTEXT;
|
||||
|
||||
/* what follows is what seems to occur in the System V
|
||||
/* what follows is what seems to occur in the System V
|
||||
implementation of this routine */
|
||||
|
||||
for (y = 0; y < win->_maxy; y++)
|
||||
@ -100,26 +100,26 @@ int wbkgd(WINDOW *win, chtype ch)
|
||||
|
||||
ch = *winptr;
|
||||
|
||||
/* determine the colors and attributes of the character read
|
||||
/* determine the colors and attributes of the character read
|
||||
from the window */
|
||||
|
||||
colr = ch & A_COLOR;
|
||||
attr = ch & (A_ATTRIBUTES ^ A_COLOR);
|
||||
|
||||
/* if the color is the same as the old background color,
|
||||
/* if the color is the same as the old background color,
|
||||
then make it the new background color, otherwise leave it */
|
||||
|
||||
if (colr == oldcolr)
|
||||
colr = newcolr;
|
||||
|
||||
/* remove any attributes (non color) from the character that
|
||||
were part of the old background, then combine the
|
||||
/* remove any attributes (non color) from the character that
|
||||
were part of the old background, then combine the
|
||||
remaining ones with the new background */
|
||||
|
||||
attr ^= oldattr;
|
||||
attr |= newattr;
|
||||
|
||||
/* change character if it is there because it was the old
|
||||
/* change character if it is there because it was the old
|
||||
background character */
|
||||
|
||||
ch &= A_CHARTEXT;
|
||||
|
24
src/3rdparty/win32_src/pdcurses/border.c
vendored
24
src/3rdparty/win32_src/pdcurses/border.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -97,28 +97,28 @@ border
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
/* _attr_passthru() -- Takes a single chtype 'ch' and checks if the
|
||||
current attribute of window 'win', as set by wattrset(), and/or the
|
||||
current background of win, as set by wbkgd(), should by combined with
|
||||
/* _attr_passthru() -- Takes a single chtype 'ch' and checks if the
|
||||
current attribute of window 'win', as set by wattrset(), and/or the
|
||||
current background of win, as set by wbkgd(), should by combined with
|
||||
it. Attributes set explicitly in ch take precedence. */
|
||||
|
||||
static chtype _attr_passthru(WINDOW *win, chtype ch)
|
||||
{
|
||||
chtype attr;
|
||||
|
||||
/* If the incoming character doesn't have its own attribute, then
|
||||
use the current attributes for the window. If the incoming
|
||||
character has attributes, but not a color component, OR the
|
||||
attributes to the current attributes for the window. If the
|
||||
incoming character has a color component, use only the attributes
|
||||
/* If the incoming character doesn't have its own attribute, then
|
||||
use the current attributes for the window. If the incoming
|
||||
character has attributes, but not a color component, OR the
|
||||
attributes to the current attributes for the window. If the
|
||||
incoming character has a color component, use only the attributes
|
||||
from the incoming character. */
|
||||
|
||||
attr = ch & A_ATTRIBUTES;
|
||||
if (!(attr & A_COLOR))
|
||||
attr |= win->_attrs;
|
||||
|
||||
/* wrs (4/10/93) -- Apply the same sort of logic for the window
|
||||
background, in that it only takes precedence if other color
|
||||
/* wrs (4/10/93) -- Apply the same sort of logic for the window
|
||||
background, in that it only takes precedence if other color
|
||||
attributes are not there. */
|
||||
|
||||
if (!(attr & A_COLOR))
|
||||
@ -131,7 +131,7 @@ static chtype _attr_passthru(WINDOW *win, chtype ch)
|
||||
return ch;
|
||||
}
|
||||
|
||||
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs,
|
||||
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs,
|
||||
chtype tl, chtype tr, chtype bl, chtype br)
|
||||
{
|
||||
int i, ymax, xmax;
|
||||
|
2
src/3rdparty/win32_src/pdcurses/clear.c
vendored
2
src/3rdparty/win32_src/pdcurses/clear.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/color.c
vendored
2
src/3rdparty/win32_src/pdcurses/color.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/debug.c
vendored
2
src/3rdparty/win32_src/pdcurses/debug.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/delch.c
vendored
2
src/3rdparty/win32_src/pdcurses/delch.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
4
src/3rdparty/win32_src/pdcurses/deleteln.c
vendored
4
src/3rdparty/win32_src/pdcurses/deleteln.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -79,7 +79,7 @@ int wdeleteln(WINDOW *win)
|
||||
for (ptr = temp; (ptr - temp < win->_maxx); ptr++)
|
||||
*ptr = blank; /* make a blank line */
|
||||
|
||||
if (win->_cury <= win->_bmarg)
|
||||
if (win->_cury <= win->_bmarg)
|
||||
{
|
||||
win->_firstch[win->_bmarg] = 0;
|
||||
win->_lastch[win->_bmarg] = win->_maxx - 1;
|
||||
|
6
src/3rdparty/win32_src/pdcurses/deprec.c
vendored
6
src/3rdparty/win32_src/pdcurses/deprec.c
vendored
@ -1,9 +1,9 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
/* Deprecated functions. These should not be used, and will eventually
|
||||
be removed. They're here solely for the benefit of applications that
|
||||
/* Deprecated functions. These should not be used, and will eventually
|
||||
be removed. They're here solely for the benefit of applications that
|
||||
linked to them in older versions of PDCurses. */
|
||||
|
||||
bool PDC_check_bios_key(void)
|
||||
|
94
src/3rdparty/win32_src/pdcurses/getch.c
vendored
94
src/3rdparty/win32_src/pdcurses/getch.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -28,36 +28,45 @@ getch
|
||||
|
||||
### Description
|
||||
|
||||
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions,
|
||||
a character is read from the terminal associated with the window.
|
||||
In nodelay mode, if there is no input waiting, the value ERR is
|
||||
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions, a
|
||||
character is read from the terminal associated with the window. In
|
||||
nodelay mode, if there is no input waiting, the value ERR is
|
||||
returned. In delay mode, the program will hang until the system
|
||||
passes text through to the program. Depending on the setting of
|
||||
cbreak(), this will be after one character or after the first
|
||||
newline. Unless noecho() has been set, the character will also
|
||||
be echoed into the designated window.
|
||||
newline. Unless noecho() has been set, the character will also be
|
||||
echoed into the designated window.
|
||||
|
||||
If keypad() is TRUE, and a function key is pressed, the token for
|
||||
that function key will be returned instead of the raw characters.
|
||||
Possible function keys are defined in <curses.h> with integers
|
||||
beginning with 0401, whose names begin with KEY_.
|
||||
|
||||
If nodelay(win, TRUE) has been called on the window and no input
|
||||
is waiting, the value ERR is returned.
|
||||
If nodelay(win, TRUE) has been called on the window and no input is
|
||||
waiting, the value ERR is returned.
|
||||
|
||||
ungetch() places ch back onto the input queue to be returned by
|
||||
the next call to wgetch().
|
||||
ungetch() places ch back onto the input queue to be returned by the
|
||||
next call to wgetch().
|
||||
|
||||
flushinp() throws away any type-ahead that has been typed by the
|
||||
user and has not yet been read by the program.
|
||||
flushinp() throws away any type-ahead that has been typed by the user
|
||||
and has not yet been read by the program.
|
||||
|
||||
wget_wch() is the wide-character version of wgetch(), available when
|
||||
PDCurses is built with the PDC_WIDE option. It takes a pointer to a
|
||||
wint_t rather than returning the key as an int, and instead returns
|
||||
KEY_CODE_YES if the key is a function key. Otherwise, it returns OK
|
||||
or ERR. It's important to check for KEY_CODE_YES, since regular wide
|
||||
characters can have the same values as function key codes.
|
||||
|
||||
unget_wch() puts a wide character on the input queue.
|
||||
|
||||
PDC_get_key_modifiers() returns the keyboard modifiers (shift,
|
||||
control, alt, numlock) effective at the time of the last getch()
|
||||
call, if PDC_save_key_modifiers(TRUE) has been called before the
|
||||
getch(). Use the macros PDC_KEY_MODIFIER_* to determine which
|
||||
modifier(s) were set. PDC_return_key_modifiers() tells getch()
|
||||
to return modifier keys pressed alone as keystrokes (KEY_ALT_L,
|
||||
etc.). These may not work on all platforms.
|
||||
modifier(s) were set. PDC_return_key_modifiers() tells getch() to
|
||||
return modifier keys pressed alone as keystrokes (KEY_ALT_L, etc.).
|
||||
These may not work on all platforms.
|
||||
|
||||
NOTE: getch() and ungetch() are implemented as macros, to avoid
|
||||
conflict with many DOS compiler's runtime libraries.
|
||||
@ -68,18 +77,18 @@ getch
|
||||
character or function key token.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
X/Open ncurses NetBSD
|
||||
getch Y Y Y
|
||||
wgetch Y Y Y
|
||||
mvgetch Y Y Y
|
||||
mvwgetch Y Y Y
|
||||
ungetch Y Y Y
|
||||
flushinp Y Y Y
|
||||
get_wch Y
|
||||
wget_wch Y
|
||||
mvget_wch Y
|
||||
mvwget_wch Y
|
||||
unget_wch Y
|
||||
get_wch Y Y Y
|
||||
wget_wch Y Y Y
|
||||
mvget_wch Y Y Y
|
||||
mvwget_wch Y Y Y
|
||||
unget_wch Y Y Y
|
||||
PDC_get_key_modifiers - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
@ -92,7 +101,7 @@ static int c_gindex = 1; /* getter index */
|
||||
static int c_ungind = 0; /* ungetch() push index */
|
||||
static int c_ungch[NUNGETCH]; /* array of ungotten chars */
|
||||
|
||||
static int _mouse_key(WINDOW *win)
|
||||
static int _mouse_key(void)
|
||||
{
|
||||
int i, key = KEY_MOUSE;
|
||||
unsigned long mbe = SP->_trap_mbe;
|
||||
@ -161,32 +170,24 @@ static int _mouse_key(WINDOW *win)
|
||||
return key;
|
||||
}
|
||||
|
||||
#define WAIT_FOREVER -1
|
||||
|
||||
int wgetch(WINDOW *win)
|
||||
{
|
||||
static int buffer[_INBUFSIZ]; /* character buffer */
|
||||
int key, waitcount;
|
||||
int key, remaining_millisecs;
|
||||
|
||||
PDC_LOG(("wgetch() - called\n"));
|
||||
|
||||
if (!win)
|
||||
return ERR;
|
||||
|
||||
waitcount = 0;
|
||||
|
||||
/* set the number of 1/20th second napms() calls */
|
||||
|
||||
if (SP->delaytenths)
|
||||
waitcount = 2 * SP->delaytenths;
|
||||
remaining_millisecs = 100 * SP->delaytenths;
|
||||
else
|
||||
if (win->_delayms)
|
||||
{
|
||||
/* Can't really do millisecond intervals, so delay in
|
||||
1/20ths of a second (50ms) */
|
||||
|
||||
waitcount = win->_delayms / 50;
|
||||
if (!waitcount)
|
||||
waitcount = 1;
|
||||
}
|
||||
remaining_millisecs = win->_delayms;
|
||||
if( !remaining_millisecs && !win->_nodelay)
|
||||
remaining_millisecs = WAIT_FOREVER;
|
||||
|
||||
/* refresh window when wgetch is called if there have been changes
|
||||
to it and it is not a pad */
|
||||
@ -215,24 +216,23 @@ int wgetch(WINDOW *win)
|
||||
|
||||
for (;;) /* loop for any buffering */
|
||||
{
|
||||
|
||||
/* is there a keystroke ready? */
|
||||
|
||||
if (!PDC_check_key())
|
||||
{
|
||||
/* if not, handle timeout() and halfdelay() */
|
||||
int nap_time = 50;
|
||||
|
||||
if (SP->delaytenths || win->_delayms)
|
||||
if (remaining_millisecs != WAIT_FOREVER)
|
||||
{
|
||||
if (!waitcount)
|
||||
if (!remaining_millisecs)
|
||||
return ERR;
|
||||
|
||||
waitcount--;
|
||||
if( nap_time > remaining_millisecs)
|
||||
nap_time = remaining_millisecs;
|
||||
remaining_millisecs -= nap_time;
|
||||
}
|
||||
else
|
||||
if (win->_nodelay)
|
||||
return ERR;
|
||||
|
||||
napms(50); /* sleep for 1/20th second */
|
||||
napms( nap_time);
|
||||
continue; /* then check again */
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ int wgetch(WINDOW *win)
|
||||
area to function keys */
|
||||
|
||||
else if (key == KEY_MOUSE)
|
||||
key = _mouse_key(win);
|
||||
key = _mouse_key();
|
||||
}
|
||||
|
||||
/* unwanted key? loop back */
|
||||
|
2
src/3rdparty/win32_src/pdcurses/getstr.c
vendored
2
src/3rdparty/win32_src/pdcurses/getstr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/getyx.c
vendored
2
src/3rdparty/win32_src/pdcurses/getyx.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/inch.c
vendored
2
src/3rdparty/win32_src/pdcurses/inch.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/initscr.c
vendored
2
src/3rdparty/win32_src/pdcurses/initscr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
10
src/3rdparty/win32_src/pdcurses/inopts.c
vendored
10
src/3rdparty/win32_src/pdcurses/inopts.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -277,7 +277,7 @@ void wtimeout(WINDOW *win, int delay)
|
||||
|
||||
if (delay < 0)
|
||||
{
|
||||
/* This causes a blocking read on the window, so turn on delay
|
||||
/* This causes a blocking read on the window, so turn on delay
|
||||
mode */
|
||||
|
||||
win->_nodelay = FALSE;
|
||||
@ -285,7 +285,7 @@ void wtimeout(WINDOW *win, int delay)
|
||||
}
|
||||
else if (!delay)
|
||||
{
|
||||
/* This causes a non-blocking read on the window, so turn off
|
||||
/* This causes a non-blocking read on the window, so turn off
|
||||
delay mode */
|
||||
|
||||
win->_nodelay = TRUE;
|
||||
@ -293,8 +293,8 @@ void wtimeout(WINDOW *win, int delay)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This causes the read on the window to delay for the number of
|
||||
milliseconds. Also forces the window into non-blocking read
|
||||
/* This causes the read on the window to delay for the number of
|
||||
milliseconds. Also forces the window into non-blocking read
|
||||
mode */
|
||||
|
||||
/*win->_nodelay = TRUE;*/
|
||||
|
2
src/3rdparty/win32_src/pdcurses/insch.c
vendored
2
src/3rdparty/win32_src/pdcurses/insch.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/insstr.c
vendored
2
src/3rdparty/win32_src/pdcurses/insstr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/instr.c
vendored
2
src/3rdparty/win32_src/pdcurses/instr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/kernel.c
vendored
2
src/3rdparty/win32_src/pdcurses/kernel.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/keyname.c
vendored
2
src/3rdparty/win32_src/pdcurses/keyname.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
25
src/3rdparty/win32_src/pdcurses/mouse.c
vendored
25
src/3rdparty/win32_src/pdcurses/mouse.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -25,6 +25,7 @@ mouse
|
||||
mmask_t mousemask(mmask_t mask, mmask_t *oldmask);
|
||||
int nc_getmouse(MEVENT *event);
|
||||
int ungetmouse(MEVENT *event);
|
||||
bool has_mouse(void);
|
||||
|
||||
### Description
|
||||
|
||||
@ -72,13 +73,12 @@ mouse
|
||||
to map a mouse action to the Soft Label Keys as set by the
|
||||
map_button() function.
|
||||
|
||||
The ncurses interface: mouseinterval(), wenclose(),
|
||||
wmouse_trafo(), mouse_trafo(), mousemask(), nc_getmouse(), and
|
||||
ungetmouse(). A typical application using this interface would
|
||||
start by calling mousemask() with a non-zero value, often
|
||||
ALL_MOUSE_EVENTS. Then it would check for a KEY_MOUSE return
|
||||
from getch(). If found, it would call nc_getmouse() to get the
|
||||
current mouse status.
|
||||
The ncurses interface: mouseinterval(), wenclose(), wmouse_traၱfo(),
|
||||
mouse_trafo(), mousemask(), nc_getmouse(), ungetmouse(), and
|
||||
has_mouse(). A typical application using this interface would start
|
||||
by calling mousemask() with a non-zero value, often ALL_MOUSE_EVENTS.
|
||||
Then it would check for a KEY_MOUSE return from getch(). If found, it
|
||||
would call nc_getmouse() to get the current mouse status.
|
||||
|
||||
mouseinterval() sets the timeout for a mouse click. On all
|
||||
current platforms, PDCurses receives mouse button press and
|
||||
@ -131,6 +131,9 @@ mouse
|
||||
be pushed back, and it can overwrite or be overwritten by real
|
||||
mouse events.
|
||||
|
||||
has_mouse() reports whether the mouse is available at all on the
|
||||
current platform.
|
||||
|
||||
### Portability
|
||||
X/Open BSD SYS V
|
||||
mouse_set - - 4.0
|
||||
@ -148,6 +151,7 @@ mouse
|
||||
mousemask - - -
|
||||
nc_getmouse - - -
|
||||
ungetmouse - - -
|
||||
has_mouse - - -
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
@ -436,3 +440,8 @@ int ungetmouse(MEVENT *event)
|
||||
|
||||
return ungetch(KEY_MOUSE);
|
||||
}
|
||||
|
||||
bool has_mouse(void)
|
||||
{
|
||||
return PDC_has_mouse();
|
||||
}
|
||||
|
2
src/3rdparty/win32_src/pdcurses/move.c
vendored
2
src/3rdparty/win32_src/pdcurses/move.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/outopts.c
vendored
2
src/3rdparty/win32_src/pdcurses/outopts.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/overlay.c
vendored
2
src/3rdparty/win32_src/pdcurses/overlay.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/pad.c
vendored
2
src/3rdparty/win32_src/pdcurses/pad.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
4
src/3rdparty/win32_src/pdcurses/panel.c
vendored
4
src/3rdparty/win32_src/pdcurses/panel.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -620,7 +620,7 @@ void update_panels(void)
|
||||
|
||||
if (is_wintouched(stdscr))
|
||||
Wnoutrefresh(&_stdscr_pseudo_panel);
|
||||
|
||||
|
||||
pan = _bottom_panel;
|
||||
|
||||
while (pan)
|
||||
|
5
src/3rdparty/win32_src/pdcurses/pdckbd.c
vendored
5
src/3rdparty/win32_src/pdcurses/pdckbd.c
vendored
@ -127,6 +127,11 @@ void PDC_flushinp(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool PDC_has_mouse( void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int PDC_mouse_set(void)
|
||||
{
|
||||
/* If turning on mouse input: Set ENABLE_MOUSE_INPUT, and clear
|
||||
|
2
src/3rdparty/win32_src/pdcurses/printw.c
vendored
2
src/3rdparty/win32_src/pdcurses/printw.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
6
src/3rdparty/win32_src/pdcurses/refresh.c
vendored
6
src/3rdparty/win32_src/pdcurses/refresh.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -82,7 +82,7 @@ int wnoutrefresh(WINDOW *win)
|
||||
int first = win->_firstch[i]; /* first changed */
|
||||
int last = win->_lastch[i]; /* last changed */
|
||||
|
||||
/* ignore areas on the outside that are marked as changed,
|
||||
/* ignore areas on the outside that are marked as changed,
|
||||
but really aren't */
|
||||
|
||||
while (first <= last && src[first] == dest[first])
|
||||
@ -98,7 +98,7 @@ int wnoutrefresh(WINDOW *win)
|
||||
memcpy(dest + first, src + first,
|
||||
(last - first + 1) * sizeof(chtype));
|
||||
|
||||
first += begx;
|
||||
first += begx;
|
||||
last += begx;
|
||||
|
||||
if (first < curscr->_firstch[j] ||
|
||||
|
16
src/3rdparty/win32_src/pdcurses/scanw.c
vendored
16
src/3rdparty/win32_src/pdcurses/scanw.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -133,17 +133,17 @@ int vw_scanw(WINDOW *win, const char *fmt, va_list varglist)
|
||||
|
||||
#ifndef HAVE_VSSCANF
|
||||
|
||||
/* _pdc_vsscanf() - Internal routine to parse and format an input
|
||||
buffer. It scans a series of input fields; each field is formatted
|
||||
according to a supplied format string and the formatted input is
|
||||
stored in the variable number of addresses passed. Returns the number
|
||||
/* _pdc_vsscanf() - Internal routine to parse and format an input
|
||||
buffer. It scans a series of input fields; each field is formatted
|
||||
according to a supplied format string and the formatted input is
|
||||
stored in the variable number of addresses passed. Returns the number
|
||||
of input fields or EOF on error.
|
||||
|
||||
Don't compile this unless required. Some compilers (at least Borland
|
||||
Don't compile this unless required. Some compilers (at least Borland
|
||||
C++ 3.0) have to link with math libraries due to the use of floats.
|
||||
|
||||
Based on vsscanf.c and input.c from emx 0.8f library source,
|
||||
Copyright (c) 1990-1992 by Eberhard Mattes, who has kindly agreed to
|
||||
Based on vsscanf.c and input.c from emx 0.8f library source,
|
||||
Copyright (c) 1990-1992 by Eberhard Mattes, who has kindly agreed to
|
||||
its inclusion in PDCurses. */
|
||||
|
||||
#define WHITE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n')
|
||||
|
2
src/3rdparty/win32_src/pdcurses/scr_dump.c
vendored
2
src/3rdparty/win32_src/pdcurses/scr_dump.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
8
src/3rdparty/win32_src/pdcurses/scroll.c
vendored
8
src/3rdparty/win32_src/pdcurses/scroll.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -17,11 +17,11 @@ scroll
|
||||
|
||||
scroll() causes the window to scroll up one line. This involves
|
||||
moving the lines in the window data strcture.
|
||||
|
||||
|
||||
With a positive n, scrl() and wscrl() scroll the window up n
|
||||
lines (line i + n becomes i); otherwise they scroll the window
|
||||
down n lines.
|
||||
|
||||
|
||||
For these functions to work, scrolling must be enabled via
|
||||
scrollok(). Note also that scrolling is not allowed if the
|
||||
supplied window is a pad.
|
||||
@ -63,7 +63,7 @@ int wscrl(WINDOW *win, int n)
|
||||
dir = -1;
|
||||
}
|
||||
|
||||
for (l = 0; l < (n * dir); l++)
|
||||
for (l = 0; l < (n * dir); l++)
|
||||
{
|
||||
temp = win->_y[start];
|
||||
|
||||
|
7
src/3rdparty/win32_src/pdcurses/slk.c
vendored
7
src/3rdparty/win32_src/pdcurses/slk.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -469,8 +469,9 @@ void PDC_slk_initialize(void)
|
||||
|
||||
if (!SP->slk_winptr)
|
||||
{
|
||||
if ( !(SP->slk_winptr = newwin(SP->slklines, COLS,
|
||||
LINES - SP->slklines, 0)) )
|
||||
SP->slk_winptr = newwin(SP->slklines, COLS,
|
||||
LINES - SP->slklines, 0);
|
||||
if (!SP->slk_winptr)
|
||||
return;
|
||||
|
||||
wattrset(SP->slk_winptr, A_REVERSE);
|
||||
|
2
src/3rdparty/win32_src/pdcurses/termattr.c
vendored
2
src/3rdparty/win32_src/pdcurses/termattr.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/terminfo.c
vendored
2
src/3rdparty/win32_src/pdcurses/terminfo.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
4
src/3rdparty/win32_src/pdcurses/touch.c
vendored
4
src/3rdparty/win32_src/pdcurses/touch.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
@ -128,7 +128,7 @@ int wtouchln(WINDOW *win, int y, int n, int changed)
|
||||
win->_firstch[i] = 0;
|
||||
win->_lastch[i] = win->_maxx - 1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
win->_firstch[i] = _NO_CHANGE;
|
||||
win->_lastch[i] = _NO_CHANGE;
|
||||
|
2
src/3rdparty/win32_src/pdcurses/util.c
vendored
2
src/3rdparty/win32_src/pdcurses/util.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
2
src/3rdparty/win32_src/pdcurses/window.c
vendored
2
src/3rdparty/win32_src/pdcurses/window.c
vendored
@ -1,4 +1,4 @@
|
||||
/* Public Domain Curses */
|
||||
/* PDCurses */
|
||||
|
||||
#include <curspriv.h>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user