aboutsummaryrefslogtreecommitdiff
path: root/src/common/emu_window.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/emu_window.h')
-rw-r--r--src/common/emu_window.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h
index 5e2c33d7a..4d09acb8b 100644
--- a/src/common/emu_window.h
+++ b/src/common/emu_window.h
@@ -6,6 +6,8 @@
#include "common/common.h"
#include "common/scm_rev.h"
+#include "common/string_util.h"
+#include "common/key_map.h"
// Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL,
// QGLWidget, GLFW, etc...)
@@ -14,7 +16,7 @@ class EmuWindow
public:
/// Data structure to store an emuwindow configuration
- struct Config{
+ struct WindowConfig {
bool fullscreen;
int res_width;
int res_height;
@@ -32,11 +34,19 @@ public:
/// Releases (dunno if this is the "right" word) the GLFW context from the caller thread
virtual void DoneCurrent() = 0;
- Config GetConfig() const {
+ virtual void ReloadSetKeymaps() = 0;
+
+ /// Signals a key press action to the HID module
+ static void KeyPressed(KeyMap::HostDeviceKey key);
+
+ /// Signals a key release action to the HID module
+ static void KeyReleased(KeyMap::HostDeviceKey key);
+
+ WindowConfig GetConfig() const {
return m_config;
}
- void SetConfig(const Config& val) {
+ void SetConfig(const WindowConfig& val) {
m_config = val;
}
@@ -65,11 +75,11 @@ public:
}
protected:
- EmuWindow() : m_client_area_width(640), m_client_area_height(480) {
- char window_title[255];
- sprintf(window_title, "Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
- m_window_title = window_title;
- }
+ EmuWindow():
+ m_client_area_width(640),
+ m_client_area_height(480),
+ m_window_title(Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc))
+ {}
virtual ~EmuWindow() {}
std::string m_window_title; ///< Current window title, should be used by window impl.
@@ -78,6 +88,6 @@ protected:
int m_client_area_height; ///< Current client height, should be set by window impl.
private:
- Config m_config; ///< Internal configuration
+ WindowConfig m_config; ///< Internal configuration
};