Commit c30ded8d authored by dscho's avatar dscho

exported rfbReverseByte

parent 0ea0b7f0
...@@ -134,9 +134,6 @@ rfbSendCursorShape(cl) ...@@ -134,9 +134,6 @@ rfbSendCursorShape(cl)
for (i = 0; i < pCursor->height; i++) { for (i = 0; i < pCursor->height; i++) {
for (j = 0; j < bitmapRowBytes; j++) { for (j = 0; j < bitmapRowBytes; j++) {
bitmapByte = bitmapData[i * bitmapRowBytes + j]; bitmapByte = bitmapData[i * bitmapRowBytes + j];
/*if (screenInfo.bitmapBitOrder == LSBFirst) {
bitmapByte = _reverse_byte[bitmapByte];
}*/
cl->updateBuf[cl->ublen++] = (char)bitmapByte; cl->updateBuf[cl->ublen++] = (char)bitmapByte;
} }
} }
...@@ -160,9 +157,6 @@ rfbSendCursorShape(cl) ...@@ -160,9 +157,6 @@ rfbSendCursorShape(cl)
for (i = 0; i < pCursor->height; i++) { for (i = 0; i < pCursor->height; i++) {
for (j = 0; j < bitmapRowBytes; j++) { for (j = 0; j < bitmapRowBytes; j++) {
bitmapByte = bitmapData[i * bitmapRowBytes + j]; bitmapByte = bitmapData[i * bitmapRowBytes + j];
/*if (screenInfo.bitmapBitOrder == LSBFirst) {
bitmapByte = _reverse_byte[bitmapByte];
}*/
cl->updateBuf[cl->ublen++] = (char)bitmapByte; cl->updateBuf[cl->ublen++] = (char)bitmapByte;
} }
} }
...@@ -179,7 +173,7 @@ rfbSendCursorShape(cl) ...@@ -179,7 +173,7 @@ rfbSendCursorShape(cl)
} }
/* conversion routine for predefined cursors in LSB order */ /* conversion routine for predefined cursors in LSB order */
static unsigned char _reverse_byte[0x100] = { unsigned char rfbReverseByte[0x100] = {
/* copied from Xvnc/lib/font/util/utilbitmap.c */ /* copied from Xvnc/lib/font/util/utilbitmap.c */
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
...@@ -219,7 +213,7 @@ void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap) ...@@ -219,7 +213,7 @@ void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap)
{ {
int i,t=(width+7)/8*height; int i,t=(width+7)/8*height;
for(i=0;i<t;i++) for(i=0;i<t;i++)
bitmap[i]=_reverse_byte[(int)bitmap[i]]; bitmap[i]=rfbReverseByte[(int)bitmap[i]];
} }
/* Cursor creation. You "paint" a cursor and let these routines do the work */ /* Cursor creation. You "paint" a cursor and let these routines do the work */
...@@ -350,12 +344,12 @@ void rfbUndrawCursor(rfbClientPtr cl) ...@@ -350,12 +344,12 @@ void rfbUndrawCursor(rfbClientPtr cl)
x2=x1+c->width; x2=x1+c->width;
if(x1<0) x1=0; if(x1<0) x1=0;
if(x2>=s->width) x2=s->width-1; if(x2>=s->width) x2=s->width-1;
x2-=x1; x2-=x1; if(x2<=0) return;
y1=s->cursorY-c->yhot; y1=s->cursorY-c->yhot;
y2=y1+c->height; y2=y1+c->height;
if(y1<0) y1=0; if(y1<0) y1=0;
if(y2>=s->height) y2=s->height-1; if(y2>=s->height) y2=s->height-1;
y2-=y1; y2-=y1; if(y2<=0) return;
for(j=0;j<y2;j++) for(j=0;j<y2;j++)
memcpy(s->frameBuffer+(y1+j)*rowstride+x1*bpp, memcpy(s->frameBuffer+(y1+j)*rowstride+x1*bpp,
s->underCursorBuffer+j*x2*bpp, s->underCursorBuffer+j*x2*bpp,
......
...@@ -605,6 +605,7 @@ typedef struct rfbCursor { ...@@ -605,6 +605,7 @@ typedef struct rfbCursor {
} rfbCursor, *rfbCursorPtr; } rfbCursor, *rfbCursorPtr;
extern Bool rfbSendCursorShape(rfbClientPtr cl/*, rfbScreenInfoPtr pScreen*/); extern Bool rfbSendCursorShape(rfbClientPtr cl/*, rfbScreenInfoPtr pScreen*/);
extern unsigned char rfbReverseByte[0x100];
extern void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap); extern void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap);
extern rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskString); extern rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskString);
extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString); extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString);
...@@ -614,6 +615,9 @@ extern void rfbFreeCursor(rfbCursorPtr cursor); ...@@ -614,6 +615,9 @@ extern void rfbFreeCursor(rfbCursorPtr cursor);
extern void rfbDrawCursor(rfbClientPtr cl); extern void rfbDrawCursor(rfbClientPtr cl);
extern void rfbUndrawCursor(rfbClientPtr cl); extern void rfbUndrawCursor(rfbClientPtr cl);
/* cursor handling for the pointer */
extern void defaultPtrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl);
/* stats.c */ /* stats.c */
extern void rfbResetStats(rfbClientPtr cl); extern void rfbResetStats(rfbClientPtr cl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment