/usr/include/simgear/canvas/CanvasWindow.hxx is in libsimgear-dev 3.4.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | // Window for placing a Canvas onto it (for dialogs, menus, etc.)
//
// Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library 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
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#ifndef CANVAS_WINDOW_HXX_
#define CANVAS_WINDOW_HXX_
#include <simgear/canvas/elements/CanvasImage.hxx>
#include <simgear/canvas/layout/Layout.hxx>
#include <simgear/canvas/events/MouseEvent.hxx>
#include <simgear/props/PropertyBasedElement.hxx>
#include <simgear/props/propertyObject.hxx>
#include <simgear/misc/CSSBorder.hxx>
#include <osg/Geode>
#include <osg/Geometry>
namespace simgear
{
namespace canvas
{
class Window:
public Image,
public LayoutItem
{
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
};
/**
* @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 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<float> getPosition() const;
const SGRect<float> getScreenRegion() const;
void setCanvasContent(CanvasPtr canvas);
simgear::canvas::CanvasWeakPtr getCanvasContent() const;
void setLayout(const LayoutRef& layout);
CanvasPtr getCanvasDecoration() const;
bool isResizable() const;
bool isCapturingEvents() const;
virtual void setVisible(bool visible);
virtual bool isVisible() 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;
CanvasPtr _canvas_decoration;
CanvasWeakPtr _canvas_content;
LayoutRef _layout;
ImagePtr _image_content,
_image_shadow;
bool _resizable,
_capture_events;
PropertyObject<int> _resize_top,
_resize_right,
_resize_bottom,
_resize_left,
_resize_status;
CSSBorder _decoration_border;
void parseDecorationBorder(const std::string& str);
void updateDecoration();
};
} // namespace canvas
} // namespace simgear
#endif /* CANVAS_WINDOW_HXX_ */
|