mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-24 15:55:14 +00:00
Removed camel casing where possible; use standard pdc_ prefixes for
console handles; _ for static functions.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
RCSID("$Id: pdcdisp.c,v 1.36 2006/10/08 20:54:30 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcdisp.c,v 1.37 2006/10/09 14:08:46 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -48,7 +48,7 @@ void PDC_gotoyx(int row, int col)
|
||||
coord.X = col;
|
||||
coord.Y = row;
|
||||
|
||||
SetConsoleCursorPosition(hConOut, coord);
|
||||
SetConsoleCursorPosition(pdc_con_out, coord);
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
@@ -96,5 +96,5 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
|
||||
ci[j].Attributes = chtype_attr(srcp[j]);
|
||||
}
|
||||
|
||||
WriteConsoleOutput(hConOut, ci, bufSize, bufPos, &sr);
|
||||
WriteConsoleOutput(pdc_con_out, ci, bufSize, bufPos, &sr);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "pdcwin.h"
|
||||
|
||||
RCSID("$Id: pdcgetsc.c,v 1.27 2006/10/08 20:54:30 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcgetsc.c,v 1.28 2006/10/09 14:08:46 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -48,7 +48,7 @@ int PDC_get_cursor_pos(int *row, int *col)
|
||||
|
||||
PDC_LOG(("PDC_get_cursor_pos() - called\n"));
|
||||
|
||||
GetConsoleScreenBufferInfo(hConOut, &scr);
|
||||
GetConsoleScreenBufferInfo(pdc_con_out, &scr);
|
||||
|
||||
*col = scr.dwCursorPosition.X;
|
||||
*row = scr.dwCursorPosition.Y;
|
||||
@@ -74,7 +74,7 @@ int PDC_get_cursor_mode(void)
|
||||
|
||||
PDC_LOG(("PDC_get_cursor_mode() - called\n"));
|
||||
|
||||
GetConsoleCursorInfo(hConOut, &ci);
|
||||
GetConsoleCursorInfo(pdc_con_out, &ci);
|
||||
|
||||
return ci.dwSize;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ int PDC_get_rows(void)
|
||||
|
||||
PDC_LOG(("PDC_get_rows() - called\n"));
|
||||
|
||||
GetConsoleScreenBufferInfo(hConOut, &scr);
|
||||
GetConsoleScreenBufferInfo(pdc_con_out, &scr);
|
||||
|
||||
return scr.srWindow.Bottom - scr.srWindow.Top + 1;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ int PDC_get_buffer_rows(void)
|
||||
|
||||
PDC_LOG(("PDC_get_buffer_rows() - called\n"));
|
||||
|
||||
GetConsoleScreenBufferInfo(hConOut, &scr);
|
||||
GetConsoleScreenBufferInfo(pdc_con_out, &scr);
|
||||
|
||||
return scr.dwSize.Y;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ int PDC_get_columns(void)
|
||||
|
||||
PDC_LOG(("PDC_get_columns() - called\n"));
|
||||
|
||||
GetConsoleScreenBufferInfo(hConOut, &scr);
|
||||
GetConsoleScreenBufferInfo(pdc_con_out, &scr);
|
||||
|
||||
return scr.srWindow.Right - scr.srWindow.Left + 1;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "pdcwin.h"
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.65 2006/10/08 20:54:30 wmcbrine Exp $");
|
||||
RCSID("$Id: pdckbd.c,v 1.66 2006/10/09 14:08:46 wmcbrine Exp $");
|
||||
|
||||
#define ACTUAL_MOUSE_MOVED (actual_mouse_status.changes & 8)
|
||||
#define ACTUAL_BUTTON_STATUS(x) (actual_mouse_status.button[(x) - 1])
|
||||
@@ -58,10 +58,10 @@ RCSID("$Id: pdckbd.c,v 1.65 2006/10/08 20:54:30 wmcbrine Exp $");
|
||||
static INPUT_RECORD save_ip;
|
||||
unsigned long pdc_key_modifiers = 0L;
|
||||
|
||||
static int keyCount = 0;
|
||||
static int key_count = 0;
|
||||
|
||||
static void win32_getch(void);
|
||||
static int win32_kbhit(int);
|
||||
static void _win32_getch(void);
|
||||
static int _win32_kbhit(int);
|
||||
|
||||
/************************************************************************
|
||||
* Table for key code translation of function keys in keypad mode *
|
||||
@@ -310,17 +310,17 @@ void PDC_set_keyboard_binary(bool on)
|
||||
|
||||
bool PDC_check_bios_key(void)
|
||||
{
|
||||
return win32_kbhit(0);
|
||||
return _win32_kbhit(0);
|
||||
}
|
||||
|
||||
/* processKeyEvent returns -1 if the key in save_ip should be ignored
|
||||
/* _process_key_event returns -1 if the key in save_ip should be ignored
|
||||
for some reasons. Otherwise the keycode is returned which should be
|
||||
returned by PDC_get_bios_code. save_ip MUST BE A KEY_EVENT!
|
||||
|
||||
The Unicode support has been disabled. See below for the reason.
|
||||
CTRL-ALT support has been disabled, when is it emitted plainly? */
|
||||
|
||||
static int processKeyEvent(void)
|
||||
static int _process_key_event(void)
|
||||
{
|
||||
CHAR ascii = save_ip.Event.KeyEvent.uChar.AsciiChar;
|
||||
#if 0
|
||||
@@ -465,12 +465,12 @@ int PDC_get_bios_key(void)
|
||||
|
||||
while (1)
|
||||
{
|
||||
win32_getch();
|
||||
_win32_getch();
|
||||
|
||||
switch (save_ip.EventType)
|
||||
{
|
||||
case KEY_EVENT:
|
||||
retval = processKeyEvent();
|
||||
retval = _process_key_event();
|
||||
if (retval == -1) /* ignore key? */
|
||||
continue;
|
||||
|
||||
@@ -799,7 +799,7 @@ int PDC_validchar(int c)
|
||||
return c;
|
||||
}
|
||||
|
||||
/* GetInterestingEvent returns 0 if *ip doesn't contain an event which
|
||||
/* _get_interesting_event returns 0 if *ip doesn't contain an event which
|
||||
should be passed back to the user. This function filters "useless"
|
||||
events.
|
||||
|
||||
@@ -829,7 +829,7 @@ int PDC_validchar(int c)
|
||||
a pressed mouse key are ignored.
|
||||
*/
|
||||
|
||||
static int GetInterestingEvent(INPUT_RECORD *ip)
|
||||
static int _get_interesting_event(INPUT_RECORD *ip)
|
||||
{
|
||||
int numKeys = 0, vk;
|
||||
static int save_press;
|
||||
@@ -838,7 +838,7 @@ static int GetInterestingEvent(INPUT_RECORD *ip)
|
||||
#ifdef PDCDEBUG
|
||||
char *ptr = "";
|
||||
|
||||
PDC_LOG(("GetInterestingEvent() - called\n"));
|
||||
PDC_LOG(("_get_interesting_event() - called\n"));
|
||||
|
||||
# define PTR(x) ptr = x
|
||||
#else
|
||||
@@ -1019,35 +1019,35 @@ static int GetInterestingEvent(INPUT_RECORD *ip)
|
||||
|
||||
#undef PTR
|
||||
|
||||
PDC_LOG(("GetInterestingEvent() - returning: numKeys %d "
|
||||
PDC_LOG(("_get_interesting_event() - returning: numKeys %d "
|
||||
"type %d: %s\n", numKeys, ip->EventType, ptr));
|
||||
|
||||
return numKeys;
|
||||
}
|
||||
|
||||
static int win32_kbhit(int timeout)
|
||||
static int _win32_kbhit(int timeout)
|
||||
{
|
||||
INPUT_RECORD ip;
|
||||
DWORD read;
|
||||
int rc = FALSE;
|
||||
|
||||
PDC_LOG(("win32_kbhit() - called: timeout %d keyCount %d\n",
|
||||
timeout, keyCount));
|
||||
PDC_LOG(("_win32_kbhit() - called: timeout %d key_count %d\n",
|
||||
timeout, key_count));
|
||||
|
||||
if (keyCount > 0)
|
||||
if (key_count > 0)
|
||||
return TRUE;
|
||||
|
||||
if (WaitForSingleObject(hConIn, timeout) != WAIT_OBJECT_0)
|
||||
if (WaitForSingleObject(pdc_con_in, timeout) != WAIT_OBJECT_0)
|
||||
return FALSE;
|
||||
|
||||
PeekConsoleInput(hConIn, &ip, 1, &read);
|
||||
PeekConsoleInput(pdc_con_in, &ip, 1, &read);
|
||||
if (read == 0)
|
||||
return FALSE;
|
||||
|
||||
ReadConsoleInput(hConIn, &ip, 1, &read);
|
||||
ReadConsoleInput(pdc_con_in, &ip, 1, &read);
|
||||
|
||||
keyCount = GetInterestingEvent(&ip);
|
||||
if (keyCount)
|
||||
key_count = _get_interesting_event(&ip);
|
||||
if (key_count)
|
||||
{
|
||||
/* To get here a recognised event has occurred; save it
|
||||
and return TRUE */
|
||||
@@ -1059,12 +1059,12 @@ static int win32_kbhit(int timeout)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void win32_getch(void)
|
||||
static void _win32_getch(void)
|
||||
{
|
||||
while (win32_kbhit(INFINITE) == FALSE)
|
||||
while (_win32_kbhit(INFINITE) == FALSE)
|
||||
;
|
||||
|
||||
keyCount--;
|
||||
key_count--;
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
@@ -1086,5 +1086,5 @@ void PDC_flushinp(void)
|
||||
{
|
||||
PDC_LOG(("PDC_flushinp() - called\n"));
|
||||
|
||||
FlushConsoleInputBuffer(hConIn);
|
||||
FlushConsoleInputBuffer(pdc_con_in);
|
||||
}
|
||||
|
||||
114
win32/pdcscrn.c
114
win32/pdcscrn.c
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "pdcwin.h"
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.65 2006/10/09 04:51:41 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcscrn.c,v 1.66 2006/10/09 14:08:46 wmcbrine Exp $");
|
||||
|
||||
#define PDC_RESTORE_NONE 0
|
||||
#define PDC_RESTORE_BUFFER 1
|
||||
@@ -60,17 +60,17 @@ static struct
|
||||
WCHAR ConsoleTitle[0x100];
|
||||
} console_info;
|
||||
|
||||
HANDLE hConOut = INVALID_HANDLE_VALUE;
|
||||
HANDLE hConIn = INVALID_HANDLE_VALUE;
|
||||
HANDLE pdc_con_out = INVALID_HANDLE_VALUE;
|
||||
HANDLE pdc_con_in = INVALID_HANDLE_VALUE;
|
||||
|
||||
static CONSOLE_SCREEN_BUFFER_INFO orig_scr;
|
||||
|
||||
static CHAR_INFO *ciSaveBuffer = NULL;
|
||||
static DWORD dwConsoleMode = 0;
|
||||
static CHAR_INFO *ci_save = NULL;
|
||||
static DWORD old_console_mode = 0;
|
||||
|
||||
static bool isNT;
|
||||
static bool is_nt;
|
||||
|
||||
static HWND FindConsoleHandle(void)
|
||||
static HWND _find_console_handle(void)
|
||||
{
|
||||
TCHAR orgtitle[1024], temptitle[1024];
|
||||
HWND wnd;
|
||||
@@ -98,7 +98,7 @@ static HWND FindConsoleHandle(void)
|
||||
section (file-mapping) object in the context of the process which
|
||||
owns the console, before posting the message. Originally by JB. */
|
||||
|
||||
static void SetConsoleInfo(void)
|
||||
static void _set_console_info(void)
|
||||
{
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
CONSOLE_CURSOR_INFO cci;
|
||||
@@ -109,10 +109,10 @@ static void SetConsoleInfo(void)
|
||||
|
||||
/* Each-time initialization for console_info */
|
||||
|
||||
GetConsoleCursorInfo(hConOut, &cci);
|
||||
GetConsoleCursorInfo(pdc_con_out, &cci);
|
||||
console_info.CursorSize = cci.dwSize;
|
||||
|
||||
GetConsoleScreenBufferInfo(hConOut, &csbi);
|
||||
GetConsoleScreenBufferInfo(pdc_con_out, &csbi);
|
||||
console_info.ScreenBufferSize = csbi.dwSize;
|
||||
|
||||
console_info.WindowSize.X = csbi.srWindow.Right -
|
||||
@@ -163,7 +163,7 @@ static void SetConsoleInfo(void)
|
||||
/* One-time initialization for console_info -- color table and font
|
||||
info from the registry; other values from functions. */
|
||||
|
||||
static void init_console_info(void)
|
||||
static void _init_console_info(void)
|
||||
{
|
||||
DWORD scrnmode, len;
|
||||
HKEY reghnd;
|
||||
@@ -171,7 +171,7 @@ static void init_console_info(void)
|
||||
|
||||
console_info.Length = sizeof(console_info);
|
||||
|
||||
GetConsoleMode(hConIn, &scrnmode);
|
||||
GetConsoleMode(pdc_con_in, &scrnmode);
|
||||
console_info.QuickEdit = !!(scrnmode & 0x0040);
|
||||
console_info.InsertMode = !!(scrnmode & 0x0020);
|
||||
|
||||
@@ -241,10 +241,10 @@ void PDC_scr_close(void)
|
||||
|
||||
PDC_LOG(("PDC_scr_close() - called\n"));
|
||||
|
||||
SetConsoleScreenBufferSize(hConOut, orig_scr.dwSize);
|
||||
SetConsoleWindowInfo(hConOut, TRUE, &orig_scr.srWindow);
|
||||
SetConsoleScreenBufferSize(hConOut, orig_scr.dwSize);
|
||||
SetConsoleWindowInfo(hConOut, TRUE, &orig_scr.srWindow);
|
||||
SetConsoleScreenBufferSize(pdc_con_out, orig_scr.dwSize);
|
||||
SetConsoleWindowInfo(pdc_con_out, TRUE, &orig_scr.srWindow);
|
||||
SetConsoleScreenBufferSize(pdc_con_out, orig_scr.dwSize);
|
||||
SetConsoleWindowInfo(pdc_con_out, TRUE, &orig_scr.srWindow);
|
||||
|
||||
if (SP->_restore != PDC_RESTORE_NONE)
|
||||
{
|
||||
@@ -264,13 +264,13 @@ void PDC_scr_close(void)
|
||||
|
||||
origin.X = origin.Y = 0;
|
||||
|
||||
if (!WriteConsoleOutput(hConOut, ciSaveBuffer,
|
||||
if (!WriteConsoleOutput(pdc_con_out, ci_save,
|
||||
orig_scr.dwSize, origin, &rect))
|
||||
return;
|
||||
}
|
||||
|
||||
SetConsoleActiveScreenBuffer(hConOut);
|
||||
SetConsoleMode(hConIn, dwConsoleMode);
|
||||
SetConsoleActiveScreenBuffer(pdc_con_out);
|
||||
SetConsoleMode(pdc_con_in, old_console_mode);
|
||||
|
||||
if (SP->visibility != 1)
|
||||
curs_set(1);
|
||||
@@ -320,14 +320,14 @@ int PDC_scr_open(int argc, char **argv)
|
||||
if (!SP || !pdc_atrtab)
|
||||
return ERR;
|
||||
|
||||
hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
hConIn = GetStdHandle(STD_INPUT_HANDLE);
|
||||
pdc_con_out = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
pdc_con_in = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
isNT = !(GetVersion() & 0x80000000);
|
||||
is_nt = !(GetVersion() & 0x80000000);
|
||||
|
||||
GetConsoleScreenBufferInfo(hConOut, &csbi);
|
||||
GetConsoleScreenBufferInfo(hConOut, &orig_scr);
|
||||
GetConsoleMode(hConIn, &dwConsoleMode);
|
||||
GetConsoleScreenBufferInfo(pdc_con_out, &csbi);
|
||||
GetConsoleScreenBufferInfo(pdc_con_out, &orig_scr);
|
||||
GetConsoleMode(pdc_con_in, &old_console_mode);
|
||||
|
||||
SP->lines = ((str = getenv("LINES")) != NULL) ?
|
||||
atoi(str) : PDC_get_rows();
|
||||
@@ -362,10 +362,10 @@ int PDC_scr_open(int argc, char **argv)
|
||||
{
|
||||
/* Attempt to save the complete console buffer */
|
||||
|
||||
ciSaveBuffer = malloc(orig_scr.dwSize.X *
|
||||
ci_save = malloc(orig_scr.dwSize.X *
|
||||
orig_scr.dwSize.Y * sizeof(CHAR_INFO));
|
||||
|
||||
if (!ciSaveBuffer)
|
||||
if (!ci_save)
|
||||
{
|
||||
PDC_LOG(("PDC_scr_open() - malloc failure (1)\n"));
|
||||
|
||||
@@ -381,24 +381,24 @@ int PDC_scr_open(int argc, char **argv)
|
||||
rect.Bottom = orig_scr.dwSize.Y - 1;
|
||||
rect.Right = orig_scr.dwSize.X - 1;
|
||||
|
||||
if (!ReadConsoleOutput(hConOut, ciSaveBuffer, bufsize,
|
||||
if (!ReadConsoleOutput(pdc_con_out, ci_save, bufsize,
|
||||
origin, &rect))
|
||||
{
|
||||
/* We can't save the complete buffer, so try and
|
||||
save just the displayed window */
|
||||
|
||||
free(ciSaveBuffer);
|
||||
ciSaveBuffer = NULL;
|
||||
free(ci_save);
|
||||
ci_save = NULL;
|
||||
|
||||
bufsize.X = orig_scr.srWindow.Right -
|
||||
orig_scr.srWindow.Left + 1;
|
||||
bufsize.Y = orig_scr.srWindow.Bottom -
|
||||
orig_scr.srWindow.Top + 1;
|
||||
|
||||
ciSaveBuffer = malloc(bufsize.X * bufsize.Y *
|
||||
ci_save = malloc(bufsize.X * bufsize.Y *
|
||||
sizeof(CHAR_INFO));
|
||||
|
||||
if (!ciSaveBuffer)
|
||||
if (!ci_save)
|
||||
{
|
||||
PDC_LOG(("PDC_scr_open() - malloc failure (2)\n"));
|
||||
|
||||
@@ -412,7 +412,7 @@ int PDC_scr_open(int argc, char **argv)
|
||||
rect.Bottom = orig_scr.srWindow.Bottom;
|
||||
rect.Right = orig_scr.srWindow.Right;
|
||||
|
||||
if (!ReadConsoleOutput(hConOut, ciSaveBuffer,
|
||||
if (!ReadConsoleOutput(pdc_con_out, ci_save,
|
||||
bufsize, origin, &rect))
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
@@ -424,8 +424,8 @@ int PDC_scr_open(int argc, char **argv)
|
||||
|
||||
PDC_LOG(("PDC_scr_open() - %s\n", LastError));
|
||||
#endif
|
||||
free(ciSaveBuffer);
|
||||
ciSaveBuffer = NULL;
|
||||
free(ci_save);
|
||||
ci_save = NULL;
|
||||
|
||||
return ERR;
|
||||
}
|
||||
@@ -445,10 +445,10 @@ int PDC_scr_open(int argc, char **argv)
|
||||
rect.Bottom = bufsize.Y - 1;
|
||||
rect.Right = bufsize.X - 1;
|
||||
|
||||
SetConsoleScreenBufferSize(hConOut, bufsize);
|
||||
SetConsoleWindowInfo(hConOut, TRUE, &rect);
|
||||
SetConsoleScreenBufferSize(hConOut, bufsize);
|
||||
SetConsoleActiveScreenBuffer(hConOut);
|
||||
SetConsoleScreenBufferSize(pdc_con_out, bufsize);
|
||||
SetConsoleWindowInfo(pdc_con_out, TRUE, &rect);
|
||||
SetConsoleScreenBufferSize(pdc_con_out, bufsize);
|
||||
SetConsoleActiveScreenBuffer(pdc_con_out);
|
||||
|
||||
PDC_reset_prog_mode();
|
||||
|
||||
@@ -460,10 +460,10 @@ int PDC_scr_open(int argc, char **argv)
|
||||
|
||||
SP->orgcbr = PDC_get_ctrl_break();
|
||||
|
||||
if (isNT)
|
||||
if (is_nt)
|
||||
{
|
||||
console_info.Hwnd = FindConsoleHandle();
|
||||
init_console_info();
|
||||
console_info.Hwnd = _find_console_handle();
|
||||
_init_console_info();
|
||||
}
|
||||
|
||||
return OK;
|
||||
@@ -473,12 +473,12 @@ int PDC_scr_open(int argc, char **argv)
|
||||
if a scoll bar shrinks the maximum possible value. The rectangle
|
||||
must at least fit in a half-sized window. */
|
||||
|
||||
static BOOL FitConsoleWindow(HANDLE hConOut, CONST SMALL_RECT *rect)
|
||||
static BOOL _fit_console_window(HANDLE con_out, CONST SMALL_RECT *rect)
|
||||
{
|
||||
SMALL_RECT run;
|
||||
SHORT mx, my;
|
||||
|
||||
if (SetConsoleWindowInfo(hConOut, TRUE, rect))
|
||||
if (SetConsoleWindowInfo(con_out, TRUE, rect))
|
||||
return TRUE;
|
||||
|
||||
run = *rect;
|
||||
@@ -488,18 +488,18 @@ static BOOL FitConsoleWindow(HANDLE hConOut, CONST SMALL_RECT *rect)
|
||||
mx = run.Right;
|
||||
my = run.Bottom;
|
||||
|
||||
if (!SetConsoleWindowInfo(hConOut, TRUE, &run))
|
||||
if (!SetConsoleWindowInfo(con_out, TRUE, &run))
|
||||
return FALSE;
|
||||
|
||||
for (run.Right = rect->Right; run.Right >= mx; run.Right--)
|
||||
if (SetConsoleWindowInfo(hConOut, TRUE, &run))
|
||||
if (SetConsoleWindowInfo(con_out, TRUE, &run))
|
||||
break;
|
||||
|
||||
if (run.Right < mx)
|
||||
return FALSE;
|
||||
|
||||
for (run.Bottom = rect->Bottom; run.Bottom >= my; run.Bottom--)
|
||||
if (SetConsoleWindowInfo(hConOut, TRUE, &run))
|
||||
if (SetConsoleWindowInfo(con_out, TRUE, &run))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
@@ -536,7 +536,7 @@ int PDC_resize_screen(int nlines, int ncols)
|
||||
if (nlines < 2 || ncols < 2)
|
||||
return ERR;
|
||||
|
||||
max = GetLargestConsoleWindowSize(hConOut);
|
||||
max = GetLargestConsoleWindowSize(pdc_con_out);
|
||||
|
||||
rect.Left = rect.Top = 0;
|
||||
rect.Right = ncols - 1;
|
||||
@@ -552,11 +552,11 @@ int PDC_resize_screen(int nlines, int ncols)
|
||||
size.X = rect.Right + 1;
|
||||
size.Y = rect.Bottom + 1;
|
||||
|
||||
FitConsoleWindow(hConOut, &rect);
|
||||
SetConsoleScreenBufferSize(hConOut, size);
|
||||
FitConsoleWindow(hConOut, &rect);
|
||||
SetConsoleScreenBufferSize(hConOut, size);
|
||||
SetConsoleActiveScreenBuffer(hConOut);
|
||||
_fit_console_window(pdc_con_out, &rect);
|
||||
SetConsoleScreenBufferSize(pdc_con_out, size);
|
||||
_fit_console_window(pdc_con_out, &rect);
|
||||
SetConsoleScreenBufferSize(pdc_con_out, size);
|
||||
SetConsoleActiveScreenBuffer(pdc_con_out);
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -565,14 +565,14 @@ void PDC_reset_prog_mode(void)
|
||||
{
|
||||
PDC_LOG(("PDC_reset_prog_mode() - called.\n"));
|
||||
|
||||
SetConsoleMode(hConIn, ENABLE_MOUSE_INPUT);
|
||||
SetConsoleMode(pdc_con_in, ENABLE_MOUSE_INPUT);
|
||||
}
|
||||
|
||||
void PDC_reset_shell_mode(void)
|
||||
{
|
||||
PDC_LOG(("PDC_reset_shell_mode() - called.\n"));
|
||||
|
||||
SetConsoleMode(hConIn, dwConsoleMode);
|
||||
SetConsoleMode(pdc_con_in, old_console_mode);
|
||||
}
|
||||
|
||||
void PDC_restore_screen_mode(int i)
|
||||
@@ -585,7 +585,7 @@ void PDC_save_screen_mode(int i)
|
||||
|
||||
bool PDC_can_change_color(void)
|
||||
{
|
||||
return isNT;
|
||||
return is_nt;
|
||||
}
|
||||
|
||||
int PDC_color_content(short color, short *red, short *green, short *blue)
|
||||
@@ -606,7 +606,7 @@ int PDC_init_color(short color, short red, short green, short blue)
|
||||
DIVROUND(green * 255, 1000),
|
||||
DIVROUND(blue * 255, 1000));
|
||||
|
||||
SetConsoleInfo();
|
||||
_set_console_info();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "pdcwin.h"
|
||||
|
||||
RCSID("$Id: pdcsetsc.c,v 1.29 2006/10/08 20:54:30 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcsetsc.c,v 1.30 2006/10/09 14:08:46 wmcbrine Exp $");
|
||||
|
||||
int PDC_curs_set(int visibility)
|
||||
{
|
||||
@@ -28,7 +28,7 @@ int PDC_curs_set(int visibility)
|
||||
|
||||
ret_vis = SP->visibility;
|
||||
|
||||
if (GetConsoleCursorInfo(hConOut,&cci) == FALSE)
|
||||
if (GetConsoleCursorInfo(pdc_con_out, &cci) == FALSE)
|
||||
return ERR;
|
||||
|
||||
switch(visibility)
|
||||
@@ -46,7 +46,7 @@ int PDC_curs_set(int visibility)
|
||||
break;
|
||||
}
|
||||
|
||||
if (SetConsoleCursorInfo(hConOut,&cci) == FALSE)
|
||||
if (SetConsoleCursorInfo(pdc_con_out, &cci) == FALSE)
|
||||
return ERR;
|
||||
|
||||
SP->visibility = visibility;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* See the file maintain.er for details of the current maintainer. *
|
||||
************************************************************************/
|
||||
|
||||
/* $Id: pdcwin.h,v 1.1 2006/10/08 23:39:41 wmcbrine Exp $ */
|
||||
/* $Id: pdcwin.h,v 1.2 2006/10/09 14:08:46 wmcbrine Exp $ */
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
# define UNICODE
|
||||
@@ -25,6 +25,6 @@
|
||||
#undef MOUSE_MOVED
|
||||
#include <curspriv.h>
|
||||
|
||||
extern HANDLE hConOut, hConIn;
|
||||
extern HANDLE pdc_con_out, pdc_con_in;
|
||||
|
||||
extern int PDC_get_buffer_rows(void);
|
||||
|
||||
Reference in New Issue
Block a user