Fresco/Berlin/include/Berlin AllocationImpl.hh,1.11,1.12 Allocator.hh,1.15,1.16 Color.hh,1.9,1.10 CommandImpl.hh,1.3,1.4 Console.hh,1.31,1.32 ControllerImpl.hh,1.25,1.26 DebugGraphic.hh,1.11,1.12 DefaultPOA.hh,1.2,1.3 DesktopImpl.hh,1.13,1.14 DrawTraversalImpl.hh,1.26,1.27 DrawingKit3DBase.hh,1.2,1.3 DrawingKitBase.hh,1.28,1.29 Event.hh,1.7,1.8 EventManager.hh,1.22,1.23 FilterImpl.hh,1.5,1.6 FocusImpl.hh,1.18,1.19 GapBuffer.hh,1.10,1.11 Geometry.hh,1.9,1.10 GraphDebugger.hh,1.1,1.2 GraphicImpl.hh,1.31,1.32 IdentifiableImpl.hh,1.3,1.4 ImplVar.hh,1.10,1.11 KitImpl.hh,1.15,1.16 LRUCache.hh,1.4,1.5 Logger.hh,1.19,1.20 Math.hh,1.7,1.8 MonoGraphic.hh,1.18,1.19 NonPositionalFocus.hh,1.15,1.16 ObjectCache.hh,1.5,1.6 ObjectVar.hh,1.2,1.3 ObserverImpl.hh,1.2,1.3 PNG.hh,1.5,1.6 PickTraversalImpl.hh,1.33,1.34 PolyGraphic.hh,1.23,1.24 Pool.hh,1.5,1.6 PositionalFocus.hh,1.15, 1.16 Provider.h

Tobias Hunger <[email protected]> Tue, 30 Dec 2003 06:08:24 +0100
Newsgroups gmane.comp.video.fresco.cvs
Message-ID <[email protected]>
Update of /cvs/fresco/Fresco/Berlin/include/Berlin
In directory purcel:/tmp/cvs-serv30213/include/Berlin

Modified Files:
	AllocationImpl.hh Allocator.hh Color.hh CommandImpl.hh 
	Console.hh ControllerImpl.hh DebugGraphic.hh DefaultPOA.hh 
	DesktopImpl.hh DrawTraversalImpl.hh DrawingKit3DBase.hh 
	DrawingKitBase.hh Event.hh EventManager.hh FilterImpl.hh 
	FocusImpl.hh GapBuffer.hh Geometry.hh GraphDebugger.hh 
	GraphicImpl.hh IdentifiableImpl.hh ImplVar.hh KitImpl.hh 
	LRUCache.hh Logger.hh Math.hh MonoGraphic.hh 
	NonPositionalFocus.hh ObjectCache.hh ObjectVar.hh 
	ObserverImpl.hh PNG.hh PickTraversalImpl.hh PolyGraphic.hh 
	Pool.hh PositionalFocus.hh Provider.hh QuadTree.hh 
	RCManager.hh RasterImpl.hh RefCountBaseImpl.hh RefCountVar.hh 
	RegionImpl.hh Requestor.hh ScreenImpl.hh ScreenManager.hh 
	ServantBase.hh ServerContextImpl.hh ServerImpl.hh 
	SubjectImpl.hh TransformImpl.hh TraversalImpl.hh Vertex.hh 
	ViewImpl.hh 
Log Message:
 * Styleguidify Berlin
 * Add namespace Berlin
Both patches are mixed into one since I did not want to commit two such
large and disruptive patches.


Index: AllocationImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/AllocationImpl.hh,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- AllocationImpl.hh	29 May 2002 06:49:37 -0000	1.11
+++ AllocationImpl.hh	29 Dec 2003 08:03:18 -0000	1.12
@@ -29,38 +29,43 @@
 #include <Berlin/Provider.hh>
 #include <vector>
 
-class RegionImpl;
-class TransformImpl;
-class AllocationImpl;
-
-template <> struct Initializer<AllocationImpl>;
-
-class AllocationImpl : public virtual POA_Fresco::Allocation,
-                       public virtual ServantBase
+namespace Berlin
 {
-  struct State
+
+  class RegionImpl;
+  class TransformImpl;
+  class AllocationImpl;
+  
+  template <> struct Initializer<AllocationImpl>;
+  
+  class AllocationImpl : public virtual POA_Fresco::Allocation,
+			 public virtual ServantBase
   {
-    RegionImpl        *allocation;
-    TransformImpl     *transformation;
-    Fresco::Screen_var root;
+      struct State
+      {
+	  RegionImpl        *allocation;
+	  TransformImpl     *transformation;
+	  Fresco::Screen_var root;
+      };
+      typedef std::vector<State> list_t;
+      friend class Provider<AllocationImpl>;
+    public:
+      AllocationImpl();
+      ~AllocationImpl();
+      void add(Fresco::Region_ptr, Fresco::Screen_ptr);
+      CORBA::Long size();
+      Fresco::Allocation::Info *get(CORBA::Long);
+      void clear();
+    private:
+      bool my_active : 1;
+      list_t my_list;
+  };
+  
+  template <> struct Initializer<AllocationImpl>
+  {
+      static void initialize(AllocationImpl *a) { a->clear();}
   };
-  typedef std::vector<State> list_t;
-  friend class Provider<AllocationImpl>;
-public:
-  AllocationImpl();
-  ~AllocationImpl();
-  void add(Fresco::Region_ptr, Fresco::Screen_ptr);
-  CORBA::Long size();
-  Fresco::Allocation::Info *get(CORBA::Long);
-  void clear();
-private:
-  bool _active : 1;
-  list_t _list;
-};
 
-template <> struct Initializer<AllocationImpl>
-{
-  static void initialize(AllocationImpl *a) { a->clear();}
-};
+} // namespace
 
 #endif 

Index: Allocator.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Allocator.hh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Allocator.hh	29 May 2002 06:49:37 -0000	1.15
+++ Allocator.hh	29 Dec 2003 08:03:18 -0000	1.16
@@ -25,55 +25,64 @@
 #include <Berlin/ImplVar.hh>
 #include <Berlin/MonoGraphic.hh>
 
-//. An Allocator is a graphic that always gives its child
-//. an allocation that matches the child's requisition.
-//. This functionality is useful as a gateway between
-//. figure objects, which ignore their allocation, and
-//. layout objects.
-class Allocator : public MonoGraphic
+namespace Berlin
 {
-public:
-  Allocator();
-  virtual ~Allocator();
 
-  virtual void request(Fresco::Graphic::Requisition &);
-
-  virtual void traverse(Fresco::Traversal_ptr);
-
-  virtual void allocate(Fresco::Tag, const Fresco::Allocation::Info &);
-  virtual void need_resize();
-// private:
-  bool _requested : 1;
-  bool _allocated : 1;
-  Fresco::Graphic::Requisition _requisition;
-  Impl_var<RegionImpl> _natural;
-  Impl_var<RegionImpl> _extension;
+  //. An Allocator is a graphic that always gives its child
+  //. an allocation that matches the child's requisition.
+  //. This functionality is useful as a gateway between
+  //. figure objects, which ignore their allocation, and
+  //. layout objects.
+  class Allocator : public MonoGraphic
+  {
+    public:
+      Allocator();
+      virtual ~Allocator();
+      
+      virtual void request(Fresco::Graphic::Requisition &);
+      
+      virtual void traverse(Fresco::Traversal_ptr);
+      
+      virtual void allocate(Fresco::Tag, const Fresco::Allocation::Info &);
+      virtual void need_resize();
+//   private:
+      bool my_requested : 1;
+      bool my_allocated : 1;
+      Fresco::Graphic::Requisition my_requisition;
+      Impl_var<RegionImpl> my_natural;
+      Impl_var<RegionImpl> my_extension;
   
-  void cache_requisition();
-  void cache_allocation();
-  void need_damage(RegionImpl *, Fresco::Allocation_ptr);
-  static void natural_allocation(const Fresco::Graphic::Requisition &, RegionImpl &);
-};
+      void cache_requisition();
+      void cache_allocation();
+      void need_damage(RegionImpl *, Fresco::Allocation_ptr);
+      static void natural_allocation(const Fresco::Graphic::Requisition &,
+				     RegionImpl &);
+  };
 
-//. A TransformAllocator maps its allocate to a translation
-//. during traversal and always gives its child the child's
-//. natural allocation.  This functionality is useful
-//. as a gateway between layout objects and figure objects
-//. (which ignore their allocation).
-class TransformAllocator : public Allocator
-{
-public:
-  TransformAllocator(Fresco::Alignment, Fresco::Alignment, Fresco::Alignment, Fresco::Alignment, Fresco::Alignment, Fresco::Alignment);
-  ~TransformAllocator();
+  //. A TransformAllocator maps its allocate to a translation
+  //. during traversal and always gives its child the child's
+  //. natural allocation.  This functionality is useful
+  //. as a gateway between layout objects and figure objects
+  //. (which ignore their allocation).
+  class TransformAllocator : public Allocator
+  {
+    public:
+      TransformAllocator(Fresco::Alignment, Fresco::Alignment,
+			 Fresco::Alignment, Fresco::Alignment,
+			 Fresco::Alignment, Fresco::Alignment);
+      ~TransformAllocator();
 
-  virtual void request(Fresco::Graphic::Requisition &);
-  virtual void traverse(Fresco::Traversal_ptr);
-  virtual void allocate(Fresco::Tag, const Fresco::Allocation::Info &);
-protected:
-  Fresco::Alignment _xparent, _yparent, _zparent;
-  Fresco::Alignment _xchild, _ychild, _zchild;
+      virtual void request(Fresco::Graphic::Requisition &);
+      virtual void traverse(Fresco::Traversal_ptr);
+      virtual void allocate(Fresco::Tag, const Fresco::Allocation::Info &);
+    protected:
+      Fresco::Alignment my_xparent, my_yparent, my_zparent;
+      Fresco::Alignment my_xchild, my_ychild, my_zchild;
+      
+      void compute_delta(const Fresco::Vertex &, const Fresco::Vertex &,
+			 Fresco::Vertex &);
+  };
 
-  void compute_delta(const Fresco::Vertex &, const Fresco::Vertex &, Fresco::Vertex &);
-};
+} // namespace
 
 #endif 

Index: Color.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Color.hh,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Color.hh	29 May 2002 06:49:38 -0000	1.9
+++ Color.hh	29 Dec 2003 08:03:18 -0000	1.10
@@ -26,72 +26,98 @@
 #include <Fresco/Types.hh>
 #include <iostream>
 
-inline Fresco::Color brightness(const Fresco::Color &c1, double adjust)
+namespace Berlin
 {
-  Fresco::Color c2;
-  if (adjust >= 0)
-    {
-      c2.red   = c1.red + (1 - c1.red) * adjust;
-      c2.green = c1.green + (1 - c1.green) * adjust;
-      c2.blue  = c1.blue + (1 - c1.blue) * adjust;
-    }
-  else
-    {
-      c2.red   = c1.red * (1 + adjust);
-      c2.green = c1.green * (1 + adjust);
-      c2.blue  = c1.blue * (1 + adjust);
-    }
-  c2.alpha = c1.alpha;
-  return c2;
-};
 
-inline void CMYtoRGB(Fresco::Coord cyan, Fresco::Coord magenta, Fresco::Coord yellow, Fresco::Color &color)
-{
-  color.red = 1. - cyan;
-  color.green = 1. - magenta;
-  color.blue = 1. - yellow;
-}
+  inline Fresco::Color brightness(const Fresco::Color &c1, double adjust)
+  {
+      Fresco::Color c2;
+      if (adjust >= 0)
+      {
+	  c2.red   = c1.red + (1 - c1.red) * adjust;
+	  c2.green = c1.green + (1 - c1.green) * adjust;
+	  c2.blue  = c1.blue + (1 - c1.blue) * adjust;
+      }
+      else
+      {
+	  c2.red   = c1.red * (1 + adjust);
+	  c2.green = c1.green * (1 + adjust);
+	  c2.blue  = c1.blue * (1 + adjust);
+      }
+      c2.alpha = c1.alpha;
+      return c2;
+  };
 
-inline void RGBtoHSV(const Fresco::Color &color, Fresco::Coord &hue, Fresco::Coord &saturation, Fresco::Coord &value)
-{
-  Fresco::Coord max = color.red > color.green ? (color.red > color.blue ? color.red : color.blue) : color.green > color.blue ? color.green : color.blue;
-  Fresco::Coord min = color.red < color.green ? (color.red < color.blue ? color.red : color.blue) : color.green < color.blue ? color.green : color.blue;
-  value = max;
-  saturation = max != 0. ? (max - min) / max : 0.; 
-  if (saturation == 0.) hue = 0.; // undefined...
-  else
-   {
-     double delta = max - min;
-     if (color.red == max) hue = (color.green - color.blue) / delta;
-     else if (color.green == max) hue = 2. + (color.blue - color.red) / delta;
-     else if (color.blue == max) hue = 4. + (color.red - color.green) / delta;
-     hue *= 60.;
-     if (hue < 0.) hue += 360.;
-   }
-}
+  inline void CMYtoRGB(Fresco::Coord cyan, Fresco::Coord magenta,
+		       Fresco::Coord yellow, Fresco::Color &color)
+  {
+      color.red = 1. - cyan;
+      color.green = 1. - magenta;
+      color.blue = 1. - yellow;
+  }
 
-inline void HSVtoRGB(Fresco::Coord hue, Fresco::Coord saturation, Fresco::Coord value, Fresco::Color &color)
-{
-  if (saturation == 0.) color.red = color.green = color.blue = value;
-  else
-    {
-      if (hue == 360.) hue = 0.;
-      hue /= 60.;
-      int i = static_cast<int>(hue);
-      Fresco::Coord f = hue - i;
-      Fresco::Coord p = value * (1. - saturation);
-      Fresco::Coord q = value * (1. - saturation * f);
-      Fresco::Coord t = value * (1. - saturation * (1. - f));
-      switch (i)
-        {
-          case 0: color.red = value; color.green = t; color.blue = p; break;
-          case 1: color.red = q; color.green = value; color.blue = p; break;
-          case 2: color.red = p; color.green = value; color.blue = t; break;
-          case 3: color.red = p; color.green = q; color.blue = value; break;
-          case 4: color.red = t; color.green = p; color.blue = value; break;
-          case 5: color.red = value; color.green = p; color.blue = q; break;
-        }
-    }
-}
+  inline void RGBtoHSV(const Fresco::Color &color, Fresco::Coord &hue,
+		       Fresco::Coord &saturation, Fresco::Coord &value)
+  {
+      Fresco::Coord max = color.red > color.green ?
+	  (color.red > color.blue ? color.red : color.blue) :
+	  color.green > color.blue ? color.green : color.blue;
+      Fresco::Coord min = color.red < color.green ?
+	  (color.red < color.blue ? color.red : color.blue) :
+	  color.green < color.blue ? color.green : color.blue;
+      value = max;
+      saturation = max != 0. ? (max - min) / max : 0.; 
+      if (saturation == 0.) hue = 0.; // undefined...
+      else
+      {
+	  double delta = max - min;
+	  if (color.red == max) hue = (color.green - color.blue) / delta;
+	  else if (color.green == max)
+	      hue = 2. + (color.blue - color.red) / delta;
+	  else if (color.blue == max)
+	      hue = 4. + (color.red - color.green) / delta;
+	  hue *= 60.;
+	  if (hue < 0.) hue += 360.;
+      }
+  }
+  
+  inline void HSVtoRGB(Fresco::Coord hue, Fresco::Coord saturation,
+		       Fresco::Coord value, Fresco::Color &color)
+  {
+      if (saturation == 0.) color.red = color.green = color.blue = value;
+      else
+      {
+	  if (hue == 360.) hue = 0.;
+	  hue /= 60.;
+	  int i = static_cast<int>(hue);
+	  Fresco::Coord f = hue - i;
+	  Fresco::Coord p = value * (1. - saturation);
+	  Fresco::Coord q = value * (1. - saturation * f);
+	  Fresco::Coord t = value * (1. - saturation * (1. - f));
+	  switch (i)
+	  {
+          case 0:
+	      color.red = value; color.green = t; color.blue = p;
+	      break;
+          case 1:
+	      color.red = q; color.green = value; color.blue = p;
+	      break;
+          case 2:
+	      color.red = p; color.green = value; color.blue = t;
+	      break;
+          case 3:
+	      color.red = p; color.green = q; color.blue = value;
+	      break;
+          case 4:
+	      color.red = t; color.green = p; color.blue = value;
+	      break;
+          case 5:
+	      color.red = value; color.green = p; color.blue = q;
+	      break;
+	  }
+      }
+  }
 
-#endif /* _Color_hh */
+} // namespace
+
+#endif

Index: CommandImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/CommandImpl.hh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CommandImpl.hh	27 Oct 2003 17:08:33 -0000	1.3
+++ CommandImpl.hh	29 Dec 2003 08:03:18 -0000	1.4
@@ -19,19 +19,24 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _CommandImpl_hh
-#define _CommandImpl_hh
+#ifndef _Berlin_CommandImpl_hh
+#define _Berlin_CommandImpl_hh
 
 #include <Fresco/config.hh>
 #include <Fresco/Command.hh>
 #include <Berlin/ServantBase.hh>
 
-class CommandImpl : public virtual POA_Fresco::Command,
-                    public virtual ServantBase
+namespace Berlin
 {
-  public:
-    virtual void execute(const CORBA::Any &) = 0;
-    virtual void destroy() { deactivate();}
-};
+
+  class CommandImpl : public virtual POA_Fresco::Command,
+		      public virtual ServantBase
+  {
+    public:
+      virtual void execute(const CORBA::Any &) = 0;
+      virtual void destroy() { deactivate(); }
+  };
+
+} // namespace
 
 #endif

Index: Console.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Console.hh,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- Console.hh	9 Feb 2003 19:14:36 -0000	1.31
+++ Console.hh	29 Dec 2003 08:03:18 -0000	1.32
@@ -34,235 +34,243 @@
 #include <vector>
 #include <map>
 
-//. This is an abstraction of the underlying graphics libraries Berlin uses.
-//. The DrawingKits call the methods of this object.
-class Console
+namespace Berlin
 {
-public:
-  class Drawable;
-  //. Extensions are a means to provide special APIs
-  //. that are not supported on all Consoles
-  class Extension
-  {
-  public:
-    virtual ~Extension(){}
-  };
-private:
-  typedef std::vector<Extension *> elist_t;
-  //. Deletes this Console in its Destrcuctor.
-  struct Reaper
-  {
-    ~Reaper();
-  };
-  friend struct Reaper;
 
-public:
-  class Pointer;
-
-  //. A helperclass to get the Console-module into memory.
-  class Loader
-  {
-  public:
-    virtual ~Loader() {}
-    virtual Console *load(int &, char **, 
-                          Fresco::PixelCoord, Fresco::PixelCoord) = 0;
-
-  };
-  template <typename T>
-  class LoaderT : public Loader
+  //. This is an abstraction of the underlying graphics libraries
+  //. Berlin uses. The DrawingKits call the methods of this object.
+  class Console
   {
-  public:
-    virtual T *load(int &argc, char **argv, 
-                    Fresco::PixelCoord x, Fresco::PixelCoord y)
-    { 
-      return new T(argc, argv, x, y);
-    }
-
-  };
-
-  //. List available consoles (modules)
-  static void list_available(std::ostream &);
-
-  //. Check whether a particular console (module) is avilable
-  static bool is_available(std::string const &console);
+    public:
+      class Drawable;
+      //. Extensions are a means to provide special APIs
+      //. that are not supported on all Consoles
+      class Extension
+      {
+	public:
+	  virtual ~Extension() { }
+      };
+    private:
+      typedef std::vector<Extension *> elist_t;
+      //. Deletes this Console in its Destrcuctor.
+      struct Reaper
+      {
+	  ~Reaper();
+      };
+      friend struct Reaper;
+      
+    public:
+      class Pointer;
+      
+      //. A helperclass to get the Console-module into memory.
+      class Loader
+      {
+	public:
+	  virtual ~Loader() {}
+	  virtual Console *load(int &, char **, 
+				Fresco::PixelCoord,
+				Fresco::PixelCoord) = 0;
+	  
+      };
+      template <typename T>
+      class LoaderT : public Loader
+      {
+	public:
+	  virtual T *load(int &argc, char **argv, 
+			  Fresco::PixelCoord x, Fresco::PixelCoord y)
+	  { return new T(argc, argv, x, y); }
 
-  //. Sets up the graphics library. It gets passed the commandline arguments
-  //. of the server (argc and argv), checks them for any console-related 
-  //. options and afterwards passes them on to the graphic's library. 
-  //. Finally you need to pass the POA to this method.
-  // FIXME: argc/argv are unused? are we still aiming for cascading GetOpt?
-  static int open(const std::string &, int argc, char **argv, 
-                  PortableServer::POA_ptr, 
-                  Fresco::PixelCoord x, Fresco::PixelCoord y)
-    throw(std::runtime_error);
+      };
 
-  //. Get the active instance of the Console.
-  static Console *instance();
+      //. List available consoles (modules)
+      static void list_available(std::ostream &);
 
-  //. Get a pointerobject to use on this Console.
-  virtual Pointer *pointer(Fresco::Raster_ptr) = 0;
+      //. Check whether a particular console (module) is avilable
+      static bool is_available(std::string const &console);
 
-  //. Get the 'root-drawable' used by this Console. That's the chunk of video
-  //. memory covering the whole screen.
-  virtual Drawable *drawable() = 0;
-  //. Creates a new Drawable of the given size (x, y) and depth.
-  virtual Drawable *create_drawable(Fresco::PixelCoord, //.< Requested x size.
-				    Fresco::PixelCoord, //.< Requested y size.
-				    Fresco::PixelCoord) = 0; //.< Requested color depth.
+      //. Sets up the graphics library. It gets passed the commandline
+      //. arguments of the server (argc and argv), checks them for any
+      //. console-related options and afterwards passes them on to the
+      //. graphic's library. Finally you need to pass the POA to this
+      //. method.
+      // FIXME: argc/argv are unused? are we still aiming for cascading
+      //        GetOpt?
+      static int open(const std::string &, int argc, char **argv, 
+		      PortableServer::POA_ptr, 
+		      Fresco::PixelCoord x, Fresco::PixelCoord y)
+	  throw(std::runtime_error);
 
-  //. Activates a given drawable: After activation it can recieve requests 
-  //. via CORBA.
-  Fresco::Drawable_ptr activate_drawable(Drawable *);
-  //. FIXME: Missing documentation!
-  PortableServer::Servant reference_to_servant(Fresco::Drawable_ptr);
+      //. Get the active instance of the Console.
+      static Console *instance();
+      
+      //. Get a pointerobject to use on this Console.
+      virtual Pointer *pointer(Fresco::Raster_ptr) = 0;
+      
+      //. Get the 'root-drawable' used by this Console. That's the chunk
+      //. of video memory covering the whole screen.
+      virtual Drawable *drawable() = 0;
+      //. Creates a new Drawable of the given size (x, y) and depth.
+      virtual Drawable *
+      create_drawable(Fresco::PixelCoord, //.< Requested x size.
+		      Fresco::PixelCoord, //.< Requested y size.
+		      Fresco::PixelCoord) = 0; //.< Requested color depth.
 
-  //. FIXME: Missing documentation!
-  virtual void device_info(std::ostream &) = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::Input::Event *next_event() = 0;
-  //. FIXME: Missing documentation!
-  virtual void wakeup() = 0;
-  //. FIXME: Missing documentation!
-  virtual void activate_autoplay() = 0;
-  //. Highlight the specified region to aid debugging.
-  //. You can set the color of the highlight by passing a
-  //. red, green and blue betwenn 0.0 and 1.0. If
-  //. you do not pass a color it defaults to red.
-  virtual void highlight_screen(Fresco::Coord, Fresco::Coord,
-				Fresco::Coord, Fresco::Coord,
-				double red = 1.0,
-				double green = 0.0,
-				double blue = 0.0) = 0;
+      //. Activates a given drawable: After activation it can recieve
+      //. requests via CORBA.
+      Fresco::Drawable_ptr activate_drawable(Drawable *);
+      //. FIXME: Missing documentation!
+      PortableServer::Servant reference_to_servant(Fresco::Drawable_ptr);
 
-  template <typename T>
-  T *get_extension(const std::string &id)
-  {
-    Extension *extension = create_extension(id);
-    T *t = dynamic_cast<T *>(extension);
-    if (!t)
+      //. FIXME: Missing documentation!
+      virtual void device_info(std::ostream &) = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::Input::Event *next_event() = 0;
+      //. FIXME: Missing documentation!
+      virtual void wakeup() = 0;
+      //. FIXME: Missing documentation!
+      virtual void activate_autoplay() = 0;
+      //. Highlight the specified region to aid debugging.
+      //. You can set the color of the highlight by passing a
+      //. red, green and blue betwenn 0.0 and 1.0. If
+      //. you do not pass a color it defaults to red.
+      virtual void highlight_screen(Fresco::Coord, Fresco::Coord,
+				    Fresco::Coord, Fresco::Coord,
+				    double red = 1.0,
+				    double green = 0.0,
+				    double blue = 0.0) = 0;
+      
+      template <typename T>
+      T *get_extension(const std::string &id)
       {
-	delete extension;
-	throw (std::runtime_error(id + ": no such extension"));
+	  Extension *extension = create_extension(id);
+	  T *t = dynamic_cast<T *>(extension);
+	  if (!t)
+	  {
+	      delete extension;
+	      throw (std::runtime_error(id + ": no such extension"));
+	  }
+	  my_extensions.push_back(extension);
+	  return t;
       }
-    _extensions.push_back(extension);
-    return t;
-  }
-protected:
-  Console() {}
-  virtual ~Console() {}
-private:
-  virtual Extension      *create_extension(const std::string &) = 0;
-  PortableServer::POA_var _poa;
-  static Console         *_console;
-  static Reaper           _reaper;
-  elist_t                 _extensions;
+    protected:
+      Console() { }
+      virtual ~Console() { }
+    private:
+      virtual Extension      *create_extension(const std::string &) = 0;
+      PortableServer::POA_var my_poa;
+      static Console         *my_console;
+      static Reaper           my_reaper;
+      elist_t                 my_extensions;
 
-  typedef std::map<std::string, std::string> console_list_t;
-  static console_list_t my_available_consoles;
-  //. Attempt to load all consoles, and cache their name/location
-  static void cache_available_consoles();
-};
+      typedef std::map<std::string, std::string> console_list_t;
+      static console_list_t my_available_consoles;
+      //. Attempt to load all consoles, and cache their name/location
+      static void cache_available_consoles();
+  };
 
 //. This is a chunk of (video-) memory that is used to store raster data.
-class Console::Drawable : public virtual POA_Fresco::Drawable,
-	                  public virtual PortableServer::RefCountServantBase
-{
-public:
-  class Extension : public virtual Console::Extension
+  class Console::Drawable : public virtual POA_Fresco::Drawable,
+		            public virtual PortableServer::RefCountServantBase
   {
-  public:
-    virtual void attach(Drawable *) = 0;
-  };
-  typedef char data_type;
-  Drawable() {}
-  virtual ~Drawable() {}
-
-  //. FIXME: Missing documentation!
-  virtual Fresco::Drawable::PixelFormat pixel_format() = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::Drawable::BufferFormat buffer_format() = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::PixelCoord width() const = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::PixelCoord height() const = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::PixelCoord vwidth() const = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::PixelCoord vheight() const = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::Coord resolution(Fresco::Axis) const = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::Coord dpi(Fresco::Axis) const = 0;
-  //. FIXME: Missing documentation!
-  virtual Fresco::PixelCoord row_length() const = 0;
+    public:
+      class Extension : public virtual Console::Extension
+      {
+	public:
+	  virtual void attach(Drawable *) = 0;
+      };
+      typedef char data_type;
+      Drawable() {}
+      virtual ~Drawable() {}
 
-  //. FIXME: Missing documentation!
-  virtual void flush() = 0;
-  //. FIXME: Missing documentation!
-  virtual void flush(Fresco::PixelCoord, Fresco::PixelCoord,
-		     Fresco::PixelCoord, Fresco::PixelCoord) = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::Drawable::PixelFormat pixel_format() = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::Drawable::BufferFormat buffer_format() = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::PixelCoord width() const = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::PixelCoord height() const = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::PixelCoord vwidth() const = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::PixelCoord vheight() const = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::Coord resolution(Fresco::Axis) const = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::Coord dpi(Fresco::Axis) const = 0;
+      //. FIXME: Missing documentation!
+      virtual Fresco::PixelCoord row_length() const = 0;
 
-  //. Called by the server when the scene is about to be drawn.
-  //. This is a suitable place to add calls for building display
-  //. lists (for example).
-  virtual void init() = 0;
-  //. Called by the server as soon as the scene finished drawing.
-  virtual void finish() = 0;
+      //. FIXME: Missing documentation!
+      virtual void flush() = 0;
+      //. FIXME: Missing documentation!
+      virtual void flush(Fresco::PixelCoord, Fresco::PixelCoord,
+			 Fresco::PixelCoord, Fresco::PixelCoord) = 0;
 
-  //. Copy part of this Drawable to a new location in the same Drawable.
-  //. These locations may overlap.
-  virtual void blit(Fresco::PixelCoord, //.< x position of one corner of the source area
-		    Fresco::PixelCoord, //.< y position of one corner of the source area
-		    Fresco::PixelCoord, //.< width of the source area
-		    Fresco::PixelCoord, //.< height of the source area
-		    Fresco::PixelCoord, //.< x position of correspnding corner of the
-		                        //.< destination area
-		    Fresco::PixelCoord) = 0; //.< y position of correspnding corner
-		                             //.< of the destination area
-  //. Copy parts of the given Drawable to the specified position in this Drawable.
-  virtual void blit(const Drawable &,   //.< source Drawable
- 		    Fresco::PixelCoord, //.< x position of one corner of the source area
-		    Fresco::PixelCoord, //.< y position of one corner of the source area
-		    Fresco::PixelCoord, //.< width of the source area
-		    Fresco::PixelCoord, //.< height of the source area
-		    Fresco::PixelCoord, //.< x position of correspnding corner of the
-		                        //.< destination area
-		    Fresco::PixelCoord) = 0; //.< y position of correspnding corner
-		                             //.< of the destination area
-  //. Copy parts of the given Drawable to the specified position in this Drawable
-  virtual void blit(Fresco::Drawable_ptr, //.< source Drawable
-		    Fresco::PixelCoord, //.< x position of one corner of the source area
-		    Fresco::PixelCoord, //.< y position of one corner of the source area
-		    Fresco::PixelCoord, //.< width of the source area
-		    Fresco::PixelCoord, //.< height of the source area
-		    Fresco::PixelCoord, //.< x position of correspnding corner of the
-		                        //.< destination area
-		    Fresco::PixelCoord) = 0; //.< y position of correspnding corner
+      //. Called by the server when the scene is about to be drawn.
+      //. This is a suitable place to add calls for building display
+      //. lists (for example).
+      virtual void init() = 0;
+      //. Called by the server as soon as the scene finished drawing.
+      virtual void finish() = 0;
+      
+      //. Copy part of this Drawable to a new location in the same
+      //. Drawable. These locations may overlap.
+      virtual void blit(Fresco::PixelCoord, //.< x position of one corner of the source area
+			Fresco::PixelCoord, //.< y position of one corner of the source area
+			Fresco::PixelCoord, //.< width of the source area
+			Fresco::PixelCoord, //.< height of the source area
+			Fresco::PixelCoord, //.< x position of correspnding corner of the
+			                    //.< destination area
+			Fresco::PixelCoord) = 0; //.< y position of correspnding corner
 		                             //.< of the destination area
-private:
-  Drawable(const Drawable &);
-  Drawable &operator = (const Drawable &);
-};
+      //. Copy parts of the given Drawable to the specified position in this Drawable.
+      virtual void blit(const Drawable &,   //.< source Drawable
+			Fresco::PixelCoord, //.< x position of one corner of the source area
+			Fresco::PixelCoord, //.< y position of one corner of the source area
+			Fresco::PixelCoord, //.< width of the source area
+			Fresco::PixelCoord, //.< height of the source area
+			Fresco::PixelCoord, //.< x position of correspnding corner of the
+			                    //.< destination area
+			Fresco::PixelCoord) = 0; //.< y position of correspnding corner
+                                                 //.< of the destination area
+      //. Copy parts of the given Drawable to the specified position in this Drawable
+      virtual void blit(Fresco::Drawable_ptr, //.< source Drawable
+			Fresco::PixelCoord, //.< x position of one corner of the source area
+			Fresco::PixelCoord, //.< y position of one corner of the source area
+			Fresco::PixelCoord, //.< width of the source area
+			Fresco::PixelCoord, //.< height of the source area
+			Fresco::PixelCoord, //.< x position of correspnding corner of the
+			                    //.< destination area
+			Fresco::PixelCoord) = 0; //.< y position of correspnding corner
+		                                 //.< of the destination area
+    private:
+      Drawable(const Drawable &);
+      Drawable &operator = (const Drawable &);
+  };
 
-//. This class is used to render the mousepointer.
-class Console::Pointer : public virtual PortableServer::RefCountServantBase
-{
-public:
-  virtual ~Pointer() {}
+  //. This class is used to render the mousepointer.
+  class Console::Pointer :
+	public virtual PortableServer::RefCountServantBase
+  {
+    public:
+      virtual ~Pointer() { }
+      
+      //. return the raster associated with this pointer
+      virtual Fresco::Raster_ptr raster() = 0;
+      //. Move the pointer to the given Pixelcoordinate.
+      virtual void move(Fresco::Coord, Fresco::Coord) = 0;
+      //. FIXME: Missing documentation!
+      virtual void draw() = 0;
+      //. FIXME: Missing documentation!
+      virtual void save() = 0;
+      //. FIXME: Missing documentation!
+      virtual void restore() = 0;
+      //. FIXME: Missing documentation!
+      virtual bool intersects(Fresco::Coord, Fresco::Coord,
+			      Fresco::Coord, Fresco::Coord) = 0;
+  };
 
-  //. return the raster associated with this pointer
-  virtual Fresco::Raster_ptr raster() = 0;
-  //. Move the pointer to the given Pixelcoordinate.
-  virtual void move(Fresco::Coord, Fresco::Coord) = 0;
-  //. FIXME: Missing documentation!
-  virtual void draw() = 0;
-  //. FIXME: Missing documentation!
-  virtual void save() = 0;
-  //. FIXME: Missing documentation!
-  virtual void restore() = 0;
-  //. FIXME: Missing documentation!
-  virtual bool intersects(Fresco::Coord, Fresco::Coord,
-			  Fresco::Coord, Fresco::Coord) = 0;
-};
+} // namespace
 
 #endif

Index: ControllerImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ControllerImpl.hh,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- ControllerImpl.hh	18 Dec 2002 06:00:06 -0000	1.25
+++ ControllerImpl.hh	29 Dec 2003 08:03:18 -0000	1.26
@@ -34,77 +34,92 @@
 #include <Berlin/RefCountVar.hh>
 #include <vector>
 
