JX Application Framework
|
#include <JXSelectionManager.h>
Public Types | |
enum | DeleteMethod { kArrayDelete , kXFree , kCFree } |
enum | { kSelectionWindPropAtomIndex , kIncrementalSendAtomIndex , kTargetsAtomIndex , kTimeStampAtomIndex , kUtf8StringAtomIndex , kMultipleAtomIndex , kMimePlainTextAtomIndex , kMimePlainTextUTF8AtomIndex , kURLAtomIndex , kDeleteSelectionAtomIndex , kNULLAtomIndex , kGnomeClipboardAtomIndex , kAtomCount } |
Public Member Functions | |
JXSelectionManager (JXDisplay *display) | |
~JXSelectionManager () override | |
bool | GetAvailableTypes (const Atom selectionName, const Time time, JArray< Atom > *typeList) |
bool | GetData (const Atom selectionName, const Time time, const Atom requestType, Atom *returnType, unsigned char **data, JSize *dataLength, DeleteMethod *delMethod) |
void | DeleteData (unsigned char **data, const DeleteMethod delMethod) |
void | SendDeleteRequest (const Atom selectionName, const Time time) |
bool | OwnedSelection (const Atom selectionName, const Time time) |
bool | OwnsSelection (const Atom selectionName) |
bool | GetData (const Atom selectionName, const Time time, const JXSelectionData **data) |
bool | SetData (const Atom selectionName, JXSelectionData *data) |
void | ClearData (const Atom selectionName, const Time endTime) |
JXDisplay * | GetDisplay () |
Atom | GetTargetsXAtom () const |
Atom | GetTimeStampXAtom () const |
Atom | GetUtf8StringXAtom () const |
Atom | GetMultipleXAtom () const |
Atom | GetMimePlainTextXAtom () const |
Atom | GetMimePlainTextUTF8XAtom () const |
Atom | GetURLXAtom () const |
Atom | GetDeleteSelectionXAtom () const |
Atom | GetNULLXAtom () const |
void | HandleSelectionRequest (const XSelectionRequestEvent &selReqEvent) |
![]() | |
JBroadcaster () | |
virtual | ~JBroadcaster () |
JBroadcaster & | operator= (const JBroadcaster &source) |
bool | HasSenders () const |
JSize | GetSenderCount () const |
bool | HasRecipients () const |
JSize | GetRecipientCount () const |
virtual JString | ToString () const |
template<class T > | |
void | ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f) |
Protected Member Functions | |
void | ReceiveWithFeedback (JBroadcaster *sender, Message *message) override |
![]() | |
JBroadcaster (const JBroadcaster &source) | |
void | ListenTo (const JBroadcaster *sender) |
void | StopListening (const JBroadcaster *sender) |
void | ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember) |
void | StopListening (const JBroadcaster *sender, const std::type_info &messageType) |
template<class T > | |
void | Send (JBroadcaster *recipient, const T &message) |
template<class T > | |
void | Broadcast (const T &message) |
virtual void | Receive (JBroadcaster *sender, const Message &message) |
void | SendWithFeedback (JBroadcaster *recipient, Message *message) |
void | BroadcastWithFeedback (Message *message) |
virtual void | ReceiveGoingAway (JBroadcaster *sender) |
Friends | |
class | JXDNDManager |
Global object to interface with X Selection mechanism. Nobody else seems to support MULTIPLE, so I see no reason to support it here. If we ever need to support it, here is the basic idea: Pass in filled JArray<Atom>* and empty JArray<char*>* We remove the unconverted types from JArray<Atom> and fill in the JArray<char*> with the converted data
anonymous enum |
JXSelectionManager::JXSelectionManager | ( | JXDisplay * | display | ) |
|
override |
void JXSelectionManager::ClearData | ( | const Atom | selectionName, |
const Time | endTime | ||
) |
void JXSelectionManager::DeleteData | ( | unsigned char ** | data, |
const DeleteMethod | delMethod | ||
) |
bool JXSelectionManager::GetAvailableTypes | ( | const Atom | selectionName, |
const Time | time, | ||
JArray< Atom > * | typeList | ||
) |
time can be CurrentTime.
bool JXSelectionManager::GetData | ( | const Atom | selectionName, |
const Time | time, | ||
const Atom | requestType, | ||
Atom * | returnType, | ||
unsigned char ** | data, | ||
JSize * | dataLength, | ||
DeleteMethod * | delMethod | ||
) |
time can be CurrentTime.
Caller is responsible for calling DeleteData() on the data that is returned.
bool JXSelectionManager::GetData | ( | const Atom | selectionName, |
const Time | time, | ||
const JXSelectionData ** | data | ||
) |
time can be CurrentTime.
In the private version, if index != nullptr, it contains the index into itsDataList.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void JXSelectionManager::HandleSelectionRequest | ( | const XSelectionRequestEvent & | selReqEvent | ) |
|
inline |
|
inline |
|
overrideprotectedvirtual |
This catches errors while sending and receiving data.
Reimplemented from JBroadcaster.
void JXSelectionManager::SendDeleteRequest | ( | const Atom | selectionName, |
const Time | time | ||
) |
Implements the DELETE selection protocol.
window should be any one that X can attach the data to. Widgets can simply pass in the result from GetWindow().
time can be CurrentTime.
bool JXSelectionManager::SetData | ( | const Atom | selectionName, |
JXSelectionData * | data | ||
) |
Set the data for the given selection.
'data' must be allocated on the heap. We take ownership of 'data' even if the function returns false.
|
friend |