From c3231a49aad482627e2a7bb14e2ed94c182b856b Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 30 Jul 2022 20:35:07 -0700 Subject: [PATCH] Minor updates to PDCurses. --- src/3rdparty/win32_include/curses.h | 5 +++-- src/3rdparty/win32_src/pdcurses/scr_dump.c | 14 +++++++------- src/3rdparty/win32_src/pdcurses/util.c | 7 ------- src/3rdparty/win32_src/pdcurses/wingui/pdcscrn.c | 16 ++++++++-------- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/src/3rdparty/win32_include/curses.h b/src/3rdparty/win32_include/curses.h index aba348c98..79412299f 100755 --- a/src/3rdparty/win32_include/curses.h +++ b/src/3rdparty/win32_include/curses.h @@ -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 3 +#define PDC_VER_CHANGE 4 #define PDC_VER_YEAR 2022 #define PDC_VER_MONTH 07 -#define PDC_VER_DAY 24 +#define PDC_VER_DAY 29 #define PDC_STRINGIZE( x) #x #define PDC_stringize( x) PDC_STRINGIZE( x) @@ -1785,6 +1785,7 @@ PDCEX void PDC_set_window_resized_callback(void (*callback)()); PDCEX int PDC_set_preferred_fontface( const wchar_t* fontface); 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 diff --git a/src/3rdparty/win32_src/pdcurses/scr_dump.c b/src/3rdparty/win32_src/pdcurses/scr_dump.c index d7fac2c2c..59e87e95d 100644 --- a/src/3rdparty/win32_src/pdcurses/scr_dump.c +++ b/src/3rdparty/win32_src/pdcurses/scr_dump.c @@ -207,13 +207,13 @@ WINDOW *getwin(FILE *filep) } win->_attrs = _get_chtype_from_eight_bytes( buff); win->_bkgd = _get_chtype_from_eight_bytes( buff + 8); - win->_clear = _clear; - win->_leaveit = _leaveit; - win->_scroll = _scroll; - win->_nodelay = _nodelay; - win->_immed = _immed; - win->_sync = _sync; - win->_use_keypad = _use_keypad; + win->_clear = (bool)_clear; + win->_leaveit = (bool)_leaveit; + win->_scroll = (bool)_scroll; + win->_nodelay = (bool)_nodelay; + win->_immed = (bool)_immed; + win->_sync = (bool)_sync; + win->_use_keypad = (bool)_use_keypad; nlines = win->_maxy; diff --git a/src/3rdparty/win32_src/pdcurses/util.c b/src/3rdparty/win32_src/pdcurses/util.c index cf89eedf3..12c5a58ad 100644 --- a/src/3rdparty/win32_src/pdcurses/util.c +++ b/src/3rdparty/win32_src/pdcurses/util.c @@ -21,10 +21,6 @@ util short color_pair, const void *opts); wchar_t *wunctrl(cchar_t *wc); - int PDC_mbtowc(wchar_t *pwc, const char *s, size_t n); - size_t PDC_mbstowcs(wchar_t *dest, const char *src, size_t n); - size_t PDC_wcstombs(char *dest, const wchar_t *src, size_t n); - ### Description unctrl() expands the text portion of the chtype c into a printable @@ -67,9 +63,6 @@ util getcchar Y Y Y setcchar Y Y Y wunctrl Y Y Y - PDC_mbtowc - - - - PDC_mbstowcs - - - - PDC_wcstombs - - - **man-end****************************************************************/ diff --git a/src/3rdparty/win32_src/pdcurses/wingui/pdcscrn.c b/src/3rdparty/win32_src/pdcurses/wingui/pdcscrn.c index 0cc746583..da6e35810 100644 --- a/src/3rdparty/win32_src/pdcurses/wingui/pdcscrn.c +++ b/src/3rdparty/win32_src/pdcurses/wingui/pdcscrn.c @@ -985,6 +985,7 @@ INLINE int set_default_sizes_from_registry( const int n_cols, const int n_rows, static void adjust_font_size( const int font_size_change) { extern int PDC_font_size; + RECT client_rect; PDC_font_size += font_size_change; if( PDC_font_size < 2) @@ -1001,22 +1002,21 @@ static void adjust_font_size( const int font_size_change) /* you disagree, I have others. */ if( IsZoomed( PDC_hWnd)) { - RECT client_rect; - GetClientRect( PDC_hWnd, &client_rect); + GetClientRect(PDC_hWnd, &client_rect); PDC_n_rows = client_rect.bottom / PDC_cyChar; PDC_n_cols = client_rect.right / PDC_cxChar; - keep_size_within_bounds( &PDC_n_rows, &PDC_n_cols); - PDC_resize_screen( PDC_n_rows, PDC_n_cols); - add_key_to_queue( KEY_RESIZE); + keep_size_within_bounds(&PDC_n_rows, &PDC_n_cols); + PDC_resize_screen(PDC_n_rows, PDC_n_cols); + add_key_to_queue(KEY_RESIZE); SP->resized = TRUE; - GetClientRect( PDC_hWnd, &client_rect); - InvalidateRect(PDC_hWnd, &client_rect, FALSE); } else { PDC_resize_screen( PDC_n_rows, PDC_n_cols); - InvalidateRect( PDC_hWnd, NULL, FALSE); } + + InvalidateRect(PDC_hWnd, NULL, FALSE); + UpdateWindow(PDC_hWnd); } #define WM_ENLARGE_FONT (WM_USER + 1)