Tweaks to facilitate osgWrapper build
This commit is contained in:
parent
7ec5632bcc
commit
5c5ab84420
@ -30,7 +30,6 @@ class OSGWIDGET_EXPORT Box: public Window
|
||||
};
|
||||
|
||||
META_Object (osgWidget, Box);
|
||||
META_UIObject (Box);
|
||||
|
||||
Box (const std::string& = "", BOX_TYPE = HORIZONTAL, bool = false);
|
||||
Box (const Box&, const osg::CopyOp&);
|
||||
|
@ -25,7 +25,6 @@ class OSGWIDGET_EXPORT Canvas: public Window
|
||||
{
|
||||
public:
|
||||
META_Object (osgWidget, Canvas);
|
||||
META_UIObject (Canvas);
|
||||
|
||||
Canvas (const std::string& = "");
|
||||
Canvas (const Canvas&, const osg::CopyOp&);
|
||||
|
@ -206,6 +206,10 @@ class FunctionCallback: public CallbackInterface
|
||||
class OSGWIDGET_EXPORT Callback
|
||||
{
|
||||
public:
|
||||
|
||||
Callback():_type(EVENT_NONE),_data(0) {}
|
||||
Callback(const Callback& rhs):_type(rhs._type),_data(rhs._data),_callback(rhs._callback) {}
|
||||
|
||||
// Creates a Callback that is bound to a member function.
|
||||
template<typename T>
|
||||
Callback(bool (T::*function)(Event&), T* obj, EventType type, void* data=0):
|
||||
|
@ -48,7 +48,6 @@ class OSGWIDGET_EXPORT Frame: public Table
|
||||
{
|
||||
public:
|
||||
META_Object (osgWidget, Corner);
|
||||
META_UIObject (Corner);
|
||||
|
||||
Corner (CORNER = CORNER_LOWER_LEFT, point_type = 0.0f, point_type = 0.0f);
|
||||
Corner (const Corner&, const osg::CopyOp&);
|
||||
@ -76,7 +75,6 @@ class OSGWIDGET_EXPORT Frame: public Table
|
||||
{
|
||||
public:
|
||||
META_Object (osgWidget, Border);
|
||||
META_UIObject (Border);
|
||||
|
||||
Border (BORDER = BORDER_LEFT, point_type = 0.0f, point_type = 0.0f);
|
||||
Border (const Border&, const osg::CopyOp&);
|
||||
@ -103,7 +101,6 @@ class OSGWIDGET_EXPORT Frame: public Table
|
||||
};
|
||||
|
||||
META_Object (osgWidget, Frame);
|
||||
META_UIObject (Frame);
|
||||
|
||||
Frame (const std::string& = "");
|
||||
Frame (const Frame&, const osg::CopyOp&);
|
||||
|
@ -28,7 +28,6 @@ class OSGWIDGET_EXPORT Label: public Widget
|
||||
public:
|
||||
|
||||
META_Object (osgWidget, Label);
|
||||
META_UIObject (Label);
|
||||
|
||||
Label (const std::string& = "", const std::string& = "");
|
||||
Label (const Label&, const osg::CopyOp&);
|
||||
|
@ -28,7 +28,6 @@ class OSGWIDGET_EXPORT Table: public Window
|
||||
typedef std::vector<point_type> CellSizes;
|
||||
|
||||
META_Object (osgWidget, Table);
|
||||
META_UIObject (Table);
|
||||
|
||||
Table (const std::string& = "", unsigned int = 0, unsigned int = 0);
|
||||
Table (const Table&, const osg::CopyOp&);
|
||||
|
@ -17,17 +17,10 @@
|
||||
#ifndef OSGWIDGET_UI_OBJECT_PARENT
|
||||
#define OSGWIDGET_UI_OBEJCT_PARENT
|
||||
|
||||
namespace osgWidget {
|
||||
#include <osg/Object>
|
||||
#include <osg/observer_ptr>
|
||||
|
||||
#define META_UIObject(name) \
|
||||
name * cloneAs(\
|
||||
const std::string& newName, \
|
||||
const osg::CopyOp& co = osg::CopyOp::DEEP_COPY_ALL \
|
||||
) const { \
|
||||
name * obj = dynamic_cast<name *>(this->clone(co)); \
|
||||
obj->setName(newName); \
|
||||
return obj; \
|
||||
}
|
||||
namespace osgWidget {
|
||||
|
||||
template <typename T>
|
||||
class UIObjectParent
|
||||
|
@ -40,6 +40,10 @@ class OSGWIDGET_EXPORT MouseHandler: public osgGA::GUIEventHandler
|
||||
osg::NodeVisitor*
|
||||
);
|
||||
|
||||
|
||||
typedef bool (MouseHandler::*MouseAction)(float, float, int);
|
||||
typedef bool (WindowManager::*MouseEvent)(float, float);
|
||||
|
||||
protected:
|
||||
|
||||
osg::ref_ptr<WindowManager> _wm;
|
||||
@ -51,9 +55,6 @@ class OSGWIDGET_EXPORT MouseHandler: public osgGA::GUIEventHandler
|
||||
bool _handleMouseMove (float, float, int);
|
||||
bool _handleMouseScroll (float, float, int);
|
||||
|
||||
typedef bool (MouseHandler::*MouseAction)(float, float, int);
|
||||
typedef bool (WindowManager::*MouseEvent)(float, float);
|
||||
|
||||
MouseAction _isMouseEvent (osgGA::GUIEventAdapter::EventType) const;
|
||||
bool _doMouseEvent (float, float, MouseEvent);
|
||||
|
||||
|
@ -77,8 +77,6 @@ public:
|
||||
Widget (const Widget&, const osg::CopyOp&);
|
||||
|
||||
META_Object (osgWidget, Widget);
|
||||
META_UIObject (Widget);
|
||||
|
||||
|
||||
virtual ~Widget() {
|
||||
}
|
||||
|
@ -63,7 +63,6 @@ class OSGWIDGET_EXPORT Window:
|
||||
|
||||
public:
|
||||
META_Object (osgWidget::Window, EmbeddedWindow);
|
||||
META_UIObject (EmbeddedWindow);
|
||||
|
||||
EmbeddedWindow (const std::string& = "", point_type = 0.0f, point_type = 0.0f);
|
||||
EmbeddedWindow (const EmbeddedWindow&, const osg::CopyOp&);
|
||||
@ -123,8 +122,6 @@ class OSGWIDGET_EXPORT Window:
|
||||
HA_RIGHT
|
||||
};
|
||||
|
||||
META_UIObject(Window);
|
||||
|
||||
Window (const std::string& = "");
|
||||
Window (const Window&, const osg::CopyOp&);
|
||||
|
||||
@ -400,8 +397,9 @@ class OSGWIDGET_EXPORT Window:
|
||||
addCallback(Callback(&callbackWindowTabFocus, EVENT_KEY_DOWN));
|
||||
}
|
||||
|
||||
protected:
|
||||
typedef point_type (Widget::*Getter)() const;
|
||||
|
||||
protected:
|
||||
|
||||
typedef std::less<point_type> Less;
|
||||
typedef std::greater<point_type> Greater;
|
||||
|
Loading…
Reference in New Issue
Block a user