summaryrefslogtreecommitdiffstats
path: root/vncterm/LinuxVNC.c
diff options
context:
space:
mode:
authordscho <dscho>2003-02-10 20:10:38 +0000
committerdscho <dscho>2003-02-10 20:10:38 +0000
commit47c481b7ca247b6abdbece512be30427135b7a39 (patch)
tree160b9f31502aa7b03b7eb0795d45e8ae3a7d2132 /vncterm/LinuxVNC.c
parentd3bb5fb6eb920b7149fa5544ef893afa038b772c (diff)
downloadlibvncserver-47c481b7ca247b6abdbece512be30427135b7a39.zip
libvncserver-47c481b7ca247b6abdbece512be30427135b7a39.tar.gz
fixed LinuxVNC colours
Diffstat (limited to 'vncterm/LinuxVNC.c')
-rw-r--r--vncterm/LinuxVNC.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/vncterm/LinuxVNC.c b/vncterm/LinuxVNC.c
index ec4eb25..3165147 100644
--- a/vncterm/LinuxVNC.c
+++ b/vncterm/LinuxVNC.c
@@ -65,6 +65,17 @@ void do_key(Bool down,KeySym keySym,rfbClientPtr cl)
isControl--;
}
+/* these colours are from linux kernel drivers/char/console.c */
+unsigned char color_table[] = { 0, 4, 2, 6, 1, 5, 3, 7,
+ 8,12,10,14, 9,13,11,15 };
+/* the default colour table, for VGA+ colour systems */
+int default_red[] = {0x00,0xaa,0x00,0xaa,0x00,0xaa,0x00,0xaa,
+ 0x55,0xff,0x55,0xff,0x55,0xff,0x55,0xff};
+int default_grn[] = {0x00,0x00,0xaa,0x55,0x00,0x00,0xaa,0xaa,
+ 0x55,0x55,0xff,0xff,0x55,0x55,0xff,0xff};
+int default_blu[] = {0x00,0x00,0x00,0x00,0xaa,0xaa,0xaa,0xaa,
+ 0x55,0x55,0x55,0x55,0xff,0xff,0xff,0xff};
+
int main(int argc,char **argv)
{
int width=80,height=25;
@@ -103,6 +114,11 @@ int main(int argc,char **argv)
/* console init */
console=vcGetConsole(&argc,argv,width,height,&vgaFont,TRUE);
+ for(i=0;i<16;i++) {
+ console->rfbScreen->colourMap.data.bytes[i*3+0]=default_red[color_table[i]];
+ console->rfbScreen->colourMap.data.bytes[i*3+1]=default_grn[color_table[i]];
+ console->rfbScreen->colourMap.data.bytes[i*3+2]=default_blu[color_table[i]];
+ }
console->rfbScreen->desktopName=title;
console->rfbScreen->kbdAddEvent=do_key;
console->selectTimeOut=100000;
OpenPOWER on IntegriCloud