Skip to content
Permalink
Browse files

InputCommon: Use nested namespace specifiers where applicable

  • Loading branch information...
lioncash committed Jun 17, 2019
1 parent 8e030a4 commit ec60027f56bde17ef32a80b9f002225542c5859a
Showing with 78 additions and 195 deletions.
  1. +2 −5 Source/Core/DolphinQt/Config/Mapping/MappingCommon.h
  2. +2 −5 Source/Core/DolphinQt/Config/Mapping/MappingWidget.h
  3. +3 −6 Source/Core/InputCommon/ControlReference/ExpressionParser.cpp
  4. +2 −5 Source/Core/InputCommon/ControlReference/ExpressionParser.h
  5. +2 −5 Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
  6. +3 −5 Source/Core/InputCommon/ControllerInterface/Android/Android.h
  7. +2 −5 Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp
  8. +2 −5 Source/Core/InputCommon/ControllerInterface/DInput/DInput.h
  9. +2 −5 Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp
  10. +2 −5 Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.h
  11. +2 −5 Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
  12. +2 −5 Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
  13. +2 −5 Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp
  14. +2 −5 Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.h
  15. +2 −6 Source/Core/InputCommon/ControllerInterface/Device.cpp
  16. +2 −6 Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp
  17. +2 −6 Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h
  18. +2 −5 Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h
  19. +2 −5 Source/Core/InputCommon/ControllerInterface/OSX/OSX.h
  20. +2 −5 Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
  21. +2 −5 Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h
  22. +2 −5 Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
  23. +2 −6 Source/Core/InputCommon/ControllerInterface/OSX/RunLoopStopper.h
  24. +2 −5 Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp
  25. +2 −5 Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h
  26. +2 −5 Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h
  27. +2 −5 Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm
  28. +2 −5 Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h
  29. +2 −5 Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
  30. +2 −5 Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
  31. +2 −5 Source/Core/InputCommon/ControllerInterface/SDL/SDL.h
  32. +2 −5 Source/Core/InputCommon/ControllerInterface/Win32/Win32.h
  33. +2 −5 Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
  34. +2 −5 Source/Core/InputCommon/ControllerInterface/XInput/XInput.h
  35. +2 −5 Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp
  36. +2 −5 Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h
  37. +2 −5 Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
  38. +2 −5 Source/Core/InputCommon/ControllerInterface/evdev/evdev.h
@@ -11,14 +11,11 @@ class QString;
class OutputReference;
class QPushButton;

namespace ciface
{
namespace Core
namespace ciface::Core
{
class DeviceContainer;
class DeviceQualifier;
} // namespace Core
} // namespace ciface
} // namespace ciface::Core

namespace MappingCommon
{
@@ -25,13 +25,10 @@ class ControlGroup;
class EmulatedController;
} // namespace ControllerEmu

namespace ciface
{
namespace Core
namespace ciface::Core
{
class Device;
}
} // namespace ciface
} // namespace ciface::Core

constexpr int INDICATOR_UPDATE_FREQ = 30;

@@ -13,12 +13,10 @@
#include "Common/StringUtil.h"
#include "InputCommon/ControlReference/ExpressionParser.h"

namespace ciface::ExpressionParser
{
using namespace ciface::Core;

namespace ciface
{
namespace ExpressionParser
{
enum TokenType
{
TOK_DISCARD,
@@ -557,5 +555,4 @@ std::pair<ParseStatus, std::unique_ptr<Expression>> ParseExpression(const std::s
std::move(complex_result.expr));
return std::make_pair(complex_result.status, std::move(combined_expr));
}
} // namespace ExpressionParser
} // namespace ciface
} // namespace ciface::ExpressionParser
@@ -9,9 +9,7 @@
#include <utility>
#include "InputCommon/ControllerInterface/Device.h"

namespace ciface
{
namespace ExpressionParser
namespace ciface::ExpressionParser
{
class ControlQualifier
{
@@ -66,5 +64,4 @@ enum class ParseStatus
};

std::pair<ParseStatus, std::unique_ptr<Expression>> ParseExpression(const std::string& expr);
} // namespace ExpressionParser
} // namespace ciface
} // namespace ciface::ExpressionParser
@@ -8,9 +8,7 @@
#include <thread>
#include "InputCommon/ControllerInterface/ControllerInterface.h"

