Class X11IconComponent
Inherited Members
Namespace: OpenTK.Platform.Native.X11
Assembly: OpenTK.Platform.dll
Syntax
public class X11IconComponent : IIconComponent, IPalComponent
Properties
CanLoadSystemIcons
If common system icons can be created. If this is true then Create(SystemIconType) will work, otherwise an exception will be thrown.
Declaration
public bool CanLoadSystemIcons { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
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 |
Methods
Create(SystemIconType)
Load a system icon. Only works if CanLoadSystemIcons is true.
Declaration
public IconHandle Create(SystemIconType systemIcon)
Parameters
Type | Name | Description |
---|---|---|
SystemIconType | systemIcon | The system icon to create. |
Returns
Type | Description |
---|---|
IconHandle | A handle to the created system icon. |
Exceptions
Type | Condition |
---|---|
PlatformNotSupportedException | Platform does not implement this function. See CanLoadSystemIcons. |
See Also
Create(int, int, IconImage[])
Creates a _NET_WM_ICON from a number of images. This is useful for specifying icon images at multiple resolutions.
Declaration
public IconHandle Create(int width, int height, X11IconComponent.IconImage[] images)
Parameters
Type | Name | Description |
---|---|---|
int | width | The width of the icon to report in GetSize(IconHandle, out int, out int). |
int | height | The height of the icon to report in GetSize(IconHandle, out int, out int). |
IconImage[] | images | The icon images. |
Returns
Type | Description |
---|---|
IconHandle | A handle to the created icon. |
Create(int, int, ReadOnlySpan<byte>)
Load an icon object with image data.
Declaration
public IconHandle Create(int width, int height, ReadOnlySpan<byte> data)
Parameters
Type | Name | Description |
---|---|---|
int | width | Width of the bitmap. |
int | height | Height of the bitmap. |
ReadOnlySpan<byte> | data | Image data to load into icon in RGBA format. |
Returns
Type | Description |
---|---|
IconHandle | A handle to the created icon. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | If |
ArgumentException |
|
Destroy(IconHandle)
Destroy an icon object.
Declaration
public void Destroy(IconHandle handle)
Parameters
Type | Name | Description |
---|---|---|
IconHandle | handle | Handle to the icon object to destroy. |
See Also
GetSize(IconHandle, out int, out int)
Get the dimensions of a icon object.
Declaration
public void GetSize(IconHandle handle, out int width, out int height)
Parameters
Type | Name | Description |
---|---|---|
IconHandle | handle | Handle to icon object. |
int | width | Width of the icon. |
int | height | Height of icon. |
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
Uninitialize()
Uninitialize the component. Frees any native resources used by the component.
Declaration
public void Uninitialize()