2013-03-10 22:08:57 +00:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program 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
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
#include "../Core/Host.h"
|
2012-11-12 17:32:35 +00:00
|
|
|
#include "InputDevice.h"
|
2018-03-22 21:14:19 +00:00
|
|
|
#include "Common/CommonWindows.h"
|
2012-11-12 17:32:35 +00:00
|
|
|
#include <list>
|
|
|
|
#include <memory>
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2017-01-16 12:08:26 +00:00
|
|
|
extern float g_mouseDeltaX;
|
|
|
|
extern float g_mouseDeltaY;
|
2013-08-12 21:26:01 +00:00
|
|
|
|
2014-09-20 19:55:58 +00:00
|
|
|
class WindowsHost : public Host {
|
2012-11-01 15:19:01 +00:00
|
|
|
public:
|
2015-12-31 15:59:40 +00:00
|
|
|
WindowsHost(HINSTANCE hInstance, HWND mainWindow, HWND displayWindow);
|
2014-06-29 20:13:53 +00:00
|
|
|
|
2014-09-20 19:55:58 +00:00
|
|
|
~WindowsHost() {
|
2013-06-26 07:32:49 +00:00
|
|
|
UpdateConsolePosition();
|
|
|
|
}
|
|
|
|
|
2017-03-15 05:01:18 +00:00
|
|
|
void PollControllers() override;
|
2014-09-20 19:55:58 +00:00
|
|
|
|
|
|
|
void UpdateSound() override;
|
|
|
|
|
|
|
|
bool AttemptLoadSymbolMap() override;
|
|
|
|
void SaveSymbolMap() override;
|
|
|
|
void SetWindowTitle(const char *message) override;
|
|
|
|
|
|
|
|
void ToggleDebugConsoleVisibility() override;
|
|
|
|
|
|
|
|
bool CreateDesktopShortcut(std::string argumentPath, std::string title) override;
|
|
|
|
|
2016-05-28 05:00:14 +00:00
|
|
|
void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override;
|
2017-12-09 22:11:39 +00:00
|
|
|
void SendUIMessage(const std::string &message, const std::string &value) override;
|
2016-05-28 05:00:14 +00:00
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
private:
|
2013-06-26 07:32:49 +00:00
|
|
|
void SetConsolePosition();
|
|
|
|
void UpdateConsolePosition();
|
|
|
|
|
2015-12-31 15:59:40 +00:00
|
|
|
HINSTANCE hInstance_;
|
2014-06-29 20:13:53 +00:00
|
|
|
HWND displayWindow_;
|
|
|
|
HWND mainWindow_;
|
2018-10-09 04:21:37 +00:00
|
|
|
size_t numDinputDevices_ = 0;
|
2020-08-18 08:07:12 +00:00
|
|
|
std::wstring lastTitle_;
|
2013-07-06 17:08:59 +00:00
|
|
|
|
2019-06-28 22:55:45 +00:00
|
|
|
std::list<std::unique_ptr<InputDevice>> input;
|
2013-08-06 23:38:54 +00:00
|
|
|
};
|