]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/Canvas.hxx
Canvas: Respect clipping while event handling.
[simgear.git] / simgear / canvas / Canvas.hxx
index 08fbe40dc3a9f363596cf8fced67799f45fd45db..c350257c0b26833df58f077ea50a5213b6d45baf 100644 (file)
@@ -71,11 +71,9 @@ namespace canvas
       typedef osg::ref_ptr<CullCallback> CullCallbackPtr;
 
       Canvas(SGPropertyNode* node);
+      virtual ~Canvas();
       virtual void onDestroy();
 
-      void setSystemAdapter(const SystemAdapterPtr& system_adapter);
-      SystemAdapterPtr getSystemAdapter() const;
-
       void setCanvasMgr(CanvasMgr* canvas_mgr);
       CanvasMgr* getCanvasMgr() const;
 
@@ -132,7 +130,7 @@ namespace canvas
 
       void update(double delta_time_sec);
 
-      naRef addEventListener(const nasal::CallContext& ctx);
+      bool addEventListener(const std::string& type, const EventListener& cb);
 
       void setSizeX(int sx);
       void setSizeY(int sy);
@@ -162,10 +160,20 @@ namespace canvas
       void reloadPlacements( const std::string& type = std::string() );
       static void addPlacementFactory( const std::string& type,
                                        PlacementFactory factory );
+      static void removePlacementFactory(const std::string& type);
+
+      /**
+       * Set global SystemAdapter for all Canvas/ODGauge instances.
+       *
+       * The SystemAdapter is responsible for application specific operations
+       * like loading images/fonts and adding/removing cameras to the scene
+       * graph.
+       */
+      static void setSystemAdapter(const SystemAdapterPtr& system_adapter);
+      static SystemAdapterPtr getSystemAdapter();
 
     protected:
 
-      SystemAdapterPtr  _system_adapter;
       CanvasMgr        *_canvas_mgr;
 
       boost::scoped_ptr<EventManager> _event_manager;
@@ -202,6 +210,8 @@ namespace canvas
 
     private:
 
+      static SystemAdapterPtr _system_adapter;
+
       Canvas(const Canvas&); // = delete;
       Canvas& operator=(const Canvas&); // = delete;
   };