summaryrefslogtreecommitdiff
path: root/src/common/emu_window.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 @@
30 * - DO NOT TREAT THIS CLASS AS A GUI TOOLKIT ABSTRACTION LAYER. That's not what it is. Please 30 * - DO NOT TREAT THIS CLASS AS A GUI TOOLKIT ABSTRACTION LAYER. That's not what it is. Please
31 * re-read the upper points again and think about it if you don't see this. 31 * re-read the upper points again and think about it if you don't see this.
32 */ 32 */
33class EmuWindow 33class EmuWindow {
34{
35public: 34public:
36 /// Data structure to store emuwindow configuration 35 /// Data structure to store emuwindow configuration
37 struct WindowConfig { 36 struct WindowConfig {
38 bool fullscreen; 37 bool fullscreen;
39 int res_width; 38 int res_width;
40 int res_height; 39 int res_height;
41 std::pair<unsigned,unsigned> min_client_area_size; 40 std::pair<unsigned, unsigned> min_client_area_size;
42 }; 41 };
43 42
44 /// Describes the layout of the window framebuffer (size and top/bottom screen positions) 43 /// Describes the layout of the window framebuffer (size and top/bottom screen positions)
@@ -193,15 +192,18 @@ public:
193 192
194 /** 193 /**
195 * Returns currently active configuration. 194 * Returns currently active configuration.
196 * @note Accesses to the returned object need not be consistent because it may be modified in another thread 195 * @note Accesses to the returned object need not be consistent because it may be modified in
196 * another thread
197 */ 197 */
198 const WindowConfig& GetActiveConfig() const { 198 const WindowConfig& GetActiveConfig() const {
199 return active_config; 199 return active_config;
200 } 200 }
201 201
202 /** 202 /**
203 * Requests the internal configuration to be replaced by the specified argument at some point in the future. 203 * Requests the internal configuration to be replaced by the specified argument at some point in
204 * @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. 204 * the future.
205 * @note This method is thread-safe, because it delays configuration changes to the GUI event
206 * loop. Hence there is no guarantee on when the requested configuration will be active.
205 */ 207 */
206 void SetConfig(const WindowConfig& val) { 208 void SetConfig(const WindowConfig& val) {
207 config = val; 209 config = val;
@@ -227,7 +229,8 @@ protected:
227 circle_pad_y = 0; 229 circle_pad_y = 0;
228 touch_pressed = false; 230 touch_pressed = false;
229 } 231 }
230 virtual ~EmuWindow() {} 232 virtual ~EmuWindow() {
233 }
231 234
232 /** 235 /**
233 * Processes any pending configuration changes from the last SetConfig call. 236 * Processes any pending configuration changes from the last SetConfig call.
@@ -258,7 +261,7 @@ protected:
258 * Update internal client area size with the given parameter. 261 * Update internal client area size with the given parameter.
259 * @note EmuWindow implementations will usually use this in window resize event handlers. 262 * @note EmuWindow implementations will usually use this in window resize event handlers.
260 */ 263 */
261 void NotifyClientAreaSizeChanged(const std::pair<unsigned,unsigned>& size) { 264 void NotifyClientAreaSizeChanged(const std::pair<unsigned, unsigned>& size) {
262 client_area_width = size.first; 265 client_area_width = size.first;
263 client_area_height = size.second; 266 client_area_height = size.second;
264 } 267 }
@@ -266,32 +269,35 @@ protected:
266private: 269private:
267 /** 270 /**
268 * Handler called when the minimal client area was requested to be changed via SetConfig. 271 * Handler called when the minimal client area was requested to be changed via SetConfig.
269 * For the request to be honored, EmuWindow implementations will usually reimplement this function. 272 * For the request to be honored, EmuWindow implementations will usually reimplement this
273 * function.
270 */ 274 */
271 virtual void OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) { 275 virtual void
276 OnMinimalClientAreaChangeRequest(const std::pair<unsigned, unsigned>& minimal_size) {
272 // By default, ignore this request and do nothing. 277 // By default, ignore this request and do nothing.
273 } 278 }
274 279
275 FramebufferLayout framebuffer_layout; ///< Current framebuffer layout 280 FramebufferLayout framebuffer_layout; ///< Current framebuffer layout
276 281
277 unsigned client_area_width; ///< Current client width, should be set by window impl. 282 unsigned client_area_width; ///< Current client width, should be set by window impl.
278 unsigned client_area_height; ///< Current client height, should be set by window impl. 283 unsigned client_area_height; ///< Current client height, should be set by window impl.
279 284
280 WindowConfig config; ///< Internal configuration (changes pending for being applied in ProcessConfigurationChanges) 285 WindowConfig config; ///< Internal configuration (changes pending for being applied in
281 WindowConfig active_config; ///< Internal active configuration 286 /// ProcessConfigurationChanges)
287 WindowConfig active_config; ///< Internal active configuration
282 288
283 bool touch_pressed; ///< True if touchpad area is currently pressed, otherwise false 289 bool touch_pressed; ///< True if touchpad area is currently pressed, otherwise false
284 290
285 u16 touch_x; ///< Touchpad X-position in native 3DS pixel coordinates (0-320) 291 u16 touch_x; ///< Touchpad X-position in native 3DS pixel coordinates (0-320)
286 u16 touch_y; ///< Touchpad Y-position in native 3DS pixel coordinates (0-240) 292 u16 touch_y; ///< Touchpad Y-position in native 3DS pixel coordinates (0-240)
287 293
288 s16 circle_pad_x; ///< Circle pad X-position in native 3DS pixel coordinates (-156 - 156) 294 s16 circle_pad_x; ///< Circle pad X-position in native 3DS pixel coordinates (-156 - 156)
289 s16 circle_pad_y; ///< Circle pad Y-position in native 3DS pixel coordinates (-156 - 156) 295 s16 circle_pad_y; ///< Circle pad Y-position in native 3DS pixel coordinates (-156 - 156)
290 296
291 /** 297 /**
292 * Clip the provided coordinates to be inside the touchscreen area. 298 * Clip the provided coordinates to be inside the touchscreen area.
293 */ 299 */
294 std::tuple<unsigned,unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y); 300 std::tuple<unsigned, unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y);
295 301
296 Service::HID::PadState pad_state; 302 Service::HID::PadState pad_state;
297}; 303};