From f638aef517b6fe52f96deb17c05179145c339867 Mon Sep 17 00:00:00 2001 From: Patrik Stridvall Date: Mon, 7 Dec 1998 09:36:13 +0000 Subject: [PATCH] Added the new TTY driver. --- Makefile.in | 6 ++- configure | 4 +- configure.in | 1 + include/ttydrv.h | 46 +++++++++++++++++++ windows/ttydrv/.cvsignore | 1 + windows/ttydrv/Makefile.in | 20 ++++++++ windows/ttydrv/clipboard.c | 48 ++++++++++++++++++++ windows/ttydrv/event.c | 93 ++++++++++++++++++++++++++++++++++++++ windows/ttydrv/init.c | 64 ++++++++++++++++++++++++++ windows/ttydrv/keyboard.c | 62 +++++++++++++++++++++++++ windows/ttydrv/mouse.c | 9 ++++ windows/ttydrv/wnd.c | 9 ++++ 12 files changed, 360 insertions(+), 3 deletions(-) create mode 100644 include/ttydrv.h create mode 100644 windows/ttydrv/.cvsignore create mode 100644 windows/ttydrv/Makefile.in create mode 100644 windows/ttydrv/clipboard.c create mode 100644 windows/ttydrv/event.c create mode 100644 windows/ttydrv/init.c create mode 100644 windows/ttydrv/keyboard.c create mode 100644 windows/ttydrv/mouse.c create mode 100644 windows/ttydrv/wnd.c diff --git a/Makefile.in b/Makefile.in index 91b8c5763ae..834477cc598 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,7 +57,8 @@ LIBSUBDIRS = \ scheduler \ server \ win32 \ - windows + windows \ + windows/ttydrv X11SUBDIRS = \ graphics/x11drv \ @@ -119,7 +120,8 @@ LIBOBJS = \ scheduler/scheduler.o \ server/server.o \ win32/win32.o \ - windows/windows.o + windows/windows.o \ + windows/ttydrv/ttydrv.o X11OBJS = \ graphics/x11drv/x11drv.o \ diff --git a/configure b/configure index e2c1d37b205..5f0e2bdd6ea 100755 --- a/configure +++ b/configure @@ -25,7 +25,7 @@ ac_help="$ac_help ac_help="$ac_help --with-ncurses compile in the ncurses terminal" ac_help="$ac_help - --without-reentrant-x Compile for use with non-reentrant X libraries" + --without-reentrant-x compile for use with non-reentrant X libraries" ac_help="$ac_help --with-x use the X Window System" @@ -3752,6 +3752,7 @@ tools/wrc/Makefile tsx11/Makefile win32/Makefile windows/Makefile +windows/ttydrv/Makefile windows/x11drv/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF diff --git a/configure.in b/configure.in index cbe608fdc66..4594de32d4b 100644 --- a/configure.in +++ b/configure.in @@ -558,6 +558,7 @@ tools/wrc/Makefile tsx11/Makefile win32/Makefile windows/Makefile +windows/ttydrv/Makefile windows/x11drv/Makefile ]) if test "$wine_cv_libc_reentrant" = "no" diff --git a/include/ttydrv.h b/include/ttydrv.h new file mode 100644 index 00000000000..99d9828e487 --- /dev/null +++ b/include/ttydrv.h @@ -0,0 +1,46 @@ +/* + * TTY driver definitions + */ + +#ifndef __WINE_TTYDRV_H +#define __WINE_TTYDRV_H + +#include "clipboard.h" +#include "keyboard.h" +#include "message.h" + +/* TTY clipboard driver */ + +extern CLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver; + +extern void TTYDRV_CLIPBOARD_EmptyClipboard(); +extern void TTYDRV_CLIPBOARD_SetClipboardData(UINT32 wFormat); +extern BOOL32 TTYDRV_CLIPBOARD_RequestSelection(); +extern void TTYDRV_CLIPBOARD_ResetOwner(WND *pWnd); + +/* TTY event driver */ + +extern EVENT_DRIVER TTYDRV_EVENT_Driver; + +extern BOOL32 TTYDRV_EVENT_Init(void); +extern void TTYDRV_EVENT_AddIO(int fd, unsigned flag); +extern void TTYDRV_EVENT_DeleteIO(int fd, unsigned flag); +extern BOOL32 TTYDRV_EVENT_WaitNetEvent(BOOL32 sleep, BOOL32 peek); +extern void TTYDRV_EVENT_Synchronize(void); +extern BOOL32 TTYDRV_EVENT_CheckFocus( void ); +extern BOOL32 TTYDRV_EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state); +extern void TTYDRV_EVENT_DummyMotionNotify(void); +extern BOOL32 TTYDRV_EVENT_Pending(void); +extern BOOL16 TTYDRV_EVENT_IsUserIdle(void); + +/* TTY keyboard driver */ + +extern KEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver; + +extern void TTYDRV_KEYBOARD_Init(void); +extern WORD TTYDRV_KEYBOARD_VkKeyScan(CHAR cChar); +extern UINT16 TTYDRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType); +extern INT16 TTYDRV_KEYBOARD_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT16 nSize); +extern INT16 TTYDRV_KEYBOARD_ToAscii(UINT16 virtKey, UINT16 scanCode, LPBYTE lpKeyState, LPVOID lpChar, UINT16 flags); + +#endif /* !defined(__WINE_TTYDRV_H) */ diff --git a/windows/ttydrv/.cvsignore b/windows/ttydrv/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/windows/ttydrv/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/windows/ttydrv/Makefile.in b/windows/ttydrv/Makefile.in new file mode 100644 index 00000000000..8e244948245 --- /dev/null +++ b/windows/ttydrv/Makefile.in @@ -0,0 +1,20 @@ +DEFS = @DLLFLAGS@ -D__WINE__ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = ttydrv + +C_SRCS = \ + clipboard.c \ + event.c \ + init.c \ + keyboard.c \ + mouse.c \ + wnd.c + +all: $(MODULE).o + +@MAKE_RULES@ + +### Dependencies: diff --git a/windows/ttydrv/clipboard.c b/windows/ttydrv/clipboard.c new file mode 100644 index 00000000000..48dbd6fd3d9 --- /dev/null +++ b/windows/ttydrv/clipboard.c @@ -0,0 +1,48 @@ +/* + * TTY clipboard driver + * + * Copyright 1998 Patrik Stridvall + */ + +#include "config.h" + +#include "heap.h" +#include "ttydrv.h" + +/**********************************************************************/ + +char *TTYDRV_CLIPBOARD_szSelection = NULL; + +/*********************************************************************** + * TTYDRV_CLIPBOARD_EmptyClipboard + */ +void TTYDRV_CLIPBOARD_EmptyClipboard() +{ + if(TTYDRV_CLIPBOARD_szSelection) + { + HeapFree(SystemHeap, 0, TTYDRV_CLIPBOARD_szSelection); + TTYDRV_CLIPBOARD_szSelection = NULL; + } +} + +/*********************************************************************** + * TTYDRV_CLIPBOARD_SetClipboardData + */ +void TTYDRV_CLIPBOARD_SetClipboardData(UINT32 wFormat) +{ +} + +/*********************************************************************** + * TTYDRV_CLIPBOARD_RequestSelection + */ +BOOL32 TTYDRV_CLIPBOARD_RequestSelection() +{ + return FALSE; +} + +/*********************************************************************** + * TTYDRV_CLIPBOARD_ResetOwner + */ +void TTYDRV_CLIPBOARD_ResetOwner(WND *pWnd) +{ +} diff --git a/windows/ttydrv/event.c b/windows/ttydrv/event.c new file mode 100644 index 00000000000..9c92afac04c --- /dev/null +++ b/windows/ttydrv/event.c @@ -0,0 +1,93 @@ +/* + * TTY event driver + * + * Copyright 1998 Patrik Stridvall + */ + +#include "config.h" + +#include "ttydrv.h" + +/*********************************************************************** + * TTYDRV_EVENT_Init + */ +BOOL32 TTYDRV_EVENT_Init(void) +{ + return TRUE; +} + +/*********************************************************************** + * TTYDRV_EVENT_AddIO + */ +void TTYDRV_EVENT_AddIO(int fd, unsigned flag) +{ +} + +/*********************************************************************** + * TTYDRV_EVENT_DeleteIO + */ +void TTYDRV_EVENT_DeleteIO(int fd, unsigned flag) +{ +} + +/*********************************************************************** + * TTYDRV_EVENT_WaitNetEvent + */ +BOOL32 TTYDRV_EVENT_WaitNetEvent(BOOL32 sleep, BOOL32 peek) +{ + return TRUE; +} + +/*********************************************************************** + * TTYDRV_EVENT_Synchronize + */ +void TTYDRV_EVENT_Synchronize(void) +{ +} + +/*********************************************************************** + * TTYDRV_EVENT_CheckFocus + */ +BOOL32 TTYDRV_EVENT_CheckFocus(void) +{ + return TRUE; +} + +/*********************************************************************** + * TTYDRV_EVENT_QueryPointer + */ +BOOL32 TTYDRV_EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state) +{ + if(posX) + *posX = 0; + + if(posY) + *posY = 0; + + if(state) + *state = 0; +} + +/*********************************************************************** + * TTYDRV_EVENT_DummyMotionNotify + */ +void TTYDRV_EVENT_DummyMotionNotify(void) +{ +} + +/*********************************************************************** + * TTYDRV_EVENT_Pending + */ +BOOL32 TTYDRV_EVENT_Pending(void) +{ + return FALSE; +} + +/*********************************************************************** + * TTYDRV_EVENT_IsUserIdle + */ +BOOL16 TTYDRV_EVENT_IsUserIdle(void) +{ + return TRUE; +} + diff --git a/windows/ttydrv/init.c b/windows/ttydrv/init.c new file mode 100644 index 00000000000..99139bfffea --- /dev/null +++ b/windows/ttydrv/init.c @@ -0,0 +1,64 @@ +/* + * TTY driver + * + * Copyright 1998 Patrik Stridvall + */ + +#include "config.h" + +#include "ttydrv.h" + +#if 0 +WND_DRIVER TTYDRV_WND_Driver = +{ + TTYDRV_WND_CreateDesktopWindow, + TTYDRV_WND_CreateWindow, + TTYDRV_WND_DestroyWindow, + TTYDRV_WND_SetParent, + TTYDRV_WND_ForceWindowRaise, + TTYDRV_WND_SetWindowPos, + TTYDRV_WND_SetText, + TTYDRV_WND_SetFocus, + TTYDRV_WND_PreSizeMove, + TTYDRV_WND_PostSizeMove +}; +#endif + +CLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver = +{ + TTYDRV_CLIPBOARD_EmptyClipboard, + TTYDRV_CLIPBOARD_SetClipboardData, + TTYDRV_CLIPBOARD_RequestSelection, + TTYDRV_CLIPBOARD_ResetOwner +}; + +KEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver = +{ + TTYDRV_KEYBOARD_Init, + TTYDRV_KEYBOARD_VkKeyScan, + TTYDRV_KEYBOARD_MapVirtualKey, + TTYDRV_KEYBOARD_GetKeyNameText, + TTYDRV_KEYBOARD_ToAscii +}; + +#if 0 +EVENT_DRIVER TTYDRV_EVENT_Driver = +{ + TTYDRV_EVENT_Init, + TTYDRV_EVENT_AddIO, + TTYDRV_EVENT_DeleteIO, + TTYDRV_EVENT_WaitNetEvent, + TTYDRV_EVENT_Synchronize, + TTYDRV_EVENT_CheckFocus, + TTYDRV_EVENT_QueryPointer, + TTYDRV_EVENT_DummyMotionNotify, + TTYDRV_EVENT_Pending, + TTYDRV_EVENT_IsUserIdle +}; +#endif + +#if 0 +MOUSE_DRIVER TTYDRV_MOUSE_Driver = +{ +}; +#endif diff --git a/windows/ttydrv/keyboard.c b/windows/ttydrv/keyboard.c new file mode 100644 index 00000000000..959085c1687 --- /dev/null +++ b/windows/ttydrv/keyboard.c @@ -0,0 +1,62 @@ +/* + * TTY keyboard driver + * + * Copyright 1998 Patrik Stridvall + */ + +#include "config.h" + +#include "keyboard.h" +#include "ttydrv.h" + +/*********************************************************************** + * TTYDRV_KEYBOARD_Init + */ +void TTYDRV_KEYBOARD_Init(void) +{ +} + +/*********************************************************************** + * TTYDRV_KEYBOARD_VkKeyScan + */ +WORD TTYDRV_KEYBOARD_VkKeyScan(CHAR cChar) +{ + return 0; +} + +/*********************************************************************** + * TTYDRV_KEYBOARD_MapVirtualKey + */ +UINT16 TTYDRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType) +{ + return 0; +} + +/*********************************************************************** + * TTYDRV_KEYBOARD_GetKeyNameText + */ +INT16 TTYDRV_KEYBOARD_GetKeyNameText( + LONG lParam, LPSTR lpBuffer, INT16 nSize) +{ + if(lpBuffer && nSize) + { + *lpBuffer = 0; + } + return 0; +} + +/*********************************************************************** + * TTYDRV_KEYBOARD_ToAscii + */ +INT16 TTYDRV_KEYBOARD_ToAscii( + UINT16 virtKey, UINT16 scanCode, + LPBYTE lpKeyState, LPVOID lpChar, UINT16 flags) +{ + return 0; +} + + + + + + diff --git a/windows/ttydrv/mouse.c b/windows/ttydrv/mouse.c new file mode 100644 index 00000000000..6bede5ceadc --- /dev/null +++ b/windows/ttydrv/mouse.c @@ -0,0 +1,9 @@ +/* + * TTY mouse driver + * + * Copyright 1998 Patrik Stridvall + */ + +#include "config.h" + +#include "ttydrv.h" diff --git a/windows/ttydrv/wnd.c b/windows/ttydrv/wnd.c new file mode 100644 index 00000000000..0e7debfc5ba --- /dev/null +++ b/windows/ttydrv/wnd.c @@ -0,0 +1,9 @@ +/* + * TTY window driver + * + * Copyright 1998 Patrik Stridvall + */ + +#include "config.h" + +#include "ttydrv.h"