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;
- 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)
+
+ 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 boost::function<ElementPtr( const CanvasWeakPtr&,
- const SGPropertyNode_ptr&,
- const Style& )> ElementFactory;
+ 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