2020-01-03 20:05:16 +01:00
|
|
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
2023-06-25 21:15:14 +02:00
|
|
|
#pragma once
|
2020-01-03 20:05:16 +01:00
|
|
|
|
|
|
|
#include "IOSOperator.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
|
|
|
|
class CIrrDeviceLinux;
|
|
|
|
|
|
|
|
//! The Operating system operator provides operation system specific methods and information.
|
|
|
|
class COSOperator : public IOSOperator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// constructor
|
|
|
|
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
|
|
|
COSOperator(const core::stringc& osversion, CIrrDeviceLinux* device);
|
|
|
|
#endif
|
|
|
|
COSOperator(const core::stringc& osversion);
|
|
|
|
|
2023-03-26 14:13:58 +02:00
|
|
|
~COSOperator();
|
|
|
|
|
|
|
|
COSOperator(const COSOperator &) = delete;
|
|
|
|
COSOperator &operator=(const COSOperator &) = delete;
|
|
|
|
|
2020-01-03 20:05:16 +01:00
|
|
|
//! returns the current operation system version as string.
|
2022-10-09 20:57:28 +02:00
|
|
|
const core::stringc& getOperatingSystemVersion() const override;
|
2020-01-03 20:05:16 +01:00
|
|
|
|
|
|
|
//! copies text to the clipboard
|
2022-10-09 20:57:28 +02:00
|
|
|
void copyToClipboard(const c8 *text) const override;
|
2020-01-03 20:05:16 +01:00
|
|
|
|
2022-08-23 17:19:23 +02:00
|
|
|
//! copies text to the primary selection
|
|
|
|
void copyToPrimarySelection(const c8 *text) const override;
|
|
|
|
|
2020-01-03 20:05:16 +01:00
|
|
|
//! gets text from the clipboard
|
2022-10-09 20:57:28 +02:00
|
|
|
const c8* getTextFromClipboard() const override;
|
2020-01-03 20:05:16 +01:00
|
|
|
|
2022-08-23 17:19:23 +02:00
|
|
|
//! gets text from the primary selection
|
|
|
|
const c8* getTextFromPrimarySelection() const override;
|
|
|
|
|
2020-01-03 20:05:16 +01:00
|
|
|
//! gets the total and available system RAM in kB
|
|
|
|
//! \param Total: will contain the total system memory
|
|
|
|
//! \param Avail: will contain the available memory
|
|
|
|
//! \return Returns true if successful, false if not
|
2022-10-09 20:57:28 +02:00
|
|
|
bool getSystemMemory(u32* Total, u32* Avail) const override;
|
2020-01-03 20:05:16 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
core::stringc OperatingSystem;
|
|
|
|
|
|
|
|
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
|
|
|
CIrrDeviceLinux * IrrDeviceLinux;
|
|
|
|
#endif
|
|
|
|
|
2021-08-30 21:51:24 +02:00
|
|
|
#ifdef _IRR_WINDOWS_API_
|
|
|
|
mutable core::stringc ClipboardBuf;
|
|
|
|
#endif
|
|
|
|
|
2023-03-26 14:13:58 +02:00
|
|
|
#ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
|
|
|
|
// These need to be freed with SDL_free
|
|
|
|
mutable char *ClipboardSelectionText = nullptr;
|
|
|
|
mutable char *PrimarySelectionText = nullptr;
|
|
|
|
#endif
|
|
|
|
|
2020-01-03 20:05:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace
|