]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/canvas_fwd.hxx
Canvas: base Elements/Canvas on SGWeakReferenced.
[simgear.git] / simgear / canvas / canvas_fwd.hxx
index 802a882761f127cd5176f8a8133624d9117f46ec..d91696eb3b28fee751a873f5f14617d9c63610f8 100644 (file)
@@ -37,29 +37,49 @@ 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 SGSharedPtr<name> name##Ptr;\
+  typedef SGWeakPtr<name> name##WeakPtr;
 
-  class Element;
-  typedef boost::shared_ptr<Element> ElementPtr;
-  typedef boost::weak_ptr<Element> ElementWeakPtr;
+  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)
+
+#undef SG_FWD_DECL
+
+#define SG_FWD_DECL(name)\
+  class name;\
+  typedef boost::shared_ptr<name> name##Ptr;\
+  typedef boost::weak_ptr<name> name##WeakPtr;
+
+  SG_FWD_DECL(Event)
+  SG_FWD_DECL(MouseEvent)
+  SG_FWD_DECL(Placement)
+  SG_FWD_DECL(SystemAdapter)
+
+#undef SG_FWD_DECL
+
+  class EventManager;
+  class EventVisitor;
 
   typedef std::map<std::string, const SGPropertyNode*> Style;
   typedef ElementPtr (*ElementFactory)( const CanvasWeakPtr&,
                                         const SGPropertyNode_ptr&,
-                                        const Style& );
+                                        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;
+  typedef boost::function<void(const EventPtr&)> EventListener;
 
 } // namespace canvas
 } // namespace simgear