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

@ -54,7 +54,6 @@ const core::stringc& COSOperator::getOperatingSystemVersion() const
//! copies text to the clipboard
//! \param text: text in utf-8
void COSOperator::copyToClipboard(const c8 *text) const
{
if (strlen(text)==0)
@ -102,8 +101,20 @@ void COSOperator::copyToClipboard(const c8 *text) const
}
//! copies text to the primary selection
void COSOperator::copyToPrimarySelection(const c8 *text) const
{
if (strlen(text)==0)
return;
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if ( IrrDeviceLinux )
IrrDeviceLinux->copyToPrimarySelection(text);
#endif
}
//! gets text from the clipboard
//! \return Returns 0 if no string is in there, otherwise an utf-8 string.
const c8* COSOperator::getTextFromClipboard() const
{
#if defined(_IRR_WINDOWS_API_)
@ -147,6 +158,21 @@ const c8* COSOperator::getTextFromClipboard() const
}
//! gets text from the primary selection
const c8* COSOperator::getTextFromPrimarySelection() const
{
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if ( IrrDeviceLinux )
return IrrDeviceLinux->getTextFromPrimarySelection();
return 0;
#else
return 0;
#endif
}
bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const
{
#if defined(_IRR_WINDOWS_API_)