Class X11ClipboardComponent
Inherited Members
Namespace: OpenTK.Platform.Native.X11
Assembly: OpenTK.Platform.dll
Syntax
public class X11ClipboardComponent : IClipboardComponent, IPalComponent
Properties
Logger
The logger that this component uses to log diagnostic messages.
Declaration
public ILogger? Logger { get; set; }
Property Value
Type | Description |
---|---|
ILogger |
See Also
Name
Name of the abstraction layer component.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
Provides
Specifies which PAL components this object provides.
Declaration
public PalComponents Provides { get; }
Property Value
Type | Description |
---|---|
PalComponents |
SupportedFormats
A list of formats that this clipboard component supports.
Declaration
public IReadOnlyList<ClipboardFormat> SupportedFormats { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<ClipboardFormat> |
See Also
Methods
GetClipboardAudio()
Gets the audio data currently in the clipboard. This function returns null if the current clipboard data doesn't have the Audio format.
Declaration
public AudioData? GetClipboardAudio()
Returns
Type | Description |
---|---|
AudioData | The audio data currently in the clipboard, or null. |
See Also
GetClipboardBitmap()
Gets the bitmap currently in the clipboard. This function returns null if the current clipboard data doesn't have the Bitmap format.
Declaration
public Bitmap? GetClipboardBitmap()
Returns
Type | Description |
---|---|
Bitmap | The bitmap currently in the clipboard, or null. |
Remarks
On linux clipboard bitmaps are defacto transferred as PNG data, as such a PNG encoder/decoder is needed to read and write bitmaps from the clipboard. To enable this SetPngCodec(IPngCodec?) must be called with an object that implements the X11ClipboardComponent.IPngCodec interface. If this is not done, SetClipboardBitmap(Bitmap) and GetClipboardBitmap() will both throw an exception.
See Also
GetClipboardFiles()
Gets a list of files and directories currently in the clipboard. This function returns null if the current clipboard data doesn't have the Files format.
Declaration
public List<string>? GetClipboardFiles()
Returns
Type | Description |
---|---|
List<string> | The list of files and directories currently in the clipboard, or null. |
See Also
GetClipboardFormat()
Gets the format of the data currently in the clipboard.
Declaration
public ClipboardFormat GetClipboardFormat()
Returns
Type | Description |
---|---|
ClipboardFormat | The format of the data currently in the clipboard. |
See Also
GetClipboardText()
Gets the string currently in the clipboard. This function returns null if the current clipboard data doesn't have the Text format.
Declaration
public string? GetClipboardText()
Returns
Type | Description |
---|---|
string | The string currently in the clipboard, or null. |
See Also
Initialize(ToolkitOptions)
Initialize the component.
Declaration
public void Initialize(ToolkitOptions options)
Parameters
Type | Name | Description |
---|---|---|
ToolkitOptions | options | The options to initialize the component with. |
See Also
SetClipboardBitmap(Bitmap)
Writes a bitmap to the clipboard.
Declaration
public void SetClipboardBitmap(Bitmap bitmap)
Parameters
Type | Name | Description |
---|---|---|
Bitmap | bitmap | The bitmap to write to the clipboard. |
Remarks
On linux clipboard bitmaps are defacto transferred as PNG data, as such a PNG encoder/decoder is needed to read and write bitmaps from the clipboard. To enable this SetPngCodec(IPngCodec?) must be called with an object that implements the X11ClipboardComponent.IPngCodec interface.
See Also
SetClipboardText(string)
Sets the string currently in the clipboard.
Declaration
public void SetClipboardText(string text)
Parameters
Type | Name | Description |
---|---|---|
string | text | The text to write to the clipboard. |
See Also
SetPngCodec(IPngCodec?)
Allows the clipboard component to decode and encode png images using the specified X11ClipboardComponent.IPngCodec instance.
Declaration
public void SetPngCodec(X11ClipboardComponent.IPngCodec? codec)
Parameters
Type | Name | Description |
---|---|---|
X11ClipboardComponent.IPngCodec | codec | The X11ClipboardComponent.IPngCodec to use for image encoding. |
See Also
Uninitialize()
Uninitialize the component. Frees any native resources used by the component.
Declaration
public void Uninitialize()