Deskflow
1.26.0.418
Keyboard and mouse sharing utility
Toggle main menu visibility
Loading...
Searching...
No Matches
XWindowsEventQueueBuffer.h
Go to the documentation of this file.
1
/*
2
* Deskflow -- mouse and keyboard sharing utility
3
* SPDX-FileCopyrightText: (C) 2026 Deskflow Developers
4
* SPDX-FileCopyrightText: (C) 2012 - 2016 Synergy App Ltd
5
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
6
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
7
*/
8
9
#pragma once
10
11
#include "
base/IEventQueueBuffer.h
"
12
13
#include <mutex>
14
#include <vector>
15
16
#include <X11/Xlib.h>
17
18
class
IEventQueue
;
19
21
class
XWindowsEventQueueBuffer
:
public
IEventQueueBuffer
22
{
23
public
:
24
XWindowsEventQueueBuffer
(Display *, Window,
IEventQueue
*events);
25
XWindowsEventQueueBuffer
(
XWindowsEventQueueBuffer
const
&) =
delete
;
26
XWindowsEventQueueBuffer
(
XWindowsEventQueueBuffer
&&) =
delete
;
27
~XWindowsEventQueueBuffer
()
override
;
28
29
XWindowsEventQueueBuffer
&
operator=
(
XWindowsEventQueueBuffer
const
&) =
delete
;
30
XWindowsEventQueueBuffer
&
operator=
(
XWindowsEventQueueBuffer
&&) =
delete
;
31
32
// IEventQueueBuffer overrides
33
void
init
()
override
34
{
35
// do nothing
36
}
37
void
waitForEvent
(
double
timeout
)
override
;
38
Type
getEvent
(
Event
&event, uint32_t &dataID)
override
;
39
bool
addEvent
(uint32_t dataID)
override
;
40
bool
isEmpty
()
const override
;
41
42
private
:
43
void
flush();
44
45
int
getPendingCountLocked();
46
47
private
:
48
using
EventList = std::vector<XEvent>;
49
50
mutable
std::mutex m_mutex;
51
Display *m_display;
52
Window m_window;
53
Atom m_userEvent;
54
XEvent m_event;
55
EventList m_postedEvents;
56
bool
m_waiting =
false
;
57
int
m_pipefd[2];
58
IEventQueue
*m_events;
59
};
timeout
static fd_set FAR fd_set FAR fd_set FAR const struct timeval FAR * timeout
Definition
ArchNetworkWinsock.cpp:41
IEventQueueBuffer.h
Event
Event.
Definition
Event.h:43
IEventQueueBuffer
Event queue buffer interface.
Definition
IEventQueueBuffer.h:22
IEventQueueBuffer::Type
Type
Definition
IEventQueueBuffer.h:26
IEventQueue
Event queue interface.
Definition
IEventQueue.h:29
XWindowsEventQueueBuffer::XWindowsEventQueueBuffer
XWindowsEventQueueBuffer(XWindowsEventQueueBuffer &&)=delete
XWindowsEventQueueBuffer::getEvent
Type getEvent(Event &event, uint32_t &dataID) override
Get the next event.
Definition
XWindowsEventQueueBuffer.cpp:125
XWindowsEventQueueBuffer::init
void init() override
Initialize.
Definition
XWindowsEventQueueBuffer.h:33
XWindowsEventQueueBuffer::XWindowsEventQueueBuffer
XWindowsEventQueueBuffer(XWindowsEventQueueBuffer const &)=delete
XWindowsEventQueueBuffer::operator=
XWindowsEventQueueBuffer & operator=(XWindowsEventQueueBuffer const &)=delete
XWindowsEventQueueBuffer::operator=
XWindowsEventQueueBuffer & operator=(XWindowsEventQueueBuffer &&)=delete
XWindowsEventQueueBuffer::isEmpty
bool isEmpty() const override
Check if event queue buffer is empty.
Definition
XWindowsEventQueueBuffer.cpp:180
XWindowsEventQueueBuffer::addEvent
bool addEvent(uint32_t dataID) override
Post an event.
Definition
XWindowsEventQueueBuffer.cpp:145
XWindowsEventQueueBuffer::waitForEvent
void waitForEvent(double timeout) override
Block waiting for an event.
Definition
XWindowsEventQueueBuffer.cpp:50
XWindowsEventQueueBuffer::XWindowsEventQueueBuffer
XWindowsEventQueueBuffer(Display *, Window, IEventQueue *events)
Definition
XWindowsEventQueueBuffer.cpp:23
src
lib
platform
XWindowsEventQueueBuffer.h
Generated by
1.18.0