deskflow/src/lib/deskflow/PlatformScreen.h
sithlord48 f51abad8cc
Some checks failed
CodeQL Analysis / Analyze (cpp) (push) Has been cancelled
Continuous Integration / reuse-lint (push) Has been cancelled
Continuous Integration / pr-comment-flags (push) Has been cancelled
Continuous Integration / ci-passed (push) Has been cancelled
Continuous Integration / test-results (push) Has been cancelled
Continuous Integration / lint-check (push) Has been cancelled
Continuous Integration / analyse-valgrind (push) Has been cancelled
Continuous Integration / analyse-sonarcloud (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[arch:amd64 config-args:-G Ninja name:windows-2022-x64 qt-version:6.8.3 runs-on:windows-2022 timeout:30 vcpkg-triplet:x64-windows-release]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[arch:arm64 config-args:-G Ninja name:windows-2022-arm64 qt-version:6.8.3 runs-on:windows-11-arm timeout:30 vcpkg-triplet:arm64-windows]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_SYSROOT=/Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk name:macos-14-arm64 qt-version:6.9.1 runs-on:macos-14 t… (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_SYSROOT=/Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk name:macos-13-x64 qt-version:6.9.1 runs-on:macos-13 ti… (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DEV_DOCS=ON container:archlinux:latest like:arch name:archlinux-x86_84 runs-on:ubuntu-latest timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:debian:trixie-slim like:debian name:debian-13-arm64 runs-on:ubuntu-24.04-arm timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:debian:trixie-slim like:debian name:debian-13-x86_64 runs-on:ubuntu-latest timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:fedora:41 like:fedora name:fedora-41-arm64 runs-on:ubuntu-24.04-arm timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:fedora:41 like:fedora name:fedora-41-x86_64 runs-on:ubuntu-latest timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:fedora:42 like:fedora name:fedora-42-arm64 runs-on:ubuntu-24.04-arm timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:fedora:42 like:fedora name:fedora-42-x86_64 runs-on:ubuntu-latest timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:opensuse/tumbleweed:latest like:suse name:opensuse-arm64 runs-on:ubuntu-24.04-arm timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:opensuse/tumbleweed:latest like:suse name:opensuse-x86_84 runs-on:ubuntu-latest timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:ubuntu:25.04 like:debian name:ubuntu-25.04-arm64 runs-on:ubuntu-24.04-arm timeout:20]) (push) Has been cancelled
Continuous Integration / ${{ matrix.target.name }} (map[config-args:-G Ninja -DCMAKE_INSTALL_PREFIX=/usr container:ubuntu:25.04 like:debian name:ubuntu-25.04-x86_64 runs-on:ubuntu-latest timeout:20]) (push) Has been cancelled
Continuous Integration / unix-${{ matrix.distro.name }} (map[name:freebsd]) (push) Has been cancelled
Continuous Integration / flatpak-${{matrix.flatpak.arch}} (map[arch:aarch64 runs-on:ubuntu-24.04-arm]) (push) Has been cancelled
Continuous Integration / flatpak-${{matrix.flatpak.arch}} (map[arch:x86_64 runs-on:ubuntu-latest]) (push) Has been cancelled
Continuous Integration / release (push) Has been cancelled
Continuous Integration / winget-publish (push) Has been cancelled
feat: Wayland, only set a side to a border if if has a neighboring screen
move protocolTypes Direction enum to new base/DirectionTypes
use the direction info when calling
fixes #8572
fixes #8452
fixes #8605
fixes #8005
2025-07-14 10:31:50 +01:00

117 lines
4.2 KiB
C++

/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#pragma once
#include "deskflow/ClientArgs.h"
#include "deskflow/IPlatformScreen.h"
#include <stdexcept>
//! Base screen implementation
/*!
This screen implementation is the superclass of all other screen
implementations. It implements a handful of methods and requires
subclasses to implement the rest.
*/
class PlatformScreen : public IPlatformScreen
{
public:
PlatformScreen(
IEventQueue *events, deskflow::ClientScrollDirection scrollDirection = deskflow::ClientScrollDirection::Normal
);
~PlatformScreen() override = default;
// IScreen overrides
void *getEventTarget() const override = 0;
bool getClipboard(ClipboardID id, IClipboard *) 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;
// IPrimaryScreen overrides
void reconfigure(uint32_t activeSides) override = 0;
uint32_t activeSides() override = 0;
void warpCursor(int32_t x, int32_t y) override = 0;
uint32_t registerHotKey(KeyID key, KeyModifierMask mask) override = 0;
void unregisterHotKey(uint32_t id) override = 0;
void fakeInputBegin() override = 0;
void fakeInputEnd() override = 0;
int32_t getJumpZoneSize() const override = 0;
bool isAnyMouseButtonDown(uint32_t &buttonID) const override = 0;
void getCursorCenter(int32_t &x, int32_t &y) const override = 0;
// ISecondaryScreen overrides
void fakeMouseButton(ButtonID id, bool press) override = 0;
void fakeMouseMove(int32_t x, int32_t y) override = 0;
void fakeMouseRelativeMove(int32_t dx, int32_t dy) const override = 0;
void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const override = 0;
// IKeyState overrides
void updateKeyMap() override;
void updateKeyState() override;
void setHalfDuplexMask(KeyModifierMask) override;
void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &) 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 fakeCtrlAltDel() override;
bool isKeyDown(KeyButton) const override;
KeyModifierMask getActiveModifiers() const override;
KeyModifierMask pollActiveModifiers() const override;
int32_t pollActiveGroup() const override;
void pollPressedKeys(KeyButtonSet &pressedKeys) const override;
// IPlatformScreen overrides
void enable() override = 0;
void disable() override = 0;
void enter() override = 0;
bool canLeave() override = 0;
void leave() override = 0;
bool setClipboard(ClipboardID, const IClipboard *) override = 0;
void checkClipboards() override = 0;
void openScreensaver(bool notify) override = 0;
void closeScreensaver() override = 0;
void screensaver(bool activate) override = 0;
void resetOptions() override = 0;
void setOptions(const OptionsList &options) override = 0;
void setSequenceNumber(uint32_t) override = 0;
bool isPrimary() const override = 0;
protected:
//! Update mouse buttons
/*!
Subclasses must implement this method to update their internal mouse
button mapping and, if desired, state tracking.
*/
virtual void updateButtons() = 0;
//! Get the key state
/*!
Subclasses must implement this method to return the platform specific
key state object that each subclass must have.
*/
virtual IKeyState *getKeyState() const = 0;
// IPlatformScreen overrides
void handleSystemEvent(const Event &event) override = 0;
/*!
* \brief mapClientScrollDirection
* Convert scroll according to client scroll directio
* \return converted value according to the client scroll direction
*/
virtual int32_t mapClientScrollDirection(int32_t) const;
private:
/*!
* \brief m_clientScrollDirection
* This member contains client scroll direction.
* This member is used only on client side.
*/
deskflow::ClientScrollDirection m_clientScrollDirection = deskflow::ClientScrollDirection::Normal;
};