#include <api_drv_video.h> // tVT_Char
#include <api_drv_terminal.h>
#include <vfs.h>
+#include <drv_pty.h>
// === CONSTANTS ===
#define MAX_INPUT_CHARS32 64
int Mode; //!< Current Mode (see ::eTplTerminal_Modes)
int Flags; //!< Flags (see VT_FLAG_*)
- short NewWidth; //!< Un-applied dimensions (Width)
- short NewHeight; //!< Un-applied dimensions (Height)
short Width; //!< Virtual Width
short Height; //!< Virtual Height
short TextWidth; //!< Text Virtual Width
int AltWritePos; //!< Alternate write position
short ScrollTop; //!< Top of scrolling region (smallest)
short ScrollHeight; //!< Length of scrolling region
+ int SavedWritePos; //!< Saved cursor position (\e[s and \e[u)
+
+ char EscapeCodeCache[16];
+ size_t EscapeCodeLen;
int VideoCursorX;
int VideoCursorY;
- tMutex ReadingLock; //!< Lock the VTerm when a process is reading from it
- tTID ReadingThread; //!< Owner of the lock
- int InputRead; //!< Input buffer read position
- int InputWrite; //!< Input buffer write position
- char InputBuffer[MAX_INPUT_CHARS8];
Uint32 RawScancode; //!< last raw scancode recieved
-// tSemaphore InputSemaphore;
- tPGID OwningProcessGroup; //!< The process group that owns the terminal
-
Uint32 *Buffer;
// TODO: Do I need to keep this about?
// When should it be deallocated? on move to text mode, or some other time
// Call set again, it's freed, and if NULL it doesn't get reallocated.
tVideo_IOCtl_Bitmap *VideoCursor;
-
- char Name[2]; //!< Name of the terminal
- tVFS_Node Node;
+
+ struct {
+ int Current;
+ size_t CurrentSize;
+ size_t Offset;
+ int CachePos;
+ char Cache[32];
+ size_t PreEat;
+ } Cmd2D;
+
+ tPTY *PTY;
};
// === GOBALS ===
// === FUNCTIONS ===
extern void VT_SetResolution(int Width, int Height);
extern void VT_SetTerminal(int ID);
+extern void VT_int_Handle2DCmd(void *Handle, size_t Length, const void *Data);
// --- Output ---
extern void VT_InitOutput(void);
extern void VT_SetMode(int Mode);
extern void VT_int_PutChar(tVTerm *Term, Uint32 Ch);
extern void VT_int_ScrollText(tVTerm *Term, int Count);
extern void VT_int_ClearLine(tVTerm *Term, int Num);
-extern void VT_int_ChangeMode(tVTerm *Term, int NewMode, int NewWidth, int NewHeight);
+extern void VT_int_Resize(tVTerm *Term, int NewWidth, int NewHeight);
extern void VT_int_ToggleAltBuffer(tVTerm *Term, int Enabled);
#endif