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
5865f0c4
Commit
5865f0c4
authored
May 04, 2006
by
steven_carr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client side support for PalmVNC/UltraVNC 'Server Side Scaling'
parent
97fe75fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
4 deletions
+71
-4
rfbproto.c
libvncclient/rfbproto.c
+48
-1
vncviewer.c
libvncclient/vncviewer.c
+20
-3
rfbclient.h
rfb/rfbclient.h
+3
-0
No files found.
libvncclient/rfbproto.c
View file @
5865f0c4
...
@@ -669,6 +669,27 @@ SendFramebufferUpdateRequest(rfbClient* client, int x, int y, int w, int h, rfbB
...
@@ -669,6 +669,27 @@ SendFramebufferUpdateRequest(rfbClient* client, int x, int y, int w, int h, rfbB
}
}
/*
* SendScaleSetting.
*/
rfbBool
SendScaleSetting
(
rfbClient
*
client
,
int
scaleSetting
)
{
rfbSetScaleMsg
ssm
;
if
(
client
->
appData
.
palmVNC
)
ssm
.
type
=
rfbPalmVNCSetScaleFactor
;
else
ssm
.
type
=
rfbSetScale
;
ssm
.
scale
=
scaleSetting
;
ssm
.
pad
=
0
;
if
(
!
WriteToRFBServer
(
client
,
(
char
*
)
&
ssm
,
sz_rfbSetScaleMsg
))
return
FALSE
;
return
TRUE
;
}
/*
/*
* SendPointerEvent.
* SendPointerEvent.
*/
*/
...
@@ -1132,6 +1153,32 @@ HandleRFBServerMessage(rfbClient* client)
...
@@ -1132,6 +1153,32 @@ HandleRFBServerMessage(rfbClient* client)
break
;
break
;
}
}
case
rfbResizeFrameBuffer
:
{
if
(
!
ReadFromRFBServer
(
client
,
((
char
*
)
&
msg
)
+
1
,
sz_rfbResizeFrameBufferMsg
-
1
))
return
FALSE
;
client
->
width
=
rfbClientSwap16IfLE
(
msg
.
rsfb
.
framebufferWidth
);
client
->
height
=
rfbClientSwap16IfLE
(
msg
.
rsfb
.
framebufferHeigth
);
client
->
MallocFrameBuffer
(
client
);
SendFramebufferUpdateRequest
(
client
,
0
,
0
,
client
->
width
,
client
->
height
,
FALSE
);
rfbClientLog
(
"Got new framebuffer size: %dx%d
\n
"
,
client
->
width
,
client
->
height
);
break
;
}
case
rfbPalmVNCReSizeFrameBuffer
:
{
if
(
!
ReadFromRFBServer
(
client
,
((
char
*
)
&
msg
)
+
1
,
sz_rfbPalmVNCReSizeFrameBufferMsg
-
1
))
return
FALSE
;
client
->
width
=
rfbClientSwap16IfLE
(
msg
.
prsfb
.
buffer_w
);
client
->
height
=
rfbClientSwap16IfLE
(
msg
.
prsfb
.
buffer_h
);
client
->
MallocFrameBuffer
(
client
);
SendFramebufferUpdateRequest
(
client
,
0
,
0
,
client
->
width
,
client
->
height
,
FALSE
);
rfbClientLog
(
"Got new framebuffer size: %dx%d
\n
"
,
client
->
width
,
client
->
height
);
break
;
}
default:
default:
{
{
rfbBool
handled
=
FALSE
;
rfbBool
handled
=
FALSE
;
...
@@ -1143,8 +1190,8 @@ HandleRFBServerMessage(rfbClient* client)
...
@@ -1143,8 +1190,8 @@ HandleRFBServerMessage(rfbClient* client)
if
(
!
handled
)
{
if
(
!
handled
)
{
char
buffer
[
256
];
char
buffer
[
256
];
ReadFromRFBServer
(
client
,
buffer
,
256
);
rfbClientLog
(
"Unknown message type %d from VNC server
\n
"
,
msg
.
type
);
rfbClientLog
(
"Unknown message type %d from VNC server
\n
"
,
msg
.
type
);
ReadFromRFBServer
(
client
,
buffer
,
256
);
return
FALSE
;
return
FALSE
;
}
}
}
}
...
...
libvncclient/vncviewer.c
View file @
5865f0c4
...
@@ -201,9 +201,23 @@ static rfbBool rfbInitConnection(rfbClient* client)
...
@@ -201,9 +201,23 @@ static rfbBool rfbInitConnection(rfbClient* client)
client
->
width
=
client
->
si
.
framebufferWidth
;
client
->
width
=
client
->
si
.
framebufferWidth
;
client
->
height
=
client
->
si
.
framebufferHeight
;
client
->
height
=
client
->
si
.
framebufferHeight
;
client
->
MallocFrameBuffer
(
client
);
client
->
MallocFrameBuffer
(
client
);
if
(
!
SendFramebufferUpdateRequest
(
client
,
0
,
0
,
client
->
width
,
client
->
height
,
FALSE
))
if
(
client
->
appData
.
scaleSetting
>
1
)
return
FALSE
;
{
if
(
!
SendScaleSetting
(
client
,
client
->
appData
.
scaleSetting
))
return
FALSE
;
if
(
!
SendFramebufferUpdateRequest
(
client
,
0
,
0
,
client
->
width
/
client
->
appData
.
scaleSetting
,
client
->
height
/
client
->
appData
.
scaleSetting
,
FALSE
))
return
FALSE
;
}
else
{
if
(
!
SendFramebufferUpdateRequest
(
client
,
0
,
0
,
client
->
width
,
client
->
height
,
FALSE
))
return
FALSE
;
}
return
TRUE
;
return
TRUE
;
}
}
...
@@ -232,6 +246,9 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
...
@@ -232,6 +246,9 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
}
else
if
(
i
+
1
<*
argc
&&
strcmp
(
argv
[
i
],
"-quality"
)
==
0
)
{
}
else
if
(
i
+
1
<*
argc
&&
strcmp
(
argv
[
i
],
"-quality"
)
==
0
)
{
client
->
appData
.
qualityLevel
=
atoi
(
argv
[
i
+
1
]);
client
->
appData
.
qualityLevel
=
atoi
(
argv
[
i
+
1
]);
j
+=
2
;
j
+=
2
;
}
else
if
(
i
+
1
<*
argc
&&
strcmp
(
argv
[
i
],
"-scale"
)
==
0
)
{
client
->
appData
.
scaleSetting
=
atoi
(
argv
[
i
+
1
]);
j
+=
2
;
}
else
{
}
else
{
char
*
colon
=
strchr
(
argv
[
i
],
':'
);
char
*
colon
=
strchr
(
argv
[
i
],
':'
);
...
...
rfb/rfbclient.h
View file @
5865f0c4
...
@@ -89,6 +89,8 @@ typedef struct {
...
@@ -89,6 +89,8 @@ typedef struct {
int
qualityLevel
;
int
qualityLevel
;
rfbBool
enableJPEG
;
rfbBool
enableJPEG
;
rfbBool
useRemoteCursor
;
rfbBool
useRemoteCursor
;
rfbBool
palmVNC
;
/* use palmvnc specific SetScale (vs ultravnc) */
int
scaleSetting
;
/* 0 means no scale set, else 1/scaleSetting */
}
AppData
;
}
AppData
;
...
@@ -239,6 +241,7 @@ extern rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient* client);
...
@@ -239,6 +241,7 @@ extern rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient* client);
extern
rfbBool
SendFramebufferUpdateRequest
(
rfbClient
*
client
,
extern
rfbBool
SendFramebufferUpdateRequest
(
rfbClient
*
client
,
int
x
,
int
y
,
int
w
,
int
h
,
int
x
,
int
y
,
int
w
,
int
h
,
rfbBool
incremental
);
rfbBool
incremental
);
extern
rfbBool
SendScaleSetting
(
rfbClient
*
client
,
int
scaleSetting
);
extern
rfbBool
SendPointerEvent
(
rfbClient
*
client
,
int
x
,
int
y
,
int
buttonMask
);
extern
rfbBool
SendPointerEvent
(
rfbClient
*
client
,
int
x
,
int
y
,
int
buttonMask
);
extern
rfbBool
SendKeyEvent
(
rfbClient
*
client
,
uint32_t
key
,
rfbBool
down
);
extern
rfbBool
SendKeyEvent
(
rfbClient
*
client
,
uint32_t
key
,
rfbBool
down
);
extern
rfbBool
SendClientCutText
(
rfbClient
*
client
,
char
*
str
,
int
len
);
extern
rfbBool
SendClientCutText
(
rfbClient
*
client
,
char
*
str
,
int
len
);
...
...
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