summaryrefslogtreecommitdiffstats
path: root/krfb/libvncserver/cursor.c
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
commit69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch)
tree073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /krfb/libvncserver/cursor.c
parent3467e6464beac3a162839bf7078e22e3a74d73e7 (diff)
downloadtdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz
tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krfb/libvncserver/cursor.c')
-rw-r--r--krfb/libvncserver/cursor.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/krfb/libvncserver/cursor.c b/krfb/libvncserver/cursor.c
index a27a2fef..d943dc37 100644
--- a/krfb/libvncserver/cursor.c
+++ b/krfb/libvncserver/cursor.c
@@ -1,5 +1,5 @@
/*
- * cursor.c - support for cursor shape updates.
+ * cursor.c - support for cursor tqshape updates.
*/
/*
@@ -25,18 +25,18 @@
#include "rfb.h"
/*
- * Send cursor shape either in X-style format or in client pixel format.
+ * Send cursor tqshape either in X-style format or in client pixel format.
*/
Bool
-rfbSendCursorShape(cl)
+rfbSendtqCursorShape(cl)
rfbClientPtr cl;
{
rfbCursorPtr pCursor;
rfbFramebufferUpdateRectHeader rect;
rfbXCursorColors colors;
int saved_ublen;
- int bitmapRowBytes, maskBytes, dataBytes;
+ int bitmapRowBytes, tqmaskBytes, dataBytes;
int i, j;
CARD8 *bitmapData;
CARD8 bitmapByte;
@@ -58,7 +58,7 @@ rfbSendCursorShape(cl)
if ( pCursor && pCursor->width == 1 &&
pCursor->height == 1 &&
- pCursor->mask[0] == 0 ) {
+ pCursor->tqmask[0] == 0 ) {
pCursor = NULL;
}
@@ -85,21 +85,21 @@ rfbSendCursorShape(cl)
/* Calculate data sizes. */
bitmapRowBytes = (pCursor->width + 7) / 8;
- maskBytes = bitmapRowBytes * pCursor->height;
+ tqmaskBytes = bitmapRowBytes * pCursor->height;
dataBytes = (cl->useRichCursorEncoding) ?
(pCursor->width * pCursor->height *
- (cl->format.bitsPerPixel / 8)) : maskBytes;
+ (cl->format.bitsPerPixel / 8)) : tqmaskBytes;
/* Send buffer contents if needed. */
if ( cl->ublen + sz_rfbFramebufferUpdateRectHeader +
- sz_rfbXCursorColors + maskBytes + dataBytes > UPDATE_BUF_SIZE ) {
+ sz_rfbXCursorColors + tqmaskBytes + dataBytes > UPDATE_BUF_SIZE ) {
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
if ( cl->ublen + sz_rfbFramebufferUpdateRectHeader +
- sz_rfbXCursorColors + maskBytes + dataBytes > UPDATE_BUF_SIZE ) {
+ sz_rfbXCursorColors + tqmaskBytes + dataBytes > UPDATE_BUF_SIZE ) {
return FALSE; /* FIXME. */
}
@@ -150,9 +150,9 @@ rfbSendCursorShape(cl)
cl->ublen += pCursor->width*bpp2*pCursor->height;
}
- /* Prepare transparency mask. */
+ /* Prepare transparency tqmask. */
- bitmapData = (CARD8 *)pCursor->mask;
+ bitmapData = (CARD8 *)pCursor->tqmask;
for (i = 0; i < pCursor->height; i++) {
for (j = 0; j < bitmapRowBytes; j++) {
@@ -199,7 +199,7 @@ rfbSendSoftCursor(rfbClientPtr cl, Bool cursorWasChanged)
if ( pCursor && pCursor->width <= 1 &&
pCursor->height <= 1 &&
- pCursor->mask[0] == 0 ) {
+ pCursor->tqmask[0] == 0 ) {
pCursor = NULL;
}
@@ -347,7 +347,7 @@ void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap)
/* Cursor creation. You "paint" a cursor and let these routines do the work */
-rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskString)
+rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* tqmaskString)
{
int i,j,w=(width+7)/8;
rfbCursorPtr cursor = (rfbCursorPtr)calloc(1,sizeof(rfbCursor));
@@ -364,13 +364,13 @@ rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskSt
for(i=0,bit=0x80;i<width;i++,bit=(bit&1)?0x80:bit>>1,cp++)
if(*cp!=' ') cursor->source[j*w+i/8]|=bit;
- if(maskString) {
- cursor->mask = (unsigned char*)calloc(w,height);
- for(j=0,cp=maskString;j<height;j++)
+ if(tqmaskString) {
+ cursor->tqmask = (unsigned char*)calloc(w,height);
+ for(j=0,cp=tqmaskString;j<height;j++)
for(i=0,bit=0x80;i<width;i++,bit=(bit&1)?0x80:bit>>1,cp++)
- if(*cp!=' ') cursor->mask[j*w+i/8]|=bit;
+ if(*cp!=' ') cursor->tqmask[j*w+i/8]|=bit;
} else
- cursor->mask = (unsigned char*)rfbMakeMaskForXCursor(width,height,cursor->source);
+ cursor->tqmask = (unsigned char*)rfbMakeMaskForXCursor(width,height,cursor->source);
return(cursor);
}
@@ -378,7 +378,7 @@ rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskSt
char* rfbMakeMaskForXCursor(int width,int height,char* source)
{
int i,j,w=(width+7)/8;
- char* mask=(char*)calloc(w,height);
+ char* tqmask=(char*)calloc(w,height);
unsigned char c;
for(j=0;j<height;j++)
@@ -388,14 +388,14 @@ char* rfbMakeMaskForXCursor(int width,int height,char* source)
if(j<height-1) c|=source[(j+1)*w+i];
if(i>0 && (c&0x80))
- mask[j*w+i-1]|=0x01;
+ tqmask[j*w+i-1]|=0x01;
if(i<w-1 && (c&0x01))
- mask[j*w+i+1]|=0x80;
+ tqmask[j*w+i+1]|=0x80;
- mask[j*w+i]|=(c<<1)|c|(c>>1);
+ tqmask[j*w+i]|=(c<<1)|c|(c>>1);
}
- return(mask);
+ return(tqmask);
}
void rfbFreeCursor(rfbCursorPtr cursor)
@@ -404,7 +404,7 @@ void rfbFreeCursor(rfbCursorPtr cursor)
if(cursor->richSource)
free(cursor->richSource);
free(cursor->source);
- free(cursor->mask);
+ free(cursor->tqmask);
free(cursor);
}
@@ -497,7 +497,7 @@ void MakeSoftCursor(rfbClientPtr cl, rfbCursorPtr cursor)
for(j=0;j<cursor->height;j++)
for(i=0,bit=0x80;i<cursor->width;i++,bit=(bit&1)?0x80:bit>>1)
- if(cursor->mask[j*w+i/8]&bit) {
+ if(cursor->tqmask[j*w+i/8]&bit) {
if (state) {
memcpy(cp,sp,bpp);
cp += bpp;
@@ -634,7 +634,7 @@ void rfbDrawCursor(rfbScreenInfoPtr s)
/* now the cursor has to be drawn */
for(j=0;j<y2;j++)
for(i=0;i<x2;i++)
- if((c->mask[(j+j1)*w+(i+i1)/8]<<((i+i1)&7))&0x80)
+ if((c->tqmask[(j+j1)*w+(i+i1)/8]<<((i+i1)&7))&0x80)
memcpy(s->frameBuffer+(j+y1)*rowstride+(i+x1)*bpp,
c->richSource+(j+j1)*c->width*bpp+(i+i1)*bpp,bpp);
@@ -655,7 +655,7 @@ void rfbPrintXCursor(rfbCursorPtr cursor)
if(cursor->source[j*w+i]&bit) putchar('#'); else putchar(' ');
putchar(':');
for(i=0,i1=0,bit=0x80;i1<cursor->width;i1++,i+=(bit&1)?1:0,bit=(bit&1)?0x80:bit>>1)
- if(cursor->mask[j*w+i]&bit) putchar('#'); else putchar(' ');
+ if(cursor->tqmask[j*w+i]&bit) putchar('#'); else putchar(' ');
putchar('\n');
}
}