-class ControllerImpl : public virtual POA_Fresco::Controller,
-                       public MonoGraphic,
-                       public SubjectImpl
+namespace Berlin
 {
-  typedef std::vector<RefCount_var<Fresco::Controller> > clist_t;
-  class Iterator;
-  friend class Iterator;
-public:
-  ControllerImpl(bool);
-  virtual ~ControllerImpl();
-  virtual void deactivate();
 
-  virtual void traverse(Fresco::Traversal_ptr);
-  virtual void draw(Fresco::DrawTraversal_ptr);
-  virtual void pick(Fresco::PickTraversal_ptr);
+  class ControllerImpl : public virtual POA_Fresco::Controller,
+			 public MonoGraphic,
+			 public SubjectImpl
+  {
+      typedef std::vector<RefCount_var<Fresco::Controller> > clist_t;
+      class Iterator;
+      friend class Iterator;
+    public:
+      ControllerImpl(bool);
+      virtual ~ControllerImpl();
+      virtual void deactivate();
+      
+      virtual void traverse(Fresco::Traversal_ptr);
+      virtual void draw(Fresco::DrawTraversal_ptr);
+      virtual void pick(Fresco::PickTraversal_ptr);
 
-  virtual void append_controller(Fresco::Controller_ptr);
-  virtual void prepend_controller(Fresco::Controller_ptr);
-  virtual void remove_controller(Fresco::Controller_ptr);
-  virtual void set_parent_controller(Fresco::Controller_ptr);
-  virtual void remove_parent_controller();
+      virtual void append_controller(Fresco::Controller_ptr);
+      virtual void prepend_controller(Fresco::Controller_ptr);
+      virtual void remove_controller(Fresco::Controller_ptr);
+      virtual void set_parent_controller(Fresco::Controller_ptr);
+      virtual void remove_parent_controller();
 
-  virtual Fresco::Controller_ptr parent_controller();
-  virtual Fresco::ControllerIterator_ptr first_child_controller();
-  virtual Fresco::ControllerIterator_ptr last_child_controller();
+      virtual Fresco::Controller_ptr parent_controller();
+      virtual Fresco::ControllerIterator_ptr first_child_controller();
+      virtual Fresco::ControllerIterator_ptr last_child_controller();
 
-  virtual CORBA::Boolean request_focus(Fresco::Controller_ptr, Fresco::Input::Device);
-  virtual CORBA::Boolean receive_focus(Fresco::Focus_ptr);
-  virtual void lose_focus(Fresco::Input::Device);
+      virtual CORBA::Boolean request_focus(Fresco::Controller_ptr,
+					   Fresco::Input::Device);
+      virtual CORBA::Boolean receive_focus(Fresco::Focus_ptr);
+      virtual void lose_focus(Fresco::Input::Device);
+      
+      virtual CORBA::Boolean first_focus(Fresco::Input::Device);
+      virtual CORBA::Boolean last_focus(Fresco::Input::Device);
+      virtual CORBA::Boolean next_focus(Fresco::Input::Device);
+      virtual CORBA::Boolean prev_focus(Fresco::Input::Device);
+      virtual CORBA::Boolean handle_positional(Fresco::PickTraversal_ptr,
+					       const Fresco::Input::Event &);
+      virtual CORBA::Boolean
+      handle_non_positional(const Fresco::Input::Event &);
 
-  virtual CORBA::Boolean first_focus(Fresco::Input::Device);
-  virtual CORBA::Boolean last_focus(Fresco::Input::Device);
-  virtual CORBA::Boolean next_focus(Fresco::Input::Device);
-  virtual CORBA::Boolean prev_focus(Fresco::Input::Device);
-  virtual CORBA::Boolean handle_positional(Fresco::PickTraversal_ptr, const Fresco::Input::Event &);
-  virtual CORBA::Boolean handle_non_positional(const Fresco::Input::Event &);
+      virtual void set(Fresco::Telltale::Mask);
+      virtual void clear(Fresco::Telltale::Mask);
+      virtual CORBA::Boolean test(Fresco::Telltale::Mask);
+      virtual void modify(Fresco::Telltale::Mask, CORBA::Boolean);
+      virtual void constraint(Fresco::TelltaleConstraint_ptr);
+      virtual Fresco::TelltaleConstraint_ptr constraint();
+    protected:
+      virtual bool inside(Fresco::PickTraversal_ptr);
+      virtual void move(Fresco::PickTraversal_ptr,
+			const Fresco::Input::Event &);
+      virtual void press(Fresco::PickTraversal_ptr,
+			 const Fresco::Input::Event &);
+      virtual void drag(Fresco::PickTraversal_ptr,
+			const Fresco::Input::Event &);
+      virtual void release(Fresco::PickTraversal_ptr,
+			   const Fresco::Input::Event &);
+      virtual void double_click(Fresco::PickTraversal_ptr,
+				const Fresco::Input::Event &);
+      virtual void key_press(const Fresco::Input::Event &);
+      virtual void key_release(const Fresco::Input::Event &);
+      virtual void other(const Fresco::Input::Event &);
+      void grab(Fresco::PickTraversal_ptr);
+      void ungrab(Fresco::PickTraversal_ptr);
+      bool grabbed(Fresco::Input::Device d) { return my_grabs & (1 << d); }
+      void set_focus(Fresco::Input::Device d)
+      { my_focus |= 1 << d; update_state(); }
+      void clear_focus(Fresco::Input::Device d)
+      { my_focus &= ~(1 << d); update_state(); }
+      bool have_focus(Fresco::Input::Device d) { return my_focus & (1 << d); }
+      virtual void update_state();
+    private:
+      Fresco::Controller_var         my_parent;
+      clist_t                        my_children;
+      CORBA::ULong                   my_telltale;
+      CORBA::ULong                   my_focus;
+      CORBA::ULong                   my_grabs;
+      bool                           my_transparent;
+      Fresco::TelltaleConstraint_var my_constraint;
+      Prague::Mutex                  my_pmutex; // for the parent link
+      Prague::Mutex                  my_cmutex; // for the children links
+      Prague::Mutex                  my_mutex;  // for the state
+  };
 
-  virtual void set(Fresco::Telltale::Mask);
-  virtual void clear(Fresco::Telltale::Mask);
-  virtual CORBA::Boolean test(Fresco::Telltale::Mask);
-  virtual void modify(Fresco::Telltale::Mask, CORBA::Boolean);
-  virtual void constraint(Fresco::TelltaleConstraint_ptr);
-  virtual Fresco::TelltaleConstraint_ptr constraint();
-protected:
-  virtual bool inside(Fresco::PickTraversal_ptr);
-  virtual void move(Fresco::PickTraversal_ptr, const Fresco::Input::Event &);
-  virtual void press(Fresco::PickTraversal_ptr, const Fresco::Input::Event &);
-  virtual void drag(Fresco::PickTraversal_ptr, const Fresco::Input::Event &);
-  virtual void release(Fresco::PickTraversal_ptr, const Fresco::Input::Event &);
-  virtual void double_click(Fresco::PickTraversal_ptr, const Fresco::Input::Event &);
-  virtual void key_press(const Fresco::Input::Event &);
-  virtual void key_release(const Fresco::Input::Event &);
-  virtual void other(const Fresco::Input::Event &);
-  void grab(Fresco::PickTraversal_ptr);
-  void ungrab(Fresco::PickTraversal_ptr);
-  bool grabbed(Fresco::Input::Device d) { return my_grabs & (1 << d);}
-  void set_focus(Fresco::Input::Device d) { my_focus |= 1 << d; update_state();}
-  void clear_focus(Fresco::Input::Device d) { my_focus &= ~(1 << d); update_state();}
-  bool have_focus(Fresco::Input::Device d) { return my_focus & (1 << d); }
-  virtual void update_state();
-private:
-  Fresco::Controller_var         my_parent;
-  clist_t                        my_children;
-  CORBA::ULong                   my_telltale;
-  CORBA::ULong                   my_focus;
-  CORBA::ULong                   my_grabs;
-  bool                           my_transparent;
-  Fresco::TelltaleConstraint_var my_constraint;
-  Prague::Mutex                  my_pmutex; // for the parent link
-  Prague::Mutex                  my_cmutex; // for the children links
-  Prague::Mutex                  my_mutex;  // for the state
-};
+} // namespace
 
 #endif 

Index: DebugGraphic.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/DebugGraphic.hh,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- DebugGraphic.hh	29 May 2002 06:49:38 -0000	1.11
+++ DebugGraphic.hh	29 Dec 2003 08:03:18 -0000	1.12
@@ -22,29 +22,40 @@
 #ifndef _Berlin_DebugGraphic_hh
 #define _Berlin_DebugGraphic_hh
 
-#include <Fresco/config.hh>
-#include <Fresco/Region.hh>
-#include "Berlin/MonoGraphic.hh"
+#include <Berlin/MonoGraphic.hh>
 #include <iostream>
 #include <string>
 
-class DebugGraphic : public MonoGraphic
+namespace Berlin
 {
-public:
-  enum Flags {none = 0x0, requests = 0x1, draws = 0x2, picks = 0x4, traversals = 0x7};
-  DebugGraphic(std::ostream &, const std::string &, unsigned int f = traversals);
-  virtual ~DebugGraphic();
 
-  virtual void request(Fresco::Graphic::Requisition &);
-  virtual void traverse(Fresco::Traversal_ptr);
-  virtual void draw(Fresco::DrawTraversal_ptr);
-  virtual void pick(Fresco::PickTraversal_ptr);
-  virtual void allocate(Fresco::Tag, const Fresco::Allocation::Info &);
-private:
-  void         heading(const char *);
-  std::ostream &_os;
-  std::string   _message;
-  unsigned int  _flags;
-};
+  class DebugGraphic : public MonoGraphic
+  {
+    public:
+      enum Flags
+      {
+	  none = 0x0,
+	  requests = 0x1,
+	  draws = 0x2,
+	  picks = 0x4,
+	  traversals = 0x7
+      };
+      DebugGraphic(std::ostream &, const std::string &,
+		   unsigned int f = traversals);
+      virtual ~DebugGraphic();
+      
+      virtual void request(Fresco::Graphic::Requisition &);
+      virtual void traverse(Fresco::Traversal_ptr);
+      virtual void draw(Fresco::DrawTraversal_ptr);
+      virtual void pick(Fresco::PickTraversal_ptr);
+      virtual void allocate(Fresco::Tag, const Fresco::Allocation::Info &);
+    private:
+      void         heading(const char *);
+      std::ostream &my_os;
+      std::string   my_message;
+      unsigned int  my_flags;
+  };
+
+} // namespace
 
 #endif 

Index: DefaultPOA.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/DefaultPOA.hh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- DefaultPOA.hh	29 May 2002 06:49:38 -0000	1.2
+++ DefaultPOA.hh	29 Dec 2003 08:03:18 -0000	1.3
@@ -25,23 +25,28 @@
 #include <Fresco/config.hh>
 #include <Fresco/Types.hh>
 
-//. A mixin class to use a single global POA as the default POA. This is used
-//. by the "shortcut POA" for omniORB so that all objects (using the class)
-//. use the POA with the shortcut policy.
-class DefaultPOA
+namespace Berlin
 {
-public:
-  //. Set the global poa. This should only be called once, in whatever method
-  //. creates the global poa (eg: the main() function creating the shortcut poa
-  //. for omniORB in server/server.cc)
-  static void default_POA(PortableServer::POA_ptr);
 
-  //. Mixin virtual method to return a duplicate ptr to the global poa.
-  virtual PortableServer::POA_ptr _default_POA();
+  //. A mixin class to use a single global POA as the default POA. This
+  //. is used by the "shortcut POA" for omniORB so that all objects (using
+  //. the class) use the POA with the shortcut policy.
+  class DefaultPOA
+  {
+    public:
+      //. Set the global poa. This should only be called once, in whatever
+      //. method creates the global poa (eg: the main() function creating
+      //. the shortcut poa for omniORB in server/server.cc)
+      static void default_POA(PortableServer::POA_ptr);
+      
+      //. Mixin virtual method to return a duplicate ptr to the global poa.
+      virtual PortableServer::POA_ptr _default_POA();
+      
+    private:
+      //. The global poa
+      static PortableServer::POA_var my_default_poa;
+  };
 
-private:
-  //. The global poa
-  static PortableServer::POA_var _default_poa;
-};
+} // namespace
 
 #endif

Index: DesktopImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/DesktopImpl.hh,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- DesktopImpl.hh	23 Jan 2003 00:43:00 -0000	1.13
+++ DesktopImpl.hh	29 Dec 2003 08:03:18 -0000	1.14
@@ -28,32 +28,37 @@
 #include <Berlin/RefCountVar.hh>
 #include <Prague/Sys/Thread.hh>
 
-class WindowImpl;
-
-class DesktopImpl : public virtual POA_Fresco::Desktop,
-                    public ControllerImpl
+namespace Berlin
 {
-public:
-  DesktopImpl(CORBA::ORB_ptr, Layout::Stage_ptr, Prague::Semaphore &);
-  virtual ~DesktopImpl();
-  virtual void body(Fresco::Graphic_ptr);
-  virtual Fresco::Graphic_ptr body();
-  virtual Fresco::Region_ptr bbox();
-  virtual CORBA::Long layers();
-  virtual Layout::StageHandle_ptr layer(Layout::Stage::Index);
-  virtual void lock();
-  virtual void unlock();
-  virtual Layout::StageHandle_ptr insert(Fresco::Graphic_ptr,
-					 const Fresco::Vertex &,
-					 const Fresco::Vertex &,
-					 Layout::Stage::Index);
 
-protected:
-  virtual void key_press(const Fresco::Input::Event &); 
-private:
-  RefCount_var<Layout::Stage> _stage;
-  CORBA::ORB_var              _orb;
-  Prague::Semaphore           & my_shutdown_semaphore;
-};
+  class WindowImpl;
+
+  class DesktopImpl : public virtual POA_Fresco::Desktop,
+		      public ControllerImpl
+  {
+    public:
+      DesktopImpl(CORBA::ORB_ptr, Layout::Stage_ptr, Prague::Semaphore &);
+      virtual ~DesktopImpl();
+      virtual void body(Fresco::Graphic_ptr);
+      virtual Fresco::Graphic_ptr body();
+      virtual Fresco::Region_ptr bbox();
+      virtual CORBA::Long layers();
+      virtual Layout::StageHandle_ptr layer(Layout::Stage::Index);
+      virtual void lock();
+      virtual void unlock();
+      virtual Layout::StageHandle_ptr insert(Fresco::Graphic_ptr,
+					     const Fresco::Vertex &,
+					     const Fresco::Vertex &,
+					     Layout::Stage::Index);
+      
+    protected:
+      virtual void key_press(const Fresco::Input::Event &); 
+    private:
+      RefCount_var<Layout::Stage> my_stage;
+      CORBA::ORB_var              my_orb;
+      Prague::Semaphore           & my_shutdown_semaphore;
+  };
+
+} // namespace
 
 #endif 

Index: DrawTraversalImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/DrawTraversalImpl.hh,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- DrawTraversalImpl.hh	10 Dec 2003 18:12:25 -0000	1.26
+++ DrawTraversalImpl.hh	29 Dec 2003 08:03:18 -0000	1.27
@@ -29,51 +29,56 @@
 #include <Berlin/TraversalImpl.hh>
 #include <vector>
 
-//. The DrawTraversal walks the SceneGraph and 'makes it visible' by
-//. asking the DrawingKit to render the nodes as the Traversal
-//. passes through them.
-class DrawTraversalImpl : public virtual POA_Fresco::DrawTraversal,
-                          public TraversalImpl
+namespace Berlin
 {
-  public:
-    //. Generates a DrawTraversal-Object that will start it the given
-    //. graphic. It will consider anything that is inside or intersects
-    //. the given Region to be damaged. The Region is 'watched', it does
-    //. not matter where it is at this time: It will be reevaluated for
-    //. each traversal. The given Transformation will be used on all
-    //. objects encountered (in addition to all the other transformations
-    //. that might be found during the Traversal). Any graphic in need of
-    //. redrawing will do so using the given DrawingKit.
-    DrawTraversalImpl(Fresco::Graphic_ptr, Fresco::Region_ptr,
-		      Fresco::Transform_ptr, Fresco::DrawingKit_ptr);
-    DrawTraversalImpl(const DrawTraversalImpl &);
-    virtual ~DrawTraversalImpl();
-    
-    //. This method is called by the ScreenManager just before a traversal.
-    //. This means the stack contains a single entry. It is this entry which
-    //. this method modifies...
-    void damage(Fresco::Region_ptr);
-    
-    virtual CORBA::Boolean intersects_allocation();
-    virtual CORBA::Boolean intersects_region(Fresco::Region_ptr);
-    
-    virtual void traverse_child(Fresco::Graphic_ptr, Fresco::Tag,
-				Fresco::Region_ptr, Fresco::Transform_ptr);
-    virtual void visit(Fresco::Graphic_ptr);
-    virtual Fresco::Traversal::order direction();
-    virtual CORBA::Boolean ok();
-    virtual Fresco::DrawingKit_ptr drawing();
+
+  //. The DrawTraversal walks the SceneGraph and 'makes it visible' by
+  //. asking the DrawingKit to render the nodes as the Traversal
+  //. passes through them.
+  class DrawTraversalImpl : public virtual POA_Fresco::DrawTraversal,
+			    public TraversalImpl
+  {
+    public:
+      //. Generates a DrawTraversal-Object that will start it the given
+      //. graphic. It will consider anything that is inside or intersects
+      //. the given Region to be damaged. The Region is 'watched', it does
+      //. not matter where it is at this time: It will be reevaluated for
+      //. each traversal. The given Transformation will be used on all
+      //. objects encountered (in addition to all the other transformations
+      //. that might be found during the Traversal). Any graphic in need of
+      //. redrawing will do so using the given DrawingKit.
+      DrawTraversalImpl(Fresco::Graphic_ptr, Fresco::Region_ptr,
+			Fresco::Transform_ptr, Fresco::DrawingKit_ptr);
+      DrawTraversalImpl(const DrawTraversalImpl &);
+      virtual ~DrawTraversalImpl();
+      
+      //. This method is called by the ScreenManager just before a traversal.
+      //. This means the stack contains a single entry. It is this entry which
+      //. this method modifies...
+      void damage(Fresco::Region_ptr);
+      
+      virtual CORBA::Boolean intersects_allocation();
+      virtual CORBA::Boolean intersects_region(Fresco::Region_ptr);
     
-    //. Saves the DrawingKit's state and sets it to sane values for
-    //. the DrawTraversal.
-    void init();
-    //. Restores the DrawingKit's state prior to the DrawTraversal.
-    void finish();
-  private:
-    Fresco::DrawingKit_var     my_drawing;
-    Fresco::Region_var         my_clipping;
-    Impl_var<TransformImpl>    my_id;
-    Fresco::DrawTraversal_var  my_this;
-};
+      virtual void traverse_child(Fresco::Graphic_ptr, Fresco::Tag,
+				  Fresco::Region_ptr, Fresco::Transform_ptr);
+      virtual void visit(Fresco::Graphic_ptr);
+      virtual Fresco::Traversal::order direction();
+      virtual CORBA::Boolean ok();
+      virtual Fresco::DrawingKit_ptr drawing();
+      
+      //. Saves the DrawingKit's state and sets it to sane values for
+      //. the DrawTraversal.
+      void init();
+      //. Restores the DrawingKit's state prior to the DrawTraversal.
+      void finish();
+    private:
+      Fresco::DrawingKit_var     my_drawing;
+      Fresco::Region_var         my_clipping;
+      Impl_var<TransformImpl>    my_id;
+      Fresco::DrawTraversal_var  my_this;
+  };
+
+} // namespace
 
 #endif 

Index: DrawingKit3DBase.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/DrawingKit3DBase.hh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- DrawingKit3DBase.hh	29 May 2002 06:49:38 -0000	1.2
+++ DrawingKit3DBase.hh	29 Dec 2003 08:03:18 -0000	1.3
@@ -21,8 +21,8 @@
  * MA 02139, USA.
  */
 
-#ifndef _DrawingKit3DBase_hh
-#define _DrawingKit3DBase_hh
+#ifndef _Berlin_DrawingKit3DBase_hh
+#define _Berlin_DrawingKit3DBase_hh
 
 #include <Fresco/config.hh>
 #include <Fresco/DrawingKit3D.hh>
@@ -30,118 +30,121 @@
 
 #include <stack>
 
-class DrawingKit3DBase : public virtual POA_Fresco::DrawingKit3D
+namespace Berlin
 {
- private:
 
-    // Which parts of the state was stored?
-    enum g3dstate {
-	st3d_material,
-	st3d_textures,
-	st3d_tex_mode,
-	st3d_fog_mode,
-	st3d_last 
-    };
-    
-    // 3D drawing state
-    struct Draw3DState {
-	unsigned long flags;
-	MaterialAttr_var saved_material;
-	Rasters_var saved_textures;
-	TextureMode saved_texmode;
-	FoggingMode saved_fogmode;
-	// need lights and lots of other stuff here as well
-    };
+  class DrawingKit3DBase : public virtual POA_Fresco::DrawingKit3D
+  {
+    private:
+
+      // Which parts of the state was stored?
+      enum g3dstate
+      {
+	  st3d_material,
+	  st3d_textures,
+	  st3d_tex_mode,
+	  st3d_fog_mode,
+	  st3d_last 
+      };
     
- public:
+      // 3D drawing state
+      struct Draw3DState
+      {
+	  unsigned long flags;
+	  MaterialAttr_var saved_material;
+	  Rasters_var saved_textures;
+	  TextureMode saved_texmode;
+	  FoggingMode saved_fogmode;
+	  // need lights and lots of other stuff here as well
+      };
     
-    // Save and restore the current drawing state. Some drawing
-    // targets may be able to do this themselves, so we keep these
-    // functions virtual.
-    virtual void saveState() { DrawState3D st; states.push(st); }
-    virtual void restoreState(); 
+    public:
     
-    virtual MaterialAttr material() = 0;
-    virtual void material(const MaterialAttr&) = 0;
-    virtual Rasters* textures() = 0;
-    virtual void textures(const Rasters&) = 0;
-    virtual TextureMode texMode() = 0;
-    virtual void texMode(TextureMode) = 0;
-    virtual FoggingMode fogMode() = 0;
-    virtual void fogMode(FoggingMode) = 0;
-    virtual void drawTriangles(const Vertices &, const Vertices &,
-			       const TexCoords &) = 0;
-    virtual void drawLines(const Vertices &, const TexCoords &) = 0;
-    virtual void drawPoints(const Vertices &) = 0;
-
-    virtual void flush() = 0;
-
- protected:
-
-    // -- Helper functions (should be able to keep these protected)
-    virtual void setMaterial(const MaterialAttr&) = 0;
-    virtual void setTextures(const Rasters&) = 0;
-    virtual void setTexMode(TextureMode) = 0;
-    virtual void setFogMode(FoggingMode) = 0;
-	
- private:
-
-    // Drawing state stack
-    stack<DrawState3D> states;
-};
+      // Save and restore the current drawing state. Some drawing
+      // targets may be able to do this themselves, so we keep these
+      // functions virtual.
+      virtual void saveState() { DrawState3D st; states.push(st); }
+      virtual void restoreState(); 
+      
+      virtual MaterialAttr material() = 0;
+      virtual void material(const MaterialAttr&) = 0;
+      virtual Rasters* textures() = 0;
+      virtual void textures(const Rasters&) = 0;
+      virtual TextureMode texMode() = 0;
+      virtual void texMode(TextureMode) = 0;
+      virtual FoggingMode fogMode() = 0;
+      virtual void fogMode(FoggingMode) = 0;
+      virtual void drawTriangles(const Vertices &, const Vertices &,
+				 const TexCoords &) = 0;
+      virtual void drawLines(const Vertices &, const TexCoords &) = 0;
+      virtual void drawPoints(const Vertices &) = 0;
+      
+      virtual void flush() = 0;
 
-//  -- Inline class methods
+    protected:
 
-inline void DrawingKit3DBase::restoreState()
-{
-    // Sanity check
-    if (states.empty()) return;
+      // -- Helper functions (should be able to keep these protected)
+      virtual void setMaterial(const MaterialAttr&) = 0;
+      virtual void setTextures(const Rasters&) = 0;
+      virtual void setTexMode(TextureMode) = 0;
+      virtual void setFogMode(FoggingMode) = 0;
+      
+    private:
+      
+      // Drawing state stack
+      stack<DrawState3D> my_states;
+  };
 
-    enum g3dstate {
-	st3d_material,
-	st3d_textures,
-	st3d_texmode,
-	st3d_fogmode,
-	st3d_last 
-    };
+  //  -- Inline class methods
 
-    // We need to restore _only_ those states that were changed 
-    DrawState3D prev = states.top();
-    if (prev.flags & (1 << st3d_material)) 
-}
+  inline void DrawingKit3DBase::restoreState()
+  {
+      // Sanity check
+      if (states.empty()) return;
+      
+      // We need to restore _only_ those states that were changed 
+      DrawState3D prev = states.top();
+      if (prev.flags & (1 << st3d_material))
+	  ; // FIXME: Huch? This code is broken!
+  }
 
-// This code is unashamedly lifted from the DrawingKitBase.hh...
+  // This code is unashamedly lifted from the DrawingKitBase.hh...
+  // It states there:
+  // sorry, I hate macros as much as the next guy,
+  // but in this case, templates are simply not cutting it.
 #define REMEMBER(state,ty,val) \
