3 /* this is now the default */
4 #define USE_ATTRIBUTE_BUFFER
6 typedef struct vncConsole
{
7 /* width and height in cells (=characters) */
10 /* current position */
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
;
22 /* if this is set, the screen doesn't scroll. */
23 rfbBool wrapBottomToTop
;
25 /* height and width of one character */
27 /* offset of characters */
31 unsigned char foreColour
,backColour
;
32 int8_t cx1
,cy1
,cx2
,cy2
;
39 rfbBool doEcho
; /* if reading input, do output directly? */
45 rfbBool wasRightButtonDown
;
46 rfbBool currentlyMarking
;
47 int markStart
,markEnd
;
49 /* should text cursor be drawn? (an underscore at current position) */
51 rfbBool cursorIsDrawn
;
52 rfbBool dontDrawCursor
; /* for example, while scrolling */
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
);
63 vncConsolePtr
vcGetConsole(int argc
,char **argv
,
64 int width
,int height
,rfbFontDataPtr font
);
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
);