mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 15:50:27 +02:00
Implement X11 primary selection
This commit is contained in:
@ -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_)
|
||||
|
Reference in New Issue
Block a user