winpty/agent/Win32Console.h
Ryan Prichard d8b8403651 Begin removing the Qt dependency.
* Replace QPoint and QSize with Coord, a C++ class derived from COORD.

 * Replace QRect with SmallRect, a C++ class derived from SMALL_RECT.

 * Turn Win32Console into a non-QObject class.
2012-03-13 00:16:51 -07:00

43 lines
908 B
C++

#ifndef WIN32CONSOLE_H
#define WIN32CONSOLE_H
#include <windows.h>
#include "Coord.h"
#include "SmallRect.h"
class Win32Console
{
public:
Win32Console();
~Win32Console();
HANDLE conin();
HANDLE conout();
HWND hwnd();
void postCloseMessage();
// Buffer and window sizes.
Coord bufferSize();
SmallRect windowRect();
void resizeBuffer(const Coord &size);
void moveWindow(const SmallRect &rect);
void reposition(const Coord &bufferSize, const SmallRect &windowRect);
// Cursor.
Coord cursorPosition();
void setCursorPosition(const Coord &point);
// Input stream.
void writeInput(const INPUT_RECORD *ir, int count=1);
// Screen content.
void read(const SmallRect &rect, CHAR_INFO *data);
void write(const SmallRect &rect, const CHAR_INFO *data);
private:
HANDLE m_conin;
HANDLE m_conout;
};
#endif // WIN32CONSOLE_H