- if (!(states.empty() || states.top().flags & (1 << st_## state)))\
+ if (!(my_states.empty() || my_states.top().flags & (1 << st_## state)))\
 { \
-  DrawState &st = states.top(); \
+  DrawState &st = my_states.top(); \
   ty tmp(val); \
-  st.saved_## state = tmp; \
+  st.saved_## my_state = tmp; \
   st.flags |= (1 << st_## state); \
 }
 
-inline DrawingKit3DBase::material(const MaterialAttr &m)
-{
-    REMEMBER(material, MaterialAttr_var, material());
-    setMaterial(m);
-}
+  inline DrawingKit3DBase::material(const MaterialAttr &m)
+  {
+      REMEMBER(material, MaterialAttr_var, material());
+      setMaterial(m);
+  }
 
-inline DrawingKit3DBase::textures(const Rasters &rs)
-{
-    REMEMBER(textures, Rasters_var, textures());
-    setTextures(rs);
-}
+  inline DrawingKit3DBase::textures(const Rasters &rs)
+  {
+      REMEMBER(textures, Rasters_var, textures());
+      setTextures(rs);
+  }
 
-inline DrawingKit3DBase::texMode(TextureMode tm) 
-{
-    REMEMBER(tex_mode, TextureMode, texMode());
-    setTexMode(tm);
-}
+  inline DrawingKit3DBase::texMode(TextureMode tm) 
+  {
+      REMEMBER(tex_mode, TextureMode, texMode());
+      setTexMode(tm);
+  }
 
-inline DrawingKit3DBase::fogMode(FoggingMode fm)
-{
-    REMEMBER(fog_mode, FoggingMode, fogMode());
-    setFogMode(fm);
-}
+  inline DrawingKit3DBase::fogMode(FoggingMode fm)
+  {
+      REMEMBER(fog_mode, FoggingMode, fogMode());
+      setFogMode(fm);
+  }
+  
+} // namespace
 
 #endif /* DrawingKit3DBase.hh */

Index: DrawingKitBase.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/DrawingKitBase.hh,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- DrawingKitBase.hh	29 May 2002 06:49:38 -0000	1.28
+++ DrawingKitBase.hh	29 Dec 2003 08:03:18 -0000	1.29
@@ -21,8 +21,8 @@
  * MA 02139, USA.
  */
 
-#ifndef _DrawingKitBase_hh
-#define _DrawingKitBase_hh
+#ifndef _Berlin_DrawingKitBase_hh
+#define _Berlin_DrawingKitBase_hh
 
 #include <Prague/Sys/Tracer.hh>
 #include <Fresco/config.hh>
@@ -31,274 +31,298 @@
 #include <Fresco/Region.hh>
 #include <Fresco/Transform.hh>
 #include <Fresco/Raster.hh>
-/*
- * bitset is buggy. Sorry, try again later...
- */
+// bitset is buggy. Sorry, try again later...
 // #include <bitset>
 #include <stack>
 
-class DrawingKitBase : public virtual POA_Fresco::DrawingKit
+namespace Berlin
 {
-  enum gstate
-    {
-      st_trafo, 
-      st_clip,
-      st_fg_color,
-      st_lt_color, 
-      st_point_size, 
-      st_line_width,
-      st_line_end_style, 
-      st_surface_fill_style,
-      st_texture, 
-      st_font_size, 
-      st_font_weight,
-      st_font_family, 
-      st_font_subfamily,
-      st_font_fullname,
-      st_font_style, 
-      st_font_attr,
-      st_last
-    };
-  
-  struct DrawState
-  {
-    DrawState() : flags(0) {}
-    // bitset<st_last> flags;
-    unsigned long flags;
-    Fresco::Transform_var saved_trafo;
-    Fresco::Region_var saved_clip;
-    Fresco::Color saved_fg_color;
-    Fresco::Color saved_lt_color;
-    Fresco::Coord saved_point_size;
-    Fresco::Coord saved_line_width;
-    Fresco::DrawingKit::Endstyle saved_line_end_style;
-    Fresco::DrawingKit::Fillstyle saved_surface_fill_style;
-    Fresco::Raster_var saved_texture;
-    CORBA::ULong saved_font_size;
-    CORBA::ULong saved_font_weight;
-    Fresco::Unistring_var saved_font_family;
-    Fresco::Unistring_var saved_font_subfamily;
-    Fresco::Unistring_var saved_font_fullname;
-    Fresco::Unistring_var saved_font_style;
-    // something here...
-    // for holding NVPair saved_font_attr;
-  };
 
-public:
-  virtual void save()
+  class DrawingKitBase : public virtual POA_Fresco::DrawingKit
   {
-    Prague::Trace trace("DrawingKitBase::save");
-    _states.push(DrawState());
-  }
-  virtual void restore();
-
-  //######################################################
-  //############### subclass signatures ##################
-  //######################################################
+      enum gstate
+      {
+	  st_trafo, 
+	  st_clip,
+	  st_fg_color,
+	  st_lt_color, 
+	  st_point_size, 
+	  st_line_width,
+	  st_line_end_style, 
+	  st_surface_fill_style,
+	  st_texture, 
+	  st_font_size, 
+	  st_font_weight,
+	  st_font_family, 
+	  st_font_subfamily,
+	  st_font_fullname,
+	  st_font_style, 
+	  st_font_attr,
+	  st_last
+      };
+  
+      struct DrawState
+      {
+	  DrawState() : flags(0) { }
+	  // bitset<st_last> flags;
+	  unsigned long flags;
+	  Fresco::Transform_var saved_trafo;
+	  Fresco::Region_var saved_clip;
+	  Fresco::Color saved_fg_color;
+	  Fresco::Color saved_lt_color;
+	  Fresco::Coord saved_point_size;
+	  Fresco::Coord saved_line_width;
+	  Fresco::DrawingKit::Endstyle saved_line_end_style;
+	  Fresco::DrawingKit::Fillstyle saved_surface_fill_style;
+	  Fresco::Raster_var saved_texture;
+	  CORBA::ULong saved_font_size;
+	  CORBA::ULong saved_font_weight;
+	  Fresco::Unistring_var saved_font_family;
+	  Fresco::Unistring_var saved_font_subfamily;
+	  Fresco::Unistring_var saved_font_fullname;
+	  Fresco::Unistring_var saved_font_style;
+	  // something here...
+	  // for holding NVPair saved_font_attr;
+      };
 
-  virtual Fresco::Transform_ptr transformation() = 0;
-  virtual void transformation(Fresco::Transform_ptr);
-  virtual Fresco::Region_ptr clipping() = 0;
-  virtual void clipping(Fresco::Region_ptr);
-  virtual Fresco::Color foreground() = 0;
-  virtual void foreground(const Fresco::Color &);
-  virtual Fresco::Color lighting() = 0;
-  virtual void lighting(const Fresco::Color &);
-  virtual Fresco::Coord point_size() = 0;
-  virtual void point_size(Fresco::Coord);
-  virtual Fresco::Coord line_width() = 0;
-  virtual void line_width(Fresco::Coord);
-  virtual Fresco::DrawingKit::Endstyle line_endstyle() = 0;
-  virtual void line_endstyle(Fresco::DrawingKit::Endstyle);
-  virtual Fresco::DrawingKit::Fillstyle surface_fillstyle() = 0;
-  virtual void surface_fillstyle(Fresco::DrawingKit::Fillstyle);
-  virtual Fresco::Raster_ptr texture() = 0;
-  virtual void texture(Fresco::Raster_ptr);
+    public:
+      virtual void save()
+      {
+	  Prague::Trace trace("DrawingKitBase::save");
+	  my_states.push(DrawState());
+      }
+      virtual void restore();
 
-  virtual CORBA::ULong font_size() = 0;
-  virtual void font_size(CORBA::ULong);
-  virtual CORBA::ULong font_weight() = 0;
-  virtual void font_weight(CORBA::ULong);
-  virtual Fresco::Unistring *font_family() = 0;
-  virtual void font_family(const Fresco::Unistring &);
-  virtual Fresco::Unistring *font_subfamily() = 0;
-  virtual void font_subfamily(const Fresco::Unistring &);
-  virtual Fresco::Unistring *font_fullname() = 0;
-  virtual void font_fullname(const Fresco::Unistring &);
-  virtual Fresco::Unistring *font_style() = 0;
-  virtual void font_style(const Fresco::Unistring &);
-  virtual Fresco::DrawingKit::FontMetrics font_metrics() = 0;
-  virtual Fresco::DrawingKit::GlyphMetrics glyph_metrics(Fresco::Unichar) = 0;
-  virtual CORBA::Any *get_font_attribute(const Fresco::Unistring &) = 0;
-  virtual void font_attribute(const Fresco::NVPair &);
+      //######################################################
+      //############### subclass signatures ##################
+      //######################################################
 
-  virtual void init() { }
-  virtual void finish() { }
-  virtual void flush() = 0;
+      virtual Fresco::Transform_ptr transformation() = 0;
+      virtual void transformation(Fresco::Transform_ptr);
+      virtual Fresco::Region_ptr clipping() = 0;
+      virtual void clipping(Fresco::Region_ptr);
+      virtual Fresco::Color foreground() = 0;
+      virtual void foreground(const Fresco::Color &);
+      virtual Fresco::Color lighting() = 0;
+      virtual void lighting(const Fresco::Color &);
+      virtual Fresco::Coord point_size() = 0;
+      virtual void point_size(Fresco::Coord);
+      virtual Fresco::Coord line_width() = 0;
+      virtual void line_width(Fresco::Coord);
+      virtual Fresco::DrawingKit::Endstyle line_endstyle() = 0;
+      virtual void line_endstyle(Fresco::DrawingKit::Endstyle);
+      virtual Fresco::DrawingKit::Fillstyle surface_fillstyle() = 0;
+      virtual void surface_fillstyle(Fresco::DrawingKit::Fillstyle);
+      virtual Fresco::Raster_ptr texture() = 0;
+      virtual void texture(Fresco::Raster_ptr);
+      
+      virtual CORBA::ULong font_size() = 0;
+      virtual void font_size(CORBA::ULong);
+      virtual CORBA::ULong font_weight() = 0;
+      virtual void font_weight(CORBA::ULong);
+      virtual Fresco::Unistring *font_family() = 0;
+      virtual void font_family(const Fresco::Unistring &);
+      virtual Fresco::Unistring *font_subfamily() = 0;
+      virtual void font_subfamily(const Fresco::Unistring &);
+      virtual Fresco::Unistring *font_fullname() = 0;
+      virtual void font_fullname(const Fresco::Unistring &);
+      virtual Fresco::Unistring *font_style() = 0;
+      virtual void font_style(const Fresco::Unistring &);
+      virtual Fresco::DrawingKit::FontMetrics font_metrics() = 0;
+      virtual Fresco::DrawingKit::GlyphMetrics
+      glyph_metrics(Fresco::Unichar) = 0;
+      virtual CORBA::Any *
+      get_font_attribute(const Fresco::Unistring &) = 0;
+      virtual void font_attribute(const Fresco::NVPair &);
 
-  virtual void set_transformation (Fresco::Transform_ptr) = 0;
-  virtual void set_clipping(Fresco::Region_ptr) = 0;
-  virtual void set_foreground(const Fresco::Color &) = 0;
-  virtual void set_lighting(const Fresco::Color &) = 0;
-  virtual void set_point_size(Fresco::Coord) = 0;
-  virtual void set_line_width(Fresco::Coord) = 0;
-  virtual void set_line_endstyle(Fresco::DrawingKit::Endstyle) = 0;
-  virtual void set_surface_fillstyle(Fresco::DrawingKit::Fillstyle) = 0;
-  virtual void set_texture(Fresco::Raster_ptr) = 0;
+      virtual void init() { }
+      virtual void finish() { }
+      virtual void flush() = 0;
 
-  virtual void set_font_size(CORBA::ULong) = 0;
-  virtual void set_font_weight(CORBA::ULong) = 0;
-  virtual void set_font_family(const Fresco::Unistring &) = 0;
-  virtual void set_font_subfamily(const Fresco::Unistring &) = 0;
-  virtual void set_font_fullname(const Fresco::Unistring &) = 0;
-  virtual void set_font_style(const Fresco::Unistring &) = 0;
-  virtual void set_font_attribute(const Fresco::NVPair &) = 0;
+      virtual void set_transformation (Fresco::Transform_ptr) = 0;
+      virtual void set_clipping(Fresco::Region_ptr) = 0;
+      virtual void set_foreground(const Fresco::Color &) = 0;
+      virtual void set_lighting(const Fresco::Color &) = 0;
+      virtual void set_point_size(Fresco::Coord) = 0;
+      virtual void set_line_width(Fresco::Coord) = 0;
+      virtual void set_line_endstyle(Fresco::DrawingKit::Endstyle) = 0;
+      virtual void
+      set_surface_fillstyle(Fresco::DrawingKit::Fillstyle) = 0;
+      virtual void set_texture(Fresco::Raster_ptr) = 0;
 
-private:
-  std::stack<DrawState> _states;
-};
+      virtual void set_font_size(CORBA::ULong) = 0;
+      virtual void set_font_weight(CORBA::ULong) = 0;
+      virtual void set_font_family(const Fresco::Unistring &) = 0;
+      virtual void set_font_subfamily(const Fresco::Unistring &) = 0;
+      virtual void set_font_fullname(const Fresco::Unistring &) = 0;
+      virtual void set_font_style(const Fresco::Unistring &) = 0;
+      virtual void set_font_attribute(const Fresco::NVPair &) = 0;
 
-inline void DrawingKitBase::restore()
-{
-  Prague::Trace trace("DrawingKitBase::restore");
-  if (_states.empty()) return; // no state to restore
-  DrawState &prev = _states.top();
-  if(prev.flags & (1 << st_trafo))              set_transformation(prev.saved_trafo);
-  if(prev.flags & (1 << st_clip))               set_clipping(prev.saved_clip);
-  if(prev.flags & (1 << st_fg_color))           set_foreground(prev.saved_fg_color);
-  if(prev.flags & (1 << st_lt_color))           set_lighting(prev.saved_lt_color);
-  if(prev.flags & (1 << st_point_size))         set_point_size(prev.saved_point_size);
-  if(prev.flags & (1 << st_line_width))         set_line_width(prev.saved_line_width);
-  if(prev.flags & (1 << st_line_end_style))     set_line_endstyle(prev.saved_line_end_style);
-  if(prev.flags & (1 << st_surface_fill_style)) set_surface_fillstyle(prev.saved_surface_fill_style);
-  if(prev.flags & (1 << st_texture))            set_texture(prev.saved_texture);
-  if(prev.flags & (1 << st_font_size))          set_font_size(prev.saved_font_size);
-  if(prev.flags & (1 << st_font_weight))        set_font_weight(prev.saved_font_weight);
-  if(prev.flags & (1 << st_font_family))        set_font_family((Fresco::Unistring &)prev.saved_font_family);
-  if(prev.flags & (1 << st_font_subfamily))     set_font_subfamily((Fresco::Unistring &)prev.saved_font_subfamily);
-  if(prev.flags & (1 << st_font_fullname))      set_font_fullname((Fresco::Unistring &)prev.saved_font_fullname);
-  if(prev.flags & (1 << st_font_style))         set_font_style((Fresco::Unistring &)prev.saved_font_style);
-    //    if(prev.flags[st_font_attr]) {
-    //       for (unsigned long i = 0; i < prev.saved_font_attr.length())
-    // 	     setFontAttr(prev.saved_font_attr[i]);
-    //    }
-  _states.pop();
-}
+    private:
+      std::stack<DrawState> my_states;
+  };
+  
+  inline void DrawingKitBase::restore()
+  {
+      Prague::Trace trace("DrawingKitBase::restore");
+      if (my_states.empty()) return; // no state to restore
+      DrawState &prev = my_states.top();
+      if(prev.flags & (1 << st_trafo))
+	  set_transformation(prev.saved_trafo);
+      if(prev.flags & (1 << st_clip))
+	  set_clipping(prev.saved_clip);
+      if(prev.flags & (1 << st_fg_color)) 
+          set_foreground(prev.saved_fg_color);
+      if(prev.flags & (1 << st_lt_color))
+	  set_lighting(prev.saved_lt_color);
+      if(prev.flags & (1 << st_point_size))
+	  set_point_size(prev.saved_point_size);
+      if(prev.flags & (1 << st_line_width)) 
+	  set_line_width(prev.saved_line_width);
+      if(prev.flags & (1 << st_line_end_style))
+	  set_line_endstyle(prev.saved_line_end_style);
+      if(prev.flags & (1 << st_surface_fill_style))
+	  set_surface_fillstyle(prev.saved_surface_fill_style);
+      if(prev.flags & (1 << st_texture))
+	  set_texture(prev.saved_texture);
+      if(prev.flags & (1 << st_font_size)) 
+	  set_font_size(prev.saved_font_size);
+      if(prev.flags & (1 << st_font_weight)) 
+	  set_font_weight(prev.saved_font_weight);
+      if(prev.flags & (1 << st_font_family))
+	  set_font_family((Fresco::Unistring &)prev.saved_font_family);
+      if(prev.flags & (1 << st_font_subfamily))
+	  set_font_subfamily((Fresco::Unistring &)
+			     prev.saved_font_subfamily);
+      if(prev.flags & (1 << st_font_fullname))
+	  set_font_fullname((Fresco::Unistring &)
+			    prev.saved_font_fullname);
+      if(prev.flags & (1 << st_font_style))
+	  set_font_style((Fresco::Unistring &)prev.saved_font_style);
+//      if(prev.flags[st_font_attr])
+//      {
+//          for (unsigned long i = 0; i < prev.saved_font_attr.length())
+// 	        setFontAttr(prev.saved_font_attr[i]);
+//      }
+      my_states.pop();
+  }
 
-//########################################################
-//############### public setter methods ##################
-//########################################################
+  //########################################################
+  //############### public setter methods ##################
+  //########################################################
 
 // sorry, I hate macros as much as the next guy,
 // but in this case, templates are simply not cutting it.
-
 #define REMEMBER(state,ty,val) \
- if (!(_states.empty() || _states.top().flags & (1 << st_## state)))\
+ if (!(my_states.empty() || my_states.top().flags & (1 << st_## state)))\
 { \
-  DrawState &st = _states.top(); \
+  DrawState &st = my_states.top(); \
   ty tmp(val); \
   st.saved_## state = tmp; \
   st.flags |= (1 << st_## state); \
 }
 
-inline void DrawingKitBase::transformation(Fresco::Transform_ptr t)
-{
-  Prague::Trace trace("DrawingKitBase::transformation");
-  REMEMBER(trafo, Fresco::Transform_var,transformation());
-  set_transformation(t);
-}
-
-inline void DrawingKitBase::clipping(Fresco::Region_ptr c)
-{
-  REMEMBER(clip, Fresco::Region_var, clipping());
-  set_clipping(c);
-}
-
-inline void DrawingKitBase::foreground(const Fresco::Color &c)
-{
-  REMEMBER(fg_color, Fresco::Color, foreground())
-  set_foreground(c);
-}
+  inline void DrawingKitBase::transformation(Fresco::Transform_ptr t)
+  {
+      Prague::Trace trace("DrawingKitBase::transformation");
+      REMEMBER(trafo, Fresco::Transform_var,transformation());
+      set_transformation(t);
+  }
 
-inline void DrawingKitBase::lighting(const Fresco::Color &c)
-{
-  REMEMBER(lt_color, Fresco::Color, lighting())
-  set_lighting(c);
-}
+  inline void DrawingKitBase::clipping(Fresco::Region_ptr c)
+  {
+      REMEMBER(clip, Fresco::Region_var, clipping());
+      set_clipping(c);
+  }
+  
+  inline void DrawingKitBase::foreground(const Fresco::Color &c)
+  {
+      REMEMBER(fg_color, Fresco::Color, foreground())
+	  set_foreground(c);
+  }
 
-inline void DrawingKitBase::point_size(Fresco::Coord s)
-{
-  REMEMBER(point_size, Fresco::Coord, point_size());
-  set_point_size(s);
-}
+  inline void DrawingKitBase::lighting(const Fresco::Color &c)
+  {
+      REMEMBER(lt_color, Fresco::Color, lighting())
+	  set_lighting(c);
+  }
 
-inline void DrawingKitBase::line_width(Fresco::Coord w)
-{
-  REMEMBER(line_width, Fresco::Coord, line_width());
-  set_line_width(w);
-}
+  inline void DrawingKitBase::point_size(Fresco::Coord s)
+  {
+      REMEMBER(point_size, Fresco::Coord, point_size());
+      set_point_size(s);
+  }
 
-inline void DrawingKitBase::line_endstyle(Fresco::DrawingKit::Endstyle s)
-{
-  REMEMBER(line_end_style, Fresco::DrawingKit::Endstyle, line_endstyle());
-  set_line_endstyle(s);
-}
+  inline void DrawingKitBase::line_width(Fresco::Coord w)
+  {
+      REMEMBER(line_width, Fresco::Coord, line_width());
+      set_line_width(w);
+  }
 
-inline void DrawingKitBase::surface_fillstyle(Fresco::DrawingKit::Fillstyle s)
-{
-  REMEMBER(surface_fill_style, Fresco::DrawingKit::Fillstyle, surface_fillstyle());
-  set_surface_fillstyle(s);
-}
+  inline void DrawingKitBase::line_endstyle(Fresco::DrawingKit::Endstyle s)
+  {
+      REMEMBER(line_end_style, Fresco::DrawingKit::Endstyle, line_endstyle());
+      set_line_endstyle(s);
+  }
 
-inline void DrawingKitBase::texture(Fresco::Raster_ptr t)
-{
-  REMEMBER(texture, Fresco::Raster_var, texture());
-  set_texture(t);
-}
+  inline void
+  DrawingKitBase::surface_fillstyle(Fresco::DrawingKit::Fillstyle s)
+  {
+      REMEMBER(surface_fill_style, Fresco::DrawingKit::Fillstyle, surface_fillstyle());
+      set_surface_fillstyle(s);
+  }
+  
+  inline void DrawingKitBase::texture(Fresco::Raster_ptr t)
+  {
+      REMEMBER(texture, Fresco::Raster_var, texture());
+      set_texture(t);
+  }
 
   ////////
   // text
   ////////
 
-inline void DrawingKitBase::font_size(CORBA::ULong s)
-{
-  REMEMBER(font_size,CORBA::ULong, font_size());
-  set_font_size(s);
-}
+  inline void DrawingKitBase::font_size(CORBA::ULong s)
+  {
+      REMEMBER(font_size,CORBA::ULong, font_size());
+      set_font_size(s);
+  }
 
-inline void DrawingKitBase::font_weight(CORBA::ULong w)
-{
-  REMEMBER(font_weight,CORBA::ULong, font_weight());
-  set_font_weight(w);
-}
+  inline void DrawingKitBase::font_weight(CORBA::ULong w)
+  {
+      REMEMBER(font_weight,CORBA::ULong, font_weight());
+      set_font_weight(w);
+  }
 
-inline void DrawingKitBase::font_family(const Fresco::Unistring &f)
-{
-  REMEMBER(font_family, Fresco::Unistring_var, font_family());
-  set_font_family(f);
-}
+  inline void DrawingKitBase::font_family(const Fresco::Unistring &f)
+  {
+      REMEMBER(font_family, Fresco::Unistring_var, font_family());
+      set_font_family(f);
+  }
 
-inline void DrawingKitBase::font_subfamily(const Fresco::Unistring &f)
-{
-  REMEMBER(font_subfamily, Fresco::Unistring_var, font_subfamily());
-  set_font_subfamily(f);
-}
+  inline void DrawingKitBase::font_subfamily(const Fresco::Unistring &f)
+  {
+      REMEMBER(font_subfamily, Fresco::Unistring_var, font_subfamily());
+      set_font_subfamily(f);
+  }
 
-inline void DrawingKitBase::font_fullname(const Fresco::Unistring &f)
-{
-  REMEMBER(font_fullname, Fresco::Unistring_var, font_fullname());
-  set_font_fullname(f);
-}
+  inline void DrawingKitBase::font_fullname(const Fresco::Unistring &f)
+  {
+      REMEMBER(font_fullname, Fresco::Unistring_var, font_fullname());
+      set_font_fullname(f);
+  }
 
-inline void DrawingKitBase::font_style(const Fresco::Unistring &s)
-{
-  REMEMBER(font_style, Fresco::Unistring_var, font_style());
-  set_font_style(s);
-}
+  inline void DrawingKitBase::font_style(const Fresco::Unistring &s)
+  {
+      REMEMBER(font_style, Fresco::Unistring_var, font_style());
+      set_font_style(s);
+  }
+  
+  inline void DrawingKitBase::font_attribute(const Fresco::NVPair &nvp)
+  {
+      // FIXME: fill this in.. it's not _too_ hard
+  }
 
-inline void DrawingKitBase::font_attribute(const Fresco::NVPair &nvp)
-{
-  // !FIXME! fill this in.. it's not _too_ hard
-}
+} // namespace
 
 #endif

Index: Event.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Event.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Event.hh	29 May 2002 06:49:38 -0000	1.7
+++ Event.hh	29 Dec 2003 08:03:18 -0000	1.8
@@ -19,26 +19,31 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
+#ifndef _Berlin_Event_hh
+#define _Berlin_Event_hh
+
 #include <Fresco/config.hh>
 #include <Fresco/Input.hh>
 
 namespace Fresco
 {
-namespace Input
-{
+  namespace Input
+  {
 
-inline int get_position(const Event &event, Input::Position &position)
-{
-  Input::Device device = event[0].dev;
-  for (size_t i = 0; i != event.length(); i++)
-    if (event[i].dev != device) return -1;
-    else if (event[i].attr._d() == Input::positional)
-      {
-	position = event[i].attr.location();
-	return i;
-      }
-  return -1;
-}
+    inline int get_position(const Event &event, Input::Position &position)
+    {
+	Input::Device device = event[0].dev;
+	for (size_t i = 0; i != event.length(); i++)
+	    if (event[i].dev != device) return -1;
+	    else if (event[i].attr._d() == Input::positional)
+	    {
+		position = event[i].attr.location();
+		return i;
+	    }
+	return -1;
+    }
 
-};
-};
+  } // namespace
+} // namespace
+
+#endif

Index: EventManager.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/EventManager.hh,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- EventManager.hh	12 Jan 2003 02:25:08 -0000	1.22
+++ EventManager.hh	29 Dec 2003 08:03:18 -0000	1.23
@@ -30,28 +30,33 @@
 #include <Berlin/ImplVar.hh>
 #include <vector>
 
-//. The Eventmanager keeps a list of Focus-Objects assoziated with Inputdevices.
-//. It queries these Devices through the Console and assoziates them to
-//. the Focus-Objects.
-
-//. For now we keep a list of global devices and a event descriptor map.
-//. Device 0 is the keyboard, device 1 the mouse.
-class EventManager
+namespace Berlin
 {
-  typedef std::vector<FocusImpl *> flist_t;
-public:
-  EventManager(Fresco::Controller_ptr, Fresco::Region_ptr);
-  ~EventManager();
-  bool request_focus(Fresco::Controller_ptr, Fresco::Input::Device);
-  //. This method is polled by the ScreenManager. It queries the Console
-  //. for new events and distributes them to the matching focus.
-  void next_event();
-  void restore(Fresco::Region_ptr);
-  void damage(Fresco::Region_ptr);
-private:
-  static void activate(FocusImpl *);
-  static void deactivate(FocusImpl *);
-  flist_t _foci;
-};
+
+  //. The Eventmanager keeps a list of Focus-Objects assoziated with
+  //. Inputdevices. It queries these Devices through the Console and
+  //. assoziates them to the Focus-Objects.
+
+  //. For now we keep a list of global devices and a event descriptor map.
+  //. Device 0 is the keyboard, device 1 the mouse.
+  class EventManager
+  {
+      typedef std::vector<FocusImpl *> flist_t;
+    public:
+      EventManager(Fresco::Controller_ptr, Fresco::Region_ptr);
+      ~EventManager();
+      bool request_focus(Fresco::Controller_ptr, Fresco::Input::Device);
+      //. This method is polled by the ScreenManager. It queries the Console
+      //. for new events and distributes them to the matching focus.
+      void next_event();
+      void restore(Fresco::Region_ptr);
+      void damage(Fresco::Region_ptr);
+    private:
+      static void activate(FocusImpl *);
+      static void deactivate(FocusImpl *);
+      flist_t my_foci;
+  };
+
+} // namespace
 
 #endif 

Index: FilterImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/FilterImpl.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- FilterImpl.hh	29 May 2002 06:49:38 -0000	1.5
+++ FilterImpl.hh	29 Dec 2003 08:03:18 -0000	1.6
@@ -26,18 +26,24 @@
 #include <Fresco/Input.hh>
 #include <Fresco/Command.hh>
 
-class Accelerator : public virtual POA_Fresco::Input::Filter,
-                    public virtual PortableServer::RefCountServantBase
+namespace Berlin
 {
- public:
-  Accelerator(Fresco::Input::Device, const Fresco::Input::Toggle &, Fresco::Input::Bitset, Fresco::Command_ptr);
-  virtual ~Accelerator() {}
-  virtual CORBA::Boolean handle(const Fresco::Input::Event &);
- private:
-  const Fresco::Input::Device device;
-  const Fresco::Input::Toggle toggle;
-  const Fresco::Input::Bitset modifier;
-  const Fresco::Command_var command;
-};
+
+  class Accelerator : public virtual POA_Fresco::Input::Filter,
+		      public virtual PortableServer::RefCountServantBase
+  {
+    public:
+      Accelerator(Fresco::Input::Device, const Fresco::Input::Toggle &,
+		  Fresco::Input::Bitset, Fresco::Command_ptr);
+      virtual ~Accelerator() { }
+      virtual CORBA::Boolean handle(const Fresco::Input::Event &);
+    private:
+      const Fresco::Input::Device my_device;
+      const Fresco::Input::Toggle my_toggle;
+      const Fresco::Input::Bitset my_modifier;
+      const Fresco::Command_var my_command;
+  };
+
+} // namespace
 
 #endif 

Index: FocusImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/FocusImpl.hh,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- FocusImpl.hh	29 May 2002 06:49:38 -0000	1.18
+++ FocusImpl.hh	29 Dec 2003 08:03:18 -0000	1.19
@@ -26,28 +26,32 @@
 #include <Fresco/Region.hh>
 #include <Fresco/Focus.hh>
 #include <Berlin/DefaultPOA.hh>
-#include <vector>
-#include <stack>
 
-class FocusImpl : public virtual POA_Fresco::Focus,
-                  public virtual PortableServer::RefCountServantBase,
-                  private DefaultPOA
+namespace Berlin
 {
-  friend class EventManager;
-public:
-  FocusImpl(Fresco::Input::Device device) : _device(device) {}
-  virtual ~FocusImpl() {}
-  virtual Fresco::Input::Device device() { return _device;}
 
-  virtual bool request(Fresco::Controller_ptr) = 0;
-  virtual void restore(Fresco::Region_ptr) = 0;
-  virtual void damage(Fresco::Region_ptr) = 0;
-  virtual void dispatch(Fresco::Input::Event &) = 0;
-  PortableServer::POA_ptr _default_POA() { return DefaultPOA::_default_POA();}
-protected:
-  virtual void activate_composite() {}
-private:
-  const Fresco::Input::Device _device;
-};
+  class FocusImpl : public virtual POA_Fresco::Focus,
+		    public virtual PortableServer::RefCountServantBase,
+		    private DefaultPOA
+  {
+      friend class EventManager;
+    public:
+      FocusImpl(Fresco::Input::Device device) : my_device(device) { }
+      virtual ~FocusImpl() { }
+      virtual Fresco::Input::Device device() { return my_device; }
+      
+      virtual bool request(Fresco::Controller_ptr) = 0;
+      virtual void restore(Fresco::Region_ptr) = 0;
+      virtual void damage(Fresco::Region_ptr) = 0;
+      virtual void dispatch(Fresco::Input::Event &) = 0;
+      PortableServer::POA_ptr _default_POA()
+      { return DefaultPOA::_default_POA(); }
+    protected:
+      virtual void activate_composite() { }
+    private:
+      const Fresco::Input::Device my_device;
+  };
+
+} // namespace
 
 #endif

Index: GapBuffer.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/GapBuffer.hh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- GapBuffer.hh	2 Jun 2002 23:42:15 -0000	1.10
+++ GapBuffer.hh	29 Dec 2003 08:03:18 -0000	1.11
@@ -19,151 +19,164 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _GapBuffer_hh
-#define _GapBuffer_hh
+#ifndef _Berlin_GapBuffer_hh
+#define _Berlin_GapBuffer_hh
 
 #include <vector>
 
-/*
- * the design of a gap buffer should follow the typical behavior
- * when editing text. Editing text has two parts: modifying it
- * and simply browsing it. The text contains a 'cursor', which indicates
- * the actual position. When in editing mode, we have to take care to
- * use smart memory management. For this purpose we introduce a little
- * memory gap into the string where new characters can be inserted,
- * so not on every insert() all the following characters have to be moved
- *
- * a gap buffer is layed out like this:
- *   
- *   |***********************..........**********|
- *   ^                      ^         ^          ^
- *  begin()                gbegin()  gend()     end()
- *
- * the following (in)equalities should always hold:
- * 
- * gend() > gbegin()
- * gend() - gbegin() <= gmaxsize()
- * end() >= gend()
- * 
- */
-template <class T, short gapsize>
-class GapBuffer : private std::vector<T>
+namespace Berlin
 {
-  typedef std::vector<T> rep_type;
-  typedef typename rep_type::value_type value_type;
-  typedef typename rep_type::iterator iterator;
-  typedef unsigned int size_type;
-  iterator gbegin() { return begin() + _gapbegin;}
-  iterator gend() { return begin() + _gapend;}
-  iterator cursor() { return begin() + _cursor;}
-  void newgap()
-  {
-    rep_type::insert(gbegin(), gapsize, value_type(0));
-    _gapend += gapsize;
-  }
-  void movegap(int d)
+
+  /*
+   * the design of a gap buffer should follow the typical behavior
+   * when editing text. Editing text has two parts: modifying it
+   * and simply browsing it. The text contains a 'cursor', which indicates
+   * the actual position. When in editing mode, we have to take care to
+   * use smart memory management. For this purpose we introduce a little
+   * memory gap into the string where new characters can be inserted,
+   * so not on every insert() all the following characters have to be moved
+   *
+   * a gap buffer is layed out like this:
+   *   
+   *   |***********************..........**********|
+   *   ^                      ^         ^          ^
+   *  begin()                gbegin()  gend()     end()
+   *
+   * the following (in)equalities should always hold:
+   * 
+   * gend() > gbegin()
+   * gend() - gbegin() <= gmaxsize()
+   * end() >= gend()
+   * 
+   */
+  template <class T, short gapsize>
+  class GapBuffer : private std::vector<T>
   {
-    if (d > 0)
+      typedef std::vector<T> rep_type;
+      typedef typename rep_type::value_type value_type;
+      typedef typename rep_type::iterator iterator;
+      typedef unsigned int size_type;
+      iterator gbegin() { return begin() + my_gapbegin;}
+      iterator gend() { return begin() + my_gapend;}
+      iterator cursor() { return begin() + my_cursor;}
+      void newgap()
       {
-	if (gend() + d > end()) rep_type::insert(end(), size_type(gend() + d - end()), value_type(0));
-	copy(gend(), gend() + d, gbegin());
+	  rep_type::insert(gbegin(), gapsize, value_type(0));
+	  my_gapend += gapsize;
       }
-    else
-      copy(rep_type::reverse_iterator(gbegin()),
-	   rep_type::reverse_iterator(gbegin() + d),
-	   rep_type::reverse_iterator(gend()));
-    _gapbegin += d, _gapend += d;
-  }
-  size_type gap() { return _gapend - _gapbegin; }
-  void editing() { size_type d = _cursor - _gapbegin; if (d != 0) movegap(d); }
-  void compact() { size_type d = end() - gend(); if (d > 0) movegap(d); }
-public:
-  GapBuffer() : _cursor(0), _gapbegin(0), _gapend(0) {}
-  size_type size() { compact(); return gbegin() - begin(); }
-  void forward()
-    {
-      if (_cursor == _gapbegin && gend() != end()) _cursor += gap();
-      else if (cursor() < end()) _cursor++;
-    }
-  void backward()
-    {
-      if (_cursor == _gapend) _cursor -= gap();
-      else if (cursor() > begin()) _cursor--;
-    }
-  void shift(size_type d)
-    {
-      size_type tmp = _cursor + d;
-      if ((_cursor > _gapend && tmp > _gapend) || (_cursor <= _gapbegin && tmp <= _gapbegin)) _cursor = tmp;
-      else if (d < 0) _cursor += d - gap();
-      else _cursor += d + gap();
-    }
-  size_type position() { return _cursor > _gapend ? _cursor - gap() : _cursor;}
-  void position(size_type p) { shift(p - _cursor);}
-  void insert(value_type u)
-    {
-      editing();
-      if (!gap()) newgap();
-      *cursor() = u;
-      _cursor++, _gapbegin++;
-    }
-  void insert(value_type *u, size_type n)
-    {
-      editing();
-      rep_type::insert(cursor(), u, u + n);
-      _cursor += n, _gapbegin += n, _gapend += n;
-    }
-  void remove_backward(size_type n)
-    {
-      if (_cursor <= _gapbegin)
-	{
-	  if (_cursor < n) n = _cursor;
-	  erase(cursor() - n, cursor());
-	  _cursor -= n, _gapbegin -= n, _gapend -= n;
-	}
-      else if (_cursor - _gapend > n)
-	{
-	  erase(cursor() - n, cursor());
-	  _cursor -= n;
-	}
-      else
-	{
-	  size_type d = _cursor - _gapend;
-	  erase(gbegin() - (n - d), gbegin());
-	  erase(cursor() - d, cursor());
-	  _gapbegin -= n - d, _gapend -= n - d;
-	  _cursor -= n;
-	}
-    }
-  void remove_forward(size_type n)
-    {
-      if (_cursor >= _gapend)
-	{
-	  if (size_type(end() - cursor()) < n) n = end() - cursor();
-	  erase(cursor(), cursor() + n);
-	}
-      else if (_gapbegin - _cursor > n)
-	{
-	  erase(cursor(), cursor() + n);
-	  _gapbegin -= n, _gapend -= n;
-	}
-      else
-	{
-	  size_type d = _gapbegin - _cursor;
-	  erase(gend(), gend() + (n - d));
-	  erase(cursor(), cursor() + d);
-	  _gapbegin -= d, _gapend -= d;
-	}
-    }
-  const value_type *get() { compact(); return &*begin();}
-  void clear_buffer()
-  {
-    position(0);
-    remove_forward(size());
-  }
-private:
-  size_type _cursor;
-  size_type _gapbegin;
-  size_type _gapend;
-};
+      void movegap(int d)
+      {
+	  if (d > 0)
+	  {
+	      if (gend() + d > end())
+		  rep_type::insert(end(), size_type(gend() + d - end()),
+				   value_type(0));
+	      copy(gend(), gend() + d, gbegin());
+	  }
+	  else
+	      copy(rep_type::reverse_iterator(gbegin()),
+		   rep_type::reverse_iterator(gbegin() + d),
+		   rep_type::reverse_iterator(gend()));
+	  my_gapbegin += d, my_gapend += d;
+      }
+      size_type gap() { return my_gapend - my_gapbegin; }
+      void editing()
+      { size_type d = my_cursor - my_gapbegin; if (d != 0) movegap(d); }
+      void compact()
+      { size_type d = end() - gend(); if (d > 0) movegap(d); }
+    public:
+      GapBuffer() : my_cursor(0), my_gapbegin(0), my_gapend(0) {}
+      size_type size() { compact(); return gbegin() - begin(); }
+      void forward()
+      {
+	  if (my_cursor == my_gapbegin && gend() != end())
+	      my_cursor += gap();
+	  else if (cursor() < end()) my_cursor++;
+      }
+      void backward()
+      {
+	  if (my_cursor == my_gapend) my_cursor -= gap();
+	  else if (cursor() > begin()) my_cursor--;
+      }
+      void shift(size_type d)
+      {
+	  size_type tmp = my_cursor + d;
+	  if ((my_cursor > my_gapend && tmp > my_gapend) ||
+	      (my_cursor <= my_gapbegin && tmp <= my_gapbegin))
+	      my_cursor = tmp;
+	  else if (d < 0) my_cursor += d - gap();
+	  else my_cursor += d + gap();
+      }
+      size_type position()
+      { return my_cursor > my_gapend ? my_cursor - gap() : my_cursor;}
+      void position(size_type p) { shift(p - my_cursor);}
+      void insert(value_type u)
+      {
+	  editing();
+	  if (!gap()) newgap();
+	  *cursor() = u;
+	  my_cursor++, my_gapbegin++;
+      }
+      void insert(value_type *u, size_type n)
+      {
+	  editing();
+	  rep_type::insert(cursor(), u, u + n);
+	  my_cursor += n, my_gapbegin += n, my_gapend += n;
+      }
+      void remove_backward(size_type n)
+      {
+	  if (my_cursor <= my_gapbegin)
+	  {
+	      if (my_cursor < n) n = my_cursor;
+	      erase(cursor() - n, cursor());
+	      my_cursor -= n, my_gapbegin -= n, my_gapend -= n;
+	  }
+	  else if (my_cursor - my_gapend > n)
+	  {
+	      erase(cursor() - n, cursor());
+	      my_cursor -= n;
+	  }
+	  else
+	  {
+	      size_type d = my_cursor - my_gapend;
+	      erase(gbegin() - (n - d), gbegin());
+	      erase(cursor() - d, cursor());
+	      my_gapbegin -= n - d, my_gapend -= n - d;
+	      my_cursor -= n;
+	  }
+      }
+      void remove_forward(size_type n)
+      {
+	  if (my_cursor >= my_gapend)
+	  {
+	      if (size_type(end() - cursor()) < n) n = end() - cursor();
+	      erase(cursor(), cursor() + n);
+	  }
+	  else if (my_gapbegin - my_cursor > n)
+	  {
+	      erase(cursor(), cursor() + n);
+	      my_gapbegin -= n, my_gapend -= n;
+	  }
+	  else
+	  {
+	      size_type d = my_gapbegin - my_cursor;
+	      erase(gend(), gend() + (n - d));
+	      erase(cursor(), cursor() + d);
+	      my_gapbegin -= d, my_gapend -= d;
+	  }
+      }
+      const value_type *get() { compact(); return &*begin(); }
+      void clear_buffer()
+      {
+	  position(0);
+	  remove_forward(size());
+      }
+    private:
+      size_type my_cursor;
+      size_type my_gapbegin;
+      size_type my_gapend;
+  };
+
+} // namespace
 
 #endif

Index: Geometry.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Geometry.hh,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Geometry.hh	26 Sep 2001 04:14:16 -0000	1.9
+++ Geometry.hh	29 Dec 2003 08:03:18 -0000	1.10
@@ -19,8 +19,8 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef Geometry_hh
-#define Geometry_hh
+#ifndef _Berlin_Geometry_hh
+#define _Berlin_Geometry_hh
 
 #include <Berlin/Math.hh>
 #include <vector>
@@ -28,434 +28,459 @@
 namespace Geometry
 {
   
-const double epsilon = 10e-6;
-
-template <class T>
-class Point
-{
-public:
-  //. Create a point at (0, 0).
-  Point() : x(0), y(0) {}
-  //. Create a point at (xx, yy).
-  Point(T xx, T yy) : x(xx), y(yy) {}
-  //. Returns the distance between this point and the given point.
-  T distance(const Point &p) const { return static_cast<T>(sqrt(static_cast<double>((x - p.x)*(x - p.x) + (y - p.y)*(y - p.y))));}
-  //. x-coordinate of this point.
-  T x;
-  //. y-coordinate of this point.
-  T y;
-};
-
-template <class T>
-class Line
-{
-public:
-  //. Create a line from (0,0) to (0,0);
-  Line() {}
-  //. Create a line from (ux, uy) to (vx, vy).
-  Line(T ux, T uy, T vx, T vy) : u(ux, uy), v(vx, vy) {}
-  //. Create a line from point uu to point vv.
-  Line(const Point<T> &uu, const Point<T> &vv) : u(uu), v(vv) {}
-  //. Return the x coordinate of the leftmost point of this line.
-  T l() const { return u.x < v.x ? u.x : v.x;}
-  //. Return the y coordinate of the buttommost point of this line.
-  T b() const { return u.y < v.y ? u.y : v.y;}
-  //. Return the x coordinate of the rightmost point of this line.
-  T r() const { return u.x > v.x ? u.x : v.x;}
-  //. Return the y coordinate of the buttommost point of this line.
-  T t() const { return u.y > v.y ? u.y : v.y;}
-  //. Return true if the point p is on this line.
-  //. Bloat provides an epsilon environment (and 'extension') so
-  //. this method has some real chance not to fail.
-  bool contains(const Point<T> &, T bloat) const;
-  //. Return true if the given line intersects this line.
-  bool intersects(const Line<T> &) const;
-  //. Startpoint of this line.
-  Point<T> u;
-  //. Endpoint of this line.
-  Point<T> v;
-};
-
-template <class T>
-class Rectangle
-{
-public:
-  //. Create a rectangle consisting of the single point (0, 0).
-  Rectangle() : l(0), t(0), r(0), b(0) {}
-  //. Copie a rectangle.
-  Rectangle(const Rectangle &rect)
-    : l(rect.l), t(rect.t), r(rect.r), b(rect.b) {}
-  //. Create a rectangle with an upper left corner at (ll, tt) and
-  //. a lower right corner at (rr, bb).
-  Rectangle(T ll, T tt, T rr, T bb) : l(ll), t(tt), r(rr), b(bb) {}
-  //. Return the width of this rectangle.
-  T w() const {	return r - l;}
-  //. Return the heigh of this rectangle.
-  T h() const { return b - t;}
-  //. Return the x coordinate of the middle of the Rectangle.
-  T cx() const { return (l + r) / 2.;}
-  //. Return the y coordinate of the middle of the Rectangle.
-  T cy() const { return (b + t) / 2.;}
-
-  //. Return true if the point p is inside this rectangle or on its border.
-  bool contains(const Point<T> &p) const { return p.x >= l && p.x <= r && p.y >= t && p.y <= b;}
-  //. Return true if the line is contained completly within this rectangle
-  //. (or at least on this rectangles border).
-  bool contains(const Line<T> &c) const { return c.l() >= l && c.t() >= t && c.r() <= r && c.b() <= b;}
-  //. Return true if the line intersects with this rectangle
-  bool intersects(const Line<T> &) const;
-  //. Return true if the given rectangle is contained inside this rectangle
-  bool contains(const Rectangle<T> &) const;
-  //. Return if the given rectangle intersects with this rectangle
-  bool intersects(const Rectangle<T> &) const;
-  //. Returns true if the given rectangle is contained in this rectangle.
-  bool within(const Rectangle<T> &) const;
-  //. Return true if both rectangles are sufficiently close to each other, as given by the constant epsilon
-  bool touches(const Rectangle<T> &, T epsilon) const;
-  //. Set the rectangle to the single point (0, 0).
-  void clear() { l = b = r = t = 0;}
-  //. Extend this rectangle to include all points of the given rectangle
-  void merge(const Rectangle<T> &);
+  const double epsilon = 10e-6;
 
-  //. The leftmost point(s) of this rectangle.
-  T l;
-  //. The topmost point(s) of this rectangle.
-  T t;
-  //. The rightmost point(s) of this rectangle.
-  T r;
-  //. The buttommost point(s) of this rectangle.
-  T b;
-private:
-  //. Returns true if the given Line intersects one or more of the
-  //. borders of this rectangle.
-  bool intersectsLine(const Line<T> &) const;
-  //. Returns true if x and y differ less then epsilon. 
-  static bool equal(T x, T y, T epsilon) { return x - y < epsilon && y - x < epsilon;}
-};
+  template <class T>
+  class Point
+  {
+    public:
+      //. Create a point at (0, 0).
+      Point() : x(0), y(0) { }
+      //. Create a point at (xx, yy).
+      Point(T xx, T yy) : x(xx), y(yy) { }
+      //. Returns the distance between this point and the given point.
+      T distance(const Point &p) const
+      {
+	  return static_cast<T>(sqrt(static_cast<double>((x - p.x) *
+							 (x - p.x) + 
+							 (y - p.y) *
+							 (y - p.y))));
+      }
+      //. x-coordinate of this point.
+      T x;
+      //. y-coordinate of this point.
+      T y;
+  };
 
-//. A Polygon class
-//. FIXME: this class needs a lot of thought:
-//.        in order to be efficient it should adapt to a variety of existing
-//.        implementations, i.e. we should use traits here
-//.        Is a Polygon the owner of its points, or does it borrow them from some other
-//.        entity temporarily for the sake of doing some computation ?
-//.        -stefan
-template <class T>
-class Polygon
-{
-public:
-  //. Create a polygon with c cornerpoints given in the pointer p.
-  Polygon(Point<T> *p, int c) : points(p), count(c), norm(0), normCount(0) {}
-  //. Delete the polygon.
-  ~Polygon() { delete [] norm;}
+  template <class T>
+  class Line
+  {
+    public:
+      //. Create a line from (0,0) to (0,0);
+      Line() { }
+      //. Create a line from (ux, uy) to (vx, vy).
+      Line(T ux, T uy, T vx, T vy) : u(ux, uy), v(vx, vy) { }
+      //. Create a line from point uu to point vv.
+      Line(const Point<T> &uu, const Point<T> &vv) : u(uu), v(vv) { }
+      //. Return the x coordinate of the leftmost point of this line.
+      T l() const { return u.x < v.x ? u.x : v.x; }
+      //. Return the y coordinate of the buttommost point of this line.
+      T b() const { return u.y < v.y ? u.y : v.y; }
+      //. Return the x coordinate of the rightmost point of this line.
+      T r() const { return u.x > v.x ? u.x : v.x; }
+      //. Return the y coordinate of the buttommost point of this line.
+      T t() const { return u.y > v.y ? u.y : v.y; }
+      //. Return true if the point p is on this line.
+      //. Bloat provides an epsilon environment (and 'extension') so
+      //. this method has some real chance not to fail.
+      bool contains(const Point<T> &, T bloat) const;
+      //. Return true if the given line intersects this line.
+      bool intersects(const Line<T> &) const;
+      //. Startpoint of this line.
+      Point<T> u;
+      //. Endpoint of this line.
+      Point<T> v;
+  };
+  
+  template <class T>
+  class Rectangle
+  {
+    public:
+      //. Create a rectangle consisting of the single point (0, 0).
+      Rectangle() : l(0), t(0), r(0), b(0) { }
+      //. Copie a rectangle.
+      Rectangle(const Rectangle &rect) :
+	  l(rect.l), t(rect.t), r(rect.r), b(rect.b)
+      { }
+      //. Create a rectangle with an upper left corner at (ll, tt) and
+      //. a lower right corner at (rr, bb).
+      Rectangle(T ll, T tt, T rr, T bb) : l(ll), t(tt), r(rr), b(bb) { }
+      //. Return the width of this rectangle.
+      T w() const { return r - l; }
+      //. Return the heigh of this rectangle.
+      T h() const { return b - t; }
+      //. Return the x coordinate of the middle of the Rectangle.
+      T cx() const { return (l + r) / 2.; }
+      //. Return the y coordinate of the middle of the Rectangle.
+      T cy() const { return (b + t) / 2.; }
 
-  //. Return the number of corners of this polygon.
-  int size() const { return count;}
-  //. Return the i. point of the polygon.
-  //. Caution: No boundary checks are done!
-  const Point<T> &operator[](int i) const { return points[i];}
-  Point<T> &operator[](int i) { return points[i];}
+      //. Return true if the point p is inside this rectangle or on its
+      //. border.
+      bool contains(const Point<T> &p) const
+      { return p.x >= l && p.x <= r && p.y >= t && p.y <= b; }
+      //. Return true if the line is contained completly within this
+      //. rectangle (or at least on this rectangles border).
+      bool contains(const Line<T> &c) const
+      { return c.l() >= l && c.t() >= t && c.r() <= r && c.b() <= b; }
+      //. Return true if the line intersects with this rectangle
+      bool intersects(const Line<T> &) const;
+      //. Return true if the given rectangle is contained inside this
+      //. rectangle
+      bool contains(const Rectangle<T> &) const;
+      //. Return if the given rectangle intersects with this rectangle
+      bool intersects(const Rectangle<T> &) const;
+      //. Returns true if the given rectangle is contained in this
+      //. rectangle.
+      bool within(const Rectangle<T> &) const;
+      //. Return true if both rectangles are sufficiently close to each
+      //. other, as given by the constant epsilon
+      bool touches(const Rectangle<T> &, T epsilon) const;
+      //. Set the rectangle to the single point (0, 0).
+      void clear() { l = b = r = t = 0;}
+      //. Extend this rectangle to include all points of the given
+      //. rectangle
+      void merge(const Rectangle<T> &);
 
-  //. Set the given rectangle to be the smallest possible rectangle
-  //. containing all points of this polygon.
-  void boundingBox(Rectangle<T> &) const;
-  //. FIXME: Someone with more understanding of geometry should document this.
-  //. It would be great if that someone could document the algorithm so that
-  //. mear mortals can understand what's going on.
-  bool contains(const Point<T> &, T) const;
-  //. FIXME: see contains().
-  bool intersects(const Line<T> &) const;
-  //. FIXME: Easy again:-) Not documented because I didn't get the
-  //. intersects(Line) this is based on.
-  bool intersects(const Rectangle<T> &) const;
-  //. FIXME: Another one for the specialist.
-  bool intersects(const Polygon<T> &) const;
-  //. FIXME: Where is this defined?!
-  bool within(const Rectangle<T> &) const;
-protected:
-  //. FIXME: The points are reordered, so much is clear. Which garanties
-  //. are there for the reordered points?
-  void normalize() const;
-  Point<T> *points; //. FIXME: use a vector?
-  int       count; //. FIXME: This would become obsolete...
-  mutable Point<T> *norm; //. FIXME: use a vector?
-  mutable int normCount; //. FIXME: This would become obsolete...
-};
+      //. The leftmost point(s) of this rectangle.
+      T l;
+      //. The topmost point(s) of this rectangle.
+      T t;
+      //. The rightmost point(s) of this rectangle.
+      T r;
+      //. The buttommost point(s) of this rectangle.
+      T b;
+    private:
+      //. Returns true if the given Line intersects one or more of the
+      //. borders of this rectangle.
+      bool intersectsLine(const Line<T> &) const;
+      //. Returns true if x and y differ less then epsilon. 
+      static bool equal(T x, T y, T epsilon)
+      { return x - y < epsilon && y - x < epsilon; }
+  };
+  
+  //. A Polygon class
+  //. FIXME: this class needs a lot of thought:
+  //.        in order to be efficient it should adapt to a variety of
+  //.        existing implementations, i.e. we should use traits here
+  //.        Is a Polygon the owner of its points, or does it borrow
+  //.        them from some other entity temporarily for the sake of
+  //.        doing some computation? - stefan
+  template <class T>
+  class Polygon
+  {
+    public:
+      //. Create a polygon with c cornerpoints given in the pointer p.
+      Polygon(Point<T> *p, int c) :
+	  points(p), count(c), norm(0), normCount(0)
+      { }
+      //. Delete the polygon.
+      ~Polygon() { delete [] norm; }
 
-//. Rotates the point (x,y) for radians degree.
-//. The rotated point is returned as (tx, ty).
-template <class T>
-inline void rotate(double radians, T x, T y, T &tx, T &ty)
-{
-  T c = static_cast<T>(cos(radians));
-  T s = static_cast<T>(sin(radians));
-  tx = x * c + y * (-s);
-  ty = x * s + y * c;
-}
+      //. Return the number of corners of this polygon.
+      int size() const { return count; }
+      //. Return the i. point of the polygon.
+      //. Caution: No boundary checks are done!
+      const Point<T> &operator[](int i) const { return points[i]; }
+      Point<T> &operator[](int i) { return points[i]; }
+      
+      //. Set the given rectangle to be the smallest possible rectangle
+      //. containing all points of this polygon.
+      void boundingBox(Rectangle<T> &) const;
+      //. FIXME: Someone with more understanding of geometry should
+      //.        document this.
+      //.        It would be great if that someone could document the
+      //.        algorithm so that mear mortals can understand what's
+      //.        going on.
+      bool contains(const Point<T> &, T) const;
+      //. FIXME: see contains().
+      bool intersects(const Line<T> &) const;
+      //. FIXME: Easy again:-) Not documented because I didn't get the
+      //. intersects(Line) this is based on.
+      bool intersects(const Rectangle<T> &) const;
+      //. FIXME: Another one for the specialist.
+      bool intersects(const Polygon<T> &) const;
+      //. FIXME: Where is this defined?!
+      bool within(const Rectangle<T> &) const;
+    protected:
+      //. FIXME: The points are reordered, so much is clear. Which
+      //. garanties are there for the reordered points?
+      void normalize() const;
+      Point<T> *points; //. FIXME: use a vector?
+      int       count; //. FIXME: This would become obsolete...
+      mutable Point<T> *norm; //. FIXME: use a vector?
+      mutable int normCount; //. FIXME: This would become obsolete...
+  };
 
-//. The signum function (-1 for x < 0; 0 for x = 0; 1 for x > 0).
-template <class T>
-inline int signum(T a)
-{
-  if (a < 0) return -1;
-  else if (a > 0) return 1;
-  else return 0;
-}
+  //. Rotates the point (x,y) for radians degree.
+  //. The rotated point is returned as (tx, ty).
+  template <class T>
+  inline void rotate(double radians, T x, T y, T &tx, T &ty)
+  {
+      T c = static_cast<T>(cos(radians));
+      T s = static_cast<T>(sin(radians));
+      tx = x * c + y * (-s);
+      ty = x * s + y * c;
+  }
 
-//. FIXME: What does this do? Isen't dx1, dy1, dx2,dy2 allways 0?
-template <class T>
-inline int same(const Point<T> &u, const Point<T> &v)
-{
-  T dx, dx1, dx2;
-  T dy, dy1, dy2;
-		
-  dx = v.x - u.x;
-  dy = v.y - u.y;
-  dx1 = u.x - u.x;
-  dy1 = u.y - u.y;
-  dx2 = v.x - v.x;
-  dy2 = v.y - v.y;
-  return signum(dx*dy1 - dy*dx1) * signum(dx*dy2 - dy*dx2);
-}
+  //. The signum function (-1 for x < 0; 0 for x = 0; 1 for x > 0).
+  template <class T>
+  inline int signum(T a)
+  {
+      if (a < 0) return -1;
+      else if (a > 0) return 1;
+      else return 0;
+  }
 
-template <class T>
-inline bool Line<T>::contains(const Point<T> &p, T bloat) const
-{
-  T l = Math::min(u.x, v.x) - bloat;
-  T t = Math::min(u.y, v.y) - bloat;
-  T r = Math::max(u.x, v.x) + bloat;
-  T b = Math::max(u.y, v.y) + bloat;
-  if (! (l <= p.x) && (p.x <= r) && (t <= p.y) && (p.y <= b)) return false;
+  //. FIXME: What does this do? Isen't dx1, dy1, dx2,dy2 allways 0?
+  template <class T>
+  inline int same(const Point<T> &u, const Point<T> &v)
+  {
+      T dx, dx1, dx2;
+      T dy, dy1, dy2;
+      
+      dx = v.x - u.x;
+      dy = v.y - u.y;
+      dx1 = u.x - u.x;
+      dy1 = u.y - u.y;
+      dx2 = v.x - v.x;
+      dy2 = v.y - v.y;
+      return signum(dx*dy1 - dy*dx1) * signum(dx*dy2 - dy*dx2);
+  }
 
-  T dx = u.x - v.x;
-  T dy = u.y - v.y;
-  T length = static_cast<T>(sqrt(dx*dx + dy*dy));
-  T radians = length <= epsilon ? 0 : static_cast<T>(acos(dx/length));
-  if (dy > 0) radians = -radians;
+  template <class T>
+  inline bool Line<T>::contains(const Point<T> &p, T bloat) const
+  {
+      T l = Math::min(u.x, v.x) - bloat;
+      T t = Math::min(u.y, v.y) - bloat;
+      T r = Math::max(u.x, v.x) + bloat;
+      T b = Math::max(u.y, v.y) + bloat;
+      if (! (l <= p.x) && (p.x <= r) && (t <= p.y) && (p.y <= b))
+	  return false;
+      
+      T dx = u.x - v.x;
+      T dy = u.y - v.y;
+      T length = static_cast<T>(sqrt(dx*dx + dy*dy));
+      T radians = length <= epsilon ? 0 : static_cast<T>(acos(dx/length));
+      if (dy > 0) radians = -radians;
 
-  T x, y;
-  rotate(radians, p.x - u.x, p.y - u.y, x, y);
-  l = -length - bloat;
-  t = -bloat;
-  r = bloat;
-  b = bloat;
-  return l <= x && x <= r && t <= y && y <= b;
-}
+      T x, y;
+      rotate(radians, p.x - u.x, p.y - u.y, x, y);
+      l = -length - bloat;
+      t = -bloat;
+      r = bloat;
+      b = bloat;
+      return l <= x && x <= r && t <= y && y <= b;
+  }
 
-template <class T>
-inline bool Line<T>::intersects(const Line &i) const
-{
-  return (l() <= i.r() &&
-	  i.l() <= r() &&
-	  t() <= i.b() &&
-	  i.t() <= b() &&
-	  same(i.u, i.v) <= 0 &&
-	  same(u, v) <= 0);
-}
+  template <class T>
+  inline bool Line<T>::intersects(const Line &i) const
+  {
+      return (l() <= i.r() &&
+	      i.l() <= r() &&
+	      t() <= i.b() &&
+	      i.t() <= b() &&
+	      same(i.u, i.v) <= 0 &&
+	      same(u, v) <= 0);
+  }
 
-template <class T>
-inline bool Rectangle<T>::intersects(const Line<T> &i) const
-{
-  return l <= i.r() && i.l() <= r && t <= i.b() && i.t() <= b && intersectsLine(i);
-}
+  template <class T>
+  inline bool Rectangle<T>::intersects(const Line<T> &i) const
+  {
+      return l <= i.r() && i.l() <= r && t <= i.b() && i.t() <= b &&
+	  intersectsLine(i);
+  }
   
-template <class T>
-inline bool Rectangle<T>::contains(const Rectangle<T> &c) const
-{
-  return l <= c.l && t <= c.t && r >= c.r && b >= c.b;
-}
-
-template <class T>
-inline bool Rectangle<T>::intersects(const Rectangle<T> &i) const
-{
-  return l <= i.r && r >= i.l && t <= i.b && b >= i.t;
-}
-
-template <class T>
-inline bool Rectangle<T>::within(const Rectangle<T> &w) const
-{
-  return l >= w.l && t >= w.t && r <= w.r && b <= w.b;
-}
+  template <class T>
+  inline bool Rectangle<T>::contains(const Rectangle<T> &c) const
+  { return l <= c.l && t <= c.t && r >= c.r && b >= c.b; }
 
-template <class T>
-inline bool Rectangle<T>::touches(const Rectangle<T> &a, T epsilon) const
-{
-  return equal(l, a.l, epsilon) || equal(r, a.r, epsilon) || equal(t, a.t, epsilon) || equal(b, a.b, epsilon);
-}
+  template <class T>
+  inline bool Rectangle<T>::intersects(const Rectangle<T> &i) const
+  { return l <= i.r && r >= i.l && t <= i.b && b >= i.t; }
 
-template <class T>
-inline void Rectangle<T>::merge(const Rectangle<T> &m)
-{
-  if (m.l < l) l = m.l;
-  if (m.t < t) t = m.t;
-  if (m.r > r) r = m.r;
-  if (m.b > b) b = m.b;
-}
+  template <class T>
+  inline bool Rectangle<T>::within(const Rectangle<T> &w) const
+  { return l >= w.l && t >= w.t && r <= w.r && b <= w.b; }
 
-template <class T>
-inline bool Rectangle<T>::intersectsLine(const Line<T> &i) const
-{
-  return (contains(i.u) || contains(i.v) ||
-	  i.intersects(Line<T>(l, t, r, t)) ||
-	  i.intersects(Line<T>(r, t, r, b)) ||
-	  i.intersects(Line<T>(r, b, l, b)) ||
-	  i.intersects(Line<T>(l, b, l, t)));
-}
+  template <class T>
+  inline bool Rectangle<T>::touches(const Rectangle<T> &a, T epsilon) const
+  {
+      return equal(l, a.l, epsilon) || equal(r, a.r, epsilon) ||
+	  equal(t, a.t, epsilon) || equal(b, a.b, epsilon);
+  }
 
-template <class T>
-std::ostream &operator << (std::ostream &os, const Rectangle<T> &rectangle)
-{
-  return os << '(' << rectangle.l << ',' << rectangle.t << ',' << rectangle.r << ',' << rectangle.b << ')';
-}
+  template <class T>
+  inline void Rectangle<T>::merge(const Rectangle<T> &m)
+  {
+      if (m.l < l) l = m.l;
+      if (m.t < t) t = m.t;
+      if (m.r > r) r = m.r;
+      if (m.b > b) b = m.b;
+  }
 
-template <class T>
-inline void Polygon<T>::boundingBox(Rectangle<T> &b) const
-{
-  b.l = b.r = points[0].x;
-  b.t = b.b = points[0].y;
-  for (int i = 1; i < count; i++)
-    {
-      b.l = Math::min(b.l, points[i].x);
-      b.t = Math::min(b.t, points[i].y);
-      b.r = Math::max(b.r, points[i].x);
-      b.b = Math::max(b.b, points[i].y);
-    }
-}
+  template <class T>
+  inline bool Rectangle<T>::intersectsLine(const Line<T> &i) const
+  {
+      return (contains(i.u) || contains(i.v) ||
+	      i.intersects(Line<T>(l, t, r, t)) ||
+	      i.intersects(Line<T>(r, t, r, b)) ||
+	      i.intersects(Line<T>(r, b, l, b)) ||
+	      i.intersects(Line<T>(l, b, l, t)));
+  }
 
-template <class T>
-inline bool Polygon<T>::contains(const Point<T> &p, T bloat) const
-{
-  if (normCount == 0) normalize();
-  int count = 0;
-  Point<T> p0;
-  bool cury_sign = norm[0].y >= p.y;
-  for (int i = 0; i < normCount - 2; i++)
-    {
-      Line<T> l(norm[i].x - p.x, norm[i].y - p.y, norm[i+1].x - p.x, norm[i+1].y - p.y);
-      if (l.contains(p0, bloat)) return true;
-      bool nexty_sign = l.v.y >= 0.;
-      if (nexty_sign != cury_sign)
-	{
-	  bool curx_sign = l.u.x >= 0;
-	  bool nextx_sign = l.v.x >= 0;
-	  if (curx_sign && nextx_sign) count++;
-	  else if (curx_sign || nextx_sign)
-	    {
-	      T dx = l.v.x - l.u.x;
-	      T dy = l.v.y - l.u.y;
-	      if (dy >= 0)
-		{
-		  if (l.u.x * dy > l.u.y * dx) count++;
-		}
-	      else
-		{
-		  if (l.u.x * dy < l.u.y * dx) count++;
-		}
-	    }
-	}
-      cury_sign = nexty_sign;
-    }
-  return count % 2 == 1;
-}
+  template <class T>
+  inline void Polygon<T>::boundingBox(Rectangle<T> &b) const
+  {
+      b.l = b.r = points[0].x;
+      b.t = b.b = points[0].y;
+      for (int i = 1; i < count; i++)
+      {
+	  b.l = Math::min(b.l, points[i].x);
+	  b.t = Math::min(b.t, points[i].y);
+	  b.r = Math::max(b.r, points[i].x);
+	  b.b = Math::max(b.b, points[i].y);
+      }
+  }
 
-template <class T>
-inline bool Polygon<T>::intersects(const Line<T> &l) const
-{
-  Rectangle<T> b;
-  bool intersects = false;
-  if (normCount == 0) normalize();
-  boundingBox(b);
-  if (b.intersects(l))
-    {
-      const Polygon<T> p(norm, normCount - 1);
-      intersects = p.intersects(l) || contains(l.u, 0) || contains(l.v, 0);
-    }
-  return intersects;
-}
+  template <class T>
+  inline bool Polygon<T>::contains(const Point<T> &p, T bloat) const
+  {
+      if (normCount == 0) normalize();
+      int count = 0;
+      Point<T> p0;
+      bool cury_sign = norm[0].y >= p.y;
+      for (int i = 0; i < normCount - 2; i++)
+      {
+	  Line<T> l(norm[i].x - p.x, norm[i].y - p.y,
+		    norm[i+1].x - p.x, norm[i+1].y - p.y);
+	  if (l.contains(p0, bloat)) return true;
+	  bool nexty_sign = l.v.y >= 0.;
+	  if (nexty_sign != cury_sign)
+	  {
+	      bool curx_sign = l.u.x >= 0;
+	      bool nextx_sign = l.v.x >= 0;
+	      if (curx_sign && nextx_sign) count++;
+	      else if (curx_sign || nextx_sign)
+	      {
+		  T dx = l.v.x - l.u.x;
+		  T dy = l.v.y - l.u.y;
+		  if (dy >= 0)
+		  {
+		      if (l.u.x * dy > l.u.y * dx) count++;
+		  }
+		  else
+		  {
+		      if (l.u.x * dy < l.u.y * dx) count++;
+		  }
+	      }
+	  }
+	  cury_sign = nexty_sign;
+      }
+      return count % 2 == 1;
+  }
 
-template <class T>
-inline bool Polygon<T>::intersects(const Rectangle<T> &ub) const
-{
-  Rectangle<T> b;
-  boundingBox(b);
-  if (!b.intersects(ub)) return false;
-  if (b.within(ub)) return true;
+  template <class T>
+  inline bool Polygon<T>::intersects(const Line<T> &l) const
+  {
+      Rectangle<T> b;
+      bool intersects = false;
+      if (normCount == 0) normalize();
+      boundingBox(b);
+      if (b.intersects(l))
+      {
+	  const Polygon<T> p(norm, normCount - 1);
+	  intersects = p.intersects(l) || contains(l.u, 0) || contains(l.v, 0);
+      }
+      return intersects;
+  }
   
-  Line<T> bottom(ub.l, ub.b, ub.r, ub.b);
-  if (intersects(bottom)) return true;
- 
-  Line<T> right(ub.r, ub.b, ub.r, ub.t);
-  if (intersects(right)) return true;
- 
-  Line<T> top(ub.r, ub.t, ub.l, ub.t);
-  if (intersects(top)) return true;
+  template <class T>
+  inline bool Polygon<T>::intersects(const Rectangle<T> &ub) const
+  {
+      Rectangle<T> b;
+      boundingBox(b);
+      if (!b.intersects(ub)) return false;
+      if (b.within(ub)) return true;
+      
+      Line<T> bottom(ub.l, ub.b, ub.r, ub.b);
+      if (intersects(bottom)) return true;
+      
+      Line<T> right(ub.r, ub.b, ub.r, ub.t);
+      if (intersects(right)) return true;
+      
+      Line<T> top(ub.r, ub.t, ub.l, ub.t);
+      if (intersects(top)) return true;
+      
+      Line<T> left(ub.l, ub.t, ub.l, ub.b);
+      return intersects(left);
+  }
+  
+  template <class T>
+  inline bool Polygon<T>::intersects(const Polygon<T> &p) const
+  {
+      int s = p.size();
+      if ((s > 0) && contains(p[0], 0)) return true;
+      if ((size() > 0) && p.contains(points[0], 0)) return true;
+      for (int i = 0; i < s; i++)
+	  if (intersects(Line<T>(p[i], p[(i + 1) % s]))) return true;
+      return false;
+  }
+  
+  //. Returns the lowest point. If more then one point qualifies for
+  //. 'lowest point' pick the leftmost.
+  template <class T>
+  inline int lowestleft(const Point<T> *points, int count)
+  {
+      int ll = 0;
+      T lx = points[0].x;
+      T ly = points[0].y;
+      for (int i = 1; i < count; i++)
+	  if (points[i].y < ly || (points[i].y == ly && points[i].x < lx))
+	  {
+	      ll = i;
+	      lx = points[i].x;
+	      ly = points[i].y;
+	  }
+      return ll;
+  }
+  
+  //. FIXME: Which order does this garanty?
+  template<class T>
+  void Polygon<T>::normalize() const
+  {
+      if (size())
+      {
+	  int i, newcount = 1;
+	  int ll, limit = size();
+	  
+	  if (points[0].x == points[size() - 1].x &&
+	      points[0].y == points[size() - 1].y) limit--;
+	  ll = lowestleft(points, limit);
+	  normCount = limit + 2;
+	  norm = new Point<T>[normCount];
+	  
+	  for (i = ll; i < limit; i++, newcount++)
+	  {
+	      norm[newcount].x = points[i].x;
+	      norm[newcount].y = points[i].y;
+	  }
+	  for (i = 0; i < ll; i++, newcount++)
+	  {
+	      norm[newcount].x = points[i].x;
+	      norm[newcount].y = points[i].y;
+	  }
+	  
+	  norm[newcount].x = norm[1].x;
+	  norm[newcount].y = norm[1].y;
+	  newcount--;
+	  norm[0].x = norm[newcount].x;
+	  norm[0].y = norm[newcount].y;
+      }
+  }
+  
+} // namespace
 
-  Line<T> left(ub.l, ub.t, ub.l, ub.b);
-  return intersects(left);
-}
- 
-template <class T>
-inline bool Polygon<T>::intersects(const Polygon<T> &p) const
+namespace std
 {
-  int s = p.size();
-  if ((s > 0) && contains(p[0], 0)) return true;
-  if ((size() > 0) && p.contains(points[0], 0)) return true;
-  for (int i = 0; i < s; i++)
-    if (intersects(Line<T>(p[i], p[(i + 1) % s]))) return true;
-  return false;
-}
 
-//. Returns the lowest point. If more then one point qualifies for
-//. 'lowest point' pick the leftmost.
 template <class T>
-inline int lowestleft(const Point<T> *points, int count)
+std::ostream &operator << (std::ostream &os,
+			   const Geometry::Rectangle<T> &rectangle)
 {
-  int ll = 0;
-  T lx = points[0].x;
-  T ly = points[0].y;
-  for (int i = 1; i < count; i++)
-    if (points[i].y < ly || (points[i].y == ly && points[i].x < lx))
-      {
-	ll = i;
-	lx = points[i].x;
-	ly = points[i].y;
-      }
-  return ll;
+    return os << '(' << rectangle.l << ',' << rectangle.t << ','
+	      << rectangle.r << ',' << rectangle.b << ')';
 }
 
-//. FIXME: Which order does this garanty?
-template<class T>
-void Polygon<T>::normalize() const
-{
-  if (size())
-    {
-      int i, newcount = 1;
-      int ll, limit = size();
-      
-      if (points[0].x == points[size() - 1].x &&
-	  points[0].y == points[size() - 1].y) limit--;
-      ll = lowestleft(points, limit);
-      normCount = limit + 2;
-      norm = new Point<T>[normCount];
- 
-      for (i = ll; i < limit; i++, newcount++)
-	{
-	  norm[newcount].x = points[i].x;
-	  norm[newcount].y = points[i].y;
-	}
-      for (i = 0; i < ll; i++, newcount++)
-	{
-	  norm[newcount].x = points[i].x;
-	  norm[newcount].y = points[i].y;
-	}
- 
-    norm[newcount].x = norm[1].x;
-    norm[newcount].y = norm[1].y;
-    newcount--;
-    norm[0].x = norm[newcount].x;
-    norm[0].y = norm[newcount].y;
-    }
-}
+} // namespace
 
-}
 #endif /* _Geometry_hh */

Index: GraphDebugger.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/GraphDebugger.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- GraphDebugger.hh	26 Feb 2003 00:19:05 -0000	1.1
+++ GraphDebugger.hh	29 Dec 2003 08:03:18 -0000	1.2
@@ -26,10 +26,10 @@
 #include <string>
 #include <vector>
 
-class GraphicImpl;
-
 namespace Berlin
 {
+
+  class GraphicImpl;
 
   class GraphDebugger
   {

Index: GraphicImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/GraphicImpl.hh,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- GraphicImpl.hh	18 Dec 2002 06:00:06 -0000	1.31
+++ GraphicImpl.hh	29 Dec 2003 08:03:18 -0000	1.32
@@ -31,84 +31,100 @@
 #include "Berlin/RefCountBaseImpl.hh"
 #include "Berlin/IdentifiableImpl.hh"
 
-class RegionImpl;
-class AllocationImpl;
-
-class GraphicImpl : public virtual POA_Fresco::Graphic,
-                    public virtual RefCountBaseImpl,
-                    public virtual IdentifiableImpl
+namespace Berlin
 {
- protected:
-  //. An edge is a reference to a graphic within a composite.
-  //. Because a graphic might appear twice within the same composite,
-  //. a graphic itself is insufficient to identify its position within
-  //. its parent.
-  struct Edge
-  {
-    Fresco::Graphic_var peer;
-    Fresco::Tag         peerId;
-    Fresco::Tag         localId;
-  };
-  typedef std::vector<Edge> glist_t;
-  struct localId_eq : public std::unary_function<Edge, bool>
-    {
-      localId_eq(Fresco::Tag t) : id(t) {}
-      bool operator()(const Edge &e) const { return e.localId == id; }
-      Fresco::Tag id;
-    };
- public:
-  static const Fresco::Coord infinity = 10e6;
-  GraphicImpl();
-  virtual ~GraphicImpl();
-  virtual void deactivate();
 
-  virtual Fresco::Graphic_ptr body();
-  virtual void body(Fresco::Graphic_ptr);
-  virtual void append_graphic(Fresco::Graphic_ptr);
-  virtual void prepend_graphic(Fresco::Graphic_ptr);
-  virtual void remove_graphic(Fresco::Tag);
-  virtual void remove_child_graphic(Fresco::Tag);
-  virtual Fresco::Tag add_parent_graphic(Fresco::Graphic_ptr, Fresco::Tag);
-  virtual void remove_parent_graphic(Fresco::Tag);
-  virtual Fresco::GraphicIterator_ptr first_child_graphic();
-  virtual Fresco::GraphicIterator_ptr last_child_graphic();
+  class RegionImpl;
+  class AllocationImpl;
+  
+  class GraphicImpl : public virtual POA_Fresco::Graphic,
+		      public virtual RefCountBaseImpl,
+		      public virtual IdentifiableImpl
+  {
+    protected:
+      //. An edge is a reference to a graphic within a composite.
+      //. Because a graphic might appear twice within the same composite,
+      //. a graphic itself is insufficient to identify its position within
+      //. its parent.
+      struct Edge
+      {
+	  Fresco::Graphic_var peer;
+	  Fresco::Tag         peerId;
+	  Fresco::Tag         localId;
+      };
+      typedef std::vector<Edge> glist_t;
+      struct localId_eq : public std::unary_function<Edge, bool>
+      {
+	  localId_eq(Fresco::Tag t) : id(t) {}
+	  bool operator()(const Edge &e) const { return e.localId == id; }
+	  Fresco::Tag id;
+      };
+    public:
+      static const Fresco::Coord infinity = 10e6;
+      GraphicImpl();
+      virtual ~GraphicImpl();
+      virtual void deactivate();
 
-  virtual Fresco::Transform_ptr transformation();
-  virtual void request(Fresco::Graphic::Requisition &);
-  virtual void extension(const Fresco::Allocation::Info &, Fresco::Region_ptr);
-  virtual void shape(Fresco::Region_ptr);
+      virtual Fresco::Graphic_ptr body();
+      virtual void body(Fresco::Graphic_ptr);
+      virtual void append_graphic(Fresco::Graphic_ptr);
+      virtual void prepend_graphic(Fresco::Graphic_ptr);
+      virtual void remove_graphic(Fresco::Tag);
+      virtual void remove_child_graphic(Fresco::Tag);
+      virtual Fresco::Tag add_parent_graphic(Fresco::Graphic_ptr,
+					     Fresco::Tag);
+      virtual void remove_parent_graphic(Fresco::Tag);
+      virtual Fresco::GraphicIterator_ptr first_child_graphic();
+      virtual Fresco::GraphicIterator_ptr last_child_graphic();
+      
+      virtual Fresco::Transform_ptr transformation();
+      virtual void request(Fresco::Graphic::Requisition &);
+      virtual void extension(const Fresco::Allocation::Info &,
+			     Fresco::Region_ptr);
+      virtual void shape(Fresco::Region_ptr);
+      
+      virtual void traverse(Fresco::Traversal_ptr);
+      virtual void draw(Fresco::DrawTraversal_ptr);
+      virtual void pick(Fresco::PickTraversal_ptr);
 
-  virtual void traverse(Fresco::Traversal_ptr);
-  virtual void draw(Fresco::DrawTraversal_ptr);
-  virtual void pick(Fresco::PickTraversal_ptr);
+      virtual void allocate(Fresco::Tag, const Fresco::Allocation::Info &);
+      virtual void allocations(Fresco::Allocation_ptr);
+      virtual void need_redraw();
+      virtual void need_redraw_region(Fresco::Region_ptr);
+      virtual void need_resize();
 
-  virtual void allocate(Fresco::Tag, const Fresco::Allocation::Info &);
-  virtual void allocations(Fresco::Allocation_ptr);
-  virtual void need_redraw();
-  virtual void need_redraw_region(Fresco::Region_ptr);
-  virtual void need_resize();
+      static void init_requisition(Fresco::Graphic::Requisition &);
+      static void default_requisition(Fresco::Graphic::Requisition &);
+      static void require(Fresco::Graphic::Requirement &, Fresco::Coord,
+			  Fresco::Coord, Fresco::Coord, Fresco::Coord);
+      static void require_lead_trail(Fresco::Graphic::Requirement &,
+				     Fresco::Coord, Fresco::Coord,
+				     Fresco::Coord, Fresco::Coord,
+				     Fresco::Coord, Fresco::Coord);
+      static Fresco::Graphic::Requirement
+      *requirement(Fresco::Graphic::Requisition &, Fresco::Axis);
+      static void default_extension(const Fresco::Allocation::Info &,
+				    Fresco::Region_ptr);
+      static void natural_allocation(Fresco::Graphic_ptr, RegionImpl &);
+      static void transform_request(Fresco::Graphic::Requisition &,
+				    Fresco::Transform_ptr);
+      static Fresco::Vertex
+      transform_allocate(RegionImpl &,
+			 const Fresco::Graphic::Requisition &,
+			 Fresco::Transform_ptr);
+    private:
+      Fresco::Tag unique_parent_id();
+      glist_t       my_parents;
+      Prague::Mutex my_mutex;
+  };
 
-  static void init_requisition(Fresco::Graphic::Requisition &);
-  static void default_requisition(Fresco::Graphic::Requisition &);
-  static void require(Fresco::Graphic::Requirement &, Fresco::Coord, Fresco::Coord, Fresco::Coord, Fresco::Coord);
-  static void require_lead_trail(Fresco::Graphic::Requirement &,
-				 Fresco::Coord, Fresco::Coord, Fresco::Coord, Fresco::Coord, Fresco::Coord, Fresco::Coord);
-  static Fresco::Graphic::Requirement *requirement(Fresco::Graphic::Requisition &, Fresco::Axis);
-  static void default_extension(const Fresco::Allocation::Info &, Fresco::Region_ptr);
-  static void natural_allocation(Fresco::Graphic_ptr, RegionImpl &);
-  static void transform_request(Fresco::Graphic::Requisition &, Fresco::Transform_ptr);
-  static Fresco::Vertex transform_allocate(RegionImpl &, const Fresco::Graphic::Requisition &, Fresco::Transform_ptr);
-private:
-  Fresco::Tag unique_parent_id();
-  glist_t              my_parents;
-  Prague::Mutex        my_mutex;
-};
+  class GraphicIteratorImpl : public virtual POA_Fresco::GraphicIterator,
+			      public virtual ServantBase
+  {
+    public:
+      virtual void destroy() { deactivate();}
+  };
 
-class GraphicIteratorImpl : public virtual POA_Fresco::GraphicIterator,
-		            public virtual ServantBase
-{
-public:
-  virtual void destroy() { deactivate();}
-};
+} // namespace
 
 #endif

Index: IdentifiableImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/IdentifiableImpl.hh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- IdentifiableImpl.hh	29 May 2002 06:49:38 -0000	1.3
+++ IdentifiableImpl.hh	29 Dec 2003 08:03:18 -0000	1.4
@@ -26,18 +26,23 @@
 #include <Fresco/Identifiable.hh>
 #include <Berlin/ServantBase.hh>
 
-class IdentifiableImpl : public virtual POA_Fresco::Identifiable,
-			 public virtual ServantBase,
-			 public virtual Prague::NamedObject
-
+namespace Berlin
 {
-public:
-  CORBA::Boolean is_identical(Fresco::Identifiable_ptr);
 
-  //. Default implementation of this method from NamedObject. Remove this to
-  //. let the compiler tell you which classes you forgot to fix this in :)
-  virtual const char *object_name() { return 0;}
+  class IdentifiableImpl : public virtual POA_Fresco::Identifiable,
+			   public virtual ServantBase,
+			   public virtual Prague::NamedObject
 
-};
+  {
+    public:
+      CORBA::Boolean is_identical(Fresco::Identifiable_ptr);
+
+      //. Default implementation of this method from NamedObject. Remove
+      //. this to let the compiler tell you which classes you forgot to
+      // fix this in :)
+      virtual const char *object_name() { return 0;}  
+  };
+
+} // namespace
 
 #endif

Index: ImplVar.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ImplVar.hh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ImplVar.hh	29 May 2002 06:49:38 -0000	1.10
+++ ImplVar.hh	29 Dec 2003 08:03:18 -0000	1.11
@@ -29,57 +29,75 @@
 #include <Berlin/Logger.hh>
 #include <typeinfo>
 
-//.these smart pointers take care of the activation/deactivation of
-//.servants they get assigned to
-//.as such, it is *not* meant to be used for RefCountBase objects as
-//.they deactivate themselfs when the ref counter drops to zero
-//.
-//.The Impl_var class is similar to auto_ptr, i.e. it owns the assigned
-//.object. If you assign one Impl_var to another, the first will lose
-//.ownership.
-template <class T>
-class Impl_var
+namespace Berlin
 {
-public:
-  explicit Impl_var(T *tt = 0) : t(tt) { if (t) activate(t);}
-  Impl_var(Impl_var<T> &i) : t(i._retn()) {}
-  ~Impl_var() { if (t) deactivate(t);}
-  Impl_var<T> &operator = (Impl_var<T> &i) { if (&i != this) { if (t) deactivate(t); t = i._retn();} return *this;}
-  Impl_var<T> &operator = (T *tt) { if (t) deactivate(t); t = tt; if (t) activate(t); return *this;}
-  T &operator *() const { return *t;}
-  T *operator->() const { return  t;}
-  operator T *() const { return  t;}
-  T *_retn() { T *tmp = t; t = 0; return tmp;}
-  static void activate(T *);
-  static void deactivate(T *);
-private:
-  T *t;
-};
 
-template <class T>
-inline void Impl_var<T>::activate(T *t)
-{
-  Prague::Trace trace("Impl_var::activate");
-  PortableServer::POA_var poa = t->_default_POA();
+  //.these smart pointers take care of the activation/deactivation of
+  //.servants they get assigned to
+  //.as such, it is *not* meant to be used for RefCountBase objects as
+  //.they deactivate themselfs when the ref counter drops to zero
+  //.
+  //.The Impl_var class is similar to auto_ptr, i.e. it owns the assigned
+  //.object. If you assign one Impl_var to another, the first will lose
+  //.ownership.
+  template <class T>
+  class Impl_var
+  {
+    public:
+      explicit Impl_var(T *tt = 0) : t(tt) { if (t) activate(t); }
+      Impl_var(Impl_var<T> &i) : t(i._retn()) { }
+      ~Impl_var() { if (t) deactivate(t); }
+      Impl_var<T> &operator = (Impl_var<T> &i)
+      {
+	  if (&i != this)
+	  {
+	      if (t) deactivate(t);
+	      t = i._retn();
+	  }
+	  return *this;
+      }
+      Impl_var<T> &operator = (T *tt)
+      { if (t) deactivate(t); t = tt; if (t) activate(t); return *this; }
+      T &operator *() const { return *t; }
+      T *operator->() const { return  t; }
+      operator T *() const { return  t; }
+      T *_retn() { T *tmp = t; t = 0; return tmp; }
+      static void activate(T *);
+      static void deactivate(T *);
+    private:
+      T *t;
+  };
+
+  template <class T>
+  inline void Impl_var<T>::activate(T *t)
+  {
+      Prague::Trace trace("Impl_var::activate");
+      PortableServer::POA_var poa = t->_default_POA();
 #ifdef LCLOG
-  Logger::log(Logger::lifecycle) << "activating " << t << " (" << typeid(*t).name() << ")" << std::endl;
+      Logger::log(Logger::lifecycle) << "activating " << t << " ("
+				     << typeid(*t).name() << ")"
+				     << std::endl;
 #endif
-  PortableServer::ObjectId *oid = poa->activate_object(t);
-  t->_remove_ref();
-  delete oid;
-}
+      PortableServer::ObjectId *oid = poa->activate_object(t);
+      t->_remove_ref();
+      delete oid;
+  }
 
-template <class T>
-inline void Impl_var<T>::deactivate(T *t)
-{
-  Prague::Trace trace("Impl_var::deactivate");
-  PortableServer::POA_var poa = t->_default_POA();
-  PortableServer::ObjectId *oid = poa->servant_to_id(t);
+  template <class T>
+  inline void Impl_var<T>::deactivate(T *t)
+  {
+      Prague::Trace trace("Impl_var::deactivate");
+      PortableServer::POA_var poa = t->_default_POA();
+      PortableServer::ObjectId *oid = poa->servant_to_id(t);
 #ifdef LCLOG
-  Logger::log(Logger::lifecycle) << "deactivating " << t << " (" << typeid(*t).name() << ")" << std::endl;
+      Logger::log(Logger::lifecycle) << "deactivating " << t << " ("
+				     << typeid(*t).name() << ")"
+				     << std::endl;
 #endif
-  poa->deactivate_object(*oid);
-  delete oid;
-}
+      poa->deactivate_object(*oid);
+      delete oid;
+  }
 
+} // namespace
+  
 #endif

Index: KitImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/KitImpl.hh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- KitImpl.hh	26 Feb 2003 00:19:05 -0000	1.15
+++ KitImpl.hh	29 Dec 2003 08:03:18 -0000	1.16
@@ -23,105 +23,105 @@
 #define _Berlin_KitImpl_hh
 
 #include <Prague/Sys/Tracer.hh>
-#include <Fresco/config.hh>
 #include <Fresco/Kit.hh>
 #include <Fresco/Graphic.hh>
 #include <Berlin/DefaultPOA.hh>
 #include <Berlin/GraphicImpl.hh>
 #include <Berlin/GraphicDictionary.hh>
-
 #include <string>
 
-class ServerImpl;
-class ServerContextImpl;
-class ServantBase;
-
-class KitImpl : public virtual POA_Fresco::Kit,
-		public virtual PortableServer::RefCountServantBase,
-		private DefaultPOA
+namespace Berlin
 {
-  friend class ServerImpl;
-public:
-  KitImpl(const std::string &,
-	  const Fresco::Kit::PropertySeq &, ServerContextImpl *);
-  ~KitImpl();
-  virtual KitImpl *clone(const Fresco::Kit::PropertySeq &,
-			 ServerContextImpl *) = 0;
-  const std::string &repo_id() const { return my_repo_id;}
-  virtual Fresco::Kit::PropertySeq *properties()
-  {
-      return new Fresco::Kit::PropertySeq(*my_props);
-  }
-  virtual void bind(Fresco::ServerContext_ptr) {}
-  virtual CORBA::Boolean supports(const Fresco::Kit::PropertySeq &);
-
-  void activate(::ServantBase *);
-  void deactivate(::ServantBase *);
-  PortableServer::POA_ptr _default_POA() { return DefaultPOA::_default_POA();}
 
-  virtual void increment();
-  virtual void decrement();
+  class ServerImpl;
+  class ServerContextImpl;
+  class ServantBase;
+  
+  class KitImpl : public virtual POA_Fresco::Kit,
+		  public virtual PortableServer::RefCountServantBase,
+		  private DefaultPOA
+  {
+      friend class ServerImpl;
+    public:
+      KitImpl(const std::string &,
+	      const Fresco::Kit::PropertySeq &, ServerContextImpl *);
+      ~KitImpl();
+      virtual KitImpl *clone(const Fresco::Kit::PropertySeq &,
+			     ServerContextImpl *) = 0;
+      const std::string &repo_id() const { return my_repo_id;}
+      virtual Fresco::Kit::PropertySeq *properties()
+      { return new Fresco::Kit::PropertySeq(*my_props); }
+      virtual void bind(Fresco::ServerContext_ptr) {}
+      virtual CORBA::Boolean supports(const Fresco::Kit::PropertySeq &);
+      
+      void activate(Berlin::ServantBase *);
+      void deactivate(Berlin::ServantBase *);
+      PortableServer::POA_ptr _default_POA()
+      { return DefaultPOA::_default_POA();}
 
-protected:
+      virtual void increment();
+      virtual void decrement();
+      
+    protected:
 
-  template <typename I, typename Im>
-  typename I::_ptr_type create(Im *impl)
-  {
-      return private_create<I>(impl);
-  } 
+      template <typename I, typename Im>
+      typename I::_ptr_type create(Im *impl)
+      { return private_create<I>(impl); } 
 
-  template <typename I, typename Im>
-  typename I::_ptr_type create(Im * impl, std::string n)
-  {
-      typename I::_ptr_type var = private_create<I>(impl);
-      Berlin::GraphicDictionary::instance()->add(var, impl, n);
-      return var;
-  }
+      template <typename I, typename Im>
+      typename I::_ptr_type create(Im * impl, std::string n)
+      {
+	  typename I::_ptr_type var = private_create<I>(impl);
+	  Berlin::GraphicDictionary::instance()->add(var, impl, n);
+	  return var;
+      }
 
-  template <typename I, typename Im>
-  typename I::_ptr_type create_and_set_body(Im *impl,
-					    Fresco::Graphic_ptr g,
-					    std::string n)
-  {
-      typename I::_ptr_type var = create<I>(impl, n);
-      var->body(g);
-      return var;
-  }
+      template <typename I, typename Im>
+      typename I::_ptr_type create_and_set_body(Im *impl,
+						Fresco::Graphic_ptr g,
+						std::string n)
+      {
+	  typename I::_ptr_type var = create<I>(impl, n);
+	  var->body(g);
+	  return var;
+      }
 
-private:
-  template <typename I, typename Im>
-  typename I::_ptr_type private_create(Im *impl)
-  {
-      activate(impl);
-      return impl->_this();
-  }
+    private:
+      template <typename I, typename Im>
+      typename I::_ptr_type private_create(Im *impl)
+      {
+	  activate(impl);
+	  return impl->_this();
+      }
 
-  void activate(PortableServer::POA_ptr);
-  void deactivate();
-  PortableServer::POA_var         my_poa;
-  const std::string               my_repo_id;
-  const Fresco::Kit::PropertySeq *my_props;
-  int                             my_refcount;
-  ServerContextImpl              *my_context;
-};
+      void activate(PortableServer::POA_ptr);
+      void deactivate();
+      PortableServer::POA_var         my_poa;
+      const std::string               my_repo_id;
+      const Fresco::Kit::PropertySeq *my_props;
+      int                             my_refcount;
+      ServerContextImpl              *my_context;
+  };
 
-// no implementation: If Graphics are given, then we need a string!
-template <>
-Fresco::Graphic_ptr
-KitImpl::create<Fresco::Graphic, GraphicImpl>(GraphicImpl * impl);
+  // no implementation: If Graphics are given, then we need a string!
+  template <>
+  Fresco::Graphic_ptr
+  KitImpl::create<Fresco::Graphic, GraphicImpl>(GraphicImpl * impl);
 
-template <typename T>
-inline T *create_prototype(const std::string &repo, std::string props[],
-			   size_t n)
-{
-  Fresco::Kit::PropertySeq properties;
-  properties.length(n/2);
-  for (size_t i = 0; i != n/2; ++i)
+  template <typename T>
+  inline T *create_prototype(const std::string &repo, std::string props[],
+			     size_t n)
   {
-    properties[i].name = CORBA::string_dup((props++)->c_str());
-    properties[i].value = CORBA::string_dup((props++)->c_str());
+      Fresco::Kit::PropertySeq properties;
+      properties.length(n/2);
+      for (size_t i = 0; i != n/2; ++i)
+      {
+	  properties[i].name = CORBA::string_dup((props++)->c_str());
+	  properties[i].value = CORBA::string_dup((props++)->c_str());
+      }
+      return new T(repo, properties, 0);
   }
-  return new T(repo, properties, 0);
-}
+
+} // namespace
 
 #endif

Index: LRUCache.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/LRUCache.hh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- LRUCache.hh	2 Jun 2002 23:42:15 -0000	1.4
+++ LRUCache.hh	29 Dec 2003 08:03:18 -0000	1.5
@@ -1,55 +1,83 @@
-#ifndef _LRUCache_hh
-#define _LRUCache_hh
+/*$Id$
+ *
+ * This source file is a part of the Fresco Project.
+ * Copyright (C) 2000 Stefan Seefeld <[email protected]> 
+ * http://www.fresco.org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
+ * MA 02139, USA.
+ */
+#ifndef _Berlin_LRUCache_hh
+#define _Berlin_LRUCache_hh
 
 #include <map>
 #include <list>
 
-/* this is an ultra-simple LRU cache. it requires that your key objects are
-  comparable by <, that your value objects are lightweight enough to be handled
-  by value, you have a factory object for your value type which has 2 methods:
-  produce (which takes a single parameter of key type and copies into it) and
-  recycle (which takes a single parameter of value type and frees its storage),
-  and you do synchronizaiton externally.
-  
-  on the other hand, it's very simple to use.  */
-
-template 
-<class kT, class vT, class factoryT, class cacheT = std::map<kT,vT> > 
-class LRUCache {
+namespace Berlin
+{
 
-private:
-  unsigned int max;
-  cacheT cache;
-  std::list<kT> queue;
-  factoryT factory;
+  /* this is an ultra-simple LRU cache. it requires that your key objects
+   * are comparable by <, that your value objects are lightweight enough
+   * to be handled by value, you have a factory object for your value type
+   * which has 2 methods: produce (which takes a single parameter of key
+   * type and copies into it) and recycle (which takes a single parameter
+   * of value type and frees its storage), and you do synchronizaiton
+   * externally.
+   *
+   * On the other hand, it's very simple to use.
+   */
 
-public:
+  template 
+  <class kT, class vT, class factoryT, class cacheT = std::map<kT,vT> > 
+  class LRUCache
+  {
+    private:
+      unsigned int my_max;
+      cacheT my_cache;
+      std::list<kT> my_queue;
+      factoryT my_factory;
 
-  LRUCache(factoryT fact, unsigned int i = 256) : max(i), factory(fact) {}
+    public:
+      LRUCache(factoryT fact, unsigned int i = 256) :
+	  my_max(i), my_factory(fact)
+      { }
 
-  void get(const kT &k, vT &v) throw () 
-  {
-    typename cacheT::iterator iter = cache.find(k);
-    if (iter != cache.end())
-      {
-	v = iter->second;
-	return;
-      }
-    else
+      void get(const kT &k, vT &v) throw () 
       {
-	v = factory.produce(k);
-	cache.insert(std::pair<kT,vT>(k,v));
-	queue.push_front(k);
-	if (queue.size() >= max)
+	  typename cacheT::iterator iter = my_cache.find(k);
+	  if (iter != my_cache.end())
 	  {
-	    kT victim = queue.back();
-	    factory.recycle(cache[victim]);
-	    cache.erase(victim);
-	    queue.pop_back();
+	      v = iter->second;
+	      return;
+	  }
+	  else
+	  {
+	      v = my_factory.produce(k);
+	      my_cache.insert(std::pair<kT,vT>(k,v));
+	      my_queue.push_front(k);
+	      if (my_queue.size() >= my_max)
+	      {
+		  kT victim = my_queue.back();
+		  my_factory.recycle(my_cache[victim]);
+		  my_cache.erase(victim);
+		  my_queue.pop_back();
+	      }
 	  }
       }
-  }
-};
+  };
 
+} // namespace
 
 #endif

Index: Logger.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Logger.hh,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- Logger.hh	3 Nov 2003 20:45:41 -0000	1.19
+++ Logger.hh	29 Dec 2003 08:03:18 -0000	1.20
@@ -28,67 +28,101 @@
 #include "Prague/Sys/Thread.hh"
 #include "Fresco/config.hh"
 
-class Logger
-//. this is a rewrite of our debugging class to use some NANA features.  the idea
-//. is that what was previously just a matter of writing to stderr, we now log
-//. *everything* to an internal buffer, and only write to stderr if the group
-//. you're writing to is enabled. Then when the system keels over, we dump the
-//. in-core log and ask users to mail it to us, as a bug report
+namespace Berlin
 {
-public:
-  enum group
-  { corba, loader, console, traversal, thread,
-    lifecycle, agent, message, command,
-    subject, observer, text, widget,
-    image, figure, layout, drawing, desktop,
-    picking, focus, geometry};
-private:
-  struct streamlock;
-  friend struct streamlock;
-  template <class T>
-  static void write(group g, const T &t)
-    {
-      los << t;
-      if (active[g]) std::cerr << t;
-    }
-  static const int numGroups = 21;
-public:
-  static void set(group g) { active[g] = true; }
-  static void clear(group g) { active[g] = false; }
-  static void setall() { for (int i = 0; i < numGroups; i++) active[i] = true;}
-  static streamlock log(group g)
-    {
-      streamlock slock(g);
-      write(g, '[');
-      write(g, static_cast<double>(Prague::Time::currentTime() - start));
-      write(g, ':');
-      write(g, Prague::Thread::id());
-      write(g, ':');
-      write(g, groupname[g]);
-      write(g, "]\t");
-      return slock;
-    } 
-  static void dump(std::ostream &);
-protected:
-private:
-  struct streamlock
+
+  class Logger
+  //. this is a rewrite of our debugging class to use some NANA features.
+  //. The idea is that what was previously just a matter of writing to
+  //. stderr, we now log *everything* to an internal buffer, and only
+  //. write to stderr if the group you're writing to is enabled. Then
+  //. when the system keels over, we dump the in-core log and ask users
+  //, to mail it to us, as a bug report,
   {
-    streamlock(group gg) : owner(true), g(gg) { Logger::mutex.lock();}
-    streamlock(const streamlock &sl) : owner(true), g(sl.g) { sl.owner = false;}
-    ~streamlock() { if (owner) Logger::mutex.unlock();}
-    mutable bool owner;
-    group g;
+    public:
+      enum group
+      {
+	  corba,
+	  loader,
+	  console,
+	  traversal,
+	  thread,
+	  lifecycle,
+	  agent,
+	  message,
+	  command,
+	  subject,
+	  observer,
+	  text,
+	  widget,
+	  image,
+	  figure,
+	  layout,
+	  drawing,
+	  desktop,
+	  picking,
+	  focus,
+	  geometry
+      };
+    private:
+      struct streamlock;
+      friend struct streamlock;
+      template <class T>
+      static void write(group g, const T &t)
+      {
+	  my_los << t;
+	  if (my_active[g]) std::cerr << t;
+      }
+      static const int my_numGroups = 21;
+    public:
+      static void set(group g) { my_active[g] = true; }
+      static void clear(group g) { my_active[g] = false; }
+      static void setall()
+      { for (int i = 0; i < my_numGroups; i++) my_active[i] = true; }
+      static streamlock log(group g)
+      {
+	  streamlock slock(g);
+	  write(g, '[');
+	  write(g, static_cast<double>(Prague::Time::currentTime() -
+				       my_start));
+	  write(g, ':');
+	  write(g, Prague::Thread::id());
+	  write(g, ':');
+	  write(g, my_groupname[g]);
+	  write(g, "]\t");
+	  return slock;
+      } 
+      static void dump(std::ostream &);
+    protected:
+    private:
+      struct streamlock
+      {
+	  streamlock(group gg) :
+	      owner(true), g(gg)
+	  { Logger::my_mutex.lock(); }
+	  streamlock(const streamlock &sl) :
+	      owner(true), g(sl.g)
+	  { sl.owner = false; }
+	  ~streamlock() { if (owner) Logger::my_mutex.unlock(); }
+	  mutable bool owner;
+	  group g;
+      };
+      friend const streamlock &
+      operator << (const streamlock &sl,
+		   std::ostream & (func)(std::ostream &))
+      { Logger::write(sl.g, func); return sl; }
+      template <class T>
+      friend const streamlock &
+      operator << (const streamlock &sl, const T &t)
+      { Logger::write(sl.g, t); return sl;}
+      static bool my_active[my_numGroups];
+      static const char *my_groupname[my_numGroups]; 
+      static Prague::logbuf my_buf;
+      static Prague::logstream my_los;
+      static Prague::Time my_start;
+      static Prague::Mutex my_mutex;
   };
-  friend const streamlock &operator << (const streamlock &sl, std::ostream & (func)(std::ostream &))
-    { Logger::write(sl.g, func); return sl;}
-  template <class T>
-  friend const streamlock &operator << (const streamlock &sl, const T &t) { Logger::write(sl.g, t); return sl;}
-  static bool active[numGroups];
-  static const char *groupname[numGroups]; 
-  static Prague::logbuf buf;
-  static Prague::logstream los;
-  static Prague::Time start;
-  static Prague::Mutex mutex;
-};
 
-#endif /* _Logger_hh */
+} // namespace
+
+#endif

