- public:
-
- naRef getEventType(naContext c, const GUIEventPtr& event)
- {
-#define RET_EVENT_STR(type, str)\
- case osgGA::GUIEventAdapter::type:\
- return nasal::to_nasal(c, str);
-
- switch( event->getEventType() )
- {
- RET_EVENT_STR(PUSH, "push");
- RET_EVENT_STR(RELEASE, "release");
- RET_EVENT_STR(DOUBLECLICK, "double-click");
- RET_EVENT_STR(DRAG, "drag");
- RET_EVENT_STR(MOVE, "move");
- RET_EVENT_STR(SCROLL, "scroll");
- RET_EVENT_STR(KEYUP, "key-up");
- RET_EVENT_STR(KEYDOWN, "key-down");
-
-#undef RET_EVENT_STR
-
- default:
- return naNil();
- }
- }
-};
-#endif
-
-SGPropertyNode& requireArg(naContext c, int argc, naRef* args, int index = 0)
-{
- if( argc <= index )
- naRuntimeError(c, "missing argument #%d", index);
-
- SGPropertyNode* props = ghostToPropNode(args[index]);