#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License // If the library is compiled as a DLL, this ensures symbols are exported #define NUCLEX_INPUT_SOURCE 1 #include "Nuclex/Input/Config.h" #if defined(NUCLEX_INPUT_WINRT) #include "Nuclex/Input/WinRTInputManager.h" #include "WinRT/WinRTInputManager.Impl.h" namespace Nuclex { namespace Input { // ------------------------------------------------------------------------------------------- // WinRTInputManager::WinRTInputManager(Windows::UI::Core::CoreWindow ^window) : impl(ref new Impl(window)) {} // ------------------------------------------------------------------------------------------- // WinRTInputManager::~WinRTInputManager() { delete this->impl; this->impl = nullptr; } // ------------------------------------------------------------------------------------------- // std::size_t WinRTInputManager::CountKeyboards() const { return 1; } // ------------------------------------------------------------------------------------------- // const Devices::Keyboard &WinRTInputManager::GetKeyboard(std::size_t index) const { if(index == 0) { return this->impl->Keyboard; } else { throw std::out_of_range("Keyboard index out of range"); } } // ------------------------------------------------------------------------------------------- // Devices::Keyboard &WinRTInputManager::GetKeyboard(std::size_t index) { if(index == 0) { return this->impl->Keyboard; } else { throw std::out_of_range("Keyboard index out of range"); } } // ------------------------------------------------------------------------------------------- // std::size_t WinRTInputManager::CountMice() const { return 1; } // ------------------------------------------------------------------------------------------- // const Devices::Mouse &WinRTInputManager::GetMouse(std::size_t index) const { if(index == 0) { return this->impl->Mouse; } else { throw std::out_of_range("Mouse index out of range"); } } // ------------------------------------------------------------------------------------------- // Devices::Mouse &WinRTInputManager::GetMouse(std::size_t index) { if(index == 0) { return this->impl->Mouse; } else { throw std::out_of_range("Mouse index out of range"); } } // ------------------------------------------------------------------------------------------- // std::size_t WinRTInputManager::CountGamePads() const { return 4; } // ------------------------------------------------------------------------------------------- // const Devices::GamePad &WinRTInputManager::GetGamePad(std::size_t index) const { if((index >= 0) && (index < 8)) { return this->impl->GamePad[index]; } else { throw std::out_of_range("Game pad index out of range"); } } // ------------------------------------------------------------------------------------------- // Devices::GamePad &WinRTInputManager::GetGamePad(std::size_t index) { if((index >= 0) && (index < 8)) { return this->impl->GamePad[index]; } else { throw std::out_of_range("Game pad index out of range"); } } // ------------------------------------------------------------------------------------------- // std::size_t WinRTInputManager::CountTouchPanels() const { return 1; } // ------------------------------------------------------------------------------------------- // const Devices::TouchPanel &WinRTInputManager::GetTouchPanel(std::size_t index) const { if(index == 0) { return this->impl->TouchPanel; } else { throw std::out_of_range("Touch panel index out of range"); } } // ------------------------------------------------------------------------------------------- // Devices::TouchPanel &WinRTInputManager::GetTouchPanel(std::size_t index) { if(index == 0) { return this->impl->TouchPanel; } else { throw std::out_of_range("Touch panel index out of range"); } } // ------------------------------------------------------------------------------------------- // }} // namespace Nuclex::Input #endif // defined(NUCLEX_INPUT_WINRT)