Set opcode correctly for binary frames.
[libvncserver.git] / vncterm / VNConsole.h
blobae6822d5a1bd27fb0d060016d43791f9b0361d5e
1 #include <rfb/rfb.h>
3 /* this is now the default */
4 #define USE_ATTRIBUTE_BUFFER
6 typedef struct vncConsole {
7 /* width and height in cells (=characters) */
8 int width, height;
10 /* current position */
11 int x,y;
13 /* characters */
14 char *screenBuffer;
16 #ifdef USE_ATTRIBUTE_BUFFER
17 /* attributes: colours. If NULL, default to gray on black, else
18 for each cell an unsigned char holds foreColour|(backColour<<4) */
19 char *attributeBuffer;
20 #endif
22 /* if this is set, the screen doesn't scroll. */
23 rfbBool wrapBottomToTop;
25 /* height and width of one character */
26 int cWidth, cHeight;
27 /* offset of characters */
28 int xhot,yhot;
30 /* colour */
31 unsigned char foreColour,backColour;
32 int8_t cx1,cy1,cx2,cy2;
34 /* input buffer */
35 char *inputBuffer;
36 int inputCount;
37 int inputSize;
38 long selectTimeOut;
39 rfbBool doEcho; /* if reading input, do output directly? */
41 /* selection */
42 char *selection;
44 /* mouse */
45 rfbBool wasRightButtonDown;
46 rfbBool currentlyMarking;
47 int markStart,markEnd;
49 /* should text cursor be drawn? (an underscore at current position) */
50 rfbBool cursorActive;
51 rfbBool cursorIsDrawn;
52 rfbBool dontDrawCursor; /* for example, while scrolling */
54 rfbFontDataPtr font;
55 rfbScreenInfoPtr screen;
56 } vncConsole, *vncConsolePtr;
58 #ifdef USE_ATTRIBUTE_BUFFER
59 vncConsolePtr vcGetConsole(int *argc,char **argv,
60 int width,int height,rfbFontDataPtr font,
61 rfbBool withAttributes);
62 #else
63 vncConsolePtr vcGetConsole(int argc,char **argv,
64 int width,int height,rfbFontDataPtr font);
65 #endif
66 void vcDrawCursor(vncConsolePtr c);
67 void vcHideCursor(vncConsolePtr c);
68 void vcCheckCoordinates(vncConsolePtr c);
70 void vcPutChar(vncConsolePtr c,unsigned char ch);
71 void vcPrint(vncConsolePtr c,unsigned char* str);
72 void vcPrintF(vncConsolePtr c,char* format,...);
74 void vcPutCharColour(vncConsolePtr c,unsigned char ch,
75 unsigned char foreColour,unsigned char backColour);
76 void vcPrintColour(vncConsolePtr c,unsigned char* str,
77 unsigned char foreColour,unsigned char backColour);
78 void vcPrintFColour(vncConsolePtr c,unsigned char foreColour,
79 unsigned char backColour,char* format,...);
81 char vcGetCh(vncConsolePtr c);
82 char vcGetChar(vncConsolePtr c); /* blocking */
83 char *vcGetString(vncConsolePtr c,char *buffer,int maxLen);
85 void vcKbdAddEventProc(rfbBool down,rfbKeySym keySym,rfbClientPtr cl);
86 void vcPtrAddEventProc(int buttonMask,int x,int y,rfbClientPtr cl);
87 void vcSetXCutTextProc(char* str,int len, struct _rfbClientRec* cl);
89 void vcToggleMarkCell(vncConsolePtr c,int pos);
90 void vcUnmark(vncConsolePtr c);
92 void vcProcessEvents(vncConsolePtr c);
94 /* before using this function, hide the cursor */
95 void vcScroll(vncConsolePtr c,int lineCount);