Remove full support for colour maps

Gets rid of a loooot of code and complexity.

Colour map clients are still supported through an
automatically generated map, but we lose the ability to
develop a client or server that uses colour maps
internally.
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx
index 789cf09..d7f57b5 100644
--- a/vncviewer/CConn.cxx
+++ b/vncviewer/CConn.cxx
@@ -65,8 +65,9 @@
 // 64 colours (2 bits per component)
 static const PixelFormat lowColourPF(8, 6, false, true,
                                      3, 3, 3, 4, 2, 0);
-// 256 colours (palette)
-static const PixelFormat mediumColourPF(8, 8, false, false);
+// 256 colours (2-3 bits per component)
+static const PixelFormat mediumColourPF(8, 8, false, true,
+                                        7, 7, 3, 5, 2, 0);
 
 CConn::CConn(const char* vncServerName, network::Socket* socket=NULL)
   : serverHost(0), serverPort(0), desktop(NULL),
@@ -342,7 +343,7 @@
 
 void CConn::setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs)
 {
-  desktop->setColourMapEntries(firstColour, nColours, rgbs);
+  vlog.error("Invalid SetColourMapEntries from server!");
 }
 
 void CConn::bell()
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index 2a2f873..3e9b57e 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -216,12 +216,6 @@
 }
 
 
-void DesktopWindow::setColourMapEntries(int firstColour, int nColours,
-                                        rdr::U16* rgbs)
-{
-  viewport->setColourMapEntries(firstColour, nColours, rgbs);
-}
-
 void DesktopWindow::fillRect(const rfb::Rect& r, rfb::Pixel pix) {
   viewport->fillRect(r, pix);
 }
diff --git a/vncviewer/DesktopWindow.h b/vncviewer/DesktopWindow.h
index 06f25f5..08a6652 100644
--- a/vncviewer/DesktopWindow.h
+++ b/vncviewer/DesktopWindow.h
@@ -50,8 +50,6 @@
   // Methods forwarded from CConn
   void setName(const char *name);
 
-  void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs);
-
   void fillRect(const rfb::Rect& r, rfb::Pixel pix);
   void imageRect(const rfb::Rect& r, void* pixels);
   void copyRect(const rfb::Rect& r, int srcX, int srcY);
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index 0ac7602..a7296e9 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -87,7 +87,7 @@
 
 Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_)
   : Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(NULL), pixelTrans(NULL),
-    colourMapChange(false), lastPointerPos(0, 0), lastButtonMask(0),
+    lastPointerPos(0, 0), lastButtonMask(0),
     cursor(NULL), menuCtrlKey(false), menuAltKey(false)
 {
 // FLTK STR #2599 must be fixed for proper dead keys support
@@ -183,11 +183,11 @@
     PixelFormat fake_pf(pf.bpp, pf.depth, nativeBigEndian, pf.trueColour,
                         pf.redMax, pf.greenMax, pf.blueMax,
                         pf.redShift, pf.greenShift, pf.blueShift);
-    pixelTrans->init(fake_pf, &colourMap, getPreferredPF());
+    pixelTrans->init(fake_pf, getPreferredPF());
     return;
   }
 
-  pixelTrans->init(pf, &colourMap, getPreferredPF());
+  pixelTrans->init(pf, getPreferredPF());
 }
 
 
@@ -197,21 +197,6 @@
 }
 
 
-// setColourMapEntries() changes some of the entries in the colourmap.
-// We don't actually act on these changes until we need to. This is
-// because recalculating the internal translation table can be expensive.
-// This also solves the issue of silly servers sending colour maps in
-// multiple pieces.
-void Viewport::setColourMapEntries(int firstColour, int nColours,
-                                   rdr::U16* rgbs)
-{
-  for (int i = 0; i < nColours; i++)
-    colourMap.set(firstColour+i, rgbs[i*3], rgbs[i*3+1], rgbs[i*3+2]);
-
-  colourMapChange = true;
-}
-
-
 // Copy the areas of the framebuffer that have been changed (damaged)
 // to the displayed window.
 
