Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -19,6 +19,7 @@ · 18 unmodified lines | |||
| 19 | #include <shared/QtHelpers.h> | 19 | #include <shared/QtHelpers.h> |
| 20 | #include <SettingHandle.h> | 20 | #include <SettingHandle.h> |
| 21 | 21 | ||
| 22 | #include <plugins/PluginManager.h> | ||
| 22 | #include <display-plugins/CompositorHelper.h> | 23 | #include <display-plugins/CompositorHelper.h> |
| 23 | #include <AddressManager.h> | 24 | #include <AddressManager.h> |
| 24 | #include "AndroidHelper.h" | 25 | #include "AndroidHelper.h" |
| @@ -609,3 +610,35 @@ void WindowScriptingInterface::onMessageBoxSelected(int button) { · 584 unmodified lines | |||
| 609 | float WindowScriptingInterface::domainLoadingProgress() { | 610 | float WindowScriptingInterface::domainLoadingProgress() { |
| 610 | return qApp->getOctreePacketProcessor().domainLoadingProgress(); | 611 | return qApp->getOctreePacketProcessor().domainLoadingProgress(); |
| 611 | } | 612 | } |
| 613 | |||
| 614 | const DisplayPluginList& getDisplayPlugins() { | ||
| 615 | static const auto& list = PluginManager::getInstance()->getDisplayPlugins(); | ||
| 616 | return list; | ||
| 617 | } | ||
| 618 | |||
| 619 | int WindowScriptingInterface::getDisplayPluginCount() { | ||
| 620 | return getDisplayPlugins().size(); | ||
| 621 | } | ||
| 622 | |||
| 623 | QString WindowScriptingInterface::getDisplayPluginName(int index) { | ||
| 624 | return getDisplayPlugins().at(index)->getName(); | ||
| 625 | } | ||
| 626 | |||
| 627 | bool WindowScriptingInterface::isDisplayPluginHmd(int index) { | ||
| 628 | return getDisplayPlugins().at(index)->isHmd(); | ||
| 629 | } | ||
| 630 | |||
| 631 | int WindowScriptingInterface::getActiveDisplayPlugin() { | ||
| 632 | auto active = qApp->getActiveDisplayPlugin(); | ||
| 633 | auto size = getDisplayPluginCount(); | ||
| 634 | for (int i = 0; i < size; ++i) { | ||
| 635 | if (getDisplayPlugins().at(i) == active) { | ||
| 636 | return i; | ||
| 637 | } | ||
| 638 | } | ||
| 639 | return -1; | ||
| 640 | } | ||
| 641 | |||
| 642 | void WindowScriptingInterface::setActiveDisplayPlugin(int index) { | ||
| 643 | qApp->setActiveDisplayPlugin(getDisplayPlugins().at(index)->getName()); | ||
| 644 | } | ||