#ifndef CANVAS_MGR_H_
#define CANVAS_MGR_H_
-#include <simgear/props/props.hxx>
-#include <simgear/structure/subsystem_mgr.hxx>
-
-#include <boost/shared_ptr.hpp>
-#include <vector>
-
-class Canvas;
-typedef boost::shared_ptr<Canvas> CanvasPtr;
+#include <simgear/canvas/CanvasMgr.hxx>
+#include <simgear/props/PropertyBasedMgr.hxx>
class CanvasMgr:
- public SGSubsystem,
- public SGPropertyChangeListener
+ public simgear::canvas::CanvasMgr
{
public:
CanvasMgr();
- virtual ~CanvasMgr();
virtual void init();
- virtual void reinit();
virtual void shutdown();
- virtual void bind();
- virtual void unbind();
-
- virtual void update(double delta_time_sec);
-
- virtual void childAdded( SGPropertyNode * parent,
- SGPropertyNode * child );
- virtual void childRemoved( SGPropertyNode * parent,
- SGPropertyNode * child );
-
/**
* Get OpenGL texture name for given canvas
*
- * @param Index of canvas
+ * @deprecated This was only meant to be used by the PUI CanvasWidget
+ * implementation as PUI can't handle osg::Texture objects.
+ * Use getCanvas(index)->getTexture() instead.
+ *
* @return OpenGL texture name
*/
- unsigned int getCanvasTexId(size_t index) const;
+ unsigned int getCanvasTexId(const simgear::canvas::CanvasPtr& canvas) const;
- private:
+ protected:
- /** Root node for everything concerning the canvas system */
- SGPropertyNode_ptr _props;
-
- /** The actual canvases */
- std::vector<CanvasPtr> _canvases;
-
- void textureAdded(SGPropertyNode* node);
-
- /**
- * Trigger a childAdded and valueChanged event for every child of node
- * (Unlimited depth) and node itself.
- */
- void triggerChangeRecursive(SGPropertyNode* node);
+ osg::observer_ptr<osg::Camera> _gui_camera;
+ SGPropertyChangeCallback<CanvasMgr> _cb_model_reinit;
+ void handleModelReinit(SGPropertyNode*);
};
#endif /* CANVAS_MGR_H_ */