@@ -230,8 +215,6 @@
 void Viewport::fillRect(const rfb::Rect& r, rfb::Pixel pix) {
   if (pixelTrans) {
     rfb::Pixel pix2;
-    if (colourMapChange)
-      commitColourMap();
     pixelTrans->translatePixels(&pix, &pix2, 1);
     pix = pix2;
   }
@@ -242,8 +225,6 @@
 
 void Viewport::imageRect(const rfb::Rect& r, void* pixels) {
   if (pixelTrans) {
-    if (colourMapChange)
-      commitColourMap();
     pixelTrans->translateRect(pixels, r.width(),
                               rfb::Rect(0, 0, r.width(), r.height()),
                               frameBuffer->data, frameBuffer->getStride(),
@@ -327,7 +308,7 @@
       m_width = (width+7)/8;
       for (int y = 0;y < height;y++) {
         for (int x = 0;x < width;x++) {
-          pf->rgbFromBuffer(o, i, 1, &colourMap);
+          pf->rgbFromBuffer(o, i, 1);
 
           if (m[(m_width*y)+(x/8)] & 0x80>>(x%8))
             o[3] = 255;
@@ -529,19 +510,6 @@
 }
 
 
-void Viewport::commitColourMap()
-{
-  if (pixelTrans == NULL)
-    return;
-  if (!colourMapChange)
-    return;
-
-  colourMapChange = false;
-
-  pixelTrans->setColourMapEntries(0, 0);
-}
-
-
 void Viewport::handleClipboardChange(int source, void *data)
 {
   Viewport *self = (Viewport *)data;
diff --git a/vncviewer/Viewport.h b/vncviewer/Viewport.h
index e83a14b..7859db6 100644
--- a/vncviewer/Viewport.h
+++ b/vncviewer/Viewport.h
@@ -26,7 +26,6 @@
 
 #include <rfb/Region.h>
 #include <rfb/Pixel.h>
-#include <rfb/ColourMap.h>
 
 class Fl_Menu_Button;
 class Fl_RGB_Image;
@@ -52,8 +51,6 @@
 
   // Methods forwarded from CConn
 
-  void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs);
-
   void fillRect(const rfb::Rect& r, rfb::Pixel pix);
   void imageRect(const rfb::Rect& r, void* pixels);
   void copyRect(const rfb::Rect& r, int srcX, int srcY);
@@ -77,8 +74,6 @@
 
   static void handleUpdateTimeout(void *data);
 
-  void commitColourMap();
-
   static void handleClipboardChange(int source, void *data);
 
   void handlePointerEvent(const rfb::Point& pos, int buttonMask);
@@ -98,11 +93,7 @@
   CConn* cc;
 
   PlatformPixelBuffer* frameBuffer;
-
   rfb::PixelTransformer *pixelTrans;
-  rfb::SimpleColourMap colourMap;
-  bool colourMapChange;
-
   rfb::Region damage;
 
   rfb::Point lastPointerPos;
diff --git a/vncviewer/Win32PixelBuffer.cxx b/vncviewer/Win32PixelBuffer.cxx
index 626bb96..4ee15ce 100644
--- a/vncviewer/Win32PixelBuffer.cxx
+++ b/vncviewer/Win32PixelBuffer.cxx
@@ -40,7 +40,7 @@
 PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) :
   FullFramePixelBuffer(rfb::PixelFormat(32, 24, false, true,
                                         255, 255, 255, 16, 8, 0),
-                       width, height, NULL, NULL),
+                       width, height, NULL),
   bitmap(NULL)
 {
   BITMAPINFOHEADER bih;
diff --git a/vncviewer/X11PixelBuffer.cxx b/vncviewer/X11PixelBuffer.cxx
index 548591e..f834003 100644
--- a/vncviewer/X11PixelBuffer.cxx
+++ b/vncviewer/X11PixelBuffer.cxx
@@ -94,7 +94,7 @@
 }
 
 PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) :
-  FullFramePixelBuffer(display_pf(), width, height, NULL, NULL),
+  FullFramePixelBuffer(display_pf(), width, height, NULL),
   shminfo(NULL), xim(NULL)
 {
   // Might not be open at this point