History

Merge branch 'master' into 21776

David Rowe committed 8 years ago

Commit b1bda282 parents 287ea8e b7ac07f239 files · +7281 −1767Browse files

Showing the changes to interface/src/Application.cpp (1 of 239 files). Show all

Unified · Split

interface/src/Application.cpp+28−2
@@ -69,6 +69,7 @@ · 68 unmodified lines
6969 #include <AudioInjectorManager.h>
7070 #include <AvatarBookmarks.h>
7171 #include <CursorManager.h>
72+#include <VirtualPadManager.h>
7273 #include <DebugDraw.h>
7374 #include <DeferredLightingEffect.h>
7475 #include <EntityScriptClient.h>
@@ -137,6 +138,7 @@ · 62 unmodified lines
137138 #include <recording/Recorder.h>
138139 #include <shared/StringHelpers.h>
139140 #include <QmlWebWindowClass.h>
141+#include <QmlFragmentClass.h>
140142 #include <Preferences.h>
141143 #include <display-plugins/CompositorHelper.h>
142144 #include <trackers/EyeTracker.h>
@@ -777,6 +779,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 634 unmodified lines
777779 DependencyManager::set<PointerScriptingInterface>();
778780 DependencyManager::set<PickScriptingInterface>();
779781 DependencyManager::set<Cursor::Manager>();
782+ DependencyManager::set<VirtualPad::Manager>();
780783 DependencyManager::set<DesktopPreviewProvider>();
781784 DependencyManager::set<AccountManager>(std::bind(&Application::getUserAgent, qApp));
782785 DependencyManager::set<StatTracker>();
@@ -1522,12 +1525,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 739 unmodified lines
15221525 return DependencyManager::get<OffscreenUi>()->navigationFocused() ? 1 : 0;
15231526 });
15241527
1525− // Setup the _keyboardMouseDevice, _touchscreenDevice and the user input mapper with the default bindings
1528+ // Setup the _keyboardMouseDevice, _touchscreenDevice, _touchscreenVirtualPadDevice and the user input mapper with the default bindings
15261529 userInputMapper->registerDevice(_keyboardMouseDevice->getInputDevice());
15271530 // if the _touchscreenDevice is not supported it will not be registered
15281531 if (_touchscreenDevice) {
15291532 userInputMapper->registerDevice(_touchscreenDevice->getInputDevice());
15301533 }
1534+ if (_touchscreenVirtualPadDevice) {
1535+ userInputMapper->registerDevice(_touchscreenVirtualPadDevice->getInputDevice());
1536+ }
15311537
15321538 // this will force the model the look at the correct directory (weird order of operations issue)
15331539 scriptEngines->reloadLocalFiles();
@@ -2611,6 +2617,9 @@ void Application::initializeUi() { · 1077 unmodified lines
26112617 if (TouchscreenDevice::NAME == inputPlugin->getName()) {
26122618 _touchscreenDevice = std::dynamic_pointer_cast<TouchscreenDevice>(inputPlugin);
26132619 }
2620+ if (TouchscreenVirtualPadDevice::NAME == inputPlugin->getName()) {
2621+ _touchscreenVirtualPadDevice = std::dynamic_pointer_cast<TouchscreenVirtualPadDevice>(inputPlugin);
2622+ }
26142623 }
26152624
26162625 auto compositorHelper = DependencyManager::get<CompositorHelper>();
@@ -3016,7 +3025,9 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { · 399 unmodified lines
30163025
30173026 // If this is a first run we short-circuit the address passed in
30183027 if (firstRun.get()) {
3028+#if !defined(Q_OS_ANDROID)
30193029 showHelp();
3030+#endif
30203031 if (sandboxIsRunning) {
30213032 qCDebug(interfaceapp) << "Home sandbox appears to be running, going to Home.";
30223033 DependencyManager::get<AddressManager>()->goToLocalSandbox();
@@ -3800,6 +3811,9 @@ void Application::touchUpdateEvent(QTouchEvent* event) { · 777 unmodified lines
38003811 if (_touchscreenDevice && _touchscreenDevice->isActive()) {
38013812 _touchscreenDevice->touchUpdateEvent(event);
38023813 }
3814+ if (_touchscreenVirtualPadDevice && _touchscreenVirtualPadDevice->isActive()) {
3815+ _touchscreenVirtualPadDevice->touchUpdateEvent(event);
3816+ }
38033817 }
38043818
38053819 void Application::touchBeginEvent(QTouchEvent* event) {
@@ -3821,6 +3835,9 @@ void Application::touchBeginEvent(QTouchEvent* event) { · 15 unmodified lines
38213835 if (_touchscreenDevice && _touchscreenDevice->isActive()) {
38223836 _touchscreenDevice->touchBeginEvent(event);
38233837 }
3838+ if (_touchscreenVirtualPadDevice && _touchscreenVirtualPadDevice->isActive()) {
3839+ _touchscreenVirtualPadDevice->touchBeginEvent(event);
3840+ }
38243841
38253842 }
38263843
@@ -3841,7 +3858,9 @@ void Application::touchEndEvent(QTouchEvent* event) { · 14 unmodified lines
38413858 if (_touchscreenDevice && _touchscreenDevice->isActive()) {
38423859 _touchscreenDevice->touchEndEvent(event);
38433860 }
3844−
3861+ if (_touchscreenVirtualPadDevice && _touchscreenVirtualPadDevice->isActive()) {
3862+ _touchscreenVirtualPadDevice->touchEndEvent(event);
3863+ }
38453864 // put any application specific touch behavior below here..
38463865 }
38473866
@@ -3849,6 +3868,9 @@ void Application::touchGestureEvent(QGestureEvent* event) { · 1 unmodified line
38493868 if (_touchscreenDevice && _touchscreenDevice->isActive()) {
38503869 _touchscreenDevice->touchGestureEvent(event);
38513870 }
3871+ if (_touchscreenVirtualPadDevice && _touchscreenVirtualPadDevice->isActive()) {
3872+ _touchscreenVirtualPadDevice->touchGestureEvent(event);
3873+ }
38523874 }
38533875
38543876 void Application::wheelEvent(QWheelEvent* event) const {
@@ -5318,7 +5340,9 @@ void Application::update(float deltaTime) { · 1463 unmodified lines
53185340 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
53195341 PerformanceWarning warn(showWarnings, "Application::update()");
53205342
5343+#if !defined(Q_OS_ANDROID)
53215344 updateLOD(deltaTime);
5345+#endif
53225346
53235347 // TODO: break these out into distinct perfTimers when they prove interesting
53245348 {
@@ -6047,6 +6071,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 722 unmodified lines
60476071 scriptEngine->registerFunction("OverlayWebWindow", QmlWebWindowClass::constructor);
60486072 #endif
60496073 scriptEngine->registerFunction("OverlayWindow", QmlWindowClass::constructor);
6074+ scriptEngine->registerFunction("QmlFragment", QmlFragmentClass::constructor);
60506075
60516076 scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance());
60526077 scriptEngine->registerGlobalObject("DesktopPreviewProvider", DependencyManager::get<DesktopPreviewProvider>().data());
@@ -6121,6 +6146,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 68 unmodified lines
61216146 scriptEngine->registerGlobalObject("Selection", DependencyManager::get<SelectionScriptingInterface>().data());
61226147 scriptEngine->registerGlobalObject("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data());
61236148 scriptEngine->registerGlobalObject("Wallet", DependencyManager::get<WalletScriptingInterface>().data());
6149+ scriptEngine->registerGlobalObject("AddressManager", DependencyManager::get<AddressManager>().data());
61246150
61256151 qScriptRegisterMetaType(scriptEngine.data(), OverlayIDtoScriptValue, OverlayIDfromScriptValue);
61266152