Index: Math.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Math.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Math.hh	29 May 2002 06:49:38 -0000	1.7
+++ Math.hh	29 Dec 2003 08:03:18 -0000	1.8
@@ -30,33 +30,42 @@
 
 namespace Math
 {
+
   const double pi = M_PI;
-  template <class T> inline T min(T a, T b) { return a < b ? a : b;}
-  template <class T> inline T max(T a, T b) { return a < b ? b : a;}
+  template <class T> inline T min(T a, T b) { return a < b ? a : b; }
+  template <class T> inline T max(T a, T b) { return a < b ? b : a; }
 
-  template <class T> inline T min(T a, T b, const T &c, const T &d) { return min(min(a, b), min(c, d));}
-  template <class T> inline T max(T a, T b, const T &c, const T &d) { return max(max(a, b), max(c, d));}
+  template <class T> inline T min(T a, T b, const T &c, const T &d)
+  { return min(min(a, b), min(c, d)); }
+  template <class T> inline T max(T a, T b, const T &c, const T &d)
+  { return max(max(a, b), max(c, d)); }
 
-  inline float abs(float a) { return fabs(a);}
-  inline double abs(double a) { return fabs(a);}
-  inline int abs(int a) { return abs(a);}
-  inline long abs(long a) { return labs(a);}
+  inline float abs(float a) { return fabs(a); }
+  inline double abs(double a) { return fabs(a); }
+  inline int abs(int a) { return abs(a); }
+  inline long abs(long a) { return labs(a); }
 
-  template <class T> inline int round(T a) { return a > 0 ? static_cast<int>(a + 0.5) : - static_cast<int>(-a + 0.5);}
-  template <class T> inline bool equal(T a, T b, T e) { return a - b < e && b - a < e;}
+  template <class T> inline int round(T a)
+  {
+      return a > 0 ? static_cast<int>(a + 0.5) :
+                     - static_cast<int>(-a + 0.5);
+  }
+  template <class T> inline bool equal(T a, T b, T e)
+  { return a - b < e && b - a < e; }
 
   //. general orthogonal matrix transformation
   //. needs to be refined for perspective trafos
-  inline Fresco::Vertex &operator *= (Fresco::Vertex &v, const Fresco::Transform::Matrix &m)
+  inline Fresco::Vertex &operator *= (Fresco::Vertex &v,
+				      const Fresco::Transform::Matrix &m)
   {
-    Fresco::Coord tx = v.x;
-    Fresco::Coord ty = v.y;
-    v.x = m[0][0] * tx + m[0][1] * ty + m[0][2] * v.z + m[0][3];
-    v.y = m[1][0] * tx + m[1][1] * ty + m[1][2] * v.z + m[1][3];
-    v.z = m[2][0] * tx + m[2][1] * ty + m[2][2] * v.z + m[2][3];
-    return v;
+      Fresco::Coord tx = v.x;
+      Fresco::Coord ty = v.y;
+      v.x = m[0][0] * tx + m[0][1] * ty + m[0][2] * v.z + m[0][3];
+      v.y = m[1][0] * tx + m[1][1] * ty + m[1][2] * v.z + m[1][3];
+      v.z = m[2][0] * tx + m[2][1] * ty + m[2][2] * v.z + m[2][3];
+      return v;
   }
 
-};
+} // namespace
 
 #endif

Index: MonoGraphic.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/MonoGraphic.hh,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- MonoGraphic.hh	29 May 2002 06:49:38 -0000	1.18
+++ MonoGraphic.hh	29 Dec 2003 08:03:18 -0000	1.19
@@ -24,30 +24,36 @@
 
 #include <Berlin/GraphicImpl.hh>
 
-class MonoGraphic : public GraphicImpl
+namespace Berlin
 {
-public:
-  MonoGraphic();
-  virtual ~MonoGraphic();
-
-  virtual Fresco::Graphic_ptr body();
-  virtual void body(Fresco::Graphic_ptr);
-  virtual void append_graphic(Fresco::Graphic_ptr);
-  virtual void prepend_graphic(Fresco::Graphic_ptr);
-  virtual void remove_graphic(Fresco::Tag);
-  virtual void remove_child_graphic(Fresco::Tag);
-  virtual Fresco::GraphicIterator_ptr first_child_graphic();
-  virtual Fresco::GraphicIterator_ptr last_child_graphic();
 
-  virtual Fresco::Transform_ptr transformation();
-  virtual void request(Fresco::Graphic::Requisition &);
-  virtual void extension(const Fresco::Allocation::Info &, Fresco::Region_ptr);
-  virtual void shape(Fresco::Region_ptr);
-
-  virtual void traverse(Fresco::Traversal_ptr);
-protected:
-  Edge          _child;
-  Prague::Mutex _mutex;
-};
+  class MonoGraphic : public GraphicImpl
+  {
+    public:
+      MonoGraphic();
+      virtual ~MonoGraphic();
+      
+      virtual Fresco::Graphic_ptr body();
+      virtual void body(Fresco::Graphic_ptr);
+      virtual void append_graphic(Fresco::Graphic_ptr);
+      virtual void prepend_graphic(Fresco::Graphic_ptr);
+      virtual void remove_graphic(Fresco::Tag);
+      virtual void remove_child_graphic(Fresco::Tag);
+      virtual Fresco::GraphicIterator_ptr first_child_graphic();
+      virtual Fresco::GraphicIterator_ptr last_child_graphic();
+      
+      virtual Fresco::Transform_ptr transformation();
+      virtual void request(Fresco::Graphic::Requisition &);
+      virtual void extension(const Fresco::Allocation::Info &,
+			     Fresco::Region_ptr);
+      virtual void shape(Fresco::Region_ptr);
+      
+      virtual void traverse(Fresco::Traversal_ptr);
+    protected:
+      Edge          my_child;
+      Prague::Mutex my_mutex;
+  };
+  
+} // namespace
 
 #endif 

Index: NonPositionalFocus.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/NonPositionalFocus.hh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- NonPositionalFocus.hh	29 May 2002 06:49:38 -0000	1.15
+++ NonPositionalFocus.hh	29 Dec 2003 08:03:18 -0000	1.16
@@ -31,29 +31,34 @@
 #include <Berlin/FocusImpl.hh>
 #include <vector>
 
-class ScreenImpl;
-
-class NonPositionalFocus : public FocusImpl
+namespace Berlin
 {
-  typedef std::vector<Fresco::Controller_var> cstack_t;
- public:
-  NonPositionalFocus(Fresco::Input::Device, Fresco::Controller_ptr);
-  virtual ~NonPositionalFocus();
 
-  virtual void grab() {}
-  virtual void ungrab() {}
-  virtual void set_cursor(Fresco::Raster_ptr) {}
-  virtual void add_filter(Fresco::Input::Filter_ptr);
+  class ScreenImpl;
+  
+  class NonPositionalFocus : public FocusImpl
+  {
+      typedef std::vector<Fresco::Controller_var> cstack_t;
+    public:
+      NonPositionalFocus(Fresco::Input::Device, Fresco::Controller_ptr);
+      virtual ~NonPositionalFocus();
+      
+      virtual void grab() { }
+      virtual void ungrab() { }
+      virtual void set_cursor(Fresco::Raster_ptr) { }
+      virtual void add_filter(Fresco::Input::Filter_ptr);
+      
+      virtual bool request(Fresco::Controller_ptr);
+      virtual void restore(Fresco::Region_ptr) { }
+      virtual void damage(Fresco::Region_ptr) { }
+      virtual void dispatch(Fresco::Input::Event &);
+    protected:
+      virtual void activate_composite();
+    private:
+      cstack_t      my_controllers;
+      Prague::Mutex my_mutex;
+  };
 
-  virtual bool request(Fresco::Controller_ptr);
-  virtual void restore(Fresco::Region_ptr) {}
-  virtual void damage(Fresco::Region_ptr) {}
-  virtual void dispatch(Fresco::Input::Event &);
-protected:
-  virtual void activate_composite();
-private:
-  cstack_t      _controllers;
-  Prague::Mutex _mutex;
-};
+} // namespace
 
 #endif 

Index: ObjectCache.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ObjectCache.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ObjectCache.hh	2 Jun 2002 23:42:15 -0000	1.5
+++ ObjectCache.hh	29 Dec 2003 08:03:18 -0000	1.6
@@ -19,81 +19,88 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _ObjectCache_hh
-#define _ObjectCache_hh
+#ifndef _Berlin_ObjectCache_hh
+#define _Berlin_ObjectCache_hh
 
 #include <vector>
 #include <list>
 #include <map>
 #include <algorithm>
 
-template <typename Remote, typename Local>
-struct DefaultObjectCacheTrait
+namespace Berlin
 {
-  static Local *create(Remote &r) { return new Local(r);}
-  static Remote remote(Local *l) { return l->remote;}
-};
 
-template <typename Remote, typename Local, typename Trait = DefaultObjectCacheTrait<Remote, Local> >
-class ObjectCache
-{
-  typedef std::vector<Local *> bucket_t;
-  typedef long hash_t;
-  typedef std::map<hash_t, bucket_t> cache_t;
-  typedef std::list<Local *> counter_t;
-  struct Predicate
+  template <typename Remote, typename Local>
+  struct DefaultObjectCacheTrait
   {
-    Predicate(Remote r) : remote(r) {}
-    bool operator () (Local *l) const { return remote->_is_equivalent(Trait::remote(l));}
-    Remote remote;
+      static Local *create(Remote &r) { return new Local(r); }
+      static Remote remote(Local *l) { return l->remote; }
   };
-public:
-  ObjectCache(int i, int b = 193) : _items(i), _buckets(b) {}
-  ~ObjectCache() { reduce(0);}
-  Local *lookup(Remote);
-  void reduce(int);
-private:
-  int       _items;
-  int       _buckets;
-  cache_t   _cache;
-  counter_t _counter;
-};
 
-/*
- * returns a cached form of r, creating it if necessary.
- * the local is moved to the end of the counter list so
- * we can eventually remove items from the head to reduce
- * the size of the cache elemminating the items not used
- * for the longest time
- */
-template <typename Remote, typename Local, typename Trait>
-inline Local *ObjectCache<Remote, Local, Trait>::lookup(Remote r)
-{
-  hash_t hash = r->_hash(_buckets);
-  bucket_t &bucket = _cache[hash];
-  typename bucket_t::iterator i =
-    find_if(bucket.begin(), bucket.end(), Predicate(r));
-  if (i == bucket.end())
-    {
-      Local *local = Trait::create(r);
-      bucket.push_back(local);
-      return bucket.back();
-    }
-  else
-    {
-      return *i;
-    }
-}
+  template <typename Remote, typename Local,
+	    typename Trait = DefaultObjectCacheTrait<Remote, Local> >
+  class ObjectCache
+  {
+      typedef std::vector<Local *> bucket_t;
+      typedef long hash_t;
+      typedef std::map<hash_t, bucket_t> cache_t;
+      typedef std::list<Local *> counter_t;
+      struct Predicate
+      {
+	  Predicate(Remote r) : remote(r) { }
+	  bool operator () (Local *l) const
+	  { return remote->_is_equivalent(Trait::remote(l));}
+	  Remote remote;
+      };
+    public:
+      ObjectCache(int i, int b = 193) : my_items(i), my_buckets(b) { }
+      ~ObjectCache() { reduce(0); }
+      Local *lookup(Remote);
+      void reduce(int);
+    private:
+      int       my_items;
+      int       my_buckets;
+      cache_t   my_cache;
+      counter_t my_counter;
+  };
 
-/*
- * reduce the cache to the new size
- * removing the items which have not been
- * used for the longest period first
- */
-template <typename Remote, typename Local, typename Trait>
-inline void ObjectCache<Remote, Local, Trait>::reduce(int size)
-{
-  //...to be implemented...
-}
+  /*
+   * returns a cached form of r, creating it if necessary.
+   * the local is moved to the end of the counter list so
+   * we can eventually remove items from the head to reduce
+   * the size of the cache elemminating the items not used
+   * for the longest time
+   */
+  template <typename Remote, typename Local, typename Trait>
+  inline Local *ObjectCache<Remote, Local, Trait>::lookup(Remote r)
+  {
+      hash_t hash = r->_hash(my_buckets);
+      bucket_t &bucket = my_cache[hash];
+      typename bucket_t::iterator i =
+	  find_if(bucket.begin(), bucket.end(), Predicate(r));
+      if (i == bucket.end())
+      {
+	  Local *local = Trait::create(r);
+	  bucket.push_back(local);
+	  return bucket.back();
+      }
+      else
+      {
+	  return *i;
+      }
+  }
+
+  /*
+   * reduce the cache to the new size
+   * removing the items which have not been
+   * used for the longest period first
+   */
+  template <typename Remote, typename Local, typename Trait>
+  inline void ObjectCache<Remote, Local, Trait>::reduce(int size)
+  {
+      // FIXME: ...to be implemented...
+  }
+  
+} // namespace
 
 #endif

Index: ObjectVar.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ObjectVar.hh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ObjectVar.hh	24 Jul 2000 23:32:11 -0000	1.2
+++ ObjectVar.hh	29 Dec 2003 08:03:18 -0000	1.3
@@ -19,43 +19,51 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _Object_var_hh
-#define _Object_var_hh
+#ifndef _Berlin_Object_var_hh
+#define _Berlin_Object_var_hh
 
 #include <Warsaw/config.hh>
 #include <Warsaw/Types.hh>
 
-template <typename T>
-class Object_var
+namespace Berlin
 {
-  typedef typename T::_ptr_type T_ptr;
-public:
-  explicit Object_var(T_ptr tt = 0) : t(tt) {}
-  Object_var(const Object_var &o) : t(T::_duplicate(o.t)) { if (!CORBA::_is_nil(t)) t->increment();}
-  Object_var &operator = (Object_var &o)
-    {
-      if (&o != this)
-        {
-          if (!CORBA::_is_nil(t)) t->decrement(), CORBA::release(t);
-          t = T::_duplicate(o.t);
-	  if (!CORBA::_is_nil(t)) t->increase();
-        }
-      return *this;
-    }
-  ~Object_var() { if (!CORBA::_is_nil(t)) t->decrement(), CORBA::release(t);}
-  Object_var &operator = (T_ptr tt)
-    {
-      if (!CORBA::_is_nil(t)) t->decrement(), CORBA::release(t);
-      t = tt;
-      return *this;
-    }
-  T_ptr get() const { return t;}
-  T &operator *() const { return *t;}
-  T *operator->() const { return  t;}
-  operator T_ptr () const { return  t;}
-  T_ptr _retn() { T_ptr tmp = t; t = 0; return tmp;}
-private:
-  T_ptr t;
-};
 
+  template <typename T>
+  class Object_var
+  {
+      typedef typename T::_ptr_type T_ptr;
+    public:
+      explicit Object_var(T_ptr tt = 0) : t(tt) {}
+      Object_var(const Object_var &o) :
+	  t(T::_duplicate(o.t))
+      { if (!CORBA::_is_nil(t)) t->increment(); }
+      Object_var &operator = (Object_var &o)
+      {
+	  if (&o != this)
+	  {
+	      if (!CORBA::_is_nil(t)) t->decrement(), CORBA::release(t);
+	      t = T::_duplicate(o.t);
+	      if (!CORBA::_is_nil(t)) t->increase();
+	  }
+	  return *this;
+      }
+      ~Object_var()
+      { if (!CORBA::_is_nil(t)) t->decrement(), CORBA::release(t); }
+      Object_var &operator = (T_ptr tt)
+      {
+	  if (!CORBA::_is_nil(t)) t->decrement(), CORBA::release(t);
+	  t = tt;
+	  return *this;
+      }
+      T_ptr get() const { return t; }
+      T &operator *() const { return *t; }
+      T *operator->() const { return  t; }
+      operator T_ptr () const { return  t; }
+      T_ptr _retn() { T_ptr tmp = t; t = 0; return tmp; }
+    private:
+      T_ptr t;
+  };
+
+} // namespace
+  
 #endif

Index: ObserverImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ObserverImpl.hh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ObserverImpl.hh	29 May 2002 06:49:38 -0000	1.2
+++ ObserverImpl.hh	29 Dec 2003 08:03:18 -0000	1.3
@@ -19,8 +19,8 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _ObserverImpl_hh
-#define _ObserverImpl_hh
+#ifndef _Berlin_ObserverImpl_hh
+#define _Berlin_ObserverImpl_hh
 
 #include <Fresco/config.hh>
 #include <Fresco/Observer.hh>
@@ -28,12 +28,17 @@
 #include <Berlin/ServantBase.hh>
 #include <Berlin/IdentifiableImpl.hh>
 
-class ObserverImpl : public virtual POA_Fresco::Observer,
-		     public virtual ServantBase,
-		     public virtual IdentifiableImpl
+namespace Berlin
 {
-public:
-  virtual void destroy() { deactivate();}
-};
+
+  class ObserverImpl : public virtual POA_Fresco::Observer,
+		       public virtual ServantBase,
+		       public virtual IdentifiableImpl
+  {
+    public:
+      virtual void destroy() { deactivate(); }
+  };
+
+} // namespace
 
 #endif 

Index: PNG.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/PNG.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- PNG.hh	20 Feb 2003 02:36:46 -0000	1.5
+++ PNG.hh	29 Dec 2003 08:03:18 -0000	1.6
@@ -28,54 +28,69 @@
 #include <png.h>
 #include <string>
 
-class PNG
+namespace Berlin
 {
-  class ibuf;
-  class obuf;
-  class Encoder;
-  class Decoder;
-public:
-  enum color_t { gray = PNG_COLOR_TYPE_GRAY,
-		 grayalpha = PNG_COLOR_TYPE_GRAY_ALPHA,
-		 palette = PNG_COLOR_TYPE_PALETTE,
-		 rgb = PNG_COLOR_TYPE_RGB,
-		 rgbalpha = PNG_COLOR_TYPE_RGB_ALPHA,
-		 maskpalette = PNG_COLOR_MASK_PALETTE,
-		 maskcolor = PNG_COLOR_MASK_COLOR,
-		 maskalpha = PNG_COLOR_MASK_ALPHA};
-  enum interlace_t { none = PNG_INTERLACE_NONE,
-		     adam7 = PNG_INTERLACE_ADAM7,
-		     last = PNG_INTERLACE_LAST};
-  PNG();
-  PNG(const Fresco::Raster::Info &);
-  ~PNG();
-  unsigned char **empty();
-  void clear();
-  void header(Fresco::Raster::Info &);
-  Fresco::Raster::Data *marshal(unsigned char *const *);
-  unsigned char **demarshal(const Fresco::Raster::Data &);
-  Fresco::Color pixel(unsigned long, unsigned long, unsigned char *const *);
-  void pixel(unsigned long, unsigned long, const Fresco::Color &, 
-             unsigned char **);
-  Fresco::Raster::ColorSeq *pixels(unsigned long, unsigned long, unsigned long, 
-                                   unsigned long, unsigned char *const *);
-  void pixels(unsigned long, unsigned long, unsigned long,
-              unsigned long, const Fresco::Raster::ColorSeq &,
-              unsigned char **);
-  unsigned char **read(const std::string &);
-  void write(const std::string &, unsigned char *const *);
-private:
-  void palette_to_rgbalpha(const unsigned char *, const unsigned char *, 
-                           unsigned char *);
-  void gray_to_rgbalpha(const unsigned char *, const unsigned char *, 
-                        unsigned char *);
-  void grayalpha_to_rgbalpha(const unsigned char *, const unsigned char *, 
-                             unsigned char *);
-  void rgb_to_rgbalpha(const unsigned char *, const unsigned char *, 
-                       unsigned char *);
-  png_structp _rpng;
-  png_infop   _rinfo;
-  png_infop   _rend;
-};
+
+  class PNG
+  {
+      class ibuf;
+      class obuf;
+      class Encoder;
+      class Decoder;
+    public:
+      enum color_t
+      { 
+	  gray = PNG_COLOR_TYPE_GRAY,
+	  grayalpha = PNG_COLOR_TYPE_GRAY_ALPHA,
+	  palette = PNG_COLOR_TYPE_PALETTE,
+	  rgb = PNG_COLOR_TYPE_RGB,
+	  rgbalpha = PNG_COLOR_TYPE_RGB_ALPHA,
+	  maskpalette = PNG_COLOR_MASK_PALETTE,
+	  maskcolor = PNG_COLOR_MASK_COLOR,
+	  maskalpha = PNG_COLOR_MASK_ALPHA
+      };
+      enum interlace_t
+      {
+	  none = PNG_INTERLACE_NONE,
+	  adam7 = PNG_INTERLACE_ADAM7,
+	  last = PNG_INTERLACE_LAST
+      };
+      PNG();
+      PNG(const Fresco::Raster::Info &);
+      ~PNG();
+      unsigned char **empty();
+      void clear();
+      void header(Fresco::Raster::Info &);
+      Fresco::Raster::Data *marshal(unsigned char *const *);
+      unsigned char **demarshal(const Fresco::Raster::Data &);
+      Fresco::Color pixel(unsigned long, unsigned long,
+			  unsigned char *const *);
+      void pixel(unsigned long, unsigned long, const Fresco::Color &, 
+		 unsigned char **);
+      Fresco::Raster::ColorSeq *pixels(unsigned long, unsigned long,
+				       unsigned long, unsigned long,
+				       unsigned char *const *);
+      void pixels(unsigned long, unsigned long, unsigned long,
+		  unsigned long, const Fresco::Raster::ColorSeq &,
+		  unsigned char **);
+      unsigned char **read(const std::string &);
+      void write(const std::string &, unsigned char *const *);
+    private:
+      void palette_to_rgbalpha(const unsigned char *,
+			       const unsigned char *, 
+			       unsigned char *);
+      void gray_to_rgbalpha(const unsigned char *, const unsigned char *, 
+			    unsigned char *);
+      void grayalpha_to_rgbalpha(const unsigned char *,
+				 const unsigned char *, 
+				 unsigned char *);
+      void rgb_to_rgbalpha(const unsigned char *, const unsigned char *, 
+			   unsigned char *);
+      png_structp my_rpng;
+      png_infop   my_rinfo;
+      png_infop   my_rend;
+  };
+
+} // namespace
 
 #endif

Index: PickTraversalImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/PickTraversalImpl.hh,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- PickTraversalImpl.hh	29 May 2002 06:49:38 -0000	1.33
+++ PickTraversalImpl.hh	29 Dec 2003 08:03:18 -0000	1.34
@@ -33,97 +33,107 @@
 #include <Berlin/Vertex.hh>
 #include <Prague/Sys/Tracer.hh>
 
-class PositionalFocus;
-
-//. provide an implementation for the PickTraversal interface.
-//. the traversal keeps a stack of controllers that are on the trail
-//.
-//. some methods are not implemented:
-//. 'intersect_region' has to be implemented if the intersecting object
-//. is known (for example a region for node selections, or a vertex for
-//. positional events
-//. the 'hit()' method needs to be implemented as it adds a specific
-//. strategy for generating a memento. Derived classes may want to
-//. cache the memento to avoid frequent object activation
-class PickTraversalImpl : public virtual POA_Fresco::PickTraversal,
-                          public TraversalImpl
+namespace Berlin
 {
-  typedef std::vector<Fresco::Controller_var> cstack_t;
-  typedef std::vector<size_t> pstack_t;
-public:
-  PickTraversalImpl(Fresco::Graphic_ptr, Fresco::Region_ptr, Fresco::Transform_ptr, PositionalFocus *);
-  PickTraversalImpl(const PickTraversalImpl &);
-  ~PickTraversalImpl();
-  PickTraversalImpl &operator = (const PickTraversalImpl &);
-  virtual Fresco::PickTraversal_ptr _this();
-  virtual Fresco::Region_ptr current_allocation();
-  virtual Fresco::Transform_ptr current_transformation();
-  virtual Fresco::Graphic_ptr current_graphic();
-  virtual void traverse_child(Fresco::Graphic_ptr, Fresco::Tag, Fresco::Region_ptr, Fresco::Transform_ptr);
-  virtual void visit(Fresco::Graphic_ptr);
-  virtual Fresco::Traversal::order direction();
-  virtual CORBA::Boolean ok();
-  virtual CORBA::Boolean intersects_allocation();
-//   virtual CORBA::Boolean intersects_region(Fresco::Region_ptr) = 0;
-  virtual void enter_controller(Fresco::Controller_ptr);
-  virtual void leave_controller();
-  virtual void hit() = 0;
-  virtual CORBA::Boolean picked() = 0;
-  virtual Fresco::Focus_ptr get_focus();
-  virtual CORBA::Boolean forward();
-  virtual CORBA::Boolean backward();
 
-  void pop_controller();
-  Fresco::Controller_ptr top_controller();
-  const std::vector<Fresco::Controller_var> &controllers() const { return _controllers;}
-  void reinit();
-protected:
-  size_t current() const { return _cursor;}
-private:
-  cstack_t                   _controllers;
-  pstack_t                   _positions;
-  PositionalFocus           *_focus;
-  size_t                     _cursor;
-  Fresco::PickTraversal_var __this;
-};
+  class PositionalFocus;
 
-//. remove one controller level from the top, it might have got out of scope
-inline void PickTraversalImpl::pop_controller()
-{
-  Prague::Trace trace("PickTraversal::pop_controller");
-  if (_controllers.size())
-    {
-      while (size() > _positions.back()) pop();
-      _cursor = size() - 1;
-      _controllers.pop_back();
-      _positions.pop_back();
-    }
-}
+  //. provide an implementation for the PickTraversal interface.
+  //. the traversal keeps a stack of controllers that are on the trail
+  //.
+  //. some methods are not implemented:
+  //. 'intersect_region' has to be implemented if the intersecting object
+  //. is known (for example a region for node selections, or a vertex for
+  //. positional events
+  //. the 'hit()' method needs to be implemented as it adds a specific
+  //. strategy for generating a memento. Derived classes may want to
+  //. cache the memento to avoid frequent object activation
+  class PickTraversalImpl : public virtual POA_Fresco::PickTraversal,
+			    public TraversalImpl
+  {
+      typedef std::vector<Fresco::Controller_var> cstack_t;
+      typedef std::vector<size_t> pstack_t;
+    public:
+      PickTraversalImpl(Fresco::Graphic_ptr, Fresco::Region_ptr,
+			Fresco::Transform_ptr, PositionalFocus *);
+      PickTraversalImpl(const PickTraversalImpl &);
+      ~PickTraversalImpl();
+      PickTraversalImpl &operator = (const PickTraversalImpl &);
+      virtual Fresco::PickTraversal_ptr _this();
+      virtual Fresco::Region_ptr current_allocation();
+      virtual Fresco::Transform_ptr current_transformation();
+      virtual Fresco::Graphic_ptr current_graphic();
+      virtual void traverse_child(Fresco::Graphic_ptr, Fresco::Tag,
+				  Fresco::Region_ptr, Fresco::Transform_ptr);
+      virtual void visit(Fresco::Graphic_ptr);
+      virtual Fresco::Traversal::order direction();
+      virtual CORBA::Boolean ok();
+      virtual CORBA::Boolean intersects_allocation();
+//      virtual CORBA::Boolean intersects_region(Fresco::Region_ptr) = 0;
+      virtual void enter_controller(Fresco::Controller_ptr);
+      virtual void leave_controller();
+      virtual void hit() = 0;
+      virtual CORBA::Boolean picked() = 0;
+      virtual Fresco::Focus_ptr get_focus();
+      virtual CORBA::Boolean forward();
+      virtual CORBA::Boolean backward();
+      
+      void pop_controller();
+      Fresco::Controller_ptr top_controller();
+      const std::vector<Fresco::Controller_var> &controllers() const
+      { return my_controllers; }
+      void reinit();
+    protected:
+      size_t current() const { return my_cursor; }
+    private:
+      cstack_t                   my_controllers;
+      pstack_t                   my_positions;
+      PositionalFocus           *my_focus;
+      size_t                     my_cursor;
+      Fresco::PickTraversal_var  my_this;
+  };
 
-inline void PickTraversalImpl::reinit()
-{
-  // DO NOT CALL DURING A TRAVERSAL!
-  
-  // At the end of the Traversal only the very first element is on the stack
-  // i(and we won't touch that), or this is a memento of another Traversal.
-  // In that case we own Graphic, Transformation and Allocation, so we
-  // must explicitly release them before calling pop().
-  Prague::Trace trace("PickTraversal::reinit");
-  _controllers.clear();
-  _positions.clear();
-  while (size() > 1)
-    {
-      CORBA::release(get_graphic(size() - 1));
-      Provider<RegionImpl>::adopt(get_allocation(size() - 1));
-      Provider<TransformImpl>::adopt(get_transformation(size() - 1));
-      pop();
-    }
-  _cursor = 0;
-}
+  //. remove one controller level from the top, it might have got out of scope
+  inline void PickTraversalImpl::pop_controller()
+  {
+      Prague::Trace trace("PickTraversal::pop_controller");
+      if (my_controllers.size())
+      {
+	  while (size() > my_positions.back()) pop();
+	  my_cursor = size() - 1;
+	  my_controllers.pop_back();
+	  my_positions.pop_back();
+      }
+  }
 
-inline Fresco::Controller_ptr PickTraversalImpl::top_controller()
-{
-  return _controllers.size() ? Fresco::Controller::_duplicate(_controllers.back()) : Fresco::Controller::_nil();
-}
+  inline void PickTraversalImpl::reinit()
+  {
+      // DO NOT CALL DURING A TRAVERSAL!
+      
+      // At the end of the Traversal only the very first element is on the
+      // stack (and we won't touch that), or this is a memento of another
+      // Traversal. In that case we own Graphic, Transformation and
+      // Allocation, so we must explicitly release them before calling pop().
+      Prague::Trace trace("PickTraversal::reinit");
+      my_controllers.clear();
+      my_positions.clear();
+      while (size() > 1)
+      {
+	  CORBA::release(get_graphic(size() - 1));
+	  Provider<RegionImpl>::adopt(get_allocation(size() - 1));
+	  Provider<TransformImpl>::adopt(get_transformation(size() - 1));
+	  pop();
+      }
+      my_cursor = 0;
+  }
+
+  inline Fresco::Controller_ptr PickTraversalImpl::top_controller()
+  {
+      return my_controllers.size() ?
+	  Fresco::Controller::_duplicate(my_controllers.back()) :
+	  Fresco::Controller::_nil();
+  }
+
+} // namespace
 
 #endif 

Index: PolyGraphic.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/PolyGraphic.hh,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- PolyGraphic.hh	3 Dec 2002 20:26:54 -0000	1.23
+++ PolyGraphic.hh	29 Dec 2003 08:03:18 -0000	1.24
@@ -26,58 +26,69 @@
 #include <Berlin/Pool.hh>
 #include <vector>
 
-class PolyGraphic : public GraphicImpl
+namespace Berlin
 {
-  class Iterator;
-  friend class Iterator;
-public:
-  PolyGraphic();
-  virtual ~PolyGraphic();
 
-  virtual void append_graphic(Fresco::Graphic_ptr);
-  virtual void prepend_graphic(Fresco::Graphic_ptr);
-  virtual void remove_graphic(Fresco::Tag);
-  virtual void remove_child_graphic(Fresco::Tag);
-  virtual Fresco::GraphicIterator_ptr first_child_graphic();
-  virtual Fresco::GraphicIterator_ptr last_child_graphic();
-
-  virtual void need_resize();
-  virtual void need_resize(Fresco::Tag);
-protected:
-  CORBA::ULong num_children();
-  Fresco::Tag unique_child_id();
-  glist_t::iterator child_id_to_iterator(Fresco::Tag);
-  CORBA::Long child_id_to_index(Fresco::Tag);
-  Fresco::Graphic::Requisition *children_requests();
-  void deallocate_requisitions(Fresco::Graphic::Requisition *);
-  void child_extension(size_t, const Fresco::Allocation::Info &, Fresco::Region_ptr);
+  class PolyGraphic : public GraphicImpl
+  {
+      class Iterator;
+      friend class Iterator;
+    public:
+      PolyGraphic();
+      virtual ~PolyGraphic();
+      
+      virtual void append_graphic(Fresco::Graphic_ptr);
+      virtual void prepend_graphic(Fresco::Graphic_ptr);
+      virtual void remove_graphic(Fresco::Tag);
+      virtual void remove_child_graphic(Fresco::Tag);
+      virtual Fresco::GraphicIterator_ptr first_child_graphic();
+      virtual Fresco::GraphicIterator_ptr last_child_graphic();
+      
+      virtual void need_resize();
+      virtual void need_resize(Fresco::Tag);
+    protected:
+      CORBA::ULong num_children();
+      Fresco::Tag unique_child_id();
+      glist_t::iterator child_id_to_iterator(Fresco::Tag);
+      CORBA::Long child_id_to_index(Fresco::Tag);
+      Fresco::Graphic::Requisition *children_requests();
+      void deallocate_requisitions(Fresco::Graphic::Requisition *);
+      void child_extension(size_t, const Fresco::Allocation::Info &,
+			   Fresco::Region_ptr);
 // private:
-  static Pool<Fresco::Graphic::Requisition> _pool;
-  glist_t _children;
-  Prague::Mutex _mutex;
-};
+      static Pool<Fresco::Graphic::Requisition> my_pool;
+      glist_t my_children;
+      Prague::Mutex my_mutex;
+  };
 
 /*
  * the following methods are inlined for speed.
- * Attention : they must be used within a PolyGraphic::childMutex locked section !
+ * Attention : they must be used within a PolyGraphic::childMutex locked
+ * section!
  */
-inline Fresco::Tag PolyGraphic::unique_child_id()
-{
-  Fresco::Tag localId;
-  for (localId = 0;
-       find_if (_children.begin(), _children.end(), localId_eq(localId)) != _children.end();
-       localId++);
+  inline Fresco::Tag PolyGraphic::unique_child_id()
+  {
+      Fresco::Tag localId;
+      for (localId = 0;
+	   find_if(my_children.begin(), my_children.end(),
+		   localId_eq(localId)) != my_children.end();
+	   localId++);
       return localId;
-}
-
-inline PolyGraphic::glist_t::iterator PolyGraphic::child_id_to_iterator(Fresco::Tag localId)
-{
-  return find_if(_children.begin(), _children.end(), localId_eq(localId));
-}
+  }
+  
+  inline PolyGraphic::glist_t::iterator
+  PolyGraphic::child_id_to_iterator(Fresco::Tag localId)
+  {
+      return find_if(my_children.begin(), my_children.end(),
+		     localId_eq(localId));
+  }
 
-inline CORBA::Long PolyGraphic::child_id_to_index(Fresco::Tag localId)
-{
-  return find_if(_children.begin(), _children.end(), localId_eq(localId)) - _children.begin();
-}
+  inline CORBA::Long PolyGraphic::child_id_to_index(Fresco::Tag localId)
+  {
+      return find_if(my_children.begin(), my_children.end(),
+		     localId_eq(localId)) - my_children.begin();
+  }
+  
+} // namespace
 
 #endif 

Index: Pool.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Pool.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Pool.hh	2 Jun 2002 23:42:15 -0000	1.5
+++ Pool.hh	29 Dec 2003 08:03:18 -0000	1.6
@@ -19,67 +19,72 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _Pool_hh
-#define _Pool_hh
+#ifndef _Berlin_Pool_hh
+#define _Berlin_Pool_hh
 
 #include <vector>
 
-template <class T>
-class Pool
+namespace Berlin
 {
-public:
-  Pool() {}
-  inline ~Pool();
-  inline T *allocate(unsigned int);
-  inline void deallocate(T *);
-private:
-  struct bucket
+
+  template <class T>
+  class Pool
   {
-    bucket(T *d, unsigned int s) : data(d), size(s), used(true) {};
-    T *data;
-    unsigned int size;
-    bool used;
+    public:
+      Pool() { }
+      inline ~Pool();
+      inline T *allocate(unsigned int);
+      inline void deallocate(T *);
+    private:
+      struct bucket
+      {
+	  bucket(T *d, unsigned int s) : data(d), size(s), used(true) {};
+	  T *data;
+	  unsigned int size;
+	  bool used;
+      };
+      std::vector<bucket> my_buckets;
   };
-  std::vector<bucket> buckets;
-};
-
-template <class T>
-inline Pool<T>::~Pool()
-{
-  for (typename std::vector<bucket>::iterator i = buckets.begin();
-       i != buckets.end(); ++i)
-    delete (*i).data;
-}
 
-template <class T>
-inline T *Pool<T>::allocate(unsigned int size)
-{
-  for (typename std::vector<bucket>::iterator i = buckets.begin();
-       i != buckets.end(); ++i)
-    if (!(*i).used && (*i).size >= size)
-      {
-	(*i).used = true;
-	return (*i).data;
-      }
+  template <class T>
+  inline Pool<T>::~Pool()
+  {
+      for (typename std::vector<bucket>::iterator i = my_buckets.begin();
+	   i != my_buckets.end(); ++i)
+	  delete (*i).data;
+  }
+  
+  template <class T>
+  inline T *Pool<T>::allocate(unsigned int size)
+  {
+      for (typename std::vector<bucket>::iterator i = my_buckets.begin();
+	   i != my_buckets.end(); ++i)
+	  if (!(*i).used && (*i).size >= size)
+	  {
+	      (*i).used = true;
+	      return (*i).data;
+	  }
 #if 1
-  bucket b(static_cast<T *>(::operator new(static_cast<size_t>(size * sizeof(T)))), size);
+      bucket b(static_cast<T *>(::operator new(static_cast<size_t>(size * sizeof(T)))), size);
 #else
-  bucket b(new T[size], size);
+      bucket b(new T[size], size);
 #endif
-  buckets.push_back(b);
-  return b.data;
-}
-
-template <class T>
-inline void Pool<T>::deallocate(T *d)
-{
-  for (typename std::vector<bucket>::iterator i = buckets.begin();
-       i != buckets.end(); ++i)
-    if ((*i).data == d)
-      {
-	(*i).used = false;
-	break;
-      }
-};
+      my_buckets.push_back(b);
+      return b.data;
+  }
+  
+  template <class T>
+  inline void Pool<T>::deallocate(T *d)
+  {
+      for (typename std::vector<bucket>::iterator i = my_buckets.begin();
+	   i != my_buckets.end(); ++i)
+	  if ((*i).data == d)
+	  {
+	      (*i).used = false;
+	      break;
+	  }
+  };
+  
+} // namespace
 
-#endif /* _Pool_hh */
+#endif

Index: PositionalFocus.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/PositionalFocus.hh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- PositionalFocus.hh	29 May 2002 06:49:38 -0000	1.15
+++ PositionalFocus.hh	29 Dec 2003 08:03:18 -0000	1.16
@@ -34,50 +34,56 @@
 #include <vector>
 #include <stack>
 
-class CachingPickTraversal;
-class ScreenImpl;
-class RasterImpl;
-
-class PositionalFocus : public FocusImpl
+namespace Berlin
 {
-  typedef std::vector<Fresco::Controller_var> cstack_t;
-  class Traversal;
-  struct PointerCacheTrait;
-  typedef ObjectCache<Fresco::Raster_var, Console::Pointer, PointerCacheTrait> PointerCache;
-  struct Resources
-  {
-    enum state { set_pointer = 0x1};
-    Resources() : flags(0) {}
-    unsigned long     flags;
-    Console::Pointer *pointer;
 
+  class CachingPickTraversal;
+  class ScreenImpl;
+  class RasterImpl;
+  
+  class PositionalFocus : public FocusImpl
+  {
+      typedef std::vector<Fresco::Controller_var> cstack_t;
+      class Traversal;
+      struct PointerCacheTrait;
+      typedef ObjectCache<Fresco::Raster_var, Console::Pointer,
+			  PointerCacheTrait> PointerCache;
+      struct Resources
+      {
+	  enum state { set_pointer = 0x1 };
+	  Resources() : flags(0) { }
+	  unsigned long flags;
+	  Console::Pointer *pointer;
+      };
+      typedef std::stack<Resources> rstack_t;
+    public:
+      PositionalFocus(Fresco::Input::Device, Fresco::Graphic_ptr,
+		      Fresco::Region_ptr);
+      virtual ~PositionalFocus();
+      virtual void grab();
+      virtual void ungrab();
+      virtual void set_cursor(Fresco::Raster_ptr);
+      virtual void add_filter(Fresco::Input::Filter_ptr);
+      
+      virtual bool request(Fresco::Controller_ptr);
+      virtual void restore(Fresco::Region_ptr);
+      virtual void damage(Fresco::Region_ptr);
+      virtual void dispatch(Fresco::Input::Event &);
+    protected:
+      virtual void activate_composite();
+    private:
+      Fresco::Graphic_ptr my_root;
+      RasterImpl         *my_default_raster;
+      PointerCache       *my_pointers;
+      Console::Pointer   *my_pointer;
+      rstack_t            my_resources;
+      Traversal          *my_traversal_cache[2];
+      Traversal          *my_traversal;
+      cstack_t            my_controllers;
+      bool                my_grabbed;
+      Prague::Mutex       my_mutex;
   };
-  typedef std::stack<Resources> rstack_t;
-public:
-  PositionalFocus(Fresco::Input::Device, Fresco::Graphic_ptr, Fresco::Region_ptr);
-  virtual ~PositionalFocus();
-  virtual void grab();
-  virtual void ungrab();
-  virtual void set_cursor(Fresco::Raster_ptr);
-  virtual void add_filter(Fresco::Input::Filter_ptr);
 
-  virtual bool request(Fresco::Controller_ptr);
-  virtual void restore(Fresco::Region_ptr);
-  virtual void damage(Fresco::Region_ptr);
-  virtual void dispatch(Fresco::Input::Event &);
-protected:
-  virtual void activate_composite();
-private:
-  Fresco::Graphic_ptr _root;
-  RasterImpl         *_default_raster;
-  PointerCache       *_pointers;
-  Console::Pointer   *_pointer;
-  rstack_t            _resources;
-  Traversal          *_traversal_cache[2];
-  Traversal          *_traversal;
-  cstack_t            _controllers;
-  bool                _grabbed;
-  Prague::Mutex       _mutex;
-};
+} // namespace
 
 #endif 

Index: Provider.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Provider.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Provider.hh	29 May 2002 06:49:38 -0000	1.7
+++ Provider.hh	29 Dec 2003 08:03:18 -0000	1.8
@@ -28,100 +28,105 @@
 #include <stack>
 #include <cassert>
 
-template <typename T>
-struct Initializer
-{
-  static void initialize(T *) {}
-};
-
-//.a global pool for transient objects
-template <typename T, typename I = Initializer<T> >
-class Provider
+namespace Berlin
 {
-public:
-  static T *provide();
-  static void adopt(T *t);
-  static size_t size() { return pool.size();}
-private:
-  static void activate(T *);
-  static void deactivate(T *);
-  static std::stack<T *> pool;
-  static Prague::Mutex mutex;
-};
-
-template <typename T, typename C>
-std::stack<T *> Provider<T, C>::pool;
-template <typename T, typename C>
-Prague::Mutex Provider<T, C>::mutex;
 
-template <typename T, typename I>
-inline void Provider<T, I>::activate(T *t)
-{
-  Prague::Trace trace("Provider<T>::activate");
-  PortableServer::POA_var poa = t->_default_POA();
-  PortableServer::ObjectId *oid = poa->activate_object(t);
-  t->_remove_ref();
-  delete oid;
-}
+  template <typename T>
+  struct Initializer
+  {
+      static void initialize(T *) { }
+  };
 
-template <typename T, typename I>
-inline void Provider<T, I>::deactivate(T *t)
-{
-  Prague::Trace trace("Provider<T>::deactivate");
-  PortableServer::POA_var poa = t->_default_POA();
-  PortableServer::ObjectId *oid = poa->servant_to_id(t);
-  poa->deactivate_object(*oid);
-  delete oid;
-}
+  //.a global pool for transient objects
+  template <typename T, typename I = Initializer<T> >
+  class Provider
+  {
+    public:
+      static T *provide();
+      static void adopt(T *t);
+      static size_t size() { return pool.size(); }
+    private:
+      static void activate(T *);
+      static void deactivate(T *);
+      static std::stack<T *> pool;
+      static Prague::Mutex mutex;
+  };
 
-template <typename T, typename I>
-inline T *Provider<T, I>::provide()
-{
-  Prague::Trace trace("Provider<T>::provide");
-  T *t = 0;
-  Prague::Guard<Prague::Mutex> guard(mutex);
-  if (!pool.empty())
-    {
-      t = pool.top();
-      pool.pop();
-    }
-  else
-    {
-      t = new T();
-      activate(t);
-    }
-  t->_active = true;
-  I::initialize(t);
-  return t;
-}
+  template <typename T, typename C>
+  std::stack<T *> Provider<T, C>::pool;
+  template <typename T, typename C>
+  Prague::Mutex Provider<T, C>::mutex;
+  
+  template <typename T, typename I>
+  inline void Provider<T, I>::activate(T *t)
+  {
+      Prague::Trace trace("Provider<T>::activate");
+      PortableServer::POA_var poa = t->_default_POA();
+      PortableServer::ObjectId *oid = poa->activate_object(t);
+      t->_remove_ref();
+      delete oid;
+  }
 
-template <typename T, typename I>
-inline void Provider<T, I>::adopt(T *t)
-{
-  Prague::Trace trace("Provider<T>::adopt");
-  assert(t->_active);
-  t->_active = false;
-  Prague::Guard<Prague::Mutex> guard(mutex);
-  pool.push(t);
-}
+  template <typename T, typename I>
+  inline void Provider<T, I>::deactivate(T *t)
+  {
+      Prague::Trace trace("Provider<T>::deactivate");
+      PortableServer::POA_var poa = t->_default_POA();
+      PortableServer::ObjectId *oid = poa->servant_to_id(t);
+      poa->deactivate_object(*oid);
+      delete oid;
+  }
+  
+  template <typename T, typename I>
+  inline T *Provider<T, I>::provide()
+  {
+      Prague::Trace trace("Provider<T>::provide");
+      T *t = 0;
+      Prague::Guard<Prague::Mutex> guard(mutex);
+      if (!pool.empty())
+      {
+	  t = pool.top();
+	  pool.pop();
+      }
+      else
+      {
+	  t = new T();
+	  activate(t);
+      }
+      t->my_active = true;
+      I::initialize(t);
+      return t;
+  }
+  
+  template <typename T, typename I>
+  inline void Provider<T, I>::adopt(T *t)
+  {
+      Prague::Trace trace("Provider<T>::adopt");
+      assert(t->my_active);
+      t->my_active = false;
+      Prague::Guard<Prague::Mutex> guard(mutex);
+      pool.push(t);
+  }
+  
+  //.Lease_var is a smart pointer to be used in conjunction with
+  //.Provider. It will give the wrapped object back to the provider
+  //.in its destructor
+  template <typename T, typename I = Initializer<T> >
+  class Lease_var
+  {
+    public:
+      explicit Lease_var(T *tt) : t(tt) {}
+      Lease_var(Lease_var<T, I> &i) : t(i._retn()) {}
+      ~Lease_var() { if (t) Provider<T, I>::adopt(t);}
+      Lease_var<T> &operator = (Lease_var<T, I> &i) { if (&i != this) { if (t) Provider<T, I>::adopt(t); t = i._retn();} return *this;}  
+      T &operator *() const { return *t;}
+      T *operator->() const { return  t;}
+      operator T *() const { return  t;}
+      T *_retn() { T *tmp = t; t = 0; return tmp;}
+    private:
+      T *t;
+  };
 
-//.Lease_var is a smart pointer to be used in conjunction with
-//.Provider. It will give the wrapped object back to the provider
-//.in its destructor
-template <typename T, typename I = Initializer<T> >
-class Lease_var
-{
-public:
-  explicit Lease_var(T *tt) : t(tt) {}
-  Lease_var(Lease_var<T, I> &i) : t(i._retn()) {}
-  ~Lease_var() { if (t) Provider<T, I>::adopt(t);}
-  Lease_var<T> &operator = (Lease_var<T, I> &i) { if (&i != this) { if (t) Provider<T, I>::adopt(t); t = i._retn();} return *this;}  
-  T &operator *() const { return *t;}
-  T *operator->() const { return  t;}
-  operator T *() const { return  t;}
-  T *_retn() { T *tmp = t; t = 0; return tmp;}
-private:
-  T *t;
-};
+} // namespace
 
 #endif

Index: QuadTree.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/QuadTree.hh,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- QuadTree.hh	2 Jun 2002 23:42:15 -0000	1.19
+++ QuadTree.hh	29 Dec 2003 08:03:18 -0000	1.20
@@ -19,301 +19,336 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _QuadTree_hh
-#define _QuadTree_hh
+#ifndef _Berlin_QuadTree_hh
+#define _Berlin_QuadTree_hh
 
 #include <Berlin/Geometry.hh>
 #include <vector>
 #include <algorithm>
 #include <functional>
 
-//. this defines a binary space partitioning (BSP) algorithm
-//. in 2D, suitable for object lookup on the screen
-//.
-//. the parametrization is as follows:
-//.  - T is the Domain, most likely Coord or PixelCoord
-//.  - I is the Item to store, can be anything which defines a method
-//.    const Geometry::Rectangle<T> &I::bbox() returning the bounding box
-//.    suitable for use in the quadtree
-template <class T, class I>
-class QTNode
+namespace Berlin
 {
-  //. This structure is used to determine wether items can get pushed
-  //. into subnodes.
-  struct move_down : std::unary_function<I, bool>
-  {
-    move_down(QTNode<T, I> *n) : node(n) {}
-    bool operator()(I i)
-    {
-      QTNode<T, I>::index idx = node->where(i);
-      if (idx != QTNode<T, I>::fence)
-	{
-	  node->quadrants[idx]->insert(i);
-	  return true;
-	}
-      else return false;
-    };
-    QTNode<T, I> *node;
-  };
-  friend class move_down;
 
-public:
-  //. An enumeration of the quadrants of the QTNode.
-  enum index
+  //. this defines a binary space partitioning (BSP) algorithm
+  //. in 2D, suitable for object lookup on the screen
+  //.
+  //. the parametrization is as follows:
+  //.  - T is the Domain, most likely Coord or PixelCoord
+  //.  - I is the Item to store, can be anything which defines a method
+  //.    const Geometry::Rectangle<T> &I::bbox() returning the bounding box
+  //.    suitable for use in the quadtree
+  template <class T, class I>
+  class QTNode
   {
-    fence = -1,
-    none = 0,
-    left = 0,
-    right = 1,
-    top = 0,
-    bottom = 2,
-    leftbottom = left|bottom, // = 2
-    rightbottom = right|bottom, // = 3
-    lefttop = left|top, // = 0
-    righttop = right|top // = 1
-  };
+      //. This structure is used to determine wether items can get pushed
+      //. into subnodes.
+      struct move_down : std::unary_function<I, bool>
+      {
+	  move_down(QTNode<T, I> *n) : node(n) {}
+	  bool operator()(I i)
+	  {
+	      QTNode<T, I>::index idx = node->where(i);
+	      if (idx != QTNode<T, I>::fence)
+	      {
+		  node->my_quadrants[idx]->insert(i);
+		  return true;
+	      }
+	      else return false;
+	  };
+	  QTNode<T, I> *node;
+      };
+      friend class move_down;
 
-  typedef std::vector<I> list;
+    public:
+      //. An enumeration of the quadrants of the QTNode.
+      enum index
+      {
+	  fence = -1,
+	  none = 0,
+	  left = 0,
+	  right = 1,
+	  top = 0,
+	  bottom = 2,
+	  leftbottom = left|bottom, // = 2
+	  rightbottom = right|bottom, // = 3
+	  lefttop = left|top, // = 0
+	  righttop = right|top // = 1
+      };
 
-  //. Creates an empty QTNode for the region r.
-  QTNode(const Geometry::Rectangle<T> &r) : region(r), elements(0)
-  { quadrants[0] = quadrants[1] = quadrants[2] = quadrants[3] = 0;}
-  //. Returns a subnode for the quadrant i.
-  QTNode<T, I> *node(index i) { return quadrants[i];}
-  //. Deletes this QTNode and frees the memory used.
-  ~QTNode() { free();}
+      typedef std::vector<I> list;
 
-  //. Region owned by this node
-  const Geometry::Rectangle<T> &extension() const { return region;}
+      //. Creates an empty QTNode for the region r.
+      QTNode(const Geometry::Rectangle<T> &r) :
+	  my_region(r), 
+	  my_elements(0)
+      {
+	  my_quadrants[0] = my_quadrants[1] =
+	      my_quadrants[2] = my_quadrants[3] = 0;
+      }
+      //. Returns a subnode for the quadrant i.
+      QTNode<T, I> *node(index i) { return my_quadrants[i]; }
+      //. Deletes this QTNode and frees the memory used.
+      ~QTNode() { free(); }
+      
+      //. Region owned by this node
+      const Geometry::Rectangle<T> &extension() const { return my_region; }
 
-  //. Bounding box of all objects in this node
-  const Geometry::Rectangle<T> &bbox() const { return boundingbox;}
+      //. Bounding box of all objects in this node
+      const Geometry::Rectangle<T> &bbox() const { return my_boundingbox; }
 
-  //. Insert an Item into the QuadTree.
-  void insert(I);
-  //. Remove an Item from the QuadTree.
-  void remove(I);
-  //. Number of objects in this node.
-  int  size() const { return elements;}
-  //. Pushes as many items as possible into subnodes.
-  void unfold();
-  //. Collapses the branch below this node. Afterwards this node will
-  //. be a leaf containing all items of the nodes that used to be below
-  //. this one.
-  void collaps();
-  //. Adjusts the branch starting with this node so that all nodes
-  //. below this one meet the following requirements:
-  //.   max is the maximum number of objects desired at each node
-  //.   min is the minimum number of objects desired at each node
-  //.   min_w and min_h are the minimum span desired for a node
-  void adjust(int, int, T, T);
+      //. Insert an Item into the QuadTree.
+      void insert(I);
+      //. Remove an Item from the QuadTree.
+      void remove(I);
+      //. Number of objects in this node.
+      int  size() const { return my_elements;}
+      //. Pushes as many items as possible into subnodes.
+      void unfold();
+      //. Collapses the branch below this node. Afterwards this node will
+      //. be a leaf containing all items of the nodes that used to be below
+      //. this one.
+      void collaps();
+      //. Adjusts the branch starting with this node so that all nodes
+      //. below this one meet the following requirements:
+      //.   max is the maximum number of objects desired at each node
+      //.   min is the minimum number of objects desired at each node
+      //.   min_w and min_h are the minimum span desired for a node
+      void adjust(int, int, T, T);
 
-protected:
-  //. Returns wether this node is a leaf of the QuadTree or not.
-  bool leaf() const { return quadrants[0] == 0;}
-  //. Creates the quadrants if they were not allocated before.
-  void allocate();
-  //. Frees the memory of this node and the subnodes.
-  void free()
-  {
-    if (!leaf())
-      for (int i = 0; i < 4; i++)
-	{
-	  delete quadrants[i];
-	  quadrants[i] = 0;
-	}
-  }
-  //. Returns the index the point p belongs into.
-  index where(const Geometry::Point<T> &p)
-  {
-    return index((p.x <= region.cx() ? left : right) | (p.y <= region.cy() ? bottom : top));
-  }
-  //. Returns the quadrant the given rectangle is in. Returns 'fence' if the
-  //. if the rectangle intersects more then one quadrant.
-  index where(const Geometry::Rectangle<T> &);
-  //. Returns the quadrant the item i belongs into. Returns 'fence' if the
-  //. item i intersects more then one quadrant.
-  index where(I i) { return where(i->bbox());}
+    protected:
+      //. Returns wether this node is a leaf of the QuadTree or not.
+      bool leaf() const { return my_quadrants[0] == 0;}
+      //. Creates the quadrants if they were not allocated before.
+      void allocate();
+      //. Frees the memory of this node and the subnodes.
+      void free()
+      {
+	  if (!leaf())
+	      for (int i = 0; i < 4; i++)
+	      {
+		  delete my_quadrants[i];
+		  my_quadrants[i] = 0;
+	      }
+      }
+      //. Returns the index the point p belongs into.
+      index where(const Geometry::Point<T> &p)
+      {
+	  return index((p.x <= my_region.cx() ? left : right) |
+		       (p.y <= my_region.cy() ? bottom : top));
+      }
+      //. Returns the quadrant the given rectangle is in. Returns 'fence'
+      // if the rectangle intersects more then one quadrant.
+      index where(const Geometry::Rectangle<T> &);
+      //. Returns the quadrant the item i belongs into. Returns 'fence'
+      //. if the item i intersects more then one quadrant.
+      index where(I i) { return where(i->bbox()); }
 
-  //. The region this node occupies,
-  Geometry::Rectangle<T> region;
-  //. The boundingbox of all objects in this node.
-  Geometry::Rectangle<T> boundingbox;
+      //. The region this node occupies,
+      Geometry::Rectangle<T> my_region;
+      //. The boundingbox of all objects in this node.
+      Geometry::Rectangle<T> my_boundingbox;
 
-  //. Total count of objects at or below this level
-  int          elements;
-  //. Items straddling the fence
-  list         items;
-  //. The quadrants of this node.
-  QTNode<T, I> *quadrants[4];
+      //. Total count of objects at or below this level
+      int my_elements;
+      //. Items straddling the fence
+      list my_items;
+      //. The quadrants of this node.
+      QTNode<T, I> *my_quadrants[4];
 
-  //. Dumps the data for this node and its subnotes if there are any.
-  friend void dumpQuadNode(const QTNode<T,I> &node, short ind)
+      //. Dumps the data for this node and its subnotes if there are any.
+      friend void dumpQuadNode(const QTNode<T,I> &node, short ind)
+      {
+	  for (short i = 0; i != ind; i++) std::cout.put(' ');
+	  std::cout << "Node : " << node.elements
+		    << '(' << node.items.size()
+		    << ") elements, extension : "
+		    << node.region << std::endl;
+	  for (typename list::const_iterator i = node.items.begin();
+	       i != node.items.end();
+	       ++i)
+	      std::cout << (*i)->boundingbox << ';';
+	  std::cout << std::endl;
+	  if (!node.leaf())
+	      for (short i = 0; i != 4; i++)
+		  dumpQuadNode(*node.my_quadrants[i], ind + 2);
+      }
+  };
+
+  template <class T, class I>
+  class QuadTree
   {
-    for (short i = 0; i != ind; i++) std::cout.put(' ');
-    std::cout << "Node : " << node.elements
-	      << '(' << node.items.size()
-	      << ") elements, extension : "
-	      << node.region << std::endl;
-    for (typename list::const_iterator i = node.items.begin();
-	 i != node.items.end();
-	 i++)
-      std::cout << (*i)->boundingbox << ';';
-    std::cout << std::endl;
-    if (!node.leaf())
-      for (short i = 0; i != 4; i++)
-	dumpQuadNode(*node.quadrants[i], ind + 2);
-  }
-};
+    public:
+      //. Creates an empty QuadTree.
+      QuadTree() : my_quad(0) { }
+      ~QuadTree() { }
+      
+      //. Returns the bounding box of all items in the QuadTree.
+      Geometry::Rectangle<T> bbox()
+      { return node() ? node()->bbox() : Geometry::Rectangle<T>(); }
+      //. Returns the number of items in this QuadTree.
+      int size() { return my_quad ? my_quad->size() : 0; }
+      //. Returns the rootnode of the QuadTree.
+      QTNode<T, I> *node() { return my_quad; }
+    protected:
+      QTNode<T, I> *my_quad;
+      
+      //. Dumps the data for this QuadTree.
+      friend void dumpQuadTree(const QuadTree<T,I> &tree)
+      {
+	  if (tree.my_quad) dumpQuadNode(*tree.my_quad, 0);
+      }
+  };
 
