]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/canvas_fwd.hxx
First working version of DOM like Canvas event handling
[simgear.git] / simgear / canvas / canvas_fwd.hxx
index 2588460a313221899cfd73d1f888fbec16a92067..4b0e41e10ccc2acca7011550fe0a992e817da118 100644 (file)
@@ -29,6 +29,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 
+#include <map>
 #include <vector>
 
 namespace simgear
@@ -36,21 +37,41 @@ namespace simgear
 namespace canvas
 {
 
-  class Canvas;
-  typedef boost::shared_ptr<Canvas> CanvasPtr;
-  typedef boost::weak_ptr<Canvas> CanvasWeakPtr;
+#define SG_FWD_DECL(name)\
+  class name;\
+  typedef boost::shared_ptr<name> name##Ptr;\
+  typedef boost::weak_ptr<name> name##WeakPtr;
+
+  SG_FWD_DECL(Canvas)
+  SG_FWD_DECL(Element)
+  SG_FWD_DECL(Group)
+  SG_FWD_DECL(Image)
+  SG_FWD_DECL(Map)
+  SG_FWD_DECL(Path)
+  SG_FWD_DECL(Text)
+
+  SG_FWD_DECL(Event)
+  SG_FWD_DECL(EventListener)
+  SG_FWD_DECL(MouseEvent)
+  SG_FWD_DECL(Placement)
+  SG_FWD_DECL(SystemAdapter)
+
+#undef SG_FWD_DECL
+
+  class EventVisitor;
+
+  typedef std::map<std::string, const SGPropertyNode*> Style;
+  typedef ElementPtr (*ElementFactory)( const CanvasWeakPtr&,
+                                        const SGPropertyNode_ptr&,
+                                        const Style&,
+                                        Element* );
 
   typedef osg::ref_ptr<osgText::Font> FontPtr;
 
-  class Placement;
-  typedef boost::shared_ptr<Placement> PlacementPtr;
   typedef std::vector<PlacementPtr> Placements;
-  typedef boost::function<Placements( const SGPropertyNode*,
+  typedef boost::function<Placements( SGPropertyNode*,
                                       CanvasPtr )> PlacementFactory;
 
-  class SystemAdapter;
-  typedef boost::shared_ptr<SystemAdapter> SystemAdapterPtr;
-
 } // namespace canvas
 } // namespace simgear