summaryrefslogtreecommitdiffstats
path: root/src/common/emu_window.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/common/emu_window.h
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Diffstat (limited to 'src/common/emu_window.h')
-rw-r--r--src/common/emu_window.h54
1 files changed, 30 insertions, 24 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h
index 57e303b6d..de8badd4f 100644
--- a/src/common/emu_window.h
+++ b/src/common/emu_window.h
@@ -30,15 +30,14 @@
* - DO NOT TREAT THIS CLASS AS A GUI TOOLKIT ABSTRACTION LAYER. That's not what it is. Please
* re-read the upper points again and think about it if you don't see this.
*/
-class EmuWindow
-{
+class EmuWindow {
public:
/// Data structure to store emuwindow configuration
struct WindowConfig {
- bool fullscreen;
- int res_width;
- int res_height;
- std::pair<unsigned,unsigned> min_client_area_size;
+ bool fullscreen;
+ int res_width;
+ int res_height;
+ std::pair<unsigned, unsigned> min_client_area_size;
};
/// Describes the layout of the window framebuffer (size and top/bottom screen positions)
@@ -193,15 +192,18 @@ public:
/**
* Returns currently active configuration.
- * @note Accesses to the returned object need not be consistent because it may be modified in another thread
+ * @note Accesses to the returned object need not be consistent because it may be modified in
+ * another thread
*/
const WindowConfig& GetActiveConfig() const {
return active_config;
}
/**
- * Requests the internal configuration to be replaced by the specified argument at some point in the future.
- * @note This method is thread-safe, because it delays configuration changes to the GUI event loop. Hence there is no guarantee on when the requested configuration will be active.
+ * Requests the internal configuration to be replaced by the specified argument at some point in
+ * the future.
+ * @note This method is thread-safe, because it delays configuration changes to the GUI event
+ * loop. Hence there is no guarantee on when the requested configuration will be active.
*/
void SetConfig(const WindowConfig& val) {
config = val;
@@ -227,7 +229,8 @@ protected:
circle_pad_y = 0;
touch_pressed = false;
}
- virtual ~EmuWindow() {}
+ virtual ~EmuWindow() {
+ }
/**
* Processes any pending configuration changes from the last SetConfig call.
@@ -258,7 +261,7 @@ protected:
* Update internal client area size with the given parameter.
* @note EmuWindow implementations will usually use this in window resize event handlers.
*/
- void NotifyClientAreaSizeChanged(const std::pair<unsigned,unsigned>& size) {
+ void NotifyClientAreaSizeChanged(const std::pair<unsigned, unsigned>& size) {
client_area_width = size.first;
client_area_height = size.second;
}
@@ -266,32 +269,35 @@ protected:
private:
/**
* Handler called when the minimal client area was requested to be changed via SetConfig.
- * For the request to be honored, EmuWindow implementations will usually reimplement this function.
+ * For the request to be honored, EmuWindow implementations will usually reimplement this
+ * function.
*/
- virtual void OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) {
+ virtual void
+ OnMinimalClientAreaChangeRequest(const std::pair<unsigned, unsigned>& minimal_size) {
// By default, ignore this request and do nothing.
}
FramebufferLayout framebuffer_layout; ///< Current framebuffer layout
- unsigned client_area_width; ///< Current client width, should be set by window impl.
- unsigned client_area_height; ///< Current client height, should be set by window impl.
+ unsigned client_area_width; ///< Current client width, should be set by window impl.
+ unsigned client_area_height; ///< Current client height, should be set by window impl.
- WindowConfig config; ///< Internal configuration (changes pending for being applied in ProcessConfigurationChanges)
- WindowConfig active_config; ///< Internal active configuration
+ WindowConfig config; ///< Internal configuration (changes pending for being applied in
+ /// ProcessConfigurationChanges)
+ WindowConfig active_config; ///< Internal active configuration
- bool touch_pressed; ///< True if touchpad area is currently pressed, otherwise false
+ bool touch_pressed; ///< True if touchpad area is currently pressed, otherwise false
- u16 touch_x; ///< Touchpad X-position in native 3DS pixel coordinates (0-320)
- u16 touch_y; ///< Touchpad Y-position in native 3DS pixel coordinates (0-240)
+ u16 touch_x; ///< Touchpad X-position in native 3DS pixel coordinates (0-320)
+ u16 touch_y; ///< Touchpad Y-position in native 3DS pixel coordinates (0-240)
s16 circle_pad_x; ///< Circle pad X-position in native 3DS pixel coordinates (-156 - 156)
s16 circle_pad_y; ///< Circle pad Y-position in native 3DS pixel coordinates (-156 - 156)
- /**
- * Clip the provided coordinates to be inside the touchscreen area.
- */
- std::tuple<unsigned,unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y);
+ /**
+ * Clip the provided coordinates to be inside the touchscreen area.
+ */
+ std::tuple<unsigned, unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y);
Service::HID::PadState pad_state;
};