Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
fa85c12a
Commit
fa85c12a
authored
Sep 24, 2001
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cursor changes
parent
1e83d9a5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
17 deletions
+49
-17
cursor.c
cursor.c
+8
-0
example.c
example.c
+8
-0
main.c
main.c
+13
-4
rfb.h
rfb.h
+2
-0
rfbserver.c
rfbserver.c
+18
-13
No files found.
cursor.c
View file @
fa85c12a
...
@@ -495,6 +495,7 @@ void rfbUndrawCursor(rfbClientPtr cl)
...
@@ -495,6 +495,7 @@ void rfbUndrawCursor(rfbClientPtr cl)
rfbCursorPtr
c
=
s
->
cursor
;
rfbCursorPtr
c
=
s
->
cursor
;
int
j
,
x1
,
x2
,
y1
,
y2
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
int
j
,
x1
,
x2
,
y1
,
y2
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
rowstride
=
s
->
paddedWidthInBytes
;
rowstride
=
s
->
paddedWidthInBytes
;
return
;
if
(
!
s
->
cursorIsDrawn
)
if
(
!
s
->
cursorIsDrawn
)
return
;
return
;
/* restore what is under the cursor */
/* restore what is under the cursor */
...
@@ -512,6 +513,9 @@ void rfbUndrawCursor(rfbClientPtr cl)
...
@@ -512,6 +513,9 @@ void rfbUndrawCursor(rfbClientPtr cl)
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
,
x2
*
bpp
);
x2
*
bpp
);
rfbMarkRectAsModified
(
s
,
x1
,
y1
,
x1
+
x2
,
y1
+
y2
);
s
->
cursorIsDrawn
=
FALSE
;
}
}
void
rfbDrawCursor
(
rfbClientPtr
cl
)
void
rfbDrawCursor
(
rfbClientPtr
cl
)
...
@@ -521,6 +525,7 @@ void rfbDrawCursor(rfbClientPtr cl)
...
@@ -521,6 +525,7 @@ void rfbDrawCursor(rfbClientPtr cl)
int
i
,
j
,
x1
,
x2
,
y1
,
y2
,
i1
,
j1
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
int
i
,
j
,
x1
,
x2
,
y1
,
y2
,
i1
,
j1
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
rowstride
=
s
->
paddedWidthInBytes
,
rowstride
=
s
->
paddedWidthInBytes
,
bufSize
=
c
->
width
*
c
->
height
*
bpp
,
w
=
(
c
->
width
+
7
)
/
8
;
bufSize
=
c
->
width
*
c
->
height
*
bpp
,
w
=
(
c
->
width
+
7
)
/
8
;
return
;
if
(
s
->
cursorIsDrawn
)
if
(
s
->
cursorIsDrawn
)
rfbUndrawCursor
(
cl
);
rfbUndrawCursor
(
cl
);
if
(
s
->
underCursorBufferLen
<
bufSize
)
{
if
(
s
->
underCursorBufferLen
<
bufSize
)
{
...
@@ -555,6 +560,9 @@ void rfbDrawCursor(rfbClientPtr cl)
...
@@ -555,6 +560,9 @@ void rfbDrawCursor(rfbClientPtr cl)
if
((
c
->
mask
[(
j
+
j1
)
*
w
+
(
i
+
i1
)
/
8
]
<<
((
i
+
i1
)
&
7
))
&
0x80
)
if
((
c
->
mask
[(
j
+
j1
)
*
w
+
(
i
+
i1
)
/
8
]
<<
((
i
+
i1
)
&
7
))
&
0x80
)
memcpy
(
s
->
frameBuffer
+
(
j
+
y1
)
*
rowstride
+
(
i
+
x1
)
*
bpp
,
memcpy
(
s
->
frameBuffer
+
(
j
+
y1
)
*
rowstride
+
(
i
+
x1
)
*
bpp
,
c
->
richSource
+
(
j
+
j1
)
*
c
->
width
*
bpp
+
(
i
+
i1
)
*
bpp
,
bpp
);
c
->
richSource
+
(
j
+
j1
)
*
c
->
width
*
bpp
+
(
i
+
i1
)
*
bpp
,
bpp
);
rfbMarkRectAsModified
(
s
,
x1
,
y1
,
x1
+
x2
,
y1
+
y2
);
s
->
cursorIsDrawn
=
TRUE
;
}
}
void
rfbPrintXCursor
(
rfbCursorPtr
cursor
)
void
rfbPrintXCursor
(
rfbCursorPtr
cursor
)
...
...
example.c
View file @
fa85c12a
...
@@ -94,6 +94,10 @@ void drawline(unsigned char* buffer,int rowstride,int bpp,int x1,int y1,int x2,i
...
@@ -94,6 +94,10 @@ void drawline(unsigned char* buffer,int rowstride,int bpp,int x1,int y1,int x2,i
void
doptr
(
int
buttonMask
,
int
x
,
int
y
,
rfbClientPtr
cl
)
void
doptr
(
int
buttonMask
,
int
x
,
int
y
,
rfbClientPtr
cl
)
{
{
ClientData
*
cd
=
cl
->
clientData
;
ClientData
*
cd
=
cl
->
clientData
;
//if(cl->screen->cursorIsDrawn)
//rfbUndrawCursor(cl);
//cl->screen->cursorX=x;
//cl->screen->cursorY=y;
if
(
x
>=
0
&&
y
>=
0
&&
x
<
maxx
&&
y
<
maxy
)
{
if
(
x
>=
0
&&
y
>=
0
&&
x
<
maxx
&&
y
<
maxy
)
{
if
(
buttonMask
)
{
if
(
buttonMask
)
{
int
i
,
j
,
x1
,
x2
,
y1
,
y2
;
int
i
,
j
,
x1
,
x2
,
y1
,
y2
;
...
@@ -189,11 +193,15 @@ void dokey(Bool down,KeySym key,rfbClientPtr cl)
...
@@ -189,11 +193,15 @@ void dokey(Bool down,KeySym key,rfbClientPtr cl)
if
(
key
==
XK_Escape
)
if
(
key
==
XK_Escape
)
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
else
if
(
key
==
XK_Page_Up
)
{
else
if
(
key
==
XK_Page_Up
)
{
//if(cl->screen->cursorIsDrawn)
//rfbUndrawCursor(cl);
initBuffer
(
cl
->
screen
->
frameBuffer
);
initBuffer
(
cl
->
screen
->
frameBuffer
);
rfbMarkRectAsModified
(
cl
->
screen
,
0
,
0
,
maxx
,
maxy
);
rfbMarkRectAsModified
(
cl
->
screen
,
0
,
0
,
maxx
,
maxy
);
}
else
if
(
key
>=
' '
&&
key
<
0x100
)
{
}
else
if
(
key
>=
' '
&&
key
<
0x100
)
{
ClientData
*
cd
=
cl
->
clientData
;
ClientData
*
cd
=
cl
->
clientData
;
int
x1
=
cd
->
oldx
,
y1
=
cd
->
oldy
,
x2
,
y2
;
int
x1
=
cd
->
oldx
,
y1
=
cd
->
oldy
,
x2
,
y2
;
//if(cl->screen->cursorIsDrawn)
//rfbUndrawCursor(cl);
cd
->
oldx
+=
drawchar
(
cl
->
screen
->
frameBuffer
,
cd
->
oldx
+=
drawchar
(
cl
->
screen
->
frameBuffer
,
cl
->
screen
->
paddedWidthInBytes
,
bpp
,
cd
->
oldx
,
cd
->
oldy
,
cl
->
screen
->
paddedWidthInBytes
,
bpp
,
cd
->
oldx
,
cd
->
oldy
,
key
);
key
);
...
...
main.c
View file @
fa85c12a
...
@@ -90,8 +90,8 @@ void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,RegionPtr modRegion)
...
@@ -90,8 +90,8 @@ void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,RegionPtr modRegion)
void
rfbMarkRectAsModified
(
rfbScreenInfoPtr
rfbScreen
,
int
x1
,
int
y1
,
int
x2
,
int
y2
)
void
rfbMarkRectAsModified
(
rfbScreenInfoPtr
rfbScreen
,
int
x1
,
int
y1
,
int
x2
,
int
y2
)
{
{
BoxRec
box
;
BoxRec
box
;
//=(BoxRec*)malloc(sizeof(BoxRec));
RegionRec
region
;
RegionRec
*
region
=
(
RegionRec
*
)
malloc
(
sizeof
(
RegionRec
))
;
int
i
;
int
i
;
if
(
x1
>
x2
)
{
i
=
x1
;
x1
=
x2
;
x2
=
i
;
}
if
(
x1
>
x2
)
{
i
=
x1
;
x1
=
x2
;
x2
=
i
;
}
x2
++
;
x2
++
;
...
@@ -104,8 +104,8 @@ void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y
...
@@ -104,8 +104,8 @@ void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y
if
(
y2
>=
rfbScreen
->
height
)
{
y2
=
rfbScreen
->
height
-
1
;
if
(
y1
==
y2
)
y1
--
;
}
if
(
y2
>=
rfbScreen
->
height
)
{
y2
=
rfbScreen
->
height
-
1
;
if
(
y1
==
y2
)
y1
--
;
}
box
.
x1
=
x1
;
box
.
y1
=
y1
;
box
.
x2
=
x2
;
box
.
y2
=
y2
;
box
.
x1
=
x1
;
box
.
y1
=
y1
;
box
.
x2
=
x2
;
box
.
y2
=
y2
;
REGION_INIT
(
cl
->
screen
,
&
region
,
&
box
,
0
);
REGION_INIT
(
cl
->
screen
,
region
,
&
box
,
0
);
rfbMarkRegionAsModified
(
rfbScreen
,
&
region
);
rfbMarkRegionAsModified
(
rfbScreen
,
region
);
}
}
int
rfbDeferUpdateTime
=
40
;
/* ms */
int
rfbDeferUpdateTime
=
40
;
/* ms */
...
@@ -298,6 +298,15 @@ defaultKbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl)
...
@@ -298,6 +298,15 @@ defaultKbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl)
void
void
defaultPtrAddEvent
(
int
buttonMask
,
int
x
,
int
y
,
rfbClientPtr
cl
)
defaultPtrAddEvent
(
int
buttonMask
,
int
x
,
int
y
,
rfbClientPtr
cl
)
{
{
if
(
x
!=
cl
->
screen
->
cursorX
||
y
!=
cl
->
screen
->
cursorY
)
{
Bool
cursorWasDrawn
=
cl
->
screen
->
cursorIsDrawn
;
if
(
cursorWasDrawn
)
rfbUndrawCursor
(
cl
);
cl
->
screen
->
cursorX
=
x
;
cl
->
screen
->
cursorY
=
y
;
if
(
cursorWasDrawn
)
rfbDrawCursor
(
cl
);
}
}
}
void
defaultSetXCutText
(
char
*
text
,
int
len
,
rfbClientPtr
cl
)
void
defaultSetXCutText
(
char
*
text
,
int
len
,
rfbClientPtr
cl
)
...
...
rfb.h
View file @
fa85c12a
...
@@ -539,6 +539,8 @@ extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString);
...
@@ -539,6 +539,8 @@ extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString);
extern
void
MakeXCursorFromRichCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
MakeXCursorFromRichCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
MakeRichCursorFromXCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
MakeRichCursorFromXCursor
(
rfbScreenInfoPtr
rfbScreen
,
rfbCursorPtr
cursor
);
extern
void
rfbFreeCursor
(
rfbCursorPtr
cursor
);
extern
void
rfbFreeCursor
(
rfbCursorPtr
cursor
);
extern
void
rfbDrawCursor
(
rfbClientPtr
cl
);
extern
void
rfbUndrawCursor
(
rfbClientPtr
cl
);
/* stats.c */
/* stats.c */
...
...
rfbserver.c
View file @
fa85c12a
...
@@ -834,15 +834,18 @@ rfbSendFramebufferUpdate(cl, updateRegion)
...
@@ -834,15 +834,18 @@ rfbSendFramebufferUpdate(cl, updateRegion)
* removed from the framebuffer. Otherwise, make sure it's put up.
* removed from the framebuffer. Otherwise, make sure it's put up.
*/
*/
if
(
cl
->
enableCursorShapeUpdates
)
{
cursorWasDrawn
=
cl
->
screen
->
cursorIsDrawn
;
cursorWasDrawn
=
cl
->
screen
->
cursorIsDrawn
;
if
(
cl
->
enableCursorShapeUpdates
)
{
if
(
cl
->
screen
->
cursorIsDrawn
)
{
if
(
cl
->
screen
->
cursorIsDrawn
)
{
fprintf
(
stderr
,
"rfbSpriteRemoveCursor(pScreen); not yet!
\n
"
);
rfbUndrawCursor
(
cl
);
//fprintf(stderr,"rfbSpriteRemoveCursor(pScreen); not yet!\n");
}
}
if
(
!
cl
->
screen
->
cursorIsDrawn
&&
cl
->
cursorWasChanged
)
if
(
!
cl
->
screen
->
cursorIsDrawn
&&
cl
->
cursorWasChanged
)
sendCursorShape
=
TRUE
;
sendCursorShape
=
TRUE
;
}
else
{
}
else
{
if
(
!
cl
->
screen
->
cursorIsDrawn
)
if
(
!
cl
->
screen
->
cursorIsDrawn
)
//rfbDrawCursor(cl);
fprintf
(
stderr
,
"rfbSpriteRestoreCursor(pScreen); not yet!
\n
"
);
fprintf
(
stderr
,
"rfbSpriteRestoreCursor(pScreen); not yet!
\n
"
);
}
}
...
@@ -1046,9 +1049,11 @@ rfbSendFramebufferUpdate(cl, updateRegion)
...
@@ -1046,9 +1049,11 @@ rfbSendFramebufferUpdate(cl, updateRegion)
if
(
cursorWasDrawn
!=
cl
->
screen
->
cursorIsDrawn
)
{
if
(
cursorWasDrawn
!=
cl
->
screen
->
cursorIsDrawn
)
{
if
(
cursorWasDrawn
)
if
(
cursorWasDrawn
)
fprintf
(
stderr
,
"rfbSpriteRestoreCursor(pScreen); not yet!!
\n
"
);
rfbDrawCursor
(
cl
);
//fprintf(stderr,"rfbSpriteRestoreCursor(pScreen); not yet!!\n");
else
else
fprintf
(
stderr
,
"rfbSpriteRemoveCursor(pScreen); not yet!!
\n
"
);
rfbUndrawCursor
(
cl
);
//fprintf(stderr,"rfbSpriteRemoveCursor(pScreen); not yet!!\n");
}
}
return
TRUE
;
return
TRUE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment