Class MacOSIconComponent
Inherited Members
Namespace: OpenTK.Platform.Native.macOS
Assembly: OpenTK.Platform.dll
Syntax
public class MacOSIconComponent : IIconComponent, IPalComponent
Properties
CanLoadSystemIcons
True if icon objects can be populated from common system icons. 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
Provides a logger for this component.
Declaration
public ILogger? Logger { get; set; }
Property Value
Type | Description |
---|---|
ILogger |
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. |
See Also
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. |
Returns
Type | Description |
---|---|
IconHandle | A handle to the created icon. |
CreateSFSymbol(string, string)
Loads a SF Symbols symbol by name.
Declaration
public IconHandle? CreateSFSymbol(string sfSymbolName, string accessibilityDescription)
Parameters
Type | Name | Description |
---|---|---|
string | sfSymbolName | The SF Symbols name. |
string | accessibilityDescription | An accessibility description of the icon. |
Returns
Type | Description |
---|---|
IconHandle | A handle to the created icon, or null if no SF Symbol matching the name was found. |
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. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Initialize(ToolkitOptions)
Initialize the component.
Declaration
public void Initialize(ToolkitOptions options)
Parameters
Type | Name | Description |
---|---|---|
ToolkitOptions | options | The options to initialize the component with. |