namespace ciface
{
namespace Android
namespace ciface::Android
{
void PopulateDevices()
{
@@ -240,5 +238,4 @@ void Touchscreen::Motor::Rumble(int padID, double state)
JNIEnv* env = IDCache::GetEnvForThread();
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetDoRumble(), padID, state);
}
} // namespace Android
} // namespace ciface
} // namespace ciface::Android
@@ -7,11 +7,10 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "jni/ButtonManager.h"

namespace ciface
{
namespace Android
namespace ciface::Android
{
void PopulateDevices();

class Touchscreen : public Core::Device
{
private:
@@ -65,5 +64,4 @@ class Touchscreen : public Core::Device
private:
const int _padID;
};
} // namespace Android
} // namespace ciface
} // namespace ciface::Android
@@ -14,9 +14,7 @@
#pragma comment(lib, "Dinput8.lib")
#pragma comment(lib, "dxguid.lib")

namespace ciface
{
namespace DInput
namespace ciface::DInput
{
BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
{
@@ -69,5 +67,4 @@ void PopulateDevices(HWND hwnd)

idi8->Release();
}
} // namespace DInput
} // namespace ciface
} // namespace ciface::DInput
@@ -12,15 +12,12 @@

#include "InputCommon/ControllerInterface/DInput/DInput8.h"

namespace ciface
{
namespace DInput
namespace ciface::DInput
{
// BOOL CALLBACK DIEnumEffectsCallback(LPCDIEFFECTINFO pdei, LPVOID pvRef);
BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef);
BOOL CALLBACK DIEnumDevicesCallback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef);
std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device);

void PopulateDevices(HWND hwnd);
} // namespace DInput
} // namespace ciface
} // namespace ciface::DInput
@@ -14,9 +14,7 @@
#include "InputCommon/ControllerInterface/DInput/DInputJoystick.h"
#include "InputCommon/ControllerInterface/DInput/XInputFilter.h"

namespace ciface
{
namespace DInput
namespace ciface::DInput
{
constexpr DWORD DATA_BUFFER_SIZE = 32;

@@ -315,5 +313,4 @@ ControlState Joystick::Hat::GetState() const

return (abs((int)(m_hat / 4500 - m_direction * 2 + 8) % 8 - 4) > 2);
}
} // namespace DInput
} // namespace ciface
} // namespace ciface::DInput
@@ -7,9 +7,7 @@
#include "InputCommon/ControllerInterface/Device.h"
#include "InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h"

namespace ciface
{
namespace DInput
namespace ciface::DInput
{
void InitJoystick(IDirectInput8* const idi8, HWND hwnd);

@@ -77,5 +75,4 @@ class Joystick : public ForceFeedback::ForceFeedbackDevice

bool m_buffered;
};
} // namespace DInput
} // namespace ciface
} // namespace ciface::DInput
@@ -17,9 +17,7 @@
// otherwise it is just some crazy value
#define DROP_INPUT_TIME 250

namespace ciface
{
namespace DInput
namespace ciface::DInput
{
static const struct
{
@@ -227,5 +225,4 @@ ControlState KeyboardMouse::Cursor::GetState() const
{
return m_axis / (m_positive ? 1.0 : -1.0);
}
} // namespace DInput
} // namespace ciface
} // namespace ciface::DInput
@@ -9,9 +9,7 @@
#include "InputCommon/ControllerInterface/DInput/DInput8.h"
#include "InputCommon/ControllerInterface/Device.h"

namespace ciface
{
namespace DInput
namespace ciface::DInput
{
void InitKeyboardMouse(IDirectInput8* const idi8, HWND hwnd);

@@ -103,5 +101,4 @@ class KeyboardMouse : public Core::Device
DWORD m_last_update;
State m_state_in;
};
} // namespace DInput
} // namespace ciface
} // namespace ciface::DInput
@@ -9,9 +9,7 @@
#include <Windows.h>
#include <SetupAPI.h>

namespace ciface
{
namespace DInput
namespace ciface::DInput
{
// Code for enumerating hardware devices that use the XINPUT device driver.
// The MSDN recommended code suffers from massive performance problems when using language packs,
@@ -76,5 +74,4 @@ std::unordered_set<DWORD> GetXInputGUIDS()
SetupDiDestroyDeviceInfoList(setup_enum);
return guids;
}
} // namespace DInput
} // namespace ciface
} // namespace ciface::DInput
@@ -7,10 +7,7 @@
#include <Windows.h>
#include <unordered_set>

