Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 69 files). Show all
Unified · Split
| @@ -34,6 +34,26 @@ WindowScriptingInterface::WindowScriptingInterface() : · 33 unmodified lines | |||
| 34 | { | 34 | { |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | QScriptValue WindowScriptingInterface::hasFocus() { | ||
| 38 | return Application::getInstance()->getGLWidget()->hasFocus(); | ||
| 39 | } | ||
| 40 | |||
| 41 | void WindowScriptingInterface::setCursorVisible(bool visible) { | ||
| 42 | Application::getInstance()->setCursorVisible(visible); | ||
| 43 | } | ||
| 44 | |||
| 45 | void WindowScriptingInterface::setCursorPosition(int x, int y) { | ||
| 46 | QCursor::setPos(x, y); | ||
| 47 | } | ||
| 48 | |||
| 49 | QScriptValue WindowScriptingInterface::getCursorPositionX() { | ||
| 50 | return QCursor::pos().x(); | ||
| 51 | } | ||
| 52 | |||
| 53 | QScriptValue WindowScriptingInterface::getCursorPositionY() { | ||
| 54 | return QCursor::pos().y(); | ||
| 55 | } | ||
| 56 | |||
| 37 | QScriptValue WindowScriptingInterface::alert(const QString& message) { | 57 | QScriptValue WindowScriptingInterface::alert(const QString& message) { |
| 38 | QScriptValue retVal; | 58 | QScriptValue retVal; |
| 39 | QMetaObject::invokeMethod(this, "showAlert", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QScriptValue, retVal), Q_ARG(const QString&, message)); | 59 | QMetaObject::invokeMethod(this, "showAlert", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QScriptValue, retVal), Q_ARG(const QString&, message)); |
| @@ -516,3 +536,11 @@ int WindowScriptingInterface::getInnerWidth() { · 476 unmodified lines | |||
| 516 | int WindowScriptingInterface::getInnerHeight() { | 536 | int WindowScriptingInterface::getInnerHeight() { |
| 517 | return Application::getInstance()->getWindow()->geometry().height(); | 537 | return Application::getInstance()->getWindow()->geometry().height(); |
| 518 | } | 538 | } |
| 539 | |||
| 540 | int WindowScriptingInterface::getX() { | ||
| 541 | return Application::getInstance()->getWindow()->x(); | ||
| 542 | } | ||
| 543 | |||
| 544 | int WindowScriptingInterface::getY() { | ||
| 545 | return Application::getInstance()->getWindow()->y(); | ||
| 546 | } | ||