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
7602f0e7
Commit
7602f0e7
authored
Apr 28, 2006
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvncclient: support changing of framebuffer size; make SDLvncviewer use it
parent
9b51d63d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
15 deletions
+30
-15
SDLvncviewer.c
client_examples/SDLvncviewer.c
+1
-0
rfbproto.c
libvncclient/rfbproto.c
+27
-15
rfbclient.h
rfb/rfbclient.h
+2
-0
No files found.
client_examples/SDLvncviewer.c
View file @
7602f0e7
...
@@ -209,6 +209,7 @@ int main(int argc,char** argv) {
...
@@ -209,6 +209,7 @@ int main(int argc,char** argv) {
/* 16-bit: cl=rfbGetClient(5,3,2); */
/* 16-bit: cl=rfbGetClient(5,3,2); */
cl
=
rfbGetClient
(
8
,
3
,
4
);
cl
=
rfbGetClient
(
8
,
3
,
4
);
cl
->
MallocFrameBuffer
=
resize
;
cl
->
MallocFrameBuffer
=
resize
;
cl
->
canHandleNewFBSize
=
TRUE
;
cl
->
GotFrameBufferUpdate
=
update
;
cl
->
GotFrameBufferUpdate
=
update
;
cl
->
HandleKeyboardLedState
=
kbd_leds
;
cl
->
HandleKeyboardLedState
=
kbd_leds
;
...
...
libvncclient/rfbproto.c
View file @
7602f0e7
...
@@ -138,14 +138,14 @@ static void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_
...
@@ -138,14 +138,14 @@ static void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_
}
}
static
void
CopyRectangle
(
rfbClient
*
client
,
uint8_t
*
buffer
,
int
x
,
int
y
,
int
w
,
int
h
)
{
static
void
CopyRectangle
(
rfbClient
*
client
,
uint8_t
*
buffer
,
int
x
,
int
y
,
int
w
,
int
h
)
{
int
i
,
j
;
int
j
;
#define COPY_RECT(BPP) \
#define COPY_RECT(BPP) \
{ \
{ \
uint##BPP##_t* _buffer=(uint##BPP##_t*)buffer
; \
int rs = w * BPP / 8, rs2 = client->width * BPP / 8
; \
for
(j=y*client->width;j<(y+h)*client->width;j+=client->width
) { \
for
(j = x + y * rs2; j < (y + h) * rs2; j += rs2
) { \
for(i=x;i<x+w;i++,_buffer++)
\
memcpy(client->frameBuffer + j, buffer, rs);
\
((uint##BPP##_t*)client->frameBuffer)[j+i]=*_buffer
; \
buffer += rs
; \
} \
} \
}
}
...
@@ -592,14 +592,17 @@ SetFormatAndEncodings(rfbClient* client)
...
@@ -592,14 +592,17 @@ SetFormatAndEncodings(rfbClient* client)
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingPointerPos
);
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingPointerPos
);
}
}
/* Keyboard State Encodings */
if
(
se
->
nEncodings
<
MAX_ENCODINGS
)
if
(
se
->
nEncodings
<
MAX_ENCODINGS
)
{
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingLastRect
);
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingKeyboardLedState
);
}
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingLastRect
);
}
}
/* Keyboard State Encodings */
if
(
se
->
nEncodings
<
MAX_ENCODINGS
)
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingKeyboardLedState
);
if
(
se
->
nEncodings
<
MAX_ENCODINGS
&&
client
->
canHandleNewFBSize
)
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingNewFBSize
);
for
(
e
=
rfbClientExtensions
;
e
;
e
=
e
->
next
)
for
(
e
=
rfbClientExtensions
;
e
;
e
=
e
->
next
)
if
(
e
->
encodings
)
{
if
(
e
->
encodings
)
{
int
*
enc
;
int
*
enc
;
...
@@ -624,8 +627,8 @@ SetFormatAndEncodings(rfbClient* client)
...
@@ -624,8 +627,8 @@ SetFormatAndEncodings(rfbClient* client)
rfbBool
rfbBool
SendIncrementalFramebufferUpdateRequest
(
rfbClient
*
client
)
SendIncrementalFramebufferUpdateRequest
(
rfbClient
*
client
)
{
{
return
SendFramebufferUpdateRequest
(
client
,
0
,
0
,
client
->
si
.
framebufferW
idth
,
return
SendFramebufferUpdateRequest
(
client
,
0
,
0
,
client
->
w
idth
,
client
->
si
.
framebufferH
eight
,
TRUE
);
client
->
h
eight
,
TRUE
);
}
}
...
@@ -807,8 +810,17 @@ HandleRFBServerMessage(rfbClient* client)
...
@@ -807,8 +810,17 @@ HandleRFBServerMessage(rfbClient* client)
continue
;
continue
;
}
}
if
((
rect
.
r
.
x
+
rect
.
r
.
w
>
client
->
si
.
framebufferWidth
)
||
if
(
rect
.
encoding
==
rfbEncodingNewFBSize
)
{
(
rect
.
r
.
y
+
rect
.
r
.
h
>
client
->
si
.
framebufferHeight
))
client
->
width
=
rect
.
r
.
w
;
client
->
height
=
rect
.
r
.
h
;
client
->
MallocFrameBuffer
(
client
);
SendFramebufferUpdateRequest
(
client
,
0
,
0
,
rect
.
r
.
w
,
rect
.
r
.
h
,
FALSE
);
rfbClientLog
(
"Got new framebuffer size: %dx%d
\n
"
,
rect
.
r
.
w
,
rect
.
r
.
h
);
continue
;
}
if
((
rect
.
r
.
x
+
rect
.
r
.
w
>
client
->
width
)
||
(
rect
.
r
.
y
+
rect
.
r
.
h
>
client
->
height
))
{
{
rfbClientLog
(
"Rect too large: %dx%d at (%d, %d)
\n
"
,
rfbClientLog
(
"Rect too large: %dx%d at (%d, %d)
\n
"
,
rect
.
r
.
w
,
rect
.
r
.
h
,
rect
.
r
.
x
,
rect
.
r
.
y
);
rect
.
r
.
w
,
rect
.
r
.
h
,
rect
.
r
.
x
,
rect
.
r
.
y
);
...
...
rfb/rfbclient.h
View file @
7602f0e7
...
@@ -201,6 +201,8 @@ typedef struct _rfbClient {
...
@@ -201,6 +201,8 @@ typedef struct _rfbClient {
int
KeyboardLedStateEnabled
;
int
KeyboardLedStateEnabled
;
int
CurrentKeyboardLedState
;
int
CurrentKeyboardLedState
;
int
canHandleNewFBSize
;
/* hooks */
/* hooks */
HandleKeyboardLedStateProc
HandleKeyboardLedState
;
HandleKeyboardLedStateProc
HandleKeyboardLedState
;
HandleCursorPosProc
HandleCursorPos
;
HandleCursorPosProc
HandleCursorPos
;
...
...
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