Implement X11 primary selection

This commit is contained in:
Desour
2022-08-23 17:19:23 +02:00
committed by sfan5
parent 1967d71cfb
commit 53b9eaa831
5 changed files with 128 additions and 32 deletions

View File

@ -97,11 +97,20 @@ namespace irr
//! \return Returns 0 if no string is in there, otherwise utf-8 text.
virtual const c8 *getTextFromClipboard() const;
//! gets text from the primary selection
//! \return Returns 0 if no string is in there, otherwise utf-8 text.
virtual const c8 *getTextFromPrimarySelection() const;
//! copies text to the clipboard
//! This sets the clipboard selection and _not_ the primary selection which you have on X on the middle mouse button.
//! This sets the clipboard selection and _not_ the primary selection.
//! @param text The text in utf-8
virtual void copyToClipboard(const c8 *text) const;
//! copies text to the primary selection
//! This sets the primary selection which you have on X on the middle mouse button.
//! @param text The text in utf-8
virtual void copyToPrimarySelection(const c8 *text) const;
//! Remove all messages pending in the system message loop
void clearSystemMessages() override;
@ -141,6 +150,9 @@ namespace irr
bool createInputContext();
void destroyInputContext();
EKEY_CODE getKeyCode(XEvent &event);
const c8 *getTextFromSelection(Atom selection, core::stringc &text_buffer) const;
bool becomeSelectionOwner(Atom selection) const;
#endif
//! Implementation of the linux cursor control
@ -413,6 +425,7 @@ namespace irr
bool HasNetWM;
// text is utf-8
mutable core::stringc Clipboard;
mutable core::stringc PrimarySelection;
#endif
#if defined(_IRR_LINUX_X11_XINPUT2_)
int currentTouchedCount;