/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/****************************************************************************
* Author: Juergen Pfeifer *
- * *
****************************************************************************/
/*
#include <curses.priv.h>
#define CUR my_term.type.
-MODULE_ID("$Id: win_driver.c,v 1.9 2010/07/31 23:43:21 tom Exp $")
+MODULE_ID("$Id: win_driver.c,v 1.11 2012/02/18 20:28:25 tom Exp $")
#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE)
#define AssertTCB() assert(TCB!=0 && TCB->magic==WINMAGIC)
-#define SetSP() assert(TCB->csp!=0); sp = TCB->csp
+#define SetSP() assert(TCB->csp!=0); sp = TCB->csp; (void) sp
#define GenMap(vKey,key) MAKELONG(key, vKey)
static int
drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB,
- bool beepFlag GCC_UNUSED)
+ int beepFlag GCC_UNUSED)
{
SCREEN *sp;
int res = ERR;
static void
drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB,
- bool fore,
+ int fore,
int color,
int (*outc) (SCREEN *, int) GCC_UNUSED)
{
}
static int
-drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf)
+drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, int setFlag, TTY * buf)
{
DWORD dwFlag = 0;
tcflag_t iflag;
}
static int
-drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag)
+drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag)
{
SCREEN *sp;
TERMINAL *_term = (TERMINAL *) TCB;
static void
drv_initpair(TERMINAL_CONTROL_BLOCK * TCB,
- short pair,
- short f,
- short b)
+ int pair,
+ int f,
+ int b)
{
SCREEN *sp;
static void
drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB,
- short color GCC_UNUSED,
- short r GCC_UNUSED,
- short g GCC_UNUSED,
- short b GCC_UNUSED)
+ int color GCC_UNUSED,
+ int r GCC_UNUSED,
+ int g GCC_UNUSED,
+ int b GCC_UNUSED)
{
SCREEN *sp;
static void
drv_do_color(TERMINAL_CONTROL_BLOCK * TCB,
- short old_pair GCC_UNUSED,
- short pair GCC_UNUSED,
- bool reverse GCC_UNUSED,
+ int old_pair GCC_UNUSED,
+ int pair GCC_UNUSED,
+ int reverse GCC_UNUSED,
int (*outc) (SCREEN *, int) GCC_UNUSED
)
{
static void
drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB,
- bool OnFlag GCC_UNUSED)
+ int OnFlag GCC_UNUSED)
{
SCREEN *sp;
EVENTLIST_2nd(_nc_eventlist * evl))
{
SCREEN *sp;
- INPUT_RECORD inp;
+ INPUT_RECORD inp_rec;
BOOL b;
DWORD nRead = 0, rc = -1;
int code = 0;
int diff;
bool isImmed = (milliseconds == 0);
-#define CONSUME() ReadConsoleInput(TCB->inp,&inp,1,&nRead)
+#define CONSUME() ReadConsoleInput(TCB->inp,&inp_rec,1,&nRead)
AssertTCB();
SetSP();
if (milliseconds < 0)
milliseconds = INFINITY;
- memset(&inp, 0, sizeof(inp));
+ memset(&inp_rec, 0, sizeof(inp_rec));
while (true) {
GetSystemTimeAsFileTime(&fstart);
if (mode) {
b = GetNumberOfConsoleInputEvents(TCB->inp, &nRead);
if (b && nRead > 0) {
- b = PeekConsoleInput(TCB->inp, &inp, 1, &nRead);
+ b = PeekConsoleInput(TCB->inp, &inp_rec, 1, &nRead);
if (b && nRead > 0) {
- switch (inp.EventType) {
+ switch (inp_rec.EventType) {
case KEY_EVENT:
if (mode & TW_INPUT) {
- WORD vk = inp.Event.KeyEvent.wVirtualKeyCode;
- char ch = inp.Event.KeyEvent.uChar.AsciiChar;
+ WORD vk = inp_rec.Event.KeyEvent.wVirtualKeyCode;
+ char ch = inp_rec.Event.KeyEvent.uChar.AsciiChar;
- if (inp.Event.KeyEvent.bKeyDown) {
+ if (inp_rec.Event.KeyEvent.bKeyDown) {
if (0 == ch) {
int nKey = MapKey(TCB, vk);
if ((nKey < 0) || FALSE == sp->_keypad_on) {
continue;
case MOUSE_EVENT:
if (decode_mouse(TCB,
- (inp.Event.MouseEvent.dwButtonState
+ (inp_rec.Event.MouseEvent.dwButtonState
& BUTTON_MASK)) == 0) {
CONSUME();
} else if (mode & TW_MOUSE) {
{
SCREEN *sp;
int n = 1;
- INPUT_RECORD inp;
+ INPUT_RECORD inp_rec;
BOOL b;
DWORD nRead;
WORD vk;
- WORD sc;
AssertTCB();
assert(buf);
SetSP();
- memset(&inp, 0, sizeof(inp));
+ memset(&inp_rec, 0, sizeof(inp_rec));
T((T_CALLED("win32con::drv_read(%p)"), TCB));
- while ((b = ReadConsoleInput(TCB->inp, &inp, 1, &nRead))) {
+ while ((b = ReadConsoleInput(TCB->inp, &inp_rec, 1, &nRead))) {
if (b && nRead > 0) {
- if (inp.EventType == KEY_EVENT) {
- if (!inp.Event.KeyEvent.bKeyDown)
+ if (inp_rec.EventType == KEY_EVENT) {
+ if (!inp_rec.Event.KeyEvent.bKeyDown)
continue;
- *buf = (int) inp.Event.KeyEvent.uChar.AsciiChar;
- vk = inp.Event.KeyEvent.wVirtualKeyCode;
- sc = inp.Event.KeyEvent.wVirtualScanCode;
+ *buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar;
+ vk = inp_rec.Event.KeyEvent.wVirtualKeyCode;
if (*buf == 0) {
if (sp->_keypad_on) {
*buf = MapKey(TCB, vk);
} else { /* *buf != 0 */
break;
}
- } else if (inp.EventType == MOUSE_EVENT) {
- if (handle_mouse(TCB, inp.Event.MouseEvent)) {
+ } else if (inp_rec.EventType == MOUSE_EVENT) {
+ if (handle_mouse(TCB, inp_rec.Event.MouseEvent)) {
*buf = KEY_MOUSE;
break;
}
}
static int
-drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag GCC_UNUSED)
+drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, int flag GCC_UNUSED)
{
SCREEN *sp;
int code = ERR;
}
static int
-drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int keycode, bool flag)
+drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int keycode, int flag)
{
int code = ERR;
SCREEN *sp;