]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scripting/NasalCanvas.cxx
Reduce amount of log output at level=debug.
[flightgear.git] / src / Scripting / NasalCanvas.cxx
index 78540f90e7a1409adecbb52839715f11460d79b7..a4f9c2a01156f57d4e4b3a224bd7afd94bfc45ba 100644 (file)
@@ -148,6 +148,14 @@ naRef f_canvasCreateGroup(sc::Canvas& canvas, const nasal::CallContext& ctx)
   );
 }
 
+/**
+ * Get group containing all gui windows
+ */
+naRef f_getDesktop(naContext c, naRef me, int argc, naRef* args)
+{
+  return NasalGroup::create(c, requireGUIMgr(c).getDesktop());
+}
+
 naRef f_elementGetTransformedBounds(sc::Element& el, const nasal::CallContext& ctx)
 {
   osg::BoundingBox bb = el.getTransformedBounds( osg::Matrix::identity() );
@@ -199,6 +207,7 @@ naRef initNasalCanvas(naRef globals, naContext c, naRef gcSave)
   NasalEvent::init("canvas.Event")
     .member("type", &sc::Event::getTypeString)
     .member("target", &sc::Event::getTarget)
+    .member("currentTarget", &sc::Event::getCurrentTarget)
     .method("stopPropagation", &sc::Event::stopPropagation);
   NasalMouseEvent::init("canvas.MouseEvent")
     .bases<NasalEvent>()
@@ -232,6 +241,7 @@ naRef initNasalCanvas(naRef globals, naContext c, naRef gcSave)
     .method("getNearestCursor", &sc::Text::getNearestCursor);
 
   NasalWindow::init("canvas.Window")
+    .bases<NasalElement>()
     .member("_node_ghost", &elementGetNode<canvas::Window>)
     .method("_getCanvasDecoration", &canvas::Window::getCanvasDecoration);
 
@@ -241,6 +251,7 @@ naRef initNasalCanvas(naRef globals, naContext c, naRef gcSave)
   canvas_module.set("_newCanvasGhost", f_createCanvas);
   canvas_module.set("_newWindowGhost", f_createWindow);
   canvas_module.set("_getCanvasGhost", f_getCanvas);
+  canvas_module.set("_getDesktopGhost", f_getDesktop);
 
   return naNil();
 }