Convert misconfigured tabs to spaces

This commit is contained in:
Jack Andersen 2017-12-08 09:17:23 -10:00
parent 1259255f34
commit 2db777eead
3 changed files with 148 additions and 148 deletions

View File

@ -31,7 +31,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine
ComPtr<IMMDeviceEnumerator> m_enumerator; ComPtr<IMMDeviceEnumerator> m_enumerator;
ComPtr<IMMDevice> m_device; ComPtr<IMMDevice> m_device;
#else #else
bool m_ready = false; bool m_ready = false;
#endif #endif
ComPtr<IAudioClient> m_audClient; ComPtr<IAudioClient> m_audClient;
ComPtr<IAudioRenderClient> m_renderClient; ComPtr<IAudioRenderClient> m_renderClient;
@ -369,7 +369,7 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine
operation->GetActivateResult(&hrActivateResult, &punkAudioInterface); operation->GetActivateResult(&hrActivateResult, &punkAudioInterface);
punkAudioInterface.As<IAudioClient>(&m_audClient); punkAudioInterface.As<IAudioClient>(&m_audClient);
_buildAudioRenderClient(); _buildAudioRenderClient();
m_ready = true; m_ready = true;
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
#endif #endif
@ -429,10 +429,10 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine
void pumpAndMixVoices() void pumpAndMixVoices()
{ {
#if WINDOWS_STORE #if WINDOWS_STORE
if (!m_ready) if (!m_ready)
return; return;
#endif #endif
int attempt = 0; int attempt = 0;
while (true) while (true)
{ {

View File

@ -209,24 +209,24 @@ public:
{ {
/* Spawn client thread */ /* Spawn client thread */
int clientReturn = 0; int clientReturn = 0;
m_clientThread = std::thread([&]() m_clientThread = std::thread([&]()
{ {
std::string thrName = WCSTMBS(getFriendlyName().data()) + " Client Thread"; std::string thrName = WCSTMBS(getFriendlyName().data()) + " Client Thread";
logvisor::RegisterThreadName(thrName.c_str()); logvisor::RegisterThreadName(thrName.c_str());
clientReturn = m_callback.appMain(this); clientReturn = m_callback.appMain(this);
}); });
CoreWindow::GetForCurrentThread()->Activate(); CoreWindow::GetForCurrentThread()->Activate();
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit); CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
return 0; return 0;
} }
void quit() void quit()
{ {
m_callback.appQuitting(this); m_callback.appQuitting(this);
if (m_clientThread.joinable()) if (m_clientThread.joinable())
m_clientThread.join(); m_clientThread.join();
} }
SystemStringView getUniqueName() const SystemStringView getUniqueName() const
{ {
@ -301,7 +301,7 @@ public:
virtual void Uninitialize() virtual void Uninitialize()
{ {
m_app.quit(); m_app.quit();
} }
void OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) void OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)

View File

@ -70,7 +70,7 @@ public:
#if !WINDOWS_STORE #if !WINDOWS_STORE
scDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; scDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
#else #else
scDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; scDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
#endif #endif
scDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; scDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
@ -250,9 +250,9 @@ class WindowUWP : public IWindow
{ {
friend struct GraphicsContextUWP; friend struct GraphicsContextUWP;
ApplicationView^ m_appView = ApplicationView::GetForCurrentView(); ApplicationView^ m_appView = ApplicationView::GetForCurrentView();
Platform::Agile<CoreWindow> m_coreWindow; Platform::Agile<CoreWindow> m_coreWindow;
Rect m_bounds; Rect m_bounds;
float m_dispInfoDpiFactor = 1.f; float m_dispInfoDpiFactor = 1.f;
std::unique_ptr<GraphicsContextUWP> m_gfxCtx; std::unique_ptr<GraphicsContextUWP> m_gfxCtx;
IWindowCallback* m_callback = nullptr; IWindowCallback* m_callback = nullptr;
@ -270,52 +270,52 @@ public:
w.OnKeyUp(window, keyEventArgs); w.OnKeyUp(window, keyEventArgs);
} }
void OnPointerEntered(CoreWindow^ window, PointerEventArgs^ args) void OnPointerEntered(CoreWindow^ window, PointerEventArgs^ args)
{ {
w.OnPointerEntered(window, args); w.OnPointerEntered(window, args);
} }
void OnPointerExited(CoreWindow^ window, PointerEventArgs^ args) void OnPointerExited(CoreWindow^ window, PointerEventArgs^ args)
{ {
w.OnPointerExited(window, args); w.OnPointerExited(window, args);
} }
void OnPointerMoved(CoreWindow^ window, PointerEventArgs^ args) void OnPointerMoved(CoreWindow^ window, PointerEventArgs^ args)
{ {
w.OnPointerMoved(window, args); w.OnPointerMoved(window, args);
} }
void OnPointerPressed(CoreWindow^ window, PointerEventArgs^ args) void OnPointerPressed(CoreWindow^ window, PointerEventArgs^ args)
{ {
w.OnPointerPressed(window, args); w.OnPointerPressed(window, args);
} }
void OnPointerReleased(CoreWindow^ window, PointerEventArgs^ args) void OnPointerReleased(CoreWindow^ window, PointerEventArgs^ args)
{ {
w.OnPointerReleased(window, args); w.OnPointerReleased(window, args);
} }
void OnPointerWheelChanged(CoreWindow^ window, PointerEventArgs^ args) void OnPointerWheelChanged(CoreWindow^ window, PointerEventArgs^ args)
{ {
w.OnPointerWheelChanged(window, args); w.OnPointerWheelChanged(window, args);
} }
void OnClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) void OnClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
{ {
w.OnClosed(sender, args); w.OnClosed(sender, args);
} }
void SizeChanged(CoreWindow^ window, WindowSizeChangedEventArgs^) void SizeChanged(CoreWindow^ window, WindowSizeChangedEventArgs^)
{ {
w.m_bounds = window->Bounds; w.m_bounds = window->Bounds;
w._resized(); w._resized();
} }
void DisplayInfoChanged(DisplayInformation^ di, Object^) void DisplayInfoChanged(DisplayInformation^ di, Object^)
{ {
w.m_dispInfoDpiFactor = di->LogicalDpi / 96.f; w.m_dispInfoDpiFactor = di->LogicalDpi / 96.f;
w._resized(); w._resized();
} }
internal: internal:
WindowUWP& w; WindowUWP& w;
@ -323,16 +323,16 @@ public:
{ {
w.m_coreWindow->KeyDown += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &EventReceiver::OnKeyDown); w.m_coreWindow->KeyDown += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &EventReceiver::OnKeyDown);
w.m_coreWindow->KeyUp += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &EventReceiver::OnKeyUp); w.m_coreWindow->KeyUp += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &EventReceiver::OnKeyUp);
w.m_coreWindow->PointerEntered += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerEntered); w.m_coreWindow->PointerEntered += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerEntered);
w.m_coreWindow->PointerExited += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerExited); w.m_coreWindow->PointerExited += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerExited);
w.m_coreWindow->PointerMoved += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerMoved); w.m_coreWindow->PointerMoved += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerMoved);
w.m_coreWindow->PointerPressed += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerPressed); w.m_coreWindow->PointerPressed += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerPressed);
w.m_coreWindow->PointerReleased += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerReleased); w.m_coreWindow->PointerReleased += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerReleased);
w.m_coreWindow->PointerWheelChanged += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerWheelChanged); w.m_coreWindow->PointerWheelChanged += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &EventReceiver::OnPointerWheelChanged);
w.m_coreWindow->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &EventReceiver::OnClosed); w.m_coreWindow->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &EventReceiver::OnClosed);
w.m_coreWindow->SizeChanged += ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &EventReceiver::SizeChanged); w.m_coreWindow->SizeChanged += ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &EventReceiver::SizeChanged);
DisplayInformation::GetForCurrentView()->DpiChanged += DisplayInformation::GetForCurrentView()->DpiChanged +=
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &EventReceiver::DisplayInfoChanged); ref new TypedEventHandler<DisplayInformation^, Object^>(this, &EventReceiver::DisplayInfoChanged);
} }
}; };
EventReceiver^ m_eventReceiver; EventReceiver^ m_eventReceiver;
@ -349,23 +349,23 @@ public:
m_gfxCtx.reset(new GraphicsContextUWPD3D(api, this, m_coreWindow, b3dCtx, sampleCount)); m_gfxCtx.reset(new GraphicsContextUWPD3D(api, this, m_coreWindow, b3dCtx, sampleCount));
setTitle(title); setTitle(title);
m_bounds = m_coreWindow->Bounds; m_bounds = m_coreWindow->Bounds;
m_dispInfoDpiFactor = DisplayInformation::GetForCurrentView()->LogicalDpi / 96.f; m_dispInfoDpiFactor = DisplayInformation::GetForCurrentView()->LogicalDpi / 96.f;
if (auto titleBar = ApplicationView::GetForCurrentView()->TitleBar) if (auto titleBar = ApplicationView::GetForCurrentView()->TitleBar)
{ {
Color grey = { 0xFF, 0x33, 0x33, 0x33 }; Color grey = { 0xFF, 0x33, 0x33, 0x33 };
Color transWhite = { 0xFF, 0x88, 0x88, 0x88 }; Color transWhite = { 0xFF, 0x88, 0x88, 0x88 };
titleBar->ButtonBackgroundColor = grey; titleBar->ButtonBackgroundColor = grey;
titleBar->ButtonForegroundColor = Colors::White; titleBar->ButtonForegroundColor = Colors::White;
titleBar->BackgroundColor = grey; titleBar->BackgroundColor = grey;
titleBar->ForegroundColor = Colors::White; titleBar->ForegroundColor = Colors::White;
titleBar->ButtonInactiveBackgroundColor = grey; titleBar->ButtonInactiveBackgroundColor = grey;
titleBar->ButtonInactiveForegroundColor = transWhite; titleBar->ButtonInactiveForegroundColor = transWhite;
titleBar->InactiveBackgroundColor = grey; titleBar->InactiveBackgroundColor = grey;
titleBar->InactiveForegroundColor = transWhite; titleBar->InactiveForegroundColor = transWhite;
} }
} }
~WindowUWP() ~WindowUWP()
@ -444,15 +444,15 @@ public:
bool isFullscreen() const bool isFullscreen() const
{ {
return ApplicationView::GetForCurrentView()->IsFullScreenMode; return ApplicationView::GetForCurrentView()->IsFullScreenMode;
} }
void setFullscreen(bool fs) void setFullscreen(bool fs)
{ {
if (fs) if (fs)
ApplicationView::GetForCurrentView()->TryEnterFullScreenMode(); ApplicationView::GetForCurrentView()->TryEnterFullScreenMode();
else else
ApplicationView::GetForCurrentView()->ExitFullScreenMode(); ApplicationView::GetForCurrentView()->ExitFullScreenMode();
} }
void claimKeyboardFocus(const int coord[2]) void claimKeyboardFocus(const int coord[2])
@ -514,81 +514,81 @@ public:
m_callback->modKeyUp(modifierKey); m_callback->modKeyUp(modifierKey);
} }
SWindowCoord GetCursorCoords(const Point& point) SWindowCoord GetCursorCoords(const Point& point)
{ {
SWindowCoord coord = { SWindowCoord coord = {
point.X * m_dispInfoDpiFactor, (m_bounds.Height - point.Y) * m_dispInfoDpiFactor, point.X * m_dispInfoDpiFactor, (m_bounds.Height - point.Y) * m_dispInfoDpiFactor,
point.X, m_bounds.Height - point.Y, point.X / m_bounds.Width, point.X, m_bounds.Height - point.Y, point.X / m_bounds.Width,
(m_bounds.Height - point.Y) / m_bounds.Height (m_bounds.Height - point.Y) / m_bounds.Height
}; };
return coord; return coord;
} }
void OnPointerEntered(CoreWindow^ window, PointerEventArgs^ args) void OnPointerEntered(CoreWindow^ window, PointerEventArgs^ args)
{ {
m_callback->mouseEnter(GetCursorCoords(args->CurrentPoint->Position)); m_callback->mouseEnter(GetCursorCoords(args->CurrentPoint->Position));
} }
void OnPointerExited(CoreWindow^ window, PointerEventArgs^ args)
{
m_callback->mouseLeave(GetCursorCoords(args->CurrentPoint->Position));
}
void OnPointerMoved(CoreWindow^ window, PointerEventArgs^ args) void OnPointerExited(CoreWindow^ window, PointerEventArgs^ args)
{ {
m_callback->mouseMove(GetCursorCoords(args->CurrentPoint->Position)); m_callback->mouseLeave(GetCursorCoords(args->CurrentPoint->Position));
} }
boo::EMouseButton m_pressedButton = boo::EMouseButton::None; void OnPointerMoved(CoreWindow^ window, PointerEventArgs^ args)
void OnPointerPressed(CoreWindow^ window, PointerEventArgs^ args) {
{ m_callback->mouseMove(GetCursorCoords(args->CurrentPoint->Position));
auto properties = args->CurrentPoint->Properties; }
boo::EMouseButton button = boo::EMouseButton::None;
if (properties->IsLeftButtonPressed)
button = boo::EMouseButton::Primary;
else if (properties->IsMiddleButtonPressed)
button = boo::EMouseButton::Middle;
else if (properties->IsRightButtonPressed)
button = boo::EMouseButton::Secondary;
else if (properties->IsXButton1Pressed)
button = boo::EMouseButton::Aux1;
else if (properties->IsXButton2Pressed)
button = boo::EMouseButton::Aux2;
m_callback->mouseDown(GetCursorCoords(args->CurrentPoint->Position),
button, translateModifiers(m_coreWindow.Get()));
m_pressedButton = button;
}
void OnPointerReleased(CoreWindow^ window, PointerEventArgs^ args) boo::EMouseButton m_pressedButton = boo::EMouseButton::None;
{ void OnPointerPressed(CoreWindow^ window, PointerEventArgs^ args)
auto properties = args->CurrentPoint->Properties; {
m_callback->mouseUp(GetCursorCoords(args->CurrentPoint->Position), auto properties = args->CurrentPoint->Properties;
m_pressedButton, translateModifiers(m_coreWindow.Get())); boo::EMouseButton button = boo::EMouseButton::None;
} if (properties->IsLeftButtonPressed)
button = boo::EMouseButton::Primary;
else if (properties->IsMiddleButtonPressed)
button = boo::EMouseButton::Middle;
else if (properties->IsRightButtonPressed)
button = boo::EMouseButton::Secondary;
else if (properties->IsXButton1Pressed)
button = boo::EMouseButton::Aux1;
else if (properties->IsXButton2Pressed)
button = boo::EMouseButton::Aux2;
m_callback->mouseDown(GetCursorCoords(args->CurrentPoint->Position),
button, translateModifiers(m_coreWindow.Get()));
m_pressedButton = button;
}
void OnPointerWheelChanged(CoreWindow^ window, PointerEventArgs^ args) void OnPointerReleased(CoreWindow^ window, PointerEventArgs^ args)
{ {
auto properties = args->CurrentPoint->Properties; auto properties = args->CurrentPoint->Properties;
SScrollDelta scroll = {}; m_callback->mouseUp(GetCursorCoords(args->CurrentPoint->Position),
scroll.delta[1] = properties->MouseWheelDelta / double(WHEEL_DELTA); m_pressedButton, translateModifiers(m_coreWindow.Get()));
m_callback->scroll(GetCursorCoords(args->CurrentPoint->Position), scroll); }
}
void OnPointerWheelChanged(CoreWindow^ window, PointerEventArgs^ args)
{
auto properties = args->CurrentPoint->Properties;
SScrollDelta scroll = {};
scroll.delta[1] = properties->MouseWheelDelta / double(WHEEL_DELTA);
m_callback->scroll(GetCursorCoords(args->CurrentPoint->Position), scroll);
}
void OnClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) void OnClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
{ {
if (m_callback) if (m_callback)
m_callback->destroyed(); m_callback->destroyed();
} }
void _resized() void _resized()
{ {
boo::SWindowRect rect( boo::SWindowRect rect(
m_bounds.X * m_dispInfoDpiFactor, m_bounds.Y * m_dispInfoDpiFactor, m_bounds.X * m_dispInfoDpiFactor, m_bounds.Y * m_dispInfoDpiFactor,
m_bounds.Width * m_dispInfoDpiFactor, m_bounds.Height * m_dispInfoDpiFactor); m_bounds.Width * m_dispInfoDpiFactor, m_bounds.Height * m_dispInfoDpiFactor);
m_gfxCtx->resized(rect); m_gfxCtx->resized(rect);
if (m_callback) if (m_callback)
m_callback->resized(rect, false); m_callback->resized(rect, false);
} }
ETouchType getTouchType() const ETouchType getTouchType() const
{ {