chore: use const pointer / ref where possible
This commit is contained in:
parent
9bdb4252e5
commit
fe12972e83
34 changed files with 71 additions and 63 deletions
|
|
@ -599,7 +599,7 @@ void ArchMultithreadPosix::insert(ArchThreadImpl *thread)
|
||||||
m_threadList.push_back(thread);
|
m_threadList.push_back(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArchMultithreadPosix::erase(ArchThreadImpl *thread)
|
void ArchMultithreadPosix::erase(const ArchThreadImpl *thread)
|
||||||
{
|
{
|
||||||
for (auto index = m_threadList.begin(); index != m_threadList.end(); ++index) {
|
for (auto index = m_threadList.begin(); index != m_threadList.end(); ++index) {
|
||||||
if (*index == thread) {
|
if (*index == thread) {
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ private:
|
||||||
ArchThreadImpl *find(pthread_t thread);
|
ArchThreadImpl *find(pthread_t thread);
|
||||||
ArchThreadImpl *findNoRef(pthread_t thread);
|
ArchThreadImpl *findNoRef(pthread_t thread);
|
||||||
void insert(ArchThreadImpl *thread);
|
void insert(ArchThreadImpl *thread);
|
||||||
void erase(ArchThreadImpl *thread);
|
void erase(const ArchThreadImpl *thread);
|
||||||
|
|
||||||
void refThread(ArchThreadImpl *rep);
|
void refThread(ArchThreadImpl *rep);
|
||||||
void testCancelThreadImpl(ArchThreadImpl *rep);
|
void testCancelThreadImpl(ArchThreadImpl *rep);
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ int Log::getFilter() const
|
||||||
return m_maxPriority;
|
return m_maxPriority;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log::output(ELevel priority, char *msg)
|
void Log::output(ELevel priority, const char *msg)
|
||||||
{
|
{
|
||||||
assert(priority >= -1 && priority < g_numPriority);
|
assert(priority >= -1 && priority < g_numPriority);
|
||||||
assert(msg != nullptr);
|
assert(msg != nullptr);
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ public:
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void output(ELevel priority, char *msg);
|
void output(ELevel priority, const char *msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using OutputterList = std::list<ILogOutputter *>;
|
using OutputterList = std::list<ILogOutputter *>;
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ bool ArgParser::isArg(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArgParser::splitCommandString(std::string &command, std::vector<std::string> &argv)
|
void ArgParser::splitCommandString(const std::string &command, std::vector<std::string> &argv)
|
||||||
{
|
{
|
||||||
if (command.empty()) {
|
if (command.empty()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -276,7 +276,7 @@ void ArgParser::splitCommandString(std::string &command, std::vector<std::string
|
||||||
argv.push_back(subString);
|
argv.push_back(subString);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ArgParser::searchDoubleQuotes(std::string &command, size_t &left, size_t &right, size_t startPos)
|
bool ArgParser::searchDoubleQuotes(const std::string &command, size_t &left, size_t &right, size_t startPos)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
left = std::string::npos;
|
left = std::string::npos;
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ public:
|
||||||
static bool isArg(
|
static bool isArg(
|
||||||
int argi, int argc, const char *const *argv, const char *name1, const char *name2, int minRequiredParameters = 0
|
int argi, int argc, const char *const *argv, const char *name1, const char *name2, int minRequiredParameters = 0
|
||||||
);
|
);
|
||||||
static void splitCommandString(std::string &command, std::vector<std::string> &argv);
|
static void splitCommandString(const std::string &command, std::vector<std::string> &argv);
|
||||||
static bool searchDoubleQuotes(std::string &command, size_t &left, size_t &right, size_t startPos = 0);
|
static bool searchDoubleQuotes(const std::string &command, size_t &left, size_t &right, size_t startPos = 0);
|
||||||
static void removeDoubleQuotes(std::string &arg);
|
static void removeDoubleQuotes(std::string &arg);
|
||||||
static const char **getArgv(std::vector<std::string> &argsArray);
|
static const char **getArgv(std::vector<std::string> &argsArray);
|
||||||
static std::string
|
static std::string
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
// IKeyState
|
// IKeyState
|
||||||
//
|
//
|
||||||
|
|
||||||
IKeyState::IKeyState(IEventQueue *events)
|
IKeyState::IKeyState(const IEventQueue *events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ to synthesize key events.
|
||||||
class IKeyState : public IInterface
|
class IKeyState : public IInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit IKeyState(IEventQueue *events);
|
explicit IKeyState(const IEventQueue *events);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public:
|
||||||
//! @name manipulators
|
//! @name manipulators
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
explicit IPlatformScreen(IEventQueue *events) : IKeyState(events)
|
explicit IPlatformScreen(const IEventQueue *events) : IKeyState(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ using namespace std;
|
||||||
static const size_t g_chunkSize = 512 * 1024; // 512kb
|
static const size_t g_chunkSize = 512 * 1024; // 512kb
|
||||||
|
|
||||||
void StreamChunker::sendClipboard(
|
void StreamChunker::sendClipboard(
|
||||||
std::string &data, size_t size, ClipboardID id, uint32_t sequence, IEventQueue *events, void *eventTarget
|
const std::string &data, size_t size, ClipboardID id, uint32_t sequence, IEventQueue *events, void *eventTarget
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// send first message (data size)
|
// send first message (data size)
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ class StreamChunker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void sendClipboard(
|
static void sendClipboard(
|
||||||
std::string &data, size_t size, ClipboardID id, uint32_t sequence, IEventQueue *events, void *eventTarget
|
const std::string_view &data, size_t size, ClipboardID id, uint32_t sequence, IEventQueue *events,
|
||||||
|
void *eventTarget
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
#include "base/LogOutputters.h"
|
#include "base/LogOutputters.h"
|
||||||
#include "common/Constants.h"
|
#include "common/Constants.h"
|
||||||
|
|
||||||
AppUtilUnix::AppUtilUnix(IEventQueue *events)
|
AppUtilUnix::AppUtilUnix(const IEventQueue *events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class IEventQueue;
|
||||||
class AppUtilUnix : public AppUtil
|
class AppUtilUnix : public AppUtil
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit AppUtilUnix(IEventQueue *events);
|
explicit AppUtilUnix(const IEventQueue *events);
|
||||||
~AppUtilUnix() override = default;
|
~AppUtilUnix() override = default;
|
||||||
|
|
||||||
int run(int argc, char **argv) override;
|
int run(int argc, char **argv) override;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public:
|
||||||
std::string m_what;
|
std::string m_what;
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit IDataSocket(IEventQueue *events)
|
explicit IDataSocket(const IEventQueue *events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ void SecureSocket::initSsl(bool server)
|
||||||
initContext(server);
|
initContext(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SecureSocket::loadCertificates(std::string &filename)
|
bool SecureSocket::loadCertificates(const std::string &filename)
|
||||||
{
|
{
|
||||||
std::lock_guard ssl_lock{ssl_mutex_};
|
std::lock_guard ssl_lock{ssl_mutex_};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ public:
|
||||||
EJobResult doRead() override;
|
EJobResult doRead() override;
|
||||||
EJobResult doWrite() override;
|
EJobResult doWrite() override;
|
||||||
void initSsl(bool server);
|
void initSsl(bool server);
|
||||||
bool loadCertificates(std::string &CertFile);
|
bool loadCertificates(const std::string &CertFile);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// SSL
|
// SSL
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ QString formatSSLFingerprint(const QByteArray &fingerprint, bool enableSeparator
|
||||||
return fingerprint.toHex().toUpper();
|
return fingerprint.toHex().toUpper();
|
||||||
}
|
}
|
||||||
|
|
||||||
Fingerprint sslCertFingerprint(X509 *cert, Fingerprint::Type type)
|
Fingerprint sslCertFingerprint(const X509 *cert, Fingerprint::Type type)
|
||||||
{
|
{
|
||||||
if (!cert) {
|
if (!cert) {
|
||||||
throw std::runtime_error("certificate is null");
|
throw std::runtime_error("certificate is null");
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ QString formatSSLFingerprint(const QByteArray &fingerprint, bool enableSeparator
|
||||||
|
|
||||||
QString formatSSLFingerprintColumns(const QByteArray &fingerprint);
|
QString formatSSLFingerprintColumns(const QByteArray &fingerprint);
|
||||||
|
|
||||||
Fingerprint sslCertFingerprint(X509 *cert, Fingerprint::Type type);
|
Fingerprint sslCertFingerprint(const X509 *cert, Fingerprint::Type type);
|
||||||
|
|
||||||
Fingerprint pemFileCertFingerprint(const std::string &path, Fingerprint::Type type);
|
Fingerprint pemFileCertFingerprint(const std::string &path, Fingerprint::Type type);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@ class EventQueueTimer
|
||||||
|
|
||||||
namespace deskflow {
|
namespace deskflow {
|
||||||
|
|
||||||
EiEventQueueBuffer::EiEventQueueBuffer(EiScreen *screen, ei *ei, IEventQueue *events) : ei_(ei_ref(ei)), events_(events)
|
EiEventQueueBuffer::EiEventQueueBuffer(const EiScreen *screen, ei *ei, IEventQueue *events)
|
||||||
|
: ei_(ei_ref(ei)),
|
||||||
|
events_(events)
|
||||||
{
|
{
|
||||||
// We need a pipe to signal ourselves when addEvent() is called
|
// We need a pipe to signal ourselves when addEvent() is called
|
||||||
int pipefd[2];
|
int pipefd[2];
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace deskflow {
|
||||||
class EiEventQueueBuffer : public IEventQueueBuffer
|
class EiEventQueueBuffer : public IEventQueueBuffer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EiEventQueueBuffer(EiScreen *screen, ei *ei, IEventQueue *events);
|
EiEventQueueBuffer(const EiScreen *screen, ei *ei, IEventQueue *events);
|
||||||
~EiEventQueueBuffer() override;
|
~EiEventQueueBuffer() override;
|
||||||
|
|
||||||
// IEventQueueBuffer overrides
|
// IEventQueueBuffer overrides
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ EiScreen::~EiScreen()
|
||||||
delete portal_input_capture_;
|
delete portal_input_capture_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EiScreen::handle_ei_log_event(ei *ei, ei_log_priority priority, const char *message, ei_log_context *context) const
|
void EiScreen::handle_ei_log_event(ei_log_priority priority, const char *message) const
|
||||||
{
|
{
|
||||||
switch (priority) {
|
switch (priority) {
|
||||||
case EI_LOG_PRIORITY_DEBUG:
|
case EI_LOG_PRIORITY_DEBUG:
|
||||||
|
|
@ -693,7 +693,7 @@ void EiScreen::on_motion_event(ei_event *event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EiScreen::on_abs_motion_event(ei_event *event) const
|
void EiScreen::on_abs_motion_event(const ei_event *event) const
|
||||||
{
|
{
|
||||||
assert(is_primary_);
|
assert(is_primary_);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,16 +96,17 @@ private:
|
||||||
void on_pointer_scroll_event(ei_event *event);
|
void on_pointer_scroll_event(ei_event *event);
|
||||||
void on_pointer_scroll_discrete_event(ei_event *event);
|
void on_pointer_scroll_discrete_event(ei_event *event);
|
||||||
void on_motion_event(ei_event *event);
|
void on_motion_event(ei_event *event);
|
||||||
void on_abs_motion_event(ei_event *event) const;
|
void on_abs_motion_event(const ei_event *event) const;
|
||||||
bool on_hotkey(KeyID key, bool is_press, KeyModifierMask mask);
|
bool on_hotkey(KeyID key, bool is_press, KeyModifierMask mask);
|
||||||
void handle_ei_log_event(ei *ei, ei_log_priority priority, const char *message, ei_log_context *context) const;
|
void handle_ei_log_event(ei_log_priority priority, const char *message) const;
|
||||||
|
|
||||||
void handle_connected_to_eis_event(const Event &event, void *);
|
void handle_connected_to_eis_event(const Event &event, void *);
|
||||||
void handle_portal_session_closed(const Event &event, void *);
|
void handle_portal_session_closed(const Event &event, void *);
|
||||||
|
|
||||||
static void cb_handle_ei_log_event(ei *ei, ei_log_priority priority, const char *message, ei_log_context *context)
|
static void cb_handle_ei_log_event(ei *ei, ei_log_priority priority, const char *message, ei_log_context *context)
|
||||||
{
|
{
|
||||||
auto screen = reinterpret_cast<EiScreen *>(ei_get_user_data(ei));
|
auto screen = reinterpret_cast<EiScreen *>(ei_get_user_data(ei));
|
||||||
screen->handle_ei_log_event(ei, priority, message, context);
|
screen->handle_ei_log_event(priority, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ void PortalInputCapture::cb_init_input_capture_session(GObject *object, GAsyncRe
|
||||||
cb_zones_changed(session_, nullptr);
|
cb_zones_changed(session_, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PortalInputCapture::cb_set_pointer_barriers(GObject *object, GAsyncResult *res)
|
void PortalInputCapture::cb_set_pointer_barriers(const GObject *object, GAsyncResult *res)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) error = nullptr;
|
g_autoptr(GError) error = nullptr;
|
||||||
|
|
||||||
|
|
@ -244,7 +244,7 @@ void PortalInputCapture::release(double x, double y)
|
||||||
is_active_ = false;
|
is_active_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PortalInputCapture::cb_disabled(XdpInputCaptureSession *session, GVariant *option)
|
void PortalInputCapture::cb_disabled(const XdpInputCaptureSession *session, const GVariant *option)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("portal cb disabled");
|
LOG_DEBUG("portal cb disabled");
|
||||||
|
|
||||||
|
|
@ -269,7 +269,9 @@ void PortalInputCapture::cb_disabled(XdpInputCaptureSession *session, GVariant *
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PortalInputCapture::cb_activated(XdpInputCaptureSession *session, std::uint32_t activation_id, GVariant *options)
|
void PortalInputCapture::cb_activated(
|
||||||
|
const XdpInputCaptureSession *session, std::uint32_t activation_id, GVariant *options
|
||||||
|
)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("portal cb activated, id=%d", activation_id);
|
LOG_DEBUG("portal cb activated, id=%d", activation_id);
|
||||||
|
|
||||||
|
|
@ -288,7 +290,9 @@ void PortalInputCapture::cb_activated(XdpInputCaptureSession *session, std::uint
|
||||||
is_active_ = true;
|
is_active_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PortalInputCapture::cb_deactivated(XdpInputCaptureSession *session, std::uint32_t activation_id, GVariant *options)
|
void PortalInputCapture::cb_deactivated(
|
||||||
|
const XdpInputCaptureSession *session, std::uint32_t activation_id, const GVariant *options
|
||||||
|
)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("cb deactivated, id=%i", activation_id);
|
LOG_DEBUG("cb deactivated, id=%i", activation_id);
|
||||||
is_active_ = false;
|
is_active_ = false;
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,11 @@ private:
|
||||||
gboolean timeout_handler() const;
|
gboolean timeout_handler() const;
|
||||||
gboolean init_input_capture_session();
|
gboolean init_input_capture_session();
|
||||||
void cb_init_input_capture_session(GObject *object, GAsyncResult *res);
|
void cb_init_input_capture_session(GObject *object, GAsyncResult *res);
|
||||||
void cb_set_pointer_barriers(GObject *object, GAsyncResult *res);
|
void cb_set_pointer_barriers(const GObject *object, GAsyncResult *res);
|
||||||
void cb_session_closed(XdpSession *session);
|
void cb_session_closed(XdpSession *session);
|
||||||
void cb_disabled(XdpInputCaptureSession *session, GVariant *option);
|
void cb_disabled(const XdpInputCaptureSession *session, const GVariant *option);
|
||||||
void cb_activated(XdpInputCaptureSession *session, std::uint32_t activation_id, GVariant *options);
|
void cb_activated(const XdpInputCaptureSession *session, std::uint32_t activation_id, GVariant *options);
|
||||||
void cb_deactivated(XdpInputCaptureSession *session, std::uint32_t activation_id, GVariant *options);
|
void cb_deactivated(const XdpInputCaptureSession *session, std::uint32_t activation_id, const GVariant *options);
|
||||||
void cb_zones_changed(XdpInputCaptureSession *session, GVariant *options);
|
void cb_zones_changed(XdpInputCaptureSession *session, GVariant *options);
|
||||||
|
|
||||||
/// g_signal_connect callback wrapper
|
/// g_signal_connect callback wrapper
|
||||||
|
|
|
||||||
|
|
@ -1254,7 +1254,7 @@ bool XWindowsClipboard::CICCCMGetClipboard::readClipboard(
|
||||||
return !m_failed;
|
return !m_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool XWindowsClipboard::CICCCMGetClipboard::processEvent(Display *display, XEvent *xevent)
|
bool XWindowsClipboard::CICCCMGetClipboard::processEvent(Display *display, const XEvent *xevent)
|
||||||
{
|
{
|
||||||
// process event
|
// process event
|
||||||
switch (xevent->type) {
|
switch (xevent->type) {
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ protected:
|
||||||
bool readClipboard(Display *display, Atom selection, Atom target, Atom *actualTarget, std::string *data);
|
bool readClipboard(Display *display, Atom selection, Atom target, Atom *actualTarget, std::string *data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool processEvent(Display *display, XEvent *event);
|
bool processEvent(Display *display, const XEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Window m_requestor;
|
Window m_requestor;
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ XWindowsKeyState::~XWindowsKeyState()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void XWindowsKeyState::init(Display *display, bool useXKB)
|
void XWindowsKeyState::init(const Display *display, bool useXKB)
|
||||||
{
|
{
|
||||||
XGetKeyboardControl(m_display, &m_keyboardState);
|
XGetKeyboardControl(m_display, &m_keyboardState);
|
||||||
#if HAVE_XKB_EXTENSION
|
#if HAVE_XKB_EXTENSION
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ protected:
|
||||||
void fakeKey(const Keystroke &keystroke) override;
|
void fakeKey(const Keystroke &keystroke) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(Display *display, bool useXKB);
|
void init(const Display *display, bool useXKB);
|
||||||
void updateKeysymMap(deskflow::KeyMap &);
|
void updateKeysymMap(deskflow::KeyMap &);
|
||||||
void updateKeysymMapXKB(deskflow::KeyMap &);
|
void updateKeysymMapXKB(deskflow::KeyMap &);
|
||||||
bool hasModifiersXKB() const;
|
bool hasModifiersXKB() const;
|
||||||
|
|
|
||||||
|
|
@ -1480,7 +1480,7 @@ void XWindowsScreen::onKeyRelease(XKeyEvent &xkey, bool isRepeat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool XWindowsScreen::onHotKey(XKeyEvent &xkey, bool isRepeat)
|
bool XWindowsScreen::onHotKey(const XKeyEvent &xkey, bool isRepeat)
|
||||||
{
|
{
|
||||||
// find the hot key id
|
// find the hot key id
|
||||||
HotKeyToIDMap::const_iterator i = m_hotKeyToIDMap.find(HotKeyItem(xkey.keycode, xkey.state));
|
HotKeyToIDMap::const_iterator i = m_hotKeyToIDMap.find(HotKeyItem(xkey.keycode, xkey.state));
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ private:
|
||||||
bool grabMouseAndKeyboard();
|
bool grabMouseAndKeyboard();
|
||||||
void onKeyPress(XKeyEvent &);
|
void onKeyPress(XKeyEvent &);
|
||||||
void onKeyRelease(XKeyEvent &, bool isRepeat);
|
void onKeyRelease(XKeyEvent &, bool isRepeat);
|
||||||
bool onHotKey(XKeyEvent &, bool isRepeat);
|
bool onHotKey(const XKeyEvent &, bool isRepeat);
|
||||||
void onMousePress(const XButtonEvent &);
|
void onMousePress(const XButtonEvent &);
|
||||||
void onMouseRelease(const XButtonEvent &);
|
void onMouseRelease(const XButtonEvent &);
|
||||||
void onMouseMove(const XMotionEvent &);
|
void onMouseMove(const XMotionEvent &);
|
||||||
|
|
|
||||||
|
|
@ -925,7 +925,7 @@ void Config::readSectionAliases(ConfigReadContext &s)
|
||||||
}
|
}
|
||||||
|
|
||||||
InputFilter::Condition *
|
InputFilter::Condition *
|
||||||
Config::parseCondition(ConfigReadContext &s, const std::string &name, const std::vector<std::string> &args)
|
Config::parseCondition(const ConfigReadContext &s, const std::string &name, const std::vector<std::string> &args)
|
||||||
{
|
{
|
||||||
if (name == "keystroke") {
|
if (name == "keystroke") {
|
||||||
if (args.size() != 1) {
|
if (args.size() != 1) {
|
||||||
|
|
@ -1147,7 +1147,7 @@ void Config::parseAction(
|
||||||
rule.adoptAction(action, activate);
|
rule.adoptAction(action, activate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::parseScreens(ConfigReadContext &c, const std::string &s, std::set<std::string> &screens) const
|
void Config::parseScreens(const ConfigReadContext &c, const std::string &s, std::set<std::string> &screens) const
|
||||||
{
|
{
|
||||||
screens.clear();
|
screens.clear();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -468,13 +468,13 @@ private:
|
||||||
void readSectionAliases(ConfigReadContext &);
|
void readSectionAliases(ConfigReadContext &);
|
||||||
|
|
||||||
InputFilter::Condition *
|
InputFilter::Condition *
|
||||||
parseCondition(ConfigReadContext &, const std::string &condition, const std::vector<std::string> &args);
|
parseCondition(const ConfigReadContext &, const std::string &condition, const std::vector<std::string> &args);
|
||||||
void parseAction(
|
void parseAction(
|
||||||
ConfigReadContext &, const std::string &action, const std::vector<std::string> &args, InputFilter::Rule &,
|
ConfigReadContext &, const std::string &action, const std::vector<std::string> &args, InputFilter::Rule &,
|
||||||
bool activate
|
bool activate
|
||||||
);
|
);
|
||||||
|
|
||||||
void parseScreens(ConfigReadContext &, const std::string &, std::set<std::string> &screens) const;
|
void parseScreens(const ConfigReadContext &, const std::string &, std::set<std::string> &screens) const;
|
||||||
static const char *getOptionName(OptionID);
|
static const char *getOptionName(OptionID);
|
||||||
static std::string getOptionValue(OptionID, OptionValue);
|
static std::string getOptionValue(OptionID, OptionValue);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,7 @@ bool Server::isLockedToScreen() const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Server::getJumpZoneSize(BaseClientProxy *client) const
|
int32_t Server::getJumpZoneSize(const BaseClientProxy *client) const
|
||||||
{
|
{
|
||||||
if (client == m_primaryClient) {
|
if (client == m_primaryClient) {
|
||||||
return m_primaryClient->getJumpZoneSize();
|
return m_primaryClient->getJumpZoneSize();
|
||||||
|
|
@ -525,7 +525,7 @@ void Server::jumpToScreen(BaseClientProxy *newScreen)
|
||||||
switchScreen(newScreen, x, y, false);
|
switchScreen(newScreen, x, y, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Server::mapToFraction(BaseClientProxy *client, EDirection dir, int32_t x, int32_t y) const
|
float Server::mapToFraction(const BaseClientProxy *client, EDirection dir, int32_t x, int32_t y) const
|
||||||
{
|
{
|
||||||
int32_t sx;
|
int32_t sx;
|
||||||
int32_t sy;
|
int32_t sy;
|
||||||
|
|
@ -548,7 +548,7 @@ float Server::mapToFraction(BaseClientProxy *client, EDirection dir, int32_t x,
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Server::mapToPixel(BaseClientProxy *client, EDirection dir, float f, int32_t &x, int32_t &y) const
|
void Server::mapToPixel(const BaseClientProxy *client, EDirection dir, float f, int32_t &x, int32_t &y) const
|
||||||
{
|
{
|
||||||
int32_t sx;
|
int32_t sx;
|
||||||
int32_t sy;
|
int32_t sy;
|
||||||
|
|
@ -572,14 +572,14 @@ void Server::mapToPixel(BaseClientProxy *client, EDirection dir, float f, int32_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Server::hasAnyNeighbor(BaseClientProxy *client, EDirection dir) const
|
bool Server::hasAnyNeighbor(const BaseClientProxy *client, EDirection dir) const
|
||||||
{
|
{
|
||||||
assert(client != nullptr);
|
assert(client != nullptr);
|
||||||
|
|
||||||
return m_config->hasNeighbor(getName(client), dir);
|
return m_config->hasNeighbor(getName(client), dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseClientProxy *Server::getNeighbor(BaseClientProxy *src, EDirection dir, int32_t &x, int32_t &y) const
|
BaseClientProxy *Server::getNeighbor(const BaseClientProxy *src, EDirection dir, int32_t &x, int32_t &y) const
|
||||||
{
|
{
|
||||||
// note -- must be locked on entry
|
// note -- must be locked on entry
|
||||||
|
|
||||||
|
|
@ -732,7 +732,7 @@ BaseClientProxy *Server::mapToNeighbor(BaseClientProxy *src, EDirection srcSide,
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Server::avoidJumpZone(BaseClientProxy *dst, EDirection dir, int32_t &x, int32_t &y) const
|
void Server::avoidJumpZone(const BaseClientProxy *dst, EDirection dir, int32_t &x, int32_t &y) const
|
||||||
{
|
{
|
||||||
// we only need to avoid jump zones on the primary screen
|
// we only need to avoid jump zones on the primary screen
|
||||||
if (dst != m_primaryClient) {
|
if (dst != m_primaryClient) {
|
||||||
|
|
@ -981,7 +981,7 @@ bool Server::isSwitchWaitStarted() const
|
||||||
return (m_switchWaitTimer != nullptr);
|
return (m_switchWaitTimer != nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Server::getCorner(BaseClientProxy *client, int32_t x, int32_t y, int32_t size) const
|
uint32_t Server::getCorner(const BaseClientProxy *client, int32_t x, int32_t y, int32_t size) const
|
||||||
{
|
{
|
||||||
assert(client != nullptr);
|
assert(client != nullptr);
|
||||||
|
|
||||||
|
|
@ -1447,7 +1447,7 @@ void Server::handleFakeInputEndEvent(const Event &, void *)
|
||||||
m_primaryClient->fakeInputEnd();
|
m_primaryClient->fakeInputEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Server::onClipboardChanged(BaseClientProxy *sender, ClipboardID id, uint32_t seqNum)
|
void Server::onClipboardChanged(const BaseClientProxy *sender, ClipboardID id, uint32_t seqNum)
|
||||||
{
|
{
|
||||||
ClipboardInfo &clipboard = m_clipboards[id];
|
ClipboardInfo &clipboard = m_clipboards[id];
|
||||||
|
|
||||||
|
|
@ -2040,7 +2040,7 @@ void Server::removeOldClient(BaseClientProxy *client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Server::forceLeaveClient(BaseClientProxy *client)
|
void Server::forceLeaveClient(const BaseClientProxy *client)
|
||||||
{
|
{
|
||||||
if (BaseClientProxy *active = (m_activeSaver != nullptr) ? m_activeSaver : m_active; active == client) {
|
if (BaseClientProxy *active = (m_activeSaver != nullptr) ? m_activeSaver : m_active; active == client) {
|
||||||
// record new position (center of primary screen)
|
// record new position (center of primary screen)
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ private:
|
||||||
bool isLockedToScreen() const;
|
bool isLockedToScreen() const;
|
||||||
|
|
||||||
// returns the jump zone of the client
|
// returns the jump zone of the client
|
||||||
int32_t getJumpZoneSize(BaseClientProxy *) const;
|
int32_t getJumpZoneSize(const BaseClientProxy *) const;
|
||||||
|
|
||||||
// change the active screen
|
// change the active screen
|
||||||
void switchScreen(BaseClientProxy *, int32_t x, int32_t y, bool forScreenSaver);
|
void switchScreen(BaseClientProxy *, int32_t x, int32_t y, bool forScreenSaver);
|
||||||
|
|
@ -214,19 +214,19 @@ private:
|
||||||
|
|
||||||
// convert pixel position to fraction, using x or y depending on the
|
// convert pixel position to fraction, using x or y depending on the
|
||||||
// direction.
|
// direction.
|
||||||
float mapToFraction(BaseClientProxy *, EDirection, int32_t x, int32_t y) const;
|
float mapToFraction(const BaseClientProxy *, EDirection, int32_t x, int32_t y) const;
|
||||||
|
|
||||||
// convert fraction to pixel position, writing only x or y depending
|
// convert fraction to pixel position, writing only x or y depending
|
||||||
// on the direction.
|
// on the direction.
|
||||||
void mapToPixel(BaseClientProxy *, EDirection, float f, int32_t &x, int32_t &y) const;
|
void mapToPixel(const BaseClientProxy *, EDirection, float f, int32_t &x, int32_t &y) const;
|
||||||
|
|
||||||
// returns true if the client has a neighbor anywhere along the edge
|
// returns true if the client has a neighbor anywhere along the edge
|
||||||
// indicated by the direction.
|
// indicated by the direction.
|
||||||
bool hasAnyNeighbor(BaseClientProxy *, EDirection) const;
|
bool hasAnyNeighbor(const BaseClientProxy *, EDirection) const;
|
||||||
|
|
||||||
// lookup neighboring screen, mapping the coordinate independent of
|
// lookup neighboring screen, mapping the coordinate independent of
|
||||||
// the direction to the neighbor's coordinate space.
|
// the direction to the neighbor's coordinate space.
|
||||||
BaseClientProxy *getNeighbor(BaseClientProxy *, EDirection, int32_t &x, int32_t &y) const;
|
BaseClientProxy *getNeighbor(const BaseClientProxy *, EDirection, int32_t &x, int32_t &y) const;
|
||||||
|
|
||||||
// lookup neighboring screen. given a position relative to the
|
// lookup neighboring screen. given a position relative to the
|
||||||
// source screen, find the screen we should move onto and where.
|
// source screen, find the screen we should move onto and where.
|
||||||
|
|
@ -237,7 +237,7 @@ private:
|
||||||
|
|
||||||
// adjusts x and y or neither to avoid ending up in a jump zone
|
// adjusts x and y or neither to avoid ending up in a jump zone
|
||||||
// after entering the client in the given direction.
|
// after entering the client in the given direction.
|
||||||
void avoidJumpZone(BaseClientProxy *, EDirection, int32_t &x, int32_t &y) const;
|
void avoidJumpZone(const BaseClientProxy *, EDirection, int32_t &x, int32_t &y) const;
|
||||||
|
|
||||||
// test if a switch is permitted. this includes testing user
|
// test if a switch is permitted. this includes testing user
|
||||||
// options like switch delay and tracking any state required to
|
// options like switch delay and tracking any state required to
|
||||||
|
|
@ -277,7 +277,7 @@ private:
|
||||||
|
|
||||||
// returns the corner (EScreenSwitchCornerMasks) where x,y is on the
|
// returns the corner (EScreenSwitchCornerMasks) where x,y is on the
|
||||||
// given client. corners have the given size.
|
// given client. corners have the given size.
|
||||||
uint32_t getCorner(BaseClientProxy *, int32_t x, int32_t y, int32_t size) const;
|
uint32_t getCorner(const BaseClientProxy *, int32_t x, int32_t y, int32_t size) const;
|
||||||
|
|
||||||
// stop relative mouse moves
|
// stop relative mouse moves
|
||||||
void stopRelativeMoves();
|
void stopRelativeMoves();
|
||||||
|
|
@ -313,7 +313,7 @@ private:
|
||||||
void handleFakeInputEndEvent(const Event &, void *);
|
void handleFakeInputEndEvent(const Event &, void *);
|
||||||
|
|
||||||
// event processing
|
// event processing
|
||||||
void onClipboardChanged(BaseClientProxy *sender, ClipboardID id, uint32_t seqNum);
|
void onClipboardChanged(const BaseClientProxy *sender, ClipboardID id, uint32_t seqNum);
|
||||||
void onScreensaver(bool activated);
|
void onScreensaver(bool activated);
|
||||||
void onKeyDown(KeyID, KeyModifierMask, KeyButton, const std::string &, const char *screens);
|
void onKeyDown(KeyID, KeyModifierMask, KeyButton, const std::string &, const char *screens);
|
||||||
void onKeyUp(KeyID, KeyModifierMask, KeyButton, const char *screens);
|
void onKeyUp(KeyID, KeyModifierMask, KeyButton, const char *screens);
|
||||||
|
|
@ -345,7 +345,7 @@ private:
|
||||||
void removeOldClient(BaseClientProxy *);
|
void removeOldClient(BaseClientProxy *);
|
||||||
|
|
||||||
// force the cursor off of \p client
|
// force the cursor off of \p client
|
||||||
void forceLeaveClient(BaseClientProxy *client);
|
void forceLeaveClient(const BaseClientProxy *client);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class ClipboardInfo
|
class ClipboardInfo
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue