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
87c12192
Commit
87c12192
authored
Oct 07, 2001
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
font corrections, displayHook
parent
446f334c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
24 deletions
+45
-24
bdf2c.pl
bdf2c.pl
+1
-0
font.c
font.c
+12
-7
main.c
main.c
+19
-12
rfb.h
rfb.h
+9
-5
rfbserver.c
rfbserver.c
+4
-0
No files found.
bdf2c.pl
View file @
87c12192
...
@@ -16,6 +16,7 @@ $nullx="0x";
...
@@ -16,6 +16,7 @@ $nullx="0x";
while
(
<>
)
{
while
(
<>
)
{
if
(
/^FONT (.*)$/
)
{
if
(
/^FONT (.*)$/
)
{
$fontname
=
$1
;
$fontname
=
$1
;
$fontname
=~
y
/\"/
/
d
;
}
elsif
(
/^ENCODING (.*)$/
)
{
}
elsif
(
/^ENCODING (.*)$/
)
{
$glyphindex
=
$1
;
$glyphindex
=
$1
;
$searchfor
=
"BBX"
;
$searchfor
=
"BBX"
;
...
...
font.c
View file @
87c12192
#include "rfb.h"
#include "rfb.h"
int
rfbDrawChar
(
rfbScreenInfoPtr
rfbScreen
,
rfbFontDataPtr
font
,
int
rfbDrawChar
(
rfbScreenInfoPtr
rfbScreen
,
rfbFontDataPtr
font
,
int
x
,
int
y
,
char
c
,
CARD32
colour
)
int
x
,
int
y
,
unsigned
char
c
,
CARD32
colour
)
{
{
int
i
,
j
,
k
,
width
,
height
;
int
i
,
j
,
k
,
width
,
height
;
unsigned
char
d
;
unsigned
char
d
;
...
@@ -12,7 +12,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
...
@@ -12,7 +12,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
width
=
font
->
metaData
[
c
*
5
+
1
];
width
=
font
->
metaData
[
c
*
5
+
1
];
height
=
font
->
metaData
[
c
*
5
+
2
];
height
=
font
->
metaData
[
c
*
5
+
2
];
x
+=
font
->
metaData
[
c
*
5
+
3
];
x
+=
font
->
metaData
[
c
*
5
+
3
];
y
+=
font
->
metaData
[
c
*
5
+
4
]
-
height
+
1
;
y
+=
-
font
->
metaData
[
c
*
5
+
4
]
-
height
+
1
;
for
(
j
=
0
;
j
<
height
;
j
++
)
{
for
(
j
=
0
;
j
<
height
;
j
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
...
@@ -23,7 +23,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
...
@@ -23,7 +23,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
if
(
d
&
0x80
)
{
if
(
d
&
0x80
)
{
for
(
k
=
0
;
k
<
bpp
;
k
++
)
for
(
k
=
0
;
k
<
bpp
;
k
++
)
rfbScreen
->
frameBuffer
[(
y
+
j
)
*
rowstride
+
(
x
+
i
)
*
bpp
+
k
]
=
rfbScreen
->
frameBuffer
[(
y
+
j
)
*
rowstride
+
(
x
+
i
)
*
bpp
+
k
]
=
((
colour
>>
(
8
*
bpp
))
&
0xff
);
((
colour
>>
(
8
*
k
))
&
0xff
);
}
}
d
<<=
1
;
d
<<=
1
;
}
}
...
@@ -34,7 +34,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
...
@@ -34,7 +34,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
}
}
void
rfbDrawString
(
rfbScreenInfoPtr
rfbScreen
,
rfbFontDataPtr
font
,
void
rfbDrawString
(
rfbScreenInfoPtr
rfbScreen
,
rfbFontDataPtr
font
,
int
x
,
int
y
,
char
*
string
,
CARD32
colour
)
int
x
,
int
y
,
unsigned
char
*
string
,
CARD32
colour
)
{
{
while
(
*
string
)
{
while
(
*
string
)
{
x
+=
rfbDrawChar
(
rfbScreen
,
font
,
x
,
y
,
*
string
,
colour
);
x
+=
rfbDrawChar
(
rfbScreen
,
font
,
x
,
y
,
*
string
,
colour
);
...
@@ -42,7 +42,7 @@ void rfbDrawString(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
...
@@ -42,7 +42,7 @@ void rfbDrawString(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
}
}
}
}
int
rfbWidth
(
rfbFontDataPtr
font
,
char
*
string
)
int
rfbWidth
(
rfbFontDataPtr
font
,
unsigned
char
*
string
)
{
{
int
i
=
0
;
int
i
=
0
;
while
(
*
string
)
{
while
(
*
string
)
{
...
@@ -52,10 +52,15 @@ int rfbWidth(rfbFontDataPtr font,char* string)
...
@@ -52,10 +52,15 @@ int rfbWidth(rfbFontDataPtr font,char* string)
return
(
i
);
return
(
i
);
}
}
void
rfbFontBBox
(
rfbFontDataPtr
font
,
char
c
,
int
*
x1
,
int
*
y1
,
int
*
x2
,
int
*
y2
)
int
rfbWidthOfChar
(
rfbFontDataPtr
font
,
unsigned
char
c
)
{
return
(
font
->
metaData
[
c
*
5
+
1
]
+
font
->
metaData
[
c
*
5
+
3
]);
}
void
rfbFontBBox
(
rfbFontDataPtr
font
,
unsigned
char
c
,
int
*
x1
,
int
*
y1
,
int
*
x2
,
int
*
y2
)
{
{
*
x1
+=
font
->
metaData
[
c
*
5
+
3
];
*
x1
+=
font
->
metaData
[
c
*
5
+
3
];
*
y1
+=
font
->
metaData
[
c
*
5
+
4
]
-
font
->
metaData
[
c
*
5
+
2
]
+
1
;
*
y1
+=
-
font
->
metaData
[
c
*
5
+
4
]
-
font
->
metaData
[
c
*
5
+
2
]
+
1
;
*
x2
=*
x1
+
font
->
metaData
[
c
*
5
+
1
];
*
x2
=*
x1
+
font
->
metaData
[
c
*
5
+
1
];
*
y2
=*
y1
+
font
->
metaData
[
c
*
5
+
2
];
*
y2
=*
y1
+
font
->
metaData
[
c
*
5
+
2
];
}
}
...
...
main.c
View file @
87c12192
...
@@ -75,22 +75,28 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
...
@@ -75,22 +75,28 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
while
((
cl
=
rfbClientIteratorNext
(
iterator
)))
{
while
((
cl
=
rfbClientIteratorNext
(
iterator
)))
{
LOCK
(
cl
->
updateMutex
);
LOCK
(
cl
->
updateMutex
);
if
(
cl
->
useCopyRect
)
{
if
(
cl
->
useCopyRect
)
{
if
(
!
sraRgnEmpty
(
cl
->
copyRegion
)
&&
(
cl
->
copyDX
!=
dx
||
cl
->
copyDY
!=
dy
))
{
sraRgnOr
(
cl
->
copyRegion
,
cl
->
modifiedRegion
);
sraRgnMakeEmpty
(
cl
->
copyRegion
);
}
sraRgnOr
(
cl
->
copyRegion
,
copyRegion
);
sraRgnOr
(
cl
->
copyRegion
,
copyRegion
);
cl
->
copyDX
=
dx
;
cl
->
copyDX
=
dx
;
cl
->
copyDY
=
dy
;
cl
->
copyDY
=
dy
;
/* while(!sraRgnEmpty(cl->copyRegion)) */
{
#ifdef HAVE_PTHREADS
#ifdef HAVE_PTHREADS
if
(
cl
->
screen
->
backgroundLoop
)
{
if
(
cl
->
screen
->
backgroundLoop
)
{
SIGNAL
(
cl
->
updateCond
);
SIGNAL
(
cl
->
updateCond
);
UNLOCK
(
cl
->
updateMutex
);
UNLOCK
(
cl
->
updateMutex
);
LOCK
(
cl
->
updateMutex
);
LOCK
(
cl
->
updateMutex
);
}
else
}
else
#endif
#endif
{
{
sraRegionPtr
updateRegion
=
sraRgnCreateRgn
(
cl
->
modifiedRegion
);
sraRegionPtr
updateRegion
=
sraRgnCreateRgn
(
cl
->
modifiedRegion
);
sraRgnOr
(
updateRegion
,
cl
->
copyRegion
);
sraRgnOr
(
updateRegion
,
cl
->
copyRegion
);
rfbSendFramebufferUpdate
(
cl
,
updateRegion
);
rfbSendFramebufferUpdate
(
cl
,
updateRegion
);
sraRgnDestroy
(
updateRegion
);
sraRgnDestroy
(
updateRegion
);
}
}
}
}
else
{
}
else
{
sraRgnOr
(
cl
->
modifiedRegion
,
copyRegion
);
sraRgnOr
(
cl
->
modifiedRegion
,
copyRegion
);
...
@@ -457,7 +463,7 @@ rfbScreenInfoPtr rfbGetScreen(int argc,char** argv,
...
@@ -457,7 +463,7 @@ rfbScreenInfoPtr rfbGetScreen(int argc,char** argv,
rfbScreen
->
colourMap
.
is16
=
0
;
rfbScreen
->
colourMap
.
is16
=
0
;
rfbScreen
->
colourMap
.
data
.
bytes
=
NULL
;
rfbScreen
->
colourMap
.
data
.
bytes
=
NULL
;
if
(
bytesPerPixel
==
8
)
{
if
(
bytesPerPixel
==
1
)
{
format
->
redMax
=
7
;
format
->
redMax
=
7
;
format
->
greenMax
=
7
;
format
->
greenMax
=
7
;
format
->
blueMax
=
3
;
format
->
blueMax
=
3
;
...
@@ -500,6 +506,7 @@ rfbScreenInfoPtr rfbGetScreen(int argc,char** argv,
...
@@ -500,6 +506,7 @@ rfbScreenInfoPtr rfbGetScreen(int argc,char** argv,
rfbScreen
->
getCursorPtr
=
defaultGetCursorPtr
;
rfbScreen
->
getCursorPtr
=
defaultGetCursorPtr
;
rfbScreen
->
setTranslateFunction
=
rfbSetTranslateFunction
;
rfbScreen
->
setTranslateFunction
=
rfbSetTranslateFunction
;
rfbScreen
->
newClientHook
=
doNothingWithClient
;
rfbScreen
->
newClientHook
=
doNothingWithClient
;
rfbScreen
->
displayHook
=
0
;
/* initialize client list and iterator mutex */
/* initialize client list and iterator mutex */
rfbClientListInit
(
rfbScreen
);
rfbClientListInit
(
rfbScreen
);
...
...
rfb.h
View file @
87c12192
...
@@ -147,6 +147,7 @@ typedef void (*SetXCutTextProcPtr) (char* str,int len, struct rfbClientRec* cl);
...
@@ -147,6 +147,7 @@ typedef void (*SetXCutTextProcPtr) (char* str,int len, struct rfbClientRec* cl);
typedef
struct
rfbCursor
*
(
*
GetCursorProcPtr
)
(
struct
rfbClientRec
*
pScreen
);
typedef
struct
rfbCursor
*
(
*
GetCursorProcPtr
)
(
struct
rfbClientRec
*
pScreen
);
typedef
Bool
(
*
SetTranslateFunctionProcPtr
)(
struct
rfbClientRec
*
cl
);
typedef
Bool
(
*
SetTranslateFunctionProcPtr
)(
struct
rfbClientRec
*
cl
);
typedef
void
(
*
NewClientHookPtr
)(
struct
rfbClientRec
*
cl
);
typedef
void
(
*
NewClientHookPtr
)(
struct
rfbClientRec
*
cl
);
typedef
void
(
*
DisplayHookPtr
)(
struct
rfbClientRec
*
cl
);
typedef
struct
{
typedef
struct
{
CARD32
count
;
CARD32
count
;
...
@@ -296,6 +297,8 @@ typedef struct
...
@@ -296,6 +297,8 @@ typedef struct
/* newClientHook is called just after a new client is created */
/* newClientHook is called just after a new client is created */
NewClientHookPtr
newClientHook
;
NewClientHookPtr
newClientHook
;
/* displayHook is called just before a frame buffer update */
DisplayHookPtr
displayHook
;
}
rfbScreenInfo
,
*
rfbScreenInfoPtr
;
}
rfbScreenInfo
,
*
rfbScreenInfoPtr
;
...
@@ -714,7 +717,7 @@ extern void rfbDisconnectUDPSock(rfbScreenInfoPtr cl);
...
@@ -714,7 +717,7 @@ extern void rfbDisconnectUDPSock(rfbScreenInfoPtr cl);
/* font.c */
/* font.c */
typedef
struct
rfbFontData
{
typedef
struct
rfbFontData
{
char
*
data
;
unsigned
char
*
data
;
/*
/*
metaData is a 256*5 array:
metaData is a 256*5 array:
for each character
for each character
...
@@ -723,10 +726,11 @@ typedef struct rfbFontData {
...
@@ -723,10 +726,11 @@ typedef struct rfbFontData {
int
*
metaData
;
int
*
metaData
;
}
rfbFontData
,
*
rfbFontDataPtr
;
}
rfbFontData
,
*
rfbFontDataPtr
;
int
rfbDrawChar
(
rfbScreenInfoPtr
rfbScreen
,
rfbFontDataPtr
font
,
int
x
,
int
y
,
char
c
,
CARD32
colour
);
int
rfbDrawChar
(
rfbScreenInfoPtr
rfbScreen
,
rfbFontDataPtr
font
,
int
x
,
int
y
,
unsigned
char
c
,
CARD32
colour
);
void
rfbDrawString
(
rfbScreenInfoPtr
rfbScreen
,
rfbFontDataPtr
font
,
int
x
,
int
y
,
char
*
string
,
CARD32
colour
);
void
rfbDrawString
(
rfbScreenInfoPtr
rfbScreen
,
rfbFontDataPtr
font
,
int
x
,
int
y
,
unsigned
char
*
string
,
CARD32
colour
);
int
rfbWidth
(
rfbFontDataPtr
font
,
char
*
string
);
int
rfbWidth
(
rfbFontDataPtr
font
,
unsigned
char
*
string
);
void
rfbFontBBox
(
rfbFontDataPtr
font
,
char
c
,
int
*
x1
,
int
*
y1
,
int
*
x2
,
int
*
y2
);
int
rfbWidthOfChar
(
rfbFontDataPtr
font
,
unsigned
char
c
);
void
rfbFontBBox
(
rfbFontDataPtr
font
,
unsigned
char
c
,
int
*
x1
,
int
*
y1
,
int
*
x2
,
int
*
y2
);
/* main.c */
/* main.c */
...
...
rfbserver.c
View file @
87c12192
...
@@ -853,6 +853,9 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
...
@@ -853,6 +853,9 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
sraRegionPtr
updateRegion
,
updateCopyRegion
;
sraRegionPtr
updateRegion
,
updateCopyRegion
;
int
dx
,
dy
;
int
dx
,
dy
;
Bool
sendCursorShape
=
FALSE
;
Bool
sendCursorShape
=
FALSE
;
if
(
cl
->
screen
->
displayHook
)
cl
->
screen
->
displayHook
(
cl
);
/*
/*
* If this client understands cursor shape updates, cursor should be
* If this client understands cursor shape updates, cursor should be
...
@@ -1097,6 +1100,7 @@ rfbSendCopyRegion(cl, reg, dx, dy)
...
@@ -1097,6 +1100,7 @@ rfbSendCopyRegion(cl, reg, dx, dy)
sraRectangleIterator
*
i
;
sraRectangleIterator
*
i
;
sraRect
rect1
;
sraRect
rect1
;
/* printf("copyrect: "); sraRgnPrint(reg); putchar('\n'); fflush(stdout); */
i
=
sraRgnGetReverseIterator
(
reg
,
dx
>
0
,
dy
>
0
);
i
=
sraRgnGetReverseIterator
(
reg
,
dx
>
0
,
dy
>
0
);
while
(
sraRgnIteratorNext
(
i
,
&
rect1
))
{
while
(
sraRgnIteratorNext
(
i
,
&
rect1
))
{
...
...
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