namespace ciface
{
namespace DInput
namespace ciface::DInput
{
std::unordered_set<DWORD> GetXInputGUIDS();
}
} // namespace ciface
} // namespace ciface::DInput
@@ -14,9 +14,7 @@
#include "Common/StringUtil.h"
#include "Common/Thread.h"

namespace ciface
{
namespace Core
namespace ciface::Core
{
// Compared to an input's current state (ideally 1.0) minus abs(initial_state) (ideally 0.0).
constexpr ControlState INPUT_DETECT_THRESHOLD = 0.55;
@@ -326,6 +324,4 @@ DeviceContainer::DetectInput(u32 wait_ms, const std::vector<std::string>& device
// No input was detected. :'(
return {};
}

} // namespace Core
} // namespace ciface
} // namespace ciface::Core
@@ -9,9 +9,7 @@

#include "Common/Thread.h"

namespace ciface
{
namespace ForceFeedback
namespace ciface::ForceFeedback
{
// Template instantiation:
template class ForceFeedbackDevice::TypedForce<DICONSTANTFORCE>;
@@ -257,6 +255,4 @@ void ForceFeedbackDevice::Force::Release()
m_effect->Unload();
m_effect->Release();
}

} // namespace ForceFeedback
} // namespace ciface
} // namespace ciface::ForceFeedback
@@ -19,9 +19,7 @@
#include "InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h"
#endif

namespace ciface
{
namespace ForceFeedback
namespace ciface::ForceFeedback
{
class ForceFeedbackDevice : public Core::Device
{
@@ -83,6 +81,4 @@ class ForceFeedbackDevice : public Core::Device
Common::Event m_update_event;
Common::Flag m_run_thread;
};

} // namespace ForceFeedback
} // namespace ciface
} // namespace ciface::ForceFeedback
@@ -20,9 +20,7 @@ typedef LONG* LPLONG; // Missing type for ForceFeedback.h
#include "Common/CommonTypes.h" // for LONG
#include "DirectInputConstants.h" // Not stricty necessary

namespace ciface
{
namespace ForceFeedback
namespace ciface::ForceFeedback
{
// Prototypes
class IUnknownImpl;
@@ -196,5 +194,4 @@ class FFDeviceAdapter : public IUnknownImpl
return FFDeviceSetForceFeedbackProperty(m_device, property, &value);
}
};
} // namespace ForceFeedback
} // namespace ciface
} // namespace ciface::ForceFeedback
@@ -4,14 +4,11 @@

#pragma once

namespace ciface
{
namespace OSX
namespace ciface::OSX
{
void Init(void* window);
void PopulateDevices(void* window);
void DeInit();

void DeviceElementDebugPrint(const void*, void*);
} // namespace OSX
} // namespace ciface
} // namespace ciface::OSX
@@ -17,9 +17,7 @@
#include "InputCommon/ControllerInterface/OSX/OSXJoystick.h"
#include "InputCommon/ControllerInterface/OSX/RunLoopStopper.h"

namespace ciface
{
namespace OSX
namespace ciface::OSX
{
constexpr CFTimeInterval FOREVER = 1e20;
static std::thread s_hotplug_thread;
@@ -227,5 +225,4 @@ void DeInit()
IOHIDManagerClose(HIDManager, kIOHIDOptionsTypeNone);
CFRelease(HIDManager);
}
}
}
} // namespace ciface::OSX
@@ -11,9 +11,7 @@
#include "InputCommon/ControllerInterface/Device.h"
#include "InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h"

namespace ciface
{
namespace OSX
namespace ciface::OSX
{
class Joystick : public ForceFeedback::ForceFeedbackDevice
{
@@ -90,5 +88,4 @@ class Joystick : public ForceFeedback::ForceFeedbackDevice

ForceFeedback::FFDeviceAdapterReference m_ff_device;
};
} // namespace OSX
} // namespace ciface
} // namespace ciface::OSX
@@ -13,9 +13,7 @@
#include "Common/Logging/Log.h"
#include "Common/StringUtil.h"

namespace ciface
{
namespace OSX
namespace ciface::OSX
{
void Joystick::AddElements(CFArrayRef elements, std::set<IOHIDElementCookie>& cookies)
{
@@ -341,5 +339,4 @@
{
return m_device == other_device;
}
}
}
} // namespace ciface::OSX

0 comments on commit ec60027

Please sign in to comment.
You can’t perform that action at this time.