X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCanvas%2Fcanvas_mgr.hxx;h=b14403491b9a1c7a182ce4df27dd34cf61942d0d;hb=733e3b3f0c8ed5c880b57e3175dd6e5e3fd0ce9c;hp=d1ae926032ab63b785ab71263bfc7245db27c5e1;hpb=373d511c6948ae4737b183e0ac38471544b6f499;p=flightgear.git diff --git a/src/Canvas/canvas_mgr.hxx b/src/Canvas/canvas_mgr.hxx index d1ae92603..b14403491 100644 --- a/src/Canvas/canvas_mgr.hxx +++ b/src/Canvas/canvas_mgr.hxx @@ -19,61 +19,35 @@ #ifndef CANVAS_MGR_H_ #define CANVAS_MGR_H_ -#include -#include - -#include -#include - -class Canvas; -typedef boost::shared_ptr CanvasPtr; +#include +#include 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 _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 _gui_camera; + SGPropertyChangeCallback _cb_model_reinit; + void handleModelReinit(SGPropertyNode*); }; #endif /* CANVAS_MGR_H_ */