-template <class T, class I>
-class QuadTree
-{
-public:
-  //. Creates an empty QuadTree.
-  QuadTree() : _quad(0) {}
-  ~QuadTree() {}
+  // inline functions only below this line.
 
-  //. Returns the bounding box of all items in the QuadTree.
-  Geometry::Rectangle<T> bbox()
+  template <class T, class I>
+  inline void QTNode<T, I>::allocate()
   {
-    return node() ? node()->bbox() : Geometry::Rectangle<T>();
+      using namespace Geometry;
+      if (leaf())
+      {
+	  my_quadrants[lefttop] =
+	      new QTNode<T, I>(Rectangle<T>(my_region.l, my_region.t,
+					    my_region.cx(),
+					    my_region.cy()));
+	  my_quadrants[righttop] =
+	      new QTNode<T, I>(Rectangle<T>(my_region.cx(), my_region.t,
+					    my_region.r, my_region.cy()));
+	  my_quadrants[leftbottom] =
+	      new QTNode<T, I>(Rectangle<T>(my_region.l, my_region.cy(),
+					    my_region.cx(), my_region.b));
+	  my_quadrants[rightbottom] =
+	      new QTNode<T, I>(Rectangle<T>(my_region.cx(), my_region.cy(),
+					    my_region.r, my_region.b));
+      }
   }
-  //. Returns the number of items in this QuadTree.
-  int size() { return _quad ? _quad->size() : 0;}
-  //. Returns the rootnode of the QuadTree.
-  QTNode<T, I> *node() { return _quad;}
-protected:
-  QTNode<T, I> *_quad;
-
-  //. Dumps the data for this QuadTree.
-  friend void dumpQuadTree(const QuadTree<T,I> &tree)
+  
+  template <class T, class I>
+  inline void QTNode<T, I>::adjust(int min, int max, T min_w, T min_h)
   {
-    if (tree._quad) dumpQuadNode(*tree._quad, 0);
+      // If we are over the maximum then unfold
+      // and push down as many objects as we can.
+      if (my_items.size() > (uint) max &&
+	  ((my_region.w() > (min_w * 2)) || (my_region.h() > (min_h * 2))))
+	  unfold();
+      if (!leaf())
+      {
+	  for (int i = 0; i < 4; ++i)
+	      my_quadrants[i]->adjust(min, max, min_w, min_h);
+	  // If our sub-tree is under the minimum then flatten it away.
+	  if (my_elements < min || my_elements - my_items.size() == 0 ||
+	      (my_region.w() < min_w && my_region.h() < min_h))
+	      collaps();
+      }
   }
-};
-
-// inline functions only below this line.
-
-template <class T, class I>
-inline void QTNode<T, I>::allocate()
-{
-  using namespace Geometry;
-  if (leaf()) {
-    quadrants[lefttop] = new QTNode<T, I>(Rectangle<T>(region.l, region.t, region.cx(), region.cy()));
-    quadrants[righttop] = new QTNode<T, I>(Rectangle<T>(region.cx(), region.t, region.r, region.cy()));
-    quadrants[leftbottom] = new QTNode<T, I>(Rectangle<T>(region.l, region.cy(), region.cx(), region.b));
-    quadrants[rightbottom] = new QTNode<T, I>(Rectangle<T>(region.cx(), region.cy(), region.r, region.b));
+  
+  template <class T, class I>
+  inline void QTNode<T, I>::unfold()
+  {
+      if (! leaf()) return;
+      allocate();
+      typename list::iterator i =
+	  remove_if(my_items.begin(), my_items.end(), move_down(this));
+      my_items.erase(i, my_items.end());
   }
-}
-
-template <class T, class I>
-inline void QTNode<T, I>::adjust(int min, int max, T min_w, T min_h)
-{
-  // If we are over the maximum then unfold
-  // and push down as many objects as we can.
-  if (items.size() > (uint) max && ((region.w() > (min_w * 2)) || (region.h() > (min_h * 2)))) unfold();
-  if (!leaf())
-    {
-      for (int i = 0; i < 4; ++i) quadrants[i]->adjust(min, max, min_w, min_h);
-      // If our sub-tree is under the minimum then flatten it away.
-      if (elements < min || elements - items.size() == 0 || (region.w() < min_w && region.h() < min_h)) collaps();
-    }
-}
-
-template <class T, class I>
-inline void QTNode<T, I>::unfold()
-{
-  if (! leaf()) return;
-  allocate();
-  typename list::iterator i =
-    remove_if(items.begin(), items.end(), move_down(this));
-  items.erase(i, items.end());
-}
 
-template <class T, class I>
-inline void QTNode<T, I>::collaps()
-{
-  if (leaf()) return;
-  for (int i = 0; i < 4; i++)
-    {
-      QTNode<T, I> *node = quadrants[i];
-      node->collaps();
-      list childItems = node->items;
-      items.insert(items.end(), childItems.begin(), childItems.end());
-    }
-  free();
-}
+  template <class T, class I>
+  inline void QTNode<T, I>::collaps()
+  {
+      if (leaf()) return;
+      for (int i = 0; i < 4; i++)
+      {
+	  QTNode<T, I> *node = my_quadrants[i];
+	  node->collaps();
+	  list childItems = node->my_items;
+	  my_items.insert(my_items.end(),
+			  childItems.begin(), childItems.end());
+      }
+      free();
+  }
 
-template <class T, class I>
-inline typename QTNode<T, I>::index
-QTNode<T, I>::where(const Geometry::Rectangle<T> &r)
-{
-  int idx = fence;
-  if (!leaf())
-    {
-      const T x = region.cx();
-      const T y = region.cy();
-      /*
-       * is r inside one of the quarters ?
-       */
-      if ((r.r <= x) == (r.l < x) && (r.b <= y) == (r.t < y))
-	idx = (r.r <= x ? left : right) | (r.b <= y ? top : bottom);
-    }
-  return static_cast<index>(idx);
-}
+  template <class T, class I>
+  inline typename QTNode<T, I>::index
+  QTNode<T, I>::where(const Geometry::Rectangle<T> &r)
+  {
+      int idx = fence;
+      if (!leaf())
+      {
+	  const T x = my_region.cx();
+	  const T y = my_region.cy();
+	  // is r inside one of the quarters ?
+	  if ((r.r <= x) == (r.l < x) && (r.b <= y) == (r.t < y))
+	      idx = (r.r <= x ? left : right) | (r.b <= y ? top : bottom);
+      }
+      return static_cast<index>(idx);
+  }
 
-template <class T, class I>
-inline void QTNode<T, I>::insert(I i)
-{
-  index idx = where(i);
-  if (idx == fence) items.push_back(i);
-  else quadrants[idx]->insert(i);
-  elements++;
-  
-  const Geometry::Rectangle<T> &bb = i->bbox();
-  if (elements > 1) boundingbox.merge(bb);
-  else boundingbox = bb;
-}
+  template <class T, class I>
+  inline void QTNode<T, I>::insert(I i)
+  {
+      index idx = where(i);
+      if (idx == fence) my_items.push_back(i);
+      else my_quadrants[idx]->insert(i);
+      my_elements++;
+      
+      const Geometry::Rectangle<T> &bb = i->bbox();
+      if (my_elements > 1) my_boundingbox.merge(bb);
+      else my_boundingbox = bb;
+  }
 
-template <class T, class I>
-inline void QTNode<T, I>::remove(I i)
-{
-  index idx = where(i);
-  if (idx == fence)
-    {
-      for (typename list::iterator j = items.begin(); j != items.end(); j++)
-	if (*j == i)
+  template <class T, class I>
+  inline void QTNode<T, I>::remove(I i)
+  {
+      index idx = where(i);
+      if (idx == fence)
+      {
+	  for (typename list::iterator j = my_items.begin();
+	       j != my_items.end();
+	       ++j)
+	      if (*j == i)
+	      {
+		  my_items.erase(j);
+		  break;
+	      }
+      }
+      else my_quadrants[idx]->remove(i);
+      my_elements--;
+      
+      if (my_boundingbox.touches(i->bbox(), epsilon))
+      {
+	  my_boundingbox.clear();
+	  bool first = true;
+	  for (typename list::iterator j = my_items.begin();
+	       j != my_items.end();
+	       ++j)
 	  {
-	    items.erase(j);
-	    break;
+	      if (first)
+	      {
+		  my_boundingbox = (*j)->bbox();
+		  first = false;
+	      }
+	      else my_boundingbox.merge((*j)->bbox());
 	  }
-    }
-  else quadrants[idx]->remove(i);
-  elements--;
+	  if (!leaf())
+	  {
+	      for (int j = 0; j < 4; j++)
+	      {
+		  QTNode<T, I> *node = my_quadrants[j];
+		  if (node->my_elements > 0)
+		  {
+		      if (first)
+		      {
+			  my_boundingbox = node->bbox();
+			  first = false;
+		      }
+		      else my_boundingbox.merge(node->bbox());
+		  }
+	      }
+	  }
+      }
+  }
 
-  if (boundingbox.touches(i->bbox(), epsilon))
-    {
-      boundingbox.clear();
-      bool first = true;
-      for (typename list::iterator j = items.begin(); j != items.end(); j++)
-	{
-	  if (first) { boundingbox = (*j)->bbox(); first = false;}
-	  else boundingbox.merge((*j)->bbox());
-	}
-      if (!leaf())
-	{
-	  for (int j = 0; j < 4; j++)
-	    {
-	      QTNode<T, I> *node = quadrants[j];
-	      if (node->elements > 0)
-		{
-		  if (first) { boundingbox = node->bbox(); first = 0;}
-		  else boundingbox.merge(node->bbox());
-		}
-	    }
-	}
-    }
-}
+} // namespace
 
-#endif /* _QuadTree_h */
+#endif

Index: RCManager.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/RCManager.hh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- RCManager.hh	14 Apr 2003 00:25:05 -0000	1.4
+++ RCManager.hh	29 Dec 2003 08:03:18 -0000	1.5
@@ -19,17 +19,22 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _RCManager_hh
-#define _RCManager_hh
+#ifndef _Berlin_RCManager_hh
+#define _Berlin_RCManager_hh
 
 #include <Prague/Sys/GetOpt.hh>
 #include <Prague/Sys/Path.hh>
 
-class RCManager
+namespace Berlin
 {
-  public:
-    static void setup(Prague::GetOpt const &);
-    static Prague::Path get_path(const std::string &);
-};
+
+  class RCManager
+  {
+    public:
+      static void setup(Prague::GetOpt const &);
+      static Prague::Path get_path(const std::string &);
+  };
+
+} // namespace
 
 #endif

Index: RasterImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/RasterImpl.hh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- RasterImpl.hh	20 Feb 2003 02:36:46 -0000	1.4
+++ RasterImpl.hh	29 Dec 2003 08:03:18 -0000	1.5
@@ -30,26 +30,37 @@
 #include <Berlin/PNG.hh>
 #include <string>
 
-class RasterImpl : public virtual POA_Fresco::Raster,
-		   public SubjectImpl
+namespace Berlin
+{
+
+  class RasterImpl : public virtual POA_Fresco::Raster,
+		     public SubjectImpl
 						  
-{  	
-public:
-  RasterImpl(const Fresco::Raster::Info &);
-  RasterImpl(const std::string &file);
-  virtual ~RasterImpl();
-  virtual Fresco::Raster::Info header();
-  virtual void clear();
-  virtual void load_data(const Fresco::Raster::Data &);
-  virtual void store_data(Fresco::Raster::Data_out);
-  virtual void load_pixel(const Fresco::Raster::Index &, const Fresco::Color &);
-  virtual void store_pixel(const Fresco::Raster::Index &, Fresco::Color &);
-  virtual void load_pixels(const Fresco::Raster::Index &, const Fresco::Raster::Index &, const Fresco::Raster::ColorSeq &);
-  virtual void store_pixels(const Fresco::Raster::Index &, const Fresco::Raster::Index &, Fresco::Raster::ColorSeq_out);
-  void write(const char *);
- private:
-  PNG _png;
-  unsigned char **_rows;
-};
+  {  	
+    public:
+      RasterImpl(const Fresco::Raster::Info &);
+      RasterImpl(const std::string &file);
+      virtual ~RasterImpl();
+      virtual Fresco::Raster::Info header();
+      virtual void clear();
+      virtual void load_data(const Fresco::Raster::Data &);
+      virtual void store_data(Fresco::Raster::Data_out);
+      virtual void load_pixel(const Fresco::Raster::Index &,
+			      const Fresco::Color &);
+      virtual void store_pixel(const Fresco::Raster::Index &,
+			       Fresco::Color &);
+      virtual void load_pixels(const Fresco::Raster::Index &,
+			       const Fresco::Raster::Index &,
+			       const Fresco::Raster::ColorSeq &);
+      virtual void store_pixels(const Fresco::Raster::Index &,
+				const Fresco::Raster::Index &,
+				Fresco::Raster::ColorSeq_out);
+      void write(const char *);
+    private:
+      PNG my_png;
+      unsigned char **my_rows;
+  };
+
+} // namespace
 
 #endif

Index: RefCountBaseImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/RefCountBaseImpl.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- RefCountBaseImpl.hh	29 May 2002 06:49:38 -0000	1.5
+++ RefCountBaseImpl.hh	29 Dec 2003 08:03:18 -0000	1.6
@@ -27,19 +27,24 @@
 #include <Fresco/RefCountBase.hh>
 #include <Berlin/ServantBase.hh>
 
-//.Implements distributed reference counting. To ease the process of keeping
-//.track of references, see the RefCount_var template.
-class RefCountBaseImpl : public virtual POA_Fresco::RefCountBase,
-                         public virtual ServantBase
+namespace Berlin
 {
-public:
-  RefCountBaseImpl();
-  virtual ~RefCountBaseImpl();
-  virtual void increment();
-  virtual void decrement();
-private:
-  //. The number of references to this object.
-  int _refcount;
-};
+
+  //.Implements distributed reference counting. To ease the process of
+  //. keeping track of references, see the RefCount_var template.
+  class RefCountBaseImpl : public virtual POA_Fresco::RefCountBase,
+			   public virtual ServantBase
+  {
+    public:
+      RefCountBaseImpl();
+      virtual ~RefCountBaseImpl();
+      virtual void increment();
+      virtual void decrement();
+    private:
+      //. The number of references to this object.
+      int my_refcount;
+  };
+
+} // namespace
 
 #endif

Index: RefCountVar.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/RefCountVar.hh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- RefCountVar.hh	29 May 2002 06:49:38 -0000	1.6
+++ RefCountVar.hh	29 Dec 2003 08:03:18 -0000	1.7
@@ -25,120 +25,128 @@
 #include <Fresco/config.hh>
 #include <Fresco/Types.hh>
 
-//.RefCount_var is a smart pointer to be used in conjunction with
-//.RefCountBase objects. The smart pointer allows you to manage reference
-//.counting more simply, by automating the increment() and decrement() calls
-//.for various operations.
-//.
-//.When a raw pointer type is given to the smart pointer, either in the
-//.constructor or the assignment operator, then ownership of the reference is
-//.transferred to the smart pointer. Programmatically this is accomplished by
-//.not increasing the reference count. This is in contrast to passing another
-//.smart pointer, in which case the reference count will be incremented,
-//.to the objectrepresenting a duplicated reference to the object.
-//.
-//.Whenever the smart pointer loses or removes its reference to an object,
-//.either through destruction of the smart pointer or an assignment operator,
-//.it will automatically decrement() the object. The exception to this is the
-//._retn() method which forwards the _retn() call to the object then removes
-//.its local reference without decrementing.
-//.
-//.@see RefCountBaseImpl
-template <typename T>
-class RefCount_var
+namespace Berlin
 {
-  //.Brings the _ptr_type of T into this scope.
-  typedef typename T::_ptr_type T_ptr;
-
-  //.Brings the _var_type of T into this scope.
-  typedef typename T::_var_type T_var;
 
-public:
+  //. RefCount_var is a smart pointer to be used in conjunction with
+  //. RefCountBase objects. The smart pointer allows you to manage
+  //. reference counting more simply, by automating the increment() and
+  //. decrement() calls for various operations.
+  //.
+  //. When a raw pointer type is given to the smart pointer, either in the
+  //. constructor or the assignment operator, then ownership of the
+  //. reference is transferred to the smart pointer. Programmatically this
+  //. is accomplished by not increasing the reference count. This is in
+  //. contrast to passing another smart pointer, in which case the
+  //. reference count will be incremented to the objectrepresenting a
+  //. duplicated reference to the object.
+  //.
+  //. Whenever the smart pointer loses or removes its reference to an
+  //. object, either through destruction of the smart pointer or an
+  //. assignment operator, it will automatically decrement() the object.
+  //. The exception to this is the _retn() method which forwards the
+  //. _retn() call to the object then removes its local reference without
+  //. decrementing.
+  //.
+  //. @see RefCountBaseImpl
+  template <typename T>
+  class RefCount_var
+  {
+      //.Brings the _ptr_type of T into this scope.
+      typedef typename T::_ptr_type T_ptr;
 
-  //.Constructor that takes a pointer to T. No reference increment is done in
-  //.this constructor, so the reference to the object represented by the
-  //.pointer is transferred to the smart pointer.
-  RefCount_var(T_ptr tt = T::_nil()) : t(tt) {}
+      //.Brings the _var_type of T into this scope.
+      typedef typename T::_var_type T_var;
+      
+    public:
 
-  //.Constructor that takes another RefCount_var to T. In this case a
-  //.reference increment *is* done.
-  RefCount_var(const RefCount_var<T> &o)
-    : t(o.t)
-  {
-    if (!CORBA::is_nil(t))
-      try {t->increment();}
-      catch (const CORBA::OBJECT_NOT_EXIST &) { t = T::_nil();}
-      catch (const CORBA::COMM_FAILURE &) { t = T::_nil();}
-  }
+      //. Constructor that takes a pointer to T. No reference increment
+      //. is done in this constructor, so the reference to the object
+      //. represented by the pointer is transferred to the smart pointer.
+      RefCount_var(T_ptr tt = T::_nil()) : my_t(tt) { }
+      
+      //.Constructor that takes another RefCount_var to T. In this case a
+      //.reference increment *is* done.
+      RefCount_var(const RefCount_var<T> &o) : my_t(o.my_t)
+      {
+	  if (!CORBA::is_nil(my_t))
+	      try { my_t->increment(); }
+	      catch (const CORBA::OBJECT_NOT_EXIST &) { my_t = T::_nil(); }
+	      catch (const CORBA::COMM_FAILURE &) { my_t = T::_nil(); }
+      }
 
-  //.Destructor - decrements reference count to object.
-  ~RefCount_var()
-  {
-    if (!CORBA::is_nil(t))
-      try {t->decrement();}
-      catch (const CORBA::OBJECT_NOT_EXIST &) {}
-      catch (const CORBA::COMM_FAILURE &) {}
-  }
+      //.Destructor - decrements reference count to object.
+      ~RefCount_var()
+      {
+	  if (!CORBA::is_nil(my_t))
+	      try { my_t->decrement(); }
+	      catch (const CORBA::OBJECT_NOT_EXIST &) { }
+	      catch (const CORBA::COMM_FAILURE &) { }
+      }
 
-  //.Assignment operator. Copies the given smart pointer into this one,
-  //.decreasing the reference count on the current object and increasing the
-  //.reference count on the new one. The returned reference is to this smart
-  //.pointer.
-  RefCount_var<T> &operator = (const RefCount_var<T> &o)
-  {
-    if (&o != this)
+      //. Assignment operator. Copies the given smart pointer into this
+      //. one, decreasing the reference count on the current object and
+      //. increasing the reference count on the new one. The returned
+      //. reference is to this smart pointer.
+      RefCount_var<T> &operator = (const RefCount_var<T> &o)
       {
-	if (!CORBA::is_nil(t))
-	  try {t->decrement();}
-	  catch (const CORBA::OBJECT_NOT_EXIST &) {}
-	  catch (const CORBA::COMM_FAILURE &) {}
-	t = o.t;
-	if (!CORBA::is_nil(t))
-	  try {t->increment();}
-	  catch (const CORBA::OBJECT_NOT_EXIST &) { t = T::_nil();}
-	  catch (const CORBA::COMM_FAILURE &) { t = T::_nil();}
+	  if (&o != this)
+	  {
+	      if (!CORBA::is_nil(my_t))
+		  try { my_t->decrement(); }
+		  catch (const CORBA::OBJECT_NOT_EXIST &) { }
+		  catch (const CORBA::COMM_FAILURE &) { }
+	      my_t = o.my_t;
+	      if (!CORBA::is_nil(my_t))
+		  try { my_t->increment(); }
+		  catch (const CORBA::OBJECT_NOT_EXIST &)
+		  { my_t = T::_nil(); }
+		  catch (const CORBA::COMM_FAILURE &) { my_t = T::_nil(); }
+	  }
+	  return *this;
       }
-    return *this;
-  }
 
-  //.Assignment operator that takes a T pointer. Decreases the reference count
-  //.to the current object, but does not increase the reference count to the
-  //.passed pointer - in effect transferring the reference to this smart
-  //.pointer.
-  RefCount_var<T> &operator = (T_ptr tt)
-  {
-    if (!CORBA::is_nil(t))
-      try { t->decrement();}
-      catch (const CORBA::OBJECT_NOT_EXIST &) {}
-      catch (const CORBA::COMM_FAILURE &) {}
-    t = tt;
-    return *this;
-  }
+      //. Assignment operator that takes a T pointer. Decreases the
+      //. reference count to the current object, but does not increase
+      //. the reference count to the passed pointer - in effect
+      //. transferring the reference to this smart pointer.
+      RefCount_var<T> &operator = (T_ptr tt)
+      {
+	  if (!CORBA::is_nil(my_t))
+	      try { my_t->decrement(); }
+	      catch (const CORBA::OBJECT_NOT_EXIST &) { }
+	      catch (const CORBA::COMM_FAILURE &) { }
+	  my_t = tt;
+	  return *this;
+      }
 
-  //.Member access operator, returns the referenced object.
-  T_ptr operator->() const { return t;}
+      //. Member access operator, returns the referenced object.
+      T_ptr operator->() const { return my_t; }
+      
+      //. Cast operator, returns the referenced object.
+      operator T_ptr () const { return my_t; }
 
-  //.Cast operator, returns the referenced object.
-  operator T_ptr () const { return t;}
+      //. Transfers control of the object to the caller. The _retn()
+      //. method is called on the contained object and the return value
+      //. of that call is returned. Before returning this smart pointer's
+      //. reference to the object is removed *without* decreasing the
+      //. reference count, so that the reference is transferred to the
+      //. return value.
+      T_ptr _retn()
+      { T_ptr tmp = my_t._retn(); my_t = T::_nil(); return tmp; }
 
-  //.Transfers control of the object to the caller. The _retn() method is called
-  //.on the contained object and the return value of that call is returned.
-  //.Before returning this smart pointer's reference to the object is removed
-  //.*without* decreasing the reference count, so that the reference is
-  //.transferred to the return
-  //.value.
-  T_ptr _retn() { T_ptr tmp = t._retn(); t = T::_nil(); return tmp;}
+      //. Forwards the increment() call to the given object, if the object
+      //. is not nil. Returns either the object or a _duplicate(),
+      //. depending on the value of 'dup'.
+      static T_ptr increment(T_ptr t, bool dup = true)
+      {
+	  if (!CORBA::is_nil(t)) t->increment();
+	  return dup ? T::_duplicate(t) : t;
+      }
+    private:
+      T_var my_t;
+  };
 
-  //.Forwards the increment() call to the given object, if the object is not
-  //.nil. Returns either the object or a _duplicate(), depending on the value
-  //.of 'dup'.
-  static T_ptr increment(T_ptr t, bool dup = true)
-  {
-    if (!CORBA::is_nil(t)) t->increment();
-    return dup ? T::_duplicate(t) : t;
-  }
-private:
-  T_var t;
-};
+} // namespace
 
 #endif

Index: RegionImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/RegionImpl.hh,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- RegionImpl.hh	29 May 2002 06:49:38 -0000	1.21
+++ RegionImpl.hh	29 Dec 2003 08:03:18 -0000	1.22
@@ -31,119 +31,136 @@
 #include <Berlin/Provider.hh>
 #include <iostream>
 
-class RegionImpl;
-template <> struct Initializer<RegionImpl>;
-
-class RegionImpl : public virtual POA_Fresco::Region,
-                   public virtual ServantBase
+namespace Berlin
 {
-  friend class Provider<RegionImpl>;
-public:
-  RegionImpl();
-  RegionImpl(const RegionImpl &);
-  RegionImpl(Fresco::Region_ptr);
-  RegionImpl(Fresco::Region_ptr, Fresco::Transform_ptr);
-  RegionImpl(Fresco::Region_ptr, TransformImpl *);
-  virtual ~RegionImpl();
-  RegionImpl &operator = (const RegionImpl &);
-  virtual CORBA::Boolean defined();
-  virtual CORBA::Boolean contains(const Fresco::Vertex &);
-  virtual CORBA::Boolean contains_plane(const Fresco::Vertex &, Fresco::Axis a);
-  virtual CORBA::Boolean intersects(Fresco::Region_ptr);
-  CORBA::Boolean intersects(const RegionImpl &) const;
-  virtual void copy(Fresco::Region_ptr);
-  virtual void merge_intersect(Fresco::Region_ptr);
-  virtual void merge_union(Fresco::Region_ptr);
-  virtual void subtract(Fresco::Region_ptr);
-  virtual void apply_transform(Fresco::Transform_ptr);
-  void apply_transform(const Fresco::Transform::Matrix &);
-  virtual void bounds(Fresco::Vertex &, Fresco::Vertex &);
-  virtual void center(Fresco::Vertex &);
-  virtual void origin(Fresco::Vertex &);
-  virtual void span(Fresco::Axis, Fresco::Region::Allotment &);
-  virtual void outline(Fresco::Path_out);
 
-  void clear();
+  class RegionImpl;
+  template <> struct Initializer<RegionImpl>;
 
-  Fresco::Region_ptr _this ()
+  class RegionImpl : public virtual POA_Fresco::Region,
+		     public virtual ServantBase
   {
-    if (!_this_valid)
+      friend class Provider<RegionImpl>;
+    public:
+      RegionImpl();
+      RegionImpl(const RegionImpl &);
+      RegionImpl(Fresco::Region_ptr);
+      RegionImpl(Fresco::Region_ptr, Fresco::Transform_ptr);
+      RegionImpl(Fresco::Region_ptr, TransformImpl *);
+      virtual ~RegionImpl();
+      RegionImpl &operator = (const RegionImpl &);
+      virtual CORBA::Boolean defined();
+      virtual CORBA::Boolean contains(const Fresco::Vertex &);
+      virtual CORBA::Boolean contains_plane(const Fresco::Vertex &,
+					    Fresco::Axis a);
+      virtual CORBA::Boolean intersects(Fresco::Region_ptr);
+      CORBA::Boolean intersects(const RegionImpl &) const;
+      virtual void copy(Fresco::Region_ptr);
+      virtual void merge_intersect(Fresco::Region_ptr);
+      virtual void merge_union(Fresco::Region_ptr);
+      virtual void subtract(Fresco::Region_ptr);
+      virtual void apply_transform(Fresco::Transform_ptr);
+      void apply_transform(const Fresco::Transform::Matrix &);
+      virtual void bounds(Fresco::Vertex &, Fresco::Vertex &);
+      virtual void center(Fresco::Vertex &);
+      virtual void origin(Fresco::Vertex &);
+      virtual void span(Fresco::Axis, Fresco::Region::Allotment &);
+      virtual void outline(Fresco::Path_out);
+      
+      void clear();
+      
+      Fresco::Region_ptr _this ()
       {
-	__this = POA_Fresco::Region::_this();
-	_this_valid = true;
+	  if (!my_this_valid)
+	  {
+	      my_this = POA_Fresco::Region::_this();
+	      my_this_valid = true;
+	  }
+	  return Fresco::Region::_duplicate (my_this);
       }
-    return Fresco::Region::_duplicate (__this);
-  }
-
-public:
-  void normalize(Fresco::Vertex &);
-  void normalize(Fresco::Transform_ptr);
-  bool valid;
-  Fresco::Vertex lower, upper;
-  Fresco::Alignment xalign, yalign, zalign;
-
-  static void merge_min(Fresco::Vertex &, const Fresco::Vertex &);
-  static void merge_max(Fresco::Vertex &, const Fresco::Vertex &);
-  static Fresco::Coord span_align(Fresco::Coord, Fresco::Coord, Fresco::Coord);
-  static Fresco::Coord span_origin(Fresco::Coord, Fresco::Coord, Fresco::Coord);
-
-private:
-  bool _active : 1;
-  bool _this_valid;
-  Fresco::Region_var __this;
-};
-
-template <> struct Initializer<RegionImpl>
-{
-  static void initialize(RegionImpl *r) { r->clear();}
-};
+      
+    public:
+      void normalize(Fresco::Vertex &);
+      void normalize(Fresco::Transform_ptr);
+      bool valid;
+      Fresco::Vertex lower, upper;
+      Fresco::Alignment xalign, yalign, zalign;
 
-inline Fresco::Coord RegionImpl::span_origin(Fresco::Coord lower, Fresco::Coord upper, Fresco::Coord align)
-{
-  Fresco::Coord orig;
-  if (Math::equal(lower, upper, 1e-4)) orig = 0.;
-  else orig = lower + align * (upper - lower);
-  return orig;
-}
+      static void merge_min(Fresco::Vertex &, const Fresco::Vertex &);
+      static void merge_max(Fresco::Vertex &, const Fresco::Vertex &);
+      static Fresco::Coord span_align(Fresco::Coord, Fresco::Coord,
+				      Fresco::Coord);
+      static Fresco::Coord span_origin(Fresco::Coord, Fresco::Coord,
+				       Fresco::Coord);
 
-inline Fresco::Coord RegionImpl::span_align(Fresco::Coord lower, Fresco::Coord upper, Fresco::Coord origin)
-{
-  Fresco::Coord s;
-  if (Math::equal(lower, upper, 1e-4)) s = 0.;
-  else s = (origin - lower) / (upper - lower);
-  return s;
-}
+    private:
+      bool my_active : 1;
+      bool my_this_valid;
+      Fresco::Region_var my_this;
+  };
+  
+  template <> struct Initializer<RegionImpl>
+  {
+      static void initialize(RegionImpl *r) { r->clear();}
+  };
+  
+  inline Fresco::Coord RegionImpl::span_origin(Fresco::Coord lower,
+					       Fresco::Coord upper,
+					       Fresco::Coord align)
+  {
+      Fresco::Coord orig;
+      if (Math::equal(lower, upper, 1e-4)) orig = 0.;
+      else orig = lower + align * (upper - lower);
+      return orig;
+  }
 
-inline void RegionImpl::merge_min(Fresco::Vertex &v0, const Fresco::Vertex &v)
-{
-  v0.x = Math::min(v0.x, v.x);
-  v0.y = Math::min(v0.y, v.y);
-  v0.z = Math::min(v0.z, v.z);
-}
+  inline Fresco::Coord RegionImpl::span_align(Fresco::Coord lower,
+					      Fresco::Coord upper,
+					      Fresco::Coord origin)
+  {
+      Fresco::Coord s;
+      if (Math::equal(lower, upper, 1e-4)) s = 0.;
+      else s = (origin - lower) / (upper - lower);
+      return s;
+  }
 
-inline void RegionImpl::merge_max(Fresco::Vertex &v0, const Fresco::Vertex &v)
-{
-  v0.x = Math::max(v0.x, v.x);
-  v0.y = Math::max(v0.y, v.y);
-  v0.z = Math::max(v0.z, v.z);
-}
+  inline void RegionImpl::merge_min(Fresco::Vertex &v0,
+				    const Fresco::Vertex &v)
+  {
+      v0.x = Math::min(v0.x, v.x);
+      v0.y = Math::min(v0.y, v.y);
+      v0.z = Math::min(v0.z, v.z);
+  }
+  
+  inline void RegionImpl::merge_max(Fresco::Vertex &v0,
+				    const Fresco::Vertex &v)
+  {
+      v0.x = Math::max(v0.x, v.x);
+      v0.y = Math::max(v0.y, v.y);
+      v0.z = Math::max(v0.z, v.z);
+  }
+  
+  inline void RegionImpl::normalize(Fresco::Vertex &o)
+  {
+      o.x = span_origin(lower.x, upper.x, xalign);
+      o.y = span_origin(lower.y, upper.y, yalign);
+      o.z = span_origin(lower.z, upper.z, zalign);
+      lower -= o;
+      upper -= o;
+  }
+  
+  inline void RegionImpl::normalize(Fresco::Transform_ptr t)
+  {
+      Fresco::Vertex o;
+      normalize(o);
+      if (!CORBA::is_nil(t)) t->translate(o);
+  }
 
-inline void RegionImpl::normalize(Fresco::Vertex &o)
-{
-  o.x = span_origin(lower.x, upper.x, xalign);
-  o.y = span_origin(lower.y, upper.y, yalign);
-  o.z = span_origin(lower.z, upper.z, zalign);
-  lower -= o;
-  upper -= o;
 }
 
-inline void RegionImpl::normalize(Fresco::Transform_ptr t)
+namespace std
 {
-  Fresco::Vertex o;
-  normalize(o);
-  if (!CORBA::is_nil(t)) t->translate(o);
+  std::ostream &operator << (std::ostream &, const Berlin::RegionImpl &);
 }
-
-std::ostream &operator << (std::ostream &, const RegionImpl &);
 
 #endif

Index: Requestor.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Requestor.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Requestor.hh	29 May 2002 06:49:38 -0000	1.7
+++ Requestor.hh	29 Dec 2003 08:03:18 -0000	1.8
@@ -24,16 +24,24 @@
 
 #include <Berlin/MonoGraphic.hh>
 
-class Requestor : public MonoGraphic
+namespace Berlin
 {
-public:
-  Requestor(Fresco::Alignment xalign = .5, Fresco::Alignment yalign = .5, Fresco::Coord xspan = 1, Fresco::Coord yspan = 1);
-  Requestor(const Fresco::Graphic::Requisition &);
-  ~Requestor();
- 
-  virtual void request(Fresco::Graphic::Requisition &);
-protected:
-  Fresco::Graphic::Requisition _requisition;
-};
+
+  class Requestor : public MonoGraphic
+  {
+    public:
+      Requestor(Fresco::Alignment xalign = .5,
+		Fresco::Alignment yalign = .5,
+		Fresco::Coord xspan = 1,
+		Fresco::Coord yspan = 1);
+      Requestor(const Fresco::Graphic::Requisition &);
+      ~Requestor();
+      
+      virtual void request(Fresco::Graphic::Requisition &);
+    protected:
+      Fresco::Graphic::Requisition my_requisition;
+  };
+
+} // namespace
 
 #endif 

Index: ScreenImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ScreenImpl.hh,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- ScreenImpl.hh	29 May 2002 06:49:38 -0000	1.28
+++ ScreenImpl.hh	29 Dec 2003 08:03:18 -0000	1.29
@@ -28,40 +28,49 @@
 #include <Berlin/MonoGraphic.hh>
 #include <Berlin/ControllerImpl.hh>
 
-class ScreenManager;
-class EventManager;
-class RegionImpl;
-
-class ScreenImpl : public virtual POA_Fresco::Screen,
-                   public ControllerImpl
+namespace Berlin
 {
-public:
-    //. Sets up the screen to the sizes given by the console in use.
-    ScreenImpl();
-    virtual ~ScreenImpl();
-    //. Sets up the Event- and Screenmanager for this screen.
-    void bind_managers(EventManager *, ScreenManager *);
-    
-    virtual void pick(Fresco::PickTraversal_ptr);
-    virtual void allocations(Fresco::Allocation_ptr);
-    virtual void need_resize() { need_redraw();}
-    
-    virtual Fresco::Coord width();
-    virtual Fresco::Coord height();
-    virtual void damage(Fresco::Region_ptr);
-    
-    virtual CORBA::Boolean request_focus(Fresco::Controller_ptr, Fresco::Input::Device);
-    virtual CORBA::Boolean receive_focus(Fresco::Focus_ptr) { return true;}
-    virtual void lose_focus(Fresco::Input::Device) {}
-    virtual CORBA::Boolean handle_positional(Fresco::PickTraversal_ptr, const Fresco::Input::Event &) { return false;}
-    virtual CORBA::Boolean handle_non_positional(const Fresco::Input::Event &) { return false;}
+
+  class ScreenManager;
+  class EventManager;
+  class RegionImpl;
+  
+  class ScreenImpl : public virtual POA_Fresco::Screen,
+		     public ControllerImpl
+  {
+    public:
+      //. Sets up the screen to the sizes given by the console in use.
+      ScreenImpl();
+      virtual ~ScreenImpl();
+      //. Sets up the Event- and Screenmanager for this screen.
+      void bind_managers(EventManager *, ScreenManager *);
+      
+      virtual void pick(Fresco::PickTraversal_ptr);
+      virtual void allocations(Fresco::Allocation_ptr);
+      virtual void need_resize() { need_redraw();}
+      
+      virtual Fresco::Coord width();
+      virtual Fresco::Coord height();
+      virtual void damage(Fresco::Region_ptr);
+      
+      virtual CORBA::Boolean request_focus(Fresco::Controller_ptr,
+					   Fresco::Input::Device);
+      virtual CORBA::Boolean receive_focus(Fresco::Focus_ptr) { return true; }
+      virtual void lose_focus(Fresco::Input::Device) { }
+      virtual CORBA::Boolean handle_positional(Fresco::PickTraversal_ptr,
+					       const Fresco::Input::Event &)
+      { return false; }
+      virtual CORBA::Boolean
+      handle_non_positional(const Fresco::Input::Event &) { return false; }
     
-    Fresco::Region_ptr allocation();
-protected:
-    Fresco::Screen_ptr    __this;
-    EventManager          *_emanager;
-    ScreenManager         *_smanager;
-    Impl_var<RegionImpl>   _region;
-};
+      Fresco::Region_ptr allocation();
+    protected:
+      Fresco::Screen_ptr     my_this;
+      EventManager          *my_emanager;
+      ScreenManager         *my_smanager;
+      Impl_var<RegionImpl>   my_region;
+  };
+
+} // namespace
 
 #endif 

