From: Thomas Geymayer Date: Fri, 9 May 2014 14:06:23 +0000 (+0200) Subject: Canvas: move Window class to simgear. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bd299746839180c9c7f1671c70730b36a39ef6bf;p=flightgear.git Canvas: move Window class to simgear. --- diff --git a/src/Canvas/CMakeLists.txt b/src/Canvas/CMakeLists.txt index d3dae9d52..cc4ec18fc 100644 --- a/src/Canvas/CMakeLists.txt +++ b/src/Canvas/CMakeLists.txt @@ -4,14 +4,12 @@ set(SOURCES canvas_mgr.cxx FGCanvasSystemAdapter.cxx gui_mgr.cxx - window.cxx ) set(HEADERS canvas_mgr.hxx FGCanvasSystemAdapter.hxx gui_mgr.hxx - window.hxx ) flightgear_component(Canvas "${SOURCES}" "${HEADERS}") \ No newline at end of file diff --git a/src/Canvas/FGCanvasSystemAdapter.cxx b/src/Canvas/FGCanvasSystemAdapter.cxx index 69ea6c5a4..95b6b65a6 100644 --- a/src/Canvas/FGCanvasSystemAdapter.cxx +++ b/src/Canvas/FGCanvasSystemAdapter.cxx @@ -99,6 +99,13 @@ namespace canvas return 0; } + //---------------------------------------------------------------------------- + SGSubsystem* + FGCanvasSystemAdapter::getSubsystem(const std::string& name) const + { + return globals->get_subsystem(name.c_str()); + } + //---------------------------------------------------------------------------- simgear::HTTP::Client* FGCanvasSystemAdapter::getHTTPClient() const { diff --git a/src/Canvas/FGCanvasSystemAdapter.hxx b/src/Canvas/FGCanvasSystemAdapter.hxx index e568302d7..c43f79359 100644 --- a/src/Canvas/FGCanvasSystemAdapter.hxx +++ b/src/Canvas/FGCanvasSystemAdapter.hxx @@ -31,6 +31,7 @@ namespace canvas virtual void addCamera(osg::Camera* camera) const; virtual void removeCamera(osg::Camera* camera) const; virtual osg::Image* getImage(const std::string& path) const; + virtual SGSubsystem* getSubsystem(const std::string& name) const; virtual simgear::HTTP::Client* getHTTPClient() const; }; } diff --git a/src/Canvas/canvas_fwd.hpp b/src/Canvas/canvas_fwd.hpp deleted file mode 100644 index b9e5ddcac..000000000 --- a/src/Canvas/canvas_fwd.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// Canvas forward declarations -// -// Copyright (C) 2012 Thomas Geymayer -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -#ifndef CANVAS_FWD_HPP_ -#define CANVAS_FWD_HPP_ - -#include - -namespace canvas -{ - class Window; - typedef SGSharedPtr WindowPtr; - typedef SGWeakPtr WindowWeakPtr; -} - -#endif /* CANVAS_FWD_HPP_ */ diff --git a/src/Canvas/gui_mgr.cxx b/src/Canvas/gui_mgr.cxx index 711297e94..d63359487 100644 --- a/src/Canvas/gui_mgr.cxx +++ b/src/Canvas/gui_mgr.cxx @@ -17,7 +17,6 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "gui_mgr.hxx" -#include #include
#include
@@ -27,6 +26,7 @@ #include #include +#include #include #include @@ -40,6 +40,8 @@ class DesktopGroup; typedef SGSharedPtr DesktopPtr; typedef SGWeakPtr DesktopWeakPtr; +namespace sc = simgear::canvas; + /** * Event handler */ @@ -62,12 +64,12 @@ class GUIEventHandler: * Track a canvas placement on a window */ class WindowPlacement: - public simgear::canvas::Placement + public sc::Placement { public: WindowPlacement( SGPropertyNode* node, - canvas::WindowPtr window, - simgear::canvas::CanvasPtr canvas ): + sc::WindowPtr window, + sc::CanvasPtr canvas ): Placement(node), _window(window), _canvas(canvas) @@ -78,23 +80,23 @@ class WindowPlacement: */ virtual ~WindowPlacement() { - canvas::WindowPtr window = _window.lock(); - simgear::canvas::CanvasPtr canvas = _canvas.lock(); + sc::WindowPtr window = _window.lock(); + sc::CanvasPtr canvas = _canvas.lock(); if( window && canvas && canvas == window->getCanvasContent().lock() ) - window->setCanvasContent( simgear::canvas::CanvasPtr() ); + window->setCanvasContent( sc::CanvasPtr() ); } private: - canvas::WindowWeakPtr _window; - simgear::canvas::CanvasWeakPtr _canvas; + sc::WindowWeakPtr _window; + sc::CanvasWeakPtr _canvas; }; /** * Desktop root group */ class DesktopGroup: - public simgear::canvas::Group + public sc::Group { public: DesktopGroup(); @@ -110,9 +112,9 @@ class DesktopGroup: simgear::PropertyObject _width, _height; - canvas::WindowWeakPtr _last_push, - _last_mouse_over, - _resize_window; + sc::WindowWeakPtr _last_push, + _last_mouse_over, + _resize_window; uint8_t _resize; int _last_cursor; @@ -128,11 +130,11 @@ class DesktopGroup: /** * */ - simgear::canvas::ElementFactory + sc::ElementFactory getChildFactory(const std::string& type) const { if( type == "window" ) - return &Element::create; + return &Element::create; return Group::getChildFactory(type); } @@ -160,14 +162,14 @@ bool GUIEventHandler::handle( const osgGA::GUIEventAdapter& ea, //------------------------------------------------------------------------------ DesktopGroup::DesktopGroup(): - Group(simgear::canvas::CanvasPtr(), fgGetNode("/sim/gui/canvas", true)), + Group(sc::CanvasPtr(), fgGetNode("/sim/gui/canvas", true)), _cb_mouse_mode( this, &DesktopGroup::handleMouseMode, fgGetNode("/devices/status/mice/mouse[0]/mode") ), _handle_events(true), _width(_node, "size[0]"), _height(_node, "size[1]"), - _resize(canvas::Window::NONE), + _resize(sc::Window::NONE), _last_cursor(MOUSE_CURSOR_NONE), _last_x(-1), _last_y(-1), @@ -267,7 +269,7 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) switch( ea.getEventType() ) { case osgGA::GUIEventAdapter::RELEASE: - _resize_window.lock()->handleResize(canvas::Window::NONE); + _resize_window.lock()->handleResize(sc::Window::NONE); _resize_window.reset(); break; case osgGA::GUIEventAdapter::DRAG: @@ -279,7 +281,7 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) } } - canvas::WindowPtr window_at_cursor; + sc::WindowPtr window_at_cursor; for( int i = _transform->getNumChildren() - 1; i >= 0; --i ) { osg::Group *element = _transform->getChild(i)->asGroup(); @@ -287,8 +289,8 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) assert(element); assert(element->getUserData()); - canvas::WindowPtr window = - dynamic_cast + sc::WindowPtr window = + dynamic_cast ( static_cast( element->getUserData() @@ -327,14 +329,14 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) _resize = 0; if( event->getScreenX() <= reg.l() + resize_corner ) - _resize |= canvas::Window::LEFT; + _resize |= sc::Window::LEFT; else if( event->getScreenX() >= reg.r() - resize_corner ) - _resize |= canvas::Window::RIGHT; + _resize |= sc::Window::RIGHT; if( event->getScreenY() <= reg.t() + resize_corner ) - _resize |= canvas::Window::TOP; + _resize |= sc::Window::TOP; else if( event->getScreenY() >= reg.b() - resize_corner ) - _resize |= canvas::Window::BOTTOM; + _resize |= sc::Window::BOTTOM; static const int cursor_mapping[] = { @@ -354,7 +356,7 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) _drag_start = event->screen_pos; window_at_cursor->raise(); - window_at_cursor->handleResize(_resize | canvas::Window::INIT); + window_at_cursor->handleResize(_resize | sc::Window::INIT); } return true; @@ -368,7 +370,7 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) return true; } - canvas::WindowPtr target_window = window_at_cursor; + sc::WindowPtr target_window = window_at_cursor; switch( ea.getEventType() ) { case osgGA::GUIEventAdapter::PUSH: @@ -399,7 +401,7 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) break; case osgGA::GUIEventAdapter::MOVE: { - canvas::WindowPtr last_mouse_over = _last_mouse_over.lock(); + sc::WindowPtr last_mouse_over = _last_mouse_over.lock(); if( last_mouse_over != window_at_cursor && last_mouse_over ) { sc::MouseEventPtr move_event( new sc::MouseEvent(*event) ); @@ -417,7 +419,7 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea) { event->type = sc::Event::MOUSE_UP; - canvas::WindowPtr last_push = _last_push.lock(); + sc::WindowPtr last_push = _last_push.lock(); _last_push.reset(); if( last_push && last_push != target_window ) @@ -484,9 +486,9 @@ GUIMgr::GUIMgr() } //------------------------------------------------------------------------------ -canvas::WindowPtr GUIMgr::createWindow(const std::string& name) +sc::WindowPtr GUIMgr::createWindow(const std::string& name) { - canvas::WindowPtr window = _desktop->createChild(name); + sc::WindowPtr window = _desktop->createChild(name); if( name.empty() ) window->set ( @@ -516,7 +518,7 @@ void GUIMgr::init() // GUI is on top of everything so lets install as first event handler .push_front( _event_handler ); - simgear::canvas::Canvas::addPlacementFactory + sc::Canvas::addPlacementFactory ( "window", boost::bind(&GUIMgr::addWindowPlacement, this, _1, _2) @@ -530,7 +532,7 @@ void GUIMgr::shutdown() { _desktop->destroy(); _desktop.reset(); - simgear::canvas::Canvas::removePlacementFactory("window"); + sc::Canvas::removePlacementFactory("window"); globals->get_renderer() ->getViewer() @@ -545,25 +547,25 @@ void GUIMgr::update(double dt) } //------------------------------------------------------------------------------ -simgear::canvas::GroupPtr GUIMgr::getDesktop() +sc::GroupPtr GUIMgr::getDesktop() { return _desktop; } //------------------------------------------------------------------------------ -simgear::canvas::Placements +sc::Placements GUIMgr::addWindowPlacement( SGPropertyNode* placement, - simgear::canvas::CanvasPtr canvas ) + sc::CanvasPtr canvas ) { const std::string& id = placement->getStringValue("id"); - simgear::canvas::Placements placements; - canvas::WindowPtr window = _desktop->getChild(id); + sc::Placements placements; + sc::WindowPtr window = _desktop->getChild(id); if( window ) { window->setCanvasContent(canvas); placements.push_back( - simgear::canvas::PlacementPtr( + sc::PlacementPtr( new WindowPlacement(placement, window, canvas) )); } diff --git a/src/Canvas/gui_mgr.hxx b/src/Canvas/gui_mgr.hxx index 770c8077c..c6764692c 100644 --- a/src/Canvas/gui_mgr.hxx +++ b/src/Canvas/gui_mgr.hxx @@ -19,8 +19,6 @@ #ifndef CANVAS_GUI_MGR_HXX_ #define CANVAS_GUI_MGR_HXX_ -#include "canvas_fwd.hpp" - #include #include #include @@ -42,7 +40,7 @@ class GUIMgr: public: GUIMgr(); - canvas::WindowPtr createWindow(const std::string& name = ""); + simgear::canvas::WindowPtr createWindow(const std::string& name = ""); virtual void init(); virtual void shutdown(); diff --git a/src/Canvas/window.cxx b/src/Canvas/window.cxx deleted file mode 100644 index 83c8309cb..000000000 --- a/src/Canvas/window.cxx +++ /dev/null @@ -1,311 +0,0 @@ -// Window for placing a Canvas onto it (for dialogs, menus, etc.) -// -// Copyright (C) 2012 Thomas Geymayer -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -#include "canvas_mgr.hxx" -#include "window.hxx" -#include
-#include -#include - -#include - -#include -#include - -namespace canvas -{ - namespace sc = simgear::canvas; - - //---------------------------------------------------------------------------- - const std::string Window::TYPE_NAME = "window"; - - //---------------------------------------------------------------------------- - Window::Window( const simgear::canvas::CanvasWeakPtr& canvas, - const SGPropertyNode_ptr& node, - const Style& parent_style, - Element* parent ): - Image(canvas, node, parent_style, parent), - _attributes_dirty(0), - _resizable(false), - _capture_events(true), - _resize_top(node, "resize-top"), - _resize_right(node, "resize-right"), - _resize_bottom(node, "resize-bottom"), - _resize_left(node, "resize-left"), - _resize_status(node, "resize-status") - { - node->setFloatValue("source/right", 1); - node->setFloatValue("source/bottom", 1); - node->setBoolValue("source/normalized", true); - } - - //---------------------------------------------------------------------------- - Window::~Window() - { - if( _canvas_decoration ) - _canvas_decoration->destroy(); - } - - //---------------------------------------------------------------------------- - void Window::update(double delta_time_sec) - { - if( _attributes_dirty & DECORATION ) - { - updateDecoration(); - _attributes_dirty &= ~DECORATION; - } - - Image::update(delta_time_sec); - } - - //---------------------------------------------------------------------------- - void Window::valueChanged(SGPropertyNode * node) - { - bool handled = false; - if( node->getParent() == _node ) - { - handled = true; - const std::string& name = node->getNameString(); - if( name == "resize" ) - _resizable = node->getBoolValue(); - else if( name == "update" ) - update(0); - else if( name == "capture-events" ) - _capture_events = node->getBoolValue(); - else if( name == "decoration-border" ) - parseDecorationBorder(node->getStringValue()); - else if( boost::starts_with(name, "shadow-") - || name == "content-size" ) - _attributes_dirty |= DECORATION; - else - handled = false; - } - - if( !handled ) - Image::valueChanged(node); - } - - //---------------------------------------------------------------------------- - osg::Group* Window::getGroup() - { - return getMatrixTransform(); - } - - //---------------------------------------------------------------------------- - const SGVec2 Window::getPosition() const - { - const osg::Matrix& m = getMatrixTransform()->getMatrix(); - return SGVec2( m(3, 0), m(3, 1) ); - } - - //---------------------------------------------------------------------------- - const SGRect Window::getScreenRegion() const - { - return getPosition() + getRegion(); - } - - //---------------------------------------------------------------------------- - void Window::setCanvasContent(sc::CanvasPtr canvas) - { - _canvas_content = canvas; - - if( _image_content ) - // Placement within decoration canvas - _image_content->setSrcCanvas(canvas); - else - setSrcCanvas(canvas); - } - - //---------------------------------------------------------------------------- - sc::CanvasWeakPtr Window::getCanvasContent() const - { - return _canvas_content; - } - - //---------------------------------------------------------------------------- - sc::CanvasPtr Window::getCanvasDecoration() - { - return _canvas_decoration; - } - - //---------------------------------------------------------------------------- - bool Window::isResizable() const - { - return _resizable; - } - - //---------------------------------------------------------------------------- - bool Window::isCapturingEvents() const - { - return _capture_events; - } - - //---------------------------------------------------------------------------- - void Window::raise() - { - // on writing the z-index the window always is moved to the top of all other - // windows with the same z-index. - set("z-index", get("z-index", 0)); - } - - //---------------------------------------------------------------------------- - void Window::handleResize( uint8_t mode, - const osg::Vec2f& offset ) - { - if( mode == NONE ) - { - _resize_status = 0; - return; - } - else if( mode & INIT ) - { - _resize_top = getRegion().t(); - _resize_right = getRegion().r(); - _resize_bottom = getRegion().b(); - _resize_left = getRegion().l(); - _resize_status = 1; - } - - if( mode & BOTTOM ) - _resize_bottom = getRegion().b() + offset.y(); - else if( mode & TOP ) - _resize_top = getRegion().t() + offset.y(); - - if( mode & canvas::Window::RIGHT ) - _resize_right = getRegion().r() + offset.x(); - else if( mode & canvas::Window::LEFT ) - _resize_left = getRegion().l() + offset.x(); - } - - //---------------------------------------------------------------------------- - void Window::parseDecorationBorder(const std::string& str) - { - _decoration_border = simgear::CSSBorder::parse(str); - _attributes_dirty |= DECORATION; - } - - //---------------------------------------------------------------------------- - void Window::updateDecoration() - { - int shadow_radius = get("shadow-radius") + 0.5; - if( shadow_radius < 2 ) - shadow_radius = 0; - - sc::CanvasPtr content = _canvas_content.lock(); - SGRect content_view - ( - 0, - 0, - get("content-size[0]", content ? content->getViewWidth() : 400), - get("content-size[1]", content ? content->getViewHeight() : 300) - ); - - if( _decoration_border.isNone() && !shadow_radius ) - { - setSrcCanvas(content); - set("size[0]", content_view.width()); - set("size[1]", content_view.height()); - - _image_content.reset(); - _image_shadow.reset(); - if( _canvas_decoration ) - _canvas_decoration->destroy(); - _canvas_decoration.reset(); - return; - } - - if( !_canvas_decoration ) - { - CanvasMgr* mgr = - dynamic_cast(globals->get_subsystem("Canvas")); - - if( !mgr ) - { - SG_LOG(SG_GENERAL, SG_WARN, "canvas::Window: no canvas manager!"); - return; - } - - _canvas_decoration = mgr->createCanvas("window-decoration"); - _canvas_decoration->getProps() - ->setStringValue("background", "rgba(0,0,0,0)"); - setSrcCanvas(_canvas_decoration); - - _image_content = _canvas_decoration->getRootGroup() - ->createChild("content"); - _image_content->setSrcCanvas(content); - - // Draw content on top of decoration - _image_content->set("z-index", 1); - } - - sc::GroupPtr group_decoration = - _canvas_decoration->getOrCreateGroup("decoration"); - group_decoration->set("tf/t[0]", shadow_radius); - group_decoration->set("tf/t[1]", shadow_radius); - // TODO do we need clipping or shall we trust the decorator not to draw over - // the shadow? - - simgear::CSSBorder::Offsets const border = - _decoration_border.getAbsOffsets(content_view); - - int shad2 = 2 * shadow_radius, - outer_width = border.l + content_view.width() + border.r + shad2, - outer_height = border.t + content_view.height() + border.b + shad2; - - _canvas_decoration->setSizeX( outer_width ); - _canvas_decoration->setSizeY( outer_height ); - _canvas_decoration->setViewWidth( outer_width ); - _canvas_decoration->setViewHeight( outer_height ); - - set("size[0]", outer_width - shad2); - set("size[1]", outer_height - shad2); - set("outset", shadow_radius); - - assert(_image_content); - _image_content->set("x", shadow_radius + border.l); - _image_content->set("y", shadow_radius + border.t); - _image_content->set("size[0]", content_view.width()); - _image_content->set("size[1]", content_view.height()); - - if( !shadow_radius ) - { - if( _image_shadow ) - { - _image_shadow->destroy(); - _image_shadow.reset(); - } - return; - } - - int shadow_inset = std::max(get("shadow-inset") + 0.5, 0), - slice_width = shadow_radius + shadow_inset; - - _image_shadow = _canvas_decoration->getRootGroup() - ->getOrCreateChild("shadow"); - _image_shadow->set("src", "gui/images/shadow.png"); - _image_shadow->set("slice", 7); - _image_shadow->set("fill", "#000000"); - _image_shadow->set("slice-width", slice_width); - _image_shadow->set("size[0]", outer_width); - _image_shadow->set("size[1]", outer_height); - - // Draw shadow below decoration - _image_shadow->set("z-index", -1); - } - -} // namespace canvas diff --git a/src/Canvas/window.hxx b/src/Canvas/window.hxx deleted file mode 100644 index da99b6070..000000000 --- a/src/Canvas/window.hxx +++ /dev/null @@ -1,123 +0,0 @@ -// Window for placing a Canvas onto it (for dialogs, menus, etc.) -// -// Copyright (C) 2012 Thomas Geymayer -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -#ifndef CANVAS_WINDOW_HXX_ -#define CANVAS_WINDOW_HXX_ - -#include -#include -#include -#include -#include - -#include -#include - -namespace canvas -{ - class Window: - public simgear::canvas::Image - { - public: - static const std::string TYPE_NAME; - - enum Resize - { - NONE = 0, - LEFT = 1, - RIGHT = LEFT << 1, - TOP = RIGHT << 1, - BOTTOM = TOP << 1, - INIT = BOTTOM << 1 - }; - - typedef simgear::canvas::Style Style; - - /** - * @param node Property node containing settings for this window: - * capture-events Disable/Enable event capturing - * content-size[0-1] Size of content area (excluding - * decoration border) - * decoration-border Size of decoration border - * resize Enable resize cursor and properties - * shadow-inset Inset of shadow image - * shadow-radius Radius/outset of shadow image - */ - Window( const simgear::canvas::CanvasWeakPtr& canvas, - const SGPropertyNode_ptr& node, - const Style& parent_style = Style(), - Element* parent = 0 ); - virtual ~Window(); - - virtual void update(double delta_time_sec); - virtual void valueChanged(SGPropertyNode* node); - - osg::Group* getGroup(); - const SGVec2 getPosition() const; - const SGRect getScreenRegion() const; - - void setCanvasContent(simgear::canvas::CanvasPtr canvas); - simgear::canvas::CanvasWeakPtr getCanvasContent() const; - - simgear::canvas::CanvasPtr getCanvasDecoration(); - - bool isResizable() const; - bool isCapturingEvents() const; - - /** - * Moves window on top of all other windows with the same z-index. - * - * @note If no z-index is set it defaults to 0. - */ - void raise(); - - void handleResize( uint8_t mode, - const osg::Vec2f& offset = osg::Vec2f() ); - - protected: - - enum Attributes - { - DECORATION = 1 - }; - - uint32_t _attributes_dirty; - - simgear::canvas::CanvasPtr _canvas_decoration; - simgear::canvas::CanvasWeakPtr _canvas_content; - - simgear::canvas::ImagePtr _image_content, - _image_shadow; - - bool _resizable, - _capture_events; - - simgear::PropertyObject _resize_top, - _resize_right, - _resize_bottom, - _resize_left, - _resize_status; - - simgear::CSSBorder _decoration_border; - - void parseDecorationBorder(const std::string& str); - void updateDecoration(); - }; -} // namespace canvas - -#endif /* CANVAS_WINDOW_HXX_ */ diff --git a/src/Cockpit/od_gauge.hxx b/src/Cockpit/od_gauge.hxx index e819a8e3b..fb3f0265f 100644 --- a/src/Cockpit/od_gauge.hxx +++ b/src/Cockpit/od_gauge.hxx @@ -21,8 +21,6 @@ #ifndef _OD_GAUGE_HXX #define _OD_GAUGE_HXX -#include - #include #include diff --git a/src/Scripting/NasalCanvas.cxx b/src/Scripting/NasalCanvas.cxx index 32aa4f84d..b3c3b1758 100644 --- a/src/Scripting/NasalCanvas.cxx +++ b/src/Scripting/NasalCanvas.cxx @@ -25,7 +25,6 @@ #include "NasalCanvas.hxx" #include #include -#include #include
#include @@ -34,6 +33,7 @@ #include #include +#include #include #include #include @@ -59,7 +59,7 @@ typedef nasal::Ghost NasalCanvas; typedef nasal::Ghost NasalElement; typedef nasal::Ghost NasalGroup; typedef nasal::Ghost NasalText; -typedef nasal::Ghost NasalWindow; +typedef nasal::Ghost NasalWindow; naRef to_nasal_helper(naContext c, const osg::BoundingBox& bb) { @@ -256,8 +256,8 @@ naRef initNasalCanvas(naRef globals, naContext c) NasalWindow::init("canvas.Window") .bases() - .member("_node_ghost", &elementGetNode) - .method("_getCanvasDecoration", &canvas::Window::getCanvasDecoration); + .member("_node_ghost", &elementGetNode) + .method("_getCanvasDecoration", &sc::Window::getCanvasDecoration); nasal::Hash globals_module(globals, c), canvas_module = globals_module.createHash("canvas");