Home | History | Annotate | Download | only in vncterm
      1 #include <rfb/rfb.h>
      2 
      3 /* this is now the default */
      4 #define USE_ATTRIBUTE_BUFFER
      5 
      6 typedef struct vncConsole {
      7   /* width and height in cells (=characters) */
      8   int width, height;
      9 
     10   /* current position */
     11   int x,y;
     12 
     13   /* characters */
     14   char *screenBuffer;
     15 
     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
     21 
     22   /* if this is set, the screen doesn't scroll. */
     23   rfbBool wrapBottomToTop;
     24 
     25   /* height and width of one character */
     26   int cWidth, cHeight;
     27   /* offset of characters */
     28   int xhot,yhot;
     29 
     30   /* colour */
     31   unsigned char foreColour,backColour;
     32   int8_t cx1,cy1,cx2,cy2;
     33 
     34   /* input buffer */
     35   char *inputBuffer;
     36   int inputCount;
     37   int inputSize;
     38   long selectTimeOut;
     39   rfbBool doEcho; /* if reading input, do output directly? */
     40 
     41   /* selection */
     42   char *selection;
     43 
     44   /* mouse */
     45   rfbBool wasRightButtonDown;
     46   rfbBool currentlyMarking;
     47   int markStart,markEnd;
     48 
     49   /* should text cursor be drawn? (an underscore at current position) */
     50   rfbBool cursorActive;
     51   rfbBool cursorIsDrawn;
     52   rfbBool dontDrawCursor; /* for example, while scrolling */
     53 
     54   rfbFontDataPtr font;
     55   rfbScreenInfoPtr screen;
     56 } vncConsole, *vncConsolePtr;
     57 
     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);
     69 
     70 void vcPutChar(vncConsolePtr c,unsigned char ch);
     71 void vcPrint(vncConsolePtr c,unsigned char* str);
     72 void vcPrintF(vncConsolePtr c,char* format,...);
     73 
     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,...);
     80 
     81 char vcGetCh(vncConsolePtr c);
     82 char vcGetChar(vncConsolePtr c); /* blocking */
     83 char *vcGetString(vncConsolePtr c,char *buffer,int maxLen);
     84 
     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);
     88 
     89 void vcToggleMarkCell(vncConsolePtr c,int pos);
     90 void vcUnmark(vncConsolePtr c);
     91 
     92 void vcProcessEvents(vncConsolePtr c);
     93 
     94 /* before using this function, hide the cursor */
     95 void vcScroll(vncConsolePtr c,int lineCount);
     96