| 1 | /* $Id: conout.h,v 1.3 2001-11-26 14:53:59 sandervl Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 5 | * Win32 Console Subsystem for OS/2
|
|---|
| 6 | * 1998/02/11 PH Patrick Haller (haller@zebra.fh-weingarten.de)
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | #ifndef _CONSOLE_OUT_H_
|
|---|
| 10 | #define _CONSOLE_OUT_H_
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | /*****************************************************************************
|
|---|
| 14 | * Remark *
|
|---|
| 15 | *****************************************************************************
|
|---|
| 16 |
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 | /*****************************************************************************
|
|---|
| 21 | * Resources *
|
|---|
| 22 | *****************************************************************************/
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | /*****************************************************************************
|
|---|
| 26 | * Includes *
|
|---|
| 27 | *****************************************************************************/
|
|---|
| 28 |
|
|---|
| 29 | //#include <win32type.h>
|
|---|
| 30 | #include "handlemanager.h"
|
|---|
| 31 | #include "HMDevice.h"
|
|---|
| 32 | #include "Console2.h"
|
|---|
| 33 |
|
|---|
| 34 | /*****************************************************************************
|
|---|
| 35 | * ConsoleOutput - redirects requests to the currently active buffer *
|
|---|
| 36 | *****************************************************************************/
|
|---|
| 37 |
|
|---|
| 38 | class HMDeviceConsoleOutClass : public HMDeviceHandler
|
|---|
| 39 | {
|
|---|
| 40 | protected:
|
|---|
| 41 | HANDLE hConsoleBuffer; /* handle to the active console buffer */
|
|---|
| 42 | PICONSOLEINPUT pConsoleInput; /* pointer to console input area */
|
|---|
| 43 | PICONSOLEGLOBALS pConsoleGlobals; /* pointer to console global area */
|
|---|
| 44 |
|
|---|
| 45 | public:
|
|---|
| 46 | HMDeviceConsoleOutClass(LPCSTR lpDeviceName,
|
|---|
| 47 | PICONSOLEINPUT piConsoleInput,
|
|---|
| 48 | PICONSOLEGLOBALS piConsoleGlobals)
|
|---|
| 49 | : HMDeviceHandler(lpDeviceName)
|
|---|
| 50 | {
|
|---|
| 51 | pConsoleInput = piConsoleInput; // save pointers to this data
|
|---|
| 52 | pConsoleGlobals = piConsoleGlobals;
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | /* this is a handler method for calls to CreateFile() */
|
|---|
| 56 | virtual DWORD CreateFile (HANDLE hHandle,
|
|---|
| 57 | LPCSTR lpFileName,
|
|---|
| 58 | PHMHANDLEDATA pHMHandleData,
|
|---|
| 59 | PVOID lpSecurityAttributes,
|
|---|
| 60 | PHMHANDLEDATA pHMHandleDataTemplate);
|
|---|
| 61 |
|
|---|
| 62 | /* this is a handler method for calls to ReadFile() */
|
|---|
| 63 | virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData,
|
|---|
| 64 | LPCVOID lpBuffer,
|
|---|
| 65 | DWORD nNumberOfBytesToRead,
|
|---|
| 66 | LPDWORD lpNumberOfBytesRead,
|
|---|
| 67 | LPOVERLAPPED lpOverlapped);
|
|---|
| 68 |
|
|---|
| 69 | /* this is a handler method for calls to WriteFile() */
|
|---|
| 70 | virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData,
|
|---|
| 71 | LPCVOID lpBuffer,
|
|---|
| 72 | DWORD nNumberOfBytesToWrite,
|
|---|
| 73 | LPDWORD lpNumberOfBytesWritten,
|
|---|
| 74 | LPOVERLAPPED lpOverlapped);
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 | /* handling non-standard I/O */
|
|---|
| 78 | virtual DWORD _DeviceRequest (PHMHANDLEDATA pHMHandleData,
|
|---|
| 79 | ULONG ulRequestCode,
|
|---|
| 80 | ULONG arg1,
|
|---|
| 81 | ULONG arg2,
|
|---|
| 82 | ULONG arg3,
|
|---|
| 83 | ULONG arg4);
|
|---|
| 84 |
|
|---|
| 85 | /* this is a handler method for calls to GetFileType() */
|
|---|
| 86 | virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData);
|
|---|
| 87 |
|
|---|
| 88 | };
|
|---|
| 89 |
|
|---|
| 90 | #endif /* _CONSOLE_OUT_H_ */
|
|---|
| 91 |
|
|---|