mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 04:52:32 +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
|
#ifdef NO_STDINT_H
|
||||||
#define uint64_t unsigned long long
|
#define uint64_t unsigned __int64
|
||||||
#define uint32_t unsigned long
|
#define uint32_t unsigned long
|
||||||
#define uint16_t unsigned short
|
#define uint16_t unsigned short
|
||||||
#else
|
#else
|
||||||
@ -56,7 +56,7 @@ PDCurses portable platform definitions list:
|
|||||||
# include <wchar.h>
|
# include <wchar.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__STDC_VERSION__) && __STDC_VERSION >= 199901L && \
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
|
||||||
!defined(__bool_true_false_are_defined)
|
!defined(__bool_true_false_are_defined)
|
||||||
# include <stdbool.h>
|
# include <stdbool.h>
|
||||||
#endif
|
#endif
|
||||||
@ -116,11 +116,11 @@ typedef chtype attr_t;
|
|||||||
/* Don't forget to update 'version.mif' if MAJOR/MINOR changes! */
|
/* Don't forget to update 'version.mif' if MAJOR/MINOR changes! */
|
||||||
|
|
||||||
#define PDC_VER_MAJOR 4
|
#define PDC_VER_MAJOR 4
|
||||||
#define PDC_VER_MINOR 0
|
#define PDC_VER_MINOR 1
|
||||||
#define PDC_VER_CHANGE 4
|
#define PDC_VER_CHANGE 0
|
||||||
#define PDC_VER_YEAR 2019
|
#define PDC_VER_YEAR 2019
|
||||||
#define PDC_VER_MONTH 1
|
#define PDC_VER_MONTH 5
|
||||||
#define PDC_VER_DAY 20
|
#define PDC_VER_DAY 8
|
||||||
|
|
||||||
#define PDC_BUILD (PDC_VER_MAJOR*1000 + PDC_VER_MINOR *100 + PDC_VER_CHANGE)
|
#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 use_default_colors(void);
|
||||||
PDCEX int wresize(WINDOW *, int, int);
|
PDCEX int wresize(WINDOW *, int, int);
|
||||||
|
|
||||||
|
PDCEX bool has_mouse(void);
|
||||||
PDCEX int mouseinterval(int);
|
PDCEX int mouseinterval(int);
|
||||||
PDCEX mmask_t mousemask(mmask_t, mmask_t *);
|
PDCEX mmask_t mousemask(mmask_t, mmask_t *);
|
||||||
PDCEX bool mouse_trafo(int *, int *, bool);
|
PDCEX bool mouse_trafo(int *, int *, bool);
|
||||||
@ -1789,8 +1790,8 @@ PDCEX int PDC_set_function_key( const unsigned function,
|
|||||||
const int new_key);
|
const int new_key);
|
||||||
|
|
||||||
PDCEX int PDC_set_preferred_fontface( const wchar_t* fontface);
|
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_color_intensify_enabled( bool enabled);
|
||||||
|
PDCEX void PDC_set_default_menu_visibility(int visible);
|
||||||
PDCEX WINDOW *Xinitscr(int, char **);
|
PDCEX WINDOW *Xinitscr(int, char **);
|
||||||
|
|
||||||
#ifdef XCURSES
|
#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_key(void);
|
||||||
int PDC_get_rows(void);
|
int PDC_get_rows(void);
|
||||||
void PDC_gotoyx(int, int);
|
void PDC_gotoyx(int, int);
|
||||||
|
bool PDC_has_mouse(void);
|
||||||
int PDC_init_color(short, short, short, short);
|
int PDC_init_color(short, short, short, short);
|
||||||
void PDC_init_pair(short, short, short);
|
void PDC_init_pair(short, short, short);
|
||||||
int PDC_modifiers_set(void);
|
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
|
PDCurses for WinGUI
|
||||||
======================
|
==================
|
||||||
|
|
||||||
This directory contains core PDCurses source code files common to all
|
|
||||||
platforms.
|
|
||||||
|
|
||||||
|
This directory contains PDCurses source code files specific to Win32
|
||||||
|
graphics mode (Win95 and all subsequent forks of Windows).
|
||||||
|
|
||||||
Building
|
Building
|
||||||
--------
|
--------
|
||||||
|
|
||||||
These modules are built by the platform-specific makefiles, in the
|
(Note that the following is almost identical to the instructions
|
||||||
platform directories.
|
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
|
Distribution Status
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
The files in this directory are released to the Public Domain.
|
The files in this directory are released to the Public Domain.
|
||||||
|
|
||||||
|
|
||||||
Acknowledgements
|
Acknowledgements
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
The panel library was originally provided by
|
Based heavily on the Win32 console flavor of PDCurses by Chris Szurgot
|
||||||
Warren Tucker <wht@n4hgf.mt-park.ga.us>
|
<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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ int PDC_expand_combined_characters( const cchar_t c, cchar_t *added)
|
|||||||
combos = NULL;
|
combos = NULL;
|
||||||
return( 0);
|
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;
|
*added = combos[c - COMBINED_CHAR_START].added;
|
||||||
return( combos[c - COMBINED_CHAR_START].root);
|
return( combos[c - COMBINED_CHAR_START].root);
|
||||||
}
|
}
|
||||||
@ -435,6 +435,8 @@ int waddch( WINDOW *win, const chtype ch)
|
|||||||
if (!SP->raw_out)
|
if (!SP->raw_out)
|
||||||
x = 0;
|
x = 0;
|
||||||
|
|
||||||
|
/* Had this commented out. I think it matters in */
|
||||||
|
/* wide, non-UTF8 mode on some platforms. */
|
||||||
wclrtoeol(win);
|
wclrtoeol(win);
|
||||||
|
|
||||||
if (++y > win->_bmarg)
|
if (++y > win->_bmarg)
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/addchstr.c
vendored
2
src/3rdparty/win32_src/pdcurses/addchstr.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
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>
|
#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>
|
#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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/bkgd.c
vendored
2
src/3rdparty/win32_src/pdcurses/bkgd.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/border.c
vendored
2
src/3rdparty/win32_src/pdcurses/border.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
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>
|
#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>
|
#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>
|
#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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/deleteln.c
vendored
2
src/3rdparty/win32_src/pdcurses/deleteln.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/deprec.c
vendored
2
src/3rdparty/win32_src/pdcurses/deprec.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
@ -28,36 +28,45 @@ getch
|
|||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|
||||||
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions,
|
With the getch(), wgetch(), mvgetch(), and mvwgetch() functions, a
|
||||||
a character is read from the terminal associated with the window.
|
character is read from the terminal associated with the window. In
|
||||||
In nodelay mode, if there is no input waiting, the value ERR is
|
nodelay mode, if there is no input waiting, the value ERR is
|
||||||
returned. In delay mode, the program will hang until the system
|
returned. In delay mode, the program will hang until the system
|
||||||
passes text through to the program. Depending on the setting of
|
passes text through to the program. Depending on the setting of
|
||||||
cbreak(), this will be after one character or after the first
|
cbreak(), this will be after one character or after the first
|
||||||
newline. Unless noecho() has been set, the character will also
|
newline. Unless noecho() has been set, the character will also be
|
||||||
be echoed into the designated window.
|
echoed into the designated window.
|
||||||
|
|
||||||
If keypad() is TRUE, and a function key is pressed, the token for
|
If keypad() is TRUE, and a function key is pressed, the token for
|
||||||
that function key will be returned instead of the raw characters.
|
that function key will be returned instead of the raw characters.
|
||||||
Possible function keys are defined in <curses.h> with integers
|
Possible function keys are defined in <curses.h> with integers
|
||||||
beginning with 0401, whose names begin with KEY_.
|
beginning with 0401, whose names begin with KEY_.
|
||||||
|
|
||||||
If nodelay(win, TRUE) has been called on the window and no input
|
If nodelay(win, TRUE) has been called on the window and no input is
|
||||||
is waiting, the value ERR is returned.
|
waiting, the value ERR is returned.
|
||||||
|
|
||||||
ungetch() places ch back onto the input queue to be returned by
|
ungetch() places ch back onto the input queue to be returned by the
|
||||||
the next call to wgetch().
|
next call to wgetch().
|
||||||
|
|
||||||
flushinp() throws away any type-ahead that has been typed by the
|
flushinp() throws away any type-ahead that has been typed by the user
|
||||||
user and has not yet been read by the program.
|
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,
|
PDC_get_key_modifiers() returns the keyboard modifiers (shift,
|
||||||
control, alt, numlock) effective at the time of the last getch()
|
control, alt, numlock) effective at the time of the last getch()
|
||||||
call, if PDC_save_key_modifiers(TRUE) has been called before the
|
call, if PDC_save_key_modifiers(TRUE) has been called before the
|
||||||
getch(). Use the macros PDC_KEY_MODIFIER_* to determine which
|
getch(). Use the macros PDC_KEY_MODIFIER_* to determine which
|
||||||
modifier(s) were set. PDC_return_key_modifiers() tells getch()
|
modifier(s) were set. PDC_return_key_modifiers() tells getch() to
|
||||||
to return modifier keys pressed alone as keystrokes (KEY_ALT_L,
|
return modifier keys pressed alone as keystrokes (KEY_ALT_L, etc.).
|
||||||
etc.). These may not work on all platforms.
|
These may not work on all platforms.
|
||||||
|
|
||||||
NOTE: getch() and ungetch() are implemented as macros, to avoid
|
NOTE: getch() and ungetch() are implemented as macros, to avoid
|
||||||
conflict with many DOS compiler's runtime libraries.
|
conflict with many DOS compiler's runtime libraries.
|
||||||
@ -68,18 +77,18 @@ getch
|
|||||||
character or function key token.
|
character or function key token.
|
||||||
|
|
||||||
### Portability
|
### Portability
|
||||||
X/Open BSD SYS V
|
X/Open ncurses NetBSD
|
||||||
getch Y Y Y
|
getch Y Y Y
|
||||||
wgetch Y Y Y
|
wgetch Y Y Y
|
||||||
mvgetch Y Y Y
|
mvgetch Y Y Y
|
||||||
mvwgetch Y Y Y
|
mvwgetch Y Y Y
|
||||||
ungetch Y Y Y
|
ungetch Y Y Y
|
||||||
flushinp Y Y Y
|
flushinp Y Y Y
|
||||||
get_wch Y
|
get_wch Y Y Y
|
||||||
wget_wch Y
|
wget_wch Y Y Y
|
||||||
mvget_wch Y
|
mvget_wch Y Y Y
|
||||||
mvwget_wch Y
|
mvwget_wch Y Y Y
|
||||||
unget_wch Y
|
unget_wch Y Y Y
|
||||||
PDC_get_key_modifiers - - -
|
PDC_get_key_modifiers - - -
|
||||||
|
|
||||||
**man-end****************************************************************/
|
**man-end****************************************************************/
|
||||||
@ -92,7 +101,7 @@ static int c_gindex = 1; /* getter index */
|
|||||||
static int c_ungind = 0; /* ungetch() push index */
|
static int c_ungind = 0; /* ungetch() push index */
|
||||||
static int c_ungch[NUNGETCH]; /* array of ungotten chars */
|
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;
|
int i, key = KEY_MOUSE;
|
||||||
unsigned long mbe = SP->_trap_mbe;
|
unsigned long mbe = SP->_trap_mbe;
|
||||||
@ -161,32 +170,24 @@ static int _mouse_key(WINDOW *win)
|
|||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define WAIT_FOREVER -1
|
||||||
|
|
||||||
int wgetch(WINDOW *win)
|
int wgetch(WINDOW *win)
|
||||||
{
|
{
|
||||||
static int buffer[_INBUFSIZ]; /* character buffer */
|
static int buffer[_INBUFSIZ]; /* character buffer */
|
||||||
int key, waitcount;
|
int key, remaining_millisecs;
|
||||||
|
|
||||||
PDC_LOG(("wgetch() - called\n"));
|
PDC_LOG(("wgetch() - called\n"));
|
||||||
|
|
||||||
if (!win)
|
if (!win)
|
||||||
return ERR;
|
return ERR;
|
||||||
|
|
||||||
waitcount = 0;
|
|
||||||
|
|
||||||
/* set the number of 1/20th second napms() calls */
|
|
||||||
|
|
||||||
if (SP->delaytenths)
|
if (SP->delaytenths)
|
||||||
waitcount = 2 * SP->delaytenths;
|
remaining_millisecs = 100 * SP->delaytenths;
|
||||||
else
|
else
|
||||||
if (win->_delayms)
|
remaining_millisecs = win->_delayms;
|
||||||
{
|
if( !remaining_millisecs && !win->_nodelay)
|
||||||
/* Can't really do millisecond intervals, so delay in
|
remaining_millisecs = WAIT_FOREVER;
|
||||||
1/20ths of a second (50ms) */
|
|
||||||
|
|
||||||
waitcount = win->_delayms / 50;
|
|
||||||
if (!waitcount)
|
|
||||||
waitcount = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* refresh window when wgetch is called if there have been changes
|
/* refresh window when wgetch is called if there have been changes
|
||||||
to it and it is not a pad */
|
to it and it is not a pad */
|
||||||
@ -215,24 +216,23 @@ int wgetch(WINDOW *win)
|
|||||||
|
|
||||||
for (;;) /* loop for any buffering */
|
for (;;) /* loop for any buffering */
|
||||||
{
|
{
|
||||||
|
|
||||||
/* is there a keystroke ready? */
|
/* is there a keystroke ready? */
|
||||||
|
|
||||||
if (!PDC_check_key())
|
if (!PDC_check_key())
|
||||||
{
|
{
|
||||||
/* if not, handle timeout() and halfdelay() */
|
/* 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;
|
return ERR;
|
||||||
|
if( nap_time > remaining_millisecs)
|
||||||
waitcount--;
|
nap_time = remaining_millisecs;
|
||||||
|
remaining_millisecs -= nap_time;
|
||||||
}
|
}
|
||||||
else
|
napms( nap_time);
|
||||||
if (win->_nodelay)
|
|
||||||
return ERR;
|
|
||||||
|
|
||||||
napms(50); /* sleep for 1/20th second */
|
|
||||||
continue; /* then check again */
|
continue; /* then check again */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ int wgetch(WINDOW *win)
|
|||||||
area to function keys */
|
area to function keys */
|
||||||
|
|
||||||
else if (key == KEY_MOUSE)
|
else if (key == KEY_MOUSE)
|
||||||
key = _mouse_key(win);
|
key = _mouse_key();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* unwanted key? loop back */
|
/* 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>
|
#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>
|
#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>
|
#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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/inopts.c
vendored
2
src/3rdparty/win32_src/pdcurses/inopts.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
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>
|
#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>
|
#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>
|
#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>
|
#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>
|
#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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
@ -25,6 +25,7 @@ mouse
|
|||||||
mmask_t mousemask(mmask_t mask, mmask_t *oldmask);
|
mmask_t mousemask(mmask_t mask, mmask_t *oldmask);
|
||||||
int nc_getmouse(MEVENT *event);
|
int nc_getmouse(MEVENT *event);
|
||||||
int ungetmouse(MEVENT *event);
|
int ungetmouse(MEVENT *event);
|
||||||
|
bool has_mouse(void);
|
||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|
||||||
@ -72,13 +73,12 @@ mouse
|
|||||||
to map a mouse action to the Soft Label Keys as set by the
|
to map a mouse action to the Soft Label Keys as set by the
|
||||||
map_button() function.
|
map_button() function.
|
||||||
|
|
||||||
The ncurses interface: mouseinterval(), wenclose(),
|
The ncurses interface: mouseinterval(), wenclose(), wmouse_traၱfo(),
|
||||||
wmouse_trafo(), mouse_trafo(), mousemask(), nc_getmouse(), and
|
mouse_trafo(), mousemask(), nc_getmouse(), ungetmouse(), and
|
||||||
ungetmouse(). A typical application using this interface would
|
has_mouse(). A typical application using this interface would start
|
||||||
start by calling mousemask() with a non-zero value, often
|
by calling mousemask() with a non-zero value, often ALL_MOUSE_EVENTS.
|
||||||
ALL_MOUSE_EVENTS. Then it would check for a KEY_MOUSE return
|
Then it would check for a KEY_MOUSE return from getch(). If found, it
|
||||||
from getch(). If found, it would call nc_getmouse() to get the
|
would call nc_getmouse() to get the current mouse status.
|
||||||
current mouse status.
|
|
||||||
|
|
||||||
mouseinterval() sets the timeout for a mouse click. On all
|
mouseinterval() sets the timeout for a mouse click. On all
|
||||||
current platforms, PDCurses receives mouse button press and
|
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
|
be pushed back, and it can overwrite or be overwritten by real
|
||||||
mouse events.
|
mouse events.
|
||||||
|
|
||||||
|
has_mouse() reports whether the mouse is available at all on the
|
||||||
|
current platform.
|
||||||
|
|
||||||
### Portability
|
### Portability
|
||||||
X/Open BSD SYS V
|
X/Open BSD SYS V
|
||||||
mouse_set - - 4.0
|
mouse_set - - 4.0
|
||||||
@ -148,6 +151,7 @@ mouse
|
|||||||
mousemask - - -
|
mousemask - - -
|
||||||
nc_getmouse - - -
|
nc_getmouse - - -
|
||||||
ungetmouse - - -
|
ungetmouse - - -
|
||||||
|
has_mouse - - -
|
||||||
|
|
||||||
**man-end****************************************************************/
|
**man-end****************************************************************/
|
||||||
|
|
||||||
@ -436,3 +440,8 @@ int ungetmouse(MEVENT *event)
|
|||||||
|
|
||||||
return ungetch(KEY_MOUSE);
|
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>
|
#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>
|
#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>
|
#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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/panel.c
vendored
2
src/3rdparty/win32_src/pdcurses/panel.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
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)
|
int PDC_mouse_set(void)
|
||||||
{
|
{
|
||||||
/* If turning on mouse input: Set ENABLE_MOUSE_INPUT, and clear
|
/* 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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/refresh.c
vendored
2
src/3rdparty/win32_src/pdcurses/refresh.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/scanw.c
vendored
2
src/3rdparty/win32_src/pdcurses/scanw.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/scroll.c
vendored
2
src/3rdparty/win32_src/pdcurses/scroll.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
@ -469,8 +469,9 @@ void PDC_slk_initialize(void)
|
|||||||
|
|
||||||
if (!SP->slk_winptr)
|
if (!SP->slk_winptr)
|
||||||
{
|
{
|
||||||
if ( !(SP->slk_winptr = newwin(SP->slklines, COLS,
|
SP->slk_winptr = newwin(SP->slklines, COLS,
|
||||||
LINES - SP->slklines, 0)) )
|
LINES - SP->slklines, 0);
|
||||||
|
if (!SP->slk_winptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wattrset(SP->slk_winptr, A_REVERSE);
|
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>
|
#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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
2
src/3rdparty/win32_src/pdcurses/touch.c
vendored
2
src/3rdparty/win32_src/pdcurses/touch.c
vendored
@ -1,4 +1,4 @@
|
|||||||
/* Public Domain Curses */
|
/* PDCurses */
|
||||||
|
|
||||||
#include <curspriv.h>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
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>
|
#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>
|
#include <curspriv.h>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user