Index: ScreenManager.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ScreenManager.hh,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- ScreenManager.hh	23 Jan 2003 00:43:00 -0000	1.27
+++ ScreenManager.hh	29 Dec 2003 08:03:18 -0000	1.28
@@ -35,35 +35,41 @@
 #include <Berlin/EventManager.hh>
 #include <vector>
 
-class RegionImpl;
-
-//. The ScreenManager contains the main event loop. It queries the
-//. EventManager for those Events, registers damages to the screen's
-//. contents and repairs them by initialising a DrawTraversal whenever
-//. needed.
-class ScreenManager
+namespace Berlin
 {
-public:
-  ScreenManager(Fresco::Graphic_ptr, EventManager *, Fresco::DrawingKit_ptr);
-  ~ScreenManager();
-  //. This method marks the given Region as damaged.
-  void damage(Fresco::Region_ptr);
-  //. This method redraws the damaged regions of the screen.
-  //. The DrawTraversal gets started here!
-  void repair();
-  //. Start the gui thread
-  void start();
-private:
-  static void *run_thread(void *);
-  void run();
-  Fresco::Graphic_var         _screen;    //.< The graphic that is managed.
-  EventManager               *_emanager;
-  Fresco::DrawingKit_var      _drawing;   //.< The DrawingKit used to update this screen. 
-  Impl_var<RegionImpl>        _theDamage; //.< The region that got damaged.
-  Impl_var<RegionImpl>        _tmpDamage; //.< Temporary copy of _theDamage
-  Impl_var<DrawTraversalImpl> _traversal;
-  Prague::Mutex               _mutex;
-  Prague::Thread              my_thread;
-};
+
+  class RegionImpl;
+
+  //. The ScreenManager contains the main event loop. It queries the
+  //. EventManager for those Events, registers damages to the screen's
+  //. contents and repairs them by initialising a DrawTraversal whenever
+  //. needed.
+  class ScreenManager
+  {
+    public:
+      ScreenManager(Fresco::Graphic_ptr, EventManager *,
+		    Fresco::DrawingKit_ptr);
+      ~ScreenManager();
+      //. This method marks the given Region as damaged.
+      void damage(Fresco::Region_ptr);
+      //. This method redraws the damaged regions of the screen.
+      //. The DrawTraversal gets started here!
+      void repair();
+      //. Start the gui thread
+      void start();
+    private:
+      static void *run_thread(void *);
+      void run();
+      Fresco::Graphic_var my_screen; //.< The graphic that is managed.
+      EventManager *my_emanager;
+      Fresco::DrawingKit_var my_drawing; //.< The DrawingKit used to update this screen. 
+      Impl_var<RegionImpl> my_theDamage; //.< The region that got damaged.
+      Impl_var<RegionImpl> my_tmpDamage; //.< Temporary copy of _theDamage
+      Impl_var<DrawTraversalImpl> my_traversal;
+      Prague::Mutex my_mutex;
+      Prague::Thread my_thread;
+  };
+
+} // namespace
 
 #endif

Index: ServantBase.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ServantBase.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ServantBase.hh	29 May 2002 06:49:38 -0000	1.7
+++ ServantBase.hh	29 Dec 2003 08:03:18 -0000	1.8
@@ -28,32 +28,37 @@
 #include <Berlin/DefaultPOA.hh>
 #include <cassert>
 
-class ServantBase : virtual public PortableServer::ServantBase,
-		    private DefaultPOA
+namespace Berlin
 {
-  friend class KitImpl;
-  friend class IdentifiableImpl;
-public:
-  ServantBase();
-  ServantBase(const ServantBase &);
-  virtual ~ServantBase();
-  ServantBase &operator = (const ServantBase &);
-  virtual PortableServer::POA_ptr _default_POA();
-  virtual void _add_ref();
-  virtual void _remove_ref();
-  virtual void deactivate();
-protected:
-  static void deactivate(ServantBase *);
-  //.in case this object serves as a factory,
-  //.this method allows to activate the manufactored objects
-  //.with the same POA this object is registered with
-  void activate(ServantBase *);
-  //.if the servant is a composite, it needs to implement this method
-  //.to activate the child servants
-  virtual void activate_composite() {}
-private:
-  int                            _refcount;
-  PortableServer::POA_var        _poa;
+
+  class ServantBase : virtual public PortableServer::ServantBase,
+		      private DefaultPOA
+  {
+      friend class KitImpl;
+      friend class IdentifiableImpl;
+    public:
+      ServantBase();
+      ServantBase(const ServantBase &);
+      virtual ~ServantBase();
+      ServantBase &operator = (const ServantBase &);
+      virtual PortableServer::POA_ptr _default_POA();
+      virtual void _add_ref();
+      virtual void _remove_ref();
+      virtual void deactivate();
+    protected:
+      static void deactivate(ServantBase *);
+      //. In case this object serves as a factory,
+      //. this method allows to activate the manufactored objects
+      //. with the same POA this object is registered with
+      void activate(ServantBase *);
+      //. If the servant is a composite, it needs to implement this method
+      //. to activate the child servants
+      virtual void activate_composite() { }
+    private:
+      int                     my_refcount;
+      PortableServer::POA_var my_poa;
 };
+
+} // namespace
 
 #endif

Index: ServerContextImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ServerContextImpl.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ServerContextImpl.hh	18 Feb 2003 07:26:23 -0000	1.5
+++ ServerContextImpl.hh	29 Dec 2003 08:03:18 -0000	1.6
@@ -20,8 +20,8 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _ServerContextImpl_hh
-#define _ServerContextImpl_hh
+#ifndef _Berlin_ServerContextImpl_hh
+#define _Berlin_ServerContextImpl_hh
 
 #include <Prague/Sys/Thread.hh>
 #include <Fresco/config.hh>
@@ -30,39 +30,52 @@
 #include <Berlin/KitImpl.hh>
 #include <map>
 
-class ServerImpl;
-
-//. this is an encapsulated "entry point" which a client uses to manufacture
-//. new objects, look up singletons, look up the scene root, etc.
-class ServerContextImpl : public virtual POA_Fresco::ServerContext,
-			  public virtual PortableServer::RefCountServantBase,
-			  public DefaultPOA
+namespace Berlin
 {
-  typedef std::multimap<std::string, KitImpl *> klist_t;
-  friend class KitImpl;
-public:
-  ServerContextImpl(ServerImpl *, const CORBA::PolicyList &, Fresco::ClientContext_ptr);
-  ~ServerContextImpl();
-  PortableServer::POA_ptr _default_POA() { return DefaultPOA::_default_POA();}
 
-  Fresco::ClientContext_ptr client();
-  Fresco::Kit_ptr resolve(const char *, const Fresco::Kit::PropertySeq &)
-    throw (Fresco::SecurityException, Fresco::CreationFailureException);
-  void set_singleton(const char *, CORBA::Object_ptr) 
-    throw (Fresco::SecurityException, Fresco::SingletonFailureException);
-  void remove_singleton(const char *) 
-    throw (Fresco::SecurityException, Fresco::SingletonFailureException);
-  CORBA::Object_ptr get_singleton(const char *) 
-    throw (Fresco::SecurityException, Fresco::SingletonFailureException);
-  bool ping();
-private:
-  void erase(KitImpl *);
-  static unsigned long      my_counter;
-  ServerImpl               *my_server;
-  CORBA::PolicyList         my_policies;
-  Fresco::ClientContext_var my_client;
-  klist_t                   my_kits;
-  Prague::Mutex             my_mutex;
-};
+  class ServerImpl;
+
+  //. This is an encapsulated "entry point" which a client uses to
+  //. manufacture new objects, look up singletons, look up the scene root,
+  //. etc.
+  class ServerContextImpl : public virtual POA_Fresco::ServerContext,
+			    public virtual PortableServer::RefCountServantBase,
+			    public DefaultPOA
+  {
+      typedef std::multimap<std::string, KitImpl *> klist_t;
+      friend class KitImpl;
+    public:
+      ServerContextImpl(ServerImpl *, const CORBA::PolicyList &,
+			Fresco::ClientContext_ptr);
+      ~ServerContextImpl();
+      PortableServer::POA_ptr _default_POA()
+      { return DefaultPOA::_default_POA(); }
+
+      Fresco::ClientContext_ptr client();
+      Fresco::Kit_ptr resolve(const char *,
+			      const Fresco::Kit::PropertySeq &)
+	  throw (Fresco::SecurityException,
+		 Fresco::CreationFailureException);
+      void set_singleton(const char *, CORBA::Object_ptr) 
+	  throw (Fresco::SecurityException,
+		 Fresco::SingletonFailureException);
+      void remove_singleton(const char *) 
+	  throw (Fresco::SecurityException,
+		 Fresco::SingletonFailureException);
+      CORBA::Object_ptr get_singleton(const char *) 
+	  throw (Fresco::SecurityException,
+		 Fresco::SingletonFailureException);
+      bool ping();
+    private:
+      void erase(KitImpl *);
+      static unsigned long      my_counter;
+      ServerImpl               *my_server;
+      CORBA::PolicyList         my_policies;
+      Fresco::ClientContext_var my_client;
+      klist_t                   my_kits;
+      Prague::Mutex             my_mutex;
+  };
+
+} // namespace
 
 #endif

Index: ServerImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ServerImpl.hh,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ServerImpl.hh	18 Feb 2003 07:26:23 -0000	1.9
+++ ServerImpl.hh	29 Dec 2003 08:03:18 -0000	1.10
@@ -20,8 +20,8 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _ServerImpl_hh
-#define _ServerImpl_hh
+#ifndef _Berlin_ServerImpl_hh
+#define _Berlin_ServerImpl_hh
 
 #include <Fresco/config.hh>
 #include <Fresco/Server.hh>
@@ -34,127 +34,142 @@
 #include <string>
 #include <map>
 
-class ServerContextImpl;
-
-//. the Server just hands out new ServerContexts to
-//. people who are connecting.  it might want to do some checking on
-//. the incoming ClientContext's credentials, but at the moment it doesn't.
-class ServerImpl : public virtual POA_Fresco::Server,
-                   public virtual PortableServer::RefCountServantBase
+namespace Berlin
 {
-  friend class ServerContextImpl;
 
-  typedef std::vector<ServerContextImpl *> clist_t;
-  typedef std::vector<Prague::Plugin<KitImpl> *> pmap_t;
-  typedef std::vector<KitImpl *> kmap_t;
-  typedef std::map<std::string, CORBA::Object_var> smap_t;
+  class ServerContextImpl;
 
-public:
-  PortableServer::POA_ptr _default_POA() { return PortableServer::POA::_duplicate(my_poa);}
+  //. The Server just hands out new ServerContexts to
+  //. people who are connecting.  it might want to do some checking on
+  //. the incoming ClientContext's credentials, but at the moment it
+  //. doesn't.
+  class ServerImpl : public virtual POA_Fresco::Server,
+		     public virtual PortableServer::RefCountServantBase
+  {
+      friend class ServerContextImpl;
 
-  typedef std::multimap<std::string, Fresco::Kit::PropertySeq_var> PluginList;
+      typedef std::vector<ServerContextImpl *> clist_t;
+      typedef std::vector<Prague::Plugin<KitImpl> *> pmap_t;
+      typedef std::vector<KitImpl *> kmap_t;
+      typedef std::map<std::string, CORBA::Object_var> smap_t;
 
-  //. Create() can be called once only! It creates the one server-object.
-  static ServerImpl *create(PortableServer::POA_ptr poa, const CORBA::PolicyList &);
-  //. Get a reference to the server in use.
-  static ServerImpl *instance();
-  
-  //. Create a ServerContext. This is what is called by a client that
-  //. wants to connect to this server. A ServerContext holds all objects
-  //. generated by a client and gets deleted (destructing all those objects)
-  //. as soon as the client terminated (or the server is no longer
-  //. able to ping the client).
-  virtual Fresco::ServerContext_ptr
-  create_server_context(Fresco::ClientContext_ptr c)
-    throw (Fresco::SecurityException);
+    public:
+      PortableServer::POA_ptr _default_POA()
+      { return PortableServer::POA::_duplicate(my_poa); }
 
-  //. Set_singleton() 'publishes' a given Object under a given name.
-  //. Clients then can request access to this object with get_singleton.
-  //. The server makes sure that there are no two objects by the same name,
-  //. throwing an SingletonFailureException as soon as someone tries to
-  //. give a name allready known to the server,
-  virtual void set_singleton(const char *, CORBA::Object_ptr)
-    throw (Fresco::SecurityException, Fresco::SingletonFailureException);
-  //. This method removes the object of the given name from the
-  //. list of known singletons. It does not destruct the object
-  virtual void remove_singleton(const char *)
-    throw (Fresco::SecurityException, Fresco::SingletonFailureException);
-  virtual CORBA::Object_ptr get_singleton(const char *) 
-    throw (Fresco::SecurityException, Fresco::SingletonFailureException);
+      typedef std::multimap<std::string,
+			    Fresco::Kit::PropertySeq_var> PluginList;
+
+      //. Create() can be called once only! It creates the one
+      //. server-object.
+      static ServerImpl *create(PortableServer::POA_ptr poa,
+				const CORBA::PolicyList &);
+      //. Get a reference to the server in use.
+      static ServerImpl *instance();
   
-  //. Finds the requested Kit and returns a reference to it.
-  template <class K>
-  typename K::_ptr_type resolve(const char *,
-				const Fresco::Kit::PropertySeq &,
-				PortableServer::POA_ptr);
+      //. Create a ServerContext. This is what is called by a client that
+      //. wants to connect to this server. A ServerContext holds all
+      //. objects generated by a client and gets deleted (destructing all
+      //. those objects) as soon as the client terminated (or the server 
+      //. is no longer able to ping the client).
+      virtual Fresco::ServerContext_ptr
+      create_server_context(Fresco::ClientContext_ptr c)
+	  throw (Fresco::SecurityException);
 
-  //. Starts the server.
-  void start();
-  //. Stops the server.
-  void stop();
-  //. Pings all ServerContexts and destroys those that do not
-  //. respond (aka. crashed).
-  void ping();
-  //. This scans all directories given as modulepath in berlinrc for Kits
-  //. and loads the whole lot of them.
-  void scan(const std::string &);
-  //. Deletes all known Kits.
-  void clear();
-  //. Returns a list of all known Pluginnames (kits) and their properties.
-  PluginList list();
+      //. Set_singleton() 'publishes' a given Object under a given name.
+      //. Clients then can request access to this object with
+      //. get_singleton. The server makes sure that there are no two
+      //. objects by the same name, throwing an SingletonFailureException
+      //. as soon as someone tries to give a name already known,
+      virtual void set_singleton(const char *, CORBA::Object_ptr)
+	  throw (Fresco::SecurityException,
+		 Fresco::SingletonFailureException);
+      //. This method removes the object of the given name from the
+      //. list of known singletons. It does not destruct the object
+      virtual void remove_singleton(const char *)
+	  throw (Fresco::SecurityException,
+		 Fresco::SingletonFailureException);
+      virtual CORBA::Object_ptr get_singleton(const char *) 
+	  throw (Fresco::SecurityException,
+		 Fresco::SingletonFailureException);
+  
+      //. Finds the requested Kit and returns a reference to it.
+      template <class K>
+      typename K::_ptr_type resolve(const char *,
+				    const Fresco::Kit::PropertySeq &,
+				    PortableServer::POA_ptr);
 
-protected:
-  //. Finds the requested kit and loads it. This is a helper function only.
-  //. Use resolve,
-  KitImpl *create(const char *,
-		  const Fresco::Kit::PropertySeq &,
-		  PortableServer::POA_ptr,
-		  ServerContextImpl *);
+      //. Starts the server.
+      void start();
+      //. Stops the server.
+      void stop();
+      //. Pings all ServerContexts and destroys those that do not
+      //. respond (aka. crashed).
+      void ping();
+      //. This scans all directories given as modulepath in berlinrc for
+      //. Kits and loads the whole lot of them.
+      void scan(const std::string &);
+      //. Deletes all known Kits.
+      void clear();
+      //. Returns a list of all known Pluginnames (kits) and their
+      //. properties.
+      PluginList list();
 
-private:
-  ServerImpl(const CORBA::PolicyList &);
-  
-  //. Called every second to ping the clients.
-  static void *run(void *);
+    protected:
+      //. Finds the requested kit and loads it. This is a helper function
+      //. only. Use resolve,
+      KitImpl *create(const char *,
+		      const Fresco::Kit::PropertySeq &,
+		      PortableServer::POA_ptr,
+		      ServerContextImpl *);
 
-  //. Destroys a given Servercontext (and with that the client's resources
-  //. in this server).
-  static void destroy_context(ServerContextImpl *);
-  PortableServer::POA_var my_poa;
-  CORBA::PolicyList       my_policies;
-  Prague::Thread          my_thread;
-  Prague::Mutex           my_mutex;
-  smap_t                  my_singletons;
-  clist_t                 my_contexts;
-  pmap_t                  my_plugins;
-  kmap_t                  my_kits;
-  static ServerImpl      *my_server;
-};
+    private:
+      ServerImpl(const CORBA::PolicyList &);
+      
+      //. Called every second to ping the clients.
+      static void *run(void *);
+      
+      //. Destroys a given Servercontext (and with that the client's
+      //. resources in this server).
+      static void destroy_context(ServerContextImpl *);
+      PortableServer::POA_var my_poa;
+      CORBA::PolicyList       my_policies;
+      Prague::Thread          my_thread;
+      Prague::Mutex           my_mutex;
+      smap_t                  my_singletons;
+      clist_t                 my_contexts;
+      pmap_t                  my_plugins;
+      kmap_t                  my_kits;
+      static ServerImpl      *my_server;
+  };
 
-template <class K>
-typename K::_ptr_type ServerImpl::resolve(const char *type,
-					  const Fresco::Kit::PropertySeq &properties,
-					  PortableServer::POA_ptr poa)
-{
-  KitImpl *kit = create(type, properties, poa, 0);
-  if (!kit) return K::_nil();
-  typename K::_var_type reference;
-  try
-  {
-    reference = K::_narrow(Fresco::Kit_var(kit->_this()));
-  }
-  catch (CORBA::Exception &e)
-  {
-    std::cerr << "Cannot narrow reference: " << e << std::endl;
-    return K::_nil();
-  }
-  if (CORBA::is_nil(reference))
+  template <class K>
+  typename K::_ptr_type
+  ServerImpl::resolve(const char *type,
+		      const Fresco::Kit::PropertySeq &properties,
+		      PortableServer::POA_ptr poa)
   {
-    std::cerr << "Reference has incorrect type" << std::endl;
-    return K::_nil();
+      KitImpl *kit = create(type, properties, poa, 0);
+      if (!kit) return K::_nil();
+      typename K::_var_type reference;
+      try
+      {
+	  reference = K::_narrow(Fresco::Kit_var(kit->_this()));
+      }
+      catch (CORBA::Exception &e)
+      {
+	  std::cerr << "Cannot narrow reference: " << e << std::endl;
+	  return K::_nil();
+      }
+      if (CORBA::is_nil(reference))
+      {
+	  std::cerr << "Reference has incorrect type" << std::endl;
+	  return K::_nil();
+      }
+      my_kits.push_back(kit);
+      return reference._retn();
   }
-  my_kits.push_back(kit);
-  return reference._retn();
-}
+  
+} // namespace
 
 #endif

Index: SubjectImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/SubjectImpl.hh,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- SubjectImpl.hh	29 May 2002 06:49:38 -0000	1.20
+++ SubjectImpl.hh	29 Dec 2003 08:03:18 -0000	1.21
@@ -30,23 +30,28 @@
 #include "Berlin/IdentifiableImpl.hh"
 #include <vector>
 
-class SubjectImpl : public virtual POA_Fresco::Subject,
-		    public virtual RefCountBaseImpl,
-                    public virtual IdentifiableImpl
+namespace Berlin
 {
-  typedef std::vector<Fresco::Observer_var> olist_t;
-public:
-  SubjectImpl();
-  void attach(Fresco::Observer_ptr);
-  void detach(Fresco::Observer_ptr);
-  void notify(const CORBA::Any &);
-  virtual void notify();
-  void block(CORBA::Boolean);  
-private:
-  olist_t        _observers;
-  CORBA::Boolean _blocked;
-  Prague::Mutex  _mutex;
-  Prague::Mutex  _observerMutex;
-};
+
+  class SubjectImpl : public virtual POA_Fresco::Subject,
+		      public virtual RefCountBaseImpl,
+		      public virtual IdentifiableImpl
+  {
+      typedef std::vector<Fresco::Observer_var> olist_t;
+    public:
+      SubjectImpl();
+      void attach(Fresco::Observer_ptr);
+      void detach(Fresco::Observer_ptr);
+      void notify(const CORBA::Any &);
+      virtual void notify();
+      void block(CORBA::Boolean);  
+    private:
+      olist_t        my_observers;
+      CORBA::Boolean my_blocked;
+      Prague::Mutex  my_mutex;
+      Prague::Mutex  my_observerMutex;
+  };
+
+} // namespace
 
 #endif 

Index: TransformImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/TransformImpl.hh,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- TransformImpl.hh	29 May 2002 06:49:38 -0000	1.16
+++ TransformImpl.hh	29 Dec 2003 08:03:18 -0000	1.17
@@ -27,73 +27,79 @@
 #include <Berlin/ServantBase.hh>
 #include <Berlin/Provider.hh>
 
-class TransformImpl;
-template <> struct Initializer<TransformImpl>;
-
-class TransformImpl : public virtual POA_Fresco::Transform,
-		      public virtual ServantBase
+namespace Berlin
 {
-  friend class Provider<TransformImpl>;
-  friend class Initializer<TransformImpl>;
-public:
-  TransformImpl();
-  TransformImpl(const TransformImpl &);
-  TransformImpl(Fresco::Transform_ptr t) : _this_valid (false) { copy(t);}
-  TransformImpl(Fresco::Transform::Matrix m);
-  virtual ~TransformImpl();
-  TransformImpl &operator = (const TransformImpl &);
-  virtual void copy(Fresco::Transform_ptr);
-  virtual void load_identity();
-  virtual void load_matrix(const Fresco::Transform::Matrix);
-  virtual void store_matrix(Fresco::Transform::Matrix);
-  virtual CORBA::Boolean equal(Fresco::Transform_ptr);
-  virtual CORBA::Boolean identity();
-  virtual CORBA::Boolean translation();
-  virtual CORBA::Boolean det_is_zero();
-  virtual void scale(const Fresco::Vertex &);
-  virtual void rotate(CORBA::Double, Fresco::Axis);
-  virtual void translate(const Fresco::Vertex &);
-  virtual void premultiply(Fresco::Transform_ptr);
-  virtual void postmultiply(Fresco::Transform_ptr);
-  virtual void invert();
-  virtual void transform_vertex(Fresco::Vertex &);
-  virtual void inverse_transform_vertex(Fresco::Vertex &);
-
-  Fresco::Transform::Matrix &matrix() { return _matrix;}
-  const Fresco::Transform::Matrix &matrix() const { return _matrix;}
 
-  Fresco::Transform_ptr _this()
+  class TransformImpl;
+  template <> struct Initializer<TransformImpl>;
+  
+  class TransformImpl : public virtual POA_Fresco::Transform,
+			public virtual ServantBase
   {
-    if (!_this_valid)
-      {
-	__this = POA_Fresco::Transform::_this ();
-	_this_valid = true;
-      }
-    return Fresco::Transform::_duplicate (__this);
-  }
-
-  // Allow for quicker traversals (test)
-  void set_and_premult(TransformImpl* set, Fresco::Transform_ptr mult);
-
-private:
-  void init();
-  void modified() { _dirty = true;}
-  void recompute();
-  Fresco::Coord det();
-  Fresco::Transform::Matrix _matrix;
-  bool _dirty       : 1;
-  bool _identity    : 1;
-  bool _translation : 1;
-  bool _xy          : 1;
-  bool _this_valid  : 1;
-  bool _active      : 1;
+      friend class Provider<TransformImpl>;
+      friend class Initializer<TransformImpl>;
+    public:
+      TransformImpl();
+      TransformImpl(const TransformImpl &);
+      TransformImpl(Fresco::Transform_ptr t) : my_this_valid(false)
+      { copy(t); }
+      TransformImpl(Fresco::Transform::Matrix m);
+      virtual ~TransformImpl();
+      TransformImpl &operator = (const TransformImpl &);
+      virtual void copy(Fresco::Transform_ptr);
+      virtual void load_identity();
+      virtual void load_matrix(const Fresco::Transform::Matrix);
+      virtual void store_matrix(Fresco::Transform::Matrix);
+      virtual CORBA::Boolean equal(Fresco::Transform_ptr);
+      virtual CORBA::Boolean identity();
+      virtual CORBA::Boolean translation();
+      virtual CORBA::Boolean det_is_zero();
+      virtual void scale(const Fresco::Vertex &);
+      virtual void rotate(CORBA::Double, Fresco::Axis);
+      virtual void translate(const Fresco::Vertex &);
+      virtual void premultiply(Fresco::Transform_ptr);
+      virtual void postmultiply(Fresco::Transform_ptr);
+      virtual void invert();
+      virtual void transform_vertex(Fresco::Vertex &);
+      virtual void inverse_transform_vertex(Fresco::Vertex &);
+      
+      Fresco::Transform::Matrix &matrix() { return my_matrix;}
+      const Fresco::Transform::Matrix &matrix() const { return my_matrix;}
+      
+      Fresco::Transform_ptr _this()
+	  {
+	      if (!my_this_valid)
+	      {
+		  my_this = POA_Fresco::Transform::_this ();
+		  my_this_valid = true;
+	      }
+	      return Fresco::Transform::_duplicate (my_this);
+	  }
+      
+      // Allow for quicker traversals (test)
+      void set_and_premult(TransformImpl* set, Fresco::Transform_ptr mult);
+      
+    private:
+      void init();
+      void modified() { my_dirty = true;}
+      void recompute();
+      Fresco::Coord det();
+      Fresco::Transform::Matrix my_matrix;
+      bool my_dirty       : 1;
+      bool my_identity    : 1;
+      bool my_translation : 1;
+      bool my_xy          : 1;
+      bool my_this_valid  : 1;
+      bool my_active      : 1;
+      
+      Fresco::Transform_var my_this;
+  };
 
-  Fresco::Transform_var __this;
-};
+  template <> struct Initializer<TransformImpl>
+  {
+      static void initialize(TransformImpl *t) { t->init(); }
+  };
 
-template <> struct Initializer<TransformImpl>
-{
-  static void initialize(TransformImpl *t) { t->init();}
-};
+} //namespace
 
 #endif

Index: TraversalImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/TraversalImpl.hh,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- TraversalImpl.hh	10 Dec 2003 18:12:25 -0000	1.26
+++ TraversalImpl.hh	29 Dec 2003 08:03:18 -0000	1.27
@@ -31,67 +31,73 @@
 #include <Berlin/TransformImpl.hh>
 #include <vector>
 
-//. TraversalImpl keeps a stack of context information for
-//. the Graphic nodes it visits. Use push and pop to add/remove
-//. new nodes to the stack. Items added via push are assumed to
-//. be managed by the caller, i.e. they are not deleted in the pop
-//. operation. In contrast, if you create a TraversalImpl via the
-//. copy constructor, it creates a deep copy of raw pointer types,
-//. and increments the ref count for ref counted objects.
-//. The number of push and pop operations called on a single TraversalImpl
-//. object therefor need to be balanced.
-class TraversalImpl : public virtual POA_Fresco::Traversal,
-                      public virtual ServantBase
+namespace Berlin
 {
-    struct State
-    {
-	State() : id(0), transformation(0) { }
-	State(Fresco::Graphic_ptr g, Fresco::Tag i,
-	      RegionImpl *a, TransformImpl *t) :
-	    graphic(g), id(i), allocation(a), transformation(t)
-	{ }
-	Fresco::Graphic_ptr      graphic;
-	Fresco::Tag              id;
-	RegionImpl              *allocation;
-	TransformImpl           *transformation;    
-    };
-    typedef std::vector<State> stack_t;
-  public:
-    TraversalImpl(Fresco::Graphic_ptr, Fresco::Region_ptr,
-		  Fresco::Transform_ptr);
-    TraversalImpl(const TraversalImpl &);
-    ~TraversalImpl();
-    TraversalImpl &operator = (const TraversalImpl &);
-    virtual Fresco::Region_ptr current_allocation();
-    virtual Fresco::Transform_ptr current_transformation();
-    virtual Fresco::Graphic_ptr current_graphic();
-    virtual CORBA::Boolean bounds(Fresco::Vertex &, Fresco::Vertex &,
-				  Fresco::Vertex &);
-    virtual CORBA::Boolean intersects_allocation() = 0;
-    virtual CORBA::Boolean intersects_region(Fresco::Region_ptr) = 0;
-    virtual void traverse_child(Fresco::Graphic_ptr, Fresco::Tag,
-				Fresco::Region_ptr,
-				Fresco::Transform_ptr) = 0;
-    virtual void visit(Fresco::Graphic_ptr) = 0;
-    virtual Fresco::Traversal::order direction() = 0;
-    virtual CORBA::Boolean ok() = 0;
-    virtual void update();
-  protected:
-    //. push puts the actual trail values on a stack. They are *not*
-    //. reference counted, it is assumed that pop is called in the same
-    //. scope. Alternatively, values not removed from the stack are
-    //. deallocated in the destructor.
-    void push(Fresco::Graphic_ptr, Fresco::Tag,
-	      RegionImpl *, TransformImpl *);
-    void pop();
-    size_t size() const { return my_stack.size(); }
-    RegionImpl    *get_allocation(size_t i) { return my_stack[i].allocation; }
-    TransformImpl *get_transformation(size_t i)
-    { return my_stack[i].transformation; }
-    Fresco::Graphic_ptr get_graphic(size_t i) { return my_stack[i].graphic; }
-  private:
-    void clear();
-    stack_t my_stack;
-};
+
+  //. TraversalImpl keeps a stack of context information for
+  //. the Graphic nodes it visits. Use push and pop to add/remove
+  //. new nodes to the stack. Items added via push are assumed to
+  //. be managed by the caller, i.e. they are not deleted in the pop
+  //. operation. In contrast, if you create a TraversalImpl via the
+  //. copy constructor, it creates a deep copy of raw pointer types,
+  //. and increments the ref count for ref counted objects.
+  //. The number of push and pop operations called on a single TraversalImpl
+  //. object therefor need to be balanced.
+  class TraversalImpl : public virtual POA_Fresco::Traversal,
+			public virtual ServantBase
+  {
+      struct State
+      {
+	  State() : id(0), transformation(0) { }
+	  State(Fresco::Graphic_ptr g, Fresco::Tag i,
+		RegionImpl *a, TransformImpl *t) :
+	      graphic(g), id(i), allocation(a), transformation(t)
+	  { }
+	  Fresco::Graphic_ptr      graphic;
+	  Fresco::Tag              id;
+	  RegionImpl              *allocation;
+	  TransformImpl           *transformation;    
+      };
+      typedef std::vector<State> stack_t;
+    public:
+      TraversalImpl(Fresco::Graphic_ptr, Fresco::Region_ptr,
+		    Fresco::Transform_ptr);
+      TraversalImpl(const TraversalImpl &);
+      ~TraversalImpl();
+      TraversalImpl &operator = (const TraversalImpl &);
+      virtual Fresco::Region_ptr current_allocation();
+      virtual Fresco::Transform_ptr current_transformation();
+      virtual Fresco::Graphic_ptr current_graphic();
+      virtual CORBA::Boolean bounds(Fresco::Vertex &, Fresco::Vertex &,
+				    Fresco::Vertex &);
+      virtual CORBA::Boolean intersects_allocation() = 0;
+      virtual CORBA::Boolean intersects_region(Fresco::Region_ptr) = 0;
+      virtual void traverse_child(Fresco::Graphic_ptr, Fresco::Tag,
+				  Fresco::Region_ptr,
+				  Fresco::Transform_ptr) = 0;
+      virtual void visit(Fresco::Graphic_ptr) = 0;
+      virtual Fresco::Traversal::order direction() = 0;
+      virtual CORBA::Boolean ok() = 0;
+      virtual void update();
+    protected:
+      //. push puts the actual trail values on a stack. They are *not*
+      //. reference counted, it is assumed that pop is called in the same
+      //. scope. Alternatively, values not removed from the stack are
+      //. deallocated in the destructor.
+      void push(Fresco::Graphic_ptr, Fresco::Tag,
+		RegionImpl *, TransformImpl *);
+      void pop();
+      size_t size() const { return my_stack.size(); }
+      RegionImpl *get_allocation(size_t i) { return my_stack[i].allocation; }
+      TransformImpl *get_transformation(size_t i)
+      { return my_stack[i].transformation; }
+      Fresco::Graphic_ptr get_graphic(size_t i)
+      { return my_stack[i].graphic; }
+    private:
+      void clear();
+      stack_t my_stack;
+  };
+  
+} // namespace
 
 #endif

Index: Vertex.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/Vertex.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Vertex.hh	29 May 2002 06:49:38 -0000	1.7
+++ Vertex.hh	29 Dec 2003 08:03:18 -0000	1.8
@@ -26,38 +26,42 @@
 #include <Fresco/Types.hh>
 #include <iostream>
 
-inline Fresco::Vertex &operator += (Fresco::Vertex &p, const Fresco::Vertex &q)
+inline Fresco::Vertex &operator += (Fresco::Vertex &p,
+				    const Fresco::Vertex &q)
 {
-  p.x += q.x;
-  p.y += q.y;
-  p.z += q.z;
-  return p;
+    p.x += q.x;
+    p.y += q.y;
+    p.z += q.z;
+    return p;
 }
 
-inline Fresco::Vertex &operator -= (Fresco::Vertex &p, const Fresco::Vertex &q)
+inline Fresco::Vertex &operator -= (Fresco::Vertex &p,
+				    const Fresco::Vertex &q)
 {
-  p.x -= q.x;
-  p.y -= q.y;
-  p.z -= q.z;
-  return p;
+    p.x -= q.x;
+    p.y -= q.y;
+    p.z -= q.z;
+    return p;
 }
 
-inline Fresco::Vertex operator + (const Fresco::Vertex &p, const Fresco::Vertex &q)
+inline Fresco::Vertex operator + (const Fresco::Vertex &p,
+				  const Fresco::Vertex &q)
 {
-  Fresco::Vertex r;
-  r.x = p.x + q.x;
-  r.y = p.y + q.y;
-  r.z = p.z + q.z;
-  return r;
+    Fresco::Vertex r;
+    r.x = p.x + q.x;
+    r.y = p.y + q.y;
+    r.z = p.z + q.z;
+    return r;
 }
 
-inline Fresco::Vertex operator - (const Fresco::Vertex &p, const Fresco::Vertex &q)
+inline Fresco::Vertex operator - (const Fresco::Vertex &p,
+				  const Fresco::Vertex &q)
 {
-  Fresco::Vertex r;
-  r.x = p.x - q.x;
-  r.y = p.y - q.y;
-  r.z = p.z - q.z;
-  return r;
+    Fresco::Vertex r;
+    r.x = p.x - q.x;
+    r.y = p.y - q.y;
+    r.z = p.z - q.z;
+    return r;
 }
 
 #endif

Index: ViewImpl.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/ViewImpl.hh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ViewImpl.hh	29 May 2002 06:49:38 -0000	1.2
+++ ViewImpl.hh	29 Dec 2003 08:03:18 -0000	1.3
@@ -19,18 +19,23 @@
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  * MA 02139, USA.
  */
-#ifndef _ViewImpl_hh
-#define _ViewImpl_hh
+#ifndef _Berlin_ViewImpl_hh
+#define _Berlin_ViewImpl_hh
 
 #include <Fresco/config.hh>
 #include <Fresco/View.hh>
 #include <Berlin/ObserverImpl.hh>
 
-class ViewImpl : public virtual POA_Fresco::View,
-		 public virtual ObserverImpl
+namespace Berlin
 {
-public:
-  virtual void destroy() {}
-};
+
+  class ViewImpl : public virtual POA_Fresco::View,
+		   public virtual ObserverImpl
+  {
+    public:
+      virtual void destroy() { }
+  };
+
+} // namespace
 
 #endif