From 821575aa24d9a89a3d475b1eb4de8e712f2a3471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A4r=20Bj=C3=B6rklund?= Date: Tue, 3 Feb 2015 15:35:12 +0100 Subject: [PATCH] Renamed GetInstance to Get --- xbmc/Application.cpp | 13 +++++++------ xbmc/input/InputManager.cpp | 2 +- xbmc/input/InputManager.h | 2 +- xbmc/peripherals/devices/PeripheralImon.cpp | 2 +- xbmc/settings/Settings.cpp | 4 ++-- xbmc/windowing/WinEventsSDL.cpp | 2 +- xbmc/windowing/WinEventsX11.cpp | 2 +- xbmc/windowing/android/WinEventsAndroid.cpp | 2 +- xbmc/windowing/osx/WinEventsIOS.mm | 2 +- xbmc/windowing/windows/WinEventsWin32.cpp | 4 ++-- 10 files changed, 18 insertions(+), 17 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index e262b7905bcf9..096e9bd9f8364 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -388,7 +388,7 @@ bool CApplication::OnEvent(XBMC_Event& newEvent) case XBMC_MOUSEBUTTONUP: case XBMC_MOUSEMOTION: g_Mouse.HandleEvent(newEvent); - CInputManager::GetInstance().ProcessMouse(g_windowManager.GetActiveWindowID()); + CInputManager::Get().ProcessMouse(g_windowManager.GetActiveWindowID()); break; case XBMC_VIDEORESIZE: if (!g_application.m_bInitializing && @@ -913,6 +913,7 @@ bool CApplication::CreateGUI() if (!CButtonTranslator::GetInstance().Load()) return false; + RESOLUTION_INFO info = g_graphicsContext.GetResInfo(); CLog::Log(LOGINFO, "GUI format %ix%i, Display %s", info.iWidth, @@ -1318,7 +1319,7 @@ bool CApplication::Initialize() ResetScreenSaver(); #ifdef HAS_SDL_JOYSTICK - CInputManager::GetInstance().SetEnabledJoystick(CSettings::Get().GetBool("input.enablejoystick") && + CInputManager::Get().SetEnabledJoystick(CSettings::Get().GetBool("input.enablejoystick") && CPeripheralImon::GetCountOfImonsConflictWithDInput() == 0 ); #endif @@ -2670,10 +2671,10 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) #endif // process input actions - CInputManager::GetInstance().ProcessRemote(g_windowManager.GetActiveWindowID()); - CInputManager::GetInstance().ProcessGamepad(g_windowManager.GetActiveWindowID()); - CInputManager::GetInstance().ProcessEventServer(g_windowManager.GetActiveWindowID(), frameTime); - CInputManager::GetInstance().ProcessPeripherals(frameTime); + CInputManager::Get().ProcessRemote(g_windowManager.GetActiveWindowID()); + CInputManager::Get().ProcessGamepad(g_windowManager.GetActiveWindowID()); + CInputManager::Get().ProcessEventServer(g_windowManager.GetActiveWindowID(), frameTime); + CInputManager::Get().ProcessPeripherals(frameTime); if (processGUI && m_renderGUI) { m_pInertialScrollingHandler->ProcessInertialScroll(frameTime); diff --git a/xbmc/input/InputManager.cpp b/xbmc/input/InputManager.cpp index 0c5519a983b56..519b6eddd0282 100644 --- a/xbmc/input/InputManager.cpp +++ b/xbmc/input/InputManager.cpp @@ -67,7 +67,7 @@ using namespace EVENTSERVER; using namespace PERIPHERALS; -CInputManager& CInputManager::GetInstance() +CInputManager& CInputManager::Get() { static CInputManager inputManager; return inputManager; diff --git a/xbmc/input/InputManager.h b/xbmc/input/InputManager.h index b157250f5264c..c106f775521ac 100644 --- a/xbmc/input/InputManager.h +++ b/xbmc/input/InputManager.h @@ -41,7 +41,7 @@ class CInputManager public: /*! \brief static method to get the current instance of the class. Creates a new instance the first time it's called. */ - static CInputManager& GetInstance(); + static CInputManager& Get(); /*! \brief decode an input event from remote controls. diff --git a/xbmc/peripherals/devices/PeripheralImon.cpp b/xbmc/peripherals/devices/PeripheralImon.cpp index 3abe4d822cfa9..5c7f55605778b 100644 --- a/xbmc/peripherals/devices/PeripheralImon.cpp +++ b/xbmc/peripherals/devices/PeripheralImon.cpp @@ -111,7 +111,7 @@ void CPeripheralImon::ActionOnImonConflict(bool deviceInserted /*= true*/) bool enableJoystickNow = !deviceInserted && CSettings::Get().GetBool("input.enablejoystick"); CLog::Log(LOGNOTICE, "Problematic iMON hardware %s. Joystick usage: %s", (deviceInserted ? "detected" : "was removed"), (enableJoystickNow) ? "enabled." : "disabled." ); - CInputManager::GetInstance().SetEnabledJoystick(enableJoystickNow); + CInputManager::Get().SetEnabledJoystick(enableJoystickNow); #endif } } diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index 996d50c62fc6c..6cbdfb12e03cd 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -272,7 +272,7 @@ void CSettings::Uninitialize() m_settingsManager->UnregisterCallback(&g_graphicsContext); m_settingsManager->UnregisterCallback(&g_langInfo); #if defined(TARGET_WINDOWS) || defined(HAS_SDL_JOYSTICK) - m_settingsManager->UnregisterCallback(&CInputManager::GetInstance().m_Joystick); + m_settingsManager->UnregisterCallback(&CInputManager::Get().m_Joystick); #endif m_settingsManager->UnregisterCallback(&g_Mouse); m_settingsManager->UnregisterCallback(&CNetworkServices::Get()); @@ -762,7 +762,7 @@ void CSettings::InitializeISettingCallbacks() #if defined(HAS_SDL_JOYSTICK) settingSet.clear(); settingSet.insert("input.enablejoystick"); - m_settingsManager->RegisterCallback(&CInputManager::GetInstance().m_Joystick, settingSet); + m_settingsManager->RegisterCallback(&CInputManager::Get().m_Joystick, settingSet); #endif settingSet.clear(); diff --git a/xbmc/windowing/WinEventsSDL.cpp b/xbmc/windowing/WinEventsSDL.cpp index f158b168ed9d1..44e82f6baedd6 100644 --- a/xbmc/windowing/WinEventsSDL.cpp +++ b/xbmc/windowing/WinEventsSDL.cpp @@ -238,7 +238,7 @@ bool CWinEventsSDL::MessagePump() case SDL_JOYHATMOTION: case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEREMOVED: - CInputManager::GetInstance().UpdateJoystick(event); + CInputManager::Get().UpdateJoystick(event); ret = true; break; #endif diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp index 6d6d1f5db4a99..2b75cc98fb206 100644 --- a/xbmc/windowing/WinEventsX11.cpp +++ b/xbmc/windowing/WinEventsX11.cpp @@ -616,7 +616,7 @@ bool CWinEventsX11Imp::MessagePump() case SDL_JOYHATMOTION: case SDL_JOYDEVICEADDED: case SDL_JOYDEVICEREMOVED: - CInputManager::GetInstance().UpdateJoystick(event); + CInputManager::Get().UpdateJoystick(event); ret = true; break; diff --git a/xbmc/windowing/android/WinEventsAndroid.cpp b/xbmc/windowing/android/WinEventsAndroid.cpp index b6402434e8707..fcbbcea822fdf 100644 --- a/xbmc/windowing/android/WinEventsAndroid.cpp +++ b/xbmc/windowing/android/WinEventsAndroid.cpp @@ -220,7 +220,7 @@ bool CWinEventsAndroid::MessagePump() if (fabs(amount) >= ALMOST_ZERO) { - ret |= CInputManager::GetInstance().ProcessJoystickEvent(g_windowManager.GetActiveWindowID(), + ret |= CInputManager::Get().ProcessJoystickEvent(g_windowManager.GetActiveWindowID(), input_device.name, item, input_type, amount, holdTime); } } diff --git a/xbmc/windowing/osx/WinEventsIOS.mm b/xbmc/windowing/osx/WinEventsIOS.mm index 4272a25cc7606..988f4428c3227 100644 --- a/xbmc/windowing/osx/WinEventsIOS.mm +++ b/xbmc/windowing/osx/WinEventsIOS.mm @@ -71,7 +71,7 @@ unsigned int holdTime = pumpEvent.jbutton.holdTime; CLog::Log(LOGDEBUG,"CWinEventsIOS: Button press keyID = %i", wKeyID); - ret |= CInputManager::GetInstance().ProcessJoystickEvent(g_windowManager.GetActiveWindowID(), joystickName, wKeyID, JACTIVE_BUTTON, fAmount, holdTime); + ret |= CInputManager::Get().ProcessJoystickEvent(g_windowManager.GetActiveWindowID(), joystickName, wKeyID, JACTIVE_BUTTON, fAmount, holdTime); } else ret |= g_application.OnEvent(pumpEvent); diff --git a/xbmc/windowing/windows/WinEventsWin32.cpp b/xbmc/windowing/windows/WinEventsWin32.cpp index 1e8fc086ca7d9..7e633eb7c72a4 100644 --- a/xbmc/windowing/windows/WinEventsWin32.cpp +++ b/xbmc/windowing/windows/WinEventsWin32.cpp @@ -455,7 +455,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L case WM_ACTIVATE: { if( WA_INACTIVE != wParam ) - CInputManager::GetInstance().ReInitializeJoystick(); + CInputManager::Get().ReInitializeJoystick(); bool active = g_application.GetRenderGUI(); if (HIWORD(wParam)) @@ -761,7 +761,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L if (((_DEV_BROADCAST_HEADER*) lParam)->dbcd_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { g_peripherals.TriggerDeviceScan(PERIPHERAL_BUS_USB); - CInputManager::GetInstance().ReInitializeJoystick(); + CInputManager::Get().ReInitializeJoystick(); } // check if an usb or optical media was inserted or removed if (((_DEV_BROADCAST_HEADER*) lParam)->dbcd_devicetype == DBT_DEVTYP_VOLUME)