Using namespace rfb in header files is a bad idea
diff --git a/unix/x0vncserver/Geometry.cxx b/unix/x0vncserver/Geometry.cxx
index adc72c3..48c1842 100644
--- a/unix/x0vncserver/Geometry.cxx
+++ b/unix/x0vncserver/Geometry.cxx
@@ -23,6 +23,8 @@
 #include <rfb/LogWriter.h>
 #include <x0vncserver/Geometry.h>
 
+using namespace rfb;
+
 static LogWriter vlog("Geometry");
 
 StringParameter Geometry::m_geometryParam("Geometry",
diff --git a/unix/x0vncserver/Geometry.h b/unix/x0vncserver/Geometry.h
index 9caeeba..98bafb2 100644
--- a/unix/x0vncserver/Geometry.h
+++ b/unix/x0vncserver/Geometry.h
@@ -26,8 +26,6 @@
 #include <rfb/Rect.h>
 #include <rfb/Configuration.h>
 
-using namespace rfb;
-
 class Geometry
 {
 public:
@@ -43,18 +41,18 @@
   int offsetTop() const { return m_rect.tl.y; }
 
   // Return the same information as a Rect structure.
-  const Rect& getRect() const { return m_rect; }
+  const rfb::Rect& getRect() const { return m_rect; }
 
 protected:
   // Parse a string, extract size and coordinates,
   // and return that rectangle clipped to m_rect.
-  Rect parseString(const char *arg) const;
+  rfb::Rect parseString(const char *arg) const;
 
-  static StringParameter m_geometryParam;
+  static rfb::StringParameter m_geometryParam;
 
   int m_fullWidth;
   int m_fullHeight;
-  Rect m_rect;
+  rfb::Rect m_rect;
 };
 
 #endif // __GEOMETRY_H__
diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx
index 3a040e2..d7f6f46 100644
--- a/unix/x0vncserver/PollingManager.cxx
+++ b/unix/x0vncserver/PollingManager.cxx
@@ -31,6 +31,8 @@
 
 #include <x0vncserver/PollingManager.h>
 
+using namespace rfb;
+
 static LogWriter vlog("PollingMgr");
 
 const int PollingManager::m_pollingOrder[32] = {
diff --git a/unix/x0vncserver/PollingManager.h b/unix/x0vncserver/PollingManager.h
index e106f79..5025fa5 100644
--- a/unix/x0vncserver/PollingManager.h
+++ b/unix/x0vncserver/PollingManager.h
@@ -32,8 +32,6 @@
 #include <x0vncserver/TimeMillis.h>
 #endif
 
-using namespace rfb;
-
 class PollingManager {
 
 public:
@@ -42,12 +40,12 @@
                  int offsetLeft = 0, int offsetTop = 0);
   virtual ~PollingManager();
 
-  void poll(VNCServer *server);
+  void poll(rfb::VNCServer *server);
 
 protected:
 
   // Screen polling. Returns true if some changes were detected.
-  bool pollScreen(VNCServer *server);
+  bool pollScreen(rfb::VNCServer *server);
 
   Display *m_dpy;
 
@@ -85,7 +83,7 @@
 
   int checkRow(int x, int y, int w);
   int checkColumn(int x, int y, int h, bool *pChangeFlags);
-  int sendChanges(VNCServer *server) const;
+  int sendChanges(rfb::VNCServer *server) const;
 
   // Check neighboring tiles and update m_changeFlags[].
   void checkNeighbors();
diff --git a/unix/x0vncserver/XPixelBuffer.h b/unix/x0vncserver/XPixelBuffer.h
index da03161..18c85fe 100644
--- a/unix/x0vncserver/XPixelBuffer.h
+++ b/unix/x0vncserver/XPixelBuffer.h
@@ -28,23 +28,21 @@
 #include <x0vncserver/Image.h>
 #include <x0vncserver/PollingManager.h>
 
-using namespace rfb;
-
 //
 // XPixelBuffer is an Image-based implementation of FullFramePixelBuffer.
 //
 
-class XPixelBuffer : public FullFramePixelBuffer
+class XPixelBuffer : public rfb::FullFramePixelBuffer
 {
 public:
-  XPixelBuffer(Display *dpy, ImageFactory &factory, const Rect &rect);
+  XPixelBuffer(Display *dpy, ImageFactory &factory, const rfb::Rect &rect);
   virtual ~XPixelBuffer();
 
   // Provide access to the underlying Image object.
   const Image *getImage() const { return m_image; }
 
   // Detect changed pixels, notify the server.
-  inline void poll(VNCServer *server) { m_poller->poll(server); }
+  inline void poll(rfb::VNCServer *server) { m_poller->poll(server); }
 
   // Override PixelBuffer::grabRegion().
   virtual void grabRegion(const rfb::Region& region);
@@ -59,7 +57,7 @@
 
   // Copy pixels from the screen to the pixel buffer,
   // for the specified rectangular area of the buffer.
-  inline void grabRect(const Rect &r) {
+  inline void grabRect(const rfb::Rect &r) {
     m_image->get(DefaultRootWindow(m_dpy),
 		 m_offsetLeft + r.tl.x, m_offsetTop + r.tl.y,
 		 r.width(), r.height(), r.tl.x, r.tl.y);