Some OS/2-specific things that don't need to be in SCREEN.

This commit is contained in:
William McBrine
2006-08-11 07:25:40 +00:00
parent be5d254c62
commit 18455c9d7d
3 changed files with 24 additions and 29 deletions

View File

@@ -15,7 +15,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: curses.h,v 1.209 2006/08/11 07:04:31 wmcbrine Exp $ */
/* $Id: curses.h,v 1.210 2006/08/11 07:25:40 wmcbrine Exp $ */
/*----------------------------------------------------------------------*
* PDCurses *
@@ -600,14 +600,9 @@ typedef struct
with each key press */
bool return_key_modifiers; /* TRUE if modifier keys are
returned as "real" keys */
#ifdef OS2
# ifdef EMXVIDEO /* nop if using EMX builtins */
int tahead; /* Type-ahead value */
int adapter; /* Screen type */
# else
# ifndef EMXVIDEO /* nop if using EMX builtins */
VIOMODEINFO scrnmode; /* default screen mode */
VIOCONFIGINFO adapter; /* Screen type */
# endif
#else
int adapter; /* Screen type */

View File

@@ -28,11 +28,12 @@
#ifdef EMXVIDEO
# include <termios.h>
static int tahead = -1;
#else
static KBDINFO kbdinfo; /* default keyboard mode */
#endif
RCSID("$Id: pdckbd.c,v 1.32 2006/08/11 07:04:31 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.33 2006/08/11 07:25:40 wmcbrine Exp $");
/************************************************************************
* Table for key code translation of function keys in keypad mode *
@@ -232,17 +233,17 @@ bool PDC_check_bios_key(void)
PDC_LOG(("PDC_check_bios_key() - called\n"));
#ifdef EMXVIDEO
if (SP->tahead == -1) /* Nothing typed yet */
if (tahead == -1) /* Nothing typed yet */
{
SP->tahead = _read_kbd(0, 0, 0);
tahead = _read_kbd(0, 0, 0);
/* Read additional */
if (SP->tahead == 0)
SP->tahead = _read_kbd(0, 1, 0) << 8;
if (tahead == 0)
tahead = _read_kbd(0, 1, 0) << 8;
}
return (SP->tahead != -1);
return (tahead != -1);
#else
# ifndef _MSC_VER
KbdPeek(&keyInfo, 0); /* peek at keyboard */
@@ -281,21 +282,21 @@ int PDC_get_bios_key(void)
PDC_LOG(("PDC_get_bios_key() - called\n"));
#ifdef EMXVIDEO
if (SP->tahead == -1)
if (tahead == -1)
{
SP->tahead = _read_kbd(0, 1, 0);
tahead = _read_kbd(0, 1, 0);
/* Read additional */
if (SP->tahead == 0)
SP->tahead = _read_kbd(0, 1, 0) << 8;
if (tahead == 0)
tahead = _read_kbd(0, 1, 0) << 8;
}
ascii = SP->tahead & 0xff;
scan = SP->tahead >> 8;
ascii = tahead & 0xff;
scan = tahead >> 8;
pdc_key_modifiers = 0L;
SP->tahead = -1;
tahead = -1;
#else
KbdCharIn(&keyInfo, IO_WAIT, 0); /* get a character */

View File

@@ -20,7 +20,7 @@
#include <curses.h>
#include <stdlib.h>
RCSID("$Id: pdcscrn.c,v 1.36 2006/08/11 07:04:31 wmcbrine Exp $");
RCSID("$Id: pdcscrn.c,v 1.37 2006/08/11 07:25:40 wmcbrine Exp $");
#ifdef EMXVIDEO
static unsigned char *saved_screen = NULL;
@@ -138,7 +138,10 @@ static bool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2)
int PDC_scr_open(int argc, char **argv)
{
char *ptr;
#ifndef EMXVIDEO
#ifdef EMXVIDEO
int adapter;
#else
VIOCONFIGINFO adapter;
USHORT totchars;
#endif
PDC_LOG(("PDC_scr_open() - called\n"));
@@ -153,12 +156,8 @@ int PDC_scr_open(int argc, char **argv)
PDC_get_cursor_pos(&SP->cursrow, &SP->curscol);
#ifdef EMXVIDEO
SP->tahead = -1;
#endif
#ifndef EMXVIDEO
PDC_query_adapter_type(&SP->adapter);
PDC_query_adapter_type(&adapter);
PDC_get_scrn_mode(&SP->scrnmode);
PDC_get_keyboard_info();
@@ -166,8 +165,8 @@ int PDC_scr_open(int argc, char **argv)
PDC_set_keyboard_binary(TRUE);
#else
SP->adapter = PDC_query_adapter_type();
if (SP->adapter == _UNIX_MONO)
adapter = PDC_query_adapter_type();
if (adapter == _UNIX_MONO)
SP->mono = TRUE;
#endif
SP->orig_font = SP->font = PDC_get_font();