X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=simgear%2Fcanvas%2Felements%2FCanvasImage.hxx;h=c9e3c081289f5ced3c7f8853ad276833e5074dde;hb=fd51518d9214f8e152e16ae46392501b95bab28a;hp=3b8dca7884aa401e4145f7c67750a31413fa6303;hpb=83da4e92486f3ab496eb43a90e46dc45b293e925;p=simgear.git diff --git a/simgear/canvas/elements/CanvasImage.hxx b/simgear/canvas/elements/CanvasImage.hxx index 3b8dca78..c9e3c081 100644 --- a/simgear/canvas/elements/CanvasImage.hxx +++ b/simgear/canvas/elements/CanvasImage.hxx @@ -27,6 +27,7 @@ namespace simgear { +namespace HTTP { class Request; } namespace canvas { @@ -34,6 +35,9 @@ namespace canvas public Element { public: + static const std::string TYPE_NAME; + static void staticInit(); + /** * @param node Property node containing settings for this image: * rect/[left/right/top/bottom] Dimensions of source @@ -43,7 +47,7 @@ namespace canvas */ Image( const CanvasWeakPtr& canvas, const SGPropertyNode_ptr& node, - const Style& parent_style, + const Style& parent_style = Style(), Element* parent = 0 ); virtual ~Image(); @@ -100,6 +104,12 @@ namespace canvas void setQuad(size_t index, const SGVec2f& tl, const SGVec2f& br); void setQuadUV(size_t index, const SGVec2f& tl, const SGVec2f& br); + void handleImageLoadDone(HTTP::Request*); + bool loadImage( osgDB::ReaderWriter& reader, + const std::string& data, + HTTP::Request& request, + const std::string& type ); + osg::ref_ptr _texture; // TODO optionally forward events to canvas CanvasWeakPtr _src_canvas;