[7549] | 1 | /* $Id: conout.h,v 1.4 2001-12-05 14:15:58 sandervl Exp $ */
|
---|
[111] | 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() */
|
---|
[7549] | 56 | virtual DWORD CreateFile (LPCSTR lpFileName,
|
---|
[111] | 57 | PHMHANDLEDATA pHMHandleData,
|
---|
| 58 | PVOID lpSecurityAttributes,
|
---|
| 59 | PHMHANDLEDATA pHMHandleDataTemplate);
|
---|
| 60 |
|
---|
[7549] | 61 | /* this is a handler method for calls to GetFileType() */
|
---|
| 62 | virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData);
|
---|
| 63 |
|
---|
[111] | 64 | /* this is a handler method for calls to ReadFile() */
|
---|
[4407] | 65 | virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData,
|
---|
[111] | 66 | LPCVOID lpBuffer,
|
---|
| 67 | DWORD nNumberOfBytesToRead,
|
---|
| 68 | LPDWORD lpNumberOfBytesRead,
|
---|
[7549] | 69 | LPOVERLAPPED lpOverlapped,
|
---|
| 70 | LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
|
---|
[111] | 71 |
|
---|
| 72 | /* this is a handler method for calls to WriteFile() */
|
---|
[4407] | 73 | virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData,
|
---|
[111] | 74 | LPCVOID lpBuffer,
|
---|
| 75 | DWORD nNumberOfBytesToWrite,
|
---|
| 76 | LPDWORD lpNumberOfBytesWritten,
|
---|
[7549] | 77 | LPOVERLAPPED lpOverlapped,
|
---|
| 78 | LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
|
---|
[111] | 79 |
|
---|
| 80 |
|
---|
| 81 | /* handling non-standard I/O */
|
---|
| 82 | virtual DWORD _DeviceRequest (PHMHANDLEDATA pHMHandleData,
|
---|
| 83 | ULONG ulRequestCode,
|
---|
| 84 | ULONG arg1,
|
---|
| 85 | ULONG arg2,
|
---|
| 86 | ULONG arg3,
|
---|
| 87 | ULONG arg4);
|
---|
[4407] | 88 |
|
---|
[111] | 89 | };
|
---|
| 90 |
|
---|
| 91 | #endif /* _CONSOLE_OUT_H_ */
|
---|
| 92 |
|
---|