]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/elements/CanvasImage.hxx
CanvasImage: improve fetching from http and add mime detection.
[simgear.git] / simgear / canvas / elements / CanvasImage.hxx
index 491ac19d37df3b7f063bdc030302e91ffc9f02b0..c9e3c081289f5ced3c7f8853ad276833e5074dde 100644 (file)
@@ -27,6 +27,7 @@
 
 namespace simgear
 {
+namespace HTTP { class Request; }
 namespace canvas
 {
 
@@ -35,6 +36,7 @@ namespace canvas
   {
     public:
       static const std::string TYPE_NAME;
+      static void staticInit();
 
       /**
        * @param node    Property node containing settings for this image:
@@ -102,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<osg::Texture2D> _texture;
       // TODO optionally forward events to canvas
       CanvasWeakPtr _src_canvas;