Move image encoding logic into a central EncodeManager class

This allows us to apply a lot more server logic
independently of which encoder is in use.

Most of this class are things moved over from the
Tight encoder.
diff --git a/common/rfb/RREEncoder.h b/common/rfb/RREEncoder.h
index 57c1584..c0de999 100644
--- a/common/rfb/RREEncoder.h
+++ b/common/rfb/RREEncoder.h
@@ -1,4 +1,5 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * Copyright 2014 Pierre Ossman for Cendio AB
  * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,17 +20,23 @@
 #define __RFB_RREENCODER_H__
 
 #include <rdr/MemOutStream.h>
-#include <rfb/RawEncoder.h>
+#include <rfb/Encoder.h>
+#include <rfb/PixelBuffer.h>
 
 namespace rfb {
 
-  class RREEncoder : public RawEncoder {
+  class RREEncoder : public Encoder {
   public:
     RREEncoder(SConnection* conn);
     virtual ~RREEncoder();
-    virtual void writeRect(const Rect& r, PixelBuffer* pb);
+    virtual bool isSupported();
+    virtual void writeRect(const PixelBuffer* pb, const Palette& palette);
+    virtual void writeSolidRect(int width, int height,
+                                const PixelFormat& pf,
+                                const rdr::U8* colour);
   private:
     rdr::MemOutStream mos;
+    ManagedPixelBuffer bufferCopy;
   };
 }
 #endif