Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
X11 clipboard implementation. More...
#include <XWindowsClipboard.h>
Classes | |
class | CICCCMGetClipboard |
class | MotifClipFormat |
class | MotifClipHeader |
class | MotifClipItem |
class | Reply |
Public Member Functions | |
XWindowsClipboard (Display *, Window window, ClipboardID id) | |
XWindowsClipboard (XWindowsClipboard const &)=delete | |
XWindowsClipboard (XWindowsClipboard &&)=delete | |
~XWindowsClipboard () override | |
XWindowsClipboard & | operator= (XWindowsClipboard const &)=delete |
XWindowsClipboard & | operator= (XWindowsClipboard &&)=delete |
void | lost (Time) |
Notify clipboard was lost. | |
void | addRequest (Window owner, Window requestor, Atom target, ::Time time, Atom property) |
Add clipboard request. | |
bool | processRequest (Window requestor, ::Time time, Atom property) |
Process clipboard request. | |
bool | destroyRequest (Window requestor) |
Cancel clipboard request. | |
Window | getWindow () const |
Get window. | |
Atom | getSelection () const |
Get selection atom. | |
bool | empty () override |
Empty clipboard. | |
void | add (EFormat, const std::string &data) override |
Add data. | |
bool | open (Time) const override |
Open clipboard. | |
void | close () const override |
Close clipboard. | |
Time | getTime () const override |
Get time. | |
bool | has (EFormat) const override |
Check for data. | |
std::string | get (EFormat) const override |
Get data. | |
Public Member Functions inherited from IClipboard | |
Public Member Functions inherited from IInterface | |
virtual | ~IInterface ()=default |
Interface destructor does nothing. |
Protected Types | |
enum class | MotifClip : int32_t { Format = 1 , Item = 2 , Header = 3 } |
using | ReplyList = std::list<Reply *> |
using | ReplyMap = std::map<Window, ReplyList> |
using | ReplyEventMask = std::map<Window, long> |
Protected Member Functions | |
void | icccmFillCache () |
bool | icccmGetSelection (Atom target, Atom *actualTarget, std::string *data) const |
Time | icccmGetTime () const |
bool | motifLockClipboard () const |
void | motifUnlockClipboard () const |
bool | motifOwnsClipboard () const |
void | motifFillCache () |
bool | motifGetSelection (const MotifClipFormat *, Atom *actualTarget, std::string *data) const |
Time | motifGetTime () const |
bool | insertMultipleReply (Window, ::Time, Atom) |
void | insertReply (Reply *) |
void | pushReplies () |
void | pushReplies (ReplyMap::iterator &, ReplyList &, ReplyList::iterator) |
bool | sendReply (Reply *) |
void | clearReplies () |
void | clearReplies (ReplyList &) |
void | sendNotify (Window requestor, Atom selection, Atom target, Atom property, Time time) |
bool | wasOwnedAtTime (::Time) const |
Atom | getTargetsData (std::string &, int *format) const |
Atom | getTimestampData (std::string &, int *format) const |
Additional Inherited Members | |
Public Types inherited from IClipboard | |
enum | EFormat { kText , kHTML , kBitmap , kNumFormats } |
Clipboard formats. More... | |
using | Time = uint32_t |
Timestamp type. | |
static std::string | marshall (const IClipboard *clipboard) |
Marshall clipboard data. | |
static void | unmarshall (IClipboard *clipboard, const std::string_view &data, Time time) |
Unmarshall clipboard data. | |
static bool | copy (IClipboard *dst, const IClipboard *src) |
Copy clipboard. | |
static bool | copy (IClipboard *dst, const IClipboard *src, Time) |
Copy clipboard. |
X11 clipboard implementation.
|
protected |
|
protected |
|
protected |
|
strongprotected |
XWindowsClipboard::XWindowsClipboard | ( | Display * | display, |
Window | window, | ||
ClipboardID | id ) |
Use window
as the window that owns or interacts with the clipboard identified by id
.
|
delete |
|
delete |
|
override |
|
overridevirtual |
Add data.
Add data in the given format to the clipboard. May only be called after a successful empty().
Implements IClipboard.
void XWindowsClipboard::addRequest | ( | Window | owner, |
Window | requestor, | ||
Atom | target, | ||
::Time | time, | ||
Atom | property ) |
Add clipboard request.
Adds a selection request to the request list. If the given owner window isn't this clipboard's window then this simply sends a failure event to the requestor.
|
protected |
|
protected |
|
overridevirtual |
Close clipboard.
Close the clipboard. close() must match a preceding successful open(). This signals that the clipboard has been filled with all the necessary data or all data has been read. It does not mean the clipboard ownership should be released (if it was taken).
Implements IClipboard.
bool XWindowsClipboard::destroyRequest | ( | Window | requestor | ) |
Cancel clipboard request.
Terminate a selection request. Returns true iff the request was known and handled.
|
overridevirtual |
Empty clipboard.
Take ownership of the clipboard and clear all data from it. This must be called between a successful open() and close(). Return false if the clipboard ownership could not be taken; the clipboard should not be emptied in this case.
Implements IClipboard.
|
overridevirtual |
Get data.
Return the data in the given format. Returns the empty string if there is no data in that format. Must be called between a successful open() and close().
Implements IClipboard.
Atom XWindowsClipboard::getSelection | ( | ) | const |
Get selection atom.
Returns the selection atom that identifies the clipboard to X11 (e.g. XA_PRIMARY).
|
protected |
|
overridevirtual |
|
protected |
Window XWindowsClipboard::getWindow | ( | ) | const |
Get window.
Returns the clipboard's window (passed the c'tor).
|
overridevirtual |
Check for data.
Return true iff the clipboard contains data in the given format. Must be called between a successful open() and close().
Implements IClipboard.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
void XWindowsClipboard::lost | ( | Time | time | ) |
Notify clipboard was lost.
Tells clipboard it lost ownership at the given time.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
overridevirtual |
Open clipboard.
Open the clipboard. Return true iff the clipboard could be opened. If open() returns true then the client must call close() at some later time; if it returns false then close() must not be called. time
should be the current time or a time in the past when the open should effectively have taken place.
Implements IClipboard.
|
delete |
|
delete |
bool XWindowsClipboard::processRequest | ( | Window | requestor, |
::Time | time, | ||
Atom | property ) |
Process clipboard request.
Continues processing a selection request. Returns true if the request was handled, false if the request was unknown.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |