16 #ifndef OSGWIDGET_WINDOW_MANAGER
17 #define OSGWIDGET_WINDOW_MANAGER
20 #include <osg/Uniform>
21 #include <osg/Drawable>
22 #include <osgGA/GUIEventAdapter>
23 #include <osgUtil/LineSegmentIntersector>
24 #include <osgViewer/View>
25 #include <osgWidget/ScriptEngine>
26 #include <osgWidget/StyleManager>
27 #include <osgWidget/Window>
42 WM_USE_LUA = 0x00000001,
43 WM_USE_PYTHON = 0x00000002,
44 WM_USE_RENDERBINS = 0x00000004,
45 WM_PICK_DEBUG = 0x00000008
51 PD_RIGHT = 0x00000002,
57 PFM_FOCUS = 0x00000000,
58 PFM_UNFOCUS = 0x00000001,
59 PFM_SLOPPY = 0x00000002
88 void setPointerXY (
float,
float);
90 void resizeAllWindows (
bool =
true);
92 XYCoord windowXY (
double,
double)
const;
93 XYCoord localXY (
double,
double)
const;
97 bool pointerMove (
float,
float);
98 bool pointerDrag (
float,
float);
99 bool mouseScroll (
float,
float);
116 return (_flags & WM_USE_LUA) != 0;
120 return (_flags & WM_USE_PYTHON) != 0;
124 return (_flags & WM_USE_RENDERBINS) != 0;
146 return _python.get();
150 return _python.get();
154 return _styleManager.get();
158 return _styleManager.get();
162 return _lastVertical;
166 return _lastHorizontal;
174 return _lastVertical | _lastHorizontal;
178 return _lastVertical == PD_UP;
182 return _lastVertical == PD_DOWN;
186 return _lastHorizontal == PD_LEFT;
190 return _lastHorizontal == PD_RIGHT;
194 return _lastVertical != PD_NONE;
198 return _lastHorizontal != PD_NONE;
222 return setFocused(getByName(name));
255 return _handleMousePushed(x, y, _leftDown);
259 return _handleMousePushed(x, y, _middleDown);
263 return _handleMousePushed(x, y, _rightDown);
267 return _handleMouseReleased(x, y, _leftDown);
271 return _handleMouseReleased(x, y, _middleDown);
275 return _handleMouseReleased(x, y, _rightDown);
280 bool keyDown (
int,
int);
281 bool keyUp (
int,
int);
288 struct WindowZCompare:
public std::binary_function<ptr_type, ptr_type, bool> {
289 bool operator()(
const ptr_type& x,
const ptr_type& y) {
290 return x.get()->getZ() > y.get()->getZ();
295 struct WindowBinNumberCompare:
public std::binary_function<ptr_type, ptr_type, bool> {
296 bool operator()(
const ptr_type& x,
const ptr_type& y) {
298 x.get()->getOrCreateStateSet()->getBinNumber() >
299 y.get()->getOrCreateStateSet()->getBinNumber()
309 unsigned int _nodeMask;
313 EventInterface* _lastEvent;
314 EventInterface* _lastPush;
315 PointerDirection _lastVertical;
316 PointerDirection _lastHorizontal;
317 PointerFocusMode _focusMode;
332 void childInserted (
unsigned int);
333 void childRemoved (
unsigned int,
unsigned int);
335 bool _handleMousePushed (
float,
float,
bool&);
336 bool _handleMouseReleased (
float,
float,
bool&);
337 bool _handleMouseScrolled (
float,
float,
bool =
false);
338 void _getPointerXYDiff (
float&,
float&);
347 if(!container.size())
return 0;
350 for(
typename T::iterator i = container.begin(); i != container.end(); i++) {
351 Widget* widget = i->get();
373 for(WindowList::iterator i = windowList.begin(); i != windowList.end(); i++) {
374 Window* window = i->get();
#define META_Object(library, name)
std::multiset< Intersection > Intersections