mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Merge upstream PDCursesMod@4.3.6 changes
This commit is contained in:
parent
081e64f212
commit
889d65994d
@ -7,6 +7,7 @@
|
||||
- libcurl@8.0.1
|
||||
- libmicrohttpd@0.9.76
|
||||
- libopenmpt@0.6.9
|
||||
* update to PDCursesMod@4.3.6 for Windows builds
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
6
src/3rdparty/win32_include/curses.h
vendored
6
src/3rdparty/win32_include/curses.h
vendored
@ -39,10 +39,10 @@ Defined by this header:
|
||||
/* the 'endwin_*' #defines below should be updated. */
|
||||
#define PDC_VER_MAJOR 4
|
||||
#define PDC_VER_MINOR 3
|
||||
#define PDC_VER_CHANGE 5
|
||||
#define PDC_VER_CHANGE 6
|
||||
#define PDC_VER_YEAR 2023
|
||||
#define PDC_VER_MONTH 01
|
||||
#define PDC_VER_DAY 05
|
||||
#define PDC_VER_MONTH 04
|
||||
#define PDC_VER_DAY 12
|
||||
|
||||
#define PDC_STRINGIZE( x) #x
|
||||
#define PDC_stringize( x) PDC_STRINGIZE( x)
|
||||
|
47
src/3rdparty/win32_src/pdcurses/getch.c
vendored
47
src/3rdparty/win32_src/pdcurses/getch.c
vendored
@ -228,7 +228,7 @@ static void _copy(void)
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
wtmp = (wchar_t *)malloc((len + 1) * sizeof(wchar_t));
|
||||
len *= 3;
|
||||
len *= 4;
|
||||
#endif
|
||||
tmp = (char *)malloc(len + 1);
|
||||
|
||||
@ -467,11 +467,11 @@ bool PDC_is_function_key( const int key)
|
||||
|
||||
#define WAIT_FOREVER -1
|
||||
|
||||
int wgetch(WINDOW *win)
|
||||
static int _raw_wgetch(WINDOW *win)
|
||||
{
|
||||
int key = ERR, remaining_millisecs;
|
||||
|
||||
PDC_LOG(("wgetch() - called\n"));
|
||||
PDC_LOG(("_raw_wgetch() - called\n"));
|
||||
|
||||
assert( SP);
|
||||
assert( win);
|
||||
@ -701,6 +701,45 @@ int PDC_return_key_modifiers(bool flag)
|
||||
return PDC_modifiers_set();
|
||||
}
|
||||
|
||||
int wgetch(WINDOW *win)
|
||||
{
|
||||
#ifndef PDC_WIDE
|
||||
return( _raw_wgetch( win));
|
||||
#else
|
||||
static unsigned char buffered[8];
|
||||
static size_t n_buff = 0;
|
||||
int rval;
|
||||
|
||||
if( n_buff)
|
||||
{
|
||||
size_t i;
|
||||
rval = buffered[0];
|
||||
n_buff--;
|
||||
for( i = 0; i < n_buff; i++)
|
||||
buffered[i] = buffered[i + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
rval = _raw_wgetch(win);
|
||||
if( rval != ERR && (rval < 0 || rval > 127)
|
||||
&& !PDC_is_function_key( rval))
|
||||
{
|
||||
wchar_t c = (wchar_t)rval;
|
||||
|
||||
n_buff = PDC_wcstombs( (char *)buffered, &c, 1);
|
||||
if( (int)n_buff <= 0)
|
||||
{
|
||||
n_buff = 0;
|
||||
rval = ERR;
|
||||
}
|
||||
else /* successfully converted to multi-byte string */
|
||||
rval = wgetch( win);
|
||||
}
|
||||
}
|
||||
return( rval);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
int wget_wch(WINDOW *win, wint_t *wch)
|
||||
{
|
||||
@ -712,7 +751,7 @@ int wget_wch(WINDOW *win, wint_t *wch)
|
||||
if (!wch)
|
||||
return ERR;
|
||||
|
||||
key = wgetch(win);
|
||||
key = _raw_wgetch(win);
|
||||
|
||||
if (key == ERR)
|
||||
return ERR;
|
||||
|
29
src/3rdparty/win32_src/pdcurses/initscr.c
vendored
29
src/3rdparty/win32_src/pdcurses/initscr.c
vendored
@ -148,11 +148,12 @@ MOUSE_STATUS Mouse_status;
|
||||
extern RIPPEDOFFLINE linesripped[5];
|
||||
extern char linesrippedoff;
|
||||
|
||||
WINDOW *initscr(void)
|
||||
SCREEN *newterm(const char *type, FILE *outfd, FILE *infd)
|
||||
{
|
||||
int i;
|
||||
|
||||
PDC_LOG(("initscr() - called\n"));
|
||||
PDC_LOG(("newterm() - called\n"));
|
||||
INTENTIONALLY_UNUSED_PARAMETER( type);
|
||||
|
||||
if (SP && SP->alive)
|
||||
return NULL;
|
||||
@ -285,8 +286,16 @@ WINDOW *initscr(void)
|
||||
return NULL;
|
||||
SP->c_ungind = 0;
|
||||
SP->c_ungmax = NUNGETCH;
|
||||
SP->opaque->output_fd = outfd;
|
||||
SP->opaque->input_fd = infd;
|
||||
|
||||
return stdscr;
|
||||
return SP;
|
||||
}
|
||||
|
||||
WINDOW *initscr(void)
|
||||
{
|
||||
PDC_LOG(("initscr() - called\n"));
|
||||
return( newterm( NULL, NULL, NULL) ? stdscr : NULL);
|
||||
}
|
||||
|
||||
#ifdef XCURSES
|
||||
@ -324,20 +333,6 @@ bool isendwin(void)
|
||||
return SP ? !(SP->alive) : FALSE;
|
||||
}
|
||||
|
||||
SCREEN *newterm(const char *type, FILE *outfd, FILE *infd)
|
||||
{
|
||||
WINDOW *win;
|
||||
|
||||
PDC_LOG(("newterm() - called\n"));
|
||||
INTENTIONALLY_UNUSED_PARAMETER( type);
|
||||
win = initscr( );
|
||||
if( win && outfd != stdout)
|
||||
SP->opaque->output_fd = outfd;
|
||||
if( win && infd != stdin)
|
||||
SP->opaque->input_fd = infd;
|
||||
return win ? SP : NULL;
|
||||
}
|
||||
|
||||
SCREEN *set_term(SCREEN *new_scr)
|
||||
{
|
||||
PDC_LOG(("set_term() - called\n"));
|
||||
|
2
src/3rdparty/win32_src/pdcurses/pad.c
vendored
2
src/3rdparty/win32_src/pdcurses/pad.c
vendored
@ -86,6 +86,7 @@ WINDOW *newpad(int nlines, int ncols)
|
||||
|
||||
PDC_LOG(("newpad() - called: lines=%d cols=%d\n", nlines, ncols));
|
||||
|
||||
assert( nlines > 0 && ncols > 0);
|
||||
win = PDC_makenew(nlines, ncols, 0, 0);
|
||||
if (win)
|
||||
win = PDC_makelines(win);
|
||||
@ -136,6 +137,7 @@ WINDOW *subpad(WINDOW *orig, int nlines, int ncols, int begy, int begx)
|
||||
if (!ncols)
|
||||
ncols = orig->_maxx - begx;
|
||||
|
||||
assert( nlines > 0 && ncols > 0);
|
||||
win = PDC_makenew(nlines, ncols, begy, begx);
|
||||
if (!win)
|
||||
return (WINDOW *)NULL;
|
||||
|
11
src/3rdparty/win32_src/pdcurses/window.c
vendored
11
src/3rdparty/win32_src/pdcurses/window.c
vendored
@ -151,6 +151,7 @@ WINDOW *PDC_makenew(int nlines, int ncols, int begy, int begx)
|
||||
PDC_LOG(("PDC_makenew() - called: lines %d cols %d begy %d begx %d\n",
|
||||
nlines, ncols, begy, begx));
|
||||
|
||||
assert( nlines > 0 && ncols > 0);
|
||||
/* allocate the window structure itself */
|
||||
|
||||
win = (WINDOW *)calloc(1, sizeof(WINDOW));
|
||||
@ -257,6 +258,10 @@ WINDOW *newwin(int nlines, int ncols, int begy, int begx)
|
||||
if (!ncols)
|
||||
ncols = COLS - begx;
|
||||
|
||||
assert( nlines > 0 && ncols > 0);
|
||||
if( nlines <= 0 || ncols <= 0)
|
||||
return (WINDOW *)NULL;
|
||||
|
||||
assert( SP);
|
||||
if (!SP || begy + nlines > SP->lines || begx + ncols > SP->cols)
|
||||
return (WINDOW *)NULL;
|
||||
@ -358,6 +363,9 @@ WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begy, int begx)
|
||||
if (!ncols)
|
||||
ncols = orig->_maxx - k;
|
||||
|
||||
assert( nlines > 0 && ncols > 0);
|
||||
if( nlines <= 0 || ncols <= 0)
|
||||
return (WINDOW *)NULL;
|
||||
win = PDC_makenew(nlines, ncols, begy, begx);
|
||||
if (!win)
|
||||
return (WINDOW *)NULL;
|
||||
@ -497,7 +505,8 @@ WINDOW *resize_window(WINDOW *win, int nlines, int ncols)
|
||||
|
||||
assert( SP);
|
||||
assert( win);
|
||||
if (!win || !SP)
|
||||
assert( nlines >= 0 && ncols >= 0);
|
||||
if (!win || !SP || nlines < 0 || ncols < 0)
|
||||
return (WINDOW *)NULL;
|
||||
|
||||
if (win->_flags & _SUBPAD)
|
||||
|
@ -204,7 +204,7 @@ function address at runtime. if the method isn't available, that means we're on
|
||||
and older operating system, so we just return the original value */
|
||||
static LONG scale_font_for_current_dpi( LONG size)
|
||||
{
|
||||
typedef LONG(__stdcall *GetDpiForSystemProc)();
|
||||
typedef LONG(STDAPICALLTYPE *GetDpiForSystemProc)();
|
||||
HMODULE user32Dll = LoadLibrary( _T("User32.dll"));
|
||||
|
||||
if ( user32Dll)
|
||||
|
@ -2241,7 +2241,7 @@ int PDC_scr_open(void)
|
||||
wine_version = (wine_version_func)GetProcAddress(hntdll, "wine_get_version");
|
||||
|
||||
if ( shcoredll) {
|
||||
typedef HRESULT(__stdcall *set_process_dpi_awareness_t)(int);
|
||||
typedef HRESULT(STDAPICALLTYPE *set_process_dpi_awareness_t)(int);
|
||||
static set_process_dpi_awareness_t set_process_dpi_awareness_func;
|
||||
static int ADJUST_DPI_PER_MONITOR = 2;
|
||||
set_process_dpi_awareness_func = (set_process_dpi_awareness_t)GetProcAddress(shcoredll, "SetProcessDpiAwareness");
|
||||
|
Loading…
Reference in New Issue
Block a user