From 18455c9d7dfea2236ff64c601b22024feec4cf4e Mon Sep 17 00:00:00 2001 From: William McBrine Date: Fri, 11 Aug 2006 07:25:40 +0000 Subject: [PATCH] Some OS/2-specific things that don't need to be in SCREEN. --- curses.h | 9 ++------- os2/pdckbd.c | 27 ++++++++++++++------------- os2/pdcscrn.c | 17 ++++++++--------- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/curses.h b/curses.h index 1d6de4b7..608961c2 100644 --- a/curses.h +++ b/curses.h @@ -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 */ diff --git a/os2/pdckbd.c b/os2/pdckbd.c index 88980eef..099d92ad 100644 --- a/os2/pdckbd.c +++ b/os2/pdckbd.c @@ -28,11 +28,12 @@ #ifdef EMXVIDEO # include +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 */ diff --git a/os2/pdcscrn.c b/os2/pdcscrn.c index 248b1acb..c5be16a1 100644 --- a/os2/pdcscrn.c +++ b/os2/pdcscrn.c @@ -20,7 +20,7 @@ #include #include -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();