From 27eb83c981cf03a8a9893a46eda668e273c7b5c3 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 10 Jan 2025 20:11:56 -0500 Subject: [PATCH] refactor: replace SInt32 with int32_t --- src/lib/client/Client.cpp | 14 +-- src/lib/client/Client.h | 14 +-- src/lib/client/ServerProxy.cpp | 2 +- src/lib/client/ServerProxy.h | 4 +- src/lib/common/basic_types.h | 1 - src/lib/deskflow/Clipboard.cpp | 2 +- src/lib/deskflow/IClient.h | 14 +-- src/lib/deskflow/IClipboard.cpp | 2 +- src/lib/deskflow/IKeyState.cpp | 4 +- src/lib/deskflow/IKeyState.h | 10 +- src/lib/deskflow/IPlatformScreen.h | 20 ++-- src/lib/deskflow/IPrimaryScreen.cpp | 4 +- src/lib/deskflow/IPrimaryScreen.h | 18 +-- src/lib/deskflow/IScreen.h | 4 +- src/lib/deskflow/ISecondaryScreen.h | 6 +- src/lib/deskflow/KeyMap.cpp | 96 ++++++++-------- src/lib/deskflow/KeyMap.h | 48 ++++---- src/lib/deskflow/KeyState.cpp | 18 +-- src/lib/deskflow/KeyState.h | 22 ++-- src/lib/deskflow/PlatformScreen.cpp | 6 +- src/lib/deskflow/PlatformScreen.h | 22 ++-- src/lib/deskflow/ProtocolUtil.h | 6 +- src/lib/deskflow/Screen.cpp | 18 +-- src/lib/deskflow/Screen.h | 18 +-- src/lib/deskflow/key_types.h | 2 +- src/lib/deskflow/option_types.h | 2 +- src/lib/deskflow/protocol_types.h | 8 +- .../MSWindowsClipboardHTMLConverter.cpp | 4 +- src/lib/platform/MSWindowsDesks.cpp | 22 ++-- src/lib/platform/MSWindowsDesks.h | 20 ++-- src/lib/platform/MSWindowsHook.cpp | 20 ++-- src/lib/platform/MSWindowsHook.h | 2 +- src/lib/platform/MSWindowsKeyState.cpp | 16 +-- src/lib/platform/MSWindowsKeyState.h | 10 +- src/lib/platform/MSWindowsScreen.cpp | 46 ++++---- src/lib/platform/MSWindowsScreen.h | 34 +++--- src/lib/platform/OSXKeyState.cpp | 16 +-- src/lib/platform/OSXKeyState.h | 10 +- src/lib/platform/OSXScreen.h | 36 +++--- src/lib/platform/OSXScreen.mm | 60 +++++----- src/lib/platform/XWindowsClipboard.cpp | 14 +-- src/lib/platform/XWindowsClipboard.h | 40 +++---- .../XWindowsClipboardAnyBitmapConverter.cpp | 22 ++-- src/lib/platform/XWindowsKeyState.cpp | 12 +- src/lib/platform/XWindowsKeyState.h | 14 +-- src/lib/platform/XWindowsScreen.cpp | 30 ++--- src/lib/platform/XWindowsScreen.h | 28 ++--- src/lib/platform/XWindowsScreenSaver.h | 2 +- src/lib/platform/XWindowsUtil.cpp | 6 +- src/lib/platform/XWindowsUtil.h | 4 +- src/lib/server/BaseClientProxy.cpp | 4 +- src/lib/server/BaseClientProxy.h | 20 ++-- src/lib/server/ClientProxy.h | 14 +-- src/lib/server/ClientProxy1_0.cpp | 14 +-- src/lib/server/ClientProxy1_0.h | 14 +-- src/lib/server/ClientProxy1_1.cpp | 4 +- src/lib/server/ClientProxy1_1.h | 2 +- src/lib/server/ClientProxy1_2.cpp | 2 +- src/lib/server/ClientProxy1_2.h | 2 +- src/lib/server/ClientProxy1_3.cpp | 2 +- src/lib/server/ClientProxy1_3.h | 2 +- src/lib/server/ClientProxy1_4.cpp | 4 +- src/lib/server/ClientProxy1_4.h | 2 +- src/lib/server/Config.cpp | 2 +- src/lib/server/Config.h | 4 +- src/lib/server/PrimaryClient.cpp | 18 +-- src/lib/server/PrimaryClient.h | 20 ++-- src/lib/server/Server.cpp | 106 +++++++++--------- src/lib/server/Server.h | 44 ++++---- src/test/integtests/net/NetworkTests.cpp | 8 +- .../platform/XWindowsKeyStateTests.cpp | 6 +- src/test/mock/deskflow/MockKeyMap.h | 2 +- src/test/mock/deskflow/MockKeyState.h | 4 +- src/test/mock/deskflow/MockScreen.h | 4 +- src/test/mock/server/MockPrimaryClient.h | 4 +- src/test/unittests/client/HelloBackTests.cpp | 4 +- src/test/unittests/deskflow/KeyStateTests.cpp | 4 +- 77 files changed, 586 insertions(+), 583 deletions(-) diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index 09895ba02..d4204cefc 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -240,17 +240,17 @@ bool Client::getClipboard(ClipboardID id, IClipboard *clipboard) const return m_screen->getClipboard(id, clipboard); } -void Client::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const +void Client::getShape(int32_t &x, int32_t &y, int32_t &w, int32_t &h) const { m_screen->getShape(x, y, w, h); } -void Client::getCursorPos(SInt32 &x, SInt32 &y) const +void Client::getCursorPos(int32_t &x, int32_t &y) const { m_screen->getCursorPos(x, y); } -void Client::enter(SInt32 xAbs, SInt32 yAbs, UInt32, KeyModifierMask mask, bool) +void Client::enter(int32_t xAbs, int32_t yAbs, UInt32, KeyModifierMask mask, bool) { m_active = true; m_screen->mouseMove(xAbs, yAbs); @@ -304,7 +304,7 @@ void Client::keyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std m_screen->keyDown(id, mask, button, lang); } -void Client::keyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang) +void Client::keyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) { m_screen->keyRepeat(id, mask, count, button, lang); } @@ -324,17 +324,17 @@ void Client::mouseUp(ButtonID id) m_screen->mouseUp(id); } -void Client::mouseMove(SInt32 x, SInt32 y) +void Client::mouseMove(int32_t x, int32_t y) { m_screen->mouseMove(x, y); } -void Client::mouseRelativeMove(SInt32 dx, SInt32 dy) +void Client::mouseRelativeMove(int32_t dx, int32_t dy) { m_screen->mouseRelativeMove(dx, dy); } -void Client::mouseWheel(SInt32 xDelta, SInt32 yDelta) +void Client::mouseWheel(int32_t xDelta, int32_t yDelta) { m_screen->mouseWheel(xDelta, yDelta); } diff --git a/src/lib/client/Client.h b/src/lib/client/Client.h index 799c71d6e..ec01cc9c3 100644 --- a/src/lib/client/Client.h +++ b/src/lib/client/Client.h @@ -173,23 +173,23 @@ public: // IScreen overrides virtual void *getEventTarget() const; virtual bool getClipboard(ClipboardID id, IClipboard *) const; - virtual void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const; - virtual void getCursorPos(SInt32 &x, SInt32 &y) const; + virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const; + virtual void getCursorPos(int32_t &x, int32_t &y) const; // IClient overrides - virtual void enter(SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver); + virtual void enter(int32_t xAbs, int32_t yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver); virtual bool leave(); virtual void setClipboard(ClipboardID, const IClipboard *); virtual void grabClipboard(ClipboardID); virtual void setClipboardDirty(ClipboardID, bool); virtual void keyDown(KeyID, KeyModifierMask, KeyButton, const std::string &); - virtual void keyRepeat(KeyID, KeyModifierMask, SInt32 count, KeyButton, const std::string &lang); + virtual void keyRepeat(KeyID, KeyModifierMask, int32_t count, KeyButton, const std::string &lang); virtual void keyUp(KeyID, KeyModifierMask, KeyButton); virtual void mouseDown(ButtonID); virtual void mouseUp(ButtonID); - virtual void mouseMove(SInt32 xAbs, SInt32 yAbs); - virtual void mouseRelativeMove(SInt32 xRel, SInt32 yRel); - virtual void mouseWheel(SInt32 xDelta, SInt32 yDelta); + virtual void mouseMove(int32_t xAbs, int32_t yAbs); + virtual void mouseRelativeMove(int32_t xRel, int32_t yRel); + virtual void mouseWheel(int32_t xDelta, int32_t yDelta); virtual void screensaver(bool activate); virtual void resetOptions(); virtual void setOptions(const OptionsList &options); diff --git a/src/lib/client/ServerProxy.cpp b/src/lib/client/ServerProxy.cpp index 7889f5964..8aa98104b 100644 --- a/src/lib/client/ServerProxy.cpp +++ b/src/lib/client/ServerProxy.cpp @@ -193,7 +193,7 @@ ServerProxy::EResult ServerProxy::parseHandshakeMessage(const uint8_t *code) } else if (memcmp(code, kMsgEIncompatible, 4) == 0) { - SInt32 major, minor; + int32_t major, minor; ProtocolUtil::readf(m_stream, kMsgEIncompatible + 4, &major, &minor); LOG((CLOG_ERR "server has incompatible version %d.%d", major, minor)); m_client->refuseConnection("server has incompatible version"); diff --git a/src/lib/client/ServerProxy.h b/src/lib/client/ServerProxy.h index bc9fb62d9..abbeb6c51 100644 --- a/src/lib/client/ServerProxy.h +++ b/src/lib/client/ServerProxy.h @@ -138,8 +138,8 @@ private: bool m_compressMouse; bool m_compressMouseRelative; - SInt32 m_xMouse, m_yMouse; - SInt32 m_dxMouse, m_dyMouse; + int32_t m_xMouse, m_yMouse; + int32_t m_dxMouse, m_dyMouse; bool m_ignoreMouse; diff --git a/src/lib/common/basic_types.h b/src/lib/common/basic_types.h index 43c8ebf13..6d7501647 100644 --- a/src/lib/common/basic_types.h +++ b/src/lib/common/basic_types.h @@ -84,7 +84,6 @@ #if defined(__APPLE__) #include #else -using SInt32 = signed TYPE_OF_SIZE_4; using UInt32 = unsigned TYPE_OF_SIZE_4; #endif #endif diff --git a/src/lib/deskflow/Clipboard.cpp b/src/lib/deskflow/Clipboard.cpp index a3326be89..e472d0380 100644 --- a/src/lib/deskflow/Clipboard.cpp +++ b/src/lib/deskflow/Clipboard.cpp @@ -39,7 +39,7 @@ bool Clipboard::empty() assert(m_open); // clear all data - for (SInt32 index = 0; index < kNumFormats; ++index) { + for (int32_t index = 0; index < kNumFormats; ++index) { m_data[index] = ""; m_added[index] = false; } diff --git a/src/lib/deskflow/IClient.h b/src/lib/deskflow/IClient.h index cba1ecaaf..9491d6b83 100644 --- a/src/lib/deskflow/IClient.h +++ b/src/lib/deskflow/IClient.h @@ -45,7 +45,7 @@ public: screen is being entered because the screen saver is starting. Subsequent clipboard events should report \p seqNum. */ - virtual void enter(SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) = 0; + virtual void enter(int32_t xAbs, int32_t yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) = 0; //! Leave screen /*! @@ -94,7 +94,7 @@ public: Synthesize key events to generate a press and release of key \c id \c count times. If possible match the given modifier mask. */ - virtual void keyRepeat(KeyID id, KeyModifierMask, SInt32 count, KeyButton, const std::string &lang) = 0; + virtual void keyRepeat(KeyID id, KeyModifierMask, int32_t count, KeyButton, const std::string &lang) = 0; //! Notify of key release /*! @@ -120,14 +120,14 @@ public: Synthesize mouse events to generate mouse motion to the absolute screen position \c xAbs,yAbs. */ - virtual void mouseMove(SInt32 xAbs, SInt32 yAbs) = 0; + virtual void mouseMove(int32_t xAbs, int32_t yAbs) = 0; //! Notify of mouse motion /*! Synthesize mouse events to generate mouse motion by the relative amount \c xRel,yRel. */ - virtual void mouseRelativeMove(SInt32 xRel, SInt32 yRel) = 0; + virtual void mouseRelativeMove(int32_t xRel, int32_t yRel) = 0; //! Notify of mouse wheel motion /*! @@ -136,7 +136,7 @@ public: to the right and negative for motion towards the user or to the left. Each wheel click should generate a delta of +/-120. */ - virtual void mouseWheel(SInt32 xDelta, SInt32 yDelta) = 0; + virtual void mouseWheel(int32_t xDelta, int32_t yDelta) = 0; //! Notify of screen saver change virtual void screensaver(bool activate) = 0; @@ -169,6 +169,6 @@ public: // IScreen overrides virtual void *getEventTarget() const = 0; virtual bool getClipboard(ClipboardID id, IClipboard *) const = 0; - virtual void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const = 0; - virtual void getCursorPos(SInt32 &x, SInt32 &y) const = 0; + virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const = 0; + virtual void getCursorPos(int32_t &x, int32_t &y) const = 0; }; diff --git a/src/lib/deskflow/IClipboard.cpp b/src/lib/deskflow/IClipboard.cpp index 22da1c716..5480a9856 100644 --- a/src/lib/deskflow/IClipboard.cpp +++ b/src/lib/deskflow/IClipboard.cpp @@ -125,7 +125,7 @@ bool IClipboard::copy(IClipboard *dst, const IClipboard *src, Time time) if (src->open(time)) { if (dst->open(time)) { if (dst->empty()) { - for (SInt32 format = 0; format != IClipboard::kNumFormats; ++format) { + for (int32_t format = 0; format != IClipboard::kNumFormats; ++format) { IClipboard::EFormat eFormat = (IClipboard::EFormat)format; if (src->has(eFormat)) { dst->add(eFormat, src->get(eFormat)); diff --git a/src/lib/deskflow/IKeyState.cpp b/src/lib/deskflow/IKeyState.cpp index d52522f89..940d5bf28 100644 --- a/src/lib/deskflow/IKeyState.cpp +++ b/src/lib/deskflow/IKeyState.cpp @@ -34,7 +34,7 @@ IKeyState::IKeyState(IEventQueue *events) // IKeyState::KeyInfo // -IKeyState::KeyInfo *IKeyState::KeyInfo::alloc(KeyID id, KeyModifierMask mask, KeyButton button, SInt32 count) +IKeyState::KeyInfo *IKeyState::KeyInfo::alloc(KeyID id, KeyModifierMask mask, KeyButton button, int32_t count) { KeyInfo *info = (KeyInfo *)malloc(sizeof(KeyInfo)); info->m_key = id; @@ -47,7 +47,7 @@ IKeyState::KeyInfo *IKeyState::KeyInfo::alloc(KeyID id, KeyModifierMask mask, Ke } IKeyState::KeyInfo *IKeyState::KeyInfo::alloc( - KeyID id, KeyModifierMask mask, KeyButton button, SInt32 count, const std::set &destinations + KeyID id, KeyModifierMask mask, KeyButton button, int32_t count, const std::set &destinations ) { std::string screens = join(destinations); diff --git a/src/lib/deskflow/IKeyState.h b/src/lib/deskflow/IKeyState.h index 287cc03aa..2cbf33c0c 100644 --- a/src/lib/deskflow/IKeyState.h +++ b/src/lib/deskflow/IKeyState.h @@ -44,8 +44,8 @@ public: class KeyInfo { public: - static KeyInfo *alloc(KeyID, KeyModifierMask, KeyButton, SInt32 count); - static KeyInfo *alloc(KeyID, KeyModifierMask, KeyButton, SInt32 count, const std::set &destinations); + static KeyInfo *alloc(KeyID, KeyModifierMask, KeyButton, int32_t count); + static KeyInfo *alloc(KeyID, KeyModifierMask, KeyButton, int32_t count, const std::set &destinations); static KeyInfo *alloc(const KeyInfo &); static bool isDefault(const char *screens); @@ -58,7 +58,7 @@ public: KeyID m_key; KeyModifierMask m_mask; KeyButton m_button; - SInt32 m_count; + int32_t m_count; char *m_screens; char m_screensBuffer[1]; }; @@ -101,7 +101,7 @@ public: Synthesizes a key repeat event and updates the key state. */ virtual bool - fakeKeyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang) = 0; + fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) = 0; //! Fake a key release /*! @@ -159,7 +159,7 @@ public: /*! Returns the active keyboard layout according to the operating system. */ - virtual SInt32 pollActiveGroup() const = 0; + virtual int32_t pollActiveGroup() const = 0; //! Get the keys currently pressed from OS /*! diff --git a/src/lib/deskflow/IPlatformScreen.h b/src/lib/deskflow/IPlatformScreen.h index 46502ba09..fe80a8c32 100644 --- a/src/lib/deskflow/IPlatformScreen.h +++ b/src/lib/deskflow/IPlatformScreen.h @@ -163,25 +163,25 @@ public: // IScreen overrides virtual void *getEventTarget() const = 0; virtual bool getClipboard(ClipboardID id, IClipboard *) const = 0; - virtual void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const = 0; - virtual void getCursorPos(SInt32 &x, SInt32 &y) const = 0; + virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const = 0; + virtual void getCursorPos(int32_t &x, int32_t &y) const = 0; // IPrimaryScreen overrides virtual void reconfigure(UInt32 activeSides) = 0; - virtual void warpCursor(SInt32 x, SInt32 y) = 0; + virtual void warpCursor(int32_t x, int32_t y) = 0; virtual UInt32 registerHotKey(KeyID key, KeyModifierMask mask) = 0; virtual void unregisterHotKey(UInt32 id) = 0; virtual void fakeInputBegin() = 0; virtual void fakeInputEnd() = 0; - virtual SInt32 getJumpZoneSize() const = 0; + virtual int32_t getJumpZoneSize() const = 0; virtual bool isAnyMouseButtonDown(UInt32 &buttonID) const = 0; - virtual void getCursorCenter(SInt32 &x, SInt32 &y) const = 0; + virtual void getCursorCenter(int32_t &x, int32_t &y) const = 0; // ISecondaryScreen overrides virtual void fakeMouseButton(ButtonID id, bool press) = 0; - virtual void fakeMouseMove(SInt32 x, SInt32 y) = 0; - virtual void fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const = 0; - virtual void fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const = 0; + virtual void fakeMouseMove(int32_t x, int32_t y) = 0; + virtual void fakeMouseRelativeMove(int32_t dx, int32_t dy) const = 0; + virtual void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const = 0; // IKeyState overrides virtual void updateKeyMap() = 0; @@ -189,7 +189,7 @@ public: virtual void setHalfDuplexMask(KeyModifierMask) = 0; virtual void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang) = 0; virtual bool - fakeKeyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang) = 0; + fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) = 0; virtual bool fakeKeyUp(KeyButton button) = 0; virtual void fakeAllKeysUp() = 0; virtual bool fakeCtrlAltDel() = 0; @@ -197,7 +197,7 @@ public: virtual bool isKeyDown(KeyButton) const = 0; virtual KeyModifierMask getActiveModifiers() const = 0; virtual KeyModifierMask pollActiveModifiers() const = 0; - virtual SInt32 pollActiveGroup() const = 0; + virtual int32_t pollActiveGroup() const = 0; virtual void pollPressedKeys(KeyButtonSet &pressedKeys) const = 0; virtual std::string &getDraggingFilename() = 0; diff --git a/src/lib/deskflow/IPrimaryScreen.cpp b/src/lib/deskflow/IPrimaryScreen.cpp index 255f7a590..9edb41c59 100644 --- a/src/lib/deskflow/IPrimaryScreen.cpp +++ b/src/lib/deskflow/IPrimaryScreen.cpp @@ -50,7 +50,7 @@ bool IPrimaryScreen::ButtonInfo::equal(const ButtonInfo *a, const ButtonInfo *b) // IPrimaryScreen::MotionInfo // -IPrimaryScreen::MotionInfo *IPrimaryScreen::MotionInfo::alloc(SInt32 x, SInt32 y) +IPrimaryScreen::MotionInfo *IPrimaryScreen::MotionInfo::alloc(int32_t x, int32_t y) { MotionInfo *info = (MotionInfo *)malloc(sizeof(MotionInfo)); info->m_x = x; @@ -62,7 +62,7 @@ IPrimaryScreen::MotionInfo *IPrimaryScreen::MotionInfo::alloc(SInt32 x, SInt32 y // IPrimaryScreen::WheelInfo // -IPrimaryScreen::WheelInfo *IPrimaryScreen::WheelInfo::alloc(SInt32 xDelta, SInt32 yDelta) +IPrimaryScreen::WheelInfo *IPrimaryScreen::WheelInfo::alloc(int32_t xDelta, int32_t yDelta) { WheelInfo *info = (WheelInfo *)malloc(sizeof(WheelInfo)); info->m_xDelta = xDelta; diff --git a/src/lib/deskflow/IPrimaryScreen.h b/src/lib/deskflow/IPrimaryScreen.h index 428083e64..58a326c10 100644 --- a/src/lib/deskflow/IPrimaryScreen.h +++ b/src/lib/deskflow/IPrimaryScreen.h @@ -49,21 +49,21 @@ public: class MotionInfo { public: - static MotionInfo *alloc(SInt32 x, SInt32 y); + static MotionInfo *alloc(int32_t x, int32_t y); public: - SInt32 m_x; - SInt32 m_y; + int32_t m_x; + int32_t m_y; }; //! Wheel motion event data class WheelInfo { public: - static WheelInfo *alloc(SInt32 xDelta, SInt32 yDelta); + static WheelInfo *alloc(int32_t xDelta, int32_t yDelta); public: - SInt32 m_xDelta; - SInt32 m_yDelta; + int32_t m_xDelta; + int32_t m_yDelta; }; //! Hot key event data class HotKeyInfo @@ -102,7 +102,7 @@ public: discard input events up to and including the warp before returning. */ - virtual void warpCursor(SInt32 x, SInt32 y) = 0; + virtual void warpCursor(int32_t x, int32_t y) = 0; //! Register a system hotkey /*! @@ -157,7 +157,7 @@ public: Return the jump zone size, the size of the regions on the edges of the screen that cause the cursor to jump to another screen. */ - virtual SInt32 getJumpZoneSize() const = 0; + virtual int32_t getJumpZoneSize() const = 0; //! Test if mouse is pressed /*! @@ -173,7 +173,7 @@ public: cursor to compute cursor motion deltas and should be far from the edges of the screen, typically the center. */ - virtual void getCursorCenter(SInt32 &x, SInt32 &y) const = 0; + virtual void getCursorCenter(int32_t &x, int32_t &y) const = 0; //@} }; diff --git a/src/lib/deskflow/IScreen.h b/src/lib/deskflow/IScreen.h index 53ae66f1f..ebc1345da 100644 --- a/src/lib/deskflow/IScreen.h +++ b/src/lib/deskflow/IScreen.h @@ -60,13 +60,13 @@ public: Return the position of the upper-left corner of the screen in \c x and \c y and the size of the screen in \c width and \c height. */ - virtual void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const = 0; + virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const = 0; //! Get cursor position /*! Return the current position of the cursor in \c x and \c y. */ - virtual void getCursorPos(SInt32 &x, SInt32 &y) const = 0; + virtual void getCursorPos(int32_t &x, int32_t &y) const = 0; //@} }; diff --git a/src/lib/deskflow/ISecondaryScreen.h b/src/lib/deskflow/ISecondaryScreen.h index 70a7e84a9..064883eac 100644 --- a/src/lib/deskflow/ISecondaryScreen.h +++ b/src/lib/deskflow/ISecondaryScreen.h @@ -44,19 +44,19 @@ public: /*! Synthesize a mouse move to the absolute coordinates \c x,y. */ - virtual void fakeMouseMove(SInt32 x, SInt32 y) = 0; + virtual void fakeMouseMove(int32_t x, int32_t y) = 0; //! Fake mouse move /*! Synthesize a mouse move to the relative coordinates \c dx,dy. */ - virtual void fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const = 0; + virtual void fakeMouseRelativeMove(int32_t dx, int32_t dy) const = 0; //! Fake mouse wheel /*! Synthesize a mouse wheel event of amount \c xDelta and \c yDelta. */ - virtual void fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const = 0; + virtual void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const = 0; //@} }; diff --git a/src/lib/deskflow/KeyMap.cpp b/src/lib/deskflow/KeyMap.cpp index 92009101a..17cbf77d5 100644 --- a/src/lib/deskflow/KeyMap.cpp +++ b/src/lib/deskflow/KeyMap.cpp @@ -57,7 +57,7 @@ void KeyMap::swap(KeyMap &x) m_modifierKeys.swap(x.m_modifierKeys); m_halfDuplex.swap(x.m_halfDuplex); m_halfDuplexMods.swap(x.m_halfDuplexMods); - SInt32 tmp1 = m_numGroups; + int32_t tmp1 = m_numGroups; m_numGroups = x.m_numGroups; x.m_numGroups = tmp1; bool tmp2 = m_composeAcrossGroups; @@ -73,7 +73,7 @@ void KeyMap::addKeyEntry(const KeyItem &item) } // resize number of groups for key - SInt32 numGroups = item.m_group + 1; + int32_t numGroups = item.m_group + 1; if (getNumGroups() > numGroups) { numGroups = getNumGroups(); } @@ -110,7 +110,7 @@ void KeyMap::addKeyEntry(const KeyItem &item) } void KeyMap::addKeyAliasEntry( - KeyID targetID, SInt32 group, KeyModifierMask targetRequired, KeyModifierMask targetSensitive, KeyID sourceID, + KeyID targetID, int32_t group, KeyModifierMask targetRequired, KeyModifierMask targetSensitive, KeyID sourceID, KeyModifierMask sourceRequired, KeyModifierMask sourceSensitive ) { @@ -120,8 +120,8 @@ void KeyMap::addKeyAliasEntry( } // find a compatible source, preferably in the same group - for (SInt32 gd = 0, n = getNumGroups(); gd < n; ++gd) { - SInt32 eg = getEffectiveGroup(group, gd); + for (int32_t gd = 0, n = getNumGroups(); gd < n; ++gd) { + int32_t eg = getEffectiveGroup(group, gd); const KeyItemList *sourceEntry = findCompatibleKey(sourceID, eg, sourceRequired, sourceSensitive); if (sourceEntry != NULL && sourceEntry->size() == 1) { KeyMap::KeyItem targetItem = sourceEntry->back(); @@ -133,14 +133,14 @@ void KeyMap::addKeyAliasEntry( } } -bool KeyMap::addKeyCombinationEntry(KeyID id, SInt32 group, const KeyID *keys, UInt32 numKeys) +bool KeyMap::addKeyCombinationEntry(KeyID id, int32_t group, const KeyID *keys, UInt32 numKeys) { // disallow kKeyNone if (id == kKeyNone) { return false; } - SInt32 numGroups = group + 1; + int32_t numGroups = group + 1; if (getNumGroups() > numGroups) { numGroups = getNumGroups(); } @@ -164,14 +164,14 @@ bool KeyMap::addKeyCombinationEntry(KeyID id, SInt32 group, const KeyID *keys, U // if we allow group switching during composition then search all // groups for keys, otherwise search just the given group. - SInt32 n = 1; + int32_t n = 1; if (m_composeAcrossGroups) { - n = (SInt32)groupTable.size(); + n = (int32_t)groupTable.size(); } bool found = false; - for (SInt32 gd = 0; gd < n && !found; ++gd) { - SInt32 eg = (group + gd) % getNumGroups(); + for (int32_t gd = 0; gd < n && !found; ++gd) { + int32_t eg = (group + gd) % getNumGroups(); const KeyEntryList &entries = groupTable[eg]; for (size_t j = 0; j < entries.size(); ++j) { if (entries[j].size() == 1) { @@ -234,7 +234,7 @@ void KeyMap::foreachKey(ForeachKeyCallback cb, void *userData) for (size_t j = 0; j < entryList.size(); ++j) { KeyItemList &itemList = entryList[j]; for (size_t k = 0; k < itemList.size(); ++k) { - (*cb)(i->first, static_cast(group), itemList[k], userData); + (*cb)(i->first, static_cast(group), itemList[k], userData); } } } @@ -242,7 +242,7 @@ void KeyMap::foreachKey(ForeachKeyCallback cb, void *userData) } const KeyMap::KeyItem *KeyMap::mapKey( - Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + Keystrokes &keys, KeyID id, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ) const { @@ -315,9 +315,9 @@ void KeyMap::setLanguageData(std::vector layouts) m_keyboardLayouts = std::move(layouts); } -SInt32 KeyMap::getLanguageGroupID(SInt32 group, const std::string &lang) const +int32_t KeyMap::getLanguageGroupID(int32_t group, const std::string &lang) const { - SInt32 id = group; + int32_t id = group; auto it = std::find(m_keyboardLayouts.begin(), m_keyboardLayouts.end(), lang); if (it != m_keyboardLayouts.end()) { @@ -330,18 +330,18 @@ SInt32 KeyMap::getLanguageGroupID(SInt32 group, const std::string &lang) const return id; } -SInt32 KeyMap::getNumGroups() const +int32_t KeyMap::getNumGroups() const { return m_numGroups; } -SInt32 KeyMap::getEffectiveGroup(SInt32 group, SInt32 offset) const +int32_t KeyMap::getEffectiveGroup(int32_t group, int32_t offset) const { return (group + offset + getNumGroups()) % getNumGroups(); } const KeyMap::KeyItemList * -KeyMap::findCompatibleKey(KeyID id, SInt32 group, KeyModifierMask required, KeyModifierMask sensitive) const +KeyMap::findCompatibleKey(KeyID id, int32_t group, KeyModifierMask required, KeyModifierMask sensitive) const { assert(group >= 0 && group < getNumGroups()); @@ -442,7 +442,7 @@ void KeyMap::initModifierKey(KeyItem &item) } } -SInt32 KeyMap::findNumGroups() const +int32_t KeyMap::findNumGroups() const { size_t max = 0; for (KeyIDMap::const_iterator i = m_keyIDMap.begin(); i != m_keyIDMap.end(); ++i) { @@ -450,7 +450,7 @@ SInt32 KeyMap::findNumGroups() const max = i->second.size(); } } - return static_cast(max); + return static_cast(max); } void KeyMap::setModifierKeys() @@ -474,10 +474,10 @@ void KeyMap::setModifierKeys() } // add key to each indicated modifier in this group - for (SInt32 b = 0; b < kKeyModifierNumBits; ++b) { + for (int32_t b = 0; b < kKeyModifierNumBits; ++b) { // skip if item doesn't generate bit b if (((1u << b) & item.m_generates) != 0) { - SInt32 mIndex = (SInt32)g * kKeyModifierNumBits + b; + int32_t mIndex = (int32_t)g * kKeyModifierNumBits + b; m_modifierKeys[mIndex].push_back(&item); } } @@ -487,7 +487,7 @@ void KeyMap::setModifierKeys() } const KeyMap::KeyItem *KeyMap::mapCommandKey( - Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + Keystrokes &keys, KeyID id, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ) const { @@ -504,9 +504,9 @@ const KeyMap::KeyItem *KeyMap::mapCommandKey( // find the first key that generates this KeyID const KeyItem *keyItem = NULL; - SInt32 numGroups = getNumGroups(); - for (SInt32 groupOffset = 0; groupOffset < numGroups; ++groupOffset) { - SInt32 effectiveGroup = getEffectiveGroup(group, groupOffset); + int32_t numGroups = getNumGroups(); + for (int32_t groupOffset = 0; groupOffset < numGroups; ++groupOffset) { + int32_t effectiveGroup = getEffectiveGroup(group, groupOffset); const KeyEntryList &entryList = keyGroupTable[effectiveGroup]; for (size_t i = 0; i < entryList.size(); ++i) { if (entryList[i].size() != 1) { @@ -542,7 +542,7 @@ const KeyMap::KeyItem *KeyMap::mapCommandKey( // make working copy of modifiers ModifierToKeys newModifiers = activeModifiers; KeyModifierMask newState = currentState; - SInt32 newGroup = group; + int32_t newGroup = group; // don't try to change CapsLock desiredMask = (desiredMask & ~KeyModifierCapsLock) | (currentState & KeyModifierCapsLock); @@ -571,12 +571,12 @@ const KeyMap::KeyItem *KeyMap::mapCommandKey( } const KeyMap::KeyItemList * -KeyMap::getKeyItemList(const KeyMap::KeyGroupTable &keyGroupTable, SInt32 group, KeyModifierMask desiredMask) const +KeyMap::getKeyItemList(const KeyMap::KeyGroupTable &keyGroupTable, int32_t group, KeyModifierMask desiredMask) const { const KeyItemList *itemList = nullptr; // find best key in any group, starting with the active group - for (SInt32 groupOffset = 0; groupOffset < getNumGroups(); ++groupOffset) { + for (int32_t groupOffset = 0; groupOffset < getNumGroups(); ++groupOffset) { auto effectiveGroup = getEffectiveGroup(group, groupOffset); auto keyIndex = findBestKey(keyGroupTable[effectiveGroup], desiredMask); if (keyIndex != -1) { @@ -590,7 +590,7 @@ KeyMap::getKeyItemList(const KeyMap::KeyGroupTable &keyGroupTable, SInt32 group, } const KeyMap::KeyItem *KeyMap::mapCharacterKey( - Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + Keystrokes &keys, KeyID id, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ) const { @@ -616,7 +616,7 @@ const KeyMap::KeyItem *KeyMap::mapCharacterKey( // make working copy of modifiers ModifierToKeys newModifiers = activeModifiers; KeyModifierMask newState = currentState; - SInt32 newGroup = group; + int32_t newGroup = group; // add each key for (size_t j = 0; j < itemList->size(); ++j) { @@ -641,24 +641,24 @@ const KeyMap::KeyItem *KeyMap::mapCharacterKey( return &keyItem; } -void KeyMap::addGroupToKeystroke(Keystrokes &keys, SInt32 &group, const std::string &lang) const +void KeyMap::addGroupToKeystroke(Keystrokes &keys, int32_t &group, const std::string &lang) const { group = getLanguageGroupID(group, lang); keys.push_back(Keystroke(group, true, false)); } const KeyMap::KeyItem *KeyMap::mapModifierKey( - Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + Keystrokes &keys, KeyID id, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ) const { return mapCharacterKey(keys, id, group, activeModifiers, currentState, desiredMask, isAutoRepeat, lang); } -SInt32 KeyMap::findBestKey(const KeyEntryList &entryList, KeyModifierMask desiredState) const +int32_t KeyMap::findBestKey(const KeyEntryList &entryList, KeyModifierMask desiredState) const { // check for an item that can accommodate the desiredState exactly - for (SInt32 i = 0; i < (SInt32)entryList.size(); ++i) { + for (int32_t i = 0; i < (int32_t)entryList.size(); ++i) { const KeyItem &item = entryList[i].back(); if ((item.m_required & desiredState) == item.m_required && (item.m_required & desiredState) == (item.m_sensitive & desiredState)) { @@ -668,12 +668,12 @@ SInt32 KeyMap::findBestKey(const KeyEntryList &entryList, KeyModifierMask desire } // choose the item that requires the fewest modifier changes - SInt32 bestCount = 32; - SInt32 bestIndex = -1; - for (SInt32 i = 0; i < (SInt32)entryList.size(); ++i) { + int32_t bestCount = 32; + int32_t bestIndex = -1; + for (int32_t i = 0; i < (int32_t)entryList.size(); ++i) { const KeyItem &item = entryList[i].back(); KeyModifierMask change = ((item.m_required ^ desiredState) & item.m_sensitive); - SInt32 n = getNumModifiers(change); + int32_t n = getNumModifiers(change); if (n < bestCount) { bestCount = n; bestIndex = i; @@ -686,7 +686,7 @@ SInt32 KeyMap::findBestKey(const KeyEntryList &entryList, KeyModifierMask desire return bestIndex; } -const KeyMap::KeyItem *KeyMap::keyForModifier(KeyButton button, SInt32 group, SInt32 modifierBit) const +const KeyMap::KeyItem *KeyMap::keyForModifier(KeyButton button, int32_t group, int32_t modifierBit) const { assert(modifierBit >= 0 && modifierBit < kKeyModifierNumBits); assert(group >= 0 && group < getNumGroups()); @@ -706,7 +706,7 @@ const KeyMap::KeyItem *KeyMap::keyForModifier(KeyButton button, SInt32 group, SI } bool KeyMap::keysForKeyItem( - const KeyItem &keyItem, SInt32 &group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + const KeyItem &keyItem, int32_t &group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredState, KeyModifierMask overrideModifiers, bool isAutoRepeat, Keystrokes &keystrokes, const std::string &lang ) const @@ -782,7 +782,7 @@ bool KeyMap::keysForKeyItem( } bool KeyMap::keysToRestoreModifiers( - const KeyItem &keyItem, SInt32, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + const KeyItem &keyItem, int32_t, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, const ModifierToKeys &desiredModifiers, Keystrokes &keystrokes ) const { @@ -823,7 +823,7 @@ bool KeyMap::keysToRestoreModifiers( } bool KeyMap::keysForModifierState( - KeyButton button, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + KeyButton button, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask requiredState, KeyModifierMask sensitiveMask, KeyModifierMask notRequiredMask, Keystrokes &keystrokes ) const @@ -850,7 +850,7 @@ bool KeyMap::keysForModifierState( // we'll assume that modifiers with higher bits are affected by modifiers // with lower bits. there's not much basis for that assumption except // that we're pretty sure shift isn't changed by other modifiers. - SInt32 bit = kKeyModifierNumBits; + int32_t bit = kKeyModifierNumBits; while (bit-- > 0) { KeyModifierMask mask = (1u << bit); if ((flipMask & mask) == 0) { @@ -1016,9 +1016,9 @@ void KeyMap::addKeystrokes( } } -SInt32 KeyMap::getNumModifiers(KeyModifierMask state) +int32_t KeyMap::getNumModifiers(KeyModifierMask state) { - SInt32 n = 0; + int32_t n = 0; for (; state != 0; state >>= 1) { if ((state & 1) != 0) { ++n; @@ -1096,7 +1096,7 @@ std::string KeyMap::formatKey(KeyID key, KeyModifierMask mask) initKeyNameMaps(); std::string x; - for (SInt32 i = 0; i < kKeyModifierNumBits; ++i) { + for (int32_t i = 0; i < kKeyModifierNumBits; ++i) { KeyModifierMask mod = (1u << i); if ((mask & mod) != 0 && s_modifierToNameMap->count(mod) > 0) { x += s_modifierToNameMap->find(mod)->second; @@ -1253,7 +1253,7 @@ KeyMap::Keystroke::Keystroke(KeyButton button, bool press, bool repeat, UInt32 d m_data.m_button.m_client = data; } -KeyMap::Keystroke::Keystroke(SInt32 group, bool absolute, bool restore) : m_type(kGroup) +KeyMap::Keystroke::Keystroke(int32_t group, bool absolute, bool restore) : m_type(kGroup) { m_data.m_group.m_group = group; m_data.m_group.m_absolute = absolute; diff --git a/src/lib/deskflow/KeyMap.h b/src/lib/deskflow/KeyMap.h index ca935c7cb..0e068af67 100644 --- a/src/lib/deskflow/KeyMap.h +++ b/src/lib/deskflow/KeyMap.h @@ -53,7 +53,7 @@ public: { public: KeyID m_id{}; //!< KeyID - SInt32 m_group{}; //!< Group for key + int32_t m_group{}; //!< Group for key KeyButton m_button{}; //!< Button to generate KeyID KeyModifierMask m_required{}; //!< Modifiers required for KeyID KeyModifierMask m_sensitive{}; //!< Modifiers key is sensitive to @@ -89,7 +89,7 @@ public: }; Keystroke(KeyButton, bool press, bool repeat, UInt32 clientData); - Keystroke(SInt32 group, bool absolute, bool restore); + Keystroke(int32_t group, bool absolute, bool restore); public: struct Button @@ -103,7 +103,7 @@ public: struct Group { public: - SInt32 m_group{}; //!< Group/offset to change to/by + int32_t m_group{}; //!< Group/offset to change to/by bool m_absolute{}; //!< \c true iff change to, else by bool m_restore{}; //!< \c true iff for restoring state }; @@ -128,7 +128,7 @@ public: using ButtonToKeyMap = std::map; //! Callback type for \c foreachKey - typedef void (*ForeachKeyCallback)(KeyID, SInt32 group, KeyItem &, void *userData); + typedef void (*ForeachKeyCallback)(KeyID, int32_t group, KeyItem &, void *userData); //! @name manipulators //@{ @@ -154,7 +154,7 @@ public: can generate \p targetID using \p sourceID). */ void addKeyAliasEntry( - KeyID targetID, SInt32 group, KeyModifierMask targetRequired, KeyModifierMask targetSensitive, KeyID sourceID, + KeyID targetID, int32_t group, KeyModifierMask targetRequired, KeyModifierMask targetSensitive, KeyID sourceID, KeyModifierMask sourceRequired, KeyModifierMask sourceSensitive ); @@ -168,7 +168,7 @@ public: least one key in \p keys is not in the map then nothing is added and this returns \c false, otherwise it returns \c true. */ - bool addKeyCombinationEntry(KeyID id, SInt32 group, const KeyID *keys, UInt32 numKeys); + bool addKeyCombinationEntry(KeyID id, int32_t group, const KeyID *keys, UInt32 numKeys); //! Enable composition across groups /*! @@ -224,7 +224,7 @@ public: pressed/repeated, or NULL if the key cannot be mapped. */ virtual const KeyItem *mapKey( - Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + Keystrokes &keys, KeyID id, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ) const; @@ -234,13 +234,13 @@ public: /*! Returns the number of keyboard groups (independent layouts) in the map. */ - SInt32 getNumGroups() const; + int32_t getNumGroups() const; //! Compute a group number /*! Returns the number of the group \p offset groups after group \p group. */ - SInt32 getEffectiveGroup(SInt32 group, SInt32 offset) const; + int32_t getEffectiveGroup(int32_t group, int32_t offset) const; //! Find key entry compatible with modifiers /*! @@ -252,7 +252,7 @@ public: for every modifier indicated by \p sensitive. */ const KeyItemList * - findCompatibleKey(KeyID id, SInt32 group, KeyModifierMask required, KeyModifierMask sensitive) const; + findCompatibleKey(KeyID id, int32_t group, KeyModifierMask required, KeyModifierMask sensitive) const; //! Test if modifier is half-duplex /*! @@ -356,7 +356,7 @@ private: using KeyEntryList = std::vector; // computes the number of groups - SInt32 findNumGroups() const; + int32_t findNumGroups() const; // computes the map of modifiers to the keys that generate the modifiers void setModifierKeys(); @@ -368,7 +368,7 @@ private: // to what character they would synthesize. we disallow multikey // entries since they don't make sense as hotkeys. const KeyItem *mapCommandKey( - Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + Keystrokes &keys, KeyID id, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ) const; @@ -376,32 +376,32 @@ private: // particular KeyID and isn't entirely concerned with the modifiers // used to do it. const KeyItem *mapCharacterKey( - Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + Keystrokes &keys, KeyID id, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ) const; // maps a modifier key const KeyItem *mapModifierKey( - Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + Keystrokes &keys, KeyID id, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ) const; // returns the index into \p entryList of the KeyItemList requiring // the fewest modifier changes between \p currentState and // \p desiredState. - SInt32 findBestKey(const KeyEntryList &entryList, KeyModifierMask desiredState) const; + int32_t findBestKey(const KeyEntryList &entryList, KeyModifierMask desiredState) const; // gets the \c KeyItem used to synthesize the modifier who's bit is // given by \p modifierBit in group \p group and does not synthesize // the key \p button. - const KeyItem *keyForModifier(KeyButton button, SInt32 group, SInt32 modifierBit) const; + const KeyItem *keyForModifier(KeyButton button, int32_t group, int32_t modifierBit) const; // fills \p keystrokes with the keys to synthesize the key in // \p keyItem taking the modifiers into account. returns \c true // iff successful and sets \p currentState to the // resulting modifier state. bool keysForKeyItem( - const KeyItem &keyItem, SInt32 &group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + const KeyItem &keyItem, int32_t &group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredState, KeyModifierMask overrideModifiers, bool isAutoRepeat, Keystrokes &keystrokes, const std::string &lang ) const; @@ -411,7 +411,7 @@ private: // \p activeModifiers not including the key in \p keyItem. // returns \c true iff successful. bool keysToRestoreModifiers( - const KeyItem &keyItem, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + const KeyItem &keyItem, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, const ModifierToKeys &desiredModifiers, Keystrokes &keystrokes ) const; @@ -421,7 +421,7 @@ private: // returns \c true iff successful and sets \p currentState to the // resulting modifier state. bool keysForModifierState( - KeyButton button, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, + KeyButton button, int32_t group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask requiredState, KeyModifierMask sensitiveMask, KeyModifierMask notRequiredMask, Keystrokes &keystrokes ) const; @@ -434,7 +434,7 @@ private: ) const; // Returns the number of modifiers indicated in \p state. - static SInt32 getNumModifiers(KeyModifierMask state); + static int32_t getNumModifiers(KeyModifierMask state); // Initialize key name/id maps static void initKeyNameMaps(); @@ -442,11 +442,11 @@ private: // Ways to synthesize a KeyID over multiple keyboard groups using KeyGroupTable = std::vector; - void addGroupToKeystroke(Keystrokes &keys, SInt32 &group, const std::string &lang) const; + void addGroupToKeystroke(Keystrokes &keys, int32_t &group, const std::string &lang) const; - SInt32 getLanguageGroupID(SInt32 group, const std::string &lang) const; + int32_t getLanguageGroupID(int32_t group, const std::string &lang) const; const KeyItemList * - getKeyItemList(const KeyGroupTable &keyGroupTable, SInt32 group, KeyModifierMask desiredMask) const; + getKeyItemList(const KeyGroupTable &keyGroupTable, int32_t group, KeyModifierMask desiredMask) const; // not implemented KeyMap(const KeyMap &); @@ -476,7 +476,7 @@ private: // KeyID info KeyIDMap m_keyIDMap; - SInt32 m_numGroups; + int32_t m_numGroups; ModifierToKeyTable m_modifierKeys; // composition info diff --git a/src/lib/deskflow/KeyState.cpp b/src/lib/deskflow/KeyState.cpp index c31c7da39..17c37c58b 100644 --- a/src/lib/deskflow/KeyState.cpp +++ b/src/lib/deskflow/KeyState.cpp @@ -716,7 +716,7 @@ void KeyState::onKey(KeyButton button, bool down, KeyModifierMask newState) } void KeyState::sendKeyEvent( - void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, SInt32 count, KeyButton button + void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, int32_t count, KeyButton button ) { if (m_keyMap.isHalfDuplex(key, button)) { @@ -781,7 +781,7 @@ void KeyState::updateKeyState() LOG((CLOG_DEBUG1 "modifiers on update: 0x%04x", m_mask)); } -void KeyState::addActiveModifierCB(KeyID, SInt32 group, deskflow::KeyMap::KeyItem &keyItem, void *vcontext) +void KeyState::addActiveModifierCB(KeyID, int32_t group, deskflow::KeyMap::KeyItem &keyItem, void *vcontext) { AddActiveModifierContext *context = static_cast(vcontext); if (group == context->m_activeGroup && (keyItem.m_generates & context->m_mask) != 0) { @@ -850,7 +850,7 @@ void KeyState::fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton serverID, c fakeKeys(keys, 1); } -bool KeyState::fakeKeyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton serverID, const std::string &lang) +bool KeyState::fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton serverID, const std::string &lang) { LOG((CLOG_DEBUG2 "fakeKeyRepeat")); serverID &= kButtonMask; @@ -986,7 +986,7 @@ KeyModifierMask &KeyState::getActiveModifiersRValue() return m_mask; } -SInt32 KeyState::getEffectiveGroup(SInt32 group, SInt32 offset) const +int32_t KeyState::getEffectiveGroup(int32_t group, int32_t offset) const { return m_keyMap.getEffectiveGroup(group, offset); } @@ -1004,7 +1004,7 @@ bool KeyState::isIgnoredKey(KeyID key, KeyModifierMask) const } } -KeyButton KeyState::getButton(KeyID id, SInt32 group) const +KeyButton KeyState::getButton(KeyID id, int32_t group) const { const deskflow::KeyMap::KeyItemList *items = m_keyMap.findCompatibleKey(id, group, 0, 0); if (items == NULL) { @@ -1016,7 +1016,7 @@ KeyButton KeyState::getButton(KeyID id, SInt32 group) const void KeyState::addAliasEntries() { - for (SInt32 g = 0, n = m_keyMap.getNumGroups(); g < n; ++g) { + for (int32_t g = 0, n = m_keyMap.getNumGroups(); g < n; ++g) { // if we can't shift any kKeyTab key in a particular group but we can // shift kKeyLeftTab then add a shifted kKeyTab entry that matches a // shifted kKeyLeftTab entry. @@ -1037,7 +1037,7 @@ void KeyState::addKeypadEntries() { // map every numpad key to its equivalent non-numpad key if it's not // on the keyboard. - for (SInt32 g = 0, n = m_keyMap.getNumGroups(); g < n; ++g) { + for (int32_t g = 0, n = m_keyMap.getNumGroups(); g < n; ++g) { for (size_t i = 0; i < sizeof(s_numpadTable) / sizeof(s_numpadTable[0]); i += 2) { m_keyMap.addKeyCombinationEntry(s_numpadTable[i], g, s_numpadTable + i + 1, 1); } @@ -1046,7 +1046,7 @@ void KeyState::addKeypadEntries() void KeyState::addCombinationEntries() { - for (SInt32 g = 0, n = m_keyMap.getNumGroups(); g < n; ++g) { + for (int32_t g = 0, n = m_keyMap.getNumGroups(); g < n; ++g) { // add dead and compose key composition sequences const KeyID *i = s_decomposeTable; while (*i != 0) { @@ -1148,7 +1148,7 @@ void KeyState::updateModifierKeyState( // KeyState::AddActiveModifierContext::AddActiveModifierContext( - SInt32 group, KeyModifierMask mask, ModifierToKeys &activeModifiers + int32_t group, KeyModifierMask mask, ModifierToKeys &activeModifiers ) : m_activeGroup(group), m_mask(mask), diff --git a/src/lib/deskflow/KeyState.h b/src/lib/deskflow/KeyState.h index f2376edae..b28b0c1cb 100644 --- a/src/lib/deskflow/KeyState.h +++ b/src/lib/deskflow/KeyState.h @@ -52,7 +52,7 @@ public: to the superclass. */ virtual void sendKeyEvent( - void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, SInt32 count, KeyButton button + void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, int32_t count, KeyButton button ); //@} @@ -70,7 +70,7 @@ public: void updateKeyState() override; void setHalfDuplexMask(KeyModifierMask) override; void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang) override; - bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang) override; + bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) override; bool fakeKeyUp(KeyButton button) override; void fakeAllKeysUp() override; bool fakeMediaKey(KeyID id) override; @@ -80,10 +80,10 @@ public: // Left abstract virtual bool fakeCtrlAltDel() override = 0; virtual KeyModifierMask pollActiveModifiers() const override = 0; - virtual SInt32 pollActiveGroup() const override = 0; + virtual int32_t pollActiveGroup() const override = 0; virtual void pollPressedKeys(KeyButtonSet &pressedKeys) const override = 0; - SInt32 getKeyState(KeyButton keyButton) + int32_t getKeyState(KeyButton keyButton) { return m_keys[keyButton]; } @@ -121,7 +121,7 @@ protected: /*! Returns the number of the group \p offset groups after group \p group. */ - SInt32 getEffectiveGroup(SInt32 group, SInt32 offset) const; + int32_t getEffectiveGroup(int32_t group, int32_t offset) const; //! Check if key is ignored /*! @@ -135,7 +135,7 @@ protected: Return the button mapped to key \p id in group \p group if any, otherwise returns 0. */ - KeyButton getButton(KeyID id, SInt32 group) const; + KeyButton getButton(KeyID id, int32_t group) const; //@} @@ -147,10 +147,10 @@ public: struct AddActiveModifierContext { public: - AddActiveModifierContext(SInt32 group, KeyModifierMask mask, ModifierToKeys &activeModifiers); + AddActiveModifierContext(int32_t group, KeyModifierMask mask, ModifierToKeys &activeModifiers); public: - SInt32 m_activeGroup; + int32_t m_activeGroup; KeyModifierMask m_mask; ModifierToKeys &m_activeModifiers; @@ -197,7 +197,7 @@ private: void updateModifierKeyState(KeyButton button, const ModifierToKeys &oldModifiers, const ModifierToKeys &newModifiers); // active modifiers collection callback - static void addActiveModifierCB(KeyID id, SInt32 group, deskflow::KeyMap::KeyItem &keyItem, void *vcontext); + static void addActiveModifierCB(KeyID id, int32_t group, deskflow::KeyMap::KeyItem &keyItem, void *vcontext); private: // must be declared before m_keyMap. used when this class owns the key map. @@ -215,13 +215,13 @@ private: // current keyboard state (> 0 if pressed, 0 otherwise). this is // initialized to the keyboard state according to the system then // it tracks synthesized events. - SInt32 m_keys[kNumButtons]; + int32_t m_keys[kNumButtons]; // synthetic keyboard state (> 0 if pressed, 0 otherwise). this // tracks the synthesized keyboard state. if m_keys[n] > 0 but // m_syntheticKeys[n] == 0 then the key was pressed locally and // not synthesized yet. - SInt32 m_syntheticKeys[kNumButtons]; + int32_t m_syntheticKeys[kNumButtons]; // client data for each pressed key UInt32 m_keyClientData[kNumButtons]; diff --git a/src/lib/deskflow/PlatformScreen.cpp b/src/lib/deskflow/PlatformScreen.cpp index 9d2c288b3..9b3e1ac69 100644 --- a/src/lib/deskflow/PlatformScreen.cpp +++ b/src/lib/deskflow/PlatformScreen.cpp @@ -55,7 +55,7 @@ void PlatformScreen::fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton butto } bool PlatformScreen::fakeKeyRepeat( - KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang + KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang ) { return getKeyState()->fakeKeyRepeat(id, mask, count, button, lang); @@ -91,7 +91,7 @@ KeyModifierMask PlatformScreen::pollActiveModifiers() const return getKeyState()->pollActiveModifiers(); } -SInt32 PlatformScreen::pollActiveGroup() const +int32_t PlatformScreen::pollActiveGroup() const { return getKeyState()->pollActiveGroup(); } @@ -109,7 +109,7 @@ bool PlatformScreen::isDraggingStarted() return false; } -SInt32 PlatformScreen::mapClientScrollDirection(SInt32 x) const +int32_t PlatformScreen::mapClientScrollDirection(int32_t x) const { return (x * m_clientScrollDirection); } diff --git a/src/lib/deskflow/PlatformScreen.h b/src/lib/deskflow/PlatformScreen.h index da9e00ef2..e56ae98a8 100644 --- a/src/lib/deskflow/PlatformScreen.h +++ b/src/lib/deskflow/PlatformScreen.h @@ -40,39 +40,39 @@ public: // IScreen overrides virtual void *getEventTarget() const = 0; virtual bool getClipboard(ClipboardID id, IClipboard *) const = 0; - virtual void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const = 0; - virtual void getCursorPos(SInt32 &x, SInt32 &y) const = 0; + virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const = 0; + virtual void getCursorPos(int32_t &x, int32_t &y) const = 0; // IPrimaryScreen overrides virtual void reconfigure(UInt32 activeSides) = 0; - virtual void warpCursor(SInt32 x, SInt32 y) = 0; + virtual void warpCursor(int32_t x, int32_t y) = 0; virtual UInt32 registerHotKey(KeyID key, KeyModifierMask mask) = 0; virtual void unregisterHotKey(UInt32 id) = 0; virtual void fakeInputBegin() = 0; virtual void fakeInputEnd() = 0; - virtual SInt32 getJumpZoneSize() const = 0; + virtual int32_t getJumpZoneSize() const = 0; virtual bool isAnyMouseButtonDown(UInt32 &buttonID) const = 0; - virtual void getCursorCenter(SInt32 &x, SInt32 &y) const = 0; + virtual void getCursorCenter(int32_t &x, int32_t &y) const = 0; // ISecondaryScreen overrides virtual void fakeMouseButton(ButtonID id, bool press) = 0; - virtual void fakeMouseMove(SInt32 x, SInt32 y) = 0; - virtual void fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const = 0; - virtual void fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const = 0; + virtual void fakeMouseMove(int32_t x, int32_t y) = 0; + virtual void fakeMouseRelativeMove(int32_t dx, int32_t dy) const = 0; + virtual void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const = 0; // IKeyState overrides virtual void updateKeyMap(); virtual void updateKeyState(); virtual void setHalfDuplexMask(KeyModifierMask); virtual void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &); - virtual bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang); + virtual bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang); virtual bool fakeKeyUp(KeyButton button); virtual void fakeAllKeysUp(); virtual bool fakeCtrlAltDel(); virtual bool isKeyDown(KeyButton) const; virtual KeyModifierMask getActiveModifiers() const; virtual KeyModifierMask pollActiveModifiers() const; - virtual SInt32 pollActiveGroup() const; + virtual int32_t pollActiveGroup() const; virtual void pollPressedKeys(KeyButtonSet &pressedKeys) const; virtual void setDraggingStarted(bool started) @@ -140,7 +140,7 @@ protected: * Convert scroll according to client scroll directio * \return converted value according to the client scroll direction */ - virtual SInt32 mapClientScrollDirection(SInt32) const; + virtual int32_t mapClientScrollDirection(int32_t) const; protected: std::string m_draggingFilename; diff --git a/src/lib/deskflow/ProtocolUtil.h b/src/lib/deskflow/ProtocolUtil.h index ba24a515a..6a94edace 100644 --- a/src/lib/deskflow/ProtocolUtil.h +++ b/src/lib/deskflow/ProtocolUtil.h @@ -64,9 +64,9 @@ public: Format specifiers are: - \%\% -- read (and discard) a literal `\%' - - \%1i -- reads a 1 byte integer; argument is a SInt32* or UInt32* - - \%2i -- reads an NBO 2 byte integer; arg is SInt32* or UInt32* - - \%4i -- reads an NBO 4 byte integer; arg is SInt32* or UInt32* + - \%1i -- reads a 1 byte integer; argument is a int32_t* or UInt32* + - \%2i -- reads an NBO 2 byte integer; arg is int32_t* or UInt32* + - \%4i -- reads an NBO 4 byte integer; arg is int32_t* or UInt32* - \%1I -- reads 1 byte integers; arg is std::vector* - \%2I -- reads NBO 2 byte integers; arg is std::vector* - \%4I -- reads NBO 4 byte integers; arg is std::vector* diff --git a/src/lib/deskflow/Screen.cpp b/src/lib/deskflow/Screen.cpp index 3b4523b9f..ff6caddbc 100644 --- a/src/lib/deskflow/Screen.cpp +++ b/src/lib/deskflow/Screen.cpp @@ -177,7 +177,7 @@ void Screen::reconfigure(UInt32 activeSides) m_screen->reconfigure(activeSides); } -void Screen::warpCursor(SInt32 x, SInt32 y) +void Screen::warpCursor(int32_t x, int32_t y) { assert(m_isPrimary); m_screen->warpCursor(x, y); @@ -210,7 +210,7 @@ void Screen::keyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std m_screen->fakeKeyDown(id, mask, button, lang); } -void Screen::keyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang) +void Screen::keyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) { assert(!m_isPrimary); m_screen->fakeKeyRepeat(id, mask, count, button, lang); @@ -231,19 +231,19 @@ void Screen::mouseUp(ButtonID button) m_screen->fakeMouseButton(button, false); } -void Screen::mouseMove(SInt32 x, SInt32 y) +void Screen::mouseMove(int32_t x, int32_t y) { assert(!m_isPrimary); m_screen->fakeMouseMove(x, y); } -void Screen::mouseRelativeMove(SInt32 dx, SInt32 dy) +void Screen::mouseRelativeMove(int32_t dx, int32_t dy) { assert(!m_isPrimary); m_screen->fakeMouseRelativeMove(dx, dy); } -void Screen::mouseWheel(SInt32 xDelta, SInt32 yDelta) const +void Screen::mouseWheel(int32_t xDelta, int32_t yDelta) const { assert(!m_isPrimary); m_screen->fakeMouseWheel(xDelta, yDelta); @@ -351,7 +351,7 @@ bool Screen::isLockedToScreen() const return false; } -SInt32 Screen::getJumpZoneSize() const +int32_t Screen::getJumpZoneSize() const { if (!m_isPrimary) { return 0; @@ -360,7 +360,7 @@ SInt32 Screen::getJumpZoneSize() const } } -void Screen::getCursorCenter(SInt32 &x, SInt32 &y) const +void Screen::getCursorCenter(int32_t &x, int32_t &y) const { m_screen->getCursorCenter(x, y); } @@ -425,12 +425,12 @@ bool Screen::getClipboard(ClipboardID id, IClipboard *clipboard) const return m_screen->getClipboard(id, clipboard); } -void Screen::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const +void Screen::getShape(int32_t &x, int32_t &y, int32_t &w, int32_t &h) const { m_screen->getShape(x, y, w, h); } -void Screen::getCursorPos(SInt32 &x, SInt32 &y) const +void Screen::getCursorPos(int32_t &x, int32_t &y) const { m_screen->getCursorPos(x, y); } diff --git a/src/lib/deskflow/Screen.h b/src/lib/deskflow/Screen.h index 21dec5e82..122e65861 100644 --- a/src/lib/deskflow/Screen.h +++ b/src/lib/deskflow/Screen.h @@ -98,7 +98,7 @@ public: discards input events up to and including the warp before returning. */ - void warpCursor(SInt32 x, SInt32 y); + void warpCursor(int32_t x, int32_t y); //! Set clipboard /*! @@ -136,7 +136,7 @@ public: Synthesize key events to generate a press and release of key \c id \c count times. If possible match the given modifier mask. */ - void keyRepeat(KeyID id, KeyModifierMask, SInt32 count, KeyButton, const std::string &lang); + void keyRepeat(KeyID id, KeyModifierMask, int32_t count, KeyButton, const std::string &lang); //! Notify of key release /*! @@ -162,14 +162,14 @@ public: Synthesize mouse events to generate mouse motion to the absolute screen position \c xAbs,yAbs. */ - void mouseMove(SInt32 xAbs, SInt32 yAbs); + void mouseMove(int32_t xAbs, int32_t yAbs); //! Notify of mouse motion /*! Synthesize mouse events to generate mouse motion by the relative amount \c xRel,yRel. */ - void mouseRelativeMove(SInt32 xRel, SInt32 yRel); + void mouseRelativeMove(int32_t xRel, int32_t yRel); //! Notify of mouse wheel motion /*! @@ -178,7 +178,7 @@ public: to the right and negative for motion towards the user or to the left. Each wheel click should generate a delta of +/-120. */ - void mouseWheel(SInt32 xDelta, SInt32 yDelta) const; + void mouseWheel(int32_t xDelta, int32_t yDelta) const; //! Notify of options changes /*! @@ -266,7 +266,7 @@ public: Return the jump zone size, the size of the regions on the edges of the screen that cause the cursor to jump to another screen. */ - SInt32 getJumpZoneSize() const; + int32_t getJumpZoneSize() const; //! Get cursor center position /*! @@ -274,7 +274,7 @@ public: cursor to compute cursor motion deltas and should be far from the edges of the screen, typically the center. */ - void getCursorCenter(SInt32 &x, SInt32 &y) const; + void getCursorCenter(int32_t &x, int32_t &y) const; //! Get the active modifiers /*! @@ -310,8 +310,8 @@ public: // IScreen overrides virtual void *getEventTarget() const; virtual bool getClipboard(ClipboardID id, IClipboard *) const; - virtual void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const; - virtual void getCursorPos(SInt32 &x, SInt32 &y) const; + virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const; + virtual void getCursorPos(int32_t &x, int32_t &y) const; IPlatformScreen *getPlatformScreen() { diff --git a/src/lib/deskflow/key_types.h b/src/lib/deskflow/key_types.h index 1d3657dca..4302653c8 100644 --- a/src/lib/deskflow/key_types.h +++ b/src/lib/deskflow/key_types.h @@ -93,7 +93,7 @@ static const UInt32 kKeyModifierBitLevel5Lock = 6; static const UInt32 kKeyModifierBitCapsLock = 12; static const UInt32 kKeyModifierBitNumLock = 13; static const UInt32 kKeyModifierBitScrollLock = 14; -static const SInt32 kKeyModifierNumBits = 16; +static const int32_t kKeyModifierNumBits = 16; //@} //! @name Modifier key identifiers diff --git a/src/lib/deskflow/option_types.h b/src/lib/deskflow/option_types.h index 699d6cd13..4b73d2e58 100644 --- a/src/lib/deskflow/option_types.h +++ b/src/lib/deskflow/option_types.h @@ -31,7 +31,7 @@ using OptionID = UInt32; /*! Type to hold an option value. */ -using OptionValue = SInt32; +using OptionValue = int32_t; // for now, options are just pairs of integers using OptionsList = std::vector; diff --git a/src/lib/deskflow/protocol_types.h b/src/lib/deskflow/protocol_types.h index 48887ff28..5d7c6e0f0 100644 --- a/src/lib/deskflow/protocol_types.h +++ b/src/lib/deskflow/protocol_types.h @@ -364,20 +364,20 @@ public: The position of the upper-left corner of the screen. This is typically 0,0. */ - SInt32 m_x, m_y; + int32_t m_x, m_y; //! Screen size /*! The size of the screen in pixels. */ - SInt32 m_w, m_h; + int32_t m_w, m_h; //! Obsolete (jump zone size) - SInt32 obsolete1; + int32_t obsolete1; //! Mouse position /*! The current location of the mouse cursor. */ - SInt32 m_mx, m_my; + int32_t m_mx, m_my; }; diff --git a/src/lib/platform/MSWindowsClipboardHTMLConverter.cpp b/src/lib/platform/MSWindowsClipboardHTMLConverter.cpp index 9040e88ed..c16d74298 100644 --- a/src/lib/platform/MSWindowsClipboardHTMLConverter.cpp +++ b/src/lib/platform/MSWindowsClipboardHTMLConverter.cpp @@ -79,8 +79,8 @@ std::string MSWindowsClipboardHTMLConverter::doToIClipboard(const std::string &d } // convert args to integers - SInt32 start = (SInt32)atoi(startArg.c_str()); - SInt32 end = (SInt32)atoi(endArg.c_str()); + int32_t start = (int32_t)atoi(startArg.c_str()); + int32_t end = (int32_t)atoi(endArg.c_str()); if (start <= 0 || end <= 0 || start >= end) { return std::string(); } diff --git a/src/lib/platform/MSWindowsDesks.cpp b/src/lib/platform/MSWindowsDesks.cpp index f8aedf5d8..ce37844e1 100644 --- a/src/lib/platform/MSWindowsDesks.cpp +++ b/src/lib/platform/MSWindowsDesks.cpp @@ -222,7 +222,7 @@ void MSWindowsDesks::updateKeys() } void MSWindowsDesks::setShape( - SInt32 x, SInt32 y, SInt32 width, SInt32 height, SInt32 xCenter, SInt32 yCenter, bool isMultimon + int32_t x, int32_t y, int32_t width, int32_t height, int32_t xCenter, int32_t yCenter, bool isMultimon ) { m_x = x; @@ -252,7 +252,7 @@ void MSWindowsDesks::fakeInputEnd() sendMessage(DESKFLOW_MSG_FAKE_INPUT, 0, 0); } -void MSWindowsDesks::getCursorPos(SInt32 &x, SInt32 &y) const +void MSWindowsDesks::getCursorPos(int32_t &x, int32_t &y) const { POINT pos; sendMessage(DESKFLOW_MSG_CURSOR_POS, reinterpret_cast(&pos), 0); @@ -317,17 +317,17 @@ void MSWindowsDesks::fakeMouseButton(ButtonID button, bool press) sendMessage(DESKFLOW_MSG_FAKE_BUTTON, flags, data); } -void MSWindowsDesks::fakeMouseMove(SInt32 x, SInt32 y) const +void MSWindowsDesks::fakeMouseMove(int32_t x, int32_t y) const { sendMessage(DESKFLOW_MSG_FAKE_MOVE, static_cast(x), static_cast(y)); } -void MSWindowsDesks::fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const +void MSWindowsDesks::fakeMouseRelativeMove(int32_t dx, int32_t dy) const { sendMessage(DESKFLOW_MSG_FAKE_REL_MOVE, static_cast(dx), static_cast(dy)); } -void MSWindowsDesks::fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const +void MSWindowsDesks::fakeMouseWheel(int32_t xDelta, int32_t yDelta) const { sendMessage(DESKFLOW_MSG_FAKE_WHEEL, xDelta, yDelta); } @@ -434,20 +434,20 @@ LRESULT CALLBACK MSWindowsDesks::secondaryDeskProc(HWND hwnd, UINT msg, WPARAM w return DefWindowProc(hwnd, msg, wParam, lParam); } -void MSWindowsDesks::deskMouseMove(SInt32 x, SInt32 y) const +void MSWindowsDesks::deskMouseMove(int32_t x, int32_t y) const { // when using absolute positioning with mouse_event(), // the normalized device coordinates range over only // the primary screen. - SInt32 w = GetSystemMetrics(SM_CXSCREEN); - SInt32 h = GetSystemMetrics(SM_CYSCREEN); + int32_t w = GetSystemMetrics(SM_CXSCREEN); + int32_t h = GetSystemMetrics(SM_CYSCREEN); send_mouse_input( MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, (DWORD)((65535.0f * x) / (w - 1) + 0.5f), (DWORD)((65535.0f * y) / (h - 1) + 0.5f), 0 ); } -void MSWindowsDesks::deskMouseRelativeMove(SInt32 dx, SInt32 dy) const +void MSWindowsDesks::deskMouseRelativeMove(int32_t dx, int32_t dy) const { // relative moves are subject to cursor acceleration which we don't // want.so we disable acceleration, do the relative move, then @@ -666,11 +666,11 @@ void MSWindowsDesks::deskThread(void *vdesk) break; case DESKFLOW_MSG_FAKE_MOVE: - deskMouseMove(static_cast(msg.wParam), static_cast(msg.lParam)); + deskMouseMove(static_cast(msg.wParam), static_cast(msg.lParam)); break; case DESKFLOW_MSG_FAKE_REL_MOVE: - deskMouseRelativeMove(static_cast(msg.wParam), static_cast(msg.lParam)); + deskMouseRelativeMove(static_cast(msg.wParam), static_cast(msg.lParam)); break; case DESKFLOW_MSG_FAKE_WHEEL: diff --git a/src/lib/platform/MSWindowsDesks.h b/src/lib/platform/MSWindowsDesks.h index ea706a579..65064ca11 100644 --- a/src/lib/platform/MSWindowsDesks.h +++ b/src/lib/platform/MSWindowsDesks.h @@ -126,7 +126,7 @@ public: /*! This tells the desks that the display size has changed. */ - void setShape(SInt32 x, SInt32 y, SInt32 width, SInt32 height, SInt32 xCenter, SInt32 yCenter, bool isMultimon); + void setShape(int32_t x, int32_t y, int32_t width, int32_t height, int32_t xCenter, int32_t yCenter, bool isMultimon); //! Install/uninstall screensaver hooks /*! @@ -156,7 +156,7 @@ public: /*! Return the current position of the cursor in \c x and \c y. */ - void getCursorPos(SInt32 &x, SInt32 &y) const; + void getCursorPos(int32_t &x, int32_t &y) const; //! Fake key press/release /*! @@ -174,19 +174,19 @@ public: /*! Synthesize a mouse move to the absolute coordinates \c x,y. */ - void fakeMouseMove(SInt32 x, SInt32 y) const; + void fakeMouseMove(int32_t x, int32_t y) const; //! Fake mouse move /*! Synthesize a mouse move to the relative coordinates \c dx,dy. */ - void fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const; + void fakeMouseRelativeMove(int32_t dx, int32_t dy) const; //! Fake mouse wheel /*! Synthesize a mouse wheel event of amount \c delta in direction \c axis. */ - void fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const; + void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const; //@} @@ -214,8 +214,8 @@ private: void destroyWindow(HWND) const; // message handlers - void deskMouseMove(SInt32 x, SInt32 y) const; - void deskMouseRelativeMove(SInt32 dx, SInt32 dy) const; + void deskMouseMove(int32_t x, int32_t y) const; + void deskMouseRelativeMove(int32_t dx, int32_t dy) const; void deskEnter(Desk *desk); void deskLeave(Desk *desk, HKL keyLayout); void deskThread(void *vdesk); @@ -258,9 +258,9 @@ private: HCURSOR m_cursor; // screen shape stuff - SInt32 m_x, m_y; - SInt32 m_w, m_h; - SInt32 m_xCenter, m_yCenter; + int32_t m_x, m_y; + int32_t m_w, m_h; + int32_t m_xCenter, m_yCenter; // true if system appears to have multiple monitors bool m_multimon; diff --git a/src/lib/platform/MSWindowsHook.cpp b/src/lib/platform/MSWindowsHook.cpp index 3cd4007f6..af6d1914f 100644 --- a/src/lib/platform/MSWindowsHook.cpp +++ b/src/lib/platform/MSWindowsHook.cpp @@ -31,11 +31,11 @@ static HHOOK g_mouseLL = NULL; static bool g_screenSaver = false; static EHookMode g_mode = kHOOK_DISABLE; static UInt32 g_zoneSides = 0; -static SInt32 g_zoneSize = 0; -static SInt32 g_xScreen = 0; -static SInt32 g_yScreen = 0; -static SInt32 g_wScreen = 0; -static SInt32 g_hScreen = 0; +static int32_t g_zoneSize = 0; +static int32_t g_xScreen = 0; +static int32_t g_yScreen = 0; +static int32_t g_wScreen = 0; +static int32_t g_hScreen = 0; static WPARAM g_deadVirtKey = 0; static WPARAM g_deadRelease = 0; static LPARAM g_deadLParam = 0; @@ -130,7 +130,7 @@ void MSWindowsHook::setSides(UInt32 sides) g_zoneSides = sides; } -void MSWindowsHook::setZone(SInt32 x, SInt32 y, SInt32 w, SInt32 h, SInt32 jumpZoneSize) +void MSWindowsHook::setZone(int32_t x, int32_t y, int32_t w, int32_t h, int32_t jumpZoneSize) { g_zoneSize = jumpZoneSize; g_xScreen = x; @@ -477,7 +477,7 @@ static LRESULT CALLBACK keyboardLLHook(int code, WPARAM wParam, LPARAM lParam) // events very early. the earlier the better. // -static bool mouseHookHandler(WPARAM wParam, SInt32 x, SInt32 y, SInt32 data) +static bool mouseHookHandler(WPARAM wParam, int32_t x, int32_t y, int32_t data) { switch (wParam) { case WM_LBUTTONDOWN: @@ -585,9 +585,9 @@ static LRESULT CALLBACK mouseLLHook(int code, WPARAM wParam, LPARAM lParam) return CallNextHookEx(g_mouseLL, code, wParam, lParam); } - SInt32 x = static_cast(info->pt.x); - SInt32 y = static_cast(info->pt.y); - SInt32 w = static_cast(HIWORD(info->mouseData)); + int32_t x = static_cast(info->pt.x); + int32_t y = static_cast(info->pt.y); + int32_t w = static_cast(HIWORD(info->mouseData)); // handle the message if (mouseHookHandler(wParam, x, y, w)) { diff --git a/src/lib/platform/MSWindowsHook.h b/src/lib/platform/MSWindowsHook.h index 51684395f..c1dc26035 100644 --- a/src/lib/platform/MSWindowsHook.h +++ b/src/lib/platform/MSWindowsHook.h @@ -38,7 +38,7 @@ public: void setSides(UInt32 sides); - void setZone(SInt32 x, SInt32 y, SInt32 w, SInt32 h, SInt32 jumpZoneSize); + void setZone(int32_t x, int32_t y, int32_t w, int32_t h, int32_t jumpZoneSize); void setMode(EHookMode mode); diff --git a/src/lib/platform/MSWindowsKeyState.cpp b/src/lib/platform/MSWindowsKeyState.cpp index 31dfe0c34..05ee992e7 100644 --- a/src/lib/platform/MSWindowsKeyState.cpp +++ b/src/lib/platform/MSWindowsKeyState.cpp @@ -729,7 +729,7 @@ void MSWindowsKeyState::onKey(KeyButton button, bool down, KeyModifierMask newSt } void MSWindowsKeyState::sendKeyEvent( - void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, SInt32 count, KeyButton button + void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, int32_t count, KeyButton button ) { if (press || isAutoRepeat) { @@ -755,7 +755,7 @@ void MSWindowsKeyState::fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton bu } bool MSWindowsKeyState::fakeKeyRepeat( - KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang + KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang ) { return KeyState::fakeKeyRepeat(id, mask, count, button, lang); @@ -824,7 +824,7 @@ KeyModifierMask MSWindowsKeyState::pollActiveModifiers() const return state; } -SInt32 MSWindowsKeyState::pollActiveGroup() const +int32_t MSWindowsKeyState::pollActiveGroup() const { // determine the thread that'll receive this event HWND targetWindow = GetForegroundWindow(); @@ -874,8 +874,8 @@ void MSWindowsKeyState::getKeyMap(deskflow::KeyMap &keyMap) // update keyboard groups if (getGroups(m_groups)) { m_groupMap.clear(); - SInt32 numGroups = (SInt32)m_groups.size(); - for (SInt32 g = 0; g < numGroups; ++g) { + int32_t numGroups = (int32_t)m_groups.size(); + for (int32_t g = 0; g < numGroups; ++g) { m_groupMap[m_groups[g]] = g; } } @@ -886,8 +886,8 @@ void MSWindowsKeyState::getKeyMap(deskflow::KeyMap &keyMap) m_keyToVKMap.clear(); deskflow::KeyMap::KeyItem item; - SInt32 numGroups = (SInt32)m_groups.size(); - for (SInt32 g = 0; g < numGroups; ++g) { + int32_t numGroups = (int32_t)m_groups.size(); + for (int32_t g = 0; g < numGroups; ++g) { item.m_group = g; ActivateKeyboardLayout(m_groups[g], 0); @@ -1259,7 +1259,7 @@ bool MSWindowsKeyState::getGroups(GroupList &groups) const return true; } -void MSWindowsKeyState::setWindowGroup(SInt32 group) +void MSWindowsKeyState::setWindowGroup(int32_t group) { HWND targetWindow = GetForegroundWindow(); diff --git a/src/lib/platform/MSWindowsKeyState.h b/src/lib/platform/MSWindowsKeyState.h index e1811abc7..64cfb3f18 100644 --- a/src/lib/platform/MSWindowsKeyState.h +++ b/src/lib/platform/MSWindowsKeyState.h @@ -143,16 +143,16 @@ public: // IKeyState overrides virtual void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang); - virtual bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang); + virtual bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang); virtual bool fakeCtrlAltDel(); virtual KeyModifierMask pollActiveModifiers() const; - virtual SInt32 pollActiveGroup() const; + virtual int32_t pollActiveGroup() const; virtual void pollPressedKeys(KeyButtonSet &pressedKeys) const; // KeyState overrides virtual void onKey(KeyButton button, bool down, KeyModifierMask newState); virtual void sendKeyEvent( - void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, SInt32 count, KeyButton button + void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, int32_t count, KeyButton button ); // Unit test accessors @@ -186,7 +186,7 @@ private: static void ctrlAltDelThread(void *); bool getGroups(GroupList &) const; - void setWindowGroup(SInt32 group); + void setWindowGroup(int32_t group); KeyID getIDForKey(deskflow::KeyMap::KeyItem &item, KeyButton button, UINT virtualKey, PBYTE keyState, HKL hkl) const; @@ -200,7 +200,7 @@ private: MSWindowsKeyState &operator=(const MSWindowsKeyState &); private: - using GroupMap = std::map; + using GroupMap = std::map; using KeyToVKMap = std::map; void *m_eventTarget; diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index f6dcb3e60..a5bc34706 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -501,7 +501,7 @@ bool MSWindowsScreen::getClipboard(ClipboardID, IClipboard *dst) const return true; } -void MSWindowsScreen::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const +void MSWindowsScreen::getShape(int32_t &x, int32_t &y, int32_t &w, int32_t &h) const { assert(m_class != 0); @@ -511,7 +511,7 @@ void MSWindowsScreen::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const h = m_h; } -void MSWindowsScreen::getCursorPos(SInt32 &x, SInt32 &y) const +void MSWindowsScreen::getCursorPos(int32_t &x, int32_t &y) const { m_desks->getCursorPos(x, y); } @@ -575,7 +575,7 @@ void MSWindowsScreen::reconfigure(UInt32 activeSides) m_hook.setSides(activeSides); } -void MSWindowsScreen::warpCursor(SInt32 x, SInt32 y) +void MSWindowsScreen::warpCursor(int32_t x, int32_t y) { // warp mouse warpCursorNoFlush(x, y); @@ -590,7 +590,7 @@ void MSWindowsScreen::warpCursor(SInt32 x, SInt32 y) saveMousePosition(x, y); } -void MSWindowsScreen::saveMousePosition(SInt32 x, SInt32 y) +void MSWindowsScreen::saveMousePosition(int32_t x, int32_t y) { m_xCursor = x; m_yCursor = y; @@ -723,7 +723,7 @@ void MSWindowsScreen::fakeInputEnd() } } -SInt32 MSWindowsScreen::getJumpZoneSize() const +int32_t MSWindowsScreen::getJumpZoneSize() const { return 1; } @@ -744,7 +744,7 @@ bool MSWindowsScreen::isAnyMouseButtonDown(UInt32 &buttonID) const return false; } -void MSWindowsScreen::getCursorCenter(SInt32 &x, SInt32 &y) const +void MSWindowsScreen::getCursorCenter(int32_t &x, int32_t &y) const { x = m_xCenter; y = m_yCenter; @@ -765,7 +765,7 @@ void MSWindowsScreen::fakeMouseButton(ButtonID id, bool press) } } -void MSWindowsScreen::fakeMouseMove(SInt32 x, SInt32 y) +void MSWindowsScreen::fakeMouseMove(int32_t x, int32_t y) { m_desks->fakeMouseMove(x, y); if (m_buttons[kButtonLeft]) { @@ -773,12 +773,12 @@ void MSWindowsScreen::fakeMouseMove(SInt32 x, SInt32 y) } } -void MSWindowsScreen::fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const +void MSWindowsScreen::fakeMouseRelativeMove(int32_t dx, int32_t dy) const { m_desks->fakeMouseRelativeMove(dx, dy); } -void MSWindowsScreen::fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const +void MSWindowsScreen::fakeMouseWheel(int32_t xDelta, int32_t yDelta) const { xDelta = mapClientScrollDirection(xDelta); yDelta = mapClientScrollDirection(yDelta); @@ -797,7 +797,7 @@ void MSWindowsScreen::fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton butt } bool MSWindowsScreen::fakeKeyRepeat( - KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang + KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang ) { bool result = PlatformScreen::fakeKeyRepeat(id, mask, count, button, lang); @@ -985,15 +985,15 @@ bool MSWindowsScreen::onPreDispatchPrimary(HWND, UINT message, WPARAM wParam, LP return onMouseButton(wParam, lParam); case DESKFLOW_MSG_MOUSE_MOVE: - return onMouseMove(static_cast(wParam), static_cast(lParam)); + return onMouseMove(static_cast(wParam), static_cast(lParam)); case DESKFLOW_MSG_MOUSE_WHEEL: // XXX -- support x-axis scrolling - return onMouseWheel(0, static_cast(wParam)); + return onMouseWheel(0, static_cast(wParam)); case DESKFLOW_MSG_PRE_WARP: { // save position to compute delta of next motion - saveMousePosition(static_cast(wParam), static_cast(lParam)); + saveMousePosition(static_cast(wParam), static_cast(lParam)); // we warped the mouse. discard events until we find the // matching post warp event. see warpCursorNoFlush() for @@ -1201,7 +1201,7 @@ bool MSWindowsScreen::onKey(WPARAM wParam, LPARAM lParam) // do it m_keyState->sendKeyEvent( getEventTarget(), ((lParam & 0x80000000u) == 0), ((lParam & 0x40000000u) != 0), key, mask, - (SInt32)(lParam & 0xffff), button + (int32_t)(lParam & 0xffff), button ); } else { LOG((CLOG_DEBUG1 "cannot map key")); @@ -1305,12 +1305,12 @@ bool MSWindowsScreen::onMouseButton(WPARAM wParam, LPARAM lParam) // seems) // 5. sends the delta movement to the client (could be +1,+1 or -1,+4 for // example) -bool MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) +bool MSWindowsScreen::onMouseMove(int32_t mx, int32_t my) { // compute motion delta (relative to the last known // mouse position) - SInt32 x = mx - m_xCursor; - SInt32 y = my - m_yCursor; + int32_t x = mx - m_xCursor; + int32_t y = my - m_yCursor; LOG((CLOG_DEBUG3 "mouse move - motion delta: %+d=(%+d - %+d),%+d=(%+d - %+d)", x, mx, m_xCursor, y, my, m_yCursor)); @@ -1344,7 +1344,7 @@ bool MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) // it's probably a bogus motion that we want to // ignore (see warpCursorNoFlush() for a further // description). - static SInt32 bogusZoneSize = 10; + static int32_t bogusZoneSize = 10; if (-x + bogusZoneSize > m_xCenter - m_x || x + bogusZoneSize > m_x + m_w - m_xCenter || -y + bogusZoneSize > m_yCenter - m_y || y + bogusZoneSize > m_y + m_h - m_yCenter) { @@ -1358,7 +1358,7 @@ bool MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) return true; } -bool MSWindowsScreen::onMouseWheel(SInt32 xDelta, SInt32 yDelta) +bool MSWindowsScreen::onMouseWheel(int32_t xDelta, int32_t yDelta) { // ignore message if posted prior to last mark change if (!ignore()) { @@ -1401,7 +1401,7 @@ bool MSWindowsScreen::onScreensaver(bool activated) bool MSWindowsScreen::onDisplayChange() { // screen resolution may have changed. save old shape. - SInt32 xOld = m_x, yOld = m_y, wOld = m_w, hOld = m_h; + int32_t xOld = m_x, yOld = m_y, wOld = m_w, hOld = m_h; // update shape updateScreenShape(); @@ -1448,7 +1448,7 @@ void MSWindowsScreen::onClipboardChange() } } -void MSWindowsScreen::warpCursorNoFlush(SInt32 x, SInt32 y) +void MSWindowsScreen::warpCursorNoFlush(int32_t x, int32_t y) { // send an event that we can recognize before the mouse warp PostThreadMessage(GetCurrentThreadId(), DESKFLOW_MSG_PRE_WARP, x, y); @@ -1786,8 +1786,8 @@ std::string &MSWindowsScreen::getDraggingFilename() int halfSize = m_dropWindowSize / 2; - SInt32 xPos = m_isPrimary ? m_xCursor : m_xCenter; - SInt32 yPos = m_isPrimary ? m_yCursor : m_yCenter; + int32_t xPos = m_isPrimary ? m_xCursor : m_xCenter; + int32_t yPos = m_isPrimary ? m_yCursor : m_yCenter; xPos = (xPos - halfSize) < 0 ? 0 : xPos - halfSize; yPos = (yPos - halfSize) < 0 ? 0 : yPos - halfSize; SetWindowPos(m_dropWindow, HWND_TOPMOST, xPos, yPos, m_dropWindowSize, m_dropWindowSize, SWP_SHOWWINDOW); diff --git a/src/lib/platform/MSWindowsScreen.h b/src/lib/platform/MSWindowsScreen.h index b915b1623..cfe05251a 100644 --- a/src/lib/platform/MSWindowsScreen.h +++ b/src/lib/platform/MSWindowsScreen.h @@ -74,8 +74,8 @@ public: // IScreen overrides virtual void *getEventTarget() const; virtual bool getClipboard(ClipboardID id, IClipboard *) const; - virtual void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const; - virtual void getCursorPos(SInt32 &x, SInt32 &y) const; + virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const; + virtual void getCursorPos(int32_t &x, int32_t &y) const; /** * \brief Get the position of the cursor on the current machine @@ -99,25 +99,25 @@ public: // IPrimaryScreen overrides virtual void reconfigure(UInt32 activeSides); - virtual void warpCursor(SInt32 x, SInt32 y); + virtual void warpCursor(int32_t x, int32_t y); virtual UInt32 registerHotKey(KeyID key, KeyModifierMask mask); virtual void unregisterHotKey(UInt32 id); virtual void fakeInputBegin(); virtual void fakeInputEnd(); - virtual SInt32 getJumpZoneSize() const; + virtual int32_t getJumpZoneSize() const; virtual bool isAnyMouseButtonDown(UInt32 &buttonID) const; - virtual void getCursorCenter(SInt32 &x, SInt32 &y) const; + virtual void getCursorCenter(int32_t &x, int32_t &y) const; // ISecondaryScreen overrides virtual void fakeMouseButton(ButtonID id, bool press); - virtual void fakeMouseMove(SInt32 x, SInt32 y); - virtual void fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const; - virtual void fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const; + virtual void fakeMouseMove(int32_t x, int32_t y); + virtual void fakeMouseRelativeMove(int32_t dx, int32_t dy) const; + virtual void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const; // IKeyState overrides virtual void updateKeys(); virtual void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang); - virtual bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang); + virtual bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang); virtual bool fakeKeyUp(KeyButton button); virtual void fakeAllKeysUp(); @@ -189,14 +189,14 @@ private: // HACK bool onKey(WPARAM, LPARAM); bool onHotKey(WPARAM, LPARAM); bool onMouseButton(WPARAM, LPARAM); - bool onMouseMove(SInt32 x, SInt32 y); - bool onMouseWheel(SInt32 xDelta, SInt32 yDelta); + bool onMouseMove(int32_t x, int32_t y); + bool onMouseWheel(int32_t xDelta, int32_t yDelta); bool onScreensaver(bool activated); bool onDisplayChange(); void onClipboardChange(); // warp cursor without discarding queued events - void warpCursorNoFlush(SInt32 x, SInt32 y); + void warpCursorNoFlush(int32_t x, int32_t y); // discard posted messages void nextMark(); @@ -239,7 +239,7 @@ private: // HACK static LRESULT CALLBACK wndProc(HWND, UINT, WPARAM, LPARAM); // save last position of mouse to compute next delta movement - void saveMousePosition(SInt32 x, SInt32 y); + void saveMousePosition(int32_t x, int32_t y); // check if it is a modifier key repeating message bool isModifierRepeat(KeyModifierMask oldState, KeyModifierMask state, WPARAM wParam) const; @@ -281,15 +281,15 @@ private: ATOM m_class; // screen shape stuff - SInt32 m_x, m_y; - SInt32 m_w, m_h; - SInt32 m_xCenter, m_yCenter; + int32_t m_x, m_y; + int32_t m_w, m_h; + int32_t m_xCenter, m_yCenter; // true if system appears to have multiple monitors bool m_multimon; // last mouse position - SInt32 m_xCursor, m_yCursor; + int32_t m_xCursor, m_yCursor; // last clipboard UInt32 m_sequenceNumber; diff --git a/src/lib/platform/OSXKeyState.cpp b/src/lib/platform/OSXKeyState.cpp index 59f9b1f1e..3ff3966b5 100644 --- a/src/lib/platform/OSXKeyState.cpp +++ b/src/lib/platform/OSXKeyState.cpp @@ -440,7 +440,7 @@ KeyModifierMask OSXKeyState::pollActiveModifiers() const return outMask; } -SInt32 OSXKeyState::pollActiveGroup() const +int32_t OSXKeyState::pollActiveGroup() const { AutoTISInputSourceRef keyboardLayout(TISCopyCurrentKeyboardLayoutInputSource(), CFRelease); CFDataRef id = (CFDataRef)TISGetInputSourceProperty(keyboardLayout.get(), kTISPropertyInputSourceID); @@ -472,11 +472,11 @@ void OSXKeyState::pollPressedKeys(KeyButtonSet &pressedKeys) const void OSXKeyState::getKeyMap(deskflow::KeyMap &keyMap) { // update keyboard groups - SInt32 numGroups{0}; + int32_t numGroups{0}; if (getGroups(m_groups)) { m_groupMap.clear(); numGroups = CFArrayGetCount(m_groups.get()); - for (SInt32 g = 0; g < numGroups; ++g) { + for (int32_t g = 0; g < numGroups; ++g) { TISInputSourceRef keyboardLayout = (TISInputSourceRef)CFArrayGetValueAtIndex(m_groups.get(), g); CFDataRef id = (CFDataRef)TISGetInputSourceProperty(keyboardLayout, kTISPropertyInputSourceID); m_groupMap[id] = g; @@ -484,7 +484,7 @@ void OSXKeyState::getKeyMap(deskflow::KeyMap &keyMap) } UInt32 keyboardType = LMGetKbdType(); - for (SInt32 g = 0; g < numGroups; ++g) { + for (int32_t g = 0; g < numGroups; ++g) { // add special keys getKeyMapForSpecialKeys(keyMap, g); @@ -630,7 +630,7 @@ void OSXKeyState::fakeKey(const Keystroke &keystroke) } case Keystroke::kGroup: { - SInt32 group = keystroke.m_data.m_group.m_group; + int32_t group = keystroke.m_data.m_group.m_group; if (!keystroke.m_data.m_group.m_restore) { if (keystroke.m_data.m_group.m_absolute) { LOG((CLOG_DEBUG1 " group %d", group)); @@ -649,7 +649,7 @@ void OSXKeyState::fakeKey(const Keystroke &keystroke) } } -void OSXKeyState::getKeyMapForSpecialKeys(deskflow::KeyMap &keyMap, SInt32 group) const +void OSXKeyState::getKeyMapForSpecialKeys(deskflow::KeyMap &keyMap, int32_t group) const { // special keys are insensitive to modifers and none are dead keys deskflow::KeyMap::KeyItem item; @@ -678,7 +678,7 @@ void OSXKeyState::getKeyMapForSpecialKeys(deskflow::KeyMap &keyMap, SInt32 group // anyway. } -bool OSXKeyState::getKeyMap(deskflow::KeyMap &keyMap, SInt32 group, const IOSXKeyResource &r) const +bool OSXKeyState::getKeyMap(deskflow::KeyMap &keyMap, int32_t group, const IOSXKeyResource &r) const { if (!r.isValid()) { return false; @@ -876,7 +876,7 @@ bool OSXKeyState::getGroups(AutoCFArray &groups) const return true; } -void OSXKeyState::setGroup(SInt32 group) +void OSXKeyState::setGroup(int32_t group) { TISInputSourceRef keyboardLayout = (TISInputSourceRef)CFArrayGetValueAtIndex(m_groups.get(), group); if (!keyboardLayout) { diff --git a/src/lib/platform/OSXKeyState.h b/src/lib/platform/OSXKeyState.h index fc401229a..71c17e948 100644 --- a/src/lib/platform/OSXKeyState.h +++ b/src/lib/platform/OSXKeyState.h @@ -91,7 +91,7 @@ public: virtual bool fakeCtrlAltDel(); virtual bool fakeMediaKey(KeyID id); virtual KeyModifierMask pollActiveModifiers() const; - virtual SInt32 pollActiveGroup() const; + virtual int32_t pollActiveGroup() const; virtual void pollPressedKeys(KeyButtonSet &pressedKeys) const; CGEventFlags getModifierStateAsOSXFlags() const; @@ -105,16 +105,16 @@ private: class KeyResource; // Add hard coded special keys to a deskflow::KeyMap. - void getKeyMapForSpecialKeys(deskflow::KeyMap &keyMap, SInt32 group) const; + void getKeyMapForSpecialKeys(deskflow::KeyMap &keyMap, int32_t group) const; // Convert keyboard resource to a key map - bool getKeyMap(deskflow::KeyMap &keyMap, SInt32 group, const IOSXKeyResource &r) const; + bool getKeyMap(deskflow::KeyMap &keyMap, int32_t group, const IOSXKeyResource &r) const; // Get the available keyboard groups bool getGroups(AutoCFArray &) const; // Change active keyboard group to group - void setGroup(SInt32 group); + void setGroup(int32_t group); // Send an event for the given modifier key void handleModifierKey(void *target, UInt32 virtualKey, KeyID id, bool down, KeyModifierMask newMask); @@ -160,7 +160,7 @@ private: KeyButtonOffset = 1 }; - using GroupMap = std::map; + using GroupMap = std::map; using VirtualKeyMap = std::map; VirtualKeyMap m_virtualKeyMap; diff --git a/src/lib/platform/OSXScreen.h b/src/lib/platform/OSXScreen.h index 2d8dde03e..1174718ff 100644 --- a/src/lib/platform/OSXScreen.h +++ b/src/lib/platform/OSXScreen.h @@ -69,25 +69,25 @@ public: // IScreen overrides void *getEventTarget() const override; bool getClipboard(ClipboardID id, IClipboard *) const override; - void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const override; - void getCursorPos(SInt32 &x, SInt32 &y) const override; + void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override; + void getCursorPos(int32_t &x, int32_t &y) const override; // IPrimaryScreen overrides void reconfigure(UInt32 activeSides) override; - void warpCursor(SInt32 x, SInt32 y) override; + void warpCursor(int32_t x, int32_t y) override; UInt32 registerHotKey(KeyID key, KeyModifierMask mask) override; void unregisterHotKey(UInt32 id) override; void fakeInputBegin() override; void fakeInputEnd() override; - SInt32 getJumpZoneSize() const override; + int32_t getJumpZoneSize() const override; bool isAnyMouseButtonDown(UInt32 &buttonID) const override; - void getCursorCenter(SInt32 &x, SInt32 &y) const override; + void getCursorCenter(int32_t &x, int32_t &y) const override; // ISecondaryScreen overrides void fakeMouseButton(ButtonID id, bool press) override; - void fakeMouseMove(SInt32 x, SInt32 y) override; - void fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const override; - void fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const override; + void fakeMouseMove(int32_t x, int32_t y) override; + void fakeMouseRelativeMove(int32_t dx, int32_t dy) const override; + void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const override; // IPlatformScreen overrides void enable() override; @@ -135,7 +135,7 @@ private: // event, false if it is a mouseup event. macButton is the index // of the button pressed using the mac button mapping. bool onMouseButton(bool pressed, uint16_t macButton); - bool onMouseWheel(SInt32 xDelta, SInt32 yDelta) const; + bool onMouseWheel(int32_t xDelta, int32_t yDelta) const; void constructMouseButtonEventMap(); @@ -156,10 +156,10 @@ private: ButtonID mapMacButtonToDeskflow(uint16_t) const; // map mac scroll wheel value to a deskflow scroll wheel value - SInt32 mapScrollWheelToDeskflow(SInt32) const; + int32_t mapScrollWheelToDeskflow(int32_t) const; // map deskflow scroll wheel value to a mac scroll wheel value - SInt32 mapScrollWheelFromDeskflow(SInt32) const; + int32_t mapScrollWheelFromDeskflow(int32_t) const; // get the current scroll wheel speed double getScrollSpeed() const; @@ -257,12 +257,12 @@ private: CGDirectDisplayID m_displayID; // screen shape stuff - SInt32 m_x, m_y; - SInt32 m_w, m_h; - SInt32 m_xCenter, m_yCenter; + int32_t m_x, m_y; + int32_t m_w, m_h; + int32_t m_xCenter, m_yCenter; // mouse state - mutable SInt32 m_xCursor, m_yCursor; + mutable int32_t m_xCursor, m_yCursor; mutable bool m_cursorPosValid; /* FIXME: this data structure is explicitly marked mutable due @@ -276,7 +276,7 @@ private: std::vector MouseButtonEventMap; bool m_cursorHidden; - SInt32 m_dragNumButtonsDown; + int32_t m_dragNumButtonsDown; Point m_dragLastPoint; EventQueueTimer *m_dragTimer; @@ -331,8 +331,8 @@ private: // for double click coalescing. double m_lastClickTime; int m_clickState; - SInt32 m_lastSingleClickXCursor; - SInt32 m_lastSingleClickYCursor; + int32_t m_lastSingleClickXCursor; + int32_t m_lastSingleClickYCursor; IEventQueue *m_events; diff --git a/src/lib/platform/OSXScreen.mm b/src/lib/platform/OSXScreen.mm index b9431ee7a..5904adb2c 100644 --- a/src/lib/platform/OSXScreen.mm +++ b/src/lib/platform/OSXScreen.mm @@ -255,7 +255,7 @@ bool OSXScreen::getClipboard(ClipboardID, IClipboard *dst) const return true; } -void OSXScreen::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const +void OSXScreen::getShape(int32_t &x, int32_t &y, int32_t &w, int32_t &h) const { x = m_x; y = m_y; @@ -263,7 +263,7 @@ void OSXScreen::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const h = m_h; } -void OSXScreen::getCursorPos(SInt32 &x, SInt32 &y) const +void OSXScreen::getCursorPos(int32_t &x, int32_t &y) const { CGEventRef event = CGEventCreate(NULL); CGPoint mouse = CGEventGetLocation(event); @@ -280,7 +280,7 @@ void OSXScreen::reconfigure(UInt32) // do nothing } -void OSXScreen::warpCursor(SInt32 x, SInt32 y) +void OSXScreen::warpCursor(int32_t x, int32_t y) { // move cursor without generating events CGPoint pos; @@ -304,7 +304,7 @@ void OSXScreen::fakeInputEnd() // FIXME -- not implemented } -SInt32 OSXScreen::getJumpZoneSize() const +int32_t OSXScreen::getJumpZoneSize() const { return 1; } @@ -319,7 +319,7 @@ bool OSXScreen::isAnyMouseButtonDown(UInt32 &buttonID) const return (GetCurrentButtonState() != 0); } -void OSXScreen::getCursorCenter(SInt32 &x, SInt32 &y) const +void OSXScreen::getCursorCenter(int32_t &x, int32_t &y) const { x = m_xCenter; y = m_yCenter; @@ -514,7 +514,7 @@ void OSXScreen::fakeMouseButton(ButtonID id, bool press) CGPoint pos; if (!m_cursorPosValid) { - SInt32 x, y; + int32_t x, y; getCursorPos(x, y); } pos.x = m_xCursor; @@ -522,8 +522,8 @@ void OSXScreen::fakeMouseButton(ButtonID id, bool press) // variable used to detect mouse coordinate differences between // old & new mouse clicks. Used in double click detection. - SInt32 xDiff = m_xCursor - m_lastSingleClickXCursor; - SInt32 yDiff = m_yCursor - m_lastSingleClickYCursor; + int32_t xDiff = m_xCursor - m_lastSingleClickXCursor; + int32_t yDiff = m_yCursor - m_lastSingleClickYCursor; double diff = sqrt(xDiff * xDiff + yDiff * yDiff); // max sqrt(x^2 + y^2) difference allowed to double click // since we don't have double click distance in NX APIs @@ -612,7 +612,7 @@ void OSXScreen::getDropTargetThread(void *) m_fakeDraggingStarted = false; } -void OSXScreen::fakeMouseMove(SInt32 x, SInt32 y) +void OSXScreen::fakeMouseMove(int32_t x, int32_t y) { if (m_fakeDraggingStarted) { m_buttonState.set(0, kMouseButtonDown); @@ -630,12 +630,12 @@ void OSXScreen::fakeMouseMove(SInt32 x, SInt32 y) postMouseEvent(pos); // save new cursor position - m_xCursor = static_cast(pos.x); - m_yCursor = static_cast(pos.y); + m_xCursor = static_cast(pos.x); + m_yCursor = static_cast(pos.y); m_cursorPosValid = true; } -void OSXScreen::fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const +void OSXScreen::fakeMouseRelativeMove(int32_t dx, int32_t dy) const { // OS X does not appear to have a fake relative mouse move function. // simulate it by getting the current mouse position and adding to @@ -649,8 +649,8 @@ void OSXScreen::fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const // synthesize event CGPoint pos; - m_xCursor = static_cast(oldPos.x); - m_yCursor = static_cast(oldPos.y); + m_xCursor = static_cast(oldPos.x); + m_yCursor = static_cast(oldPos.y); pos.x = oldPos.x + dx; pos.y = oldPos.y + dy; postMouseEvent(pos); @@ -659,7 +659,7 @@ void OSXScreen::fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const m_cursorPosValid = false; } -void OSXScreen::fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const +void OSXScreen::fakeMouseWheel(int32_t xDelta, int32_t yDelta) const { if (xDelta != 0 || yDelta != 0) { // create a scroll event, post it and release it. not sure if kCGScrollEventUnitLine @@ -1027,8 +1027,8 @@ bool OSXScreen::onMouseMove(CGFloat mx, CGFloat my) } // save position to compute delta of next motion - m_xCursor = (SInt32)mx; - m_yCursor = (SInt32)my; + m_xCursor = (int32_t)mx; + m_yCursor = (int32_t)my; if (m_isOnScreen) { // motion on primary screen @@ -1046,7 +1046,7 @@ bool OSXScreen::onMouseMove(CGFloat mx, CGFloat my) // it's probably a bogus motion that we want to // ignore (see warpCursorNoFlush() for a further // description). - static SInt32 bogusZoneSize = 10; + static int32_t bogusZoneSize = 10; if (-x + bogusZoneSize > m_xCenter - m_x || x + bogusZoneSize > m_x + m_w - m_xCenter || -y + bogusZoneSize > m_yCenter - m_y || y + bogusZoneSize > m_y + m_h - m_yCenter) { LOG((CLOG_DEBUG "dropped bogus motion %+d,%+d", x, y)); @@ -1060,8 +1060,8 @@ bool OSXScreen::onMouseMove(CGFloat mx, CGFloat my) m_yFractionalMove += y; // Return the integer part - SInt32 intX = (SInt32)m_xFractionalMove; - SInt32 intY = (SInt32)m_yFractionalMove; + int32_t intX = (int32_t)m_xFractionalMove; + int32_t intY = (int32_t)m_yFractionalMove; // And keep only the fractional part m_xFractionalMove -= intX; @@ -1126,7 +1126,7 @@ bool OSXScreen::onMouseButton(bool pressed, uint16_t macButton) return true; } -bool OSXScreen::onMouseWheel(SInt32 xDelta, SInt32 yDelta) const +bool OSXScreen::onMouseWheel(int32_t xDelta, int32_t yDelta) const { LOG((CLOG_DEBUG1 "event: button wheel delta=%+d,%+d", xDelta, yDelta)); sendEvent(m_events->forIPrimaryScreen().wheel(), WheelInfo::alloc(xDelta, yDelta)); @@ -1342,18 +1342,18 @@ ButtonID OSXScreen::mapMacButtonToDeskflow(uint16_t macButton) const return static_cast(macButton); } -SInt32 OSXScreen::mapScrollWheelToDeskflow(SInt32 x) const +int32_t OSXScreen::mapScrollWheelToDeskflow(int32_t x) const { // return accelerated scrolling double d = (1.0 + getScrollSpeed()) * x; - return static_cast(120.0 * d); + return static_cast(120.0 * d); } -SInt32 OSXScreen::mapScrollWheelFromDeskflow(SInt32 x) const +int32_t OSXScreen::mapScrollWheelFromDeskflow(int32_t x) const { // use server's acceleration with a little boost since other platforms // take one wheel step as a larger step than the mac does. - auto result = static_cast(3.0 * x / 120.0); + auto result = static_cast(3.0 * x / 120.0); return mapClientScrollDirection(result); } @@ -1407,7 +1407,7 @@ void OSXScreen::handleDrag(const Event &, void *) if ((short)p.x != m_dragLastPoint.h || (short)p.y != m_dragLastPoint.v) { m_dragLastPoint.h = (short)p.x; m_dragLastPoint.v = (short)p.y; - onMouseMove((SInt32)p.x, (SInt32)p.y); + onMouseMove((int32_t)p.x, (int32_t)p.y); } } @@ -1459,10 +1459,10 @@ bool OSXScreen::updateScreenShape() } // get shape of default screen - m_x = (SInt32)totalBounds.origin.x; - m_y = (SInt32)totalBounds.origin.y; - m_w = (SInt32)totalBounds.size.width; - m_h = (SInt32)totalBounds.size.height; + m_x = (int32_t)totalBounds.origin.x; + m_y = (int32_t)totalBounds.origin.y; + m_w = (int32_t)totalBounds.size.width; + m_h = (int32_t)totalBounds.size.height; // get center of default screen CGDirectDisplayID main = CGMainDisplayID(); diff --git a/src/lib/platform/XWindowsClipboard.cpp b/src/lib/platform/XWindowsClipboard.cpp index e352b42cc..5092c493d 100644 --- a/src/lib/platform/XWindowsClipboard.cpp +++ b/src/lib/platform/XWindowsClipboard.cpp @@ -431,7 +431,7 @@ void XWindowsClipboard::doClearCache() { m_checkCache = false; m_cached = false; - for (SInt32 index = 0; index < kNumFormats; ++index) { + for (int32_t index = 0; index < kNumFormats; ++index) { m_data[index] = ""; m_added[index] = false; } @@ -615,7 +615,7 @@ bool XWindowsClipboard::motifOwnsClipboard() const // get the Motif clipboard header property from the root window Atom target; - SInt32 format; + int32_t format; std::string data; Window root = RootWindow(m_display, DefaultScreen(m_display)); if (!XWindowsUtil::getWindowProperty(m_display, root, m_atomMotifClipHeader, &data, &target, &format, False)) { @@ -640,7 +640,7 @@ void XWindowsClipboard::motifFillCache() // get the Motif clipboard header property from the root window Atom target; - SInt32 format; + int32_t format; std::string data; Window root = RootWindow(m_display, DefaultScreen(m_display)); if (!XWindowsUtil::getWindowProperty(m_display, root, m_atomMotifClipHeader, &data, &target, &format, False)) { @@ -676,13 +676,13 @@ void XWindowsClipboard::motifFillCache() } // format list is after static item structure elements - const SInt32 numFormats = item.m_numFormats - item.m_numDeletedFormats; - auto formats = static_cast(static_cast(item.m_size + data.data())); + const int32_t numFormats = item.m_numFormats - item.m_numDeletedFormats; + auto formats = static_cast(static_cast(item.m_size + data.data())); // get the available formats using MotifFormatMap = std::map; MotifFormatMap motifFormats; - for (SInt32 i = 0; i < numFormats; ++i) { + for (int32_t i = 0; i < numFormats; ++i) { // get Motif format property from the root window snprintf(name, buffer_size, "_MOTIF_CLIP_ITEM_%d", formats[i]); Atom atomFormat = XInternAtom(m_display, name, False); @@ -775,7 +775,7 @@ bool XWindowsClipboard::insertMultipleReply(Window requestor, ::Time time, Atom { // get the requested targets Atom target; - SInt32 format; + int32_t format; std::string data; if (!XWindowsUtil::getWindowProperty(m_display, requestor, property, &data, &target, &format, False)) { // can't get the requested targets diff --git a/src/lib/platform/XWindowsClipboard.h b/src/lib/platform/XWindowsClipboard.h index 39a481f06..b5c278465 100644 --- a/src/lib/platform/XWindowsClipboard.h +++ b/src/lib/platform/XWindowsClipboard.h @@ -183,7 +183,7 @@ protected: }; // Motif structure IDs - enum class MotifClip : SInt32 + enum class MotifClip : int32_t { Format = 1, Item = 2, @@ -195,13 +195,13 @@ protected: { public: MotifClip m_id; - SInt32 m_pad1[3]; - SInt32 m_item; - SInt32 m_pad2[4]; - SInt32 m_numItems; - SInt32 m_pad3[3]; - SInt32 m_selectionOwner; // a Window - SInt32 m_pad4[2]; + int32_t m_pad1[3]; + int32_t m_item; + int32_t m_pad2[4]; + int32_t m_numItems; + int32_t m_pad3[3]; + int32_t m_selectionOwner; // a Window + int32_t m_pad4[2]; }; // Motif clip item structure @@ -209,11 +209,11 @@ protected: { public: MotifClip m_id; - SInt32 m_pad1[5]; - SInt32 m_size; - SInt32 m_numFormats; - SInt32 m_numDeletedFormats; - SInt32 m_pad2[6]; + int32_t m_pad1[5]; + int32_t m_size; + int32_t m_numFormats; + int32_t m_numDeletedFormats; + int32_t m_pad2[6]; }; // Motif clip format structure @@ -221,13 +221,13 @@ protected: { public: MotifClip m_id; - SInt32 m_pad1[6]; - SInt32 m_length; - SInt32 m_data; - SInt32 m_type; // an Atom - SInt32 m_pad2[1]; - SInt32 m_deleted; - SInt32 m_pad3[4]; + int32_t m_pad1[6]; + int32_t m_length; + int32_t m_data; + int32_t m_type; // an Atom + int32_t m_pad2[1]; + int32_t m_deleted; + int32_t m_pad3[4]; }; // stores data needed to respond to a selection request diff --git a/src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp b/src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp index ac9c3d77e..48c80336f 100644 --- a/src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp +++ b/src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp @@ -23,14 +23,14 @@ struct CBMPInfoHeader { public: UInt32 biSize; - SInt32 biWidth; - SInt32 biHeight; + int32_t biWidth; + int32_t biHeight; uint16_t biPlanes; uint16_t biBitCount; UInt32 biCompression; UInt32 biSizeImage; - SInt32 biXPelsPerMeter; - SInt32 biYPelsPerMeter; + int32_t biXPelsPerMeter; + int32_t biYPelsPerMeter; UInt32 biClrUsed; UInt32 biClrImportant; }; @@ -44,7 +44,7 @@ static void toLE(uint8_t *&dst, uint16_t src) dst += 2; } -static void toLE(uint8_t *&dst, SInt32 src) +static void toLE(uint8_t *&dst, int32_t src) { dst[0] = static_cast(src & 0xffu); dst[1] = static_cast((src >> 8) & 0xffu); @@ -67,9 +67,9 @@ static inline uint16_t fromLEU16(const uint8_t *data) return static_cast(data[0]) | (static_cast(data[1]) << 8); } -static inline SInt32 fromLES32(const uint8_t *data) +static inline int32_t fromLES32(const uint8_t *data) { - return static_cast( + return static_cast( static_cast(data[0]) | (static_cast(data[1]) << 8) | (static_cast(data[2]) << 16) | (static_cast(data[3]) << 24) ); @@ -150,14 +150,14 @@ std::string XWindowsClipboardAnyBitmapConverter::toIClipboard(const std::string uint8_t infoHeader[40]; uint8_t *dst = infoHeader; toLE(dst, static_cast(40)); - toLE(dst, static_cast(w)); - toLE(dst, static_cast(h)); + toLE(dst, static_cast(w)); + toLE(dst, static_cast(h)); toLE(dst, static_cast(1)); toLE(dst, static_cast(depth)); toLE(dst, static_cast(0)); // BI_RGB toLE(dst, static_cast(image.size())); - toLE(dst, static_cast(2834)); // 72 dpi - toLE(dst, static_cast(2834)); // 72 dpi + toLE(dst, static_cast(2834)); // 72 dpi + toLE(dst, static_cast(2834)); // 72 dpi toLE(dst, static_cast(0)); toLE(dst, static_cast(0)); diff --git a/src/lib/platform/XWindowsKeyState.cpp b/src/lib/platform/XWindowsKeyState.cpp index bc336e646..b6e55831c 100644 --- a/src/lib/platform/XWindowsKeyState.cpp +++ b/src/lib/platform/XWindowsKeyState.cpp @@ -89,7 +89,7 @@ void XWindowsKeyState::init(Display *display, bool useXKB) setActiveGroup(kGroupPoll); } -void XWindowsKeyState::setActiveGroup(SInt32 group) +void XWindowsKeyState::setActiveGroup(int32_t group) { if (group == kGroupPollAndSet) { // we need to set the group to -1 in order for pollActiveGroup() to @@ -135,7 +135,7 @@ bool XWindowsKeyState::mapModifiersToX(KeyModifierMask mask, unsigned int &modif { modifiers = 0; - for (SInt32 i = 0; i < kKeyModifierNumBits; ++i) { + for (int32_t i = 0; i < kKeyModifierNumBits; ++i) { KeyModifierMask bit = (1u << i); if ((mask & bit) != 0) { KeyModifierToXMask::const_iterator j = m_modifierToX.find(bit); @@ -176,7 +176,7 @@ KeyModifierMask XWindowsKeyState::pollActiveModifiers() const return mapModifiersFromX(state); } -SInt32 XWindowsKeyState::pollActiveGroup() const +int32_t XWindowsKeyState::pollActiveGroup() const { // fixed condition where any group < -1 would have undetermined behaviour if (m_group >= 0) { @@ -229,7 +229,7 @@ void XWindowsKeyState::getKeyMap(deskflow::KeyMap &keyMap) updateKeysymMap(keyMap); } -bool XWindowsKeyState::setCurrentLanguageWithDBus(SInt32 group) const +bool XWindowsKeyState::setCurrentLanguageWithDBus(int32_t group) const { QString service = "org.gnome.Shell"; QString path = "/org/gnome/Shell"; @@ -711,7 +711,7 @@ void XWindowsKeyState::updateKeysymMapXKB(deskflow::KeyMap &keyMap) UInt32 modifierBit = XWindowsUtil::getModifierBitForKeySym(keysym); if (isModifier && modifierBit != kKeyModifierBitNone) { item.m_generates = (1u << modifierBit); - for (SInt32 j = 0; j < 8; ++j) { + for (int32_t j = 0; j < 8; ++j) { // skip modifiers this key doesn't generate if ((modifierMask & (1u << j)) == 0) { continue; @@ -789,7 +789,7 @@ void XWindowsKeyState::updateKeysymMapXKB(deskflow::KeyMap &keyMap) } #endif -void XWindowsKeyState::remapKeyModifiers(KeyID id, SInt32 group, deskflow::KeyMap::KeyItem &item, void *vself) +void XWindowsKeyState::remapKeyModifiers(KeyID id, int32_t group, deskflow::KeyMap::KeyItem &item, void *vself) { XWindowsKeyState *self = static_cast(vself); item.m_required = self->mapModifiersFromX(XkbBuildCoreState(item.m_required, group)); diff --git a/src/lib/platform/XWindowsKeyState.h b/src/lib/platform/XWindowsKeyState.h index b9041e719..f06d9b875 100644 --- a/src/lib/platform/XWindowsKeyState.h +++ b/src/lib/platform/XWindowsKeyState.h @@ -67,7 +67,7 @@ public: on X11. If \p group is \c kGroupPollAndSet then this will poll the active group now and use it for future calls to \c pollActiveGroup(). */ - void setActiveGroup(SInt32 group); + void setActiveGroup(int32_t group); //! Set the auto-repeat state /*! @@ -106,7 +106,7 @@ public: // IKeyState overrides virtual bool fakeCtrlAltDel(); virtual KeyModifierMask pollActiveModifiers() const; - virtual SInt32 pollActiveGroup() const; + virtual int32_t pollActiveGroup() const; virtual void pollPressedKeys(KeyButtonSet &pressedKeys) const; protected: @@ -126,9 +126,9 @@ private: /*! Returns the existance of nedeed DBus interface. */ - bool setCurrentLanguageWithDBus(SInt32 group) const; + bool setCurrentLanguageWithDBus(int32_t group) const; - static void remapKeyModifiers(KeyID, SInt32, deskflow::KeyMap::KeyItem &, void *); + static void remapKeyModifiers(KeyID, int32_t, deskflow::KeyMap::KeyItem &, void *); private: struct XKBModifierInfo @@ -154,7 +154,7 @@ private: #if HAVE_XKB_EXTENSION XkbDescPtr m_xkb; #endif - SInt32 m_group; + int32_t m_group; XKBModifierMap m_lastGoodXKBModifiers; NonXKBModifierMap m_lastGoodNonXKBModifiers; @@ -172,11 +172,11 @@ private: #ifdef TEST_ENV public: - SInt32 group() const + int32_t group() const { return m_group; } - void group(const SInt32 &group) + void group(const int32_t &group) { m_group = group; } diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 11f35130f..f844e9d22 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -498,7 +498,7 @@ bool XWindowsScreen::getClipboard(ClipboardID id, IClipboard *clipboard) const return Clipboard::copy(clipboard, m_clipboard[id], timestamp); } -void XWindowsScreen::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const +void XWindowsScreen::getShape(int32_t &x, int32_t &y, int32_t &w, int32_t &h) const { x = m_x; y = m_y; @@ -506,7 +506,7 @@ void XWindowsScreen::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const h = m_h; } -void XWindowsScreen::getCursorPos(SInt32 &x, SInt32 &y) const +void XWindowsScreen::getCursorPos(int32_t &x, int32_t &y) const { Window root, window; int mx, my, xWindow, yWindow; @@ -525,7 +525,7 @@ void XWindowsScreen::reconfigure(UInt32) // do nothing } -void XWindowsScreen::warpCursor(SInt32 x, SInt32 y) +void XWindowsScreen::warpCursor(int32_t x, int32_t y) { // warp mouse warpCursorNoFlush(x, y); @@ -770,7 +770,7 @@ void XWindowsScreen::fakeInputEnd() // FIXME -- not implemented } -SInt32 XWindowsScreen::getJumpZoneSize() const +int32_t XWindowsScreen::getJumpZoneSize() const { return 1; } @@ -788,7 +788,7 @@ bool XWindowsScreen::isAnyMouseButtonDown(UInt32 &buttonID) const return false; } -void XWindowsScreen::getCursorCenter(SInt32 &x, SInt32 &y) const +void XWindowsScreen::getCursorCenter(int32_t &x, int32_t &y) const { x = m_xCenter; y = m_yCenter; @@ -803,7 +803,7 @@ void XWindowsScreen::fakeMouseButton(ButtonID button, bool press) } } -void XWindowsScreen::fakeMouseMove(SInt32 x, SInt32 y) +void XWindowsScreen::fakeMouseMove(int32_t x, int32_t y) { if (m_xinerama && m_xtestIsXineramaUnaware) { XWarpPointer(m_display, None, m_root, 0, 0, 0, 0, x, y); @@ -813,14 +813,14 @@ void XWindowsScreen::fakeMouseMove(SInt32 x, SInt32 y) XFlush(m_display); } -void XWindowsScreen::fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const +void XWindowsScreen::fakeMouseRelativeMove(int32_t dx, int32_t dy) const { // FIXME -- ignore xinerama for now XTestFakeRelativeMotionEvent(m_display, dx, dy, CurrentTime); XFlush(m_display); } -void XWindowsScreen::fakeMouseWheel(SInt32, SInt32 yDelta) const +void XWindowsScreen::fakeMouseWheel(int32_t, int32_t yDelta) const { // XXX -- support x-axis scrolling if (yDelta == 0) { @@ -965,7 +965,7 @@ void XWindowsScreen::saveShape() #endif } -void XWindowsScreen::setShape(SInt32 width, SInt32 height) +void XWindowsScreen::setShape(int32_t width, int32_t height) { // set shape m_x = 0; @@ -1021,7 +1021,7 @@ Window XWindowsScreen::openWindow() const attr.cursor = createBlankCursor(); // adjust attributes and get size and shape - SInt32 x, y, w, h; + int32_t x, y, w, h; if (m_isPrimary) { // grab window attributes. this window is used to capture user // input when the user is focused on another client. it covers @@ -1371,7 +1371,7 @@ void XWindowsScreen::handleSystemEvent(const Event &event, void *) case XkbStateNotify: LOG((CLOG_INFO "group change: %d", xkbEvent->state.group)); - m_keyState->setActiveGroup((SInt32)xkbEvent->state.group); + m_keyState->setActiveGroup((int32_t)xkbEvent->state.group); return; } } @@ -1538,8 +1538,8 @@ void XWindowsScreen::onMouseMove(const XMotionEvent &xmotion) // compute motion delta (relative to the last known // mouse position) - SInt32 x = xmotion.x_root - m_xCursor; - SInt32 y = xmotion.y_root - m_yCursor; + int32_t x = xmotion.x_root - m_xCursor; + int32_t y = xmotion.y_root - m_yCursor; // save position to compute delta of next motion m_xCursor = xmotion.x_root; @@ -1577,7 +1577,7 @@ void XWindowsScreen::onMouseMove(const XMotionEvent &xmotion) // pixel) but the latter is a PITA. to work around // it we only warp when the mouse has moved more // than s_size pixels from the center. - static const SInt32 s_size = 32; + static const int32_t s_size = 32; if (xmotion.x_root - m_xCenter < -s_size || xmotion.x_root - m_xCenter > s_size || xmotion.y_root - m_yCenter < -s_size || xmotion.y_root - m_yCenter > s_size) { warpCursorNoFlush(m_xCenter, m_yCenter); @@ -1843,7 +1843,7 @@ unsigned int XWindowsScreen::mapButtonToX(ButtonID id) const return static_cast(id); } -void XWindowsScreen::warpCursorNoFlush(SInt32 x, SInt32 y) +void XWindowsScreen::warpCursorNoFlush(int32_t x, int32_t y) { assert(m_window != None); diff --git a/src/lib/platform/XWindowsScreen.h b/src/lib/platform/XWindowsScreen.h index 8a4ca245c..bebe8fffa 100644 --- a/src/lib/platform/XWindowsScreen.h +++ b/src/lib/platform/XWindowsScreen.h @@ -54,25 +54,25 @@ public: // IScreen overrides void *getEventTarget() const override; bool getClipboard(ClipboardID id, IClipboard *) const override; - void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const override; - void getCursorPos(SInt32 &x, SInt32 &y) const override; + void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override; + void getCursorPos(int32_t &x, int32_t &y) const override; // IPrimaryScreen overrides void reconfigure(UInt32 activeSides) override; - void warpCursor(SInt32 x, SInt32 y) override; + void warpCursor(int32_t x, int32_t y) override; UInt32 registerHotKey(KeyID key, KeyModifierMask mask) override; void unregisterHotKey(UInt32 id) override; void fakeInputBegin() override; void fakeInputEnd() override; - SInt32 getJumpZoneSize() const override; + int32_t getJumpZoneSize() const override; bool isAnyMouseButtonDown(UInt32 &buttonID) const override; - void getCursorCenter(SInt32 &x, SInt32 &y) const override; + void getCursorCenter(int32_t &x, int32_t &y) const override; // ISecondaryScreen overrides void fakeMouseButton(ButtonID id, bool press) override; - void fakeMouseMove(SInt32 x, SInt32 y) override; - void fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const override; - void fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const override; + void fakeMouseMove(int32_t x, int32_t y) override; + void fakeMouseRelativeMove(int32_t dx, int32_t dy) const override; + void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const override; // IPlatformScreen overrides void enable() override; @@ -131,7 +131,7 @@ private: Display *openDisplay(const char *displayName); void saveShape(); - void setShape(SInt32 width, SInt32 height); + void setShape(int32_t width, int32_t height); Window openWindow() const; void openIM(); @@ -154,7 +154,7 @@ private: ButtonID mapButtonFromX(const XButtonEvent *) const; unsigned int mapButtonToX(ButtonID id) const; - void warpCursorNoFlush(SInt32 x, SInt32 y); + void warpCursorNoFlush(int32_t x, int32_t y); void refreshKeyboard(XEvent *); @@ -190,12 +190,12 @@ private: bool m_isOnScreen; // screen shape stuff - SInt32 m_x, m_y; - SInt32 m_w, m_h; - SInt32 m_xCenter, m_yCenter; + int32_t m_x, m_y; + int32_t m_w, m_h; + int32_t m_xCenter, m_yCenter; // last mouse position - SInt32 m_xCursor, m_yCursor; + int32_t m_xCursor, m_yCursor; // keyboard stuff XWindowsKeyState *m_keyState; diff --git a/src/lib/platform/XWindowsScreenSaver.h b/src/lib/platform/XWindowsScreenSaver.h index a62847895..a5bc7a30f 100644 --- a/src/lib/platform/XWindowsScreenSaver.h +++ b/src/lib/platform/XWindowsScreenSaver.h @@ -169,7 +169,7 @@ private: // fake mouse motion position for suppressing the screen saver. // xscreensaver since 2.21 requires the mouse to move more than 10 // pixels to be considered significant. - SInt32 m_disablePos; + int32_t m_disablePos; IEventQueue *m_events; }; diff --git a/src/lib/platform/XWindowsUtil.cpp b/src/lib/platform/XWindowsUtil.cpp index 1093544aa..aa343b029 100644 --- a/src/lib/platform/XWindowsUtil.cpp +++ b/src/lib/platform/XWindowsUtil.cpp @@ -1515,7 +1515,7 @@ static const KeySym s_map1008FF[] = { XWindowsUtil::KeySymMap XWindowsUtil::s_keySymToUCS4; bool XWindowsUtil::getWindowProperty( - Display *display, Window window, Atom property, std::string *data, Atom *type, SInt32 *format, bool deleteProperty + Display *display, Window window, Atom property, std::string *data, Atom *type, int32_t *format, bool deleteProperty ) { assert(display != NULL); @@ -1587,7 +1587,7 @@ bool XWindowsUtil::getWindowProperty( *type = actualType; } if (format != NULL) { - *format = static_cast(actualDatumSize); + *format = static_cast(actualDatumSize); } if (okay) { @@ -1601,7 +1601,7 @@ bool XWindowsUtil::getWindowProperty( } bool XWindowsUtil::setWindowProperty( - Display *display, Window window, Atom property, const void *vdata, UInt32 size, Atom type, SInt32 format + Display *display, Window window, Atom property, const void *vdata, UInt32 size, Atom type, int32_t format ) { const UInt32 length = 4 * XMaxRequestSize(display); diff --git a/src/lib/platform/XWindowsUtil.h b/src/lib/platform/XWindowsUtil.h index a809ce1f8..04d7a3bc3 100644 --- a/src/lib/platform/XWindowsUtil.h +++ b/src/lib/platform/XWindowsUtil.h @@ -45,7 +45,7 @@ public: property is deleted after being read. */ static bool getWindowProperty( - Display *, Window window, Atom property, std::string *data, Atom *type, SInt32 *format, bool deleteProperty + Display *, Window window, Atom property, std::string *data, Atom *type, int32_t *format, bool deleteProperty ); //! Set property @@ -54,7 +54,7 @@ public: \c data. */ static bool - setWindowProperty(Display *, Window window, Atom property, const void *data, UInt32 size, Atom type, SInt32 format); + setWindowProperty(Display *, Window window, Atom property, const void *data, UInt32 size, Atom type, int32_t format); //! Get X server time /*! diff --git a/src/lib/server/BaseClientProxy.cpp b/src/lib/server/BaseClientProxy.cpp index 1e15081c4..eaec2e735 100644 --- a/src/lib/server/BaseClientProxy.cpp +++ b/src/lib/server/BaseClientProxy.cpp @@ -32,13 +32,13 @@ BaseClientProxy::~BaseClientProxy() // do nothing } -void BaseClientProxy::setJumpCursorPos(SInt32 x, SInt32 y) +void BaseClientProxy::setJumpCursorPos(int32_t x, int32_t y) { m_x = x; m_y = y; } -void BaseClientProxy::getJumpCursorPos(SInt32 &x, SInt32 &y) const +void BaseClientProxy::getJumpCursorPos(int32_t &x, int32_t &y) const { x = m_x; y = m_y; diff --git a/src/lib/server/BaseClientProxy.h b/src/lib/server/BaseClientProxy.h index b89322325..5fdd890e3 100644 --- a/src/lib/server/BaseClientProxy.h +++ b/src/lib/server/BaseClientProxy.h @@ -41,7 +41,7 @@ public: /*! Save the position of the cursor when jumping from client. */ - void setJumpCursorPos(SInt32 x, SInt32 y); + void setJumpCursorPos(int32_t x, int32_t y); //@} //! @name accessors @@ -51,7 +51,7 @@ public: /*! Get the position of the cursor when last jumping from client. */ - void getJumpCursorPos(SInt32 &x, SInt32 &y) const; + void getJumpCursorPos(int32_t &x, int32_t &y) const; //! Get cursor position /*! @@ -67,23 +67,23 @@ public: // IScreen virtual void *getEventTarget() const = 0; virtual bool getClipboard(ClipboardID id, IClipboard *) const = 0; - virtual void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const = 0; - virtual void getCursorPos(SInt32 &x, SInt32 &y) const = 0; + virtual void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const = 0; + virtual void getCursorPos(int32_t &x, int32_t &y) const = 0; // IClient overrides - virtual void enter(SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) = 0; + virtual void enter(int32_t xAbs, int32_t yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) = 0; virtual bool leave() = 0; virtual void setClipboard(ClipboardID, const IClipboard *) = 0; virtual void grabClipboard(ClipboardID) = 0; virtual void setClipboardDirty(ClipboardID, bool) = 0; virtual void keyDown(KeyID, KeyModifierMask, KeyButton, const std::string &) = 0; - virtual void keyRepeat(KeyID, KeyModifierMask, SInt32 count, KeyButton, const std::string &lang) = 0; + virtual void keyRepeat(KeyID, KeyModifierMask, int32_t count, KeyButton, const std::string &lang) = 0; virtual void keyUp(KeyID, KeyModifierMask, KeyButton) = 0; virtual void mouseDown(ButtonID) = 0; virtual void mouseUp(ButtonID) = 0; - virtual void mouseMove(SInt32 xAbs, SInt32 yAbs) = 0; - virtual void mouseRelativeMove(SInt32 xRel, SInt32 yRel) = 0; - virtual void mouseWheel(SInt32 xDelta, SInt32 yDelta) = 0; + virtual void mouseMove(int32_t xAbs, int32_t yAbs) = 0; + virtual void mouseRelativeMove(int32_t xRel, int32_t yRel) = 0; + virtual void mouseWheel(int32_t xDelta, int32_t yDelta) = 0; virtual void screensaver(bool activate) = 0; virtual void resetOptions() = 0; virtual void setOptions(const OptionsList &options) = 0; @@ -96,5 +96,5 @@ public: private: std::string m_name; - SInt32 m_x, m_y; + int32_t m_x, m_y; }; diff --git a/src/lib/server/ClientProxy.h b/src/lib/server/ClientProxy.h index 313f3acd2..4595e0030 100644 --- a/src/lib/server/ClientProxy.h +++ b/src/lib/server/ClientProxy.h @@ -65,23 +65,23 @@ public: // IScreen void *getEventTarget() const override; bool getClipboard(ClipboardID id, IClipboard *) const override = 0; - void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const override = 0; - void getCursorPos(SInt32 &x, SInt32 &y) const override = 0; + void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override = 0; + void getCursorPos(int32_t &x, int32_t &y) const override = 0; // IClient overrides - void enter(SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) override = 0; + void enter(int32_t xAbs, int32_t yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) override = 0; bool leave() override = 0; void setClipboard(ClipboardID, const IClipboard *) override = 0; void grabClipboard(ClipboardID) override = 0; void setClipboardDirty(ClipboardID, bool) override = 0; void keyDown(KeyID, KeyModifierMask, KeyButton, const std::string &) override = 0; - void keyRepeat(KeyID, KeyModifierMask, SInt32 count, KeyButton, const std::string &lang) override = 0; + void keyRepeat(KeyID, KeyModifierMask, int32_t count, KeyButton, const std::string &lang) override = 0; void keyUp(KeyID, KeyModifierMask, KeyButton) override = 0; void mouseDown(ButtonID) override = 0; void mouseUp(ButtonID) override = 0; - void mouseMove(SInt32 xAbs, SInt32 yAbs) override = 0; - void mouseRelativeMove(SInt32 xRel, SInt32 yRel) override = 0; - void mouseWheel(SInt32 xDelta, SInt32 yDelta) override = 0; + void mouseMove(int32_t xAbs, int32_t yAbs) override = 0; + void mouseRelativeMove(int32_t xRel, int32_t yRel) override = 0; + void mouseWheel(int32_t xDelta, int32_t yDelta) override = 0; void screensaver(bool activate) override = 0; void resetOptions() override = 0; void setOptions(const OptionsList &options) override = 0; diff --git a/src/lib/server/ClientProxy1_0.cpp b/src/lib/server/ClientProxy1_0.cpp index 20491a13c..7f844a21c 100644 --- a/src/lib/server/ClientProxy1_0.cpp +++ b/src/lib/server/ClientProxy1_0.cpp @@ -229,7 +229,7 @@ bool ClientProxy1_0::getClipboard(ClipboardID id, IClipboard *clipboard) const return true; } -void ClientProxy1_0::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const +void ClientProxy1_0::getShape(int32_t &x, int32_t &y, int32_t &w, int32_t &h) const { x = m_info.m_x; y = m_info.m_y; @@ -237,14 +237,14 @@ void ClientProxy1_0::getShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) const h = m_info.m_h; } -void ClientProxy1_0::getCursorPos(SInt32 &x, SInt32 &y) const +void ClientProxy1_0::getCursorPos(int32_t &x, int32_t &y) const { // note -- this returns the cursor pos from when we last got client info x = m_info.m_mx; y = m_info.m_my; } -void ClientProxy1_0::enter(SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool) +void ClientProxy1_0::enter(int32_t xAbs, int32_t yAbs, UInt32 seqNum, KeyModifierMask mask, bool) { LOG((CLOG_DEBUG1 "send enter to \"%s\", %d,%d %d %04x", getName().c_str(), xAbs, yAbs, seqNum, mask)); ProtocolUtil::writef(getStream(), kMsgCEnter, xAbs, yAbs, seqNum, mask); @@ -284,7 +284,7 @@ void ClientProxy1_0::keyDown(KeyID key, KeyModifierMask mask, KeyButton, const s ProtocolUtil::writef(getStream(), kMsgDKeyDown1_0, key, mask); } -void ClientProxy1_0::keyRepeat(KeyID key, KeyModifierMask mask, SInt32 count, KeyButton, const std::string &) +void ClientProxy1_0::keyRepeat(KeyID key, KeyModifierMask mask, int32_t count, KeyButton, const std::string &) { LOG((CLOG_DEBUG1 "send key repeat to \"%s\" id=%d, mask=0x%04x, count=%d", getName().c_str(), key, mask, count)); ProtocolUtil::writef(getStream(), kMsgDKeyRepeat1_0, key, mask, count); @@ -308,18 +308,18 @@ void ClientProxy1_0::mouseUp(ButtonID button) ProtocolUtil::writef(getStream(), kMsgDMouseUp, button); } -void ClientProxy1_0::mouseMove(SInt32 xAbs, SInt32 yAbs) +void ClientProxy1_0::mouseMove(int32_t xAbs, int32_t yAbs) { LOG((CLOG_DEBUG2 "send mouse move to \"%s\" %d,%d", getName().c_str(), xAbs, yAbs)); ProtocolUtil::writef(getStream(), kMsgDMouseMove, xAbs, yAbs); } -void ClientProxy1_0::mouseRelativeMove(SInt32, SInt32) +void ClientProxy1_0::mouseRelativeMove(int32_t, int32_t) { // ignore -- not supported in protocol 1.0 } -void ClientProxy1_0::mouseWheel(SInt32, SInt32 yDelta) +void ClientProxy1_0::mouseWheel(int32_t, int32_t yDelta) { // clients prior to 1.3 only support the y axis LOG((CLOG_DEBUG2 "send mouse wheel to \"%s\" %+d", getName().c_str(), yDelta)); diff --git a/src/lib/server/ClientProxy1_0.h b/src/lib/server/ClientProxy1_0.h index 7de891f8c..6fa09e67f 100644 --- a/src/lib/server/ClientProxy1_0.h +++ b/src/lib/server/ClientProxy1_0.h @@ -40,23 +40,23 @@ public: // IScreen bool getClipboard(ClipboardID id, IClipboard *) const override; - void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const override; - void getCursorPos(SInt32 &x, SInt32 &y) const override; + void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override; + void getCursorPos(int32_t &x, int32_t &y) const override; // IClient overrides - void enter(SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) override; + void enter(int32_t xAbs, int32_t yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) override; bool leave() override; void setClipboard(ClipboardID, const IClipboard *) override; void grabClipboard(ClipboardID) override; void setClipboardDirty(ClipboardID, bool) override; void keyDown(KeyID, KeyModifierMask, KeyButton, const std::string &) override; - void keyRepeat(KeyID, KeyModifierMask, SInt32 count, KeyButton, const std::string &) override; + void keyRepeat(KeyID, KeyModifierMask, int32_t count, KeyButton, const std::string &) override; void keyUp(KeyID, KeyModifierMask, KeyButton) override; void mouseDown(ButtonID) override; void mouseUp(ButtonID) override; - void mouseMove(SInt32 xAbs, SInt32 yAbs) override; - void mouseRelativeMove(SInt32 xRel, SInt32 yRel) override; - void mouseWheel(SInt32 xDelta, SInt32 yDelta) override; + void mouseMove(int32_t xAbs, int32_t yAbs) override; + void mouseRelativeMove(int32_t xRel, int32_t yRel) override; + void mouseWheel(int32_t xDelta, int32_t yDelta) override; void screensaver(bool activate) override; void resetOptions() override; void setOptions(const OptionsList &options) override; diff --git a/src/lib/server/ClientProxy1_1.cpp b/src/lib/server/ClientProxy1_1.cpp index 5ee633340..c4c34856b 100644 --- a/src/lib/server/ClientProxy1_1.cpp +++ b/src/lib/server/ClientProxy1_1.cpp @@ -45,7 +45,9 @@ void ClientProxy1_1::keyDown(KeyID key, KeyModifierMask mask, KeyButton button, ProtocolUtil::writef(getStream(), kMsgDKeyDown, key, mask, button); } -void ClientProxy1_1::keyRepeat(KeyID key, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang) +void ClientProxy1_1::keyRepeat( + KeyID key, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang +) { LOG( (CLOG_DEBUG1 "send key repeat to \"%s\" id=%d, mask=0x%04x, count=%d, " diff --git a/src/lib/server/ClientProxy1_1.h b/src/lib/server/ClientProxy1_1.h index 88133e216..094c4c1ef 100644 --- a/src/lib/server/ClientProxy1_1.h +++ b/src/lib/server/ClientProxy1_1.h @@ -29,6 +29,6 @@ public: // IClient overrides virtual void keyDown(KeyID, KeyModifierMask, KeyButton, const std::string &); - virtual void keyRepeat(KeyID, KeyModifierMask, SInt32 count, KeyButton, const std::string &); + virtual void keyRepeat(KeyID, KeyModifierMask, int32_t count, KeyButton, const std::string &); virtual void keyUp(KeyID, KeyModifierMask, KeyButton); }; diff --git a/src/lib/server/ClientProxy1_2.cpp b/src/lib/server/ClientProxy1_2.cpp index 7c6e8565f..37472cbf3 100644 --- a/src/lib/server/ClientProxy1_2.cpp +++ b/src/lib/server/ClientProxy1_2.cpp @@ -36,7 +36,7 @@ ClientProxy1_2::~ClientProxy1_2() // do nothing } -void ClientProxy1_2::mouseRelativeMove(SInt32 xRel, SInt32 yRel) +void ClientProxy1_2::mouseRelativeMove(int32_t xRel, int32_t yRel) { LOG((CLOG_DEBUG2 "send mouse relative move to \"%s\" %d,%d", getName().c_str(), xRel, yRel)); ProtocolUtil::writef(getStream(), kMsgDMouseRelMove, xRel, yRel); diff --git a/src/lib/server/ClientProxy1_2.h b/src/lib/server/ClientProxy1_2.h index db75515a0..e87f286d9 100644 --- a/src/lib/server/ClientProxy1_2.h +++ b/src/lib/server/ClientProxy1_2.h @@ -30,5 +30,5 @@ public: ~ClientProxy1_2(); // IClient overrides - virtual void mouseRelativeMove(SInt32 xRel, SInt32 yRel); + virtual void mouseRelativeMove(int32_t xRel, int32_t yRel); }; diff --git a/src/lib/server/ClientProxy1_3.cpp b/src/lib/server/ClientProxy1_3.cpp index 816d3ab36..2ae2977d9 100644 --- a/src/lib/server/ClientProxy1_3.cpp +++ b/src/lib/server/ClientProxy1_3.cpp @@ -45,7 +45,7 @@ ClientProxy1_3::~ClientProxy1_3() removeHeartbeatTimer(); } -void ClientProxy1_3::mouseWheel(SInt32 xDelta, SInt32 yDelta) +void ClientProxy1_3::mouseWheel(int32_t xDelta, int32_t yDelta) { LOG((CLOG_DEBUG2 "send mouse wheel to \"%s\" %+d,%+d", getName().c_str(), xDelta, yDelta)); ProtocolUtil::writef(getStream(), kMsgDMouseWheel, xDelta, yDelta); diff --git a/src/lib/server/ClientProxy1_3.h b/src/lib/server/ClientProxy1_3.h index bff39d2b7..418b8d7ec 100644 --- a/src/lib/server/ClientProxy1_3.h +++ b/src/lib/server/ClientProxy1_3.h @@ -33,7 +33,7 @@ public: ClientProxy1_3 &operator=(ClientProxy1_3 &&) = delete; // IClient overrides - virtual void mouseWheel(SInt32 xDelta, SInt32 yDelta); + virtual void mouseWheel(int32_t xDelta, int32_t yDelta); void handleKeepAlive(const Event &, void *); diff --git a/src/lib/server/ClientProxy1_4.cpp b/src/lib/server/ClientProxy1_4.cpp index d7bc17264..bdc2455f4 100644 --- a/src/lib/server/ClientProxy1_4.cpp +++ b/src/lib/server/ClientProxy1_4.cpp @@ -47,7 +47,9 @@ void ClientProxy1_4::keyDown(KeyID key, KeyModifierMask mask, KeyButton button, ClientProxy1_3::keyDown(key, mask, button, lang); } -void ClientProxy1_4::keyRepeat(KeyID key, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang) +void ClientProxy1_4::keyRepeat( + KeyID key, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang +) { ClientProxy1_3::keyRepeat(key, mask, count, button, lang); } diff --git a/src/lib/server/ClientProxy1_4.h b/src/lib/server/ClientProxy1_4.h index 25944717d..19c163b31 100644 --- a/src/lib/server/ClientProxy1_4.h +++ b/src/lib/server/ClientProxy1_4.h @@ -42,7 +42,7 @@ public: // IClient overrides virtual void keyDown(KeyID key, KeyModifierMask mask, KeyButton button, const std::string &); - virtual void keyRepeat(KeyID key, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang); + virtual void keyRepeat(KeyID key, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang); virtual void keyUp(KeyID key, KeyModifierMask mask, KeyButton button); virtual void keepAlive(); diff --git a/src/lib/server/Config.cpp b/src/lib/server/Config.cpp index 53fccbd11..e89aea2da 100644 --- a/src/lib/server/Config.cpp +++ b/src/lib/server/Config.cpp @@ -1704,7 +1704,7 @@ std::ostream &operator<<(std::ostream &s, const Config &config) // ConfigReadContext // -ConfigReadContext::ConfigReadContext(std::istream &s, SInt32 firstLine) : m_stream(s), m_line(firstLine - 1) +ConfigReadContext::ConfigReadContext(std::istream &s, int32_t firstLine) : m_stream(s), m_line(firstLine - 1) { // do nothing } diff --git a/src/lib/server/Config.h b/src/lib/server/Config.h index 8452cef16..dd511dba1 100644 --- a/src/lib/server/Config.h +++ b/src/lib/server/Config.h @@ -526,7 +526,7 @@ class ConfigReadContext public: using ArgList = std::vector; - ConfigReadContext(std::istream &, SInt32 firstLine = 1); + ConfigReadContext(std::istream &, int32_t firstLine = 1); ~ConfigReadContext(); bool readLine(std::string &); @@ -562,7 +562,7 @@ private: private: std::istream &m_stream; - SInt32 m_line; + int32_t m_line; }; //! Configuration stream read exception diff --git a/src/lib/server/PrimaryClient.cpp b/src/lib/server/PrimaryClient.cpp index 1bc90756d..9f1791f57 100644 --- a/src/lib/server/PrimaryClient.cpp +++ b/src/lib/server/PrimaryClient.cpp @@ -71,12 +71,12 @@ void PrimaryClient::fakeInputEnd() } } -SInt32 PrimaryClient::getJumpZoneSize() const +int32_t PrimaryClient::getJumpZoneSize() const { return m_screen->getJumpZoneSize(); } -void PrimaryClient::getCursorCenter(SInt32 &x, SInt32 &y) const +void PrimaryClient::getCursorCenter(int32_t &x, int32_t &y) const { m_screen->getCursorCenter(x, y); } @@ -101,12 +101,12 @@ bool PrimaryClient::getClipboard(ClipboardID id, IClipboard *clipboard) const return m_screen->getClipboard(id, clipboard); } -void PrimaryClient::getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const +void PrimaryClient::getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const { m_screen->getShape(x, y, width, height); } -void PrimaryClient::getCursorPos(SInt32 &x, SInt32 &y) const +void PrimaryClient::getCursorPos(int32_t &x, int32_t &y) const { m_screen->getCursorPos(x, y); } @@ -121,7 +121,7 @@ void PrimaryClient::disable() m_screen->disable(); } -void PrimaryClient::enter(SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool screensaver) +void PrimaryClient::enter(int32_t xAbs, int32_t yAbs, UInt32 seqNum, KeyModifierMask mask, bool screensaver) { m_screen->setSequenceNumber(seqNum); if (!screensaver) { @@ -172,7 +172,7 @@ void PrimaryClient::keyDown(KeyID key, KeyModifierMask mask, KeyButton button, c } } -void PrimaryClient::keyRepeat(KeyID, KeyModifierMask, SInt32, KeyButton, const std::string &) +void PrimaryClient::keyRepeat(KeyID, KeyModifierMask, int32_t, KeyButton, const std::string &) { // ignore } @@ -198,17 +198,17 @@ void PrimaryClient::mouseUp(ButtonID) // ignore } -void PrimaryClient::mouseMove(SInt32 x, SInt32 y) +void PrimaryClient::mouseMove(int32_t x, int32_t y) { m_screen->warpCursor(x, y); } -void PrimaryClient::mouseRelativeMove(SInt32, SInt32) +void PrimaryClient::mouseRelativeMove(int32_t, int32_t) { // ignore } -void PrimaryClient::mouseWheel(SInt32, SInt32) +void PrimaryClient::mouseWheel(int32_t, int32_t) { // ignore } diff --git a/src/lib/server/PrimaryClient.h b/src/lib/server/PrimaryClient.h index 6c4c99ec4..65a31ea41 100644 --- a/src/lib/server/PrimaryClient.h +++ b/src/lib/server/PrimaryClient.h @@ -92,7 +92,7 @@ public: Return the jump zone size, the size of the regions on the edges of the screen that cause the cursor to jump to another screen. */ - SInt32 getJumpZoneSize() const; + int32_t getJumpZoneSize() const; //! Get cursor center position /*! @@ -100,7 +100,7 @@ public: cursor to compute cursor motion deltas and should be far from the edges of the screen, typically the center. */ - void getCursorCenter(SInt32 &x, SInt32 &y) const; + void getCursorCenter(int32_t &x, int32_t &y) const; //! Get toggle key state /*! @@ -123,23 +123,23 @@ public: // IScreen overrides void *getEventTarget() const override; bool getClipboard(ClipboardID id, IClipboard *) const override; - void getShape(SInt32 &x, SInt32 &y, SInt32 &width, SInt32 &height) const override; - void getCursorPos(SInt32 &x, SInt32 &y) const override; + void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override; + void getCursorPos(int32_t &x, int32_t &y) const override; // IClient overrides - void enter(SInt32 xAbs, SInt32 yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) override; + void enter(int32_t xAbs, int32_t yAbs, UInt32 seqNum, KeyModifierMask mask, bool forScreensaver) override; bool leave() override; void setClipboard(ClipboardID, const IClipboard *) override; void grabClipboard(ClipboardID) override; void setClipboardDirty(ClipboardID, bool) override; void keyDown(KeyID, KeyModifierMask, KeyButton, const std::string &) override; - void keyRepeat(KeyID, KeyModifierMask, SInt32 count, KeyButton, const std::string &) override; + void keyRepeat(KeyID, KeyModifierMask, int32_t count, KeyButton, const std::string &) override; void keyUp(KeyID, KeyModifierMask, KeyButton) override; void mouseDown(ButtonID) override; void mouseUp(ButtonID) override; - void mouseMove(SInt32 xAbs, SInt32 yAbs) override; - void mouseRelativeMove(SInt32 xRel, SInt32 yRel) override; - void mouseWheel(SInt32 xDelta, SInt32 yDelta) override; + void mouseMove(int32_t xAbs, int32_t yAbs) override; + void mouseRelativeMove(int32_t xRel, int32_t yRel) override; + void mouseWheel(int32_t xDelta, int32_t yDelta) override; void screensaver(bool activate) override; void resetOptions() override; void setOptions(const OptionsList &options) override; @@ -160,5 +160,5 @@ public: private: deskflow::Screen *m_screen; bool m_clipboardDirty[kClipboardEnd]; - SInt32 m_fakeInputCount; + int32_t m_fakeInputCount; }; diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index 6431a7931..20fe27601 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -355,7 +355,7 @@ std::string Server::protocolString() const UInt32 Server::getNumClients() const { - return (SInt32)m_clients.size(); + return (int32_t)m_clients.size(); } void Server::getClients(std::vector &list) const @@ -422,7 +422,7 @@ bool Server::isLockedToScreen() const return false; } -SInt32 Server::getJumpZoneSize(BaseClientProxy *client) const +int32_t Server::getJumpZoneSize(BaseClientProxy *client) const { if (client == m_primaryClient) { return m_primaryClient->getJumpZoneSize(); @@ -431,11 +431,11 @@ SInt32 Server::getJumpZoneSize(BaseClientProxy *client) const } } -void Server::switchScreen(BaseClientProxy *dst, SInt32 x, SInt32 y, bool forScreensaver) +void Server::switchScreen(BaseClientProxy *dst, int32_t x, int32_t y, bool forScreensaver) { assert(dst != NULL); - SInt32 dx, dy, dw, dh; + int32_t dx, dy, dw, dh; dst->getShape(dx, dy, dw, dh); // any of these conditions seem to trigger when the portal permission dialog @@ -551,15 +551,15 @@ void Server::jumpToScreen(BaseClientProxy *newScreen) m_active->setJumpCursorPos(m_x, m_y); // get the last cursor position on the target screen - SInt32 x, y; + int32_t x, y; newScreen->getJumpCursorPos(x, y); switchScreen(newScreen, x, y, false); } -float Server::mapToFraction(BaseClientProxy *client, EDirection dir, SInt32 x, SInt32 y) const +float Server::mapToFraction(BaseClientProxy *client, EDirection dir, int32_t x, int32_t y) const { - SInt32 sx, sy, sw, sh; + int32_t sx, sy, sw, sh; client->getShape(sx, sy, sw, sh); switch (dir) { case kLeft: @@ -577,19 +577,19 @@ float Server::mapToFraction(BaseClientProxy *client, EDirection dir, SInt32 x, S return 0.0f; } -void Server::mapToPixel(BaseClientProxy *client, EDirection dir, float f, SInt32 &x, SInt32 &y) const +void Server::mapToPixel(BaseClientProxy *client, EDirection dir, float f, int32_t &x, int32_t &y) const { - SInt32 sx, sy, sw, sh; + int32_t sx, sy, sw, sh; client->getShape(sx, sy, sw, sh); switch (dir) { case kLeft: case kRight: - y = static_cast(f * sh) + sy; + y = static_cast(f * sh) + sy; break; case kTop: case kBottom: - x = static_cast(f * sw) + sx; + x = static_cast(f * sw) + sx; break; case kNoDirection: @@ -605,7 +605,7 @@ bool Server::hasAnyNeighbor(BaseClientProxy *client, EDirection dir) const return m_config->hasNeighbor(getName(client), dir); } -BaseClientProxy *Server::getNeighbor(BaseClientProxy *src, EDirection dir, SInt32 &x, SInt32 &y) const +BaseClientProxy *Server::getNeighbor(BaseClientProxy *src, EDirection dir, int32_t &x, int32_t &y) const { // note -- must be locked on entry @@ -651,7 +651,7 @@ BaseClientProxy *Server::getNeighbor(BaseClientProxy *src, EDirection dir, SInt3 } } -BaseClientProxy *Server::mapToNeighbor(BaseClientProxy *src, EDirection srcSide, SInt32 &x, SInt32 &y) const +BaseClientProxy *Server::mapToNeighbor(BaseClientProxy *src, EDirection srcSide, int32_t &x, int32_t &y) const { // note -- must be locked on entry @@ -664,7 +664,7 @@ BaseClientProxy *Server::mapToNeighbor(BaseClientProxy *src, EDirection srcSide, } // get the source screen's size - SInt32 dx, dy, dw, dh; + int32_t dx, dy, dw, dh; BaseClientProxy *lastGoodScreen = src; lastGoodScreen->getShape(dx, dy, dw, dh); @@ -756,7 +756,7 @@ BaseClientProxy *Server::mapToNeighbor(BaseClientProxy *src, EDirection srcSide, return dst; } -void Server::avoidJumpZone(BaseClientProxy *dst, EDirection dir, SInt32 &x, SInt32 &y) const +void Server::avoidJumpZone(BaseClientProxy *dst, EDirection dir, int32_t &x, int32_t &y) const { // we only need to avoid jump zones on the primary screen if (dst != m_primaryClient) { @@ -764,10 +764,10 @@ void Server::avoidJumpZone(BaseClientProxy *dst, EDirection dir, SInt32 &x, SInt } const std::string dstName(getName(dst)); - SInt32 dx, dy, dw, dh; + int32_t dx, dy, dw, dh; dst->getShape(dx, dy, dw, dh); float t = mapToFraction(dst, dir, x, y); - SInt32 z = getJumpZoneSize(dst); + int32_t z = getJumpZoneSize(dst); // move in far enough to avoid the jump zone. if entering a side // that doesn't have a neighbor (i.e. an asymmetrical side) then we @@ -799,7 +799,7 @@ void Server::avoidJumpZone(BaseClientProxy *dst, EDirection dir, SInt32 &x, SInt } bool Server::isSwitchOkay( - BaseClientProxy *newScreen, EDirection dir, SInt32 x, SInt32 y, SInt32 xActive, SInt32 yActive + BaseClientProxy *newScreen, EDirection dir, int32_t x, int32_t y, int32_t xActive, int32_t yActive ) { LOG((CLOG_DEBUG1 "try to leave \"%s\" on %s", getName(m_active).c_str(), Config::dirName(dir))); @@ -857,7 +857,7 @@ bool Server::isSwitchOkay( Config::ScreenOptions::const_iterator i = options->find(kOptionScreenSwitchCorners); UInt32 corners = static_cast(i->second); i = options->find(kOptionScreenSwitchCornerSize); - SInt32 size = 0; + int32_t size = 0; if (i != options->end()) { size = i->second; } @@ -892,7 +892,7 @@ bool Server::isSwitchOkay( return !preventSwitch; } -void Server::noSwitch(SInt32 x, SInt32 y) +void Server::noSwitch(int32_t x, int32_t y) { armSwitchTwoTap(x, y); stopSwitchWait(); @@ -916,7 +916,7 @@ void Server::startSwitchTwoTap() LOG((CLOG_DEBUG1 "waiting for second tap")); } -void Server::armSwitchTwoTap(SInt32 x, SInt32 y) +void Server::armSwitchTwoTap(int32_t x, int32_t y) { if (m_switchTwoTapEngaged) { if (m_switchTwoTapTimer.getTime() > m_switchTwoTapDelay) { @@ -925,9 +925,9 @@ void Server::armSwitchTwoTap(SInt32 x, SInt32 y) } else if (!m_switchTwoTapArmed) { // still time for a double tap. see if we left the tap // zone and, if so, arm the two tap. - SInt32 ax, ay, aw, ah; + int32_t ax, ay, aw, ah; m_active->getShape(ax, ay, aw, ah); - SInt32 tapZone = m_primaryClient->getJumpZoneSize(); + int32_t tapZone = m_primaryClient->getJumpZoneSize(); if (tapZone < m_switchTwoTapZone) { tapZone = m_switchTwoTapZone; } @@ -978,7 +978,7 @@ bool Server::shouldSwitchTwoTap() const return (m_switchTwoTapArmed && m_switchTwoTapTimer.getTime() <= m_switchTwoTapDelay); } -void Server::startSwitchWait(SInt32 x, SInt32 y) +void Server::startSwitchWait(int32_t x, int32_t y) { stopSwitchWait(); m_switchWaitX = x; @@ -1000,16 +1000,16 @@ bool Server::isSwitchWaitStarted() const return (m_switchWaitTimer != NULL); } -UInt32 Server::getCorner(BaseClientProxy *client, SInt32 x, SInt32 y, SInt32 size) const +UInt32 Server::getCorner(BaseClientProxy *client, int32_t x, int32_t y, int32_t size) const { assert(client != NULL); // get client screen shape - SInt32 ax, ay, aw, ah; + int32_t ax, ay, aw, ah; client->getShape(ax, ay, aw, ah); // check for x,y on the left or right - SInt32 xSide; + int32_t xSide; if (x <= ax) { xSide = -1; } else if (x >= ax + aw - 1) { @@ -1019,7 +1019,7 @@ UInt32 Server::getCorner(BaseClientProxy *client, SInt32 x, SInt32 y, SInt32 siz } // check for x,y on the top or bottom - SInt32 ySide; + int32_t ySide; if (y <= ay) { ySide = -1; } else if (y >= ay + ah - 1) { @@ -1053,7 +1053,7 @@ void Server::stopRelativeMoves() { if (m_relativeMoves && m_active != m_primaryClient) { // warp to the center of the active client so we know where we are - SInt32 ax, ay, aw, ah; + int32_t ax, ay, aw, ah; m_active->getShape(ax, ay, aw, ah); m_x = ax + (aw >> 1); m_y = ay + (ah >> 1); @@ -1176,7 +1176,7 @@ void Server::handleShapeChanged(const Event &, void *vclient) LOG((CLOG_DEBUG "screen \"%s\" shape changed", getName(client).c_str())); // update jump coordinate - SInt32 x, y; + int32_t x, y; client->getCursorPos(x, y); client->setJumpCursorPos(x, y); @@ -1375,7 +1375,7 @@ void Server::handleSwitchInDirectionEvent(const Event &event, void *) SwitchInDirectionInfo *info = static_cast(event.getData()); // jump to screen in chosen direction from center of this screen - SInt32 x = m_x, y = m_y; + int32_t x = m_x, y = m_y; BaseClientProxy *newScreen = getNeighbor(m_active, info->m_direction, x, y); if (newScreen == NULL) { LOG((CLOG_DEBUG1 "no neighbor %s", Config::dirName(info->m_direction))); @@ -1537,9 +1537,9 @@ void Server::onScreensaver(bool activated) if (m_activeSaver != NULL && m_activeSaver != m_primaryClient) { // check position BaseClientProxy *screen = m_activeSaver; - SInt32 x, y, w, h; + int32_t x, y, w, h; screen->getShape(x, y, w, h); - SInt32 zoneSize = getJumpZoneSize(screen); + int32_t zoneSize = getJumpZoneSize(screen); if (m_xSaver < x + zoneSize) { m_xSaver = x + zoneSize; } else if (m_xSaver >= x + w - zoneSize) { @@ -1612,7 +1612,7 @@ void Server::onKeyUp(KeyID id, KeyModifierMask mask, KeyButton button, const cha } } -void Server::onKeyRepeat(KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button, const std::string &lang) +void Server::onKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) { LOG( (CLOG_DEBUG1 "onKeyRepeat id=%d mask=0x%04x count=%d button=0x%04x lang=\"%s\"", id, mask, count, button, @@ -1662,7 +1662,7 @@ void Server::onMouseUp(ButtonID id) } } -bool Server::onMouseMovePrimary(SInt32 x, SInt32 y) +bool Server::onMouseMovePrimary(int32_t x, int32_t y) { LOG((CLOG_DEBUG4 "onMouseMovePrimary %d,%d", x, y)); @@ -1685,12 +1685,12 @@ bool Server::onMouseMovePrimary(SInt32 x, SInt32 y) m_y = y; // get screen shape - SInt32 ax, ay, aw, ah; + int32_t ax, ay, aw, ah; m_active->getShape(ax, ay, aw, ah); - SInt32 zoneSize = getJumpZoneSize(m_active); + int32_t zoneSize = getJumpZoneSize(m_active); // clamp position to screen - SInt32 xc = x, yc = y; + int32_t xc = x, yc = y; if (xc < ax + zoneSize) { xc = ax; } else if (xc >= ax + aw - zoneSize) { @@ -1706,7 +1706,7 @@ bool Server::onMouseMovePrimary(SInt32 x, SInt32 y) // when the cursor is in a corner, there may be a screen either // horizontally or vertically. check both directions. EDirection dirh = kNoDirection, dirv = kNoDirection; - SInt32 xh = x, yv = y; + int32_t xh = x, yv = y; if (x < ax + zoneSize) { xh -= zoneSize; dirh = kLeft; @@ -1729,7 +1729,7 @@ bool Server::onMouseMovePrimary(SInt32 x, SInt32 y) // check both horizontally and vertically EDirection dirs[] = {dirh, dirv}; - SInt32 xs[] = {xh, x}, ys[] = {y, yv}; + int32_t xs[] = {xh, x}, ys[] = {y, yv}; for (int i = 0; i < 2; ++i) { EDirection dir = dirs[i]; if (dir == kNoDirection) { @@ -1802,15 +1802,15 @@ void Server::sendDragInfo(BaseClientProxy *newScreen) } } -void Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) +void Server::onMouseMoveSecondary(int32_t dx, int32_t dy) { LOG((CLOG_DEBUG2 "onMouseMoveSecondary initial %+d,%+d", dx, dy)); const char *envVal = std::getenv("DESKFLOW_MOUSE_ADJUSTMENT"); if (envVal != nullptr) { try { - double multiplier = std::stod(envVal); // Convert to double - SInt32 adjustedDx = static_cast(std::round(dx * multiplier)); // Apply multiplier and round - SInt32 adjustedDy = static_cast(std::round(dy * multiplier)); + double multiplier = std::stod(envVal); // Convert to double + int32_t adjustedDx = static_cast(std::round(dx * multiplier)); // Apply multiplier and round + int32_t adjustedDy = static_cast(std::round(dy * multiplier)); LOG((CLOG_DEBUG2 "Adjusted to %+d,%+d using multiplier %.2f", adjustedDx, adjustedDy, multiplier)); dx = adjustedDx; // Update dx and dy to adjusted values dy = adjustedDy; @@ -1842,8 +1842,8 @@ void Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) } // save old position - const SInt32 xOld = m_x; - const SInt32 yOld = m_y; + const int32_t xOld = m_x; + const int32_t yOld = m_y; // save last delta m_xDelta2 = m_xDelta; @@ -1858,7 +1858,7 @@ void Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) m_y += dy; // get screen shape - SInt32 ax, ay, aw, ah; + int32_t ax, ay, aw, ah; m_active->getShape(ax, ay, aw, ah); // find direction of neighbor and get the neighbor @@ -1866,7 +1866,7 @@ void Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) BaseClientProxy *newScreen; do { // clamp position to screen - SInt32 xc = m_x, yc = m_y; + int32_t xc = m_x, yc = m_y; if (xc < ax) { xc = ax; } else if (xc >= ax + aw) { @@ -1897,7 +1897,7 @@ void Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) // then arm the double tap. if (m_switchScreen != NULL) { bool clearWait; - SInt32 zoneSize = m_primaryClient->getJumpZoneSize(); + int32_t zoneSize = m_primaryClient->getJumpZoneSize(); switch (m_switchDir) { case kLeft: clearWait = (m_x >= ax + zoneSize); @@ -1945,8 +1945,8 @@ void Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) m_sendFileThread.reset(nullptr); } - SInt32 newX = m_x; - SInt32 newY = m_y; + int32_t newX = m_x; + int32_t newY = m_y; // switch screens switchScreen(newScreen, newX, newY, false); @@ -1977,7 +1977,7 @@ void Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) } } -void Server::onMouseWheel(SInt32 xDelta, SInt32 yDelta) +void Server::onMouseWheel(int32_t xDelta, int32_t yDelta) { LOG((CLOG_DEBUG1 "onMouseWheel %+d,%+d", xDelta, yDelta)); assert(m_active != NULL); @@ -2042,7 +2042,7 @@ bool Server::addClient(BaseClientProxy *client) m_clients.insert(std::make_pair(name, client)); // initialize client data - SInt32 x, y; + int32_t x, y; client->getCursorPos(x, y); client->setJumpCursorPos(x, y); diff --git a/src/lib/server/Server.h b/src/lib/server/Server.h index 363b91a17..a044b061b 100644 --- a/src/lib/server/Server.h +++ b/src/lib/server/Server.h @@ -254,21 +254,21 @@ private: bool isLockedToScreen() const; // returns the jump zone of the client - SInt32 getJumpZoneSize(BaseClientProxy *) const; + int32_t getJumpZoneSize(BaseClientProxy *) const; // change the active screen - void switchScreen(BaseClientProxy *, SInt32 x, SInt32 y, bool forScreenSaver); + void switchScreen(BaseClientProxy *, int32_t x, int32_t y, bool forScreenSaver); // jump to screen void jumpToScreen(BaseClientProxy *); // convert pixel position to fraction, using x or y depending on the // direction. - float mapToFraction(BaseClientProxy *, EDirection, SInt32 x, SInt32 y) const; + float mapToFraction(BaseClientProxy *, EDirection, int32_t x, int32_t y) const; // convert fraction to pixel position, writing only x or y depending // on the direction. - void mapToPixel(BaseClientProxy *, EDirection, float f, SInt32 &x, SInt32 &y) const; + void mapToPixel(BaseClientProxy *, EDirection, float f, int32_t &x, int32_t &y) const; // returns true if the client has a neighbor anywhere along the edge // indicated by the direction. @@ -276,27 +276,27 @@ private: // lookup neighboring screen, mapping the coordinate independent of // the direction to the neighbor's coordinate space. - BaseClientProxy *getNeighbor(BaseClientProxy *, EDirection, SInt32 &x, SInt32 &y) const; + BaseClientProxy *getNeighbor(BaseClientProxy *, EDirection, int32_t &x, int32_t &y) const; // lookup neighboring screen. given a position relative to the // source screen, find the screen we should move onto and where. // if the position is sufficiently far from the source then we // cross multiple screens. if there is no suitable screen then // return NULL and x,y are not modified. - BaseClientProxy *mapToNeighbor(BaseClientProxy *, EDirection, SInt32 &x, SInt32 &y) const; + BaseClientProxy *mapToNeighbor(BaseClientProxy *, EDirection, int32_t &x, int32_t &y) const; // adjusts x and y or neither to avoid ending up in a jump zone // after entering the client in the given direction. - void avoidJumpZone(BaseClientProxy *, EDirection, SInt32 &x, SInt32 &y) const; + void avoidJumpZone(BaseClientProxy *, EDirection, int32_t &x, int32_t &y) const; // test if a switch is permitted. this includes testing user // options like switch delay and tracking any state required to // implement them. returns true iff a switch is permitted. - bool isSwitchOkay(BaseClientProxy *dst, EDirection, SInt32 x, SInt32 y, SInt32 xActive, SInt32 yActive); + bool isSwitchOkay(BaseClientProxy *dst, EDirection, int32_t x, int32_t y, int32_t xActive, int32_t yActive); // update switch state due to a mouse move at \p x, \p y that // doesn't switch screens. - void noSwitch(SInt32 x, SInt32 y); + void noSwitch(int32_t x, int32_t y); // stop switch timers void stopSwitch(); @@ -305,7 +305,7 @@ private: void startSwitchTwoTap(); // arm the two tap switch timer if \p x, \p y is outside the tap zone - void armSwitchTwoTap(SInt32 x, SInt32 y); + void armSwitchTwoTap(int32_t x, int32_t y); // stop the two tap switch timer void stopSwitchTwoTap(); @@ -317,7 +317,7 @@ private: bool shouldSwitchTwoTap() const; // start delay switch timer - void startSwitchWait(SInt32 x, SInt32 y); + void startSwitchWait(int32_t x, int32_t y); // stop delay switch timer void stopSwitchWait(); @@ -327,7 +327,7 @@ private: // returns the corner (EScreenSwitchCornerMasks) where x,y is on the // given client. corners have the given size. - UInt32 getCorner(BaseClientProxy *, SInt32 x, SInt32 y, SInt32 size) const; + UInt32 getCorner(BaseClientProxy *, int32_t x, int32_t y, int32_t size) const; // stop relative mouse moves void stopRelativeMoves(); @@ -369,12 +369,12 @@ private: void onScreensaver(bool activated); void onKeyDown(KeyID, KeyModifierMask, KeyButton, const std::string &, const char *screens); void onKeyUp(KeyID, KeyModifierMask, KeyButton, const char *screens); - void onKeyRepeat(KeyID, KeyModifierMask, SInt32, KeyButton, const std::string &); + void onKeyRepeat(KeyID, KeyModifierMask, int32_t, KeyButton, const std::string &); void onMouseDown(ButtonID); void onMouseUp(ButtonID); - bool onMouseMovePrimary(SInt32 x, SInt32 y); - void onMouseMoveSecondary(SInt32 dx, SInt32 dy); - void onMouseWheel(SInt32 xDelta, SInt32 yDelta); + bool onMouseMovePrimary(int32_t x, int32_t y); + void onMouseMoveSecondary(int32_t dx, int32_t dy); + void onMouseWheel(int32_t xDelta, int32_t yDelta); void onFileChunkSending(const void *data); void onFileRecieveCompleted(); @@ -453,14 +453,14 @@ private: // current mouse position (in absolute screen coordinates) on // whichever screen is active - SInt32 m_x, m_y; + int32_t m_x, m_y; // last mouse deltas. this is needed to smooth out double tap // on win32 which reports bogus mouse motion at the edge of // the screen when using low level hooks, synthesizing motion // in the opposite direction the mouse actually moved. - SInt32 m_xDelta, m_yDelta; - SInt32 m_xDelta2, m_yDelta2; + int32_t m_xDelta, m_yDelta; + int32_t m_xDelta2, m_yDelta2; // current configuration ServerConfig *m_config; @@ -473,7 +473,7 @@ private: // state saved when screen saver activates BaseClientProxy *m_activeSaver; - SInt32 m_xSaver, m_ySaver; + int32_t m_xSaver, m_ySaver; // common state for screen switch tests. all tests are always // trying to reach the same screen in the same direction. @@ -483,14 +483,14 @@ private: // state for delayed screen switching double m_switchWaitDelay; EventQueueTimer *m_switchWaitTimer; - SInt32 m_switchWaitX, m_switchWaitY; + int32_t m_switchWaitX, m_switchWaitY; // state for double-tap screen switching double m_switchTwoTapDelay; Stopwatch m_switchTwoTapTimer; bool m_switchTwoTapEngaged; bool m_switchTwoTapArmed; - SInt32 m_switchTwoTapZone; + int32_t m_switchTwoTapZone; // modifiers needed before switching bool m_switchNeedsShift; diff --git a/src/test/integtests/net/NetworkTests.cpp b/src/test/integtests/net/NetworkTests.cpp index 6ffd89ff4..9bfa8ebef 100644 --- a/src/test/integtests/net/NetworkTests.cpp +++ b/src/test/integtests/net/NetworkTests.cpp @@ -59,8 +59,8 @@ const uint16_t kMockDataChunkIncrement = 1024; // 1KB const char *kMockFilename = "tmp/test/NetworkTests.mock"; const size_t kMockFileSize = 1024 * 1024 * 10; // 10MB -void getScreenShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h); -void getCursorPos(SInt32 &x, SInt32 &y); +void getScreenShape(int32_t &x, int32_t &y, int32_t &w, int32_t &h); +void getCursorPos(int32_t &x, int32_t &y); uint8_t *newMockData(size_t size); void createFile(fstream &file, const char *filename, size_t size); @@ -517,14 +517,14 @@ void createFile(fstream &file, const char *filename, size_t size) { delete[] buffer; } -void getScreenShape(SInt32 &x, SInt32 &y, SInt32 &w, SInt32 &h) { +void getScreenShape(int32_t &x, int32_t &y, int32_t &w, int32_t &h) { x = 0; y = 0; w = 1; h = 1; } -void getCursorPos(SInt32 &x, SInt32 &y) { +void getCursorPos(int32_t &x, int32_t &y) { x = 0; y = 0; } diff --git a/src/test/integtests/platform/XWindowsKeyStateTests.cpp b/src/test/integtests/platform/XWindowsKeyStateTests.cpp index 6fde7cbf6..8e6d321f4 100644 --- a/src/test/integtests/platform/XWindowsKeyStateTests.cpp +++ b/src/test/integtests/platform/XWindowsKeyStateTests.cpp @@ -176,7 +176,7 @@ TEST_F(XWindowsKeyStateTests, pollActiveGroup_defaultState_returnsZero) { MockEventQueue eventQueue; XWindowsKeyState keyState(m_display, true, &eventQueue, keyMap); - SInt32 actual = keyState.pollActiveGroup(); + int32_t actual = keyState.pollActiveGroup(); ASSERT_EQ(0, actual); } @@ -188,7 +188,7 @@ TEST_F(XWindowsKeyStateTests, pollActiveGroup_positiveGroup_returnsGroup) { keyState.group(3); - SInt32 actual = keyState.pollActiveGroup(); + int32_t actual = keyState.pollActiveGroup(); ASSERT_EQ(3, actual); } @@ -206,7 +206,7 @@ TEST_F(XWindowsKeyStateTests, pollActiveGroup_xkb_areEqual) { // compare pollActiveGroup() with XkbGetState() if (XkbGetState(m_display, XkbUseCoreKbd, &state) == Success) { - SInt32 actual = keyState.pollActiveGroup(); + int32_t actual = keyState.pollActiveGroup(); ASSERT_EQ(state.group, actual); } else { diff --git a/src/test/mock/deskflow/MockKeyMap.h b/src/test/mock/deskflow/MockKeyMap.h index c22b89c4d..b23e3f025 100644 --- a/src/test/mock/deskflow/MockKeyMap.h +++ b/src/test/mock/deskflow/MockKeyMap.h @@ -31,7 +31,7 @@ public: MOCK_METHOD(bool, isHalfDuplex, (KeyID, KeyButton), (const, override)); MOCK_METHOD( const KeyMap::KeyItem *, mapKey, - (Keystrokes &, KeyID, SInt32, ModifierToKeys &, KeyModifierMask &, KeyModifierMask, bool, const std::string &), + (Keystrokes &, KeyID, int32_t, ModifierToKeys &, KeyModifierMask &, KeyModifierMask, bool, const std::string &), (const, override) ); }; diff --git a/src/test/mock/deskflow/MockKeyState.h b/src/test/mock/deskflow/MockKeyState.h index ca46b25c9..bcdc00b2a 100644 --- a/src/test/mock/deskflow/MockKeyState.h +++ b/src/test/mock/deskflow/MockKeyState.h @@ -39,7 +39,7 @@ public: { } - MOCK_METHOD(SInt32, pollActiveGroup, (), (const, override)); + MOCK_METHOD(int32_t, pollActiveGroup, (), (const, override)); MOCK_METHOD(KeyModifierMask, pollActiveModifiers, (), (const, override)); MOCK_METHOD(bool, fakeCtrlAltDel, (), (override)); MOCK_METHOD(void, getKeyMap, (deskflow::KeyMap &), (override)); @@ -52,4 +52,4 @@ typedef ::testing::NiceMock KeyStateImpl; using KeyID = UInt32; -typedef void (*ForeachKeyCallback)(KeyID, SInt32 group, deskflow::KeyMap::KeyItem &, void *userData); +typedef void (*ForeachKeyCallback)(KeyID, int32_t group, deskflow::KeyMap::KeyItem &, void *userData); diff --git a/src/test/mock/deskflow/MockScreen.h b/src/test/mock/deskflow/MockScreen.h index d1ecbfbb2..8db56bd28 100644 --- a/src/test/mock/deskflow/MockScreen.h +++ b/src/test/mock/deskflow/MockScreen.h @@ -30,8 +30,8 @@ public: { } MOCK_METHOD(void, disable, (), (override)); - MOCK_METHOD(void, getShape, (SInt32 &, SInt32 &, SInt32 &, SInt32 &), (const, override)); - MOCK_METHOD(void, getCursorPos, (SInt32 &, SInt32 &), (const, override)); + MOCK_METHOD(void, getShape, (int32_t &, int32_t &, int32_t &, int32_t &), (const, override)); + MOCK_METHOD(void, getCursorPos, (int32_t &, int32_t &), (const, override)); MOCK_METHOD(void, resetOptions, (), (override)); MOCK_METHOD(void, setOptions, (const OptionsList &), (override)); MOCK_METHOD(void, enable, (), (override)); diff --git a/src/test/mock/server/MockPrimaryClient.h b/src/test/mock/server/MockPrimaryClient.h index 1297f6dde..3d2cf1bfe 100644 --- a/src/test/mock/server/MockPrimaryClient.h +++ b/src/test/mock/server/MockPrimaryClient.h @@ -27,8 +27,8 @@ class MockPrimaryClient : public PrimaryClient { public: MOCK_METHOD(void *, getEventTarget, (), (const, override)); - MOCK_METHOD(void, getCursorPos, (SInt32 &, SInt32 &), (const, override)); - MOCK_METHOD(void, setJumpCursorPos, (SInt32, SInt32), (const)); + MOCK_METHOD(void, getCursorPos, (int32_t &, int32_t &), (const, override)); + MOCK_METHOD(void, setJumpCursorPos, (int32_t, int32_t), (const)); MOCK_METHOD(void, reconfigure, (UInt32), (override)); MOCK_METHOD(void, resetOptions, (), (override)); MOCK_METHOD(void, setOptions, (const OptionsList &), (override)); diff --git a/src/test/unittests/client/HelloBackTests.cpp b/src/test/unittests/client/HelloBackTests.cpp index 7cd8a6af4..d1b9fb99b 100644 --- a/src/test/unittests/client/HelloBackTests.cpp +++ b/src/test/unittests/client/HelloBackTests.cpp @@ -36,7 +36,7 @@ void intTo2ByteBuf(int16_t value, std::array &buf) buf[1] = static_cast(value & 0xFF); // LSB } -void intTo4ByteBuf(SInt32 value, std::array &buf) +void intTo4ByteBuf(int32_t value, std::array &buf) { buf[0] = static_cast((value >> 24) & 0xFF); // MSB buf[1] = static_cast((value >> 16) & 0xFF); @@ -99,7 +99,7 @@ void setupMockHelloBackWrite( std::array nameLenBuf; intTo2ByteBuf(majorVersion, majorBuf); intTo2ByteBuf(minorVersion, minorBuf); - intTo4ByteBuf(static_cast(name.size()), nameLenBuf); + intTo4ByteBuf(static_cast(name.size()), nameLenBuf); const auto versionIntSize = 4; const auto clientNameIntSize = 4; diff --git a/src/test/unittests/deskflow/KeyStateTests.cpp b/src/test/unittests/deskflow/KeyStateTests.cpp index 602fd6534..837776efd 100644 --- a/src/test/unittests/deskflow/KeyStateTests.cpp +++ b/src/test/unittests/deskflow/KeyStateTests.cpp @@ -35,7 +35,7 @@ void stubPollPressedKeys(IKeyState::KeyButtonSet &pressedKeys); void assertMaskIsOne(ForeachKeyCallback cb, void *userData); const deskflow::KeyMap::KeyItem *stubMapKey( - deskflow::KeyMap::Keystrokes &keys, KeyID id, SInt32 group, deskflow::KeyMap::ModifierToKeys &activeModifiers, + deskflow::KeyMap::Keystrokes &keys, KeyID id, int32_t group, deskflow::KeyMap::ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat, const std::string &lang ); @@ -484,7 +484,7 @@ void assertMaskIsOne(ForeachKeyCallback cb, void *userData) } const deskflow::KeyMap::KeyItem * -stubMapKey(deskflow::KeyMap::Keystrokes &keys, KeyID, SInt32, deskflow::KeyMap::ModifierToKeys &, KeyModifierMask &, KeyModifierMask, bool, const std::string &) +stubMapKey(deskflow::KeyMap::Keystrokes &keys, KeyID, int32_t, deskflow::KeyMap::ModifierToKeys &, KeyModifierMask &, KeyModifierMask, bool, const std::string &) { keys.push_back(s_stubKeystroke); return &s_stubKeyItem;