2024-05-13 00:17:40 +02:00
|
|
|
// <auto-generated>
|
|
|
|
// This code is generated by csbindgen.
|
|
|
|
// DON'T CHANGE THIS DIRECTLY.
|
|
|
|
// </auto-generated>
|
|
|
|
#pragma warning disable CS8500
|
|
|
|
#pragma warning disable CS8981
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
2024-05-25 11:16:37 +02:00
|
|
|
namespace ServicePoint.BindGen
|
2024-05-13 00:17:40 +02:00
|
|
|
{
|
|
|
|
public static unsafe partial class NativeMethods
|
|
|
|
{
|
2024-05-26 13:15:11 +02:00
|
|
|
const string __DllName = "servicepoint_binding_c";
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-09-05 21:15:53 +02:00
|
|
|
public const nuint SP_TILE_SIZE = 8;
|
|
|
|
public const nuint SP_TILE_WIDTH = 56;
|
|
|
|
public const nuint SP_TILE_HEIGHT = 20;
|
2024-05-13 00:17:40 +02:00
|
|
|
|
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new `BitVec` instance.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `size`: size in bits.
|
|
|
|
///
|
|
|
|
/// returns: `BitVec` with all bits set to false.
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When `size` is not divisible by 8.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_bit_vec_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern BitVec* sp_bit_vec_new(nuint size);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Interpret the data as a series of bits and load then into a new `BitVec` instance.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `data` points to a valid memory location of at least `data_length`
|
|
|
|
/// bytes in size.
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_bit_vec_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern BitVec* sp_bit_vec_load(byte* data, nuint data_length);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Clones a `BitVec`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_bit_vec_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern BitVec* sp_bit_vec_clone(BitVec* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Deallocates a `BitVec`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// - `this` is not used concurrently or after this call
|
|
|
|
/// - `this` was not passed to another consuming function, e.g. to create a `Command`
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_dealloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_bit_vec_dealloc(BitVec* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the value of a bit from the `BitVec`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
/// - `index`: the bit index to read
|
|
|
|
///
|
|
|
|
/// returns: value of the bit
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When accessing `index` out of bounds.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-05-13 00:17:40 +02:00
|
|
|
[return: MarshalAs(UnmanagedType.U1)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern bool sp_bit_vec_get(BitVec* @this, nuint index);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the value of a bit in the `BitVec`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to write to
|
|
|
|
/// - `index`: the bit index to edit
|
|
|
|
/// - `value`: the value to set the bit to
|
|
|
|
///
|
|
|
|
/// returns: old value of the bit
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When accessing `index` out of bounds.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// - `this` is not written to or read from concurrently
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_bit_vec_set(BitVec* @this, nuint index, [MarshalAs(UnmanagedType.U1)] bool value);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the value of all bits in the `BitVec`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `value`: the value to set all bits to
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// - `this` is not written to or read from concurrently
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_bit_vec_fill(BitVec* @this, [MarshalAs(UnmanagedType.U1)] bool value);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the length of the `BitVec` in bits.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_len", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern nuint sp_bit_vec_len(BitVec* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Returns true if length is 0.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_is_empty", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-05-15 23:17:29 +02:00
|
|
|
[return: MarshalAs(UnmanagedType.U1)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern bool sp_bit_vec_is_empty(BitVec* @this);
|
2024-05-15 23:17:29 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets an unsafe reference to the data of the `BitVec` instance.
|
|
|
|
///
|
|
|
|
/// ## Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// - the returned memory range is never accessed after the passed `BitVec` has been freed
|
|
|
|
/// - the returned memory range is never accessed concurrently, either via the `BitVec` or directly
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_bit_vec_unsafe_data_ref", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern ByteSlice sp_bit_vec_unsafe_data_ref(BitVec* @this);
|
2024-05-15 20:34:51 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new `BrightnessGrid` with the specified dimensions.
|
|
|
|
///
|
|
|
|
/// returns: `BrightnessGrid` initialized to 0.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_brightness_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern BrightnessGrid* sp_brightness_grid_new(nuint width, nuint height);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Loads a `BrightnessGrid` with the specified dimensions from the provided data.
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When the provided `data_length` is not sufficient for the `height` and `width`
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `data` points to a valid memory location of at least `data_length`
|
|
|
|
/// bytes in size.
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_brightness_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern BrightnessGrid* sp_brightness_grid_load(nuint width, nuint height, byte* data, nuint data_length);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Clones a `BrightnessGrid`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BrightnessGrid`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_brightness_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern BrightnessGrid* sp_brightness_grid_clone(BrightnessGrid* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Deallocates a `BrightnessGrid`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BrightnessGrid`
|
|
|
|
/// - `this` is not used concurrently or after this call
|
|
|
|
/// - `this` was not passed to another consuming function, e.g. to create a `Command`
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_dealloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_brightness_grid_dealloc(BrightnessGrid* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the current value at the specified position.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
/// - `x` and `y`: position of the cell to read
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When accessing `x` or `y` out of bounds.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BrightnessGrid`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern byte sp_brightness_grid_get(BrightnessGrid* @this, nuint x, nuint y);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the value of the specified position in the `BrightnessGrid`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to write to
|
|
|
|
/// - `x` and `y`: position of the cell
|
|
|
|
/// - `value`: the value to write to the cell
|
|
|
|
///
|
|
|
|
/// returns: old value of the cell
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// - When accessing `x` or `y` out of bounds.
|
|
|
|
/// - When providing an invalid brightness value
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// - `this` is not written to or read from concurrently
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_brightness_grid_set(BrightnessGrid* @this, nuint x, nuint y, byte value);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the value of all cells in the `BrightnessGrid`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to write to
|
|
|
|
/// - `value`: the value to set all cells to
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// - When providing an invalid brightness value
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BrightnessGrid`
|
|
|
|
/// - `this` is not written to or read from concurrently
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_brightness_grid_fill(BrightnessGrid* @this, byte value);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the width of the `BrightnessGrid` instance.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BrightnessGrid`
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_width", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern nuint sp_brightness_grid_width(BrightnessGrid* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the height of the `BrightnessGrid` instance.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BrightnessGrid`
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_height", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern nuint sp_brightness_grid_height(BrightnessGrid* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets an unsafe reference to the data of the `BrightnessGrid` instance.
|
|
|
|
///
|
|
|
|
/// ## Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BrightnessGrid`
|
|
|
|
/// - the returned memory range is never accessed after the passed `BrightnessGrid` has been freed
|
|
|
|
/// - the returned memory range is never accessed concurrently, either via the `BrightnessGrid` or directly
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_unsafe_data_ref", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern ByteSlice sp_brightness_grid_unsafe_data_ref(BrightnessGrid* @this);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new `Cp437Grid` with the specified dimensions.
|
|
|
|
///
|
|
|
|
/// returns: `Cp437Grid` initialized to 0.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_cp437_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Cp437Grid* sp_cp437_grid_new(nuint width, nuint height);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Loads a `Cp437Grid` with the specified dimensions from the provided data.
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When the provided `data_length` is not sufficient for the `height` and `width`
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `data` points to a valid memory location of at least `data_length`
|
|
|
|
/// bytes in size.
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_cp437_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Cp437Grid* sp_cp437_grid_load(nuint width, nuint height, byte* data, nuint data_length);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Clones a `Cp437Grid`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Cp437Grid`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_cp437_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Cp437Grid* sp_cp437_grid_clone(Cp437Grid* @this);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Deallocates a `Cp437Grid`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Cp437Grid`
|
|
|
|
/// - `this` is not used concurrently or after this call
|
|
|
|
/// - `this` was not passed to another consuming function, e.g. to create a `Command`
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_dealloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_cp437_grid_dealloc(Cp437Grid* @this);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the current value at the specified position.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
/// - `x` and `y`: position of the cell to read
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When accessing `x` or `y` out of bounds.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Cp437Grid`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern byte sp_cp437_grid_get(Cp437Grid* @this, nuint x, nuint y);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the value of the specified position in the `Cp437Grid`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to write to
|
|
|
|
/// - `x` and `y`: position of the cell
|
|
|
|
/// - `value`: the value to write to the cell
|
|
|
|
///
|
|
|
|
/// returns: old value of the cell
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When accessing `x` or `y` out of bounds.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `BitVec`
|
|
|
|
/// - `this` is not written to or read from concurrently
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_cp437_grid_set(Cp437Grid* @this, nuint x, nuint y, byte value);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the value of all cells in the `Cp437Grid`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to write to
|
|
|
|
/// - `value`: the value to set all cells to
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Cp437Grid`
|
|
|
|
/// - `this` is not written to or read from concurrently
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_cp437_grid_fill(Cp437Grid* @this, byte value);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the width of the `Cp437Grid` instance.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Cp437Grid`
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_width", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern nuint sp_cp437_grid_width(Cp437Grid* @this);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the height of the `Cp437Grid` instance.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Cp437Grid`
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_height", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern nuint sp_cp437_grid_height(Cp437Grid* @this);
|
2024-06-23 15:42:15 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets an unsafe reference to the data of the `Cp437Grid` instance.
|
|
|
|
///
|
|
|
|
/// ## Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Cp437Grid`
|
|
|
|
/// - the returned memory range is never accessed after the passed `Cp437Grid` has been freed
|
|
|
|
/// - the returned memory range is never accessed concurrently, either via the `Cp437Grid` or directly
|
|
|
|
/// </summary>
|
2024-06-23 15:42:15 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_unsafe_data_ref", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern ByteSlice sp_cp437_grid_unsafe_data_ref(Cp437Grid* @this);
|
2024-05-15 20:34:51 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Tries to turn a `SPPacket` into a `SPCommand`. The packet is deallocated in the process.
|
2024-08-29 20:03:07 +02:00
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Returns: pointer to new `SPCommand` instance or NULL
|
2024-08-29 20:03:07 +02:00
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// - `packet` points to a valid instance of `SPPacket`
|
2024-08-29 20:03:07 +02:00
|
|
|
/// - `packet` is not used concurrently or after this call
|
|
|
|
/// - the result is checked for NULL
|
2024-09-07 11:44:42 +02:00
|
|
|
/// - the returned `SPCommand` instance is freed in some way, either by using a consuming function or
|
2024-08-29 20:03:07 +02:00
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_try_from_packet", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_try_from_packet(Packet* packet);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Clones a `SPCommand` instance.
|
2024-08-29 20:03:07 +02:00
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid instance of `Command`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_clone(Command* original);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::Clear` instance.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Set all pixels to the off state. Does not affect brightness.
|
|
|
|
///
|
|
|
|
/// # Examples
|
|
|
|
///
|
|
|
|
/// ```C
|
|
|
|
/// sp_connection_send(connection, sp_command_clear());
|
|
|
|
/// ```
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_clear", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_clear();
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::HardReset` instance.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Kills the udp daemon on the display, which usually results in a restart.
|
|
|
|
/// Please do not send this in your normal program flow.
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_hard_reset", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_hard_reset();
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::FadeOut` instance.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_fade_out", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_fade_out();
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::Brightness` instance for setting the brightness of all tiles to the
|
|
|
|
/// same value.
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// - When the provided brightness value is out of range (0-11).
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
2024-09-05 21:15:53 +02:00
|
|
|
/// - the returned `SPCommand` instance is freed in some way, either by using a consuming function or
|
2024-08-29 20:03:07 +02:00
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_brightness", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_brightness(byte brightness);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::CharBrightness` instance.
|
2024-09-05 21:15:53 +02:00
|
|
|
/// The passed `SPBrightnessGrid` gets consumed.
|
2024-08-29 20:03:07 +02:00
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Set the brightness of individual tiles in a rectangular area of the display.
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
2024-09-05 21:15:53 +02:00
|
|
|
/// - `grid` points to a valid instance of `SPBrightnessGrid`
|
|
|
|
/// - `grid` is not used concurrently or after this call
|
2024-08-29 20:03:07 +02:00
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_char_brightness", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-09-05 21:15:53 +02:00
|
|
|
public static extern Command* sp_command_char_brightness(nuint x, nuint y, BrightnessGrid* grid);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::BitmapLinear` instance.
|
|
|
|
/// The passed `BitVec` gets consumed.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Set pixel data starting at the pixel offset on screen.
|
|
|
|
///
|
|
|
|
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
|
|
|
|
/// once the starting row is full, overwriting will continue on column 0.
|
|
|
|
///
|
|
|
|
/// The contained `BitVec` is always uncompressed.
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `bit_vec` points to a valid instance of `BitVec`
|
|
|
|
/// - `bit_vec` is not used concurrently or after this call
|
|
|
|
/// - `compression` matches one of the allowed enum values
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_bitmap_linear(nuint offset, BitVec* bit_vec, CompressionCode compression);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::BitmapLinearAnd` instance.
|
|
|
|
/// The passed `BitVec` gets consumed.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Set pixel data according to an and-mask starting at the offset.
|
|
|
|
///
|
|
|
|
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
|
|
|
|
/// once the starting row is full, overwriting will continue on column 0.
|
|
|
|
///
|
|
|
|
/// The contained `BitVec` is always uncompressed.
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `bit_vec` points to a valid instance of `BitVec`
|
|
|
|
/// - `bit_vec` is not used concurrently or after this call
|
|
|
|
/// - `compression` matches one of the allowed enum values
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear_and", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_bitmap_linear_and(nuint offset, BitVec* bit_vec, CompressionCode compression);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::BitmapLinearOr` instance.
|
|
|
|
/// The passed `BitVec` gets consumed.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Set pixel data according to an or-mask starting at the offset.
|
|
|
|
///
|
|
|
|
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
|
|
|
|
/// once the starting row is full, overwriting will continue on column 0.
|
|
|
|
///
|
|
|
|
/// The contained `BitVec` is always uncompressed.
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `bit_vec` points to a valid instance of `BitVec`
|
|
|
|
/// - `bit_vec` is not used concurrently or after this call
|
|
|
|
/// - `compression` matches one of the allowed enum values
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear_or", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_bitmap_linear_or(nuint offset, BitVec* bit_vec, CompressionCode compression);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::BitmapLinearXor` instance.
|
|
|
|
/// The passed `BitVec` gets consumed.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Set pixel data according to a xor-mask starting at the offset.
|
|
|
|
///
|
|
|
|
/// The screen will continuously overwrite more pixel data without regarding the offset, meaning
|
|
|
|
/// once the starting row is full, overwriting will continue on column 0.
|
|
|
|
///
|
|
|
|
/// The contained `BitVec` is always uncompressed.
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `bit_vec` points to a valid instance of `BitVec`
|
|
|
|
/// - `bit_vec` is not used concurrently or after this call
|
|
|
|
/// - `compression` matches one of the allowed enum values
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear_xor", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_bitmap_linear_xor(nuint offset, BitVec* bit_vec, CompressionCode compression);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::Cp437Data` instance.
|
|
|
|
/// The passed `ByteGrid` gets consumed.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Show text on the screen.
|
|
|
|
///
|
|
|
|
/// <div class="warning">
|
|
|
|
/// The library does not currently convert between UTF-8 and CP-437.
|
|
|
|
/// Because Rust expects UTF-8 strings, it might be necessary to only send ASCII for now.
|
|
|
|
/// </div>
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `byte_grid` points to a valid instance of `ByteGrid`
|
|
|
|
/// - `byte_grid` is not used concurrently or after this call
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_cp437_data", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_cp437_data(nuint x, nuint y, Cp437Grid* byte_grid);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Allocates a new `Command::BitmapLinearWin` instance.
|
|
|
|
/// The passed `PixelGrid` gets consumed.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// Sets a window of pixels to the specified values
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `pixel_grid` points to a valid instance of `PixelGrid`
|
|
|
|
/// - `pixel_grid` is not used concurrently or after this call
|
|
|
|
/// - `compression` matches one of the allowed enum values
|
|
|
|
/// - the returned `Command` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_command_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear_win", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern Command* sp_command_bitmap_linear_win(nuint x, nuint y, PixelGrid* pixel_grid, CompressionCode compression_code);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Deallocates a `Command`.
|
|
|
|
///
|
2024-09-07 11:44:42 +02:00
|
|
|
/// # Examples
|
|
|
|
///
|
|
|
|
/// ```C
|
|
|
|
/// SPCommand c = sp_command_clear();
|
|
|
|
/// sp_command_dealloc(c);
|
|
|
|
/// ```
|
|
|
|
///
|
2024-08-29 20:03:07 +02:00
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Command`
|
|
|
|
/// - `this` is not used concurrently or after this call
|
|
|
|
/// - `this` was not passed to another consuming function, e.g. to create a `Packet`
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_command_dealloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern void sp_command_dealloc(Command* ptr);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new instance of `Connection`.
|
|
|
|
///
|
|
|
|
/// returns: NULL if connection fails, or connected instance
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// Bad string encoding
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_connection_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_connection_open", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern Connection* sp_connection_open(byte* host);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sends a `Packet` to the display using the `Connection`.
|
|
|
|
/// The passed `Packet` gets consumed.
|
|
|
|
///
|
|
|
|
/// returns: true in case of success
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `connection` points to a valid instance of `Connection`
|
|
|
|
/// - `packet` points to a valid instance of `Packet`
|
|
|
|
/// - `packet` is not used concurrently or after this call
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_connection_send", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-05-13 00:17:40 +02:00
|
|
|
[return: MarshalAs(UnmanagedType.U1)]
|
2024-05-28 21:28:42 +02:00
|
|
|
public static extern bool sp_connection_send(Connection* connection, Packet* packet);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Closes and deallocates a `Connection`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Connection`
|
|
|
|
/// - `this` is not used concurrently or after this call
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_connection_dealloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern void sp_connection_dealloc(Connection* ptr);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new `PixelGrid` with the specified dimensions.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `width`: size in pixels in x-direction
|
|
|
|
/// - `height`: size in pixels in y-direction
|
|
|
|
///
|
|
|
|
/// returns: `PixelGrid` initialized to all pixels off
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// - when the width is not dividable by 8
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_pixel_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern PixelGrid* sp_pixel_grid_new(nuint width, nuint height);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Loads a `PixelGrid` with the specified dimensions from the provided data.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `width`: size in pixels in x-direction
|
|
|
|
/// - `height`: size in pixels in y-direction
|
|
|
|
///
|
|
|
|
/// returns: `PixelGrid` that contains a copy of the provided data
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// - when the dimensions and data size do not match exactly.
|
|
|
|
/// - when the width is not dividable by 8
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `data` points to a valid memory location of at least `data_length` bytes in size.
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_pixel_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern PixelGrid* sp_pixel_grid_load(nuint width, nuint height, byte* data, nuint data_length);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Clones a `PixelGrid`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `PixelGrid`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_pixel_grid_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern PixelGrid* sp_pixel_grid_clone(PixelGrid* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Deallocates a `PixelGrid`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `PixelGrid`
|
|
|
|
/// - `this` is not used concurrently or after this call
|
|
|
|
/// - `this` was not passed to another consuming function, e.g. to create a `Command`
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_dealloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern void sp_pixel_grid_dealloc(PixelGrid* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the current value at the specified position in the `PixelGrid`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
/// - `x` and `y`: position of the cell to read
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When accessing `x` or `y` out of bounds.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `PixelGrid`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-05-13 00:17:40 +02:00
|
|
|
[return: MarshalAs(UnmanagedType.U1)]
|
2024-05-26 13:15:11 +02:00
|
|
|
public static extern bool sp_pixel_grid_get(PixelGrid* @this, nuint x, nuint y);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the value of the specified position in the `PixelGrid`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to write to
|
|
|
|
/// - `x` and `y`: position of the cell
|
|
|
|
/// - `value`: the value to write to the cell
|
|
|
|
///
|
|
|
|
/// returns: old value of the cell
|
|
|
|
///
|
|
|
|
/// # Panics
|
|
|
|
///
|
|
|
|
/// When accessing `x` or `y` out of bounds.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `PixelGrid`
|
|
|
|
/// - `this` is not written to or read from concurrently
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern void sp_pixel_grid_set(PixelGrid* @this, nuint x, nuint y, [MarshalAs(UnmanagedType.U1)] bool value);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the state of all pixels in the `PixelGrid`.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to write to
|
|
|
|
/// - `value`: the value to set all pixels to
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `PixelGrid`
|
|
|
|
/// - `this` is not written to or read from concurrently
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern void sp_pixel_grid_fill(PixelGrid* @this, [MarshalAs(UnmanagedType.U1)] bool value);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the width in pixels of the `PixelGrid` instance.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `PixelGrid`
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_width", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern nuint sp_pixel_grid_width(PixelGrid* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the height in pixels of the `PixelGrid` instance.
|
|
|
|
///
|
|
|
|
/// # Arguments
|
|
|
|
///
|
|
|
|
/// - `this`: instance to read from
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `PixelGrid`
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_height", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern nuint sp_pixel_grid_height(PixelGrid* @this);
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets an unsafe reference to the data of the `PixelGrid` instance.
|
|
|
|
///
|
|
|
|
/// ## Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `PixelGrid`
|
|
|
|
/// - the returned memory range is never accessed after the passed `PixelGrid` has been freed
|
|
|
|
/// - the returned memory range is never accessed concurrently, either via the `PixelGrid` or directly
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_pixel_grid_unsafe_data_ref", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public static extern ByteSlice sp_pixel_grid_unsafe_data_ref(PixelGrid* @this);
|
2024-05-15 20:34:51 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Turns a `Command` into a `Packet`.
|
|
|
|
/// The `Command` gets consumed.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `command` points to a valid instance of `Command`
|
|
|
|
/// - `command` is not used concurrently or after this call
|
|
|
|
/// - the returned `Packet` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_packet_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_packet_from_command", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern Packet* sp_packet_from_command(Command* command);
|
2024-05-15 20:34:51 +02:00
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Tries to load a `Packet` from the passed array with the specified length.
|
|
|
|
///
|
|
|
|
/// returns: NULL in case of an error, pointer to the allocated packet otherwise
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `data` points to a valid memory region of at least `length` bytes
|
|
|
|
/// - `data` is not written to concurrently
|
|
|
|
/// - the returned `Packet` instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_packet_dealloc`.
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_packet_try_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern Packet* sp_packet_try_load(byte* data, nuint length);
|
2024-05-15 20:34:51 +02:00
|
|
|
|
2024-09-05 21:15:53 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Clones a `Packet`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Packet`
|
|
|
|
/// - `this` is not written to concurrently
|
|
|
|
/// - the returned instance is freed in some way, either by using a consuming function or
|
|
|
|
/// by explicitly calling `sp_packet_dealloc`.
|
|
|
|
/// </summary>
|
|
|
|
[DllImport(__DllName, EntryPoint = "sp_packet_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern Packet* sp_packet_clone(Packet* @this);
|
|
|
|
|
2024-08-29 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Deallocates a `Packet`.
|
|
|
|
///
|
|
|
|
/// # Safety
|
|
|
|
///
|
|
|
|
/// The caller has to make sure that:
|
|
|
|
///
|
|
|
|
/// - `this` points to a valid `Packet`
|
|
|
|
/// - `this` is not used concurrently or after this call
|
|
|
|
/// </summary>
|
2024-05-26 13:15:11 +02:00
|
|
|
[DllImport(__DllName, EntryPoint = "sp_packet_dealloc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
|
|
public static extern void sp_packet_dealloc(Packet* @this);
|
2024-05-13 01:26:44 +02:00
|
|
|
|
2024-05-13 00:17:40 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public unsafe partial struct BitVec
|
2024-05-13 00:17:40 +02:00
|
|
|
{
|
|
|
|
}
|
2024-06-23 15:42:15 +02:00
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public unsafe partial struct BrightnessGrid
|
2024-06-23 15:42:15 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public unsafe partial struct Cp437Grid
|
2024-06-23 15:42:15 +02:00
|
|
|
{
|
|
|
|
}
|
2024-05-13 00:17:40 +02:00
|
|
|
|
2024-08-29 20:39:42 +02:00
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2024-08-29 21:40:33 +02:00
|
|
|
public unsafe partial struct Command
|
2024-08-29 20:39:42 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-13 00:17:40 +02:00
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2024-09-05 21:15:53 +02:00
|
|
|
public unsafe partial struct Connection
|
2024-05-13 00:17:40 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2024-09-05 21:15:53 +02:00
|
|
|
public unsafe partial struct PixelGrid
|
2024-05-13 00:17:40 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-15 20:34:51 +02:00
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
2024-09-05 21:15:53 +02:00
|
|
|
public unsafe partial struct ByteSlice
|
2024-05-15 20:34:51 +02:00
|
|
|
{
|
2024-09-05 21:15:53 +02:00
|
|
|
public byte* start;
|
|
|
|
public nuint length;
|
2024-05-15 20:34:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
|
public unsafe partial struct Packet
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-05-13 00:17:40 +02:00
|
|
|
|
|
|
|
public enum CompressionCode : ushort
|
|
|
|
{
|
|
|
|
Uncompressed = 0,
|
2024-05-16 21:32:33 +02:00
|
|
|
Zlib = 26490,
|
|
|
|
Bzip2 = 25210,
|
|
|
|
Lzma = 27770,
|
|
|
|
Zstd = 31347,
|
2024-05-13 00:17:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|